diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 84b2a76..15d776f 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -1845,14 +1845,16 @@ Nil means don't hide any tags." (string :tag "Regexp "))) (defcustom org-agenda-remove-tags nil - "Non-nil means remove the tags from the headline copy in the agenda. + "Non-nil means remove tags from the headline in the agenda. When this is the symbol `prefix', only remove tags when -`org-agenda-prefix-format' contains a `%T' specifier." +`org-agenda-prefix-format' contains a `%T' specifier. +When this is a list, only remove the listed tags." :group 'org-agenda-line-format :type '(choice (const :tag "Always" t) - (const :tag "Never" nil) - (const :tag "When prefix format contains %T" prefix))) + (repeat (string :tag "Remove this tag")) + (const :tag "When prefix format contains %T" prefix) + (const :tag "Never" nil))) (org-defvaralias 'org-agenda-remove-tags-when-in-prefix 'org-agenda-remove-tags) @@ -3705,7 +3707,9 @@ generating a new one." (while (org-activate-plain-links (point-max)) (add-text-properties (match-beginning 0) (match-end 0) '(face org-link)))) - (unless (eq org-agenda-remove-tags t) + (unless (or (eq org-agenda-remove-tags t) + (and (listp org-agenda-remove-tags) + (stringp (car org-agenda-remove-tags)))) (org-agenda-align-tags)) (unless org-agenda-with-colors (remove-text-properties (point-min) (point-max) '(face nil))) @@ -6529,8 +6533,13 @@ Any match of REMOVE-RE will be removed from TXT." txt) ;; Tags are in the string (if (or (eq org-agenda-remove-tags t) + (and (symbolp org-agenda-remove-tags) + org-prefix-has-tag) (and org-agenda-remove-tags - org-prefix-has-tag)) + (let ((case-fold-search t)) + (save-match-data + (string-match (regexp-opt org-agenda-remove-tags) + (match-string 0 txt)))))) (setq txt (replace-match "" t t txt)) (setq txt (replace-match (concat (make-string (max (- 50 (length txt)) 1) ?\ )