# HG changeset patch # User Stefan Monnier # Date 1242056144 0 # Node ID 0f518b180240a3ac42f481ce3032b00dbbcd5723 # Parent 1bf70050c13e240e3d13f808212ff4f2884517d7 (completion-setup-function): Only modify the default-directory in *Completions* (bug#3250). Take partial-completion into account when setting default-directory. diff -r 1bf70050c13e -r 0f518b180240 lisp/ChangeLog --- a/lisp/ChangeLog Mon May 11 09:30:34 2009 +0000 +++ b/lisp/ChangeLog Mon May 11 15:35:44 2009 +0000 @@ -1,3 +1,9 @@ +2009-05-11 Stefan Monnier + + * 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 * emacs-lisp/cl-macs.el (lexical-let*): Doc fix (Bug#3178). @@ -16,26 +22,22 @@ 2009-05-08 Kenichi Handa - * international/encoded-kb.el (encoded-kbd-setup-keymap): Fix for - big5. - - * international/mule-diag.el (describe-coding-system): Fix for - big5. + * international/encoded-kb.el (encoded-kbd-setup-keymap): + * international/mule-diag.el (describe-coding-system): Fix for big5. 2009-05-07 Martin Rudalics * window.el (split-window-sensibly): New function. (split-height-threshold, split-width-threshold): State in - doc-string that these affect split-window-sensibly. Change - customization subtype from number to integer. + doc-string that these affect split-window-sensibly. + Change customization subtype from number to integer. (window--splittable-p): Rename to window-splittable-p since it's - referred to in doc-string of split-window-sensibly. Update - doc-string. + referred to in doc-string of split-window-sensibly. Update doc-string. (window--try-to-split-window): Unconditionally call split-window-preferred-function and move splitting functionality to split-window-sensibly (Bug#3142). - (split-window-preferred-function): Rewrite doc-string. Don't - allow nil as customization type. + (split-window-preferred-function): Rewrite doc-string. + Don't allow nil as customization type. 2009-05-07 Chong Yidong @@ -104,8 +106,8 @@ * progmodes/cc-langs.el (c-constant-kwds): New ObjC keywords "YES", "NO", "NS_DURING", "NS_HANDLER", "NS_ENDHANDLER". - * progmodes/cc-align.el (c-lineup-ObjC-method-call-colons): New - function. + * progmodes/cc-align.el (c-lineup-ObjC-method-call-colons): + New function. 2009-04-29 Chong Yidong @@ -114,8 +116,8 @@ 2009-04-29 Ulrich Mueller * files.el (hack-local-variables-prop-line) - (hack-local-variables, dir-locals-read-from-file): Bind - read-circle to nil before reading. + (hack-local-variables, dir-locals-read-from-file): + Bind read-circle to nil before reading. 2009-04-28 Geert Kloosterman (tiny change) diff -r 1bf70050c13e -r 0f518b180240 lisp/simple.el --- a/lisp/simple.el Mon May 11 09:30:34 2009 +0000 +++ b/lisp/simple.el Mon May 11 15:35:44 2009 +0000 @@ -5851,20 +5851,22 @@ ;; after the text of the completion list buffer is written. (defun completion-setup-function () (let* ((mainbuf (current-buffer)) - (mbuf-contents (minibuffer-completion-contents)) - common-string-length) - ;; When reading a file name in the minibuffer, - ;; set default-directory in the minibuffer - ;; so it will get copied into the completion list buffer. - (if minibuffer-completing-file-name - (with-current-buffer mainbuf - (setq default-directory - (file-name-directory (expand-file-name mbuf-contents))))) + (base-dir + ;; When reading a file name in the minibuffer, + ;; try and find the right default-directory to set in the + ;; completion list buffer. + ;; FIXME: Why do we do that, actually? --Stef + (if minibuffer-completing-file-name + (file-name-as-directory + (expand-file-name + (substring (minibuffer-completion-contents) + 0 (or completion-base-size 0))))))) (with-current-buffer standard-output (let ((base-size completion-base-size)) ;Read before killing localvars. (completion-list-mode) (set (make-local-variable 'completion-base-size) base-size)) (set (make-local-variable 'completion-reference-buffer) mainbuf) + (if base-dir (setq default-directory base-dir)) (unless completion-base-size ;; This shouldn't be needed any more, but further analysis is needed ;; to make sure it's the case.