emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* automatic completion of file tags
@ 2020-01-23  8:54 Alan Schmitt
  2020-01-26 17:04 ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Schmitt @ 2020-01-23  8:54 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I'm playing with an implementation of Zettelkasten using deft and org
files, and I want to tag each note with some tags taken from a list (I'm
using the ~#FILETAGS:~ line for that at the moment). Is there a builtin
org way of doing it (have a list of tags defined somewhere and tag a
whole file with them using some completion mechanism, as for headlines),
or do I need to roll up my own?

Thanks,

Alan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: automatic completion of file tags
  2020-01-23  8:54 automatic completion of file tags Alan Schmitt
@ 2020-01-26 17:04 ` Bastien
  2020-01-26 18:37   ` Alan Schmitt
  0 siblings, 1 reply; 4+ messages in thread
From: Bastien @ 2020-01-26 17:04 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode

Hi Alan,

> I'm playing with an implementation of Zettelkasten using deft and org
> files, and I want to tag each note with some tags taken from a list (I'm
> using the ~#FILETAGS:~ line for that at the moment). Is there a builtin
> org way of doing it (have a list of tags defined somewhere and tag a
> whole file with them using some completion mechanism, as for headlines),
> or do I need to roll up my own?

I'm not entirely sure: you want to tag all headline in a file with
multiple pre-defined tags?

With `org-loop-over-headlines-in-active-region' set to `t', you can
tag multiple headlines by selecting a region with the headlines you
want to tag, then C-c C-q to tag them one after another.

You cannot add multiple tags for each headline this way, though.

I would go for defining a temporary local tag like "replaceme" to
tag multiple (all) headline in the file, then simpy search/replace
occurrences of "replaceme" with your:list:of:tags

HTH,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: automatic completion of file tags
  2020-01-26 17:04 ` Bastien
@ 2020-01-26 18:37   ` Alan Schmitt
  2020-01-27 11:12     ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Schmitt @ 2020-01-26 18:37 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Hi Bastien,

On 2020-01-26 18:04, Bastien <bzg@gnu.org> writes:

> I'm not entirely sure: you want to tag all headline in a file with
> multiple pre-defined tags?

There are no headlines in the file (it's a small note). I want to tag
the file itself (or its content). It's mostly to help with full-text
search (I prefix my tags with '#' so they don't occur otherwise). I
think the notion of file tag does not really exist in org mode, but as
there is a '+#FILETAGS:' cookie (?), I was wondering if there was
infrastructure to help me enter the tags there.

> With `org-loop-over-headlines-in-active-region' set to `t', you can
> tag multiple headlines by selecting a region with the headlines you
> want to tag, then C-c C-q to tag them one after another.
>
> You cannot add multiple tags for each headline this way, though.
>
> I would go for defining a temporary local tag like "replaceme" to
> tag multiple (all) headline in the file, then simpy search/replace
> occurrences of "replaceme" with your:list:of:tags

Thank you. This is not what I want to do, but it's nice to know how to
do this.

Alan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: automatic completion of file tags
  2020-01-26 18:37   ` Alan Schmitt
@ 2020-01-27 11:12     ` Bastien
  0 siblings, 0 replies; 4+ messages in thread
From: Bastien @ 2020-01-27 11:12 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode

Hi Alan,

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> There are no headlines in the file (it's a small note). I want to tag
> the file itself (or its content). It's mostly to help with full-text
> search (I prefix my tags with '#' so they don't occur otherwise). I
> think the notion of file tag does not really exist in org mode, but as
> there is a '+#FILETAGS:' cookie (?), I was wondering if there was
> infrastructure to help me enter the tags there.

Thanks - I now understand better.

You may want to hack something together based on this:

#+begin_src emacs-lisp
(replace-regexp-in-string "::+" ":" (mapconcat (lambda(s) (if (stringp (car s)) (car s))) org-tag-alist ":"))
#+end_src

-- 
 Bastien

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-01-27 11:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-23  8:54 automatic completion of file tags Alan Schmitt
2020-01-26 17:04 ` Bastien
2020-01-26 18:37   ` Alan Schmitt
2020-01-27 11:12     ` Bastien

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).