emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "H.M. Pham" <phamhm@gmail.com>
To: emacs-orgmode@gnu.org
Subject: 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	[thread overview]
Message-ID: <CAJJ-Z=oW6qTfGgG4BrRO-1HrCi9N9iJ7dGABwbYQCOx0aWLKxg@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2526 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 6346 bytes --]

             reply	other threads:[~2017-05-20  7:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-20  7:46 H.M. Pham [this message]
2017-05-20 13:25 ` Bug: org tags [9.0.7 (9.0.7-elpaplus @ ~/.emacs.d/elpa/org-plus-contrib-20170515/)] Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJJ-Z=oW6qTfGgG4BrRO-1HrCi9N9iJ7dGABwbYQCOx0aWLKxg@mail.gmail.com' \
    --to=phamhm@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).