emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: org-columns adds spaces [8.3beta (release_8.3beta-1286-g20795f @ /home/youngfrog/sources/org-mode/lisp/)]
@ 2015-07-13 11:34 Nicolas Richard
  2015-07-13 12:52 ` Nicolas Richard
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Richard @ 2015-07-13 11:34 UTC (permalink / raw)
  To: emacs-orgmode

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

Here's my test.org file :

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: test.org --]
[-- Type: text/x-org, Size: 164 bytes --]

* Test org
:PROPERTIES:
:COLUMNS:  %15foo %fooo %2foooo %2fooooo %2foobar %2foobaz %2fooquw %2fooqux %2fooapp %2foopoj %2fooazf %2fooavp %10foopa %1whatever 
:END:

[-- Attachment #3: Type: text/plain, Size: 649 bytes --]


Here's how I test it :
emacs -Q -L ~/sources/org-mode/lisp/ test.org -f whitespace-mode

then hit:
M-x whitespace-mode RET ;; not required
M-x outline-show-all RET ;; not required
C-c C-x C-c ;; enter org-columns
q ;; leave it

The buffer is still marked "unmodified" but there are five space
characters at the end of the headline. (and this will later confuse org
element cache which thus give errors, but I guess that's to be
expected.)

Emacs  : GNU Emacs 25.0.50.1 (i686-pc-linux-gnu, X toolkit, Xaw scroll bars)
 of 2015-07-11 on Aurora
Package: Org-mode version 8.3beta (release_8.3beta-1286-g20795f @ /home/youngfrog/sources/org-mode/lisp/)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug: org-columns adds spaces [8.3beta (release_8.3beta-1286-g20795f @ /home/youngfrog/sources/org-mode/lisp/)]
  2015-07-13 11:34 Bug: org-columns adds spaces [8.3beta (release_8.3beta-1286-g20795f @ /home/youngfrog/sources/org-mode/lisp/)] Nicolas Richard
@ 2015-07-13 12:52 ` Nicolas Richard
  2015-07-18  7:46   ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Richard @ 2015-07-13 12:52 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: emacs-orgmode

Nicolas Richard <youngfrog@members.fsf.org> writes:
> The buffer is still marked "unmodified" but there are five space
> characters at the end of the headline. (and this will later confuse org
> element cache which thus give errors, but I guess that's to be
> expected.)

Meanwhile I had a look and it's due to this part of
org-columns-display-here :
    (org-unmodified (insert " "))

(http://orgmode.org/cgit.cgi/org-mode.git/tree/lisp/org-colview.el?h=maint#n247)

Inserting characters in the buffer for the sake of columnview seems
wrong to me. Even more so if this is done silently.

I tried removing the whole (if then) block. That not only helps with the
spurious spaces, but also makes the column view work better in my
original usecase. OTOH I don't know what it will break.

--- /home/youngfrog/sources/org-mode/lisp/org-colview.el
+++ #<buffer org-colview.el>
@@ -224,13 +224,7 @@
        (overlay-put ov 'org-columns-pom pom)
        (overlay-put ov 'org-columns-format f)
        (overlay-put ov 'line-prefix "")
-       (overlay-put ov 'wrap-prefix ""))
-      (if (or (not (char-after beg))
-	      (equal (char-after beg) ?\n))
-	  (let ((inhibit-read-only t))
-	    (save-excursion
-	      (goto-char beg)
-	      (org-unmodified (insert " ")))))) ;; FIXME: add props and remove later?
+       (overlay-put ov 'wrap-prefix "")))
     ;; Make the rest of the line disappear.
     (org-unmodified
      (setq ov (org-columns-new-overlay beg (point-at-eol)))

-- 
Nicolas Richard

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug: org-columns adds spaces [8.3beta (release_8.3beta-1286-g20795f @ /home/youngfrog/sources/org-mode/lisp/)]
  2015-07-13 12:52 ` Nicolas Richard
@ 2015-07-18  7:46   ` Nicolas Goaziou
  0 siblings, 0 replies; 3+ messages in thread
From: Nicolas Goaziou @ 2015-07-18  7:46 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: emacs-orgmode

Hello,

Nicolas Richard <youngfrog@members.fsf.org> writes:

> Nicolas Richard <youngfrog@members.fsf.org> writes:
>> The buffer is still marked "unmodified" but there are five space
>> characters at the end of the headline. (and this will later confuse org
>> element cache which thus give errors, but I guess that's to be
>> expected.)
>
> Meanwhile I had a look and it's due to this part of
> org-columns-display-here :
>     (org-unmodified (insert " "))

Thank you.

> Inserting characters in the buffer for the sake of columnview seems
> wrong to me.

Each column is an overlay applied on top of a character in the line.
Since columns cannot overlap, you need at least as many characters in
the line as columns to display.

> Even more so if this is done silently.

I fixed it in cf5cb15.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-18  7:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-13 11:34 Bug: org-columns adds spaces [8.3beta (release_8.3beta-1286-g20795f @ /home/youngfrog/sources/org-mode/lisp/)] Nicolas Richard
2015-07-13 12:52 ` Nicolas Richard
2015-07-18  7:46   ` Nicolas Goaziou

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).