GNU bug report logs - #33740
[PATCH] Customizable flymake mode-line indicator

Previous Next

Package: emacs;

Reported by: Andrii Kolomoiets <andreyk.mad <at> gmail.com>

Date: Fri, 14 Dec 2018 09:21:01 UTC

Severity: wishlist

Tags: fixed, patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 33740 <at> debbugs.gnu.org, joaotavora <at> gmail.com, andreyk.mad <at> gmail.com
Subject: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Thu, 19 Sep 2019 17:55:00 +0200
Lars Ingebrigtsen <larsi <at> 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




This bug report was last modified 4 years and 140 days ago.

Previous Next


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