From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "B. T. Raven" Newsgroups: gmane.emacs.help Subject: Re: How to follow the end of *Messages* buffer in Emacs? Date: Sat, 10 Nov 2012 00:39:08 -0600 Organization: NewsGuy - Unlimited Usenet $19.95 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1352529913 32561 80.91.229.3 (10 Nov 2012 06:45:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 10 Nov 2012 06:45:13 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 10 07:45:24 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TX4ok-00070w-2N for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Nov 2012 07:45:22 +0100 Original-Received: from localhost ([::1]:33320 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TX4oa-0003hm-Mw for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Nov 2012 01:45:12 -0500 Original-Path: usenet.stanford.edu!news.glorb.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!spln!extra.newsguy.com!newsp.newsguy.com!news6 Original-Newsgroups: gnu.emacs.help Original-Lines: 47 Original-NNTP-Posting-Host: p5c87a020a0c229c74121bc9c28f281abda6e568b958d695a.newsdawg.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 In-Reply-To: X-Received-Bytes: 2304 Original-Xref: usenet.stanford.edu gnu.emacs.help:195300 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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 Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:87622 Archived-At: > I am playing with Elisp, and I find convenient to have the *Messages* > buffer always open in a window in my frame. > > I discovered recently that sometimes the buffer stops following the last > lines. If I want to see the last appended lines in this buffer, I need > to go in the buffer and jump to the end manually, with M->. Which is > quite annoying and disruptive. > > I am trying to reproduce the "tail -f" command line, in a buffer. Of > course 'auto-revert-tail-mode complains that the *Messages* is not a > visited file... As a consequence, this mode does not want to work. But > it gave me the idea to add a function hook when the buffer is modified. > That function would jump to (point-max) each time that buffer is > modified. > > Here is my own attempt, invoked from *Messages* buffer, with M-: > (add-hook > 'after-change-functions > (lambda (s e l) (goto-char (point-max))) > nil t) > > But it does not work. The (point) remains in the same place while I see > the buffer is growing... The lambda function does not produce any error, > otherwise it would have been removed from the 'after-change-functions > hook and C-h k 'after-change-functions shows it is present. > > Any better suggestions? > I don't know if it's better, but this macro works: C-x ( C-x 5 b *Messages* M-> C-u -1 C-x 5 o C-x ) C-x C-k n bot-mess (global-set-key [(super a)] 'bot-mess) C-x C-e Keeping at the bottom of *Messages* this way does require intermittent manual intervention but it's only one keychord. Ed