Mercurial > emacs
comparison lisp/ediff-init.el @ 81076:c2b0d8bb6ca7
(ediff-defvar-local, ediff-with-current-buffer):
Add indentation and debugging info. Fix up comment convention.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Fri, 25 May 2007 16:41:25 +0000 |
parents | e3694f1cb928 |
children | c5bcf5ad255f 03ec96a627ba |
comparison
equal
deleted
inserted
replaced
81075:8520ffa982fc | 81076:c2b0d8bb6ca7 |
---|---|
108 ;; so that `kill-all-local-variables' (called by major-mode setting | 108 ;; so that `kill-all-local-variables' (called by major-mode setting |
109 ;; commands) won't destroy Ediff control variables. | 109 ;; commands) won't destroy Ediff control variables. |
110 ;; | 110 ;; |
111 ;; Plagiarised from `emerge-defvar-local' for XEmacs. | 111 ;; Plagiarised from `emerge-defvar-local' for XEmacs. |
112 (defmacro ediff-defvar-local (var value doc) | 112 (defmacro ediff-defvar-local (var value doc) |
113 (declare (indent defun)) | |
113 `(progn | 114 `(progn |
114 (defvar ,var ,value ,doc) | 115 (defvar ,var ,value ,doc) |
115 (make-variable-buffer-local ',var) | 116 (make-variable-buffer-local ',var) |
116 (put ',var 'permanent-local t))) | 117 (put ',var 'permanent-local t))) |
117 | 118 |
256 | 257 |
257 ;; Macro to switch to BUFFER, evaluate BODY, returns to original buffer. | 258 ;; Macro to switch to BUFFER, evaluate BODY, returns to original buffer. |
258 ;; Doesn't save the point and mark. | 259 ;; Doesn't save the point and mark. |
259 ;; This is `with-current-buffer' with the added test for live buffers." | 260 ;; This is `with-current-buffer' with the added test for live buffers." |
260 (defmacro ediff-with-current-buffer (buffer &rest body) | 261 (defmacro ediff-with-current-buffer (buffer &rest body) |
262 (declare (indent 1) (debug (form body))) | |
261 `(if (ediff-buffer-live-p ,buffer) | 263 `(if (ediff-buffer-live-p ,buffer) |
262 (save-current-buffer | 264 (save-current-buffer |
263 (set-buffer ,buffer) | 265 (set-buffer ,buffer) |
264 ,@body) | 266 ,@body) |
265 (or (eq this-command 'ediff-quit) | 267 (or (eq this-command 'ediff-quit) |
1871 | 1873 |
1872 (provide 'ediff-init) | 1874 (provide 'ediff-init) |
1873 | 1875 |
1874 | 1876 |
1875 | 1877 |
1876 ;;; Local Variables: | 1878 ;; Local Variables: |
1877 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) | 1879 ;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) |
1878 ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1) | 1880 ;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1) |
1879 ;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body)) | 1881 ;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body)) |
1880 ;;; End: | 1882 ;; End: |
1881 | 1883 |
1882 ;;; arch-tag: fa31d384-1e70-4d4b-82a7-3e96307c46f5 | 1884 ;; arch-tag: fa31d384-1e70-4d4b-82a7-3e96307c46f5 |
1883 ;;; ediff-init.el ends here | 1885 ;;; ediff-init.el ends here |