summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Wahl <marcowahlsoft@gmail.com>2019-12-04 23:36:33 +0100
committerMarco Wahl <marcowahlsoft@gmail.com>2019-12-04 23:36:33 +0100
commitb8f43ecbf4ec1683b04b67e1ab16f74fb3814d51 (patch)
tree8f32fecc420ea5d7d6999b2218c715330e8256e8
parentfe2db1ee8f185aacec70d7f46f77c0ce8ae19eb5 (diff)
downloadorg-mode-b8f43ecbf4ec1683b04b67e1ab16f74fb3814d51.tar.gz
org,colview: Quit column-view with C-c C-c. manual,news: Update
* lisp/org-colview.el (org-columns-toggle-or-columns-quit): New function. Takes the place of removed function org-columns-set-tags-or-toggle.
-rw-r--r--doc/org-manual.org14
-rw-r--r--etc/ORG-NEWS16
-rw-r--r--lisp/org-colview.el22
-rw-r--r--lisp/org.el2
4 files changed, 41 insertions, 13 deletions
diff --git a/doc/org-manual.org b/doc/org-manual.org
index f4387aa..35f6013 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -5469,7 +5469,7 @@ either for all clocks or just for today.
~org-columns-default-format~, and column view is established for the
current entry and its subtree.
-- {{{kbd(r)}}} or {{{kbd(g)}}} (~org-columns-redo~) ::
+- {{{kbd(r)}}} or {{{kbd(g)}}} on a columns view line (~org-columns-redo~) ::
#+kindex: r
#+kindex: g
@@ -5477,9 +5477,10 @@ either for all clocks or just for today.
Recreate the column view, to include recent changes made in the
buffer.
-- {{{kbd(q)}}} (~org-columns-quit~) ::
+- {{{kbd(C-c C-c)}}} or {{{kbd(q)}}} on a columns view line (~org-columns-quit~) ::
#+kindex: q
+ #+kindex: C-c C-c
#+findex: org-columns-quit
Exit column view.
@@ -5519,11 +5520,12 @@ either for all clocks or just for today.
property. For example, the tag completion or fast selection
interface pops up when editing a =TAGS= property.
-- {{{kbd(C-c C-c)}}} (~org-columns-set-tags-or-toggle~) ::
+- {{{kbd(C-c C-c)}}} (~org-columns-toggle-or-columns-quit~) ::
#+kindex: C-c C-c
- #+findex: org-columns-set-tags-or-toggle
- When there is a checkbox at point, toggle it.
+ #+findex: org-columns-toggle-or-columns-quit
+ When there is a checkbox at point, toggle it. Else exit column
+ view.
- {{{kbd(v)}}} (~org-columns-show-value~) ::
@@ -18590,6 +18592,8 @@ the context. It is probably the most over-worked, multi-purpose key
combination in Org. Its uses are well documented throughout this
manual, but here is a consolidated list for easy reference.
+- If column view (see [[*Column View]]) is on, exit column view.
+
- If any highlights shown in the buffer from the creation of a sparse
tree, or from clock display, remove such highlights.
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 027f8c5..e61b97f 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -21,6 +21,22 @@ just as if it was at outline level 0. Inheritance for properties will
work also for this level. In other words: defining things in a
property drawer before the first headline will make them "inheritable"
for all headlines.
+** New functions
+*** ~org-columns-toggle-or-columns-quit~
+=<C-c C-c>= bound to ~org-columns-toggle-or-columns-quit~ replaces the
+recent ~org-columns-set-tags-or-toggle~. Tag setting is still
+possible via column view value edit or with =<C-c C-q>=.
+
+** Removed functions and variables
+
+*** ~org-columns-set-tags-or-toggle~
+See [[*~org-columns-toggle-or-columns-quit~]]
+
+** Miscellaneous
+*** Exit column view with =<C-c C-c>=
+=<C-c C-c>= (almost) everywhere in a buffer exits column view. Before
+there was only key =<q>= to exit column view and only functional on lines
+which were affected by the column view.
* Version 9.3
diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index caef425..a0c4c90 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -164,7 +164,7 @@ See `org-columns-summary-types' for details.")
(org-defkey org-columns-map "o" 'org-overview)
(org-defkey org-columns-map "e" 'org-columns-edit-value)
(org-defkey org-columns-map "\C-c\C-t" 'org-columns-todo)
-(org-defkey org-columns-map "\C-c\C-c" 'org-columns-set-tags-or-toggle)
+(org-defkey org-columns-map "\C-c\C-c" 'org-columns-toggle-or-columns-quit)
(org-defkey org-columns-map "\C-c\C-o" 'org-columns-open-link)
(org-defkey org-columns-map "v" 'org-columns-show-value)
(org-defkey org-columns-map "q" 'org-columns-quit)
@@ -554,13 +554,19 @@ for the duration of the command.")
(interactive "P")
(org-columns-edit-value "TODO"))
-(defun org-columns-set-tags-or-toggle (&optional _arg)
- "Toggle checkbox at point, or set tags for current headline."
- (interactive "P")
- (if (string-match "\\`\\[[ xX-]\\]\\'"
- (get-char-property (point) 'org-columns-value))
- (org-columns-next-allowed-value)
- (org-columns-edit-value "TAGS")))
+(defun org-columns-toggle-or-columns-quit ()
+ "Toggle checkbox at point, or quit column view."
+ (interactive)
+ (or (org-columns--toggle)
+ (org-columns-quit)))
+
+(defun org-columns--toggle ()
+ "Toggle checkbox at point. Return non-nil if toggle happened, else nil.
+See info documentation about realizing a suitable checkbox."
+ (when (string-match "\\`\\[[ xX-]\\]\\'"
+ (get-char-property (point) 'org-columns-value))
+ (org-columns-next-allowed-value)
+ t))
(defvar org-overriding-columns-format nil
"When set, overrides any other format definition for the agenda.
diff --git a/lisp/org.el b/lisp/org.el
index 6a18093..562260c 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -141,6 +141,7 @@ Stars are put in group 1 and the trimmed body in group 2.")
(declare-function org-clock-update-time-maybe "org-clock" ())
(declare-function org-clocking-buffer "org-clock" ())
(declare-function org-clocktable-shift "org-clock" (dir n))
+(declare-function org-columns-quit "org-colview" ())
(declare-function org-columns-insert-dblock "org-colview" ())
(declare-function org-duration-from-minutes "org-duration" (minutes &optional fmt canonical))
(declare-function org-element-at-point "org-element" ())
@@ -17816,6 +17817,7 @@ This command does many different things, depending on context:
inhibited by setting `org-babel-no-eval-on-ctrl-c-ctrl-c'."
(interactive "P")
(cond
+ ((bound-and-true-p org-columns-overlays) (org-columns-quit))
((or (bound-and-true-p org-clock-overlays) org-occur-highlights)
(when (boundp 'org-clock-overlays) (org-clock-remove-overlays))
(org-remove-occur-highlights)