emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Bug: org tags [9.0.7 (9.0.7-elpaplus @ ~/.emacs.d/elpa/org-plus-cont


From: H.M. Pham
Subject: [O] Bug: org tags [9.0.7 (9.0.7-elpaplus @ ~/.emacs.d/elpa/org-plus-contrib-20170515/)]
Date: Sat, 20 May 2017 00:46:08 -0700

I just downloaded org-plus-contrib and my customizde capture stopped
working. The function org-set-tags-to is different than the org
package. The let form shows up in the org-plus-contrib. 

(when (let ((case-fold-search nil)) <-------- i think this line is wrong
     (looking-at org-complex-heading-regexp))    

Here is the function in org-plus-contrib
Emacs  : GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.9)
of 2016-10-29
Package: Org mode version 9.0.7 (9.0.7-elpaplus @ /home/hp/.emacs.d/elpa/org-plus-contrib-20170515/)
(defun org-set-tags-to (data)
  "Set the tags of the current entry to DATA, replacing the current tags.
DATA may be a tags string like :aa:bb:cc:, or a list of tags.
If DATA is nil or the empty string, any tags will be removed."
  (interactive "sTags: ")
  (setq data
(cond
((eq data nil) "")
((equal data "") "")
((stringp data)
 (concat ":" (mapconcat 'identity (org-split-string data ":+") ":")
 ":"))
((listp data)
 (concat ":" (mapconcat 'identity data ":") ":"))))
  (when data
    (save-excursion
      (org-back-to-heading t)
      (when (let ((case-fold-search nil))
     (looking-at org-complex-heading-regexp))
(if (match-end 5)
   (progn
     (goto-char (match-beginning 5))
     (insert data)
     (delete-region (point) (point-at-eol))
     (org-set-tags nil 'align))
 (goto-char (point-at-eol))
 (insert " " data)
 (org-set-tags nil 'align)))
      (beginning-of-line 1)
      (when (looking-at ".*?\\([ \t]+\\)$")
(delete-region (match-beginning 1) (match-end 1))))))



Here's the function from org:

(defun org-set-tags-to (data)
  "Set the tags of the current entry to DATA, replacing the current tags.
DATA may be a tags string like :aa:bb:cc:, or a list of tags.
If DATA is nil or the empty string, any tags will be removed."
  (interactive "sTags: ")
  (setq data
(cond
((eq data nil) "")
((equal data "") "")
((stringp data)
 (concat ":" (mapconcat 'identity (org-split-string data ":+") ":")
 ":"))
((listp data)
 (concat ":" (mapconcat 'identity data ":") ":"))))
  (when data
    (save-excursion
      (org-back-to-heading t)
      (when (looking-at org-complex-heading-regexp)
(if (match-end 5)
   (progn
     (goto-char (match-beginning 5))
     (insert data)
     (delete-region (point) (point-at-eol))
     (org-set-tags nil 'align))
 (goto-char (point-at-eol))
 (insert " " data)
 (org-set-tags nil 'align)))
      (beginning-of-line 1)
      (if (looking-at ".*?\\([ \t]+\\)$")
 (delete-region (match-beginning 1) (match-end 1))))))


--
Best, 
Huy Pham

reply via email to

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