emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jean Louis <bugs@gnu.support>
To: Ihor Radchenko <yantar92@gmail.com>
Cc: "Göktuğ Kayaalp" <self@gkayaalp.com>, "Org Mode" <emacs-orgmode@gnu.org>
Subject: Re: [emacs-humanities] Paper Zettelkasten safety [was: Why Emacs-humanities?]
Date: Mon, 19 Jul 2021 08:00:06 +0300	[thread overview]
Message-ID: <YPUG1jd/CZ3JB8d2@protected.localdomain> (raw)
In-Reply-To: <878s237k1u.fsf@localhost>

* Ihor Radchenko <yantar92@gmail.com> [2021-07-18 17:51]:
> Jean Louis <bugs@gnu.support> writes:
> 
> > How do I display the list of tags in Org mode?
> 
> There is nothing like dashboard of tags in Org mode. However, you can
> get a list of all the tags using (org-global-tags-completion-table).

I will move the email to org mode mailing list. Here I am showing
the concept on how to show the tags create buttons. I am using
this in Hyperscope as to list all the tags. But I am not using
Org mode to display it, though that would be better for Org
mode. I did not delete those not necessary variables and
functions below as it is only to show the concept. 

When you run M-x rcd-org-tags you would get a new pop up window
with the list of tags, you can then use Enter or Mouse to invoke
Org agenda on the tag.

Having tags index is useful. Something like this should be in Org mode.

(defun rcd-org-tags (&optional prefix)
  (interactive "p")
  "Report ordered Org tags"
  (let* ((tags (flatten-list (org-global-tags-completion-table)))
	 (tags (seq-sort 'string< (seq-uniq tags))))
    (rcd-pop-to-report
     (with-temp-buffer
       (rcd-org-insert-buttons tags)
       (buffer-string))
     nil)))

(defun rcd-org-insert-button (tag)
  (insert-text-button tag
		      'action
		      `(lambda (_) 
			 (org-tags-view nil ,tag)))
                      'follow-link t)

(defun rcd-org-insert-buttons (tags)
  (insert "TAGS:  ")
  (while tags
    (let* ((tag (pop tags)))
      (rcd-org-insert-button tag)
      (insert " ")
	(when (> (current-column) 70) (insert "\n")))))

(defun rcd-pop-to-report (string &optional buffer-name map place refresh truncate)
  "Pop the new buffer and inserts STRING.
Quits with `q' if necessary.
BUFFER-NAME is optional.

It will destroy the buffer before display of report."
  (let ((buffer (or buffer-name "*RCD Report*")))
    (when (buffer-live-p (get-buffer buffer))
      (kill-buffer (get-buffer buffer)))
    (save-excursion
      (pop-to-buffer buffer)
      (let ((word-wrap truncate))
	(when word-wrap (toggle-truncate-lines 1))
	(setq rcd-current-table (when (listp place) (cdr (assoc "table" place))))
	(setq rcd-current-column (when (listp place) (cdr (assoc "column" place))))
	(setq rcd-current-table-id (when (listp place) (cdr (assoc "table-id" place))))
	(setq rcd-tabulated-refresh-function refresh)
	(insert string)
	(goto-char 1)
	(if map 
	    (use-local-map map)
	  (local-set-key (kbd "q") 'delete-window)
	  (read-only-mode 1))))))

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


           reply	other threads:[~2021-07-19  5:02 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <878s237k1u.fsf@localhost>]

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=YPUG1jd/CZ3JB8d2@protected.localdomain \
    --to=bugs@gnu.support \
    --cc=emacs-orgmode@gnu.org \
    --cc=self@gkayaalp.com \
    --cc=yantar92@gmail.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).