From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.help Subject: Re: Simple useful function Date: Tue, 6 Jul 2010 14:25:06 +0200 Message-ID: References: <87vd8tk026.fsf@stats.ox.ac.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1278420143 32160 80.91.229.12 (6 Jul 2010 12:42:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 6 Jul 2010 12:42:23 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Andrea Crotti Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 06 14:42:20 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OW7Tf-0007cU-AX for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Jul 2010 14:42:19 +0200 Original-Received: from localhost ([127.0.0.1]:49828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OW7Te-0008SU-L7 for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Jul 2010 08:42:18 -0400 Original-Received: from [140.186.70.92] (port=46500 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OW7DN-000505-53 for help-gnu-emacs@gnu.org; Tue, 06 Jul 2010 08:25:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OW7DL-00066H-Tr for help-gnu-emacs@gnu.org; Tue, 06 Jul 2010 08:25:28 -0400 Original-Received: from mail-gx0-f169.google.com ([209.85.161.169]:41080) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OW7DL-00066B-QP for help-gnu-emacs@gnu.org; Tue, 06 Jul 2010 08:25:27 -0400 Original-Received: by gxk4 with SMTP id 4so2435438gxk.0 for ; Tue, 06 Jul 2010 05:25:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=Icyrw6uWEbiWl2DksZpRyKeQKjXbnzHsWzwL4pW/LjY=; b=J7ipqovPQpYXFGY4Q1AFNPDc1q88/39bgEp55VdKbUJv8vFOYTjIq3dQ1HemPOZC+K lDLX2mGX4UnGrbKgDpuStfjY6HCYh4ygaDrU1DaflPb1G5M0W1ul+75TQR5YSG2opBiH WKpOXqEt9Ye/oU0JKs27NY95ox40LxWEB+YBs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=Vk2Sn/QQ2/87Lfx5mdAlcNYAvh+m+0esUrkU3cYD3ZVWSc8mKdOsDmUJbDgtXgI0it K5Qvscg6qOp7KwTL70k5CPPHAhyKjYcig8T1j8HsrxGwIuRhlWDtCYG7gMWih/6XBenf cr3vJ30RRIMJ37X5AGOx9Mz4w/qSwqxyMFdMc= Original-Received: by 10.213.27.145 with SMTP id i17mr1998643ebc.91.1278419126617; Tue, 06 Jul 2010 05:25:26 -0700 (PDT) Original-Received: by 10.213.15.132 with HTTP; Tue, 6 Jul 2010 05:25:06 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:74098 Archived-At: On Tue, Jul 6, 2010 at 1:49 PM, Andrea Crotti w= rote: > Lennart Borgman 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 () >> =C2=A0(if >> =C2=A0 =C2=A0 =C2=A0(file-exists-p ".git") >> =C2=A0 =C2=A0 =C2=A0(split-string (shell-command-to-string "git ls-files= ")) >> =C2=A0 =C2=A0(message "not a git repo") >> =C2=A0 =C2=A0nil)) > > 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")