mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-23 07:19:15 +00:00
(widget-narrow-to-field): New function.
(widget-complete): Use it.
This commit is contained in:
parent
77cafc7a48
commit
301f9235f6
@ -1085,14 +1085,23 @@ the field."
|
||||
:type 'function
|
||||
:group 'widgets)
|
||||
|
||||
(defun widget-narrow-to-field ()
|
||||
"Narrow to field"
|
||||
(interactive)
|
||||
(let ((field (widget-field-find (point))))
|
||||
(if field
|
||||
(narrow-to-region (line-beginning-position) (line-end-position)))))
|
||||
|
||||
(defun widget-complete ()
|
||||
"Complete content of editable field from point.
|
||||
When not inside a field, move to the previous button or field."
|
||||
(interactive)
|
||||
(let ((field (widget-field-find (point))))
|
||||
(if field
|
||||
(widget-apply field :complete)
|
||||
(error "Not in an editable field"))))
|
||||
(save-restriction
|
||||
(widget-narrow-to-field)
|
||||
(widget-apply field :complete))
|
||||
(error "Not in an editable field"))))
|
||||
|
||||
;;; Setting up the buffer.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user