all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 33740@debbugs.gnu.org, joaotavora@gmail.com, andreyk.mad@gmail.com
Subject: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Thu, 19 Sep 2019 17:55:00 +0200	[thread overview]
Message-ID: <8736gsjn6z.fsf@gnus.org> (raw)
In-Reply-To: <87blvgjoev.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 19 Sep 2019 17:28:40 +0200")

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Then try this:
>
> (setq flymake--mode-line-format (concat (propertize " bar " 'face 'bold) "foo"))
>
> Both "bar" and "foo" will be bold in the mode line.

I...  think I know why this is happening.

Mixing the two ways of specifying text properties isn't really allowed.

`mode-line-modes' has this:

 (:propertize
  ("" minor-mode-alist)
  mouse-face mode-line-highlight help-echo "Minor mode\nmouse-1: Display minor m
  ...

display_mode_element does this for strings:

	    Lisp_Object oprops, aelt;
	    oprops = Ftext_properties_at (make_fixnum (0), elt);

	    /* If the starting string's properties are not what
	       we want, translate the string.  Also, if the string
	       is risky, do that anyway.  */

	    if (NILP (Fequal (props, oprops)) || risky)
	      {
		/* If the starting string has properties,
		   merge the specified ones onto the existing ones.  */
		if (! NILP (oprops) && !risky)

So we basically do exactly what I was seeing -- overwrite the entire
string's text properties with the text property in the first character
of the string.

But!

This is only done if the string is inside a (:propertize ...) clause,
because this is only done of props is passed in, which (if I read the
code correctly) only happens if that's done.

But the code in that function could be clearer -- I don't really
understand why this is done at all.

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





  reply	other threads:[~2019-09-19 15:55 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14  9:19 bug#33740: [PATCH] Customizable flymake mode-line indicator Andrii Kolomoiets
2019-01-04 20:27 ` João Távora
2019-06-22 14:15   ` Štěpán Němec
2019-09-16 22:22   ` Lars Ingebrigtsen
2019-09-17  6:09     ` Eli Zaretskii
2019-09-17 11:57       ` Lars Ingebrigtsen
2019-09-17 12:13         ` Eli Zaretskii
2019-09-17 12:22           ` Lars Ingebrigtsen
2019-09-17 12:44             ` Eli Zaretskii
2019-09-18 13:38               ` Lars Ingebrigtsen
2019-09-18 14:09                 ` Lars Ingebrigtsen
2019-09-19 15:28                   ` Lars Ingebrigtsen
2019-09-19 15:55                     ` Lars Ingebrigtsen [this message]
2019-09-19 16:23                       ` Lars Ingebrigtsen
2019-09-19 17:26                         ` Eli Zaretskii
2019-09-20 12:32                           ` Lars Ingebrigtsen
2019-09-20 13:06                             ` Eli Zaretskii
2019-09-20 13:13                               ` Lars Ingebrigtsen
2019-09-17 14:07     ` João Távora
2019-09-18 13:40       ` Lars Ingebrigtsen
2019-09-18 13:59         ` João Távora
2019-09-19 15:39           ` Lars Ingebrigtsen
2019-09-20 13:07             ` João Távora
2019-09-21  7:54               ` Lars Ingebrigtsen
2019-09-22 20:55                 ` Juri Linkov
2019-09-23  9:18                   ` João Távora
2019-09-23 18:10                     ` Lars Ingebrigtsen
2019-09-23  9:25                 ` João Távora
2019-09-23 18:11                   ` Lars Ingebrigtsen
2019-09-18 14:02         ` Noam Postavsky
2020-12-29  2:12   ` Lars Ingebrigtsen
2020-12-29  2:19     ` Lars Ingebrigtsen
2020-12-29 13:52       ` João Távora
2020-12-29 14:14         ` Lars Ingebrigtsen
2020-12-29 14:18       ` João Távora
2020-12-29 14:22         ` Lars Ingebrigtsen
2020-12-29 15:13           ` João Távora
2020-12-30  3:22             ` Lars Ingebrigtsen
2020-12-30  9:28               ` João Távora
2020-12-30 20:16                 ` Eli Zaretskii
2020-12-30 21:13                   ` João Távora
2020-12-31 14:05                     ` João Távora
2021-01-01 10:56                       ` Lars Ingebrigtsen
2021-01-02 11:27                         ` João Távora

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=8736gsjn6z.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=33740@debbugs.gnu.org \
    --cc=andreyk.mad@gmail.com \
    --cc=eliz@gnu.org \
    --cc=joaotavora@gmail.com \
    /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.