* bug#61239: 30.0.50; Display property value `((space :align-to))` doesn't handle line numbers
@ 2023-02-02 21:26 Narendra Joshi
2023-02-03 8:54 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Narendra Joshi @ 2023-02-02 21:26 UTC (permalink / raw)
To: 61239
The following code demonstrates the behavior:
(display-line-numbers-mode +1)
(setq header-line-format
(concat (propertize " " 'display '((space :align-to 0))) "Column"))
With line numbers displayed, the text above, i.e. "Column" doesn't align
wit the text in the buffer. This is problematic for modes like SES mode
(https://www.gnu.org/software/emacs/manual/html_node/ses/index.html).
In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.36, cairo version 1.17.6) of 2023-01-21 built on derhulk
Repository revision: ca8f5f71f412f29d52da0bdb8ac196d298b3b0d3
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12014000
System Description: Fedora Linux 37 (Workstation Edition)
Configured using:
'configure --prefix /home/narendraj9/.local/ --with-native-compilation
--with-imagemagick --with-json'
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ
IMAGEMAGICK JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2
M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP
SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM
GTK3 ZLIB
Important settings:
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8
Major mode: Lisp Interaction
Minor modes in effect:
display-fill-column-indicator-mode: t
windmove-mode: t
display-line-numbers-mode: t
gradle-mode: t
dired-recent-mode: t
global-git-commit-mode: t
recentf-mode: t
pomodoro-mode: t
yas-global-mode: t
yas-minor-mode: t
aggressive-indent-mode: t
paredit-mode: t
outline-minor-mode: t
flyspell-mode: t
crux-reopen-as-root-mode: t
shell-dirtrack-mode: t
wrap-region-global-mode: t
wrap-region-mode: t
volatile-highlights-mode: t
company-statistics-mode: t
global-company-mode: t
company-mode: t
server-mode: t
global-auto-revert-mode: t
sub-paredit-mode: t
vertico-mode: t
minibuffer-depth-indicate-mode: t
delete-selection-mode: t
global-subword-mode: t
subword-mode: t
winner-mode: t
save-place-mode: t
which-key-mode: t
savehist-mode: t
electric-pair-mode: t
display-battery-mode: t
display-time-mode: t
midnight-mode: t
repeat-mode: t
override-global-mode: t
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tab-bar-history-mode: t
file-name-shadow-mode: t
context-menu-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
size-indication-mode: t
column-number-mode: t
line-number-mode: t
auto-fill-function: yas--auto-fill
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
abbrev-mode: t
hs-minor-mode: t
Features:
(shadow sort footnote gnus-config messages-are-flowing smtpmail
gnus-delay gnus-draft gnus-agent gnus-srvr gnus-score score-mode
nnvirtual gnus-cache nndraft nnmh gnus-async nntp gnus-msg bbdb-gnus
bbdb-mua bbdb-com bbdb bbdb-site timezone emacsbug hippie-exp
display-fill-column-indicator cursor-sensor ses unsafep emacs-news-mode
completion windmove finder skeleton autoinsert expand-region
subword-mode-expansions text-mode-expansions cc-mode-expansions
the-org-mode-expansions python-el-fgallina-expansions
er-basic-expansions expand-region-core expand-region-custom
symbol-overlay display-line-numbers consult-imenu mule-util mm-archive
lisp-mnt whitespace gradle-mode cl-print misearch multi-isearch
inferior-jshell shortdoc network-stream url-http url-gw url-cache
url-auth quoted-scratch mylife-relationships wid-browse goto-addr
org-indent org-element org-persist avl-tree oc-basic ol-eww ol-rmail
ol-mhe ol-irc ol-info ol-gnus nnselect gnus-art mm-uu mml2015 mm-view
mml-smime smime gnutls dig gnus-sum gnus-group gnus-undo gnus-start
gnus-dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo gnus-spec
gnus-int gnus-range gnus-win ol-docview doc-view image-mode exif
ol-bibtex bibtex ol-bbdb ol-w3m ol-doi org-link-doi mail-extr jka-compr
markdown-mode vc bug-reference macrostep-c cmacexp macrostep eglot array
jsonrpc ert ewoc debug backtrace flymake-proc flymake pulse color
dired-aux hl-line dired-x dired-recent dired-collapse dired-hacks-utils
discover makey face-remap 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 imenu magit-diff smerge-mode
diff git-commit log-edit message sendmail yank-media rfc822 mml mml-sec
epa derived epg rfc6068 epg-config mm-decode mm-bodies mm-encode
mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils
mailheader pcvs-util add-log magit-core magit-autorevert magit-margin
magit-transient magit-process with-editor magit-mode magit-git
magit-base magit-section crm vertico-repeat consult-register
consult-vertico consult recentf tree-widget erc-config erc-log
erc-services erc-track erc-match erc-join erc erc-backend erc-goodies
erc-networks erc-common erc-compat erc-loaddefs bookmark ledger-mode
ledger-check ledger-texi ledger-test ledger-sort ledger-report
ledger-reconcile ledger-occur ledger-fonts ledger-fontify ledger-state
ledger-complete ledger-schedule ledger-init ledger-xact ledger-post
ledger-exec ledger-navigate eshell esh-cmd esh-ext esh-opt esh-proc
esh-io esh-arg esh-module esh-groups esh-util ledger-context
ledger-commodities ledger-regex pomodoro org-timer org-config org-attach
org-id org-clock org-habit ob-ditaa ob-haskell ob-go ob-elixir ob-awk
ob-shell ob-C ob-clojure ob-gnuplot ob-ruby ob-R ob-python python
ob-lisp ob-sqlite ob-sql ob-plantuml picture org-agenda org-refile
org-web-tools esxml-query alert log4e notifications gntp ag vc-svn
find-dired dired dired-loaddefs org ob ob-tangle ob-ref ob-lob ob-table
ob-exp org-macro org-src ob-comint org-pcomplete org-list org-footnote
org-faces org-entities ob-emacs-lisp ob-core ob-eval org-cycle org-table
ol org-fold org-fold-core org-keys oc org-loaddefs find-func org-version
org-compat org-macs yasnippet-snippets yasnippet aggressive-indent
paredit hideshow noutline outline flyspell ispell crux tramp
tramp-loaddefs trampver tramp-integration cus-edit pp cus-start cus-load
files-x tramp-compat shell pcomplete parse-time iso8601 ls-lisp
wrap-region advice volatile-highlights company-oddmuse company-keywords
company-etags company-gtags company-dabbrev-code company-dabbrev
company-files company-clang company-capf company-cmake company-semantic
company-template company-bbdb company-statistics company
minibuffer-command-history init keycast memory-report nsm chart server
git-timemachine transient vc-git vc-dispatcher autorevert filenotify
diff-mode go-guru go-mode find-file typescript-mode cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
scribble-mode geiser-racket geiser-mit geiser-repl geiser-capf geiser
geiser-image geiser-doc geiser-menu geiser-autodoc geiser-edit etags
fileloop generator xref project-x project geiser-completion geiser-eval
geiser-connection tq geiser-syntax scheme geiser-log geiser-popup view
geiser-impl help-fns radix-tree geiser-custom geiser-base plisp-mode
picolisp-mode inferior-plisp inferior-picolisp pos-tip info-lookmore
info-look javadoc-lookup ido vertico orderless mb-depth delsel timeclock
sh-script smie treesit executable cap-words superword subword gud winner
saveplace which-key savehist apropos region-bindings-mode disp-table
wgrep grep compile comint ansi-osc ansi-color ring elec-pair
use-package-diminish eww xdg url-queue shr pixel-fill kinsoku url-file
svg dom puny mm-url gnus nnheader gnus-util text-property-search
time-date mail-utils range wid-edit mm-util mail-prsvr ffap thingatpt
ibuf-ext ibuffer ibuffer-loaddefs format-spec battery dbus xml time
mode-line-config jazz-theme cal-julian appearance pcase modus-themes
solar cal-dst cal-menu calendar cal-loaddefs midnight secrets
no-littering compat defs repeat edmacro kmacro use-package-bind-key f
f-shortdoc dash s comp comp-cstr warnings icons bind-key cl-extra
help-mode diminish use-package-ensure use-package-core magit-autoloads
git-commit-autoloads consult-autoloads alchemist-autoloads
elixir-mode-autoloads tree-sitter-autoloads tsc-autoloads
auctex-autoloads tex-site ht-autoloads ace-link-autoloads
aggressive-indent-autoloads async-autoloads auto-compile-autoloads
beacon-autoloads bicycle-autoloads boxquote-autoloads cargo-autoloads
markdown-mode-autoloads cdlatex-autoloads multiple-cursors-autoloads
paredit-autoloads color-identifiers-mode-autoloads
counsel-bbdb-autoloads crdt-autoloads crux-autoloads diminish-autoloads
dired-collapse-autoloads dired-narrow-autoloads dired-subtree-autoloads
dired-hacks-utils-autoloads ednc-autoloads eglot-java-autoloads
eglot-autoloads eldoc-box-autoloads elm-mode-autoloads embark-autoloads
emmet-mode-autoloads erlang-autoloads ess-autoloads evil-autoloads
expand-region-autoloads flycheck-yamllint-autoloads
git-timemachine-autoloads go-guru-autoloads go-mode-autoloads
google-translate-autoloads popup-autoloads graphviz-dot-mode-autoloads
haskell-mode-autoloads keycast-autoloads know-your-http-well-autoloads
ledger-mode-autoloads lua-mode-autoloads modus-themes-autoloads
moody-autoloads nix-mode-autoloads no-littering-autoloads
orderless-autoloads org-gcal-autoloads alert-autoloads aio-autoloads
elnode-autoloads web-autoloads creole-autoloads fakir-autoloads
noflet-autoloads db-autoloads ox-reveal-autoloads pcache-autoloads
persist-autoloads plisp-mode-autoloads proof-general-autoloads
proof-site proof-autoloads py-autopep8-autoloads python-mode-autoloads
racket-mode-autoloads realgud-autoloads realgud-recursive-autoloads
restclient-autoloads robe-autoloads rust-mode-autoloads rvm-autoloads
scala-mode-autoloads slime-autoloads macrostep-autoloads
symbol-overlay-autoloads tiny-autoloads tracking-autoloads
ace-window-autoloads avy-autoloads tuareg-autoloads rx caml-autoloads
typescript-mode-autoloads vertico-autoloads web-mode-autoloads
which-key-autoloads yaml-mode-autoloads rinari-autoloads jump-autoloads
geiser-mit-autoloads geiser-racket-autoloads geiser-autoloads
bbdb-autoloads csv-mode-autoloads yaml-autoloads ialign-autoloads
pos-tip-autoloads reformatter-autoloads ement-autoloads
transient-autoloads taxy-magit-section-autoloads magit-section-autoloads
taxy-autoloads plz-autoloads svg-lib-autoloads
quelpa-use-package-autoloads use-package-autoloads bind-key-autoloads
quelpa-autoloads easy-mmode company-autoloads pdf-tools-autoloads
request-autoloads finder-inf password-store-autoloads
with-editor-autoloads compat-autoloads f-autoloads
dash-functional-autoloads inf-ruby-autoloads js2-mode-autoloads
cider-autoloads clojure-mode-autoloads flycheck-autoloads s-autoloads
info dash-autoloads package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie generate-lisp-file
url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv
bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip
cconv 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 nadvice seq simple cl-generic
indonesian philippine 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 abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process
native-compile emacs)
Memory information:
((conses 16 1303151 246368)
(symbols 48 81870 9)
(strings 32 385694 22266)
(string-bytes 1 12033194)
(vectors 16 129508)
(vector-slots 8 3417594 248291)
(floats 8 3398 1186)
(intervals 56 15860 8336)
(buffers 976 48))
Best regards,
--
Narendra Joshi
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#61239: 30.0.50; Display property value `((space :align-to))` doesn't handle line numbers
2023-02-02 21:26 bug#61239: 30.0.50; Display property value `((space :align-to))` doesn't handle line numbers Narendra Joshi
@ 2023-02-03 8:54 ` Eli Zaretskii
2023-02-03 10:08 ` Narendra Joshi
2023-02-03 14:48 ` Eli Zaretskii
0 siblings, 2 replies; 4+ messages in thread
From: Eli Zaretskii @ 2023-02-03 8:54 UTC (permalink / raw)
To: Narendra Joshi; +Cc: 61239
tags 61239 notabug wontfix
thanks
> From: Narendra Joshi <narendraj9@gmail.com>
> Date: Thu, 02 Feb 2023 22:26:57 +0100
>
>
> The following code demonstrates the behavior:
>
> (display-line-numbers-mode +1)
> (setq header-line-format
> (concat (propertize " " 'display '((space :align-to 0))) "Column"))
>
> With line numbers displayed, the text above, i.e. "Column" doesn't align
> wit the text in the buffer. This is problematic for modes like SES mode
> (https://www.gnu.org/software/emacs/manual/html_node/ses/index.html).
The :align-to values in header-line and mode-line do not automatically
account for line numbers when display-line-numbers-mode is turned on.
This is because the display engine cannot possibly know whether the
application does or doesn't want this; we certainly don't want that
for mode-line, for example. For header lines, there's no guarantee
that the text there must align with the buffer text: that is up to the
application to decide.
So if a Lisp program wants the header-line indentation to be updated
according to the screen estate taken by line numbers, it should do the
following:
. turn on the minor mode header-line-indent-mode
. include header-line-indent-width in the :align-to expression
In your case, the following change in the :align-to should do what you
want:
(setq header-line-format
(concat (propertize " "
'display
'(space :align-to
(+ header-line-indent-width 0)))
"Column"))
You can see further examples of using this in tabulated-list-mode.el.
I see that the ELisp manual doesn't mention this minor mode, and
moreover, has some text which might mislead you into thinking that the
header-line display will automatically be updated to account for the
line numbers; I will fix the manual soon.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#61239: 30.0.50; Display property value `((space :align-to))` doesn't handle line numbers
2023-02-03 8:54 ` Eli Zaretskii
@ 2023-02-03 10:08 ` Narendra Joshi
2023-02-03 14:48 ` Eli Zaretskii
1 sibling, 0 replies; 4+ messages in thread
From: Narendra Joshi @ 2023-02-03 10:08 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 61239
[-- Attachment #1: Type: text/plain, Size: 2087 bytes --]
Thank a lot for the explanation :)
Best,
Narendra
On Fri, Feb 3, 2023, 09:54 Eli Zaretskii <eliz@gnu.org> wrote:
> tags 61239 notabug wontfix
> thanks
>
> > From: Narendra Joshi <narendraj9@gmail.com>
> > Date: Thu, 02 Feb 2023 22:26:57 +0100
> >
> >
> > The following code demonstrates the behavior:
> >
> > (display-line-numbers-mode +1)
> > (setq header-line-format
> > (concat (propertize " " 'display '((space :align-to 0))) "Column"))
> >
> > With line numbers displayed, the text above, i.e. "Column" doesn't align
> > wit the text in the buffer. This is problematic for modes like SES mode
> > (https://www.gnu.org/software/emacs/manual/html_node/ses/index.html).
>
>
> The :align-to values in header-line and mode-line do not automatically
> account for line numbers when display-line-numbers-mode is turned on.
> This is because the display engine cannot possibly know whether the
> application does or doesn't want this; we certainly don't want that
> for mode-line, for example. For header lines, there's no guarantee
> that the text there must align with the buffer text: that is up to the
> application to decide.
>
> So if a Lisp program wants the header-line indentation to be updated
> according to the screen estate taken by line numbers, it should do the
> following:
>
> . turn on the minor mode header-line-indent-mode
> . include header-line-indent-width in the :align-to expression
>
> In your case, the following change in the :align-to should do what you
> want:
>
> (setq header-line-format
> (concat (propertize " "
> 'display
> '(space :align-to
> (+ header-line-indent-width 0)))
> "Column"))
>
> You can see further examples of using this in tabulated-list-mode.el.
>
> I see that the ELisp manual doesn't mention this minor mode, and
> moreover, has some text which might mislead you into thinking that the
> header-line display will automatically be updated to account for the
> line numbers; I will fix the manual soon.
>
[-- Attachment #2: Type: text/html, Size: 2968 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#61239: 30.0.50; Display property value `((space :align-to))` doesn't handle line numbers
2023-02-03 8:54 ` Eli Zaretskii
2023-02-03 10:08 ` Narendra Joshi
@ 2023-02-03 14:48 ` Eli Zaretskii
1 sibling, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2023-02-03 14:48 UTC (permalink / raw)
To: narendraj9; +Cc: 61239-done
> Cc: 61239@debbugs.gnu.org
> Date: Fri, 03 Feb 2023 10:54:35 +0200
> From: Eli Zaretskii <eliz@gnu.org>
>
> I see that the ELisp manual doesn't mention this minor mode, and
> moreover, has some text which might mislead you into thinking that the
> header-line display will automatically be updated to account for the
> line numbers; I will fix the manual soon.
Now done.
And with that I'm closing this bug. Thanks for bringing this to our
attention.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-02-03 14:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-02 21:26 bug#61239: 30.0.50; Display property value `((space :align-to))` doesn't handle line numbers Narendra Joshi
2023-02-03 8:54 ` Eli Zaretskii
2023-02-03 10:08 ` Narendra Joshi
2023-02-03 14:48 ` Eli Zaretskii
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.