Commit a9e3ff69 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(completion-setup-function):

Only modify the default-directory in *Completions* (bug#3250).
Take partial-completion into account when setting default-directory.
parent 9cb363db
2009-05-11 Stefan Monnier <monnier@iro.umontreal.ca>
* simple.el (completion-setup-function):
Only modify the default-directory in *Completions* (bug#3250).
Take partial-completion into account when setting default-directory.
2009-05-10 Chong Yidong <cyd@stupidchicken.com> 2009-05-10 Chong Yidong <cyd@stupidchicken.com>
   
* emacs-lisp/cl-macs.el (lexical-let*): Doc fix (Bug#3178). * emacs-lisp/cl-macs.el (lexical-let*): Doc fix (Bug#3178).
...@@ -16,26 +22,22 @@ ...@@ -16,26 +22,22 @@
   
2009-05-08 Kenichi Handa <handa@m17n.org> 2009-05-08 Kenichi Handa <handa@m17n.org>
   
* international/encoded-kb.el (encoded-kbd-setup-keymap): Fix for * international/encoded-kb.el (encoded-kbd-setup-keymap):
big5. * international/mule-diag.el (describe-coding-system): Fix for big5.
* international/mule-diag.el (describe-coding-system): Fix for
big5.
   
2009-05-07 Martin Rudalics <rudalics@gmx.at> 2009-05-07 Martin Rudalics <rudalics@gmx.at>
   
* window.el (split-window-sensibly): New function. * window.el (split-window-sensibly): New function.
(split-height-threshold, split-width-threshold): State in (split-height-threshold, split-width-threshold): State in
doc-string that these affect split-window-sensibly. Change doc-string that these affect split-window-sensibly.
customization subtype from number to integer. Change customization subtype from number to integer.
(window--splittable-p): Rename to window-splittable-p since it's (window--splittable-p): Rename to window-splittable-p since it's
referred to in doc-string of split-window-sensibly. Update referred to in doc-string of split-window-sensibly. Update doc-string.
doc-string.
(window--try-to-split-window): Unconditionally call (window--try-to-split-window): Unconditionally call
split-window-preferred-function and move splitting functionality split-window-preferred-function and move splitting functionality
to split-window-sensibly (Bug#3142). to split-window-sensibly (Bug#3142).
(split-window-preferred-function): Rewrite doc-string. Don't (split-window-preferred-function): Rewrite doc-string.
allow nil as customization type. Don't allow nil as customization type.
   
2009-05-07 Chong Yidong <cyd@stupidchicken.com> 2009-05-07 Chong Yidong <cyd@stupidchicken.com>
   
...@@ -104,8 +106,8 @@ ...@@ -104,8 +106,8 @@
* progmodes/cc-langs.el (c-constant-kwds): New ObjC keywords * progmodes/cc-langs.el (c-constant-kwds): New ObjC keywords
"YES", "NO", "NS_DURING", "NS_HANDLER", "NS_ENDHANDLER". "YES", "NO", "NS_DURING", "NS_HANDLER", "NS_ENDHANDLER".
   
* progmodes/cc-align.el (c-lineup-ObjC-method-call-colons): New * progmodes/cc-align.el (c-lineup-ObjC-method-call-colons):
function. New function.
   
2009-04-29 Chong Yidong <cyd@stupidchicken.com> 2009-04-29 Chong Yidong <cyd@stupidchicken.com>
   
...@@ -114,8 +116,8 @@ ...@@ -114,8 +116,8 @@
2009-04-29 Ulrich Mueller <ulm@gentoo.org> 2009-04-29 Ulrich Mueller <ulm@gentoo.org>
   
* files.el (hack-local-variables-prop-line) * files.el (hack-local-variables-prop-line)
(hack-local-variables, dir-locals-read-from-file): Bind (hack-local-variables, dir-locals-read-from-file):
read-circle to nil before reading. Bind read-circle to nil before reading.
   
2009-04-28 Geert Kloosterman <g.j.kloosterman@gmail.com> (tiny change) 2009-04-28 Geert Kloosterman <g.j.kloosterman@gmail.com> (tiny change)
   
......
...@@ -5851,20 +5851,22 @@ Called from `temp-buffer-show-hook'." ...@@ -5851,20 +5851,22 @@ Called from `temp-buffer-show-hook'."
;; after the text of the completion list buffer is written. ;; after the text of the completion list buffer is written.
(defun completion-setup-function () (defun completion-setup-function ()
(let* ((mainbuf (current-buffer)) (let* ((mainbuf (current-buffer))
(mbuf-contents (minibuffer-completion-contents)) (base-dir
common-string-length) ;; When reading a file name in the minibuffer,
;; When reading a file name in the minibuffer, ;; try and find the right default-directory to set in the
;; set default-directory in the minibuffer ;; completion list buffer.
;; so it will get copied into the completion list buffer. ;; FIXME: Why do we do that, actually? --Stef
(if minibuffer-completing-file-name (if minibuffer-completing-file-name
(with-current-buffer mainbuf (file-name-as-directory
(setq default-directory (expand-file-name
(file-name-directory (expand-file-name mbuf-contents))))) (substring (minibuffer-completion-contents)
0 (or completion-base-size 0)))))))
(with-current-buffer standard-output (with-current-buffer standard-output
(let ((base-size completion-base-size)) ;Read before killing localvars. (let ((base-size completion-base-size)) ;Read before killing localvars.
(completion-list-mode) (completion-list-mode)
(set (make-local-variable 'completion-base-size) base-size)) (set (make-local-variable 'completion-base-size) base-size))
(set (make-local-variable 'completion-reference-buffer) mainbuf) (set (make-local-variable 'completion-reference-buffer) mainbuf)
(if base-dir (setq default-directory base-dir))
(unless completion-base-size (unless completion-base-size
;; This shouldn't be needed any more, but further analysis is needed ;; This shouldn't be needed any more, but further analysis is needed
;; to make sure it's the case. ;; to make sure it's the case.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment