summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2001-10-05 12:26:27 +0000
committerMiles Bader <miles@gnu.org>2001-10-05 12:26:27 +0000
commit8bbb7c706012dfab0997a55e32ca59f3631cf942 (patch)
treec8a441a453e4d6a59319dccfc18b43457bb9305c
parenta346ec72156de1ba197ee2256f721255ee2c6623 (diff)
downloademacs-8bbb7c706012dfab0997a55e32ca59f3631cf942.tar.gz
(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.el11
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 @@
;;; minibuf-eldef.el --- Only show defaults in prompts when applicable
;;
-;; Copyright (C) 2000 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2001 Free Software Foundation, Inc.
;;
;; Author: Miles Bader <miles@gnu.org>
;; Keywords: convenience
@@ -76,15 +76,14 @@ regexp subexpression that matched.")
(defun minibuf-eldef-setup-minibuffer ()
"Set up a minibuffer for `minibuffer-electric-default-mode'.
The prompt and initial input should already have been inserted."
- (let ((prompt (field-string-no-properties (point-min)))
- (regexps minibuffer-default-in-prompt-regexps)
+ (let ((regexps minibuffer-default-in-prompt-regexps)
(match nil)
(inhibit-point-motion-hooks t))
(save-excursion
(save-restriction
;; Narrow to only the prompt
(goto-char (point-min))
- (narrow-to-region (point) (field-end))
+ (narrow-to-region (point) (minibuffer-prompt-end))
;; See the prompt contains a default input indicator
(while regexps
(setq match (pop regexps))
@@ -101,7 +100,7 @@ The prompt and initial input should already have been inserted."
(make-overlay (match-beginning match) (match-end match)))
(setq minibuf-eldef-showing-default-in-prompt t)
(setq minibuf-eldef-initial-input
- (field-string-no-properties (point-max)))
+ (minibuffer-contents-no-properties))
(setq minibuf-eldef-initial-buffer-length (point-max))
(add-to-list 'minibuf-eldef-frobbed-minibufs (current-buffer))
(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
been set up by `minibuf-eldef-setup-minibuffer'."
(unless (eq minibuf-eldef-showing-default-in-prompt
(and (= (point-max) minibuf-eldef-initial-buffer-length)
- (string-equal (field-string-no-properties (point-max))
+ (string-equal (minibuffer-contents-no-properties)
minibuf-eldef-initial-input)))
;; swap state
(setq minibuf-eldef-showing-default-in-prompt