21.5.17: local variables bug in revert-buffer

Rodney Sparapani <[email protected]> Thu, 25 Mar 2004 08:47:01 -0600 (CST)
Newsgroups gmane.emacs.xemacs.general
Message-ID <[email protected]>
With the recent announcement, I decided to give unstable a try.  However, I 
quickly discovered that the local variables bug in revert-buffer still exists in 
unstable.  So, I decided to patch it with stable since that has been fixed.  
And, it worked!  Here's the patch:
*** files.el    Tue Oct 14 11:10:06 2003
--- ../../xemacs-21.4.15/lisp/files.el  Thu Dec  4 20:06:33 2003
***************
*** 3480,3489 ****
                    ;; The resultant buffer is identical, alter
                    ;; modtime, update mods and exit
                    (set-visited-file-modtime)
!                   (after-find-file nil nil t t t))
                   (t t))
             t)))))
  
  (defun revert-buffer-internal (&optional file-name)
    "Read contents of FILE-NAME into a buffer, and compare to current buffer.
  Return nil if identical, and the new buffer if different."
--- 2724,2742 ----
                    ;; The resultant buffer is identical, alter
                    ;; modtime, update mods and exit
                    (set-visited-file-modtime)
!                   (after-find-file nil nil t t t)
!                   ;; We preserved modes above so fixup the local
!                   ;; variables manually
!                   (condition-case err
!                       (hack-local-variables)
!                     (error (lwarn 'local-variables 'warning
!                              "File local-variables error: %s"
!                              (error-message-string err)))))
                   (t t))
             t)))))
  
+ ;; #### something like `revert-buffer-compare-with-file' is a better name
+ ;; #### why is the argument optional?
  (defun revert-buffer-internal (&optional file-name)
    "Read contents of FILE-NAME into a buffer, and compare to current buffer.
  Return nil if identical, and the new buffer if different."

Rodney Sparapani              Medical College of Wisconsin
Sr. Biostatistician           Patient Care & Outcomes Research
[email protected]              http://www.mcw.edu/pcor
Was 'Name That Tune' rigged?  WWLD -- What Would Lombardi Do
files.diff (text/plain, 1.3 KB)
*** files.el	Tue Oct 14 11:10:06 2003
--- ../../xemacs-21.4.15/lisp/files.el	Thu Dec  4 20:06:33 2003
***************
*** 3480,3489 ****
  		    ;; The resultant buffer is identical, alter
  		    ;; modtime, update mods and exit
  		    (set-visited-file-modtime)
! 		    (after-find-file nil nil t t t))
  		   (t t))
  	     t)))))
  
  (defun revert-buffer-internal (&optional file-name)
    "Read contents of FILE-NAME into a buffer, and compare to current buffer.
  Return nil if identical, and the new buffer if different."
--- 2724,2742 ----
  		    ;; The resultant buffer is identical, alter
  		    ;; modtime, update mods and exit
  		    (set-visited-file-modtime)
! 		    (after-find-file nil nil t t t)
! 		    ;; We preserved modes above so fixup the local
! 		    ;; variables manually
! 		    (condition-case err
! 			(hack-local-variables)
! 		      (error (lwarn 'local-variables 'warning
! 			       "File local-variables error: %s"
! 			       (error-message-string err)))))
  		   (t t))
  	     t)))))
  
+ ;; #### something like `revert-buffer-compare-with-file' is a better name
+ ;; #### why is the argument optional?
  (defun revert-buffer-internal (&optional file-name)
    "Read contents of FILE-NAME into a buffer, and compare to current buffer.
  Return nil if identical, and the new buffer if different."