From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Borchmann Subject: Filters lost after reviving buried, sticky agenda Date: Fri, 01 May 2015 23:19:36 +0200 Message-ID: <877fssro5z.fsf@tu-dresden.de> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoIfQ-0003Vh-CG for emacs-orgmode@gnu.org; Fri, 01 May 2015 17:40:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YoIfN-0003zE-J0 for emacs-orgmode@gnu.org; Fri, 01 May 2015 17:40:16 -0400 Received: from plane.gmane.org ([80.91.229.3]:56209) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoIfN-0003uu-Cv for emacs-orgmode@gnu.org; Fri, 01 May 2015 17:40:13 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YoIfF-0007Qi-En for emacs-orgmode@gnu.org; Fri, 01 May 2015 23:40:05 +0200 Received: from port-92-195-3-80.dynamic.qsc.de ([92.195.3.80]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 01 May 2015 23:40:05 +0200 Received: from daniel.borchmann by port-92-195-3-80.dynamic.qsc.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 01 May 2015 23:40:05 +0200 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: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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 =2D-->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))))) ...)) =2D--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 =2D-->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)))))) ...) =2D--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 =2D-=20 Daniel Borchmann http://daniel.kxpq.de GPG (Mail) 0849 473E 6BF0 B504 DF0B D640 455E 3610 01FF 778F --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJVQ+3sAAoJEEVeNhAB/3ePFiwQAIwLCye6p2t0W/csl/NHB3b5 6Hid/7uVipBLs+de9VSTFN+fJvznMl5UJ8TRWVku+omcDBbk8fBuy5OLaf7GoU3B 135i0dd2AOX9TPPL/oTNbKMk0xdR2sqW/3fJhmAbnEcNMxdKWSABJjbGb1kkgG1I sLIdHERQ35siCHh373DdKAFg+qE6wdQTu/ZbvJuyAh0wCIwTTTNHHT4a2vWIq5Hg lHgQyaxPxqBvFx1xZFDcHLbIbE8mg04+yO6qL3h4jI9PUvtuyiWGJUByXXeFd75M SUiKWZUTDQcXEVydJPHphW+KS6FJ8L3/m5fm+Iw8K24jMyTp80OZoCm8PRo1CPer 5MH5655MKZVzjBz6i8ABPxg30oNVfci/HI7wKRrtQ9L9+FDcUdQvjTF0ozjpwiLz 1NnwsRTi2z+t6eV2NtXtuWS0NCqt36fEhXpag1ohmfRyDZKwX7lgn3JrF0oiQ02B YibQdRUMo6NI5XP+TSkajU53VdoV3scYUdOIOJV48XJhsb8ArBdGqkTXDMTqgRt1 rLZpwYMp9FOqOVCRdsMOoR68BUNSNHQwXYj3UTkaSvxe9ThSobS4ug/a+q2nwH8w lPjxUG3ld5tbC5sKf7vfCf+einpW6/SrQhn6p+yvBWFBhoVkhugx07nKSk5veYL2 HksDCDRr0ZFRE1Qu0EtE =m8Px -----END PGP SIGNATURE----- --=-=-=--