Comments (19)
Try
(add-to-list 'default-frame-alist '(ns-appearance . dark))
from homebrew-emacs-plus.
From to the Emacs manual:
When the desktop restores the frame and window configuration, it uses
the recorded values of frame parameters, disregarding any settings for
those parameters you have in your init file. This
means that frame parameters such as fonts and faces for the restored
frames will come from the desktop file, where they were saved when you
exited your previous Emacs session; any settings for those parameters in
your init file will be ignored. To disable this, customize the value of
āframeset-filter-alistā to filter out the frame parameters you donāt
want to be restored.
From the description of the frameset-filter-alist
variable:
On saving, PARAMETERS is the parameter alist of each frame processed,
and FILTERED is the parameter alist that gets saved to the frameset.On restoring, PARAMETERS is the parameter alist extracted from the
frameset, and FILTERED is the resulting frame parameter alist used
to restore the frame.Elements of āframeset-filter-alistā are conses (PARAM . ACTION),
where PARAM is a parameter name (a symbol identifying a frame
parameter), and ACTION can be:nil The parameter is copied to FILTERED.
:never The parameter is never copied to FILTERED.
:save The parameter is copied only when saving the frame.
:restore The parameter is copied only when restoring the frame.
FILTER A filter function.
So we just need to ensure that frame parameters ns-transparent-titlebar
and ns-appearance
are never copied to FILTERED
:
(add-to-list 'frameset-filter-alist '(ns-transparent-titlebar . :never))
(add-to-list 'frameset-filter-alist '(ns-appearance . :never))
from homebrew-emacs-plus.
Thanks @rsrock! That worked š
I had tried a similar configuration, but had quoted dark
, i.e., 'dark
, which doesn't work.
Just to be clear, this works for me:
(add-to-list 'default-frame-alist '(ns-appearance . dark))
This doesn't work (note the single quote in front of dark):
(add-to-list 'default-frame-alist '(ns-appearance . 'dark))
@kaz-yos I see that you have the single quote in front of dark
in your configuration above. Have you tried without the quote?
from homebrew-emacs-plus.
(add-to-list 'default-frame-alist '(ns-appearance . dark))
is the solution, but the result is not natural.
The more suitable answer:
(dolist (x '((ns-transparent-titlebar . unbound)
(ns-appearance . unbound)))
(add-to-list 'frameset-filter-alist x))
from homebrew-emacs-plus.
With Homebrew Emacs 27.1, the below addition fixes the titlebar text/font:
(add-to-list 'default-frame-alist '(ns-appearance . dark))
from homebrew-emacs-plus.
I'm having the same problem with the latest --HEAD. I also noticed the font becomes more visible when the frame is in the background (behind Safari, etc). Is there an option to determine the font color in the frame title? My configuration is the following.
;;; Transparent titlebar
;; https://github.com/d12frosted/homebrew-emacs-plus/blob/master/Formula/emacs-plus.rb#L98
;; https://github.com/d12frosted/homebrew-emacs-plus/issues/55
;; https://www.gnu.org/software/emacs/manual/html_node/elisp/Properties-in-Mode.html#Properties-in-Mode
(when (memq window-system '(mac ns))
(add-to-list 'default-frame-alist '(ns-appearance . 'dark))
(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t)))
from homebrew-emacs-plus.
Hey,
Did you find a solution?
from homebrew-emacs-plus.
I've noticed a similar issue with the natural color title bar option.
When using light themes the title bar font is rendered in white, so very hard to see. Oddly covering it with another window/frame from emacs or another application (I'm on MacOS High Sierra) it turns grey, then back to white on focus. Ah, like kaz-yos noticed.
Does anyone know where to set this kind of thing?
from homebrew-emacs-plus.
I'd rather have a blank title bar than one with ugly text, so I'm currently using this hack to remove the title bar text:
(setq frame-title-format nil)
from homebrew-emacs-plus.
@rsrock @jhacksworth Thanks. Dropping the single quote did solve the issue!
from homebrew-emacs-plus.
@kaz-yos Great to hear! š
from homebrew-emacs-plus.
I'm also experiencing what @malloryerik mentioned on light themes. Dark themes look fine.
I tried the suggested fixes with both dark
and light
values but they don't work. Maybe there should be a way to change the color of the title's face?
Here's the difference with both solarized theme variants:
from homebrew-emacs-plus.
Thanks @rsrock! It has fixed the issue for spacemacs on macos high sierra.
from homebrew-emacs-plus.
Emacs 26.1 is out. Closing this issue šø
Let me know if you have any questions/problems.
from homebrew-emacs-plus.
@junjiemars It's interesting. First of all, when I try using unbound
value Emacs behaves the same as with default values. And also, I don't see unbound
value handing in the nsterm.m
file of Emacs.
Regarding ns-appearance
:
if (EQ (new_value, Qdark))
{
window.appearance = [NSAppearance
appearanceNamed: NSAppearanceNameVibrantDark];
FRAME_NS_APPEARANCE (f) = ns_appearance_vibrant_dark;
}
else
{
window.appearance = [NSAppearance
appearanceNamed: NSAppearanceNameAqua];
FRAME_NS_APPEARANCE (f) = ns_appearance_aqua;
}
As you can see, if it's not dark
, then the default value is used. And this is also described in the info pages.
āns-appearanceā
Only available on macOS, if set to ādarkā draw this frameās
window-system window using the āvibrant darkā theme, otherwise use
the system default. The āvibrant darkā theme can be used to set
the toolbar and scrollbars to a dark appearance when using an Emacs
theme with a dark background.
Similar story with ns-transparent-titlebar
:
if ([window respondsToSelector: @selector(titlebarAppearsTransparent)]
&& !EQ (new_value, old_value))
{
window.titlebarAppearsTransparent = !NILP (new_value);
FRAME_NS_TRANSPARENT_TITLEBAR (f) = !NILP (new_value);
}
It differentiates only nil
and any non-nil
values. And this is exactly what info says.
āns-transparent-titlebarā
Only available on macOS, if non-ānilā, set the titlebar and toolbar
to be transparent. This effectively sets the background color of
both to match the Emacs background color.
So I have a question - where did you get the idea to set this value to unbound
?
P. S. I've checked the sources both on master
and emacs-26
branches.
from homebrew-emacs-plus.
@d12frosted The key in frameset.el
, when desktop-save
been called frameset
should be saved,
and whatever the value of ns-transparent-titlebar
and ns-appearance
is, the saved frameset
should be (ns-transparent-titlebar . unbound) (ns-appearance . unbound)
and the frame title bar will sucked.
You can disable desktop-save-mode
to check the frame title bar is OK or sucked.
from homebrew-emacs-plus.
@junjiemars I didn't get what you mean by 'sucking frame title'. If I understand you correctly, you can configure it (or leave it empty).
I've looked at frameset.el
and didn't find any mentions of unbound
symbol. Also, I've checked desktop-save
function definition (from desktop.el
) and there is no usages of ns-*
variables, which are used only for setting up Cocoa window.
But then I realised that you are talking about frameset-filter-alist
(sorry, missed that) and I've looked at this function and it seems that you are setting filtering actions to unbound
. But the documentation says that action can be one of
nil The parameter is copied to FILTERED.
:never The parameter is never copied to FILTERED.
:save The parameter is copied only when saving the frame.
:restore The parameter is copied only when restoring the frame.
FILTER A filter function.
Since unbound
is not defined, you get the nil
behaviour.
Just to avoid any confusion, I am not trying to say that you are wrong :) I just want to understand what you are trying to achieve. šø Because maybe your goal is useful for me as well šø
from homebrew-emacs-plus.
@d12frosted missing (ns-appearance . unbound)
cons cell in frameset
diffs with (ns-appearance . nil)
or (ns-appearance . dark)
. If frameset
has any (ns-appearance . ...)
cons cells, Emacs will use ns appearance 'nil or 'dark.
desktop-save
=> frameset-save
=> reopen Emacs => frame title bar sucked.
After frameset-save
, (ns-transparent-titlebar . unbound) (ns-appearance . unbound)
will be saved into desktop file.
from homebrew-emacs-plus.
I see. Thanks.
So yeah, maybe it worth mentioning in the documentation that one might want to set the value of frameset-filter-alist
.
from homebrew-emacs-plus.
Related Issues (20)
- native-comp is enabled by default in emacs 30, Please add option --with-native-compilation=no
- Error with daemon running through brew services HOT 2
- Another Big Sur style icon
- Could not install emacs@30 HOT 20
- installing packages in emacs-plus@30 gives "Wrong type argument: package-desc" error HOT 5
- Make it possible for sqlite to be compiled so it can load extensions HOT 3
- Formula descriptions don't seem to work
- Could not install emacs@30 in macos M1 HOT 4
- [General]: Stuck on git clone with emacs@30 HOT 2
- [General]: Emacs.app alias file at /Applications folder
- [General]: On M3 with --with-x11, no Emacs.app is built HOT 1
- [Build Failure]: The include files (AppKit/AppKit.h etc) that are required for a Nextstep build are missing or cannot be compiled. HOT 6
- [General]: --without-cocoa requires xorgproto libxau libxdmcp libxcb libx11 libxext libxrender pixman cairo gdk-pixbuf fribidi harfbuzz pango librsvg HOT 6
- Dark themes not working properly with multiple frames HOT 1
- d12frosted/emacs-plus/emacs-plus@30: private method `new' called for Tap:Class ~ HOT 7
- New and shiny Big Sur icon
- Slow startup of compile command when emacs is started from GUI
- Execute Emacs.app with command-line switches
- [Build Failure]: the latest 30 commit with --with-poll option
- [General]: emacs-plus@30 segfaults when using tree-sitter 0.22.5 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homebrew-emacs-plus.