emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/lisp-mnt.el


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/emacs-lisp/lisp-mnt.el
Date: Mon, 22 Sep 2003 11:23:53 -0400

Index: emacs/lisp/emacs-lisp/lisp-mnt.el
diff -c emacs/lisp/emacs-lisp/lisp-mnt.el:1.41 
emacs/lisp/emacs-lisp/lisp-mnt.el:1.42
*** emacs/lisp/emacs-lisp/lisp-mnt.el:1.41      Mon Sep  1 11:45:22 2003
--- emacs/lisp/emacs-lisp/lisp-mnt.el   Mon Sep 22 11:23:53 2003
***************
*** 180,187 ****
  If called with optional MODE and with value `section',
  return section regexp instead."
    (if (eq mode 'section)
!       (concat "^;;;;* " header ":[ \t]*$")
!     (concat lm-header-prefix header "[ \t]*:[ \t]*")))
  
  (defun lm-get-package-name ()
    "Return package name by looking at the first line."
--- 180,187 ----
  If called with optional MODE and with value `section',
  return section regexp instead."
    (if (eq mode 'section)
!       (concat "^;;;;* \\(" header "\\):[ \t]*$")
!     (concat lm-header-prefix "\\(" header "\\)[ \t]*:[ \t]*")))
  
  (defun lm-get-package-name ()
    "Return package name by looking at the first line."
***************
*** 296,310 ****
  ;; These give us smart access to the header fields and commentary
  
  (defmacro lm-with-file (file &rest body)
!   "Make a buffer with FILE current, and execute BODY.
! If FILE isn't in a buffer, load it in, and kill it after BODY is executed."
    (let ((filesym (make-symbol "file")))
!     `(save-excursion
!        (let ((,filesym ,file))
!        (if ,filesym (set-buffer (find-file-noselect ,filesym)))
!        (prog1 (progn ,@body)
!          (if (and ,filesym (not (get-buffer-window (current-buffer) t)))
!              (kill-buffer (current-buffer))))))))
  (put 'lm-with-file 'lisp-indent-function 1)
  (put 'lm-with-file 'edebug-form-spec t)
  
--- 296,309 ----
  ;; These give us smart access to the header fields and commentary
  
  (defmacro lm-with-file (file &rest body)
!   "Execute BODY in a buffer containing the contents of FILE.
! If FILE is nil, just return nil."
    (let ((filesym (make-symbol "file")))
!     `(let ((,filesym ,file))
!        (when ,filesym 
!        (with-temp-buffer
!          (insert-file-contents ,filesym)
!          ,@body)))))
  (put 'lm-with-file 'lisp-indent-function 1)
  (put 'lm-with-file 'edebug-form-spec t)
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]