From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Magnus Henoch Newsgroups: gmane.emacs.help Subject: Re: `last-message' variable ? Date: Tue, 16 May 2006 10:45:25 +0200 Message-ID: <87fyjauzmi.fsf@freemail.hu> References: <87slnb54eq.fsf@tallis.ilo.ucl.ac.uk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1147769181 8818 80.91.229.2 (16 May 2006 08:46:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 16 May 2006 08:46:21 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 16 10:46:19 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FfvC1-0004k4-Kk for geh-help-gnu-emacs@m.gmane.org; Tue, 16 May 2006 10:46:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FfvC1-0001y8-4n for geh-help-gnu-emacs@m.gmane.org; Tue, 16 May 2006 04:46:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FfvBl-0001y3-CP for help-gnu-emacs@gnu.org; Tue, 16 May 2006 04:45:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FfvBj-0001xq-UZ for help-gnu-emacs@gnu.org; Tue, 16 May 2006 04:45:57 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FfvBj-0001xn-OM for help-gnu-emacs@gnu.org; Tue, 16 May 2006 04:45:55 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FfvEK-0000sq-Tm for help-gnu-emacs@gnu.org; Tue, 16 May 2006 04:48:37 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FfvBT-0004eB-Rh for help-gnu-emacs@gnu.org; Tue, 16 May 2006 10:45:39 +0200 Original-Received: from c83-248-123-63.bredband.comhem.se ([83.248.123.63]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 May 2006 10:45:39 +0200 Original-Received: from mange by c83-248-123-63.bredband.comhem.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 May 2006 10:45:39 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-To: help-gnu-emacs@gnu.org Original-Lines: 22 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: c83-248-123-63.bredband.comhem.se Mail-Copies-To: never Jabber-Id: legoscia@jabber.cd.chalmers.se User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (berkeley-unix) Cancel-Lock: sha1:7JDO03wy6PvviqCFImVkdJnrTNU= X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:35073 Archived-At: Bastien writes: > Just guessing, i thought Emacs would have a `last-message' variable, > in case we want to fetch the last message quickly. Apparently, this > is not the case. > > How do i get the last message string ? > > What about implementing this ? I have worked around it like this: (defun last-message () "Display last message from *Messages* buffer." (interactive) (with-current-buffer "*Messages*" (save-excursion (goto-char (point-max)) (previous-line) (message "%s" (buffer-substring (point) (1- (point-max))))))) Magnus