summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2009-02-19 09:43:51 +0100
committerCarsten Dominik <carsten.dominik@gmail.com>2009-02-19 09:43:51 +0100
commit8b31b5e798d3c4ff6fc301b1b355bc6871983105 (patch)
treea21922e696b47f511db4f9ee3ab798c83de02e3b
parente6e3d977975c3d276267a6b50ce8ee1955fa94eb (diff)
downloadorg-mode-8b31b5e798d3c4ff6fc301b1b355bc6871983105.tar.gz
Tags: Implement newlines for fast tag interface
This commit makes it possible to force new lines and even empty lines in the fast tag selection interface, either by splitting tags definition into several lines, or by inserting "\n" into the tags list, or by inserting (:newline) into the tags alist. This is largely a patch from Christopher Suckling
-rw-r--r--doc/ChangeLog2
-rw-r--r--doc/org.texi18
-rwxr-xr-xlisp/ChangeLog6
-rw-r--r--lisp/org.el12
4 files changed, 35 insertions, 3 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 74a6239..61b2300 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,5 +1,7 @@
2009-02-19 Carsten Dominik <carsten.dominik@gmail.com>
+ * org.texi (Setting tags): Document newline option.
+
* orgcard.tex: Document `C-c C-x o'.
* org.texi (TODO dependencies, Checkboxes): Document
diff --git a/doc/org.texi b/doc/org.texi
index f6dd023..ff11a78 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -3887,6 +3887,21 @@ can, instead, set the TAGS option line as:
#+TAGS: @@work(w) @@home(h) @@tennisclub(t) laptop(l) pc(p)
@end example
+@noindent The tags interface will show the available tags in a splash
+window. If you would to start a new line after a specific tag, insert
+@samp{\n} into the tag list
+
+@example
+#+TAGS: @@work(w) @@home(h) @@tennisclub(t) \n laptop(l) pc(p)
+@end example
+
+@noindent or write them in two lines:
+
+@example
+#+TAGS: @@work(w) @@home(h) @@tennisclub(t)
+#+TAGS: laptop(l) pc(p)
+@end example
+
@noindent
You can also group together tags that are mutually exclusive. By using
braces, as in:
@@ -3904,7 +3919,8 @@ these lines to activate any changes.
@noindent
To set these mutually exclusive groups in the variable @code{org-tags-alist}
you must use the dummy tags @code{:startgroup} and @code{:endgroup} instead
-of the braces. The previous example would be set globally by the following
+of the braces. Similarly, you can use @code{:newline} to indicate a line
+break. The previous example would be set globally by the following
configuration:
@lisp
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index eedd85c..0e4db7f 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -3,6 +3,12 @@
* org.el (org-track-ordered-property-with-tag): New option.
(org-toggle-ordered-property): Honor
`org-track-ordered-property-with-tag'.
+ (org-tag-alist): Add newline options.
+ (org-set-regexps-and-options): Separate option lines imply a
+ newline.
+ (org-set-regexps-and-options, org-assign-fast-keys)
+ (org-fast-todo-selection, org-fast-tag-selection): Handle newline
+ option.
* org-list.el (org-checkbox-blocked-p): New function.
(org-toggle-checkbox): Check for blocking.
diff --git a/lisp/org.el b/lisp/org.el
index ac998b4..8d70050 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -2067,7 +2067,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.
@@ -3268,7 +3269,8 @@ means to push this value onto the list in the variable.")
(push (cons (intern (downcase (match-string 1 key)))
(org-split-string value splitre)) kwds))
((equal key "TAGS")
- (setq tags (append tags (org-split-string value splitre))))
+ (setq tags (append tags (if tags '("\\n") nil)
+ (org-split-string value splitre))))
((equal key "COLUMNS")
(org-set-local 'org-columns-default-format value))
((equal key "LINK")
@@ -3399,6 +3401,7 @@ means to push this value onto the list in the variable.")
(cond
((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)))
@@ -3535,6 +3538,7 @@ Respect keys that are already there."
(cond
((equal e '(:startgroup)) (push e new))
((equal e '(:endgroup)) (push e new))
+ ((equal e '(:newline)) (push e new))
(t
(setq k (car e) c2 nil)
(if (cdr e)
@@ -8897,6 +8901,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 "))
(t
(setq tg (car e) c (cdr e))
(if ingroup (push tg (car groups)))
@@ -10348,6 +10354,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 "))
(t
(setq tg (car e) c2 nil)
(if (cdr e)