emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: highlight failed part of isearch input


From: Drew Adams
Subject: RE: highlight failed part of isearch input
Date: Sat, 23 Feb 2008 13:27:57 -0800

> The patch below fixes this problem.  When the first message from the
> isearch-cmds stack is not the same as isearch-message (this 
> happens when isearch-edit-string sets a different value) then it
> uses this value for succ-msg.

Thanks; good catch.

> Also this patch uses a better background color for the
> `isearch-fail' face - the same color as used by Firefox
> for the background of the failed search text.  UI designers
> of Firefox made a good job and this color looks nice.

How about separating that face-change suggestion, which is independent of
the bug fix?

Personally, I disagree about the color, at least for a light background with
unlimited colors available - it is too vivid (bright, saturated, loud). For
that, Plum or some other pastel is a better default, IMO. It's important to
not only notice the failure but also easily read the text that is
highlighted.

For a dark background, the color should presumably be quite dark, not
bright.

Also, I think it should specify a foreground color by default, for the case
where someone uses a different foreground color for a standalone minibuffer.

How about something like this? The default color here for a dark background
is the complement of Plum (a light violet): a dark green. You certainly
don't want something like IndianRed1 or Plum on a dark background, I expect.

(defface isearch-fail
      '((((class color) (min-colors 88) (background dark))
         (:foreground "white" :background "#22225F5F2222"))
        (((class color) (min-colors 88) (background light))
         (:foreground "Black" :background "Plum"))
        (((class color) (min-colors 8)) (:background "red"))
        (((type tty) (class mono)) :inverse-video t)
        (t :background "gray"))
    "Face for highlighting failed part in Isearch echo-area message."
    :version "23.1" :group 'isearch)

I also added the mono case and the catch-all case. Copied them from the
definition for `region'.

I can't speak much to what should be the default for a dark background or
for when there are limited colors available. Perhaps people who use those
contexts could suggest an improvement.

BTW - I'm no expert on face specs, but isn't your duplication of the red
spec for (min-colors 8) and (min-colors 16) redundant? Doesn't (min-colors
8), as shown above, take care of both?


> ! (defface isearch-fail '((t (:foreground "Black" :background 
> "Plum")))
>     "Face for highlighting failed part in Isearch echo-area message."
>     :group 'isearch)
>   
>   (defcustom isearch-lazy-highlight t
> --- 231,245 ----
>     :group 'basic-faces)
>   (defvar isearch 'isearch)
>   
> ! (defface isearch-fail
> !   '((((class color) (min-colors 88))
> !      (:background "IndianRed1"))
> !     (((class color) (min-colors 16))
> !      (:background "red"))
> !     (((class color) (min-colors 8))
> !      (:background "red")))
>     "Face for highlighting failed part in Isearch echo-area message."
> +   :version "23.1"
>     :group 'isearch)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]