/[emacs]/emacs/lisp/emacs-lisp/lisp-mnt.el
ViewVC logotype

Diff of /emacs/lisp/emacs-lisp/lisp-mnt.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.42 by rms, Mon Sep 22 15:23:53 2003 UTC revision 1.43 by rms, Tue Sep 30 12:47:04 2003 UTC
# Line 297  The returned value is a list of strings, Line 297  The returned value is a list of strings,
297    
298  (defmacro lm-with-file (file &rest body)  (defmacro lm-with-file (file &rest body)
299    "Execute BODY in a buffer containing the contents of FILE.    "Execute BODY in a buffer containing the contents of FILE.
300  If FILE is nil, just return nil."  If FILE is nil, execute BODY in the current buffer."
301    (let ((filesym (make-symbol "file")))    (let ((filesym (make-symbol "file")))
302      `(let ((,filesym ,file))      `(let ((,filesym ,file))
303         (when ,filesym         (if ,filesym
304           (with-temp-buffer             (with-temp-buffer
305             (insert-file-contents ,filesym)               (insert-file-contents ,filesym)
306                 ,@body)
307             (save-excursion
308             ,@body)))))             ,@body)))))
309  (put 'lm-with-file 'lisp-indent-function 1)  (put 'lm-with-file 'lisp-indent-function 1)
310  (put 'lm-with-file 'edebug-form-spec t)  (put 'lm-with-file 'edebug-form-spec t)

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.43

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26