From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: [PATCH] - Fix org-fast-tag-selection Date: Tue, 03 Apr 2012 09:45:53 -0400 Message-ID: <15477.1333460753@alphaville> References: <87fwclayfa.fsf@noman.maa.corp.collab.net> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:39924) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SF43l-0003tM-0S for emacs-orgmode@gnu.org; Tue, 03 Apr 2012 09:46:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SF43a-0005Ot-Va for emacs-orgmode@gnu.org; Tue, 03 Apr 2012 09:46:08 -0400 Received: from g1t0029.austin.hp.com ([15.216.28.36]:36240) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SF43a-0005Oh-Og for emacs-orgmode@gnu.org; Tue, 03 Apr 2012 09:45:58 -0400 In-Reply-To: Message from Noorul Islam K M of "Tue, 03 Apr 2012 16:13:05 +0530." <87fwclayfa.fsf@noman.maa.corp.collab.net> 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: Noorul Islam K M Cc: nicholas.dokos@hp.com, emacs-orgmode Noorul Islam K M wrote: > > Hello all, > > I have the following setup similar to Bernt Hansen. > > (setq org-tag-alist (quote ((:startgroup) > ("@errand" . ?e) > ("@office" . ?o) > ("@home" . ?h) > (:endgroup) > ("PHONE" . ?p) > ("WAITING" . ?w) > ("HOME" . ?H) > ("CANCELLED" . ?c) > ("NOTE" . ?n) > ("ORG" . ?O)))) > > New when I try to add a new tag with the key press "C-c C-q TAB" from a > heading, I get following backtrace. > > Debugger entered--Lisp error: (wrong-type-argument stringp :endgroup) > string-match("" :endgroup) > ido-read-internal(list "Tag: " nil nil nil nil) > ido-completing-read("Tag: " (#("REFILE" 0 6 (inherited t)) :startgroup "@errand" "@office" "@home" :endgroup "PHONE" "WAITING" "HOME" "CANCELLED" "NOTE" "ORG")) > apply(ido-completing-read "Tag: " (#("REFILE" 0 6 (inherited t)) :startgroup "@errand" "@office" "@home" :endgroup "PHONE" "WAITING" "HOME" "CANCELLED" "NOTE" "ORG") nil) > org-icompleting-read("Tag: " (#("REFILE" 0 6 (inherited t)) :startgroup "@errand" "@office" "@home" :endgroup "PHONE" "WAITING" "HOME" "CANCELLED" "NOTE" "ORG")) > org-fast-tag-selection(nil (#("REFILE" 0 6 (inherited t))) ((:startgroup) ("@errand" . 101) ("@office" . 111) ("@home" . 104) (:endgroup) ("PHONE" . 112) ("WAITING" . 119) ("HOME" . 72) ("CANCELLED" . 99) ("NOTE" . 110) ("ORG" . 79) (#("REFILE" 0 6 (inherited t)))) nil) > org-set-tags(nil nil) > org-set-tags-command(nil) > call-interactively(org-set-tags-command nil nil) > > I think I nailed down the problem and fixed it in the attached patch. > Why did the :endgroup fail and not the :startgroup? Nick > Changelog: > > * lisp/org.el (org-fast-tag-selection): Remove non-string object from org-tag-alist. > > Thanks and Regards > Noorul > > diff --git a/lisp/org.el b/lisp/org.el > index 8ffb6c8..2df860e 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -13756,7 +13756,10 @@ Returns the new tags string, or nil to not change the current settings." > (append (or buffer-tags > (with-current-buffer buf > (mapcar 'car (org-get-buffer-tags)))) > - (mapcar 'car table))))) > + (delq nil > + (mapcar (lambda (x) > + (if (stringp > + (car x)) x)) table)))))) > (quit (setq tg ""))) > (when (string-match "\\S-" tg) > (add-to-list 'buffer-tags (list tg))