aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/ChangeLog14
-rw-r--r--lisp/minibuffer.el18
-rw-r--r--lisp/pcmpl-gnu.el4
-rw-r--r--lisp/progmodes/elisp-mode.el2
-rw-r--r--lisp/progmodes/octave.el14
6 files changed, 38 insertions, 19 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 9786f3a6698..f3890a51aad 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -363,6 +363,11 @@ helper functions) obsolete.
363 363
364* Incompatible Lisp Changes in Emacs 25.1 364* Incompatible Lisp Changes in Emacs 25.1
365 365
366** completion-table-dynamic stays in the minibuffer.
367If you want the old behavior of calling the function in the buffer
368from which the minibuffer was entered, call it with the new argument
369`switch-buffer'.
370
366** window-configurations no longer record the buffers's marks. 371** window-configurations no longer record the buffers's marks.
367 372
368** inhibit-modification-hooks now also inhibits lock-file checks, as well as 373** inhibit-modification-hooks now also inhibits lock-file checks, as well as
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b79b918dc77..a70917e7b92 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
12014-12-03 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * minibuffer.el (completion-table-dynamic): Add arg `switch-buffer'
4 and change default to stay in the minibuffer when called from
5 the minibuffer (bug#19250).
6 (lazy-completion-table): Use this new argument to preserve the
7 old behavior.
8
9 * progmodes/elisp-mode.el (elisp--local-variables): Don't burp on
10 incorrect lexical elements (bug#19250).
11
12014-12-03 Eric S. Raymond <esr@snark.thyrsus.com> 122014-12-03 Eric S. Raymond <esr@snark.thyrsus.com>
2 13
3 * files.el (file-tree-walk): Lisp translation of ANSI ftw(3). 14 * files.el (file-tree-walk): Lisp translation of ANSI ftw(3).
@@ -23,8 +34,7 @@
23 * vc-hooks.el: Bind vc-delete-file to Ctrl-x v delete. 34 * vc-hooks.el: Bind vc-delete-file to Ctrl-x v delete.
24 35
25 * vc.el (vc-expand-dirs): Now takes a second BACKEND argument, 36 * vc.el (vc-expand-dirs): Now takes a second BACKEND argument,
26 improving behavior on directories using multiple file-oriented 37 improving behavior on directories using multiple file-oriented VCSes.
27 VCSes.
28 38
29 * vc/vc.el and all backends: API simplification; clear-headers 39 * vc/vc.el and all backends: API simplification; clear-headers
30 is no longer a public method. It is now local to the one place 40 is no longer a public method. It is now local to the one place
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index c9ce381c87b..0bee13b155c 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -169,13 +169,15 @@ ACTION can be one of nil, t or `lambda'."
169 (t 'test-completion)) 169 (t 'test-completion))
170 string table pred)))) 170 string table pred))))
171 171
172(defun completion-table-dynamic (fun) 172(defun completion-table-dynamic (fun &optional switch-buffer)
173 "Use function FUN as a dynamic completion table. 173 "Use function FUN as a dynamic completion table.
174FUN is called with one argument, the string for which completion is required, 174FUN is called with one argument, the string for which completion is required,
175and it should return an alist containing all the intended possible completions. 175and it should return an alist containing all the intended possible completions.
176This alist may be a full list of possible completions so that FUN can ignore 176This alist may be a full list of possible completions so that FUN can ignore
177the value of its argument. If completion is performed in the minibuffer, 177the value of its argument.
178FUN will be called in the buffer from which the minibuffer was entered. 178If SWITCH-BUFFER is non-nil and completion is performed in the
179minibuffer, FUN will be called in the buffer from which the minibuffer
180was entered.
179 181
180The result of the `completion-table-dynamic' form is a function 182The result of the `completion-table-dynamic' form is a function
181that can be used as the COLLECTION argument to `try-completion' and 183that can be used as the COLLECTION argument to `try-completion' and
@@ -187,9 +189,10 @@ See also the related function `completion-table-with-cache'."
187 ;; `fun' is not supposed to return another function but a plain old 189 ;; `fun' is not supposed to return another function but a plain old
188 ;; completion table, whose boundaries are always trivial. 190 ;; completion table, whose boundaries are always trivial.
189 nil 191 nil
190 (with-current-buffer (let ((win (minibuffer-selected-window))) 192 (with-current-buffer (if (not switch-buffer) (current-buffer)
191 (if (window-live-p win) (window-buffer win) 193 (let ((win (minibuffer-selected-window)))
192 (current-buffer))) 194 (if (window-live-p win) (window-buffer win)
195 (current-buffer))))
193 (complete-with-action action (funcall fun string) string pred))))) 196 (complete-with-action action (funcall fun string) string pred)))))
194 197
195(defun completion-table-with-cache (fun &optional ignore-case) 198(defun completion-table-with-cache (fun &optional ignore-case)
@@ -228,7 +231,8 @@ You should give VAR a non-nil `risky-local-variable' property."
228 (lambda (,str) 231 (lambda (,str)
229 (when (functionp ,var) 232 (when (functionp ,var)
230 (setq ,var (funcall #',fun))) 233 (setq ,var (funcall #',fun)))
231 ,var)))) 234 ,var)
235 'do-switch-buffer)))
232 236
233(defun completion-table-case-fold (table &optional dont-fold) 237(defun completion-table-case-fold (table &optional dont-fold)
234 "Return new completion TABLE that is case insensitive. 238 "Return new completion TABLE that is case insensitive.
diff --git a/lisp/pcmpl-gnu.el b/lisp/pcmpl-gnu.el
index bcab1f7cb5b..3d769b1fffa 100644
--- a/lisp/pcmpl-gnu.el
+++ b/lisp/pcmpl-gnu.el
@@ -323,8 +323,8 @@
323 (let ((file (pcomplete-arg 1))) 323 (let ((file (pcomplete-arg 1)))
324 (completion-table-dynamic 324 (completion-table-dynamic
325 (lambda (_string) 325 (lambda (_string)
326 (pcmpl-gnu-with-file-buffer file 326 (pcmpl-gnu-with-file-buffer
327 (mapcar #'tar-header-name tar-parse-info))))) 327 file (mapcar #'tar-header-name tar-parse-info)))))
328 (pcomplete-entries)) 328 (pcomplete-entries))
329 nil 'identity)))) 329 nil 'identity))))
330 330
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 2be81a57ebe..ba70f903b4b 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -293,7 +293,7 @@ Blank lines separate paragraphs. Semicolons start comments.
293 (let* ((sexp (condition-case nil 293 (let* ((sexp (condition-case nil
294 (car (read-from-string 294 (car (read-from-string
295 (concat txt "elisp--witness--lisp" closer))) 295 (concat txt "elisp--witness--lisp" closer)))
296 (end-of-file nil))) 296 ((invalid-read-syntax end-of-file) nil)))
297 (macroexpand-advice (lambda (expander form &rest args) 297 (macroexpand-advice (lambda (expander form &rest args)
298 (condition-case nil 298 (condition-case nil
299 (apply expander form args) 299 (apply expander form args)
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index 25b081545a3..7d963635bc0 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -45,13 +45,13 @@
45 (defun completion-table-with-cache (fun &optional ignore-case) 45 (defun completion-table-with-cache (fun &optional ignore-case)
46 ;; See eg bug#11906. 46 ;; See eg bug#11906.
47 (let* (last-arg last-result 47 (let* (last-arg last-result
48 (new-fun 48 (new-fun
49 (lambda (arg) 49 (lambda (arg)
50 (if (and last-arg (string-prefix-p last-arg arg ignore-case)) 50 (if (and last-arg (string-prefix-p last-arg arg ignore-case))
51 last-result 51 last-result
52 (prog1 52 (prog1
53 (setq last-result (funcall fun arg)) 53 (setq last-result (funcall fun arg))
54 (setq last-arg arg)))))) 54 (setq last-arg arg))))))
55 (completion-table-dynamic new-fun))))) 55 (completion-table-dynamic new-fun)))))
56(eval-when-compile 56(eval-when-compile
57 (unless (fboundp 'setq-local) 57 (unless (fboundp 'setq-local)