emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

About completion-ignore-case in org-tags-completion-function


From: tumashu
Subject: About completion-ignore-case in org-tags-completion-function
Date: Wed, 14 Apr 2021 20:30:24 +0800 (CST)

In org-tags-completion-function,  completion-ignore-case force nil, 
what about set it to t?

tags are case-sensitive,  wile this function is used to search tag.

--------------------------------------------------------
(defun org-tags-completion-function (string _predicate &optional flag)
  "Complete tag STRING.
FLAG specifies the type of completion operation to perform.  This
function is passed as a collection function to `completing-read',
which see."
  (let ((completion-ignore-case nil)    ;tags are case-sensitive
        (confirm (lambda (x) (stringp (car x))))
        (prefix ""))
    (when (string-match "^\\(.*[-+:&,|]\\)\\([^-+:&,|]*\\)$" string)
      (setq prefix (match-string 1 string))
      (setq string (match-string 2 string)))
    (pcase flag
      (`t (all-completions string org-last-tags-completion-table confirm))
      (`lambda (assoc string org-last-tags-completion-table)) ;exact match?
      (`nil
       (pcase (try-completion string org-last-tags-completion-table confirm)
         ((and completion (pred stringp))
          (concat prefix
                  completion
                  (if (and org-add-colon-after-tag-completion
                           (assoc completion org-last-tags-completion-table))
                      ":"
                    "")))
         (completion completion)))
      (_ nil))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]