diff options
| author | Eli Zaretskii | 2004-11-27 12:50:34 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2004-11-27 12:50:34 +0000 |
| commit | 301f9235f6be9f0714bcc442fadcd42519173b4e (patch) | |
| tree | 304bbcdceb57f87b4d06ed56d37008284196ff56 | |
| parent | 77cafc7a48e688a5bfcbcce44394982a79624f57 (diff) | |
| download | emacs-301f9235f6be9f0714bcc442fadcd42519173b4e.tar.gz emacs-301f9235f6be9f0714bcc442fadcd42519173b4e.zip | |
(widget-narrow-to-field): New function.
(widget-complete): Use it.
| -rw-r--r-- | lisp/wid-edit.el | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 05ef4b95658..f659518ee02 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el | |||
| @@ -1085,14 +1085,23 @@ the field." | |||
| 1085 | :type 'function | 1085 | :type 'function |
| 1086 | :group 'widgets) | 1086 | :group 'widgets) |
| 1087 | 1087 | ||
| 1088 | (defun widget-narrow-to-field () | ||
| 1089 | "Narrow to field" | ||
| 1090 | (interactive) | ||
| 1091 | (let ((field (widget-field-find (point)))) | ||
| 1092 | (if field | ||
| 1093 | (narrow-to-region (line-beginning-position) (line-end-position))))) | ||
| 1094 | |||
| 1088 | (defun widget-complete () | 1095 | (defun widget-complete () |
| 1089 | "Complete content of editable field from point. | 1096 | "Complete content of editable field from point. |
| 1090 | When not inside a field, move to the previous button or field." | 1097 | When not inside a field, move to the previous button or field." |
| 1091 | (interactive) | 1098 | (interactive) |
| 1092 | (let ((field (widget-field-find (point)))) | 1099 | (let ((field (widget-field-find (point)))) |
| 1093 | (if field | 1100 | (if field |
| 1094 | (widget-apply field :complete) | 1101 | (save-restriction |
| 1095 | (error "Not in an editable field")))) | 1102 | (widget-narrow-to-field) |
| 1103 | (widget-apply field :complete)) | ||
| 1104 | (error "Not in an editable field")))) | ||
| 1096 | 1105 | ||
| 1097 | ;;; Setting up the buffer. | 1106 | ;;; Setting up the buffer. |
| 1098 | 1107 | ||