Prechádzať zdrojové kódy

org-pcomplete: Fix TAGS completion

* lisp/org-pcomplete.el (pcomplete/org-mode/file-option/tags):
(pcomplete/org-mode/tag): Use new `org-current-tag-alist' instead of
`org-tag-alist' so as to take `org-tag-persistent-alist' into
consideration.
Nicolas Goaziou 9 rokov pred
rodič
commit
2a49038fd6
1 zmenil súbory, kde vykonal 4 pridanie a 3 odobranie
  1. 4 3
      lisp/org-pcomplete.el

+ 4 - 3
lisp/org-pcomplete.el

@@ -42,6 +42,7 @@
 (declare-function org-buffer-property-keys "org"
 (declare-function org-buffer-property-keys "org"
 		  (&optional specials defaults columns ignore-malformed))
 		  (&optional specials defaults columns ignore-malformed))
 (declare-function org-entry-properties "org" (&optional pom which specific))
 (declare-function org-entry-properties "org" (&optional pom which specific))
+(declare-function org-tag-alist-to-string "org" (alist &optional skip-key))
 
 
 ;;;; Customization variables
 ;;;; Customization variables
 
 
@@ -52,7 +53,7 @@
 
 
 (defvar org-drawer-regexp)
 (defvar org-drawer-regexp)
 (defvar org-property-re)
 (defvar org-property-re)
-(defvar org-tag-alist)
+(defvar org-current-tag-alist)
 
 
 (defun org-thing-at-point ()
 (defun org-thing-at-point ()
   "Examine the thing at point and let the caller know what it is.
   "Examine the thing at point and let the caller know what it is.
@@ -241,7 +242,7 @@ When completing for #+STARTUP, for example, this function returns
 (defun pcomplete/org-mode/file-option/tags ()
 (defun pcomplete/org-mode/file-option/tags ()
   "Complete arguments for the #+TAGS file option."
   "Complete arguments for the #+TAGS file option."
   (pcomplete-here
   (pcomplete-here
-   (list (org-tag-alist-to-string org-tag-alist))))
+   (list (org-tag-alist-to-string org-current-tag-alist))))
 
 
 (defun pcomplete/org-mode/file-option/title ()
 (defun pcomplete/org-mode/file-option/title ()
   "Complete arguments for the #+TITLE file option."
   "Complete arguments for the #+TITLE file option."
@@ -334,7 +335,7 @@ This needs more work, to handle headings with lots of spaces in them."
 			      (or (remq
 			      (or (remq
 				   nil
 				   nil
 				   (mapcar (lambda (x) (org-string-nw-p (car x)))
 				   (mapcar (lambda (x) (org-string-nw-p (car x)))
-					   org-tag-alist))
+					   org-current-tag-alist))
 				  (mapcar #'car (org-get-buffer-tags))))))
 				  (mapcar #'car (org-get-buffer-tags))))))
 		    (dolist (tag (org-get-tags))
 		    (dolist (tag (org-get-tags))
 		      (setq lst (delete tag lst)))
 		      (setq lst (delete tag lst)))