From mboxrd@z Thu Jan 1 00:00:00 1970 From: Allen Li Subject: Re: Bug: org-agenda-overriding-columns-format destroyed on revert [9.2.1 (9.2.1-2-gc6d37c-elpaplus)] Date: Wed, 13 Feb 2019 08:37:59 +0000 Message-ID: References: <808syk5cis.fsf@felesatra.moe> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:52398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtqG7-0002Tc-Kv for emacs-orgmode@gnu.org; Wed, 13 Feb 2019 03:51:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtq3Y-0004gi-Qx for emacs-orgmode@gnu.org; Wed, 13 Feb 2019 03:38:13 -0500 Received: from mail-it1-x12e.google.com ([2607:f8b0:4864:20::12e]:50672) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gtq3Y-0004gS-G1 for emacs-orgmode@gnu.org; Wed, 13 Feb 2019 03:38:12 -0500 Received: by mail-it1-x12e.google.com with SMTP id z7so3986524iti.0 for ; Wed, 13 Feb 2019 00:38:12 -0800 (PST) In-Reply-To: <808syk5cis.fsf@felesatra.moe> 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: Org Mode List On Wed, Feb 13, 2019 at 8:17 AM Allen Li wrote: > > 0. Make /tmp/tmp.org containing > > * TODO foo bar > > 1. emacs -Q > 2. Eval (setq org-agenda-custom-commands '(("n" "n" alltodo "" ((org-agenda-overriding-columns-format "%TODO"))))) > 3. Eval (setq org-agenda-files '("/tmp/tmp.org")) > 4. M-x org-agenda RET n > 5. Move point to item > 6. C-c C-x C-c (column view) > 7. g > > Expected: > > Column format is preserved > > Actual: > > Column format is reset > > (The example uses the version of Org shipped with Emacs, but I can > reproduce with my personal config using latest org-contrib-plus) I'm suspicious of org-agenda-mode -> kill-all-local-variables Debugger entered--killing local value of org-agenda-overriding-columns-format in buffer *Org Agenda(f:SCHEDULED>"")*: debug--implement-debug-watch(org-agenda-overriding-columns-format nil makunbound #"")*>) kill-all-local-variables() org-agenda-mode() org-agenda-prepare("TAGS SCHEDULED>\"\"") org-tags-view((4) "SCHEDULED>\"\"") (let ((org-agenda-sorting-strategy '(scheduled-up)) (org-agenda-overriding-columns-format "%TODO %60ITEM %SCHEDULED")) (org-tags-view '(4) (if current-prefix-arg nil "SCHEDULED>\"\""))) eval((let ((org-agenda-sorting-strategy '(scheduled-up)) (org-agenda-overriding-columns-format "%TODO %60ITEM %SCHEDULED")) (org-tags-view '(4) (if current-prefix-arg nil "SCHEDULED>\"\"")))) org-let(((org-agenda-sorting-strategy '(scheduled-up)) (org-agenda-overriding-columns-format "%TODO %60ITEM %SCHEDULED")) (org-tags-view '(4) (if current-prefix-arg nil "SCHEDULED>\"\""))) (if series-redo-cmd (eval series-redo-cmd) (org-let lprops redo-cmd)) (let* ((p (or (and (looking-at "\\'") (1- (point))) (point))) (cpa (if (eq all t) nil current-prefix-arg)) (org-agenda-doing-sticky-redo org-agenda-sticky) (org-agenda-sticky nil) (org-agenda-buffer-name (or org-agenda-this-buffer-name org-agenda-buffer-name)) (org-agenda-keep-modes t) (tag-filter org-agenda-tag-filter) (tag-preset (get 'org-agenda-tag-filter :preset-filter)) (top-hl-filter org-agenda-top-headline-filter) (cat-filter org-agenda-category-filter) (cat-preset (get 'org-agenda-category-filter :preset-filter)) (re-filter org-agenda-regexp-filter) (re-preset (get 'org-agenda-regexp-filter :preset-filter)) (effort-filter org-agenda-effort-filter) (effort-preset (get 'org-agenda-effort-filter :preset-filter)) (org-agenda-tag-filter-while-redo (or tag-filter tag-preset)) (cols org-agenda-columns-active) (line (org-current-line)) (window-line (- line (org-current-line (window-start)))) (lprops (get 'org-agenda-redo-command 'org-lprops)) (redo-cmd (get-text-property p 'org-redo-cmd)) (last-args (get-text-property p 'org-last-args)) (org-agenda-overriding-cmd (get-text-property p 'org-series-cmd)) (org-agenda-overriding-cmd-arguments (if (eq all t) nil (cond ((listp last-args) (cons (or cpa (car last-args)) (cdr last-args))) ((stringp last-args) last-args)))) (series-redo-cmd (get-text-property p 'org-series-redo-cmd))) (put 'org-agenda-tag-filter :preset-filter nil) (put 'org-agenda-category-filter :preset-filter nil) (put 'org-agenda-regexp-filter :preset-filter nil) (put 'org-agenda-effort-filter :preset-filter nil) (and cols (org-columns-quit)) (message "Rebuilding agenda buffer...") (if series-redo-cmd (eval series-redo-cmd) (org-let lprops redo-cmd)) (setq org-agenda-undo-list nil org-agenda-pending-undo-list nil org-agenda-tag-filter tag-filter org-agenda-category-filter cat-filter org-agenda-regexp-filter re-filter org-agenda-effort-filter effort-filter org-agenda-top-headline-filter top-hl-filter) (message "Rebuilding agenda buffer...done") (put 'org-agenda-tag-filter :preset-filter tag-preset) (put 'org-agenda-category-filter :preset-filter cat-preset) (put 'org-agenda-regexp-filter :preset-filter re-preset) (put 'org-agenda-effort-filter :preset-filter effort-preset) (let ((tag (or tag-filter tag-preset)) (cat (or cat-filter cat-preset)) (effort (or effort-filter effort-preset)) (re (or re-filter re-preset))) (if tag (progn (org-agenda-filter-apply tag 'tag t))) (if cat (progn (org-agenda-filter-apply cat 'category))) (if effort (progn (org-agenda-filter-apply effort 'effort))) (if re (progn (org-agenda-filter-apply re 'regexp)))) (and top-hl-filter (org-agenda-filter-top-headline-apply top-hl-filter)) (and cols (called-interactively-p 'any) (org-agenda-columns)) (org-goto-line line) (recenter window-line)) org-agenda-redo() One oddity is that repeatedly reverting the buffer swaps between the "correct" overriding column format and the default.