From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Reitter Newsgroups: gmane.emacs.devel Subject: Re: Idempotency of add-hook wrt lambda expressions Date: Wed, 4 Mar 2009 16:00:01 -0500 Message-ID: <74F2CF19-2E71-473F-A352-A628B3B29A8E@gmail.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1236200470 23944 80.91.229.12 (4 Mar 2009 21:01:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 Mar 2009 21:01:10 +0000 (UTC) Cc: Geoff Gole , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 04 22:02:23 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LeyEE-0007lB-6l for ged-emacs-devel@m.gmane.org; Wed, 04 Mar 2009 22:02:10 +0100 Original-Received: from localhost ([127.0.0.1]:46989 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LeyCt-00043p-2f for ged-emacs-devel@m.gmane.org; Wed, 04 Mar 2009 16:00:47 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LeyCI-0003Sz-FW for emacs-devel@gnu.org; Wed, 04 Mar 2009 16:00:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LeyCF-0003RD-Vs for emacs-devel@gnu.org; Wed, 04 Mar 2009 16:00:09 -0500 Original-Received: from [199.232.76.173] (port=38044 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LeyCF-0003Qi-9L for emacs-devel@gnu.org; Wed, 04 Mar 2009 16:00:07 -0500 Original-Received: from mail-ew0-f179.google.com ([209.85.219.179]:47480) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LeyCE-0004qP-Qe for emacs-devel@gnu.org; Wed, 04 Mar 2009 16:00:07 -0500 Original-Received: by ewy27 with SMTP id 27so2996412ewy.42 for ; Wed, 04 Mar 2009 13:00:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=1xSfnehhTyU62Ca1seRQjnmr2Ea5c/48N2OFT7uNCIo=; b=W6gln43YtNXlqWAaIcIsp+IYMU4wrh/DuYkkiSv1VuK3I3JcGi5/O5pAmOnLvyJbq+ VNYmr0GL74oPp3mA10X4/cmD6E4CYzHkQCsCsPSgcQ8SAOYOC8/5BeBKC43acFX4XtkL BjtmwduPtQY/vMdvbc6JkKUqD5hZ+zXIqj/o8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=qiDEf/DH8TZYw2u9UBJa/+lC4dPJ8P2o3VAZxULJn5hXtK70GAy38b1EmcKDaerdw2 /n8meryj40/hcH4ha4+4WBJlUlGDkn9pLbrf/EiczWNS+hqmaWK9VSmV3AkpjDI4Bzbh /DJdeJm2Di3WacDmjBqWQgI4re3kO2nWPmDsg= Original-Received: by 10.216.8.77 with SMTP id 55mr130196weq.220.1236200405708; Wed, 04 Mar 2009 13:00:05 -0800 (PST) Original-Received: from ?192.168.1.42? (pool-72-65-195-138.pitbpa.east.verizon.net [72.65.195.138]) by mx.google.com with ESMTPS id 35sm804979nfu.7.2009.03.04.13.00.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 04 Mar 2009 13:00:04 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.930.3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:109451 Archived-At: On 4 Mar 2009, at 09:18, Stefan Monnier wrote: > As a general rule, you should not put a lambda but a function name > (i.e. a symbol) instead, to avoid all those problems (and be able to > replace the function with a newer version of it). But occasionally > a lambda is really exactly what you want, of course. People haven't adopted this, and this is pretty annoying. A similar case are commands bound to menu items (or any other keys): C- h k does not bring up something useful for keys that are just bound to a lambda term. As for hooks, is a lambda expression ever suitable to be added to a hook? Would it make sense to change add-hook such that only true function names are allowed?