From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: C-x RET r utf-8 RET Date: Mon, 08 Dec 2014 17:39:43 +0800 Message-ID: <87mw6yzdi8.fsf@ericabrahamsen.net> References: <87d27uzn8g.fsf@skimble.plus.com> <87iohm1tnf.fsf@ericabrahamsen.net> <87r3wa8qt8.fsf@wmi.amu.edu.pl> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xxuhs-0000nh-4s for emacs-orgmode@gnu.org; Mon, 08 Dec 2014 04:34:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xxuhm-0001Lv-2X for emacs-orgmode@gnu.org; Mon, 08 Dec 2014 04:34:16 -0500 Received: from plane.gmane.org ([80.91.229.3]:57436) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xxuhl-0001Lr-R1 for emacs-orgmode@gnu.org; Mon, 08 Dec 2014 04:34:09 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Xxuhk-0005RW-Li for emacs-orgmode@gnu.org; Mon, 08 Dec 2014 10:34:08 +0100 Received: from 61.149.185.27 ([61.149.185.27]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 08 Dec 2014 10:34:08 +0100 Received: from eric by 61.149.185.27 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 08 Dec 2014 10:34:08 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Marcin Borkowski writes: > On 2014-12-08, at 08:35, Eric Abrahamsen wrote: > >> [...] You could do that in a lambda, but >> it probably won't accept a non-interactive function, [...] > > Out of curiosity: can't a lambda (in e.g. global-set-key) be made > interactive? I did this right now: > > (global-set-key (kbd "C-z C-s") (lambda () (interactive) (message "It can be done!"))) > > and it seems to work. Is it going to change e.g. in future Emacs > versions, IOW, is it deprecated or something? No, you're quite right, I was just answering off the cuff, without thorough thought. It is indeed possible to stick (interactive) inside of a lambda, though intuition tells me that that it's not generally good practice -- Emacs' introspection functions will probably at some point bark at you for not having a named function, and it will make it harder to use the built-in help functions to figure out what's going on. But yes, you're right, it's definitely possible. E