Re: [O] [BUG] Hotkeys defined in org-tag-alist repeated in agenda filter dispatcher

2013-04-24 Thread Bastien
Hi Viktor,

thanks for the patient and detailed debugging.

I don't have time to test the attached patch myself, but given your
description it should be okay.

Can you test it and report?  Otherwise I will test this myself later
on.

Thanks!

diff --git a/lisp/org.el b/lisp/org.el
index c76ddd0..d75f6c2 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -17985,9 +17985,8 @@ When a buffer is unmodified, it is just killed.  When modified, it is saved
 		  (append org-todo-keyword-alist-for-agenda org-todo-key-alist))
 	(setq org-drawers-for-agenda
 		  (append org-drawers-for-agenda org-drawers))
-	(unless (equal org-tag-alist-for-agenda org-tag-alist)
-	  (setq org-tag-alist-for-agenda
-		(append org-tag-alist-for-agenda org-tag-alist)))
+	(setq org-tag-alist-for-agenda
+		  (org-uniquify (append org-tag-alist-for-agenda org-tag-alist)))
 	(if org-group-tags
 		(setq org-tag-groups-alist-for-agenda
 		  (org-uniquify-alist

-- 
 Bastien


Re: [O] [BUG] Hotkeys defined in org-tag-alist repeated in agenda filter dispatcher

2013-04-24 Thread Viktor Rosenfeld
Hi Bastien,

with this patch, everything works as expected.

Thanks!

Cheers,
Viktor

Bastien wrote:

 Hi Viktor,
 
 thanks for the patient and detailed debugging.
 
 I don't have time to test the attached patch myself, but given your
 description it should be okay.
 
 Can you test it and report?  Otherwise I will test this myself later
 on.
 
 Thanks!
 



Re: [O] [BUG] Hotkeys defined in org-tag-alist repeated in agenda filter dispatcher

2013-04-24 Thread Bastien
Hi Viktor,

Viktor Rosenfeld listuse...@gmail.com writes:

 with this patch, everything works as expected.

Applied, thanks for checking!

-- 
 Bastien



Re: [O] [BUG] Hotkeys defined in org-tag-alist repeated in agenda filter dispatcher

2013-04-22 Thread Bastien
Hi Viktor,

Viktor Rosenfeld listuse...@gmail.com writes:

 If I hit the =/= key in the agenda to filter the agenda by tag, the
 hotkeys defined in the list above are repeated multiple times.

Can you test this patch against latest maint or master branch?

Thanks,

From 4c5a5d0fd1433f82e66344d2038f735c09643e3f Mon Sep 17 00:00:00 2001
From: Bastien Guerry b...@altern.org
Date: Mon, 22 Apr 2013 11:25:39 +0200
Subject: [PATCH] org.el (org-agenda-prepare-buffers): Fix setting of
 `org-tag-alist'

* org.el (org-agenda-prepare-buffers): Don't append tags to
`org-tag-alist-for-agenda' when `org-tag-alist-for-agenda' is
not initially set.

Thanks to Viktor Rosenfeld for reporting this.
---
 lisp/org.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 70bee87..2f04f1c 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -17974,7 +17974,8 @@ When a buffer is unmodified, it is just killed.  When modified, it is saved
 		  (append org-todo-keyword-alist-for-agenda org-todo-key-alist))
 	(setq org-drawers-for-agenda
 		  (append org-drawers-for-agenda org-drawers))
-	(unless (equal org-tag-alist-for-agenda org-tag-alist)
+	(unless (and org-tag-alist-for-agenda
+			 (equal org-tag-alist-for-agenda org-tag-alist))
 	  (setq org-tag-alist-for-agenda
 		(append org-tag-alist-for-agenda org-tag-alist)))
 	(if org-group-tags
-- 
1.8.2


-- 
 Bastien


Re: [O] [BUG] Hotkeys defined in org-tag-alist repeated in agenda filter dispatcher

2013-04-22 Thread Viktor Rosenfeld
Hi Bastian,

Bastien wrote:

 Hi Viktor,
 
 Viktor Rosenfeld listuse...@gmail.com writes:
 
  If I hit the =/= key in the agenda to filter the agenda by tag, the
  hotkeys defined in the list above are repeated multiple times.
 
 Can you test this patch against latest maint or master branch?

The problem still remains with the patch. However, I was able to narrow
the problem to a specific line and can provide a minimal example:

Consider the following configuration (which is loaded in init.el via
org-babel-load-file):

#+BEGIN_SRC emacs-lisp
(global-set-key (kbd f12) 'org-agenda)

(setq org-agenda-files '(
  ~/org/dokumente.org
  ~/org/openloops.org
  ~/org/routine.org
  ~/org/arbeit.org
 ))

(setq org-tag-alist '((:startgroup . nil)
 (@home . ?h)
 (@comp . ?c)
 (@otg . ?o)
 (@fon . ?f)
 (@agenda . ?a) 
 (@read . ?r)
 (@write . ?w)
 (:endgroup . nil)
 (:startgroup . nil)
 (IMPORTANT . ?*)
 (SOMEDAY . ??)
 (:endgroup . nil)))
#+END_SRC

The four agenda files are as follows: The first file, dokumente.org
caontains a single headline and a #+TAGS: definition:

#+BEGIN_SRC org :tangle dokumente.org
#+TAGS: foo

* 1996
#+END_SRC

The other three files only contain a heading and no #+TAGS: definition:

#+BEGIN_SRC org :tangle openloops.org
* Inbox
#+END_SRC

#+BEGIN_SRC org :tangle routine.org
* Review
#+END_SRC

#+BEGIN_SRC org :tangle arbeit.org
* 1996
#+END_SRC

With this setup the tag hotkeys are repeated three times, one time for
each file with no tags definition. If I remove the #+TAGS definition in
dokumente.org, the bug disappears. If I add a #+TAGS definition to every
other file, then no tag hotkeys are printed, which is another unexpected
behavior. In other words, the presence of #+TAGS in a file causes the
tag hotkeys to repeated once for every file which does not have a #+TAGS
definition. To achieve the correct behavior, either no #+TAGS:
definition must appear anywhere or there must be exactly one file
without a #+TAGS definition.

Note that the number of repetions also depends on where the file with
the #+TAGS definition is located in the org-agenda-files list. Using the
four files above, if I move the file dokumente.org with the #+TAGS
definition to the end of the list then there are no repetitions.

Cheers,
Viktor

 
 Thanks,
 




[O] [BUG] Hotkeys defined in org-tag-alist repeated in agenda filter dispatcher

2013-04-21 Thread Viktor Rosenfeld
Hi,

I have the following tags defined in my initialization code:

#+BEGIN_SRC emacs-lisp
(setq org-tag-alist '((:startgroup . nil)
  (@home . ?h)
  (@comp . ?c)
  (@otg . ?o)
  (@fon . ?f)
  (@agenda . ?a) 
  (@read . ?r)
  (@write . ?w)
  (:endgroup . nil)
  (:startgroup . nil)
  (IMPORTANT . ?*)
  (SOMEDAY . ??)
  (:endgroup . nil)))
#+END_SRC

If I hit the =/= key in the agenda to filter the agenda by tag, the
hotkeys defined in the list above are repeated multiple times. That
is, the string in the Emacs minibuffer reads:

#+BEGIN_EXAMPLE
Narrow by tag 
[hcofarw*?hcofarw*?hcofarw*?hcofarw*?hcofarw*?hcofarw*?hcofarw*?hcofarw*?hcofarw*?
 ], [TAB], ...
#+END_EXAMPLE

This only happens if =org-agenda-files= is set to a directory (or list
of directories), e.g.:

#+BEGIN_SRC emacs-lisp
(setq org-agenda-files '( ~/org ))
#+END_SRC

If =org-agenda-files= is set to a list of files the hotkeys are not
repeated. E.g.:

#+BEGIN_SRC emacs-lisp
(setq org-agenda-files '( ~/org/openloops.org 
  ~/org/dokumente.org))
#+END_SRC

With the setting above the string in the Emacs minibuffer reads, as
expected:

#+BEGIN_EXAMPLE
Narrow by tag [hcofarw*? ], [TAB], ...
#+END_EXAMPLE

git bisect reveals the following commit as the culprit:
http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=575c9f16c3a1dc6660dd1aebdd560ec7caa1365e

However, before this commit, none of the hotkeys appear in the
minibuffer, which is another bug. Apparently, the last commit where
everything works as expected is:
http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=a9880a7710415218d3940e380968a9ed56367880
 

I am on Ubuntu 12.04.2 with a backported Emacs 24.3.1.

Cheers,
Viktor