diff options
| author | Glenn Morris | 2010-12-02 09:36:45 -0800 |
|---|---|---|
| committer | Glenn Morris | 2010-12-02 09:36:45 -0800 |
| commit | 05907bb3aa0e68c594a0a06c5adaa75fe9817fbf (patch) | |
| tree | a18453af2d715dc254afaba8b61002f27a0da7f0 | |
| parent | bd77c2effa8ad5a557200b932a23244624dc524b (diff) | |
| download | emacs-05907bb3aa0e68c594a0a06c5adaa75fe9817fbf.tar.gz emacs-05907bb3aa0e68c594a0a06c5adaa75fe9817fbf.zip | |
cl-macs `loop' fix for bug#7492.
* lisp/emacs-lisp/cl-macs.el (cl-parse-loop-clause):
Avoid infinite loop over windows.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 13 |
2 files changed, 14 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 135cfe952c7..502a6c65f42 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2010-12-02 Glenn Morris <rgm@gnu.org> | 1 | 2010-12-02 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * emacs-lisp/cl-macs.el (cl-parse-loop-clause): | ||
| 4 | Avoid infinite loop over windows. (Bug#7492) | ||
| 5 | |||
| 3 | * progmodes/flymake.el (flymake-check-file-limit): | 6 | * progmodes/flymake.el (flymake-check-file-limit): |
| 4 | Allow nil to mean "no limit". | 7 | Allow nil to mean "no limit". |
| 5 | (flymake-check-patch-master-file-buffer): Update for above change. | 8 | (flymake-check-patch-master-file-buffer): Update for above change. |
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 76f677c6198..725b98354af 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el | |||
| @@ -965,16 +965,25 @@ Valid clauses are: | |||
| 965 | 965 | ||
| 966 | ((memq word '(window windows)) | 966 | ((memq word '(window windows)) |
| 967 | (let ((scr (and (memq (car loop-args) '(in of)) (cl-pop2 loop-args))) | 967 | (let ((scr (and (memq (car loop-args) '(in of)) (cl-pop2 loop-args))) |
| 968 | (temp (make-symbol "--cl-var--"))) | 968 | (temp (make-symbol "--cl-var--")) |
| 969 | (minip (make-symbol "--cl-minip--"))) | ||
| 969 | (push (list var (if scr | 970 | (push (list var (if scr |
| 970 | (list 'frame-selected-window scr) | 971 | (list 'frame-selected-window scr) |
| 971 | '(selected-window))) | 972 | '(selected-window))) |
| 972 | loop-for-bindings) | 973 | loop-for-bindings) |
| 974 | ;; If we started in the minibuffer, we need to | ||
| 975 | ;; ensure that next-window will bring us back there | ||
| 976 | ;; at some point. (Bug#7492). | ||
| 977 | ;; (Consider using walk-windows instead of loop if | ||
| 978 | ;; you care about such things.) | ||
| 979 | (push (list minip `(minibufferp (window-buffer ,var))) | ||
| 980 | loop-for-bindings) | ||
| 973 | (push (list temp nil) loop-for-bindings) | 981 | (push (list temp nil) loop-for-bindings) |
| 974 | (push (list 'prog1 (list 'not (list 'eq var temp)) | 982 | (push (list 'prog1 (list 'not (list 'eq var temp)) |
| 975 | (list 'or temp (list 'setq temp var))) | 983 | (list 'or temp (list 'setq temp var))) |
| 976 | loop-body) | 984 | loop-body) |
| 977 | (push (list var (list 'next-window var)) loop-for-steps))) | 985 | (push (list var (list 'next-window var minip)) |
| 986 | loop-for-steps))) | ||
| 978 | 987 | ||
| 979 | (t | 988 | (t |
| 980 | (let ((handler (and (symbolp word) | 989 | (let ((handler (and (symbolp word) |