emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* column view with display-line-numbers-mode
@ 2018-03-15 10:51 Eric S Fraga
  2018-03-16 22:04 ` Nicolas Goaziou
  2018-03-20 23:48 ` Bastien
  0 siblings, 2 replies; 5+ messages in thread
From: Eric S Fraga @ 2018-03-15 10:51 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 475 bytes --]

The display-line-numbers-mode introduced in recent Emacs versions is
very nice and works very well generally.  However, org is not aware of
it and this causes a minor problem with the display of the header line
in column view mode.

The line numbers are displayed between the fringe and the actual
contents of the lines and so the text starts some distance from the
window border.  The header has no line numbers so starts immediately
after the fringe.  See attached image.


[-- Attachment #1.2: screendump-20180315103351.png --]
[-- Type: image/png, Size: 33225 bytes --]

[-- Attachment #1.3: Type: text/plain, Size: 186 bytes --]


Not a major problem but I thought I would mention it.  Affects the
æsthetic in me.  :-)

Thanks,
eric

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.6-303-g6cf5fc.dirty

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

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

* Re: column view with display-line-numbers-mode
  2018-03-15 10:51 column view with display-line-numbers-mode Eric S Fraga
@ 2018-03-16 22:04 ` Nicolas Goaziou
  2018-03-16 22:51   ` Eric S Fraga
  2018-03-20 23:48 ` Bastien
  1 sibling, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2018-03-16 22:04 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Eric S Fraga <esflists@gmail.com> writes:

> The display-line-numbers-mode introduced in recent Emacs versions is
> very nice and works very well generally.  However, org is not aware of
> it and this causes a minor problem with the display of the header line
> in column view mode.
>
> The line numbers are displayed between the fringe and the actual
> contents of the lines and so the text starts some distance from the
> window border.  The header has no line numbers so starts immediately
> after the fringe.  See attached image.
>
>
>
> Not a major problem but I thought I would mention it.  Affects the
> æsthetic in me.  :-)

I don't use Emacs 26 yet, so I have no clue about how to fix it. Do you
have an idea about how it could be done? Another option is to ask Emacs
devel for advice.

Regards,

-- 
Nicolas Goaziou

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

* Re: column view with display-line-numbers-mode
  2018-03-16 22:04 ` Nicolas Goaziou
@ 2018-03-16 22:51   ` Eric S Fraga
  0 siblings, 0 replies; 5+ messages in thread
From: Eric S Fraga @ 2018-03-16 22:51 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

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

On Friday, 16 Mar 2018 at 23:04, Nicolas Goaziou wrote:

[...]

> I don't use Emacs 26 yet, so I have no clue about how to fix it. Do you
> have an idea about how it could be done? Another option is to ask Emacs
> devel for advice.

I have no idea.  I'll try asking on emacs dev group.  I'll see if I can
find a more generic example of where this fails.

thanks,
eric

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.6-303-g6cf5fc.dirty

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

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

* Re: column view with display-line-numbers-mode
  2018-03-15 10:51 column view with display-line-numbers-mode Eric S Fraga
  2018-03-16 22:04 ` Nicolas Goaziou
@ 2018-03-20 23:48 ` Bastien
  2018-04-26 23:34   ` Bastien
  1 sibling, 1 reply; 5+ messages in thread
From: Bastien @ 2018-03-20 23:48 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: emacs-orgmode

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

Hi Eric,

Eric S Fraga <esflists@gmail.com> writes:

> Not a major problem but I thought I would mention it.  Affects the
> æsthetic in me.  :-)

can you try the attached patch against master?

There is still a problem with big .org files, because we cannot
recompute the colview header format depending on the width reserved
for the line number... but it goes in the right direction.

Thanks for testing,

-- 
 Bastien

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-colview.el.patch --]
[-- Type: text/x-diff, Size: 945 bytes --]

diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index cb5c091..dd97499 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -424,6 +424,7 @@ for the duration of the command.")
   "Overlay the newline before the current line with the table title."
   (interactive)
   (let ((title "")
+	(linum-offset (line-number-display-width 'columns))
 	(i 0))
     (dolist (column org-columns-current-fmt-compiled)
       (pcase column
@@ -435,7 +436,7 @@ for the duration of the command.")
     (setq-local org-previous-header-line-format header-line-format)
     (setq org-columns-full-header-line-format
 	  (concat
-	   (org-add-props " " nil 'display '(space :align-to 0))
+	   (org-add-props " " nil 'display `(space :align-to ,linum-offset))
 	   (org-add-props (substring title 0 -1) nil 'face 'org-column-title)))
     (setq org-columns-previous-hscroll -1)
     (add-hook 'post-command-hook 'org-columns-hscroll-title nil 'local)))

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

* Re: column view with display-line-numbers-mode
  2018-03-20 23:48 ` Bastien
@ 2018-04-26 23:34   ` Bastien
  0 siblings, 0 replies; 5+ messages in thread
From: Bastien @ 2018-04-26 23:34 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: emacs-orgmode

Hi Eric,

Bastien <bzg@gnu.org> writes:

> can you try the attached patch against master?

I've applied the patch in master...

> There is still a problem with big .org files, because we cannot
> recompute the colview header format depending on the width reserved
> for the line number... but it goes in the right direction.

... and let's see if we can fix all situations.

Thanks,

-- 
 Bastien

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

end of thread, other threads:[~2018-04-26 23:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-15 10:51 column view with display-line-numbers-mode Eric S Fraga
2018-03-16 22:04 ` Nicolas Goaziou
2018-03-16 22:51   ` Eric S Fraga
2018-03-20 23:48 ` Bastien
2018-04-26 23:34   ` Bastien

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