all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Frank Fischer <frank.fischer@mathematik.tu-chemnitz.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 15155@debbugs.gnu.org
Subject: 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	[thread overview]
Message-ID: <5215B7EC.10808@mathematik.tu-chemnitz.de> (raw)
In-Reply-To: <jwv4naimrzo.fsf-monnier+emacs@gnu.org>

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






  reply	other threads:[~2013-08-22  7:04 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-21 19:54 bug#15155: 24.3; wrap-prefix in adaptive-wrap-prefix-mode with variable-pitch has wrong face Frank Fischer
2013-08-22  1:33 ` Stefan Monnier
2013-08-22  7:04   ` Frank Fischer [this message]
2013-08-22 14:54     ` Eli Zaretskii
2013-08-22 15:26       ` Frank Fischer
2013-08-22 16:03         ` Eli Zaretskii
2013-08-22 16:15           ` Frank Fischer
2013-08-22 16:56             ` Eli Zaretskii
2013-08-22 20:32               ` Frank Fischer
2013-08-23  6:41                 ` Eli Zaretskii
2013-08-23 13:17                   ` Frank Fischer
2013-08-23 14:29                     ` Eli Zaretskii
2013-08-23 15:17                       ` Frank Fischer
2013-08-23 15:38                     ` Stefan Monnier
2013-08-24  9:58                       ` Frank Fischer
2013-08-26  4:14                         ` Stefan Monnier
2013-08-23 15:39                     ` Stefan Monnier
2013-08-22 18:15       ` Stefan Monnier
2013-08-22 18:49         ` Eli Zaretskii
2013-08-22 14:50   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5215B7EC.10808@mathematik.tu-chemnitz.de \
    --to=frank.fischer@mathematik.tu-chemnitz.de \
    --cc=15155@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.