unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Re: longlines and global-auto-revert-mode
@ 2008-01-15 17:35 martin rudalics
  2008-01-16 10:07 ` Dmitry Bolshakov
  0 siblings, 1 reply; 5+ messages in thread
From: martin rudalics @ 2008-01-15 17:35 UTC (permalink / raw)
  To: dmitry.bolshakov; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 436 bytes --]

 > It works fine, but if longlines-mode is active, then when file is been
 > modified by external program, I get not only my message, but before it I
 > get question in minibuffer "filename.txt changed on disk; really edit
 > the buffer? (y, n, r or C-h)". Why? I want only my message. How to
 > disable this question?

Can you try the attached patch?   It's against CVS Emacs hence
if you have any problems applying it please tell me.

[-- Attachment #2: longlines.patch --]
[-- Type: text/plain, Size: 2573 bytes --]

*** longlines.el.~1.41.~	Fri Nov 30 10:00:46 2007
--- longlines.el	Tue Jan 15 18:29:16 2008
***************
*** 136,142 ****
          (let ((buffer-undo-list t)
                (inhibit-read-only t)
  	      (after-change-functions nil)
!               (mod (buffer-modified-p)))
            ;; Turning off undo is OK since (spaces + newlines) is
            ;; conserved, except for a corner case in
            ;; longlines-wrap-lines that we'll never encounter from here
--- 136,143 ----
          (let ((buffer-undo-list t)
                (inhibit-read-only t)
  	      (after-change-functions nil)
!               (mod (buffer-modified-p))
! 	      buffer-file-name buffer-file-truename)
            ;; Turning off undo is OK since (spaces + newlines) is
            ;; conserved, except for a corner case in
            ;; longlines-wrap-lines that we'll never encounter from here
***************
*** 176,182 ****
          (longlines-unshow-hard-newlines))
      (let ((buffer-undo-list t)
  	  (after-change-functions nil)
!           (inhibit-read-only t))
        (if longlines-decoded
  	  (save-restriction
  	    (widen)
--- 177,184 ----
          (longlines-unshow-hard-newlines))
      (let ((buffer-undo-list t)
  	  (after-change-functions nil)
!           (inhibit-read-only t)
! 	  buffer-file-name buffer-file-truename)
        (if longlines-decoded
  	  (save-restriction
  	    (widen)
***************
*** 220,226 ****
  	 (mod (buffer-modified-p))
  	 (buffer-undo-list t)
  	 (inhibit-read-only t)
! 	 (inhibit-modification-hooks t))
      (while pos
        (put-text-property pos (1+ pos) 'display
  			 (copy-sequence longlines-show-effect))
--- 222,229 ----
  	 (mod (buffer-modified-p))
  	 (buffer-undo-list t)
  	 (inhibit-read-only t)
! 	 (inhibit-modification-hooks t)
! 	 buffer-file-name buffer-file-truename)
      (while pos
        (put-text-property pos (1+ pos) 'display
  			 (copy-sequence longlines-show-effect))
***************
*** 235,241 ****
  	(mod (buffer-modified-p))
  	(buffer-undo-list t)
  	(inhibit-read-only t)
! 	(inhibit-modification-hooks t))
      (while pos
        (remove-text-properties pos (1+ pos) '(display))
        (setq pos (text-property-not-all (1+ pos) (point-max) 'hard nil)))
--- 238,245 ----
  	(mod (buffer-modified-p))
  	(buffer-undo-list t)
  	(inhibit-read-only t)
! 	(inhibit-modification-hooks t)
! 	buffer-file-name buffer-file-truename)
      (while pos
        (remove-text-properties pos (1+ pos) '(display))
        (setq pos (text-property-not-all (1+ pos) (point-max) 'hard nil)))

[-- Attachment #3: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 5+ messages in thread
* longlines and global-auto-revert-mode
@ 2008-01-15 10:01 Dmitry Bolshakov
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Bolshakov @ 2008-01-15 10:01 UTC (permalink / raw)
  To: help-gnu-emacs

Hi All.

My system:
WinXP
GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600) of 2007-06-02 on RELEASE

In order to be informed that file has been modified externally, I have 
added this in my .emacs:
(global-auto-revert-mode 1)
(defun inform-revert-modified-file (&optional p1 p2)
  (let ((revert-buffer-function nil))
    (revert-buffer p1 p2)
    (message-box "emacs: modified file automatically reverted: %s" 
(buffer-file-name))
  )
)
(setq revert-buffer-function 'inform-revert-modified-file)

It works fine, but if longlines-mode is active, then when file is been 
modified by external program, I get not only my message, but before it I 
get question in minibuffer "filename.txt changed on disk; really edit 
the buffer? (y, n, r or C-h)". Why? I want only my message. How to 
disable this question?

-- 
With best regards
Dmitry Bolshakov

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-01-16 12:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-15 17:35 longlines and global-auto-revert-mode martin rudalics
2008-01-16 10:07 ` Dmitry Bolshakov
2008-01-16 10:55   ` martin rudalics
2008-01-16 12:29     ` Dmitry Bolshakov
  -- strict thread matches above, loose matches on Subject: below --
2008-01-15 10:01 Dmitry Bolshakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).