emacs-diffs
[Top][All Lists]
Advanced

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

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


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/format.el
Date: Tue, 11 Jun 2002 15:26:46 -0400

Index: emacs/lisp/format.el
diff -c emacs/lisp/format.el:1.36 emacs/lisp/format.el:1.37
*** emacs/lisp/format.el:1.36   Wed Apr  3 10:29:18 2002
--- emacs/lisp/format.el        Tue Jun 11 15:26:45 2002
***************
*** 140,146 ****
  
  MODE-FN, if specified, is called when visiting a file with that format.
           It is called with a single positive argument, on the assumption
!          that it turns on some Emacs mode.")
  
  ;;; Basic Functions (called from Lisp)
  
--- 140,149 ----
  
  MODE-FN, if specified, is called when visiting a file with that format.
           It is called with a single positive argument, on the assumption
!          that it turns on some Emacs mode.
! 
! PRESERVE, if non-nil, means that `format-write-file' should not remove
!           this format from `buffer-file-formats'.")
  
  ;;; Basic Functions (called from Lisp)
  
***************
*** 371,377 ****
          (fmt (format-read (format "Write file `%s' in format: "
                                    (file-name-nondirectory file)))))
       (list file fmt)))
!   (setq buffer-file-format format)
    (write-file filename))
  
  (defun format-find-file (filename format)
--- 374,389 ----
          (fmt (format-read (format "Write file `%s' in format: "
                                    (file-name-nondirectory file)))))
       (list file fmt)))
!   (let ((old-formats buffer-file-format)
!       preserve-formats)
!     (dolist (fmt old-formats)
!       (let ((aelt (assq fmt format-alist)))
!       (if (nth 7 aelt)
!           (push fmt preserve-formats))))
!     (setq buffer-file-format format)
!     (dolist (fmt preserve-formats)
!       (unless (memq fmt buffer-file-format)
!       (setq buffer-file-format (append buffer-file-format (list fmt))))))
    (write-file filename))
  
  (defun format-find-file (filename format)



reply via email to

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