From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.help Subject: using (current-message) bound to a key Date: Thu, 11 Jul 2013 11:56:02 +0200 Message-ID: <87li5d1kul.fsf@yahoo.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1373536572 27508 80.91.229.3 (11 Jul 2013 09:56:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Jul 2013 09:56:12 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 11 11:56:13 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UxDbc-0006TP-JM for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Jul 2013 11:56:08 +0200 Original-Received: from localhost ([::1]:54769 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxDbc-0003sz-9T for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Jul 2013 05:56:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxDbO-0003so-HH for help-gnu-emacs@gnu.org; Thu, 11 Jul 2013 05:55:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UxDbN-0007d4-Dt for help-gnu-emacs@gnu.org; Thu, 11 Jul 2013 05:55:54 -0400 Original-Received: from mxin.ulb.ac.be ([164.15.128.112]:58282) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxDbN-0007cu-72 for help-gnu-emacs@gnu.org; Thu, 11 Jul 2013 05:55:53 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApwEAJeA3lGkD4Nx/2dsb2JhbABaxnR0gzskNAEEiFgBEpZsj0yHSQGJKI9+g18Dl1qGEIs6gxM6 Original-Received: from geodiff-mac3.ulb.ac.be (HELO geodiff-mac3) ([164.15.131.113]) by smtp.ulb.ac.be with ESMTP; 11 Jul 2013 11:55:52 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 164.15.128.112 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:92047 Archived-At: Hello, I'm trying to access what's located in the echo area. I failed. Could someone explain what I'm doing wrong ? (defun show-current-message () (interactive) (insert (format "%s" (current-message)))) (global-set-key (kbd "") 'show-current-message) That doesn't work, e.g. if I write "'foo" and then hit the keys: C-x e , I get "nil" inserted whereas I expected to have "foo" inserted. Perhaps the way C-x e works is getting in the way, so I try this: (defun say-hi () (interactive) (message "hi")) (global-set-key (kbd "") 'say-hi) then hitting succesively f6 and f5 inserts again "nil" instead of the expected "hi". On the other hand, (progn (message "hi") (call-interactively 'show-current-message)) inserts "hi" as expected. So there is something wrong with me binding show-current-message to a key. How to work around this ? Thanks -- Nico.