From: Nick Savage <nick@nicksavage.ca>
To: emacs-orgmode@gnu.org
Subject: [PATCH]: org-columns does not respect global-visual-line-mode for long text within headlines
Date: Sun, 2 May 2021 10:20:30 -0400 [thread overview]
Message-ID: <5b9ffb77-5945-b045-dec1-4613ba9398d3@nicksavage.ca> (raw)
In-Reply-To: <875z02si3g.fsf@nicolasgoaziou.fr>
[-- Attachment #1: Type: text/plain, Size: 654 bytes --]
I've done some more research on
https://orgmode.org/list/875z02si3g.fsf@nicolasgoaziou.fr/, and I
believe the issue is that `org-columns' is setting `truncate-lines' as
t, while `global-visual-line-mode' is expecting it to be set to nil. The
interaction between the two causes the wrapping to not occur.
`org-columns; also cleans up after itself and replaces truncate-lines
with the original value, which is why the problem only occurs when
`org-columns' is enabled it.
The attached patch ensures the behaviour is correct when
`global-visual-line-mode' is enabled and that there are no behaviour
changes when it has not already been enabled.
[-- Attachment #2: 0001-lisp-org-colview.el-Update-org-columns-to-respect-gl.patch --]
[-- Type: text/x-patch, Size: 1453 bytes --]
From fbb91ddc2bc8b6f29651e3114754bcd8fcad30d0 Mon Sep 17 00:00:00 2001
From: Nicholas Savage <nick@nicksavage.ca>
Date: Sat, 1 May 2021 20:05:09 -0400
Subject: [PATCH] lisp/org-colview.el: Update org-columns to respect
global-visual-line-mode
* lisp/org-colview.el (org-columns): Prevent enabling truncate-lines
when global-visual-line-mode is also enabled
Fixing a bug where org-column overlays were disabling wrapping of
lines when global-visual-line-mode was already activated, and so
therefore expectation was that the lines would continue wrapping. This
is because org-columns was setting truncate-lines to t, when
global-visual-line-mode requires it to be set to nil. The interaction
between the two caused the wrapping not to occur.
---
lisp/org-colview.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index 517bcdf1c..9dad8c7d9 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -879,7 +879,8 @@ When COLUMNS-FMT-STRING is non-nil, use it as the column format."
(unless (local-variable-p 'org-colview-initial-truncate-line-value)
(setq-local org-colview-initial-truncate-line-value
truncate-lines))
- (setq truncate-lines t)
+ (if (not global-visual-line-mode)
+ (setq truncate-lines t))
(dolist (entry cache)
(goto-char (car entry))
(org-columns--display-here (cdr entry)))))))))
--
2.20.1
next prev parent reply other threads:[~2021-05-02 14:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-01 3:22 Bug: org-columns does not respect global-visual-line-mode for long text within headlines Nick Savage
2021-05-01 13:23 ` Nicolas Goaziou
2021-05-02 14:20 ` Nick Savage [this message]
2021-05-02 17:22 ` [PATCH]: " Bastien
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=5b9ffb77-5945-b045-dec1-4613ba9398d3@nicksavage.ca \
--to=nick@nicksavage.ca \
--cc=emacs-orgmode@gnu.org \
/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).