From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Peter Lee Newsgroups: gmane.emacs.help Subject: Re: Command to re-read current file? Date: Mon, 04 Aug 2003 14:45:52 GMT Organization: SBC http://yahoo.sbc.com Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1060019490 17841 80.91.224.253 (4 Aug 2003 17:51:30 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 4 Aug 2003 17:51:30 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 04 19:51:47 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19jjUp-0007Qz-00 for ; Mon, 04 Aug 2003 19:51:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19jgpO-0004to-6q for geh-help-gnu-emacs@m.gmane.org; Mon, 04 Aug 2003 11:00:50 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!nntp.cs.ubc.ca!cyclone.bc.net!snoopy.risq.qc.ca!chi1.webusenet.com!news.webusenet.com!peer02.cox.net!cox.net!prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr24.news.prodigy.com.POSTED!404941e6!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:T5lJJT0rJ2mmkdHpF7wIS0NElCM= Original-Lines: 56 Original-NNTP-Posting-Host: 216.62.199.3 Original-X-Complaints-To: abuse@prodigy.net Original-X-Trace: newssvr24.news.prodigy.com 1060008352 ST000 216.62.199.3 (Mon, 04 Aug 2003 10:45:52 EDT) Original-NNTP-Posting-Date: Mon, 04 Aug 2003 10:45:52 EDT X-UserInfo1: [[PA@SFGPBSYRIXXKJJD]_HBWB]^PCPDLXUNNHLHQAVTUZ]CLNTCPFK[WDXDHV[K^FCGJCJLPF_D_NCC@FUG^Q\DINVAXSLIFXYJSSCCALP@PB@\OS@BITWAH\CQZKJMMD^SJA^NXA\GVLSRBD^M_NW_F[YLVTWIGAXAQBOATKBBQRXECDFDMQ\DZFUE@\JM Original-Xref: shelby.stanford.edu gnu.emacs.help:115651 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:11574 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:11574 >>>> bill writes: bill> If the file corresponding to the current buffer changes on bill> disk, and I want the buffer to reflect the new version, I bill> normally do "C-f [RET] yes". It bugs me to have to answer bill> 'yes' (or even 'y') in these cases. Is there a command to bill> tell Emacs, "re-read the file from disk and don't ask me bill> about it"? ,----[ C-h f revert-buffer RET ] | revert-buffer is an interactive compiled Lisp function in `files'. | (revert-buffer &optional IGNORE-AUTO NOCONFIRM PRESERVE-MODES) | | Replace current buffer text with the text of the visited file on disk. | This undoes all changes since the file was visited or saved. | With a prefix argument, offer to revert from latest auto-save file, if | that is more recent than the visited file. | | This command also works for special buffers that contain text which | doesn't come from a file, but reflects some other data base instead: | for example, Dired buffers and buffer-list buffers. In these cases, | it reconstructs the buffer contents from the appropriate data base. | | When called from Lisp, the first argument is IGNORE-AUTO; only offer | to revert from the auto-save file when this is nil. Note that the | sense of this argument is the reverse of the prefix argument, for the | sake of backward compatibility. IGNORE-AUTO is optional, defaulting | to nil. | | Optional second argument NOCONFIRM means don't ask for confirmation at | all. (The local variable `revert-without-query', if non-nil, prevents | confirmation.) | | Optional third argument PRESERVE-MODES non-nil means don't alter | the files modes. Normally we reinitialize them using `normal-mode'. | | If the value of `revert-buffer-function' is non-nil, it is called to | do all the work for this command. Otherwise, the hooks | `before-revert-hook' and `after-revert-hook' are run at the beginning | and the end, and if `revert-buffer-insert-file-contents-function' is | non-nil, it is called instead of rereading visited file contents. `---- bill> But this is a relatively trivial issue. A far more bill> important question is the following meta-question: how could bill> I have figured out the answer to the previous question on my bill> own? I tried apropos with various query strings, such as bill> "re-find", "re-open", "re-visit", and variants thereof, but bill> they yielded nothing. Is there a better approach to finding bill> the command for an Emacs functionality? You could have done 'M-x apropos-documentation RET reread'. apropos-documentation is handy when the command name is not intuitive.