emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Raffael Stocker <r.stocker@mnet-mail.de>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] Columnview makes attributes wander [9.7.4 (9.7.4-1387e3 @ /home/rst/.emacs.d/elpa/org-9.7.4/)]
Date: Mon, 17 Jun 2024 21:23:39 +0200	[thread overview]
Message-ID: <yplmbk3zidac.fsf@mnet-mail.de> (raw)
In-Reply-To: <87v827a3gh.fsf@localhost> (Ihor Radchenko's message of "Mon, 17 Jun 2024 17:23:10 +0000")

[-- Attachment #1: Type: text/plain, Size: 208 bytes --]

Ihor Radchenko <yantar92@posteo.net> writes:

> May you please convert the diff into a proper patch, so that I can
> install it under your name?

I gave it a try, please see the attachment.

Cheers,
Raffael


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: columnview left trim patch --]
[-- Type: text/x-patch, Size: 1314 bytes --]

From a94c25606164678b7887e9cc45c059b025f5140c Mon Sep 17 00:00:00 2001
From: Raffael Stocker <r.stocker@mnet-mail.de>
Date: Mon, 17 Jun 2024 21:09:45 +0200
Subject: [PATCH] lisp/org-colview.el: Prevent repeated indentation of keyword
 lines

* org-colview.el (org-columns-dblock-write-default): left trim keyword
and TBLFM lines to prevent repeated indentation.
---
 lisp/org-colview.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index 961ae0fbe..bc93941e4 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -1662,7 +1662,7 @@ defun org-columns-dblock-write-default
 	;; Insert affiliated keywords before the table.
 	(when content-lines
 	  (while (string-match-p "\\`[ \t]*#\\+" (car content-lines))
-	    (insert (pop content-lines) "\n")))
+	    (insert (string-trim-left (pop content-lines)) "\n")))
 	(save-excursion
 	  ;; Insert table at point.
 	  (insert
@@ -1675,7 +1675,7 @@ defun org-columns-dblock-write-default
 	  (let ((case-fold-search t))
 	    (dolist (line content-lines)
 	      (when (string-match-p "\\`[ \t]*#\\+TBLFM:" line)
-		(insert "\n" line)
+		(insert "\n" (string-trim-left line))
 		(unless recalc (setq recalc t))))))
 	(when recalc (org-table-recalculate 'all t))
 	(org-table-align)
-- 
2.45.2


  reply	other threads:[~2024-06-17 19:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-17  8:50 [BUG] Columnview makes attributes wander [9.7.4 (9.7.4-1387e3 @ /home/rst/.emacs.d/elpa/org-9.7.4/)] Raffael Stocker
2024-06-17 17:23 ` Ihor Radchenko
2024-06-17 19:23   ` Raffael Stocker [this message]
2024-06-18 12:52     ` Ihor Radchenko

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=yplmbk3zidac.fsf@mnet-mail.de \
    --to=r.stocker@mnet-mail.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /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).