aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2009-08-19 02:31:59 +0000
committerStefan Monnier2009-08-19 02:31:59 +0000
commit85be9ec4fffd52d760fa820c2d7b2211093fcc3b (patch)
treedcc1c5815f581d36bbab630cd428e78e66280576
parent890429cc79e403a9afd651ef7fcff216a2def656 (diff)
downloademacs-85be9ec4fffd52d760fa820c2d7b2211093fcc3b.tar.gz
emacs-85be9ec4fffd52d760fa820c2d7b2211093fcc3b.zip
(choose-completion-string): Don't rely on minibuffer-completing-file-name
and ad-hoc checks to decide whether to continue completion or not.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/simple.el34
2 files changed, 24 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ad3d029edd7..930defaae02 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
12009-08-19 Stefan Monnier <monnier@iro.umontreal.ca> 12009-08-19 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * simple.el (choose-completion-string): Don't rely on
4 minibuffer-completing-file-name and ad-hoc checks to decide whether
5 to continue completion or not.
6
3 * minibuffer.el (minibuffer-hide-completions): New function. 7 * minibuffer.el (minibuffer-hide-completions): New function.
4 (completion--do-completion): Use it. 8 (completion--do-completion): Use it.
5 (completions-annotations): New face. 9 (completions-annotations): New face.
diff --git a/lisp/simple.el b/lisp/simple.el
index a01073c5d70..c8e537cdf50 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -368,7 +368,7 @@ select the source buffer."
368 (interactive "p") 368 (interactive "p")
369 (next-error-no-select (- (or n 1)))) 369 (next-error-no-select (- (or n 1))))
370 370
371;;; Internal variable for `next-error-follow-mode-post-command-hook'. 371;; Internal variable for `next-error-follow-mode-post-command-hook'.
372(defvar next-error-follow-last-line nil) 372(defvar next-error-follow-last-line nil)
373 373
374(define-minor-mode next-error-follow-minor-mode 374(define-minor-mode next-error-follow-minor-mode
@@ -382,8 +382,8 @@ location."
382 (add-hook 'post-command-hook 'next-error-follow-mode-post-command-hook nil t) 382 (add-hook 'post-command-hook 'next-error-follow-mode-post-command-hook nil t)
383 (make-local-variable 'next-error-follow-last-line))) 383 (make-local-variable 'next-error-follow-last-line)))
384 384
385;;; Used as a `post-command-hook' by `next-error-follow-mode' 385;; Used as a `post-command-hook' by `next-error-follow-mode'
386;;; for the *Compilation* *grep* and *Occur* buffers. 386;; for the *Compilation* *grep* and *Occur* buffers.
387(defun next-error-follow-mode-post-command-hook () 387(defun next-error-follow-mode-post-command-hook ()
388 (unless (equal next-error-follow-last-line (line-number-at-pos)) 388 (unless (equal next-error-follow-last-line (line-number-at-pos))
389 (setq next-error-follow-last-line (line-number-at-pos)) 389 (setq next-error-follow-last-line (line-number-at-pos))
@@ -4475,8 +4475,8 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
4475 (/= arg 1) t nil))))) 4475 (/= arg 1) t nil)))))
4476 4476
4477 4477
4478;;; Many people have said they rarely use this feature, and often type 4478;; Many people have said they rarely use this feature, and often type
4479;;; it by accident. Maybe it shouldn't even be on a key. 4479;; it by accident. Maybe it shouldn't even be on a key.
4480(put 'set-goal-column 'disabled t) 4480(put 'set-goal-column 'disabled t)
4481 4481
4482(defun set-goal-column (arg) 4482(defun set-goal-column (arg)
@@ -5855,13 +5855,19 @@ to decide what to delete."
5855 minibuffer-completion-table 5855 minibuffer-completion-table
5856 ;; If this is reading a file name, and the file name chosen 5856 ;; If this is reading a file name, and the file name chosen
5857 ;; is a directory, don't exit the minibuffer. 5857 ;; is a directory, don't exit the minibuffer.
5858 (if (and minibuffer-completing-file-name 5858 (let* ((result (buffer-substring (field-beginning) (point)))
5859 (file-directory-p (field-string (point-max)))) 5859 (bounds
5860 (let ((mini (active-minibuffer-window))) 5860 (completion-boundaries result minibuffer-completion-table
5861 (select-window mini) 5861 minibuffer-completion-predicate
5862 (when minibuffer-auto-raise 5862 "")))
5863 (raise-frame (window-frame mini)))) 5863 (if (eq (car bounds) (length result))
5864 (exit-minibuffer))))))) 5864 ;; The completion chosen leads to a new set of completions
5865 ;; (e.g. it's a directory): don't exit the minibuffer yet.
5866 (let ((mini (active-minibuffer-window)))
5867 (select-window mini)
5868 (when minibuffer-auto-raise
5869 (raise-frame (window-frame mini))))
5870 (exit-minibuffer))))))))
5865 5871
5866(define-derived-mode completion-list-mode nil "Completion List" 5872(define-derived-mode completion-list-mode nil "Completion List"
5867 "Major mode for buffers showing lists of possible completions. 5873 "Major mode for buffers showing lists of possible completions.
@@ -6319,8 +6325,8 @@ have both Backspace, Delete and F1 keys.
6319See also `normal-erase-is-backspace'." 6325See also `normal-erase-is-backspace'."
6320 (interactive "P") 6326 (interactive "P")
6321 (let ((enabled (or (and arg (> (prefix-numeric-value arg) 0)) 6327 (let ((enabled (or (and arg (> (prefix-numeric-value arg) 0))
6322 (and (not arg) 6328 (not (or arg
6323 (not (eq 1 (terminal-parameter 6329 (eq 1 (terminal-parameter
6324 nil 'normal-erase-is-backspace))))))) 6330 nil 'normal-erase-is-backspace)))))))
6325 (set-terminal-parameter nil 'normal-erase-is-backspace 6331 (set-terminal-parameter nil 'normal-erase-is-backspace
6326 (if enabled 1 0)) 6332 (if enabled 1 0))