Mercurial > emacs
comparison lisp/ibuf-macs.el @ 50010:d19b54decc23
(ibuffer-aif): Use `make-symbol' instead of
`gensym' in case user calls macro at runtime.
(ibuffer-save-marks): Likewise.
author | John Paul Wallington <jpw@pobox.com> |
---|---|
date | Mon, 03 Mar 2003 15:11:05 +0000 |
parents | 37645a051842 |
children | 16a30b905d2e |
comparison
equal
deleted
inserted
replaced
50009:173ef569a9e0 | 50010:d19b54decc23 |
---|---|
35 (defmacro ibuffer-aif (test true-body &rest false-body) | 35 (defmacro ibuffer-aif (test true-body &rest false-body) |
36 "Evaluate TRUE-BODY or FALSE-BODY depending on value of TEST. | 36 "Evaluate TRUE-BODY or FALSE-BODY depending on value of TEST. |
37 If TEST returns non-nil, bind `it' to the value, and evaluate | 37 If TEST returns non-nil, bind `it' to the value, and evaluate |
38 TRUE-BODY. Otherwise, evaluate forms in FALSE-BODY as if in `progn'. | 38 TRUE-BODY. Otherwise, evaluate forms in FALSE-BODY as if in `progn'. |
39 Compare with `if'." | 39 Compare with `if'." |
40 (let ((sym (gensym "--ibuffer-aif-"))) | 40 (let ((sym (make-symbol "ibuffer-aif-sym"))) |
41 `(let ((,sym ,test)) | 41 `(let ((,sym ,test)) |
42 (if ,sym | 42 (if ,sym |
43 (let ((it ,sym)) | 43 (let ((it ,sym)) |
44 ,true-body) | 44 ,true-body) |
45 (progn | 45 (progn |
54 nil)) | 54 nil)) |
55 ;; (put 'ibuffer-awhen 'lisp-indent-function 1) | 55 ;; (put 'ibuffer-awhen 'lisp-indent-function 1) |
56 | 56 |
57 (defmacro ibuffer-save-marks (&rest body) | 57 (defmacro ibuffer-save-marks (&rest body) |
58 "Save the marked status of the buffers and execute BODY; restore marks." | 58 "Save the marked status of the buffers and execute BODY; restore marks." |
59 (let ((bufsym (gensym))) | 59 (let ((bufsym (make-symbol "bufsym"))) |
60 `(let ((,bufsym (current-buffer)) | 60 `(let ((,bufsym (current-buffer)) |
61 (ibuffer-save-marks-tmp-mark-list (ibuffer-current-state-list))) | 61 (ibuffer-save-marks-tmp-mark-list (ibuffer-current-state-list))) |
62 (unwind-protect | 62 (unwind-protect |
63 (progn | 63 (progn |
64 (save-excursion | 64 (save-excursion |