emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Christopher Suckling <suckling.list@googlemail.com>
To: org-mode mailing list <emacs-orgmode@gnu.org>
Subject: [PATCH] fast tag selection interface
Date: Mon, 16 Feb 2009 00:15:33 +0000	[thread overview]
Message-ID: <181D70D7-85EC-4010-ABD5-8F18C785337E@gmail.com> (raw)

As a result of the 40 variables thread and assorted worg tutorials,  
I'm getting a little carried away with customising my workflow.  
Consequently, my tag list have grown to the extent that the fast tags  
selection interface is looking rather messy.

The small patch below adds the capability to create arbitrary new  
lines, either by adding "\n" (backslash n, not a newline!) to your # 
+TAGS: or by adding "(:newline . nil)" to org-tag-alist.

So I can have something like:

[a] @assorted [g] @gtd [c] @contexts

[o] other [r] relevant [t] tags

[m] more [f] for [d] different [p] projects

The patch is a very hacky cut and paste job with little understanding  
of the surrounding code, but I don't seem to have broken anything in  
my setup yet...

Best wishes,



	Modified lisp/org.el
diff --git a/lisp/org.el b/lisp/org.el
index c4cfacd..484df30 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -2066,7 +2066,8 @@ See the manual for details."
  	   (cons   (string    :tag "Tag name")
  		   (character :tag "Access char"))
  	   (const :tag "Start radio group" (:startgroup))
-	   (const :tag "End radio group" (:endgroup)))))
+	   (const :tag "End radio group" (:endgroup))
+	   (const :tag "New line" (:newline)))))

  (defvar org-file-tags nil
    "List of tags that can be inherited by all entries in the file.
@@ -3398,6 +3399,7 @@ means to push this value onto the list in the  
  	     ((equal e "{") (push '(:startgroup) tgs))
  	     ((equal e "}") (push '(:endgroup) tgs))
+	     ((equal e "\\n") (push '(:newline) tgs))
  	     ((string-match (org-re "^\\([[:alnum:]_@]+\\)(\\(.\\))$") e)
  	      (push (cons (match-string 1 e)
  			  (string-to-char (match-string 2 e)))
@@ -3534,6 +3536,7 @@ Respect keys that are already there."
         ((equal e '(:startgroup)) (push e new))
         ((equal e '(:endgroup)) (push e new))
+       ((equal e '(:newline)) (push e new))
  	(setq k (car e) c2 nil)
  	(if (cdr e)
@@ -8866,6 +8869,8 @@ Returns the new TODO keyword, or nil if no state  
change should occur."
  	   ((equal e '(:endgroup))
  	    (setq ingroup nil cnt 0)
  	    (insert "}\n"))
+	   ((equal e '(:newline))
+	    (insert "\n  "))
  	    (setq tg (car e) c (cdr e))
  	    (if ingroup (push tg (car groups)))
@@ -10316,6 +10321,8 @@ Returns the new tags string, or nil to not  
change the current settings."
  	 ((equal e '(:endgroup))
  	  (setq ingroup nil cnt 0)
  	  (insert "}\n"))
+	 ((equal e '(:newline))
+	  (insert "\n  "))
  	  (setq tg (car e) c2 nil)
  	  (if (cdr e)

             reply	other threads:[~2009-02-16  0:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-16  0:15 Christopher Suckling [this message]
2009-02-17 21:00 ` Carsten Dominik
2009-02-18 22:50   ` Christopher Suckling
     [not found] ` <B2AEFB22-36E9-4FF0-A8F8-F360718FF11E@uva.nl>
2009-02-27 18:40   ` Christopher Suckling

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:

  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=181D70D7-85EC-4010-ABD5-8F18C785337E@gmail.com \
    --to=suckling.list@googlemail.com \
    --cc=emacs-orgmode@gnu.org \


* 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


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