From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.help Subject: Re: using (current-message) bound to a key Date: Thu, 11 Jul 2013 13:06:44 +0200 Message-ID: <87fvvl1hkr.fsf@yahoo.fr> References: <87li5d1kul.fsf@yahoo.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1373540808 8653 80.91.229.3 (11 Jul 2013 11:06:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Jul 2013 11:06:48 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Peter Dyballa Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 11 13:06:48 2013 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 1UxEi0-0005PL-LV for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Jul 2013 13:06:48 +0200 Original-Received: from localhost ([::1]:57787 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxEhz-0001kx-Rx for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Jul 2013 07:06:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxEho-0001ki-P5 for help-gnu-emacs@gnu.org; Thu, 11 Jul 2013 07:06:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UxEhn-0006UO-9E for help-gnu-emacs@gnu.org; Thu, 11 Jul 2013 07:06:36 -0400 Original-Received: from mxin.ulb.ac.be ([164.15.128.112]:63752) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxEhn-0006UF-22 for help-gnu-emacs@gnu.org; Thu, 11 Jul 2013 07:06:35 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqAEAPuQ3lGkD4Nx/2dsb2JhbABahw6+SoEcdIIjAQEEASNWBQsIAxoCBSECAg8BBEkTh3wBAwkGpXZPh0MBSiKIPIEmjjsHglaBHwOXWoYQizqDEzo Original-Received: from geodiff-mac3.ulb.ac.be (HELO geodiff-mac3) ([164.15.131.113]) by smtp.ulb.ac.be with ESMTP; 11 Jul 2013 13:06:34 +0200 In-Reply-To: (Peter Dyballa's message of "Thu, 11 Jul 2013 12:35:46 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 164.15.128.112 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:92049 Archived-At: Peter Dyballa writes: > Am 11.07.2013 um 11:56 schrieb Nicolas Richard: > >> I'm trying to access what's located in the echo area. > > You can find it also in *Messages* buffer=E2=80=A6 Yes, thank you, but while this is true most of the time, it is not always true -- and sometimes the text is slightly different (usually: a "user-error: " or "call-interactively: " can be prepended, or " [n times]" can be appended). I do admit that the following would be good enough in all cases I can think of: (with-current-buffer "*Messages*" (save-excursion (goto-char (point-max)) (skip-chars-backward "\n") (buffer-substring-no-properties (point)=20 (progn (skip-chars-backward "^\n") (point))))) --=20 Nicolas