branch: externals/org
commit 4454150927d1ee21919c59ad94797733ffc99e0f
Author: Ihor Radchenko <[email protected]>
Commit: Ihor Radchenko <[email protected]>
org-colview: Disable org-num-mode for the duration of column view
* lisp/org-colview.el (org-columns-org-num-was-active): New variable
indicating presence of `org-num-mode' when we activate org-columns.
This new variable follows `org-columns-flyspell-was-active'.
(org-columns-remove-overlays):
(org-columns):
(org-agenda-columns): Disable `org-num-mode' while column view is
active and re-enable (if it was enabled) upon exiting. `org-num-mode'
overlays interfere with columns and I have not find a good way to fix
this. See https://yhetil.org/emacs-devel/87ldrvntoi.fsf@localhost/
Reported-by: Sean Devlin <[email protected]>
Link:
https://orgmode.org/list/[email protected]
---
lisp/org-colview.el | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index 5b5fa24948..8b97aa2ad0 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -510,6 +510,10 @@ substring whose `string-width' does not exceed WIDTH."
"Remember the state of `flyspell-mode' before column view.
Flyspell mode can cause problems in columns view, so it is turned off
for the duration of the command.")
+(defvar org-columns-org-num-was-active nil
+ "Remember the state of `org-num-mode' before column view.
+Org-num mode can cause problems in columns view, so it is turned off
+for the duration of the command.")
(defvar header-line-format)
(defvar org-columns-previous-hscroll 0)
@@ -574,6 +578,8 @@ for the duration of the command.")
(remove-text-properties (point-min) (point-max) '(read-only t))))
(when org-columns-flyspell-was-active
(flyspell-mode 1))
+ (when org-columns-org-num-was-active
+ (org-num-mode 1))
(when (local-variable-p 'org-colview-initial-truncate-line-value)
(setq truncate-lines org-colview-initial-truncate-line-value))))
@@ -919,6 +925,9 @@ When COLUMNS-FMT-STRING is non-nil, use it as the column
format."
(when (setq-local org-columns-flyspell-was-active
(bound-and-true-p flyspell-mode))
(flyspell-mode 0))
+ (when (setq-local org-columns-org-num-was-active
+ (bound-and-true-p org-num-mode))
+ (org-num-mode 0))
(unless (local-variable-p 'org-colview-initial-truncate-line-value)
(setq-local org-colview-initial-truncate-line-value
truncate-lines))
@@ -1796,6 +1805,9 @@ definition."
(when (setq-local org-columns-flyspell-was-active
(bound-and-true-p flyspell-mode))
(flyspell-mode 0))
+ (when (setq-local org-columns-org-num-was-active
+ (bound-and-true-p org-num-mode))
+ (org-num-mode 0))
(dolist (entry cache)
(goto-char (car entry))
(org-columns--display-here (cdr entry)))