From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.help Subject: Re: How to follow the end of *Messages* buffer in Emacs? Date: Mon, 12 Nov 2012 10:56:59 +0100 Message-ID: <50A0C7EB.2040201@gmx.at> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1352714505 26022 80.91.229.3 (12 Nov 2012 10:01:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 Nov 2012 10:01:45 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Yves Baumes Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 12 11:01:55 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 1TXqq1-0004fm-JO for geh-help-gnu-emacs@m.gmane.org; Mon, 12 Nov 2012 11:01:53 +0100 Original-Received: from localhost ([::1]:52009 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXqpr-0002ya-NU for geh-help-gnu-emacs@m.gmane.org; Mon, 12 Nov 2012 05:01:43 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:42026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXqpk-0002xc-0W for help-gnu-emacs@gnu.org; Mon, 12 Nov 2012 05:01:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXqpg-0007P2-TG for help-gnu-emacs@gnu.org; Mon, 12 Nov 2012 05:01:35 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:51665) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TXqpg-0007Ol-Ia for help-gnu-emacs@gnu.org; Mon, 12 Nov 2012 05:01:32 -0500 Original-Received: (qmail invoked by alias); 12 Nov 2012 09:57:09 -0000 Original-Received: from 62-47-55-250.adsl.highway.telekom.at (EHLO [62.47.55.250]) [62.47.55.250] by mail.gmx.net (mp040) with SMTP; 12 Nov 2012 10:57:09 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18qhvRdGHQq3tvWSh+1meAyStPVtg9FLfgLRTSv/k gRkINQhsDgtSCV In-Reply-To: X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 213.165.64.22 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:87650 Archived-At: >> For the moment it should be sufficient if you add your function to >> `window-configuration-change-hook' instead of `post-command-hook'. This >> should allow you to scroll and edit *Messages* without any problems. > > I've just tried and it does not work with that hook, as is. It doesn't, indeed. As a matter of fact, `window-point' is reset by `quit-window' _after_ running `window-configuration-change-hook'. If you want to fix this in `window-configuration-change-hook' you have two possibilites: (1) In `window-configuration-change-hook' add your function that updates the positions to `post-command-hook'. In the function itself add code so the function removes itself from `post-command-hook'. This means that you run the function only when the *Messages* buffer reappears on the frame and not when you scroll or modify it. (2) In the function itself modify the `quit-restore' parameter of the window to point to `point-max' instead. Both approaches are tricky so try them only if you want to play around with Elisp. Otherwise, the patch I posted in reply to your bug report should take care of this. martin