From mboxrd@z Thu Jan 1 00:00:00 1970 From: Phil Hudson Subject: org-agenda-bulk-custom-functions Customize mismatch Date: Sun, 08 May 2016 14:57:21 +0100 Message-ID: <87mvo0irem.fsf@quiz.hudson-it.ddns.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azPBx-0003dD-6i for emacs-orgmode@gnu.org; Sun, 08 May 2016 09:56:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1azPBs-00040f-P8 for emacs-orgmode@gnu.org; Sun, 08 May 2016 09:56:15 -0400 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:33526) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azPBs-00040a-I4 for emacs-orgmode@gnu.org; Sun, 08 May 2016 09:56:12 -0400 Received: by mail-wm0-x22e.google.com with SMTP id g17so16570675wme.0 for ; Sun, 08 May 2016 06:56:12 -0700 (PDT) Received: from quiz.hudson-it.ddns.net.quiz.hudson-it.ddns.net (82-71-5-38.dsl.in-addr.zen.co.uk. [82.71.5.38]) by smtp.gmail.com with ESMTPSA id l124sm18939960wmf.11.2016.05.08.06.56.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 May 2016 06:56:11 -0700 (PDT) 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" To: emacs-orgmode@gnu.org Another defcustom mismatched with the code. At line 9962 of org-agenda.el (20160502 release) we have: (setq cmd (list (cadr (assoc action org-agenda-bulk-custom-functions))) This assumes that `org-agenda-bulk-custom-functions` is a list-of-two-element-lists alist. Thus, the `cadr` form returns (should return) the second element of one two-element list from the alist. However, the defcustom is declared as type alist, which in defcustom means (by default) a list-of-conses alist. See if you agree with my thinking about this. This means that the code must always fail if the Customize UI is used to populate `org-agenda-bulk-custom-functions`. That in turn implies that (to a first approximation) zero users apart from me have tried to declare a custom bulk agenda command with its own custom key via Customize. Oh well. If my diagnosis is correct, then I see two ways to fix it: either change the defcustom to create a list-of-two-element-lists alist, or change the code so that it handles a list-of-conses alist. The first approach is supported by defcustom and gives us the chance to be both more descriptive and more prescriptive. It shouldn't break anything that isn't in fact already broken. The second approach is as simple as changing that `cadr` to a `cdr`, but it does risk breaking working configs where the alist was populated procedurally. I propose the first. Here's a patch. -- Phil Hudson http://hudson-it.ddns.net @UWascalWabbit PGP/GnuPG ID: 0x887DCA63 --- org-20160502/org-agenda.el 2016-05-07 10:18:22.000000000 +0100 +++ org-mode-mod/org-agenda.el 2016-05-08 14:39:52.000000000 +0100 @@ -1999,7 +1999,7 @@ With selected entries in an agenda buffer, `B R' will call the custom function `set-category' on the selected entries. Note that functions in this alist don't need to be quoted." - :type 'alist + :type '(alist :key-type character :value-type (group function)) :version "24.1" :group 'org-agenda)