org: Option for user to force non fast tag selection interface

* lisp/org.el (org-set-tags-command): Disable the fast tag selection
  interface when the command is prefixed by C-u C-u.
This commit is contained in:
Marco Wahl 2019-01-05 13:16:31 +01:00
parent 99f0c53418
commit 2862bea69b
2 changed files with 62 additions and 50 deletions

View File

@ -123,6 +123,12 @@ It was unused throughout the code base.
** Miscellaneous
*** Org Table reads numbers starting with 0 as strings
*** Disable fast tag selection interface via prefix arg
A call of ~org-set-tags-command~ with prefix argument C-u C-u avoids
the fast tag selection interface and instead offers the plain
interface.
* Version 9.2
** Incompatible changes
*** Removal of OrgStruct mode mode and radio lists

View File

@ -14165,18 +14165,24 @@ tags."
When called with `\\[universal-argument]' prefix argument ARG, \
realign all tags
in the current buffer. If a region is active, set tags for
all headlines in the region.
in the current buffer.
When called with `\\[universal-argument] \\[universal-argument]' prefix argument, \
unconditionally do not
offer the fast tag selection interface.
If a region is active, set tags in the region according to the
setting of `org-loop-over-headlines-in-active-region'.
This function is for interactive use only;
in Lisp code use `org-set-tags' instead."
(interactive "P")
(let ((org-use-fast-tag-selection
(unless (equal '(16) arg) org-use-fast-tag-selection)))
(cond
(arg (org-align-tags t))
((equal '(4) arg) (org-align-tags t))
((and (org-region-active-p) org-loop-over-headlines-in-active-region)
;; Disable `org-loop-over-headlines-in-active-region' for
;; successive calls.
(let (org-loop-over-headlines-in-active-region)
(let (org-loop-over-headlines-in-active-region) ; hint: infinite recursion.
(org-map-entries
#'org-set-tags-command
nil
@ -14218,7 +14224,7 @@ in Lisp code use `org-set-tags' instead."
#'org-tags-completion-function
nil nil (org-make-tag-string current-tags)
'org-tags-history)))))))
(org-set-tags tags))))))
(org-set-tags tags)))))))
(defun org-align-tags (&optional all)
"Align tags in current entry.