help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Simple useful function


From: Andrea Crotti
Subject: Re: Simple useful function
Date: Tue, 06 Jul 2010 13:49:09 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (darwin)

Lennart Borgman <lennart.borgman@gmail.com> 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...




reply via email to

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