unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Nicolas Richard <theonewiththeevillook@yahoo.fr>
To: Peter Dyballa <Peter_Dyballa@Web.DE>
Cc: help-gnu-emacs@gnu.org
Subject: Re: using (current-message) bound to a key
Date: Thu, 11 Jul 2013 13:06:44 +0200	[thread overview]
Message-ID: <87fvvl1hkr.fsf@yahoo.fr> (raw)
In-Reply-To: <C6C4D04B-381D-481A-AF0C-42FC48AEB33D@Web.DE> (Peter Dyballa's message of "Thu, 11 Jul 2013 12:35:46 +0200")

Peter Dyballa <Peter_Dyballa@Web.DE> 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…

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) 
                                    (progn
                                      (skip-chars-backward "^\n")
                                      (point)))))

-- 
Nicolas



      reply	other threads:[~2013-07-11 11:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-11  9:56 using (current-message) bound to a key Nicolas Richard
2013-07-11 10:35 ` Peter Dyballa
2013-07-11 11:06   ` Nicolas Richard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fvvl1hkr.fsf@yahoo.fr \
    --to=theonewiththeevillook@yahoo.fr \
    --cc=Peter_Dyballa@Web.DE \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).