From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: john@ankarstrom.se (John =?utf-8?Q?Ankarstr=C3=B6m?=) Newsgroups: gmane.emacs.help Subject: Re: Is there a way to get the last message? Date: Sun, 28 May 2017 13:41:39 +0200 Message-ID: <87o9udtdho.fsf@ankarstrom.se> References: <87r2z92r2z.fsf@jane> <87lgphp6ug.fsf@rosalinde> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1495978469 23959 195.159.176.226 (28 May 2017 13:34:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 28 May 2017 13:34:29 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: Help Gnu Emacs mailing list To: Stephen Berman Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun May 28 15:34:24 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dEyKt-00066L-Et for geh-help-gnu-emacs@m.gmane.org; Sun, 28 May 2017 15:34:23 +0200 Original-Received: from localhost ([::1]:44000 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEyKy-0003D6-RN for geh-help-gnu-emacs@m.gmane.org; Sun, 28 May 2017 09:34:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEwZr-0005Yi-IE for help-gnu-emacs@gnu.org; Sun, 28 May 2017 07:41:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dEwZn-0006id-KT for help-gnu-emacs@gnu.org; Sun, 28 May 2017 07:41:43 -0400 Original-Received: from pusjkin.ankarstrom.se ([172.104.152.215]:44246) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dEwZn-0006iJ-Cl for help-gnu-emacs@gnu.org; Sun, 28 May 2017 07:41:39 -0400 Original-Received: from DESKTOP-2MQA95O (c83-253-24-36.bredband.comhem.se [83.253.24.36]) by pusjkin.ankarstrom.se (Postfix) with ESMTPSA id BBB4B3EC86; Sun, 28 May 2017 13:41:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ankarstrom.se; s=default; t=1495971695; bh=bo64GIC/ekIoAaRQR+3x9CCXnomTfw0mVJb4Lgy7U3s=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=PqFLDCGPsqWeV4v47v4xbTI5iXgBLT7L31mgsH1o9f1rqpFeYqUP85YDeR6ricB/l BP/LpBrpcyGvbPrwTry4pqZWTwyBapMDclMOCQ/PPw7pWD4TTsuUov0Q1pkGYR1jGJ 6RdQfsOugTG4ZaL105DUx85LOhr0rLHszWiJ1wkM= In-Reply-To: <87lgphp6ug.fsf@rosalinde> (Stephen Berman's message of "Sun, 28 May 2017 13:18:47 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 172.104.152.215 X-Mailman-Approved-At: Sun, 28 May 2017 09:33:37 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:113209 Archived-At: Stephen Berman writes: > (add-hook 'post-command-hook 'get-last-message) Wouldn't post-command-hook be a bit overkill here? Personally, I'd do something like this: (advice-add #'message :after #'get-last-message) I'm not 100% sure that `message' is the only function that creates messages, but that advice should cover most cases. - John