diff options
| author | Miles Bader | 2001-10-05 12:26:27 +0000 |
|---|---|---|
| committer | Miles Bader | 2001-10-05 12:26:27 +0000 |
| commit | 8bbb7c706012dfab0997a55e32ca59f3631cf942 (patch) | |
| tree | c8a441a453e4d6a59319dccfc18b43457bb9305c | |
| parent | a346ec72156de1ba197ee2256f721255ee2c6623 (diff) | |
| download | emacs-8bbb7c706012dfab0997a55e32ca59f3631cf942.tar.gz emacs-8bbb7c706012dfab0997a55e32ca59f3631cf942.zip | |
(minibuf-eldef-setup-minibuffer)
(minibuf-eldef-update-minibuffer): Use `minibuffer-' functions
instead of calling `field-' functions directly.
(minibuf-eldef-setup-minibuffer): Remove unused variable `prompt'.
| -rw-r--r-- | lisp/minibuf-eldef.el | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lisp/minibuf-eldef.el b/lisp/minibuf-eldef.el index 866869d99c7..a0fb127c9f0 100644 --- a/lisp/minibuf-eldef.el +++ b/lisp/minibuf-eldef.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; minibuf-eldef.el --- Only show defaults in prompts when applicable | 1 | ;;; minibuf-eldef.el --- Only show defaults in prompts when applicable |
| 2 | ;; | 2 | ;; |
| 3 | ;; Copyright (C) 2000 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2000, 2001 Free Software Foundation, Inc. |
| 4 | ;; | 4 | ;; |
| 5 | ;; Author: Miles Bader <miles@gnu.org> | 5 | ;; Author: Miles Bader <miles@gnu.org> |
| 6 | ;; Keywords: convenience | 6 | ;; Keywords: convenience |
| @@ -76,15 +76,14 @@ regexp subexpression that matched.") | |||
| 76 | (defun minibuf-eldef-setup-minibuffer () | 76 | (defun minibuf-eldef-setup-minibuffer () |
| 77 | "Set up a minibuffer for `minibuffer-electric-default-mode'. | 77 | "Set up a minibuffer for `minibuffer-electric-default-mode'. |
| 78 | The prompt and initial input should already have been inserted." | 78 | The prompt and initial input should already have been inserted." |
| 79 | (let ((prompt (field-string-no-properties (point-min))) | 79 | (let ((regexps minibuffer-default-in-prompt-regexps) |
| 80 | (regexps minibuffer-default-in-prompt-regexps) | ||
| 81 | (match nil) | 80 | (match nil) |
| 82 | (inhibit-point-motion-hooks t)) | 81 | (inhibit-point-motion-hooks t)) |
| 83 | (save-excursion | 82 | (save-excursion |
| 84 | (save-restriction | 83 | (save-restriction |
| 85 | ;; Narrow to only the prompt | 84 | ;; Narrow to only the prompt |
| 86 | (goto-char (point-min)) | 85 | (goto-char (point-min)) |
| 87 | (narrow-to-region (point) (field-end)) | 86 | (narrow-to-region (point) (minibuffer-prompt-end)) |
| 88 | ;; See the prompt contains a default input indicator | 87 | ;; See the prompt contains a default input indicator |
| 89 | (while regexps | 88 | (while regexps |
| 90 | (setq match (pop regexps)) | 89 | (setq match (pop regexps)) |
| @@ -101,7 +100,7 @@ The prompt and initial input should already have been inserted." | |||
| 101 | (make-overlay (match-beginning match) (match-end match))) | 100 | (make-overlay (match-beginning match) (match-end match))) |
| 102 | (setq minibuf-eldef-showing-default-in-prompt t) | 101 | (setq minibuf-eldef-showing-default-in-prompt t) |
| 103 | (setq minibuf-eldef-initial-input | 102 | (setq minibuf-eldef-initial-input |
| 104 | (field-string-no-properties (point-max))) | 103 | (minibuffer-contents-no-properties)) |
| 105 | (setq minibuf-eldef-initial-buffer-length (point-max)) | 104 | (setq minibuf-eldef-initial-buffer-length (point-max)) |
| 106 | (add-to-list 'minibuf-eldef-frobbed-minibufs (current-buffer)) | 105 | (add-to-list 'minibuf-eldef-frobbed-minibufs (current-buffer)) |
| 107 | (add-hook 'post-command-hook #'minibuf-eldef-update-minibuffer nil t)))) | 106 | (add-hook 'post-command-hook #'minibuf-eldef-update-minibuffer nil t)))) |
| @@ -114,7 +113,7 @@ This is intended to be used as a minibuffer post-command-hook for | |||
| 114 | been set up by `minibuf-eldef-setup-minibuffer'." | 113 | been set up by `minibuf-eldef-setup-minibuffer'." |
| 115 | (unless (eq minibuf-eldef-showing-default-in-prompt | 114 | (unless (eq minibuf-eldef-showing-default-in-prompt |
| 116 | (and (= (point-max) minibuf-eldef-initial-buffer-length) | 115 | (and (= (point-max) minibuf-eldef-initial-buffer-length) |
| 117 | (string-equal (field-string-no-properties (point-max)) | 116 | (string-equal (minibuffer-contents-no-properties) |
| 118 | minibuf-eldef-initial-input))) | 117 | minibuf-eldef-initial-input))) |
| 119 | ;; swap state | 118 | ;; swap state |
| 120 | (setq minibuf-eldef-showing-default-in-prompt | 119 | (setq minibuf-eldef-showing-default-in-prompt |