[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple useful function

From: Lennart Borgman
Subject: Re: Simple useful function
Date: Tue, 6 Jul 2010 14:25:06 +0200

On Tue, Jul 6, 2010 at 1:49 PM, Andrea Crotti <address@hidden> wrote:
> Lennart Borgman <address@hidden> writes:
>> No. The last statement run will be (message ...) and the doc string
>> for message says "Return the message".
>> Just add nil if you want it to return nil:
>> (defun ls-git-files ()
>>  (if
>>      (file-exists-p ".git")
>>      (split-string (shell-command-to-string "git ls-files"))
>>    (message "not a git repo")
>>    nil))
> Ah good thanks, a non related question, why the last message written in
> *Messages* is not automatically saved somewhere?
> I mean, sometimes it's useful to get it, without going to the *Messages*
> buffer every time...

There is (current-message), see

  (info "(elisp) Displaying Messages")

reply via email to

[Prev in Thread] Current Thread [Next in Thread]