GNU bug report logs - #15155
24.3; wrap-prefix in adaptive-wrap-prefix-mode with variable-pitch has wrong face

Previous Next

Package: emacs;

Reported by: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>

Date: Wed, 21 Aug 2013 20:23:01 UTC

Severity: normal

Found in version 24.3

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15155 in the body.
You can then email your comments to 15155 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#15155; Package emacs. (Wed, 21 Aug 2013 20:23:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 21 Aug 2013 20:23:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3; wrap-prefix in adaptive-wrap-prefix-mode with variable-pitch has
 wrong face
Date: Wed, 21 Aug 2013 21:54:40 +0200
Using 'adaptive-wrap.el' from ELPA 
(http://elpa.gnu.org/packages/adaptive-wrap-0.5.el)

emacs -Q -l adaptive-wrap-0.5.el
M-x visual-line-mode RET
M-x adaptive-wrap-prefix-mode RET
M-x variable-pitch-mode RET

Then make the X window small enough so that the lines in the *scratch*
buffer wrap. The color of the wrap-prefix (i.e. the semicolons ;;) is
black and seems fixed width instead of red and using variable-pitch
font. It seems as if the wrap-prefix does not inherit the face of the
original (comment) prefix. This becomes more apparent when adding
whitespaces at the beginning of the first line. Then the indentation of
the next (wrapped) lines will also increase, however by a different
amount because of the different font. I suppose the wrap-prefix somehow
uses the global default font and not the font defined by variable-pitch.

Note that this used to work in Emacs 23 (tested with 23.4.1) where the
wrap-prefix in the successive lines has the same face as the original
prefix.

Also see my question in emacs-help:
http://article.gmane.org/gmane.emacs.help/93023


In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.6.4)
 of 2013-04-14 on marid, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11303000
System Description:	Ubuntu 13.04

Configured using:
 `configure '--build' 'x86_64-linux-gnu' '--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/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp'
 '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes'
 '--with-x-toolkit=gtk3' '--with-toolkit-scroll-bars'
 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector
 --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall'
 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro'
 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LANG: de_DE.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  adaptive-wrap-prefix-mode: t
  highlight-parentheses-mode: t
  company-mode: t
  global-semantic-mru-bookmark-mode: t
  global-semanticdb-minor-mode: t
  global-semantic-idle-scheduler-mode: t
  global-semantic-decoration-mode: t
  show-paren-mode: t
  Info-breadcrumbs-in-mode-line-mode: t
  global-hl-line-mode: t
  global-auto-revert-mode: t
  winpoint-mode: t
  ido-everywhere: t
  global-surround-mode: t
  surround-mode: t
  evil-mode: t
  evil-local-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  auto-compile-on-load-mode: t
  auto-compile-on-save-mode: t
  semantic-mode: t
  tooltip-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
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  visual-line-mode: t
  transient-mark-mode: t

Recent input:
M-x r e p o <tab> r <tab> <return> a d a p t i v e 
- w <S-up> M-x a <escape> M-x a d a p <tab> C-g k k 
M-x v i s u <tab> <return> M-x a d a p <tab> <return> 
M-x <up> <return> M-x r e p o <tab> r <tab> <retur
n>

Recent messages:
Loading /home/fifr/.emacs.d/site-lisp/rudel/rudel-loaddefs.el (source)...done
Starting Emacs daemon.
When done with this frame, type C-x 5 0
Making completion list...
byte-code: Command attempted to use minibuffer while in minibuffer
Quit
Visual-Line mode enabled
Adaptive-Wrap-Prefix mode disabled
Adaptive-Wrap-Prefix mode enabled
Making completion list...

Load-path shadows:
/home/fifr/.emacs.d/el-get/wanderlust/utils/ssl hides /home/fifr/.emacs.d/el-get/wanderlust/site-lisp/wl/ssl
/home/fifr/.emacs.d/el-get/wanderlust/utils/wl-complete hides /home/fifr/.emacs.d/el-get/wanderlust/site-lisp/wl/wl-complete
/home/fifr/.emacs.d/el-get/wanderlust/utils/im-wl hides /home/fifr/.emacs.d/el-get/wanderlust/site-lisp/wl/im-wl
/home/fifr/.emacs.d/el-get/wanderlust/utils/wl-mailto hides /home/fifr/.emacs.d/el-get/wanderlust/site-lisp/wl/wl-mailto
/home/fifr/.emacs.d/el-get/wanderlust/utils/rfc2368 hides /home/fifr/.emacs.d/el-get/wanderlust/site-lisp/wl/rfc2368
/home/fifr/.emacs.d/el-get/wanderlust/utils/wl-addrbook hides /home/fifr/.emacs.d/el-get/wanderlust/site-lisp/wl/wl-addrbook
/home/fifr/.emacs.d/el-get/cedet/lisp/speedbar/loaddefs hides /home/fifr/.emacs.d/el-get/cedet/lisp/eieio/loaddefs
/home/fifr/.emacs.d/el-get/cedet/lisp/speedbar/loaddefs hides /home/fifr/.emacs.d/el-get/cedet/lisp/cedet/loaddefs
/home/fifr/.emacs.d/el-get/reftex/lisp/lpath hides /home/fifr/.emacs.d/el-get/auctex/lpath
/home/fifr/.emacs.d/elpa/company-20130810.112/.dir-locals hides /home/fifr/.emacs.d/elpa/highlight-parentheses-20130523.1752/.dir-locals
/home/fifr/.emacs.d/elpa/company-20130810.112/.dir-locals hides /home/fifr/.emacs.d/elpa/magit-20130810.1119/.dir-locals
/home/fifr/.emacs.d/elpa/company-20130810.112/.dir-locals hides ~/.emacs.d/el-get/el-get/.dir-locals
/home/fifr/.emacs.d/elpa/cmake-mode-20110824/cmake-mode hides /usr/share/emacs/24.3/site-lisp/cmake-data/cmake-mode
/usr/share/emacs/24.3/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
/home/fifr/.emacs.d/elpa/cmake-mode-20110824/cmake-mode hides /usr/share/emacs/site-lisp/cmake-mode
~/.emacs.d/custom hides /usr/share/emacs/24.3/lisp/custom
/home/fifr/.emacs.d/el-get/flim/site-lisp/flim/md4 hides /usr/share/emacs/24.3/lisp/md4
/home/fifr/.emacs.d/el-get/flim/site-lisp/flim/hex-util hides /usr/share/emacs/24.3/lisp/hex-util
/home/fifr/.emacs.d/el-get/cedet/lisp/speedbar/loaddefs hides /usr/share/emacs/24.3/lisp/loaddefs
/home/fifr/.emacs.d/el-get/reftex/lisp/reftex-auc hides /usr/share/emacs/24.3/lisp/textmodes/reftex-auc
/home/fifr/.emacs.d/el-get/reftex/lisp/reftex-dcr hides /usr/share/emacs/24.3/lisp/textmodes/reftex-dcr
/home/fifr/.emacs.d/el-get/reftex/lisp/reftex-parse hides /usr/share/emacs/24.3/lisp/textmodes/reftex-parse
/home/fifr/.emacs.d/el-get/reftex/lisp/reftex-ref hides /usr/share/emacs/24.3/lisp/textmodes/reftex-ref
/home/fifr/.emacs.d/el-get/reftex/lisp/reftex-cite hides /usr/share/emacs/24.3/lisp/textmodes/reftex-cite
/usr/share/emacs24/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/24.3/lisp/textmodes/ispell
/usr/share/emacs24/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/24.3/lisp/textmodes/flyspell
/home/fifr/.emacs.d/el-get/reftex/lisp/reftex-vars hides /usr/share/emacs/24.3/lisp/textmodes/reftex-vars
/home/fifr/.emacs.d/el-get/reftex/lisp/reftex-toc hides /usr/share/emacs/24.3/lisp/textmodes/reftex-toc
/home/fifr/.emacs.d/el-get/reftex/lisp/reftex hides /usr/share/emacs/24.3/lisp/textmodes/reftex
/home/fifr/.emacs.d/el-get/reftex/lisp/reftex-sel hides /usr/share/emacs/24.3/lisp/textmodes/reftex-sel
/home/fifr/.emacs.d/el-get/reftex/lisp/reftex-index hides /usr/share/emacs/24.3/lisp/textmodes/reftex-index
/home/fifr/.emacs.d/el-get/reftex/lisp/reftex-global hides /usr/share/emacs/24.3/lisp/textmodes/reftex-global
/home/fifr/.emacs.d/el-get/flim/site-lisp/flim/hmac-md5 hides /usr/share/emacs/24.3/lisp/net/hmac-md5
/home/fifr/.emacs.d/el-get/flim/site-lisp/flim/sasl-cram hides /usr/share/emacs/24.3/lisp/net/sasl-cram
/home/fifr/.emacs.d/el-get/flim/site-lisp/flim/hmac-def hides /usr/share/emacs/24.3/lisp/net/hmac-def
/home/fifr/.emacs.d/el-get/flim/site-lisp/flim/sasl-digest hides /usr/share/emacs/24.3/lisp/net/sasl-digest
/home/fifr/.emacs.d/el-get/flim/site-lisp/flim/sasl-ntlm hides /usr/share/emacs/24.3/lisp/net/sasl-ntlm
/home/fifr/.emacs.d/el-get/flim/site-lisp/flim/sasl hides /usr/share/emacs/24.3/lisp/net/sasl
/home/fifr/.emacs.d/el-get/flim/site-lisp/flim/ntlm hides /usr/share/emacs/24.3/lisp/net/ntlm
/home/fifr/.emacs.d/el-get/wanderlust/utils/rfc2368 hides /usr/share/emacs/24.3/lisp/mail/rfc2368
/home/fifr/.emacs.d/el-get/semi/site-lisp/semi/smime hides /usr/share/emacs/24.3/lisp/gnus/smime
/home/fifr/.emacs.d/elpa/company-20130810.112/.dir-locals hides /usr/share/emacs/24.3/lisp/gnus/.dir-locals
/usr/share/emacs24/site-lisp/erc/erc-networks hides /usr/share/emacs/24.3/lisp/erc/erc-networks
/usr/share/emacs24/site-lisp/erc/erc-truncate hides /usr/share/emacs/24.3/lisp/erc/erc-truncate
/usr/share/emacs24/site-lisp/erc/erc-menu hides /usr/share/emacs/24.3/lisp/erc/erc-menu
/usr/share/emacs24/site-lisp/erc/erc-identd hides /usr/share/emacs/24.3/lisp/erc/erc-identd
/usr/share/emacs24/site-lisp/erc/erc-lang hides /usr/share/emacs/24.3/lisp/erc/erc-lang
/usr/share/emacs24/site-lisp/erc/erc-track hides /usr/share/emacs/24.3/lisp/erc/erc-track
/usr/share/emacs24/site-lisp/erc/erc-compat hides /usr/share/emacs/24.3/lisp/erc/erc-compat
/usr/share/emacs24/site-lisp/erc/erc-stamp hides /usr/share/emacs/24.3/lisp/erc/erc-stamp
/usr/share/emacs24/site-lisp/erc/erc hides /usr/share/emacs/24.3/lisp/erc/erc
/usr/share/emacs24/site-lisp/erc/erc-fill hides /usr/share/emacs/24.3/lisp/erc/erc-fill
/usr/share/emacs24/site-lisp/erc/erc-ezbounce hides /usr/share/emacs/24.3/lisp/erc/erc-ezbounce
/usr/share/emacs24/site-lisp/erc/erc-ring hides /usr/share/emacs/24.3/lisp/erc/erc-ring
/usr/share/emacs24/site-lisp/erc/erc-pcomplete hides /usr/share/emacs/24.3/lisp/erc/erc-pcomplete
/usr/share/emacs24/site-lisp/erc/erc-capab hides /usr/share/emacs/24.3/lisp/erc/erc-capab
/usr/share/emacs24/site-lisp/erc/erc-netsplit hides /usr/share/emacs/24.3/lisp/erc/erc-netsplit
/usr/share/emacs24/site-lisp/erc/erc-button hides /usr/share/emacs/24.3/lisp/erc/erc-button
/usr/share/emacs24/site-lisp/erc/erc-goodies hides /usr/share/emacs/24.3/lisp/erc/erc-goodies
/usr/share/emacs24/site-lisp/erc/erc-speedbar hides /usr/share/emacs/24.3/lisp/erc/erc-speedbar
/usr/share/emacs24/site-lisp/erc/erc-backend hides /usr/share/emacs/24.3/lisp/erc/erc-backend
/usr/share/emacs24/site-lisp/erc/erc-notify hides /usr/share/emacs/24.3/lisp/erc/erc-notify
/usr/share/emacs24/site-lisp/erc/erc-match hides /usr/share/emacs/24.3/lisp/erc/erc-match
/usr/share/emacs24/site-lisp/erc/erc-replace hides /usr/share/emacs/24.3/lisp/erc/erc-replace
/usr/share/emacs24/site-lisp/erc/erc-services hides /usr/share/emacs/24.3/lisp/erc/erc-services
/usr/share/emacs24/site-lisp/erc/erc-page hides /usr/share/emacs/24.3/lisp/erc/erc-page
/usr/share/emacs24/site-lisp/erc/erc-log hides /usr/share/emacs/24.3/lisp/erc/erc-log
/usr/share/emacs24/site-lisp/erc/erc-imenu hides /usr/share/emacs/24.3/lisp/erc/erc-imenu
/usr/share/emacs24/site-lisp/erc/erc-xdcc hides /usr/share/emacs/24.3/lisp/erc/erc-xdcc
/usr/share/emacs24/site-lisp/erc/erc-ibuffer hides /usr/share/emacs/24.3/lisp/erc/erc-ibuffer
/usr/share/emacs24/site-lisp/erc/erc-dcc hides /usr/share/emacs/24.3/lisp/erc/erc-dcc
/usr/share/emacs24/site-lisp/erc/erc-autoaway hides /usr/share/emacs/24.3/lisp/erc/erc-autoaway
/usr/share/emacs24/site-lisp/erc/erc-list hides /usr/share/emacs/24.3/lisp/erc/erc-list
/usr/share/emacs24/site-lisp/erc/erc-spelling hides /usr/share/emacs/24.3/lisp/erc/erc-spelling
/usr/share/emacs24/site-lisp/erc/erc-sound hides /usr/share/emacs/24.3/lisp/erc/erc-sound
/usr/share/emacs24/site-lisp/erc/erc-join hides /usr/share/emacs/24.3/lisp/erc/erc-join
/home/fifr/.emacs.d/el-get/cedet/lisp/eieio/eieio hides /usr/share/emacs/24.3/lisp/emacs-lisp/eieio
/home/fifr/.emacs.d/el-get/cedet/lisp/eieio/eieio-base hides /usr/share/emacs/24.3/lisp/emacs-lisp/eieio-base
/home/fifr/.emacs.d/el-get/cedet/lisp/eieio/eieio-opt hides /usr/share/emacs/24.3/lisp/emacs-lisp/eieio-opt
/home/fifr/.emacs.d/el-get/cedet/lisp/eieio/eieio-speedbar hides /usr/share/emacs/24.3/lisp/emacs-lisp/eieio-speedbar
/home/fifr/.emacs.d/el-get/cedet/lisp/eieio/eieio-custom hides /usr/share/emacs/24.3/lisp/emacs-lisp/eieio-custom
/home/fifr/.emacs.d/el-get/cedet/lisp/eieio/chart hides /usr/share/emacs/24.3/lisp/emacs-lisp/chart
/home/fifr/.emacs.d/el-get/cedet/lisp/eieio/eieio-datadebug hides /usr/share/emacs/24.3/lisp/emacs-lisp/eieio-datadebug
~/.emacs.d/package hides /usr/share/emacs/24.3/lisp/emacs-lisp/package
/home/fifr/.emacs.d/el-get/semi/site-lisp/semi/pgg hides /usr/share/emacs/24.3/lisp/obsolete/pgg
/home/fifr/.emacs.d/el-get/semi/site-lisp/semi/pgg-pgp hides /usr/share/emacs/24.3/lisp/obsolete/pgg-pgp
/usr/share/emacs24/site-lisp/erc/erc-hecomplete hides /usr/share/emacs/24.3/lisp/obsolete/erc-hecomplete
/home/fifr/.emacs.d/el-get/semi/site-lisp/semi/pgg-parse hides /usr/share/emacs/24.3/lisp/obsolete/pgg-parse
/home/fifr/.emacs.d/el-get/semi/site-lisp/semi/pgg-pgp5 hides /usr/share/emacs/24.3/lisp/obsolete/pgg-pgp5
/home/fifr/.emacs.d/el-get/semi/site-lisp/semi/pgg-gpg hides /usr/share/emacs/24.3/lisp/obsolete/pgg-gpg
/home/fifr/.emacs.d/el-get/semi/site-lisp/semi/pgg-def hides /usr/share/emacs/24.3/lisp/obsolete/pgg-def

Features:
(shadow sort footnote org-rmail org-mhe org-irc org-info org-gnus
org-docview org-bibtex bibtex org-bbdb org-w3m init-text org org-macro
org-footnote org-pcomplete pcomplete org-list org-faces org-entities
noutline outline 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 cal-menu calendar cal-loaddefs speck init-spell
gnus-util mail-extr adaptive-wrap init-visual-line emacsbug message
format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils server init-untabify
highlight-parentheses company-files company-oddmuse company-keywords
company-dabbrev-code company-dabbrev company-etags etags company-gtags
company-cmake company-ropemacs company-xcode company-eclim company-clang
company-template company-semantic company-css company-nxml company-elisp
company init-auto-complete rudel-loaddefs init-prog init-prog-ruby
init-prog-lisp init-cmake init-semantic semantic/mru-bookmark
semantic/db-mode semantic/idle working fame semantic/decorate/mode
semantic/decorate pulse paren init-mail idle-require init-colors
menu-bar+ easy-mmode info+ thingatpt hl-line uniquify time-date
autorevert winpoint ido init-evil ace-jump-mode diminish surround evil
evil-integration evil-maps evil-commands evil-types evil-search evil-ex
evil-macros evil-repeat evil-states evil-core evil-common undo-tree diff
windmove rect jka-compr evil-digraphs evil-vars time auto-compile packed
init-server init-packages .loaddefs rudel-backend theme-roller
theme-roller-macro color-theme reftex cedet-devel-load eieio-opt
find-func srecode/map srecode semantic/canned-configs semantic/ia-sb
semantic/analyze semantic/sort semantic/scope semantic/analyze/fcn
semantic/db semantic/ctxt semantic/format semantic/tag-ls semantic/find
semantic/util-modes semantic/util semantic semantic/tag semantic/lex
semantic/fw mode-local cedet-compat inversion sb-info ede/speedbar
ede/files ede ede/base ede/auto ede/source eieio-base eieio-speedbar
speedbar sb-image ezimage dframe eieio-custom wid-edit cedet eieio
eieio-core cedet-remove-builtin bbdb timezone bbdb-autoloads tex-site
auto-loads el-get cl-macs gv el-get-autoloads el-get-list-packages
el-get-notify help-mode el-get-dependencies el-get-build el-get-status
pp el-get-recipes el-get-byte-compile el-get-methods el-get-fossil
el-get-svn el-get-pacman el-get-github-zip el-get-github-tar
el-get-http-zip el-get-http-tar el-get-hg el-get-git-svn el-get-fink
el-get-emacswiki el-get-http el-get-emacsmirror el-get-github el-get-git
el-get-elpa el-get-darcs el-get-cvs el-get-bzr el-get-brew
el-get-builtin el-get-apt-get el-get-custom el-get-core autoload cl
dired melpa ace-jump-mode-autoloads adaptive-wrap-autoloads
auto-compile-autoloads auto-complete-autoloads cdlatex-autoloads
cmake-mode-autoloads color-theme-autoloads company-autoloads
deft-autoloads dictionary-autoloads diminish-autoloads ebib-autoloads
evil-autoloads ghc-autoloads go-mode-autoloads haskell-mode-autoloads
edmacro kmacro highlight-parentheses-autoloads idle-require-autoloads
inf-ruby-autoloads inf-ruby ruby-mode compile comint ansi-color ring
info+-autoloads lua-mode-autoloads melpa-autoloads byte-opt warnings
bytecomp byte-compile cconv multi-eshell-autoloads org-autoloads
packed-autoloads magit-autoloads info easymenu finder-inf
popup-autoloads smart-tabs-mode-autoloads speck-autoloads
sunrise-x-buttons-autoloads sunrise-x-loop-autoloads
sunrise-x-modeline-autoloads sunrise-x-popviewer-autoloads
sunrise-commander-autoloads surround-autoloads
tex-smart-umlauts-autoloads undo-tree-autoloads winpoint-autoloads
package advice help-fns cl-lib advice-preload erc-auto tooltip
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
register page menu-bar rfn-eshadow timer select scroll-bar mouse
jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer loaddefs button faces cus-face macroexp files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty emacs)

-- 
Frank Fischer
Chemnitz University of Technology, Department of Mathematics
eMail: frank.fischer <at> mathematik.tu-chemnitz.de
Tel.: +49 (371) 531-36913




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15155; Package emacs. (Thu, 22 Aug 2013 01:35:02 GMT) Full text and rfc822 format available.

Message #8 received at 15155 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
Cc: 15155 <at> debbugs.gnu.org
Subject: Re: bug#15155: 24.3;
 wrap-prefix in adaptive-wrap-prefix-mode with variable-pitch has
 wrong face
Date: Wed, 21 Aug 2013 21:33:58 -0400
> Then make the X window small enough so that the lines in the *scratch*
> buffer wrap. The color of the wrap-prefix (i.e. the semicolons ;;) is
> black and seems fixed width instead of red and using variable-pitch
> font.  It seems as if the wrap-prefix does not inherit the face of the
> original (comment) prefix.  This becomes more apparent when adding
> whitespaces at the beginning of the first line. Then the indentation of
> the next (wrapped) lines will also increase, however by a different
> amount because of the different font.  I suppose the wrap-prefix somehow
> uses the global default font and not the font defined by variable-pitch.
> Note that this used to work in Emacs 23 (tested with 23.4.1) where the
> wrap-prefix in the successive lines has the same face as the original
> prefix.

I have the vague impression of having already seen such a bug-report,
except the other way around (where the user complained that the
wrap-prefix was displayed in the font that happened to be active where
the line got truncated), so we "fixed" it for Emacs-24.

At least that was within the redisplay engine.  So maybe the problem we
have now is that adaptive-wrap constructs the prefix without paying
attention to existing faces.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15155; Package emacs. (Thu, 22 Aug 2013 07:05:02 GMT) Full text and rfc822 format available.

Message #11 received at 15155 <at> debbugs.gnu.org (full text, mbox):

From: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 15155 <at> debbugs.gnu.org
Subject: Re: bug#15155: 24.3; wrap-prefix in adaptive-wrap-prefix-mode with
 variable-pitch has wrong face
Date: Thu, 22 Aug 2013 09:04:12 +0200
Am 08/22/2013 03:33 AM, schrieb Stefan Monnier:


> I have the vague impression of having already seen such a bug-report,
> except the other way around (where the user complained that the
> wrap-prefix was displayed in the font that happened to be active where
> the line got truncated), so we "fixed" it for Emacs-24.

Ah, I see (just add some additional !!! before the first line in
*scratch* and see that the exclamation marks in the wrapped lines have
comment face (but they should be black) in Emacs 23).

Taking your hint, I have tried the following `adaptive-fill-function`

(setq adaptive-fill-function
  (lambda ()
    (and adaptive-fill-prefix
         (looking-at adaptive-fill-prefix)
         (match-string 0))))

This is exactly what `fill-adaptive-match-prefix' does except the latter
uses `match-string-no-properties`.

This seems to work fine for the color of the prefix but not for its font
(when using variable-pitch-mode). So a second try was


(setq adaptive-fill-function
  (lambda ()
    (and adaptive-fill-prefix
         (looking-at adaptive-fill-prefix)
         (propertize (match-string-no-properties 0) 'face 'default))))

Now the wrap-prefix has the correct font but the wrong color (but this
variant seems to work reasonably well for LaTeX and variable-pitch).

I think, the wrap-prefix should at least have the default face (which
may be modified by variable-pitch-mode) in any case. I'm not sure about
the other properties like color, but may adaptive-wrap-mode should
(optionally?) use something like the adaptive-fill-function above to
assign the wrap-prefix the same face as the original prefix (in contrast
to the one that happened to be active where the line got truncated).

Though, I have no idea what to about the color vs. font problem (how to
get both?).


Many thanks for your comments, they already helped me a lot :)

Frank





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15155; Package emacs. (Thu, 22 Aug 2013 14:51:02 GMT) Full text and rfc822 format available.

Message #14 received at 15155 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: frank.fischer <at> mathematik.tu-chemnitz.de, 15155 <at> debbugs.gnu.org
Subject: Re: bug#15155: 24.3;
 wrap-prefix in adaptive-wrap-prefix-mode with variable-pitch
 has	wrong face
Date: Thu, 22 Aug 2013 17:50:44 +0300
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Date: Wed, 21 Aug 2013 21:33:58 -0400
> Cc: 15155 <at> debbugs.gnu.org
> 
> I have the vague impression of having already seen such a bug-report,
> except the other way around (where the user complained that the
> wrap-prefix was displayed in the font that happened to be active where
> the line got truncated), so we "fixed" it for Emacs-24.

I believe you are talking about bugs #4281 and #10395, which were
fixed by revision 107654.

> So maybe the problem we have now is that adaptive-wrap constructs
> the prefix without paying attention to existing faces.

Indeed.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15155; Package emacs. (Thu, 22 Aug 2013 14:55:02 GMT) Full text and rfc822 format available.

Message #17 received at 15155 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
Cc: monnier <at> iro.umontreal.ca, 15155 <at> debbugs.gnu.org
Subject: Re: bug#15155: 24.3;
 wrap-prefix in adaptive-wrap-prefix-mode with variable-pitch
 has	wrong face
Date: Thu, 22 Aug 2013 17:54:23 +0300
> Date: Thu, 22 Aug 2013 09:04:12 +0200
> From: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
> Cc: 15155 <at> debbugs.gnu.org
> 
> Taking your hint, I have tried the following `adaptive-fill-function`
> 
> (setq adaptive-fill-function
>   (lambda ()
>     (and adaptive-fill-prefix
>          (looking-at adaptive-fill-prefix)
>          (match-string 0))))
> 
> This is exactly what `fill-adaptive-match-prefix' does except the latter
> uses `match-string-no-properties`.
> 
> This seems to work fine for the color of the prefix but not for its font
> (when using variable-pitch-mode). So a second try was
> 
> 
> (setq adaptive-fill-function
>   (lambda ()
>     (and adaptive-fill-prefix
>          (looking-at adaptive-fill-prefix)
>          (propertize (match-string-no-properties 0) 'face 'default))))
> 
> Now the wrap-prefix has the correct font but the wrong color (but this
> variant seems to work reasonably well for LaTeX and variable-pitch).
> 
> I think, the wrap-prefix should at least have the default face (which
> may be modified by variable-pitch-mode) in any case. I'm not sure about
> the other properties like color, but may adaptive-wrap-mode should
> (optionally?) use something like the adaptive-fill-function above to
> assign the wrap-prefix the same face as the original prefix (in contrast
> to the one that happened to be active where the line got truncated).
> 
> Though, I have no idea what to about the color vs. font problem (how to
> get both?).

How about using the face returned by face-at-point, instead of
'default'?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15155; Package emacs. (Thu, 22 Aug 2013 15:27:01 GMT) Full text and rfc822 format available.

Message #20 received at 15155 <at> debbugs.gnu.org (full text, mbox):

From: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>,
 monnier <at> iro.umontreal.ca, 15155 <at> debbugs.gnu.org
Subject: Re: bug#15155: 24.3;	wrap-prefix in adaptive-wrap-prefix-mode with
 variable-pitch has	wrong face
Date: Thu, 22 Aug 2013 17:26:50 +0200
Am 08/22/2013 04:54 PM, schrieb Eli Zaretskii:
>> (setq adaptive-fill-function
>>   (lambda ()
>>     (and adaptive-fill-prefix
>>          (looking-at adaptive-fill-prefix)
>>          (propertize (match-string-no-properties 0) 'face 'default))))
> 
> How about using the face returned by face-at-point, instead of
> 'default'?

I'm not sure. In my tests (adding several % comment marker before a line
in a LaTeX document) I got strange results. Sometimes the wrap prefix
had the correct color, sometimes not. But in no case it had the correct
(variable-width) font. I used the following code (of course the correct
name of the variable is `adaptive-fill-regexp` not `adaptive-fill-prefix`):

(setq adaptive-fill-function
  (lambda ()
    (and adaptive-fill-regexp
         (looking-at adaptive-fill-regexp)
         (propertize (match-string-no-properties 0) 'face
		     (face-at-point)))))


But I suppose that using `match-string` instead of
`match-string-no-properties` should preserve the correct face, right?
But this did not work, too.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15155; Package emacs. (Thu, 22 Aug 2013 16:04:01 GMT) Full text and rfc822 format available.

Message #23 received at 15155 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
Cc: monnier <at> iro.umontreal.ca, 15155 <at> debbugs.gnu.org
Subject: Re: bug#15155: 24.3;
 wrap-prefix in adaptive-wrap-prefix-mode with variable-pitch
 has	wrong face
Date: Thu, 22 Aug 2013 19:03:50 +0300
> Date: Thu, 22 Aug 2013 17:26:50 +0200
> From: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
> CC: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>, 
>  monnier <at> iro.umontreal.ca, 15155 <at> debbugs.gnu.org
> 
> > How about using the face returned by face-at-point, instead of
> > 'default'?
> 
> I'm not sure. In my tests (adding several % comment marker before a line
> in a LaTeX document) I got strange results. Sometimes the wrap prefix
> had the correct color, sometimes not. But in no case it had the correct
> (variable-width) font. I used the following code (of course the correct
> name of the variable is `adaptive-fill-regexp` not `adaptive-fill-prefix`):
> 
> (setq adaptive-fill-function
>   (lambda ()
>     (and adaptive-fill-regexp
>          (looking-at adaptive-fill-regexp)
>          (propertize (match-string-no-properties 0) 'face
> 		     (face-at-point)))))

Perhaps you are calling face-at-point at the wrong buffer position.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15155; Package emacs. (Thu, 22 Aug 2013 16:16:02 GMT) Full text and rfc822 format available.

Message #26 received at 15155 <at> debbugs.gnu.org (full text, mbox):

From: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: monnier <at> iro.umontreal.ca, 15155 <at> debbugs.gnu.org
Subject: Re: bug#15155: 24.3;	wrap-prefix in adaptive-wrap-prefix-mode with
 variable-pitch has	wrong face
Date: Thu, 22 Aug 2013 18:15:21 +0200
Am 08/22/2013 06:03 PM, schrieb Eli Zaretskii:
>> Date: Thu, 22 Aug 2013 17:26:50 +0200
>> From: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
>> CC: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>, 
>>  monnier <at> iro.umontreal.ca, 15155 <at> debbugs.gnu.org
>>
>>> How about using the face returned by face-at-point, instead of
>>> 'default'?
>>
>> I'm not sure. In my tests (adding several % comment marker before a line
>> in a LaTeX document) I got strange results. Sometimes the wrap prefix
>> had the correct color, sometimes not. But in no case it had the correct
>> (variable-width) font. I used the following code (of course the correct
>> name of the variable is `adaptive-fill-regexp` not `adaptive-fill-prefix`):
>>
>> (setq adaptive-fill-function
>>   (lambda ()
>>     (and adaptive-fill-regexp
>>          (looking-at adaptive-fill-regexp)
>>          (propertize (match-string-no-properties 0) 'face
>> 		     (face-at-point)))))
> 
> Perhaps you are calling face-at-point at the wrong buffer position.

Perhaps, but what is the correct buffer position (I expected (point)
when `looking-at` is called to be the correct one, but this may be wrong
in some cases -- I do not know enough about the internals of determining
the wrap-prefix to really say what's going on)?

However, as long as the prefix does not get the correct font it does not
matter, because this is the most important aspect (for me because I want
to use adaptive-wrap with variable-pitch-mode).





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15155; Package emacs. (Thu, 22 Aug 2013 16:57:02 GMT) Full text and rfc822 format available.

Message #29 received at 15155 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
Cc: monnier <at> iro.umontreal.ca, 15155 <at> debbugs.gnu.org
Subject: Re: bug#15155: 24.3;
 wrap-prefix in adaptive-wrap-prefix-mode with variable-pitch
 has	wrong face
Date: Thu, 22 Aug 2013 19:56:05 +0300
> Date: Thu, 22 Aug 2013 18:15:21 +0200
> From: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
> CC: monnier <at> iro.umontreal.ca, 15155 <at> debbugs.gnu.org
> 
> > Perhaps you are calling face-at-point at the wrong buffer position.
> 
> Perhaps, but what is the correct buffer position (I expected (point)
> when `looking-at` is called to be the correct one, but this may be wrong
> in some cases -- I do not know enough about the internals of determining
> the wrap-prefix to really say what's going on)?
> 
> However, as long as the prefix does not get the correct font it does not
> matter, because this is the most important aspect (for me because I want
> to use adaptive-wrap with variable-pitch-mode).

Can you build Emacs from the trunk?  I would like to ask you to try a
patch that might fix this in your use case.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15155; Package emacs. (Thu, 22 Aug 2013 18:16:01 GMT) Full text and rfc822 format available.

Message #32 received at 15155 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>,
 15155 <at> debbugs.gnu.org
Subject: Re: bug#15155: 24.3;
 wrap-prefix in adaptive-wrap-prefix-mode with variable-pitch
 has	wrong face
Date: Thu, 22 Aug 2013 14:15:43 -0400
>> This is exactly what `fill-adaptive-match-prefix' does except the latter
>> uses `match-string-no-properties`.

That looks like the right fix.

>> This seems to work fine for the color of the prefix but not for its font
>> (when using variable-pitch-mode). So a second try was

Hmm... Eli, could it be that the redisplay ignores the face-remapping-alist
when processing the wrap-prefix?


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15155; Package emacs. (Thu, 22 Aug 2013 18:50:02 GMT) Full text and rfc822 format available.

Message #35 received at 15155 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: frank.fischer <at> mathematik.tu-chemnitz.de, 15155 <at> debbugs.gnu.org
Subject: Re: bug#15155: 24.3;
 wrap-prefix in adaptive-wrap-prefix-mode with variable-pitch
 has	wrong face
Date: Thu, 22 Aug 2013 21:49:25 +0300
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>,  15155 <at> debbugs.gnu.org
> Date: Thu, 22 Aug 2013 14:15:43 -0400
> 
> Hmm... Eli, could it be that the redisplay ignores the face-remapping-alist
> when processing the wrap-prefix?

It does, indeed.  That's the patch I wanted Frank to try.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15155; Package emacs. (Thu, 22 Aug 2013 20:33:02 GMT) Full text and rfc822 format available.

Message #38 received at 15155 <at> debbugs.gnu.org (full text, mbox):

From: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: monnier <at> iro.umontreal.ca, 15155 <at> debbugs.gnu.org
Subject: Re: bug#15155: 24.3;	wrap-prefix in adaptive-wrap-prefix-mode with
 variable-pitch has	wrong face
Date: Thu, 22 Aug 2013 22:32:46 +0200
Am Thu, 22 Aug 2013 19:56:05 +0300
schrieb Eli Zaretskii <eliz <at> gnu.org>:

> Can you build Emacs from the trunk?  I would like to ask you to try a
> patch that might fix this in your use case.

Sure, I'd be happy to help ;)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15155; Package emacs. (Fri, 23 Aug 2013 06:42:02 GMT) Full text and rfc822 format available.

Message #41 received at 15155 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
Cc: monnier <at> iro.umontreal.ca, 15155 <at> debbugs.gnu.org
Subject: Re: bug#15155: 24.3;
 wrap-prefix in adaptive-wrap-prefix-mode with variable-pitch
 has	wrong face
Date: Fri, 23 Aug 2013 09:41:01 +0300
> Date: Thu, 22 Aug 2013 22:32:46 +0200
> From: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
> Cc: monnier <at> iro.umontreal.ca, 15155 <at> debbugs.gnu.org
> 
> Am Thu, 22 Aug 2013 19:56:05 +0300
> schrieb Eli Zaretskii <eliz <at> gnu.org>:
> 
> > Can you build Emacs from the trunk?  I would like to ask you to try a
> > patch that might fix this in your use case.
> 
> Sure, I'd be happy to help ;)

Thank you.  Please try the patch below.  It should solve the problem
with the font; you will still need to make sure on the Lisp level that
the prefix has the right face, to get the color you want.

=== modified file 'src/xdisp.c'
--- src/xdisp.c	2013-08-15 16:28:42 +0000
+++ src/xdisp.c	2013-08-22 16:57:56 +0000
@@ -3915,7 +3915,9 @@ handle_face_prop (struct it *it)
 	     surrounding text, unless they specify their own
 	     faces.  */
 	  base_face_id = it->string_from_prefix_prop_p
-	    ? DEFAULT_FACE_ID
+	    ? (!NILP (Vface_remapping_alist)
+	       ? lookup_basic_face (it->f, DEFAULT_FACE_ID)
+	       : DEFAULT_FACE_ID)
 	    : underlying_face_id (it);
 	}
 





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15155; Package emacs. (Fri, 23 Aug 2013 13:19:01 GMT) Full text and rfc822 format available.

Message #44 received at 15155 <at> debbugs.gnu.org (full text, mbox):

From: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: monnier <at> iro.umontreal.ca, 15155 <at> debbugs.gnu.org
Subject: Re: bug#15155: 24.3;	wrap-prefix in adaptive-wrap-prefix-mode with
 variable-pitch has	wrong face
Date: Fri, 23 Aug 2013 15:17:58 +0200
Am Fri, 23 Aug 2013 09:41:01 +0300
schrieb Eli Zaretskii <eliz <at> gnu.org>:

> > Date: Thu, 22 Aug 2013 22:32:46 +0200
> > From: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
> > Cc: monnier <at> iro.umontreal.ca, 15155 <at> debbugs.gnu.org
> > 
> > Am Thu, 22 Aug 2013 19:56:05 +0300
> > schrieb Eli Zaretskii <eliz <at> gnu.org>:
> > 
> > > Can you build Emacs from the trunk?  I would like to ask you to
> > > try a patch that might fix this in your use case.
> > 
> > Sure, I'd be happy to help ;)
> 
> Thank you.  Please try the patch below.  It should solve the problem
> with the font; you will still need to make sure on the Lisp level that
> the prefix has the right face, to get the color you want.

That patch seems to work, thank you.

I have only one (very) minor issue left: depending on the mode the
wrap-prefix may contain characters with different faces (e.g. in
emacs-lisp mode !!!;;; would be a correct prefix, the first three
characters with default face, the latter three with comment-face), hence
there is not really "the one" correct face to assign 'wrap-prefix with
`propertize`. That why I tried the variant

(setq adaptive-fill-function
  (lambda ()
    (and adaptive-fill-regexp
         (looking-at adaptive-fill-regexp)
         (match-string 0))))

hoping that (match-string 0) returns the whole prefix with the correct
fontification. However, there are situations where this does not work:
for example if one has a (very long) wrapped line without comment and
then inserts a semicolon (only one) at the beginning of that line to
comment it out, then the wrap-prefix does not get comment face (to be
precise, it has the correct font, thus your patch works, but not the
correct color). But if one inserts a second semicolon then the
wrap-prefix gets the correct color. I assume this happens because the
wrap-prefix is set before font-lock changed the face of inserted
semicolon. 

Perhaps this is a more an issue of adaptive-wrap-mode, I
don't know. If my guess is correct, is it possible to run the
appropriate hooks (I think adaptive-wrap uses
`jit-lock-register`) *after* font-lock changed the face? Or is there
another, better way to detect the correct face?

If you don't have a solution to this question, don't worry. I'm quite
happy with your patch and it does already what I want ;)

Thank you again,
Frank





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15155; Package emacs. (Fri, 23 Aug 2013 14:30:02 GMT) Full text and rfc822 format available.

Message #47 received at 15155 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
Cc: monnier <at> iro.umontreal.ca, 15155 <at> debbugs.gnu.org
Subject: Re: bug#15155: 24.3;
 wrap-prefix in adaptive-wrap-prefix-mode with variable-pitch
 has	wrong face
Date: Fri, 23 Aug 2013 17:29:37 +0300
> Date: Fri, 23 Aug 2013 15:17:58 +0200
> From: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
> Cc: monnier <at> iro.umontreal.ca, 15155 <at> debbugs.gnu.org
> 
> Am Fri, 23 Aug 2013 09:41:01 +0300
> schrieb Eli Zaretskii <eliz <at> gnu.org>:
> 
> > > Date: Thu, 22 Aug 2013 22:32:46 +0200
> > > From: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
> > > Cc: monnier <at> iro.umontreal.ca, 15155 <at> debbugs.gnu.org
> > > 
> > > Am Thu, 22 Aug 2013 19:56:05 +0300
> > > schrieb Eli Zaretskii <eliz <at> gnu.org>:
> > > 
> > > > Can you build Emacs from the trunk?  I would like to ask you to
> > > > try a patch that might fix this in your use case.
> > > 
> > > Sure, I'd be happy to help ;)
> > 
> > Thank you.  Please try the patch below.  It should solve the problem
> > with the font; you will still need to make sure on the Lisp level that
> > the prefix has the right face, to get the color you want.
> 
> That patch seems to work, thank you.

Thanks, committed as trunk revision 113979.

> I have only one (very) minor issue left: depending on the mode the
> wrap-prefix may contain characters with different faces (e.g. in
> emacs-lisp mode !!!;;; would be a correct prefix, the first three
> characters with default face, the latter three with comment-face), hence
> there is not really "the one" correct face to assign 'wrap-prefix with
> `propertize`. That why I tried the variant
> 
> (setq adaptive-fill-function
>   (lambda ()
>     (and adaptive-fill-regexp
>          (looking-at adaptive-fill-regexp)
>          (match-string 0))))
> 
> hoping that (match-string 0) returns the whole prefix with the correct
> fontification. However, there are situations where this does not work:
> for example if one has a (very long) wrapped line without comment and
> then inserts a semicolon (only one) at the beginning of that line to
> comment it out, then the wrap-prefix does not get comment face (to be
> precise, it has the correct font, thus your patch works, but not the
> correct color). But if one inserts a second semicolon then the
> wrap-prefix gets the correct color. I assume this happens because the
> wrap-prefix is set before font-lock changed the face of inserted
> semicolon. 

I think your analysis is correct.  Perhaps invoking font-lock to
fontify the appropriate portion of the text, before taking the prefix
string, will solve that?

> Perhaps this is a more an issue of adaptive-wrap-mode, I
> don't know.

I think it is indeed an issue with adaptive-wrap-mode.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15155; Package emacs. (Fri, 23 Aug 2013 15:19:02 GMT) Full text and rfc822 format available.

Message #50 received at 15155 <at> debbugs.gnu.org (full text, mbox):

From: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: monnier <at> iro.umontreal.ca, 15155 <at> debbugs.gnu.org
Subject: Re: bug#15155: 24.3;	wrap-prefix in adaptive-wrap-prefix-mode with
 variable-pitch has	wrong face
Date: Fri, 23 Aug 2013 17:17:59 +0200
[Message part 1 (text/plain, inline)]
Am Fri, 23 Aug 2013 17:29:37 +0300
schrieb Eli Zaretskii <eliz <at> gnu.org>:

> > That patch seems to work, thank you.
> 
> Thanks, committed as trunk revision 113979.

Cool!

> I think your analysis is correct.  Perhaps invoking font-lock to
> fontify the appropriate portion of the text, before taking the prefix
> string, will solve that?
> 
> > Perhaps this is a more an issue of adaptive-wrap-mode, I
> > don't know.
> 
> I think it is indeed an issue with adaptive-wrap-mode.

Yes, it seems to work. I used the attached patch for adaptive-wrap.el
(although I do not know if this is the correct way to do because
I'm not really familiar with font-lock), it just works for me.

Thanks again
Frank


[adaptive-wrap.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15155; Package emacs. (Fri, 23 Aug 2013 15:39:02 GMT) Full text and rfc822 format available.

Message #53 received at 15155 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 15155 <at> debbugs.gnu.org
Subject: Re: bug#15155: 24.3;
 wrap-prefix in adaptive-wrap-prefix-mode with variable-pitch
 has	wrong face
Date: Fri, 23 Aug 2013 11:38:05 -0400
> (setq adaptive-fill-function
>   (lambda ()
>     (and adaptive-fill-regexp
>          (looking-at adaptive-fill-regexp)
>          (match-string 0))))

W.r.t the above change, I installed the patch below which should make
it unnecessary:

--- lisp/textmodes/fill.el	2013-01-02 16:13:04 +0000
+++ lisp/textmodes/fill.el	2013-08-23 15:25:50 +0000
@@ -220,7 +220,7 @@
   (let ((str (or
               (and adaptive-fill-function (funcall adaptive-fill-function))
               (and adaptive-fill-regexp (looking-at adaptive-fill-regexp)
-                   (match-string-no-properties 0)))))
+                   (match-string 0)))))
     (if (>= (+ (current-left-margin) (length str)) (current-fill-column))
         ;; Death to insanely long prefixes.
         nil

> hoping that (match-string 0) returns the whole prefix with the correct
> fontification. However, there are situations where this does not work:
> for example if one has a (very long) wrapped line without comment and
> then inserts a semicolon (only one) at the beginning of that line to
> comment it out, then the wrap-prefix does not get comment face (to be
> precise, it has the correct font, thus your patch works, but not the
> correct color). But if one inserts a second semicolon then the
> wrap-prefix gets the correct color. I assume this happens because the
> wrap-prefix is set before font-lock changed the face of inserted
> semicolon.

Indeed.  It probably depends on whether adaptive-mode-mode was enabled
before or after font-lock.  Can you try the patch below to see if it
fixes this problem for you?


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15155; Package emacs. (Fri, 23 Aug 2013 15:40:01 GMT) Full text and rfc822 format available.

Message #56 received at 15155 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 15155 <at> debbugs.gnu.org
Subject: Re: bug#15155: 24.3;
 wrap-prefix in adaptive-wrap-prefix-mode with variable-pitch
 has	wrong face
Date: Fri, 23 Aug 2013 11:39:44 -0400
> don't know. If my guess is correct, is it possible to run the
> appropriate hooks (I think adaptive-wrap uses
> `jit-lock-register`) *after* font-lock changed the face? Or is there
> another, better way to detect the correct face?

Oops, sorry, here's the patch,


        Stefan


diff --git a/packages/adaptive-wrap/adaptive-wrap.el b/packages/adaptive-wrap/adaptive-wrap.el
index 3787a99..9455789 100644
--- a/packages/adaptive-wrap/adaptive-wrap.el
+++ b/packages/adaptive-wrap/adaptive-wrap.el
@@ -96,7 +96,13 @@ extra indent = 2
   :lighter ""
   :group 'visual-line
   (if adaptive-wrap-prefix-mode
-      (jit-lock-register #'adaptive-wrap-prefix-function)
+      (progn
+        ;; HACK ATTACK!  We need to run after font-lock, but jit-lock-register
+        ;; doesn't accept an `append' argument, so we add ourselves beforehand,
+        ;; to make sure we're at the end of the hook (bug#15155).
+        (add-hook 'jit-lock-functions
+                  #'adaptive-wrap-prefix-function 'append t)
+        (jit-lock-register #'adaptive-wrap-prefix-function))
     (jit-lock-unregister #'adaptive-wrap-prefix-function)
     (with-silent-modifications
       (save-restriction
Date: Fri, 23 Aug 2013 11:39:05 -0400




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15155; Package emacs. (Sat, 24 Aug 2013 09:59:02 GMT) Full text and rfc822 format available.

Message #59 received at 15155 <at> debbugs.gnu.org (full text, mbox):

From: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 15155 <at> debbugs.gnu.org
Subject: Re: bug#15155: 24.3;	wrap-prefix in adaptive-wrap-prefix-mode with
 variable-pitch has	wrong face
Date: Sat, 24 Aug 2013 11:58:29 +0200
Am Fri, 23 Aug 2013 11:38:05 -0400
schrieb Stefan Monnier <monnier <at> IRO.UMontreal.CA>:

> Indeed.  It probably depends on whether adaptive-mode-mode was enabled
> before or after font-lock.  Can you try the patch below to see if it
> fixes this problem for you?

Yes it does, thank you.

Frank




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15155; Package emacs. (Mon, 26 Aug 2013 04:15:02 GMT) Full text and rfc822 format available.

Message #62 received at 15155 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 15155 <at> debbugs.gnu.org
Subject: Re: bug#15155: 24.3;
 wrap-prefix in adaptive-wrap-prefix-mode with variable-pitch
 has	wrong face
Date: Mon, 26 Aug 2013 00:14:13 -0400
>> Indeed.  It probably depends on whether adaptive-mode-mode was enabled
>> before or after font-lock.  Can you try the patch below to see if it
>> fixes this problem for you?
> Yes it does, thank you.

Thanks, installed in trunk,


        Stefan




bug marked as fixed in version 24.4, send any further explanations to 15155 <at> debbugs.gnu.org and Frank Fischer <frank.fischer <at> mathematik.tu-chemnitz.de> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 29 Aug 2013 17:30:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 27 Sep 2013 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 235 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.