unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#33648: 25.2; feature request: configurable position of strike-through line
@ 2018-12-06  8:20 Robert Samal
  2020-08-31 11:21 ` Stefan Kangas
  0 siblings, 1 reply; 8+ messages in thread
From: Robert Samal @ 2018-12-06  8:20 UTC (permalink / raw)
  To: 33648


When I use set-face-attribute to give some text a strike-through
attribute, I see that emacs behaves differently from other pieces of
software: Apparently, the line is drawn at the level of half the glyph's
height -- which causes the line to be just touching letters like "a",
"c", "e", ... and it isn't perceived as striking the text out (at least
not by me).

In comparison, web browsers interpreting html strike tag make the
line at the level of half of the "small lowercase letters" -- basically
at the level of the line in lowercase "e". The same is done by Libre
Office ... and others.

My suggestion is to make this configurable in some way. I'm not sure,
if it would be better to have a global option for all files, or
if "(set-face-attribute ... :strike-through" should accept more choices
to make each line configurable. (I personally would change all of my
striking lines, if possible.)

Thanks in advance for considering this, for some uses (in particular
org-mode) this would help a lot.

Robert Samal, samal@iuuk.mff.cuni.cz


In GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.21)
of 2017-09-22, modified by Debian built on lgw01-amd64-050
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Ubuntu 18.04.1 LTS

Configured using:
'configure --build x86_64-linux-gnu --prefix=/usr
--sharedstatedir=/var/lib --libexecdir=/usr/lib
--localstatedir=/var/lib --infodir=/usr/share/info
--mandir=/usr/share/man --with-pop=yes
--enable-locallisppath=/etc/emacs25:/etc/emacs:/usr/local/share/emacs/25.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.2/site-lisp:/usr/share/emacs/site-lisp 

--with-sound=alsa --without-gconf --build x86_64-linux-gnu
--prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib
--localstatedir=/var/lib --infodir=/usr/share/info
--mandir=/usr/share/man --with-pop=yes
--enable-locallisppath=/etc/emacs25:/etc/emacs:/usr/local/share/emacs/25.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.2/site-lisp:/usr/share/emacs/site-lisp 

--with-sound=alsa --without-gconf --with-x=yes --with-x-toolkit=gtk3
--with-toolkit-scroll-bars 'CFLAGS=-g -O2
-fdebug-prefix-map=/build/emacs25-jYekUr/emacs25-25.2+1=.
-fstack-protector-strong -Wformat -Werror=format-security -Wall'
'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2'
'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
value of $LC_ALL:
value of $LC_CTYPE: en_GB.utf8
value of $LC_MESSAGES: en_GB.utf8
value of $LC_MONETARY: cs_CZ.utf8
value of $LC_NUMERIC: cs_CZ.utf8
value of $LC_TIME: en_GB.utf8
value of $LANG: cs_CZ.utf8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix

Major mode: Info

Minor modes in effect:
projectile-mode: t
recentf-mode: t
global-magit-file-mode: t
diff-auto-refine-mode: t
global-git-commit-mode: t
async-bytecomp-package-mode: t
winum-mode: t
winner-mode: t
volatile-highlights-mode: t
global-vi-tilde-fringe-mode: t
spaceline-info-mode: t
spaceline-helm-mode: t
save-place-mode: t
savehist-mode: t
popwin-mode: t
persp-mode: t
Info-breadcrumbs-in-mode-line-mode: t
flx-ido-mode: t
eyebrowse-mode: t
global-evil-surround-mode: t
evil-surround-mode: t
global-evil-search-highlight-persist: t
evil-search-highlight-persist: t
show-smartparens-global-mode: t
evil-escape-mode: t
global-anzu-mode: t
anzu-mode: t
eval-sexp-fu-flash-mode: t
counsel-mode: t
ivy-mode: t
clean-aindent-mode: t
which-key-mode: t
override-global-mode: t
global-undo-tree-mode: t
undo-tree-mode: t
shell-dirtrack-mode: t
evil-mode: t
evil-local-mode: t
spacemacs-leader-override-mode: t
global-spacemacs-leader-override-mode: t
global-hl-line-mode: t
xterm-mouse-mode: t
global-auto-revert-mode: t
ido-vertical-mode: t
global-page-break-lines-mode: t
global-eldoc-mode: t
electric-indent-mode: t
mouse-wheel-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

Recent messages:
user-error: This is the last Info node you looked at [8 times]
evil-line-move: End of buffer [2 times]
Mark saved where search started [2 times]
user-error: Point neither on reference nor in menu item description
user-error: Node has no Previous [2 times]
user-error: Node has no Next [3 times]
user-error: This is the last Info node you looked at [2 times]
C-c y is undefined
Saving file /home/samal/.emacs.d/.cache/recentf...
Wrote /home/samal/.emacs.d/.cache/recentf

Load-path shadows:
/usr/share/emacs/25.2/site-lisp/debian-startup hides 
/usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs/site-lisp/rst hides 
/usr/share/emacs/25.2/lisp/textmodes/rst
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-ledger hides 
/usr/share/emacs/25.2/lisp/org/ob-ledger
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-datetree hides 
/usr/share/emacs/25.2/lisp/org/org-datetree
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-perl hides 
/usr/share/emacs/25.2/lisp/org/ob-perl
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-plantuml hides 
/usr/share/emacs/25.2/lisp/org/ob-plantuml
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-lilypond hides 
/usr/share/emacs/25.2/lisp/org/ob-lilypond
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-plot hides 
/usr/share/emacs/25.2/lisp/org/org-plot
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-maxima hides 
/usr/share/emacs/25.2/lisp/org/ob-maxima
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-io hides 
/usr/share/emacs/25.2/lisp/org/ob-io
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-comint hides 
/usr/share/emacs/25.2/lisp/org/ob-comint
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-R hides 
/usr/share/emacs/25.2/lisp/org/ob-R
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob hides 
/usr/share/emacs/25.2/lisp/org/ob
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-compat hides 
/usr/share/emacs/25.2/lisp/org/org-compat
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-table hides 
/usr/share/emacs/25.2/lisp/org/org-table
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-C hides 
/usr/share/emacs/25.2/lisp/org/ob-C
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-fortran hides 
/usr/share/emacs/25.2/lisp/org/ob-fortran
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ox-texinfo hides 
/usr/share/emacs/25.2/lisp/org/ox-texinfo
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-irc hides 
/usr/share/emacs/25.2/lisp/org/org-irc
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-ctags hides 
/usr/share/emacs/25.2/lisp/org/org-ctags
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-matlab hides 
/usr/share/emacs/25.2/lisp/org/ob-matlab
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-feed hides 
/usr/share/emacs/25.2/lisp/org/org-feed
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-eval hides 
/usr/share/emacs/25.2/lisp/org/ob-eval
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-octave hides 
/usr/share/emacs/25.2/lisp/org/ob-octave
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-colview hides 
/usr/share/emacs/25.2/lisp/org/org-colview
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-org hides 
/usr/share/emacs/25.2/lisp/org/ob-org
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-core hides 
/usr/share/emacs/25.2/lisp/org/ob-core
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ox-md hides 
/usr/share/emacs/25.2/lisp/org/ox-md
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-w3m hides 
/usr/share/emacs/25.2/lisp/org/org-w3m
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-crypt hides 
/usr/share/emacs/25.2/lisp/org/org-crypt
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-calc hides 
/usr/share/emacs/25.2/lisp/org/ob-calc
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-scheme hides 
/usr/share/emacs/25.2/lisp/org/ob-scheme
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-ref hides 
/usr/share/emacs/25.2/lisp/org/ob-ref
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-emacs-lisp hides 
/usr/share/emacs/25.2/lisp/org/ob-emacs-lisp
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-dot hides 
/usr/share/emacs/25.2/lisp/org/ob-dot
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-macs hides 
/usr/share/emacs/25.2/lisp/org/org-macs
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org hides 
/usr/share/emacs/25.2/lisp/org/org
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-timer hides 
/usr/share/emacs/25.2/lisp/org/org-timer
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ox-man hides 
/usr/share/emacs/25.2/lisp/org/ox-man
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-gnuplot hides 
/usr/share/emacs/25.2/lisp/org/ob-gnuplot
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-picolisp hides 
/usr/share/emacs/25.2/lisp/org/ob-picolisp
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-sass hides 
/usr/share/emacs/25.2/lisp/org/ob-sass
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-info hides 
/usr/share/emacs/25.2/lisp/org/org-info
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-lisp hides 
/usr/share/emacs/25.2/lisp/org/ob-lisp
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ox-latex hides 
/usr/share/emacs/25.2/lisp/org/ox-latex
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-mscgen hides 
/usr/share/emacs/25.2/lisp/org/ob-mscgen
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ox-org hides 
/usr/share/emacs/25.2/lisp/org/ox-org
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-mouse hides 
/usr/share/emacs/25.2/lisp/org/org-mouse
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-agenda hides 
/usr/share/emacs/25.2/lisp/org/org-agenda
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-shen hides 
/usr/share/emacs/25.2/lisp/org/ob-shen
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-attach hides 
/usr/share/emacs/25.2/lisp/org/org-attach
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-tangle hides 
/usr/share/emacs/25.2/lisp/org/ob-tangle
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-table hides 
/usr/share/emacs/25.2/lisp/org/ob-table
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-ocaml hides 
/usr/share/emacs/25.2/lisp/org/ob-ocaml
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-loaddefs hides 
/usr/share/emacs/25.2/lisp/org/org-loaddefs
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-mhe hides 
/usr/share/emacs/25.2/lisp/org/org-mhe
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-screen hides 
/usr/share/emacs/25.2/lisp/org/ob-screen
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-faces hides 
/usr/share/emacs/25.2/lisp/org/org-faces
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-python hides 
/usr/share/emacs/25.2/lisp/org/ob-python
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ox hides 
/usr/share/emacs/25.2/lisp/org/ox
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-bbdb hides 
/usr/share/emacs/25.2/lisp/org/org-bbdb
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-keys hides 
/usr/share/emacs/25.2/lisp/org/ob-keys
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-css hides 
/usr/share/emacs/25.2/lisp/org/ob-css
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-ditaa hides 
/usr/share/emacs/25.2/lisp/org/ob-ditaa
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-eshell hides 
/usr/share/emacs/25.2/lisp/org/org-eshell
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-docview hides 
/usr/share/emacs/25.2/lisp/org/org-docview
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-asymptote hides 
/usr/share/emacs/25.2/lisp/org/ob-asymptote
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ox-beamer hides 
/usr/share/emacs/25.2/lisp/org/ox-beamer
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-clojure hides 
/usr/share/emacs/25.2/lisp/org/ob-clojure
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-sql hides 
/usr/share/emacs/25.2/lisp/org/ob-sql
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-gnus hides 
/usr/share/emacs/25.2/lisp/org/org-gnus
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-haskell hides 
/usr/share/emacs/25.2/lisp/org/ob-haskell
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-ruby hides 
/usr/share/emacs/25.2/lisp/org/ob-ruby
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-clock hides 
/usr/share/emacs/25.2/lisp/org/org-clock
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-rmail hides 
/usr/share/emacs/25.2/lisp/org/org-rmail
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-src hides 
/usr/share/emacs/25.2/lisp/org/org-src
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ox-html hides 
/usr/share/emacs/25.2/lisp/org/ox-html
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-makefile hides 
/usr/share/emacs/25.2/lisp/org/ob-makefile
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-capture hides 
/usr/share/emacs/25.2/lisp/org/org-capture
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-element hides 
/usr/share/emacs/25.2/lisp/org/org-element
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-habit hides 
/usr/share/emacs/25.2/lisp/org/org-habit
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-inlinetask hides 
/usr/share/emacs/25.2/lisp/org/org-inlinetask
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-exp hides 
/usr/share/emacs/25.2/lisp/org/ob-exp
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-pcomplete hides 
/usr/share/emacs/25.2/lisp/org/org-pcomplete
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-bibtex hides 
/usr/share/emacs/25.2/lisp/org/org-bibtex
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-id hides 
/usr/share/emacs/25.2/lisp/org/org-id
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-js hides 
/usr/share/emacs/25.2/lisp/org/ob-js
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-latex hides 
/usr/share/emacs/25.2/lisp/org/ob-latex
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-awk hides 
/usr/share/emacs/25.2/lisp/org/ob-awk
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-footnote hides 
/usr/share/emacs/25.2/lisp/org/org-footnote
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-mobile hides 
/usr/share/emacs/25.2/lisp/org/org-mobile
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ox-icalendar hides 
/usr/share/emacs/25.2/lisp/org/ox-icalendar
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ox-odt hides 
/usr/share/emacs/25.2/lisp/org/ox-odt
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-lob hides 
/usr/share/emacs/25.2/lisp/org/ob-lob
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-java hides 
/usr/share/emacs/25.2/lisp/org/ob-java
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-indent hides 
/usr/share/emacs/25.2/lisp/org/org-indent
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ox-ascii hides 
/usr/share/emacs/25.2/lisp/org/ox-ascii
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ob-sqlite hides 
/usr/share/emacs/25.2/lisp/org/ob-sqlite
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-install hides 
/usr/share/emacs/25.2/lisp/org/org-install
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-protocol hides 
/usr/share/emacs/25.2/lisp/org/org-protocol
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/ox-publish hides 
/usr/share/emacs/25.2/lisp/org/ox-publish
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-list hides 
/usr/share/emacs/25.2/lisp/org/org-list
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-entities hides 
/usr/share/emacs/25.2/lisp/org/org-entities
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-archive hides 
/usr/share/emacs/25.2/lisp/org/org-archive
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-version hides 
/usr/share/emacs/25.2/lisp/org/org-version
/home/samal/.emacs.d/elpa/org-plus-contrib-20180910/org-macro hides 
/usr/share/emacs/25.2/lisp/org/org-macro
/home/samal/.emacs.d/elpa/let-alist-1.0.5/let-alist hides 
/usr/share/emacs/25.2/lisp/emacs-lisp/let-alist

Features:
(shadow sort mail-extr emacsbug sendmail smex vc-git misearch
multi-isearch jka-compr diminish projectile grep ibuf-ext ibuffer
recentf tree-widget smartparens-org smartparens-text orgit org-element
avl-tree git-rebase evil-magit magit-obsolete magit-blame magit-stash
magit-bisect magit-remote magit-commit magit-sequence magit-notes
magit-worktree magit-tag magit-merge magit-branch magit-reset
magit-collab ghub-graphql treepy graphql ghub url-http tls gnutls url-gw
url-auth url url-proxy url-privacy url-expand url-methods url-history
url-cookie url-domsuf url-util mailcap let-alist magit-files magit-refs
magit-status magit magit-repos magit-apply magit-wip magit-log
which-func imenu magit-diff smerge-mode diff-mode magit-core
magit-autorevert magit-process magit-margin magit-mode git-commit
magit-git magit-section magit-utils crm magit-popup log-edit message
rfc822 mml mml-sec epg mailabbrev mail-utils gmm-utils mailheader
pcvs-util add-log with-editor async-bytecomp async org org-macro
org-footnote org-pcomplete org-list org-faces org-entities org-version
ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp
ob-comint ob-core ob-eval org-compat org-macs org-loaddefs find-func
cal-menu calendar cal-loaddefs hl-todo server ws-butler winum winner
etags volatile-highlights vi-tilde-fringe spaceline-config
spaceline-segments spaceline powerline powerline-separators
powerline-themes smartparens-config saveplace savehist popwin persp-mode
linum ivy-hydra info+ image-mode flx-ido flx eyebrowse format-spec
evil-unimpaired f s evil-surround evil-search-highlight-persist
evil-numbers evil-lisp-state smartparens dash evil-indent-plus
evil-exchange evil-escape evil-args evil-anzu anzu eval-sexp-fu rx
highlight noutline outline counsel xref project dired compile swiper ivy
delsel colir color ivy-overlay ffap clean-aindent-mode adaptive-wrap
hybrid-mode exec-path-from-shell evil-evilified-state which-key
use-package use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key use-package-core hydra lv cus-edit
cus-start cus-load evil evil-keybindings evil-integration undo-tree diff
evil-maps evil-commands reveal flyspell ispell evil-jumps
evil-command-window evil-types evil-search evil-ex shell pcomplete
comint ansi-color evil-macros evil-repeat evil-states evil-core
evil-common windmove thingatpt rect evil-digraphs evil-vars ring info
bind-map quelpa url-parse auth-source gnus-util password-cache url-vars
package-build mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 ietf-drums mm-util help-fns mail-prsvr json map lisp-mnt hl-line
xt-mouse autorevert filenotify disp-table wid-edit leuven-theme
finder-inf core-configuration-layer eieio-compat cl-seq ht cl warnings
package epg-config eieio eieio-core ido-vertical-mode ido seq byte-opt
bytecomp byte-compile cl-extra help-mode cconv core-spacemacs
core-use-package-ext core-transient-state core-micro-state core-toggle
core-keybindings core-fonts-support core-spacemacs-buffer core-funcs
cl-macs gv core-themes-support core-display-init core-jump
core-auto-completion core-release-management core-dotspacemacs
core-command-line core-debug edmacro kmacro derived advice profiler
easymenu cl-loaddefs cl-lib page-break-lines easy-mmode subr-x pcase
time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame 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 charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote dbusbind inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 634356 638794)
(symbols 48 55709 12)
(miscs 40 854 680)
(strings 32 151316 386782)
(string-bytes 1 4950930)
(vectors 16 55986)
(vector-slots 8 1363127 277341)
(floats 8 757 796)
(intervals 56 5736 504)
(buffers 976 21))





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

* bug#33648: 25.2; feature request: configurable position of strike-through line
  2018-12-06  8:20 bug#33648: 25.2; feature request: configurable position of strike-through line Robert Samal
@ 2020-08-31 11:21 ` Stefan Kangas
  2020-08-31 11:35   ` Stefan Kangas
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Stefan Kangas @ 2020-08-31 11:21 UTC (permalink / raw)
  To: Robert Samal; +Cc: 33648

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

tags 33648 + confirmed
thanks

Robert Samal <samal@iuuk.mff.cuni.cz> writes:

> When I use set-face-attribute to give some text a strike-through
> attribute, I see that emacs behaves differently from other pieces of
> software: Apparently, the line is drawn at the level of half the glyph's
> height -- which causes the line to be just touching letters like "a",
> "c", "e", ... and it isn't perceived as striking the text out (at least
> not by me).
>
> In comparison, web browsers interpreting html strike tag make the
> line at the level of half of the "small lowercase letters" -- basically
> at the level of the line in lowercase "e". The same is done by Libre
> Office ... and others.
>
> My suggestion is to make this configurable in some way. I'm not sure,
> if it would be better to have a global option for all files, or
> if "(set-face-attribute ... :strike-through" should accept more choices
> to make each line configurable. (I personally would change all of my
> striking lines, if possible.)
>
> Thanks in advance for considering this, for some uses (in particular
> org-mode) this would help a lot.

This is what I see on current master:

[-- Attachment #2: Type: text/plain, Size: 49 bytes --]


This is the same text rendered in LibreOffice:


[-- Attachment #3: bug-33648-emacs-orig.png --]
[-- Type: image/png, Size: 3871 bytes --]

[-- Attachment #4: bug-33648-libreoffice.png --]
[-- Type: image/png, Size: 4903 bytes --]

[-- Attachment #5: Type: text/plain, Size: 637 bytes --]


I see two problems here:

1. The strike-through in our case is placed at half the height of an
   upper-case glyph.  LibreOffice seems to have a smarter positioning.

2. The strike-through line is hard coded to 1 pixel in our case, whereas
   LibreOffice scales it up as the font size increases.

I'm have no idea how to fix it; the font code is pretty opaque to me.

I mucked around a bit and came up with the below diff.  It is probably
not the correct fix, but does make it slightly better for me.  Someone
who understands this better would need to investigate this properly.

FWIW, here is what it looks like with the below patch:


[-- Attachment #6: bug-33648-with-patch.png --]
[-- Type: image/png, Size: 2288 bytes --]

[-- Attachment #7: Type: text/plain, Size: 513 bytes --]


diff --git a/src/xterm.c b/src/xterm.c
index 2e0407aff4..5792574e05 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -3932,7 +3932,7 @@ x_draw_glyph_string (struct glyph_string *s)
 	  /* Strike-through width and offset from the glyph string's
 	     top edge.  */
           unsigned long h = 1;
-          unsigned long dy = (glyph_height - h) / 2;
+          unsigned long dy = (glyph_height - h) / 3;
 
 	  if (s->face->strike_through_color_defaulted_p)
 	    x_fill_rectangle (s->f, s->gc, s->x, glyph_y + dy,

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

* bug#33648: 25.2; feature request: configurable position of strike-through line
  2020-08-31 11:21 ` Stefan Kangas
@ 2020-08-31 11:35   ` Stefan Kangas
  2020-08-31 14:39     ` Eli Zaretskii
  2020-08-31 14:40     ` Eli Zaretskii
  2020-08-31 14:37   ` Eli Zaretskii
  2020-08-31 17:42   ` Stefan Kangas
  2 siblings, 2 replies; 8+ messages in thread
From: Stefan Kangas @ 2020-08-31 11:35 UTC (permalink / raw)
  To: Robert Samal; +Cc: 33648

Stefan Kangas <stefan@marxist.se> writes:

> I mucked around a bit and came up with the below diff.  It is probably
> not the correct fix, but does make it slightly better for me.  Someone
> who understands this better would need to investigate this properly.

Actually, looking at this more, I'm starting to get convinced that
LibreOffice is actually just positioning the line at the upper case
glyph height divided by 3 instead of 2.

I had a look also at Firefox, and, if I'm not mistaken, they place the
line at half the height of the lower-case glyph.  (Perhaps that makes
even more sense?)  I used the following link for testing:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strike#Example

Best regards,
Stefan Kangas





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

* bug#33648: 25.2; feature request: configurable position of strike-through line
  2020-08-31 11:21 ` Stefan Kangas
  2020-08-31 11:35   ` Stefan Kangas
@ 2020-08-31 14:37   ` Eli Zaretskii
  2020-08-31 17:42   ` Stefan Kangas
  2 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2020-08-31 14:37 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 33648, samal

> From: Stefan Kangas <stefan@marxist.se>
> Date: Mon, 31 Aug 2020 11:21:09 +0000
> Cc: 33648@debbugs.gnu.org
> 
> > When I use set-face-attribute to give some text a strike-through
> > attribute, I see that emacs behaves differently from other pieces of
> > software: Apparently, the line is drawn at the level of half the glyph's
> > height -- which causes the line to be just touching letters like "a",
> > "c", "e", ... and it isn't perceived as striking the text out (at least
> > not by me).
> >
> > In comparison, web browsers interpreting html strike tag make the
> > line at the level of half of the "small lowercase letters" -- basically
> > at the level of the line in lowercase "e". The same is done by Libre
> > Office ... and others.

Web browsers and the rest normally don't have to support display
elements of different height on the same screen line.

> > My suggestion is to make this configurable in some way. I'm not sure,
> > if it would be better to have a global option for all files, or
> > if "(set-face-attribute ... :strike-through" should accept more choices
> > to make each line configurable. (I personally would change all of my
> > striking lines, if possible.)

Patches to make the offset configurable via a Lisp variable are
welcome.  (I'm not sure the result will be prettier, except in some
very special cases, but if someone wants to shoot themselves in the
foot, why not?)

> I'm have no idea how to fix it; the font code is pretty opaque to me.

The code to handle this is quite simple: search for strike_through_p
in xterm.c.  (We have similar code in w32term.c and nsterm.m.)

> I mucked around a bit and came up with the below diff.

I found no diffs in your message.





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

* bug#33648: 25.2; feature request: configurable position of strike-through line
  2020-08-31 11:35   ` Stefan Kangas
@ 2020-08-31 14:39     ` Eli Zaretskii
  2020-08-31 14:40     ` Eli Zaretskii
  1 sibling, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2020-08-31 14:39 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 33648, samal

> From: Stefan Kangas <stefan@marxist.se>
> Date: Mon, 31 Aug 2020 11:35:50 +0000
> Cc: 33648@debbugs.gnu.org
> 
> Actually, looking at this more, I'm starting to get convinced that
> LibreOffice is actually just positioning the line at the upper case
> glyph height divided by 3 instead of 2.
> 
> I had a look also at Firefox, and, if I'm not mistaken, they place the
> line at half the height of the lower-case glyph.

What happens/will happen if the same screen line has characters from
fonts of different height, all of them with strike-through? doesn't
the strike-through line break?





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

* bug#33648: 25.2; feature request: configurable position of strike-through line
  2020-08-31 11:35   ` Stefan Kangas
  2020-08-31 14:39     ` Eli Zaretskii
@ 2020-08-31 14:40     ` Eli Zaretskii
  1 sibling, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2020-08-31 14:40 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 33648, samal

> From: Stefan Kangas <stefan@marxist.se>
> Date: Mon, 31 Aug 2020 11:35:50 +0000
> Cc: 33648@debbugs.gnu.org
> 
> Actually, looking at this more, I'm starting to get convinced that
> LibreOffice is actually just positioning the line at the upper case
> glyph height divided by 3 instead of 2.
> 
> I had a look also at Firefox, and, if I'm not mistaken, they place the
> line at half the height of the lower-case glyph.

What happens/will happen if the same screen line has characters from
fonts of different height, all of them with strike-through? doesn't
the strike-through line break in Firefox and the likes?





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

* bug#33648: 25.2; feature request: configurable position of strike-through line
  2020-08-31 11:21 ` Stefan Kangas
  2020-08-31 11:35   ` Stefan Kangas
  2020-08-31 14:37   ` Eli Zaretskii
@ 2020-08-31 17:42   ` Stefan Kangas
  2020-08-31 18:43     ` Eli Zaretskii
  2 siblings, 1 reply; 8+ messages in thread
From: Stefan Kangas @ 2020-08-31 17:42 UTC (permalink / raw)
  To: Robert Samal; +Cc: 33648

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

Stefan Kangas <stefan@marxist.se> writes:

> 2. The strike-through line is hard coded to 1 pixel in our case, whereas
>    LibreOffice scales it up as the font size increases.

I've attached a suggested patch to change the strike-through line
depending on the glyph size.  The constant factor was found by
experimentation and produces reasonable results here.

Best regards,
Stefan Kangas

[-- Attachment #2: 0001-Make-strike-through-thicker-for-larger-font-sizes.patch --]
[-- Type: text/x-diff, Size: 2625 bytes --]

From 74b5091161890bc145034c5f2fd0c7e615b21d65 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Mon, 31 Aug 2020 13:39:51 +0200
Subject: [PATCH] Make strike-through thicker for larger font sizes

* src/nsterm.m (ns_draw_text_decoration):
* src/w32term.c (w32_draw_glyph_string):
* src/xterm.c (x_draw_glyph_string): Make strike-through thicker
for larger font sizes.  (Bug#33648)
* src/dispextern.h (STRIKE_THROUGH_WIDTH_FACTOR): New constant.
---
 src/dispextern.h | 4 ++++
 src/nsterm.m     | 2 +-
 src/w32term.c    | 2 +-
 src/xterm.c      | 2 +-
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/dispextern.h b/src/dispextern.h
index 956ca96eb6..461526a7f8 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -656,6 +656,10 @@ #define GLYPH_INVALID_P(GLYPH) (GLYPH_CHAR (GLYPH) < 0)
 
 #define CHAR_GLYPH_PADDING_P(GLYPH) (GLYPH).padding_p
 
+/* Calculate the width of the strike-through line.  */
+
+#define STRIKE_THROUGH_WIDTH(x) ceilf (x / 15.0)
+
 
 
 \f
diff --git a/src/nsterm.m b/src/nsterm.m
index 26059ab67c..16575c066b 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3706,7 +3706,7 @@ larger if there are taller display elements (e.g., characters
       int glyph_height = s->first_glyph->ascent + s->first_glyph->descent;
       /* Strike-through width and offset from the glyph string's
 	 top edge.  */
-      unsigned long h = 1;
+      unsigned long h = STRIKE_THROUGH_WIDTH (glyph_height);
       unsigned long dy;
 
       dy = lrint ((glyph_height - h) / 2);
diff --git a/src/w32term.c b/src/w32term.c
index 1766b32514..1b8d9b811b 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -2636,7 +2636,7 @@ w32_draw_glyph_string (struct glyph_string *s)
 	  int glyph_height = s->first_glyph->ascent + s->first_glyph->descent;
 	  /* Strike-through width and offset from the glyph string's
 	     top edge.  */
-          unsigned long h = 1;
+	  unsigned long h = STRIKE_THROUGH_WIDTH (glyph_height);
           unsigned long dy = (glyph_height - h) / 2;
 
           if (s->face->strike_through_color_defaulted_p)
diff --git a/src/xterm.c b/src/xterm.c
index 2e0407aff4..b17afdf225 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -3931,7 +3931,7 @@ x_draw_glyph_string (struct glyph_string *s)
 	  int glyph_height = s->first_glyph->ascent + s->first_glyph->descent;
 	  /* Strike-through width and offset from the glyph string's
 	     top edge.  */
-          unsigned long h = 1;
+	  unsigned long h = STRIKE_THROUGH_WIDTH (glyph_height);
           unsigned long dy = (glyph_height - h) / 2;
 
 	  if (s->face->strike_through_color_defaulted_p)
-- 
2.28.0


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

* bug#33648: 25.2; feature request: configurable position of strike-through line
  2020-08-31 17:42   ` Stefan Kangas
@ 2020-08-31 18:43     ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2020-08-31 18:43 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 33648, samal

> From: Stefan Kangas <stefan@marxist.se>
> Date: Mon, 31 Aug 2020 17:42:43 +0000
> Cc: 33648@debbugs.gnu.org
> 
> I've attached a suggested patch to change the strike-through line
> depending on the glyph size.  The constant factor was found by
> experimentation and produces reasonable results here.

Which glyph, though?  Emacs draws glyphs in series, called "glyph
string".  All the glyphs in a glyph string share the same face (and
thus the same font), but that doesn't mean all the glyphs are of the
same height.  And here...

> --- a/src/xterm.c
> +++ b/src/xterm.c
> @@ -3931,7 +3931,7 @@ x_draw_glyph_string (struct glyph_string *s)
>  	  int glyph_height = s->first_glyph->ascent + s->first_glyph->descent;
>  	  /* Strike-through width and offset from the glyph string's
>  	     top edge.  */
> -          unsigned long h = 1;
> +	  unsigned long h = STRIKE_THROUGH_WIDTH (glyph_height);
>            unsigned long dy = (glyph_height - h) / 2;

..glyph_height is simply the height of the first glyph in the glyph
string.  Which could be anything, whereas you seem to assume that all
of the glyphs in a glyph string are of the same height.  IOW, you are
repeating the same "mistake" we do now, just with a different fraction
value.  Wanna bet that it will break with some fonts?

That is why I suggested a Lisp-exposed variable that could be set to
the offset in pixels of the strike-through line from the base.  (If
you want to be fancy, the Lisp variable could also be a float, in
which case it will be interpreted as a fraction of the first glyph's
height.)  This should be user-controlled, which will allow users (or
Lisp programs) to set that as they see fit, without requiring us to
second-guess up front what they would like.

Thanks.





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

end of thread, other threads:[~2020-08-31 18:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-06  8:20 bug#33648: 25.2; feature request: configurable position of strike-through line Robert Samal
2020-08-31 11:21 ` Stefan Kangas
2020-08-31 11:35   ` Stefan Kangas
2020-08-31 14:39     ` Eli Zaretskii
2020-08-31 14:40     ` Eli Zaretskii
2020-08-31 14:37   ` Eli Zaretskii
2020-08-31 17:42   ` Stefan Kangas
2020-08-31 18:43     ` Eli Zaretskii

Code repositories for project(s) associated with this public 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).