unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#56176: 28.1.50; csv-align-mode misaligns when display-line-numbers-mode is on
@ 2022-06-23 19:26 Joost Kremers
  2022-06-24  9:38 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Joost Kremers @ 2022-06-23 19:26 UTC (permalink / raw)
  To: 56176


I work with csv files with long lines, which do not fit the window. If I
activate csv-align-mode and display-line-numbers-mode, then move to the end of a
line (so that the first few columns are not visible anymore), the columns that
are visible are no longer properly aligned. If I disable
display-line-numbers-mode, they are propely aligned again.

I could attach some screen shots showing the problem, but I'm not sure
attachments are allowed here. Let me know if I should.

Thanks,

Joost




In GNU Emacs 28.1.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0)
 of 2022-04-05 built on Swift
Repository revision: dd3863d8bcc77c43363bbd041da1c1eb37a3ee32
Repository branch: emacs-28
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: elementary OS 6.1 Jólnir

Configured using:
 'configure --with-harfbuzz --with-cairo --with-json --with-libgmp
 --with-native-compilation'
Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LCMS2
LIBOTF LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB
Important settings:
  value of $LC_MONETARY: en_IE.UTF-8
  value of $LC_NUMERIC: en_IE.UTF-8
  value of $LC_TIME: en_IE.UTF-8
  value of $LANG: en_GB.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: VTerm

Minor modes in effect:
  magit-auto-revert-mode: t
  flycheck-indicator-mode: t
  company-box-mode: t
  minions-mode: t
  doom-modeline-mode: t
  which-key-mode: t
  global-atomic-chrome-edit-mode: t
  marginalia-mode: t
  all-the-icons-completion-mode: t
  company-prescient-mode: t
  selectrum-prescient-mode: t
  prescient-persist-mode: t
  projectile-mode: t
  global-diff-hl-mode: t
  global-git-commit-mode: t
  csv-field-index-mode: t
  shell-dirtrack-mode: t
  company-quickhelp-mode: t
  company-quickhelp-local-mode: t
  global-company-mode: t
  company-mode: t
  electric-pair-mode: t
  recentf-mode: t
  delete-selection-mode: t
  override-global-mode: t
  ctrlf-mode: t
  ctrlf-local-mode: t
  selectrum-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-save-visited-mode: t

Load-path shadows:
/home/joost/.emacs.d/elpa/transient-20220527.2213/transient hides /usr/local/share/emacs/28.1.50/lisp/transient
~/.emacs.d/lisp/custom hides /usr/local/share/emacs/28.1.50/lisp/custom

Features:
(shadow emacsbug cursor-sensor subword-mode-expansions cap-words superword
subword shr-color magit-extras bug-reference mixed-pitch pandoc-mode
pandoc-mode-utils smiley gnus-cite mail-extr qp display-line-numbers
mu4e-settings gnus-dired mu4e mu4e-org mu4e-main mu4e-view mu4e-view-gnus
mu4e-view-common mu4e-headers mu4e-compose mu4e-context mu4e-draft mu4e-actions
rfc2368 smtpmail mu4e-mark mu4e-proc mu4e-utils mu4e-lists mu4e-message
flow-fill mu4e-vars mu4e-meta magit-bookmark magit-submodule magit-obsolete
magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull
magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes
magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files
magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log
which-func magit-diff smerge-mode diff magit-core magit-autorevert magit-margin
magit-transient magit-process magit-mode ace-window avy pdf-tools pdf-view
pdf-cache pdf-info tq pdf-util pdf-macs vc-mtn vc-hg vc-bzr vc-src vc-sccs
vc-cvs vc-rcs consult-selectrum consult compat-28 expand-region
yaml-mode-expansions text-mode-expansions cc-mode-expansions
the-org-mode-expansions python-el-fgallina-expansions js2-mode-expansions
js-mode-expansions clojure-mode-expansions er-basic-expansions
expand-region-core expand-region-custom cus-start cl-print help-fns radix-tree
visual-fill-column org-autolist org-indent ol-eww eww xdg mm-url ol-rmail ol-mhe
ol-irc ol-info ol-gnus nnselect gnus-search eieio-opt speedbar ezimage dframe
gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum gnus-group gnus-undo
gnus-start gnus-dbus gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo
gnus-spec gnus-int gnus-range gnus-win gnus nnheader ol-docview doc-view
jka-compr image-mode exif ol-bibtex ol-bbdb ol-w3m ol-doi org-link-doi org-ebib
ebib-biblio ebib-settings ebib ebib-reading-list ebib-notes ebib-filters
ebib-keywords ebib-utils ebib-db parsebib char-fold vc-git
display-fill-column-indicator flycheck-indicator async mm-archive mule-util
gnutls url-cache finder-inf jk-input-methods quail multi-vterm company-box
company-box-doc frame-local company-box-icons company-amelia amelia wgrep-ag
wgrep flycheck-ledger vterm bookmark term disp-table ehelp vterm-module
term/xterm xterm ielm minions doom-modeline doom-modeline-segments
doom-modeline-env doom-modeline-core shrink-path which-key atomic-chrome iimage
image+ image-file image-converter ctrlf marginalia all-the-icons-completion
company-prescient selectrum-prescient selectrum minibuf-eldef prescient
groovy-mode dockerfile-mode sh-script smie executable impatient-mode htmlize
tide tide-lv typescript-mode indium indium-list-sources indium-scratch
indium-interaction indium-chrome indium-nodejs indium-repl indium-debugger
indium-debugger-litable js2-refactor js2r-paredit js2r-conveniences
js2r-conditionals js2r-wrapping js2r-functions js2r-vars
mc-hide-unmatched-lines-mode mc-mark-more mc-cycle-cursors multiple-cursors-core
rect js2r-iife js2r-formatting js2r-helpers indium-debugger-locals
indium-breakpoint indium-inspector indium-render indium-faces indium-seq-fix
indium-client indium-structs json-process-client js2-mode js cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs jupyter
python-pytest lsp-pyright dap-python paredit sesman clojure-mode align dap-mode
dap-launch dap-overlays eldoc-box jsonrpc ert debug backtrace lsp-ui
lsp-ui-flycheck lsp-ui-doc goto-addr lsp-ui-imenu lsp-ui-peek lsp-ui-sideline
flycheck-posframe flycheck lsp-mode network-stream markdown-mode inline imenu f
f-shortdoc shortdoc lsp-ui-util face-remap lsp-protocol ht ag vc-svn find-dired
s projectile lisp-mnt grep compile ibuf-ext ibuffer ibuffer-loaddefs thingatpt
diff-hl log-view vc-dir ewoc vc vc-dispatcher diff-mode git-commit magit-git
magit-base magit-section crm compat-27 compat-26 with-editor transient compat
log-edit message rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util
rmail rmail-loaddefs mm-decode mm-bodies mm-encode mailabbrev gmm-utils
mailheader pcvs-util add-log autorevert filenotify aggressive-indent sendmail
mail-utils nswbuff yaml-mode yaml guess-language flyspell ispell dired
dired-loaddefs reftex reftex-loaddefs reftex-vars csv-mode sort tab-jump-out
yasnippet-snippets yasnippet company-org-block org-settings org-clock ob-jupyter
jupyter-tramp tramp-cache jupyter-server jupyter-server-ioloop
jupyter-ioloop-comm jupyter-ioloop zmq zmq-core jupyter-rest-api url-http
url-auth mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr url-gw
nsm rmc jupyter-org-extensions jupyter-org-client jupyter-repl
jupyter-kernel-manager jupyter-channel jupyter-widget-client websocket bindat
simple-httpd jupyter-client jupyter-comm-layer jupyter-messages hmac-def
jupyter-mime shr kinsoku text-property-search puny svg jupyter-kernelspec
jupyter-env jupyter-base eieio-base ob-shell ob-scheme ob-clojure ob-python
python tramp-sh org-element avl-tree dom org ob ob-tangle ob-ref ob-lob ob-table
ob-exp org-macro org-footnote org-src ob-comint org-pcomplete org-list org-faces
org-entities noutline outline org-version ob-emacs-lisp ob-core ob-eval
org-table oc-basic ol org-keys oc org-compat org-macs org-loaddefs find-func
cal-menu calendar cal-loaddefs tramp tramp-loaddefs trampver tramp-integration
files-x tramp-compat shell pcomplete comint ansi-color parse-time ls-lisp
format-spec biblio biblio-download biblio-dissemin biblio-ieee biblio-hal
biblio-dblp biblio-crossref biblio-arxiv timezone biblio-doi biblio-core
let-alist url-queue ido hl-line bibtex iso8601 time-date adaptive-wrap goggles
comp comp-cstr warnings rx pulse posframe bm company-quickhelp pos-tip
all-the-icons all-the-icons-faces data-material data-weathericons data-octicons
data-fileicons data-faicons data-alltheicons company-keywords company-etags
etags fileloop generator xref project company-gtags company-dabbrev-code
company-dabbrev company-ipa company-files company-clang company-cmake
company-semantic company-template company-css company-capf company
solarized-light-theme solarized-theme solarized solarized-faces color paradox
paradox-menu paradox-commit-list hydra ring lv cus-edit pp cus-load
paradox-execute paradox-github paradox-core spinner dash cl-extra help-mode
jk-functions advice eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg
esh-module esh-groups esh-util notifications dbus xml edmacro kmacro server
elec-pair recentf tree-widget wid-edit delsel use-package use-package-ensure
use-package-delight use-package-diminish use-package-bind-key bind-key
use-package-core tex-site realgud-recursive-autoloads easy-mmode info package
browse-url url url-proxy url-privacy url-expand url-methods url-history
url-cookie url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map url-vars
seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib pcase iso-transl
tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset
image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer
select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj
charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk
x-toolkit x multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 2783127 249839)
 (symbols 48 77556 60)
 (strings 32 428236 80784)
 (string-bytes 1 19635064)
 (vectors 16 157893)
 (vector-slots 8 3594188 210063)
 (floats 8 2108 2651)
 (intervals 56 290480 15592)
 (buffers 992 59))

-- 
Joost Kremers
Life has its moments





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

* bug#56176: 28.1.50; csv-align-mode misaligns when display-line-numbers-mode is on
  2022-06-23 19:26 bug#56176: 28.1.50; csv-align-mode misaligns when display-line-numbers-mode is on Joost Kremers
@ 2022-06-24  9:38 ` Lars Ingebrigtsen
  2022-06-27 12:55   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-24  9:38 UTC (permalink / raw)
  To: Joost Kremers; +Cc: 56176, Stefan Monnier

Joost Kremers <joostkremers@fastmail.fm> writes:

> I work with csv files with long lines, which do not fit the window. If I
> activate csv-align-mode and display-line-numbers-mode, then move to the end of a
> line (so that the first few columns are not visible anymore), the columns that
> are visible are no longer properly aligned. If I disable
> display-line-numbers-mode, they are propely aligned again.
>
> I could attach some screen shots showing the problem, but I'm not sure
> attachments are allowed here. Let me know if I should.

Attachments are allowed, but I can reproduce the problem without them.

The problem seems to be in the computations in csv--jit-align, which
don't take the line numbers mode area into account.  But after poking at
it for a couple of minutes, it's not immediately clear to me what the
algorithm is actually doing, so I've added Stefan to the CCs.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#56176: 28.1.50; csv-align-mode misaligns when display-line-numbers-mode is on
  2022-06-24  9:38 ` Lars Ingebrigtsen
@ 2022-06-27 12:55   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-06-27 13:03     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-06-27 12:55 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Joost Kremers, 56176

Lars Ingebrigtsen [2022-06-24 11:38:32] wrote:
> Joost Kremers <joostkremers@fastmail.fm> writes:
>> I work with csv files with long lines, which do not fit the window. If I
>> activate csv-align-mode and display-line-numbers-mode, then move to the end of a
>> line (so that the first few columns are not visible anymore), the columns that
>> are visible are no longer properly aligned. If I disable
>> display-line-numbers-mode, they are propely aligned again.
>>
>> I could attach some screen shots showing the problem, but I'm not sure
>> attachments are allowed here. Let me know if I should.
> Attachments are allowed, but I can reproduce the problem without them.
> The problem seems to be in the computations in csv--jit-align, which
> don't take the line numbers mode area into account.  But after poking at
> it for a couple of minutes, it's not immediately clear to me what the
> algorithm is actually doing, so I've added Stefan to the CCs.

I'm not sure the problem is on `csv-mode.el`, tho.
I just tried it on a TSV file of mine where I can indeed see incorrect
alignment (tho it is correct both when displaying the leftmost columns
and when displaying the rightmost column: the errors show up only when
I scrolled in the middle for me).

But when I look with `C-u C-x =` at the TAB separator between two
columns, I see that two misaligned separators both show:

  display              (space :align-to 63)

and when I try `M-: (current-column)` I see that one of them says 60 and
the other says 61, so both elastic spaces *should* end at the same
column 63, AFAICT, even tho they clearly don't on my screen.  Also, the
60 -vs- 61 is odd because the column position on screen of those two
positions differs by 3 rather than by 1, according to my eyes.

So, my crystal ball suggests the error might be in the redisplay.


        Stefan






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

* bug#56176: 28.1.50; csv-align-mode misaligns when display-line-numbers-mode is on
  2022-06-27 12:55   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-06-27 13:03     ` Eli Zaretskii
  2022-06-27 15:27       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2022-06-27 13:03 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: joostkremers, larsi, 56176

> Cc: Joost Kremers <joostkremers@fastmail.fm>, 56176@debbugs.gnu.org
> Date: Mon, 27 Jun 2022 08:55:07 -0400
> From:  Stefan Monnier via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> I'm not sure the problem is on `csv-mode.el`, tho.
> I just tried it on a TSV file of mine where I can indeed see incorrect
> alignment (tho it is correct both when displaying the leftmost columns
> and when displaying the rightmost column: the errors show up only when
> I scrolled in the middle for me).
> 
> But when I look with `C-u C-x =` at the TAB separator between two
> columns, I see that two misaligned separators both show:
> 
>   display              (space :align-to 63)
> 
> and when I try `M-: (current-column)` I see that one of them says 60 and
> the other says 61, so both elastic spaces *should* end at the same
> column 63, AFAICT, even tho they clearly don't on my screen.  Also, the
> 60 -vs- 61 is odd because the column position on screen of those two
> positions differs by 3 rather than by 1, according to my eyes.
> 
> So, my crystal ball suggests the error might be in the redisplay.

A recipe starting from "emacs -Q", preferably without csv-mode at all,
would be appreciated.





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

* bug#56176: 28.1.50; csv-align-mode misaligns when display-line-numbers-mode is on
  2022-06-27 13:03     ` Eli Zaretskii
@ 2022-06-27 15:27       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-06-29 17:19         ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-06-27 15:27 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: joostkremers, larsi, 56176

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

> A recipe starting from "emacs -Q", preferably without csv-mode at all,
> would be appreciated.

Here's one that works for me:

    src/emacs -Q -l ~/tmp/foo.el -f my-test

where `foo.el` is the attached file.

Then scroll horizontally (I use `C-f` from the BOL and `C-b` from EOL to
do that), you'll see that sometimes the columns aren't aligned (tho
sometimes they are, even the very same columns).


        Stefan

[-- Attachment #2: foo.el --]
[-- Type: application/emacs-lisp, Size: 5085 bytes --]

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

* bug#56176: 28.1.50; csv-align-mode misaligns when display-line-numbers-mode is on
  2022-06-27 15:27       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-06-29 17:19         ` Eli Zaretskii
  2022-06-30  9:23           ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2022-06-29 17:19 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: joostkremers, larsi, 56176

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: larsi@gnus.org,  joostkremers@fastmail.fm,  56176@debbugs.gnu.org
> Date: Mon, 27 Jun 2022 11:27:17 -0400
> 
>     src/emacs -Q -l ~/tmp/foo.el -f my-test
> 
> where `foo.el` is the attached file.
> 
> Then scroll horizontally (I use `C-f` from the BOL and `C-b` from EOL to
> do that), you'll see that sometimes the columns aren't aligned (tho
> sometimes they are, even the very same columns).

Thanks for the clear recipe.  This should be now fixed on the master
branch, please see if the original problem is also fixed.





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

* bug#56176: 28.1.50; csv-align-mode misaligns when display-line-numbers-mode is on
  2022-06-29 17:19         ` Eli Zaretskii
@ 2022-06-30  9:23           ` Lars Ingebrigtsen
  0 siblings, 0 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-30  9:23 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: joostkremers, 56176, Stefan Monnier

Eli Zaretskii <eliz@gnu.org> writes:

> Thanks for the clear recipe.  This should be now fixed on the master
> branch, please see if the original problem is also fixed.

Yup; with your fixes, I can no longer reproduce the problem in
csv-align-mode, so I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2022-06-30  9:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-23 19:26 bug#56176: 28.1.50; csv-align-mode misaligns when display-line-numbers-mode is on Joost Kremers
2022-06-24  9:38 ` Lars Ingebrigtsen
2022-06-27 12:55   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-27 13:03     ` Eli Zaretskii
2022-06-27 15:27       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-29 17:19         ` Eli Zaretskii
2022-06-30  9:23           ` Lars Ingebrigtsen

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs.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).