From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: cal-x.el/diary-lib.el diary-mode-hook Date: Thu, 15 May 2008 10:52:15 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1210864684 29918 80.91.229.12 (15 May 2008 15:18:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 May 2008 15:18:04 +0000 (UTC) Cc: emacs-devel@gnu.org To: Karl Chen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 15 17:18:37 2008 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 1Jwf7Z-0002Gq-ER for ged-emacs-devel@m.gmane.org; Thu, 15 May 2008 17:11:53 +0200 Original-Received: from localhost ([127.0.0.1]:51234 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jwf6p-0005Io-JW for ged-emacs-devel@m.gmane.org; Thu, 15 May 2008 11:11:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jweoh-0005bT-0N for emacs-devel@gnu.org; Thu, 15 May 2008 10:52:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jweog-0005aU-9y for emacs-devel@gnu.org; Thu, 15 May 2008 10:52:22 -0400 Original-Received: from [199.232.76.173] (port=58361 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jweog-0005aM-4F for emacs-devel@gnu.org; Thu, 15 May 2008 10:52:22 -0400 Original-Received: from 76-10-180-207.dsl.teksavvy.com ([76.10.180.207]:59803 helo=ceviche.home) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jweof-0004uz-Ki for emacs-devel@gnu.org; Thu, 15 May 2008 10:52:21 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id B77B6B40CB; Thu, 15 May 2008 10:52:15 -0400 (EDT) In-Reply-To: (Karl Chen's message of "Thu, 15 May 2008 02:52:26 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) 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:97213 Archived-At: > Hi, this is regarding calendar. I experience the symptoms in > Emacs 22.2, and by inspecting CVS HEAD I suspect it is still > affected despite the code having been significantly updated. > emacs -q > (setq diary-display-hook 'fancy-diary-display) > (setq calendar-setup 'one-frame) > (calendar) > A couple places in calendar/*.el seem to assume that > diary-mode-hook is a list of functions, e.g. when it uses ``(memq > 'diary-fancy-display diary-display-hook)''. > In my setup I had ``(setq diary-display-hook > 'fancy-schedule-display-desk-calendar)'' [instead of add-hook or > ``setq .. '(..)''] and this would trigger a type error. > I realize the documentation for diary-display-hook says "list of > functions", but a couple places in the code let-bind > diary-display-hook to non-lists, and the documentation in 22.2 has > sample code with non-lists. Hooks accept either a function or a list of functions, where the former is only accepted for historical reasons. So all the code that sets hooks to a single function should be reported as (minor) bugs, and all the documentation that does that should be reported as (non-minor) bugs. A quick grep in the EMACS_22_BASE branch disn't show me the sample code you refer to, so could you please tell us where you found it? This said, using `memq' on a hook is indeed an error. Stefan PS: You should "never" modify a hook with setq, always use `add-hook'.