Re: [O] Bug: org-columns adds spaces [8.3beta (release_8.3beta-1286-g20795f @ /home/youngfrog/sources/org-mode/lisp/)]

2015-07-18 Thread Nicolas Goaziou
Hello,

Nicolas Richard youngf...@members.fsf.org writes:

 Nicolas Richard youngf...@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



[O] Bug: org-columns adds spaces [8.3beta (release_8.3beta-1286-g20795f @ /home/youngfrog/sources/org-mode/lisp/)]

2015-07-13 Thread Nicolas Richard
Here's my test.org file :
* Test org
:PROPERTIES:
:COLUMNS:  %15foo %fooo %2f %2fo %2foobar %2foobaz %2fooquw %2fooqux %2fooapp %2foopoj %2fooazf %2fooavp %10foopa %1whatever 
:END:

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


Re: [O] Bug: org-columns adds spaces [8.3beta (release_8.3beta-1286-g20795f @ /home/youngfrog/sources/org-mode/lisp/)]

2015-07-13 Thread Nicolas Richard
Nicolas Richard youngf...@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