Git Product home page Git Product logo

Comments (19)

rsrock avatar rsrock commented on May 11, 2024 7

Try

(add-to-list 'default-frame-alist '(ns-appearance . dark))

from homebrew-emacs-plus.

mshkrebtan avatar mshkrebtan commented on May 11, 2024 5

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.

jhacksworth avatar jhacksworth commented on May 11, 2024 3

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.

junjiemars avatar junjiemars commented on May 11, 2024 2

(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))

image

from homebrew-emacs-plus.

saurabh-sm avatar saurabh-sm commented on May 11, 2024 2

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.

kaz-yos avatar kaz-yos commented on May 11, 2024 1

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.

d12frosted avatar d12frosted commented on May 11, 2024

Hey,

Did you find a solution?

from homebrew-emacs-plus.

malloryerik avatar malloryerik commented on May 11, 2024

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.

jhacksworth avatar jhacksworth commented on May 11, 2024

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.

kaz-yos avatar kaz-yos commented on May 11, 2024

@rsrock @jhacksworth Thanks. Dropping the single quote did solve the issue!

from homebrew-emacs-plus.

jhacksworth avatar jhacksworth commented on May 11, 2024

@kaz-yos Great to hear! šŸ˜„

from homebrew-emacs-plus.

vmsp avatar vmsp commented on May 11, 2024

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:
scrot_light
scrot_dark

from homebrew-emacs-plus.

hsg777 avatar hsg777 commented on May 11, 2024

Thanks @rsrock! It has fixed the issue for spacemacs on macos high sierra.

image

from homebrew-emacs-plus.

d12frosted avatar d12frosted commented on May 11, 2024

Emacs 26.1 is out. Closing this issue šŸ˜ø

Let me know if you have any questions/problems.

from homebrew-emacs-plus.

d12frosted avatar d12frosted commented on May 11, 2024

@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.

junjiemars avatar junjiemars commented on May 11, 2024

@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.

d12frosted avatar d12frosted commented on May 11, 2024

@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.

junjiemars avatar junjiemars commented on May 11, 2024

@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.

d12frosted avatar d12frosted commented on May 11, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.