2

Like most Emacs users I have a setup!

But there's one thing I try not to set : faces etc. For one thing I'm not that good with color intuitions. Another: all previous experiences of doing this show it breaks in some corner cases.

But now I find that the region face is so non-different from the rest (default) that it effectively (visually) does not exist. (Region behavior ok just color change absent)

Note that with -r (--reverse-video) a dark blue -- not optimal but at least visible -- appears.

But with plain default startup it's utterly invisible.

Other than explicitly setting the region face, is there some option to make the region visible? [And is this some kind of regression? I've never had this before]


Emacs started with -Q version 27.1, on ubuntu


Added in response to Nickd.

Default color

Foreground: black
DistantForeground: unspecified
Background: white

Region color

Foreground: unspecified
DistantForeground: gtk_selection_fg_color
Background: gtk_selection_bg_color

Searching around there does seem to be some bug:

https://lists.gnu.org/archive/html/bug-gnu-emacs/2017-09/msg01098.html

And, reading between the lines, it seems the response is:

Bug : yes
Response: Wont fix

Oh Well 🙃

9
  • 1
    What does M-x describe-face RET default RET say? Ditto for region? Please add these values to your question. Also, is this Emacs in the terminal or in a GUI? Not sure whether Ubuntu does Emacs customizations the way that Debian apparently does, but if so, you might try to disable their customizations (somehow - I'm not an Ubuntu user so I can't help you there) and see if that's the underlying cause of the problem. Also, is transient-mark-mode enabled?
    – NickD
    Mar 3, 2022 at 14:40
  • What's the complete, step-by-step recipe to repro the problem? Are you saying that just emacs -Q (no init file) gives you a region face that has the same background as the frame, by default, so that the region seems invisible?
    – Drew
    Mar 3, 2022 at 15:16
  • @NickD Added details
    – Rusi
    Mar 3, 2022 at 15:22
  • @Drew Changed from -q to -Q. Same behavior
    – Rusi
    Mar 3, 2022 at 15:23
  • Maybe @phils will come along and explain what is going on, but the region setting seems funny.
    – NickD
    Mar 3, 2022 at 16:30

1 Answer 1

1

Looking at customize-face -> region it talks about gtk_selection_bg_color. Indeed I get a better visible selection by selecting another theme in what the xfce4-setttings-manager calls Appearance.

Yet the nearly invisible selection background is no problem in other applications, so they probably ignore or override the theme in one of the gazillion ways this is possible in gtk.

I can put a

*:selected {
  background: red;
}

into ~/.config/gtk-3.0/gtk.css and a freshly started thunderbird uses red as the background when selecting text in an email. And emacs now uses red too.

While I agree with the OP that changing such colors gets one easily into a mess, in this case it is probably saner to just fix the region background color manually with customize-face rather than messing with the css. Except using another Appearance theme is an option.

(This is with emacs 29 on Ubuntu 20.04 using xfce4.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.