From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xebar Saram Subject: add additional tag (using %^G) to existing tag in org capture Date: Thu, 7 Sep 2017 20:31:05 +0300 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a113779ee435c3605589cd37e" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dq0e1-0005x0-G9 for emacs-orgmode@gnu.org; Thu, 07 Sep 2017 13:31:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dq0dw-0003em-MR for emacs-orgmode@gnu.org; Thu, 07 Sep 2017 13:31:13 -0400 Received: from mail-pf0-x22d.google.com ([2607:f8b0:400e:c00::22d]:35138) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dq0dw-0003dt-GZ for emacs-orgmode@gnu.org; Thu, 07 Sep 2017 13:31:08 -0400 Received: by mail-pf0-x22d.google.com with SMTP id g13so534862pfm.2 for ; Thu, 07 Sep 2017 10:31:07 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: org mode --001a113779ee435c3605589cd37e Content-Type: text/plain; charset="UTF-8" Hi! I have this current capture (add-to-list 'org-capture-templates '("bb" "Work.TODO" entry (file+headline (concat pmm "/org/files/agenda/bgu.org") "TDEN") "* TODO %^G %? :@work: \n%^T" )) which seems to work by adding a tag (via the %^G) alongside the current already defined tag in the capture template. is there anyway to add a tag to the current tag in the capture template (:@work: above). Thx! Z --001a113779ee435c3605589cd37e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi!

I have this current capture

= (add-to-list 'org-capture-templates '("bb" "Work.TOD= O" entry (file+headline (concat pmm "/org/files/agenda/bgu.org") "TDEN") "* TODO %^G %? := @work: \n%^T"
))

which seems to work by adding a tag (via th= e %^G) alongside the current already defined tag in the capture template.
is there anyway to add a tag to the current tag in the capture templa= te (:@work: above).

Thx!

= Z
--001a113779ee435c3605589cd37e-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Porter Subject: Re: add additional tag (using %^G) to existing tag in org capture Date: Fri, 08 Sep 2017 00:04:01 -0500 Message-ID: <87377xdbni.fsf@alphapapa.net> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqBT5-0000Rs-Po for emacs-orgmode@gnu.org; Fri, 08 Sep 2017 01:04:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dqBT1-0003vC-Ea for emacs-orgmode@gnu.org; Fri, 08 Sep 2017 01:04:39 -0400 Received: from [195.159.176.226] (port=47521 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dqBT1-0003uy-7P for emacs-orgmode@gnu.org; Fri, 08 Sep 2017 01:04:35 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dqBSc-0002V0-OT for emacs-orgmode@gnu.org; Fri, 08 Sep 2017 07:04:10 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Xebar Saram writes: > is there anyway to add a tag to the current tag in the capture template (:@work: above). Hey Z, Sorry, I don't understand the question. Can you clarify what you mean? From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xebar Saram Subject: Re: add additional tag (using %^G) to existing tag in org capture Date: Fri, 8 Sep 2017 08:28:11 +0300 Message-ID: References: <87377xdbni.fsf@alphapapa.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="f403043e75d4d591a30558a6d7a8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqBpy-0004VU-Bo for emacs-orgmode@gnu.org; Fri, 08 Sep 2017 01:28:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dqBpt-00062I-Kx for emacs-orgmode@gnu.org; Fri, 08 Sep 2017 01:28:18 -0400 Received: from mail-pf0-x22c.google.com ([2607:f8b0:400e:c00::22c]:35168) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dqBpt-000612-DQ for emacs-orgmode@gnu.org; Fri, 08 Sep 2017 01:28:13 -0400 Received: by mail-pf0-x22c.google.com with SMTP id g13so2997922pfm.2 for ; Thu, 07 Sep 2017 22:28:13 -0700 (PDT) In-Reply-To: <87377xdbni.fsf@alphapapa.net> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Adam Porter Cc: org mode --f403043e75d4d591a30558a6d7a8 Content-Type: text/plain; charset="UTF-8" Hi and thx for the response the issues is that it dosent seem to add an additional tag to the already defined tag list in the capture (:@work: ) but instead add another :TAG: field apart from the already existing tag field. so the final result looks like this: ** TODO TEST :@work: :TAG: while i expect the %^G capture to add to the existing tag entry so it looks like this ** TODO TEST :@work:TAG: thx! Z On Fri, Sep 8, 2017 at 8:04 AM, Adam Porter wrote: > Xebar Saram writes: > > > is there anyway to add a tag to the current tag in the capture template > (:@work: above). > > Hey Z, > > Sorry, I don't understand the question. Can you clarify what you mean? > > > --f403043e75d4d591a30558a6d7a8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi and thx for the response

the issues = is that it dosent seem to add an additional tag to the already defined tag = list in the capture (:@work:=C2=A0) but instead add another :TAG: field apart= from the already existing tag field. so the final result looks like this:<= /span>

** TODO TEST =C2=A0:@work: =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 :TAG:

while i expect the=C2=A0%^G capture to add to the existing=C2= =A0tag entry so it looks like this

** TODO TE= ST =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:@work:TAG= :

thx!

<= div>Z

On Fri, Sep 8, 2017 at 8:04 AM, Ada= m Porter <adam@alphapapa.net> wrote:
Xebar Saram <zeltakc@gmail.com> writes:

> is there anyway to add a tag to the current tag in the capture templat= e (:@work: above).

Hey Z,

Sorry, I don't understand the question.=C2=A0 Can you clarify what you = mean?



--f403043e75d4d591a30558a6d7a8-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Porter Subject: Re: add additional tag (using %^G) to existing tag in org capture Date: Fri, 08 Sep 2017 05:11:15 -0500 Message-ID: <87wp59biv0.fsf@alphapapa.net> References: <87377xdbni.fsf@alphapapa.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49069) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqGGX-00062y-DB for emacs-orgmode@gnu.org; Fri, 08 Sep 2017 06:12:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dqGGS-0000YM-PV for emacs-orgmode@gnu.org; Fri, 08 Sep 2017 06:12:01 -0400 Received: from [195.159.176.226] (port=59171 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dqGGS-0000XO-J7 for emacs-orgmode@gnu.org; Fri, 08 Sep 2017 06:11:56 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dqGFy-0002wf-2m for emacs-orgmode@gnu.org; Fri, 08 Sep 2017 12:11:26 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Xebar Saram writes: > the issues is that it dosent seem to add an additional tag to the already defined tag list in the capture (:@work: ) but instead add another :TAG: field > apart from the already existing tag field. so the final result looks like this: > > ** TODO TEST :@work: :TAG: > > while i expect the %^G capture to add to the existing tag entry so it looks like this > > ** TODO TEST :@work:TAG: Hey Z, I understand now. Yes, that happens because org-capture-fill-template inserts the tag text manually, like this: #+BEGIN_SRC elisp (let* ((org-last-tags-completion-table (org-global-tags-completion-table (cond ((equal key "G") (org-agenda-files)) (file (list file)) (t nil)))) (org-add-colon-after-tag-completion t) (ins (mapconcat #'identity (org-split-string (completing-read (if prompt (concat prompt ": ") "Tags: ") 'org-tags-completion-function nil nil nil 'org-tags-history) "[^[:alnum:]_@#%]+") ":"))) (when (org-string-nw-p ins) (unless (eq (char-before) ?:) (insert ":")) (insert ins) (unless (eq (char-after) ?:) (insert ":")) (and (org-at-heading-p) (let ((org-ignore-region t)) (org-set-tags nil 'align))))) #+END_SRC It would be simple to have it use org-set-tags-to instead of inserting them manually. I guess that would be correct in the vast majority of cases, however IIUC it would be a change in functionality, as the %^G could be put anywhere in the template and insert tags there (which seems like a strange thing to do, but you never know). On the other hand, it seems like what you're asking for would be the more expected functionality, in which case this would be a bug fix. So maybe the maintainers would accept a patch for that, or maybe not... :) From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: add additional tag (using %^G) to existing tag in org capture Date: Sun, 10 Sep 2017 09:46:49 +0200 Message-ID: <878thn2dxy.fsf@nicolasgoaziou.fr> References: <87377xdbni.fsf@alphapapa.net> <87wp59biv0.fsf@alphapapa.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60223) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqwxD-0006Jq-70 for emacs-orgmode@gnu.org; Sun, 10 Sep 2017 03:46:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dqwxA-0007gN-3h for emacs-orgmode@gnu.org; Sun, 10 Sep 2017 03:46:55 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:51843) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dqwx9-0007fV-TQ for emacs-orgmode@gnu.org; Sun, 10 Sep 2017 03:46:52 -0400 In-Reply-To: <87wp59biv0.fsf@alphapapa.net> (Adam Porter's message of "Fri, 08 Sep 2017 05:11:15 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Adam Porter Cc: emacs-orgmode@gnu.org Hello, Adam Porter writes: > Xebar Saram writes: > >> the issues is that it dosent seem to add an additional tag to the already defined tag list in the capture (:@work: ) but instead add another :TAG: field >> apart from the already existing tag field. so the final result looks like this: >> >> ** TODO TEST :@work: :TAG: >> >> while i expect the %^G capture to add to the existing tag entry so it looks like this >> >> ** TODO TEST :@work:TAG: > > Hey Z, > > I understand now. Yes, that happens because org-capture-fill-template > inserts the tag text manually, like this: > > #+BEGIN_SRC elisp > (let* ((org-last-tags-completion-table > (org-global-tags-completion-table > (cond ((equal key "G") (org-agenda-files)) > (file (list file)) > (t nil)))) > (org-add-colon-after-tag-completion t) > (ins (mapconcat > #'identity > (org-split-string > (completing-read > (if prompt (concat prompt ": ") "Tags: ") > 'org-tags-completion-function nil nil nil > 'org-tags-history) > "[^[:alnum:]_@#%]+") > ":"))) > (when (org-string-nw-p ins) > (unless (eq (char-before) ?:) (insert ":")) > (insert ins) > (unless (eq (char-after) ?:) (insert ":")) > (and (org-at-heading-p) > (let ((org-ignore-region t)) > (org-set-tags nil 'align))))) > #+END_SRC > > It would be simple to have it use org-set-tags-to instead of inserting > them manually. I guess that would be correct in the vast majority of > cases, however IIUC it would be a change in functionality, as the %^G > could be put anywhere in the template and insert tags there (which seems > like a strange thing to do, but you never know). On the other hand, it > seems like what you're asking for would be the more expected > functionality, in which case this would be a bug fix. So maybe the > maintainers would accept a patch for that, or maybe not... :) Either case sounds odd to me. As you point out, using `org-set-tags-to' means "%^G" is no longer a placeholder, since the change is likely to happen is some other location. >From a UI POV, turning "^%G" into a property, e.g., :ask-for-tags, could make more sense. WDYT? Regards, -- Nicolas Goaziou