help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to update a file


From: Gordon Beaton
Subject: Re: How to update a file
Date: 14 Mar 2006 16:57:57 +0100
User-agent: slrn/0.9.7.4 (Linux)

On 14 Mar 2006 07:50:06 -0800, billy wrote:
> by update I mean that I have the file open for viewing/editing.
> In a shell I execute a script that recreates the file.  It changes, but
> if I dont reopen the file again I do not see the new version.

M-x revert-buffer
or 
C-x C-v <enter>

I use the following with find-alternate-file so I don't have to hunt
for my position in the file afterward re-visiting it:

(defadvice find-alternate-file (around restore-point activate)
  "Restore current position when re-visiting same file"
  (let ((saved-point (point))
        (saved-window-start (window-start))
        (saved-filename buffer-file-name))
    ad-do-it
    (if (equal saved-filename buffer-file-name)
        (progn (goto-char saved-point)
               (set-window-start (selected-window) saved-window-start)))))

(suggestions for improvements are welcome)

/gordon

-- 
[  do not email me copies of your followups  ]
g o r d o n + n e w s @  b a l d e r 1 3 . s e


reply via email to

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