From: Ken Mankoff <mankoff@gmail.com>
To: John Kitchin <jkitchin@andrew.cmu.edu>
Cc: David Masterson <dsmasterson@outlook.com>,
Colin Baxter <m43cap@yandex.com>,
"emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Tracking Tags ??
Date: Wed, 23 Jan 2019 13:57:16 -0800 [thread overview]
Message-ID: <87a7jrhwar.fsf@geus3064linuxwsm.geus.dk> (raw)
In-Reply-To: <CAJ51ETpmtBQN4HjTYrRuokqn-2-JF48Tnff4WPm1TR8E1GiGzg@mail.gmail.com>
On 2019-01-23 at 12:22 -0800, John Kitchin <jkitchin@andrew.cmu.edu> wrote...
> I see, that only finds files with the particular tag. I think the goal of
> this is to get a list of all the tags, for use in completion, for example.
I do not think grep is the right solution, but as an ugly hack it can find most of my tags rather easily. Tags are wrapped in "::" and at the end of the line, I think. Assuming that, then,
grep -h -E -o "\:.*\:$" *.org | grep -v -E "PROPERTIES|CATEGORY|END|LOG|STYLE|REPEAT|ID|RESULTS" | tr ':' '\n' | sort | uniq -c | sort -n
Gives all my tags sorted by usage (I don't use them much) plus a few stray words others...
Since drawers are usually begin on the 1st column, or within the first few columns, an alternative to the negative grep could be "cat *.org | cut -c10- | ..." or some other method to skip the first few columns, rather than growing the negative grep list.
-k.
next prev parent reply other threads:[~2019-01-23 21:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-23 0:53 Tracking Tags ?? David Masterson
2019-01-23 18:24 ` Colin Baxter
2019-01-23 18:46 ` John Kitchin
2019-01-23 19:48 ` Colin Baxter
2019-01-23 20:22 ` John Kitchin
2019-01-23 21:57 ` Ken Mankoff [this message]
2019-01-24 1:12 ` David Masterson
-- strict thread matches above, loose matches on Subject: below --
2019-01-23 15:17 Anders Johansson
2019-01-24 1:07 ` David Masterson
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=87a7jrhwar.fsf@geus3064linuxwsm.geus.dk \
--to=mankoff@gmail.com \
--cc=dsmasterson@outlook.com \
--cc=emacs-orgmode@gnu.org \
--cc=jkitchin@andrew.cmu.edu \
--cc=m43cap@yandex.com \
/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).