emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Daniel Borchmann <daniel.borchmann@tu-dresden.de>
To: emacs-orgmode@gnu.org
Subject: Filters lost after reviving buried, sticky agenda
Date: Fri, 01 May 2015 23:19:36 +0200	[thread overview]
Message-ID: <877fssro5z.fsf@tu-dresden.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 1857 bytes --]


Dear all,

I regularly lose all my filters when I bury a sticky agenda and revive
it later.  In that case, the variable `org-agenda-tag-filter' is set to
nil, although it was non-nil before burying.

I played around a bit, and found out that `org-agenda-tag-filter' is
buffer-local (which is not a surprise).  When the agenda buffer is
revived, the function `org-agenda-prepare' is called, which, among
others, should reset the filters (provided that
`org-agenda-persistent-filter' is set).  The beginning of the function
is

--->8---
(defun org-agenda-prepare (&optional name)
  (let ((filter-alist (if org-agenda-persistent-filter
                          (list `(tag . ,org-agenda-tag-filter)
                                `(re . ,org-agenda-regexp-filter)
                                `(car . ,org-agenda-category-filter)))))
  ...))
---8<---

It seems to me that `org-agenda-tag-filter' is read *before* the old
agenda buffer is poped up (i.e., made current), and thus results in a
`nil' value.  Indeed, if I replace the definition of `filter-alist' by

--->8---
(let ((filter-alist (if org-agenda-persistent-filter
                        (with-current-buffer
                            (get-buffer org-agenda-buffer-name)
                          (list `(tag . ,org-agenda-tag-filter)
                                `(re . ,org-agenda-regexp-filter)
                                `(car . ,org-agenda-category-filter))))))
  ...)
---8<---

then the bug (seems to) disappear.

My question is now: is this correct, or did I understand something
wrong?  If my understanding is correct, how this bug be fixed more
elegantly?

Best,

  Daniel

-- 
Daniel Borchmann                                   http://daniel.kxpq.de
GPG (Mail)            0849 473E 6BF0 B504 DF0B  D640 455E 3610 01FF 778F

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

             reply	other threads:[~2015-05-01 21:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-01 21:19 Daniel Borchmann [this message]
2015-06-21 15:47 ` Filters lost after reviving buried, sticky agenda Daimrod
2015-06-21 18:40   ` Daniel Borchmann
2015-06-22  4:11     ` Daimrod
2015-06-22 15:09       ` Subhan Michael Tindall
2015-06-22 13:27   ` Nick Dokos
2015-06-23  8:47     ` Daimrod
2015-06-23  9:15       ` Daimrod
2015-06-23 21:35         ` Nicolas Goaziou
2015-06-24  7:54           ` Daimrod

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877fssro5z.fsf@tu-dresden.de \
    --to=daniel.borchmann@tu-dresden.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).