comparison lisp/ediff-init.el @ 81334:c5bcf5ad255f

2007-06-12 Michael Kifer <kifer@cs.stonybrook.edu> * ediff-ptch.el (ediff-context-diff-label-regexp): spurious parenthesis. * ediff-init.el: doc strings.
author Michael Kifer <kifer@cs.stonybrook.edu>
date Tue, 12 Jun 2007 21:18:46 +0000
parents c2b0d8bb6ca7
children b98604865ea0 3619e7770f2e
comparison
equal deleted inserted replaced
81333:fc32f1336974 81334:c5bcf5ad255f
100 (defun ediff-use-toolbar-p () 100 (defun ediff-use-toolbar-p ()
101 (and (ediff-has-toolbar-support-p) ;Can it do it ? 101 (and (ediff-has-toolbar-support-p) ;Can it do it ?
102 (boundp 'ediff-use-toolbar-p) 102 (boundp 'ediff-use-toolbar-p)
103 ediff-use-toolbar-p)) ;Does the user want it ? 103 ediff-use-toolbar-p)) ;Does the user want it ?
104 104
105 ;; Defines SYMBOL as an advertised local variable. 105 ;; Defines VAR as an advertised local variable.
106 ;; Performs a defvar, then executes `make-variable-buffer-local' on 106 ;; Performs a defvar, then executes `make-variable-buffer-local' on
107 ;; the variable. Also sets the `permanent-local' property, 107 ;; the variable. Also sets the `permanent-local' property,
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 "Defines VAR as a local variable."
113 (declare (indent defun)) 114 (declare (indent defun))
114 `(progn 115 `(progn
115 (defvar ,var ,value ,doc) 116 (defvar ,var ,value ,doc)
116 (make-variable-buffer-local ',var) 117 (make-variable-buffer-local ',var)
117 (put ',var 'permanent-local t))) 118 (put ',var 'permanent-local t)))
257 258
258 ;; Macro to switch to BUFFER, evaluate BODY, returns to original buffer. 259 ;; Macro to switch to BUFFER, evaluate BODY, returns to original buffer.
259 ;; Doesn't save the point and mark. 260 ;; Doesn't save the point and mark.
260 ;; This is `with-current-buffer' with the added test for live buffers." 261 ;; This is `with-current-buffer' with the added test for live buffers."
261 (defmacro ediff-with-current-buffer (buffer &rest body) 262 (defmacro ediff-with-current-buffer (buffer &rest body)
263 "Evaluates BODY in BUFFER."
262 (declare (indent 1) (debug (form body))) 264 (declare (indent 1) (debug (form body)))
263 `(if (ediff-buffer-live-p ,buffer) 265 `(if (ediff-buffer-live-p ,buffer)
264 (save-current-buffer 266 (save-current-buffer
265 (set-buffer ,buffer) 267 (set-buffer ,buffer)
266 ,@body) 268 ,@body)