Homebrew-emacs-plus: Update breaks app appearance

Created on 29 May 2018  ยท  35Comments  ยท  Source: d12frosted/homebrew-emacs-plus

With the option to turn off the frame title bars gone we have to resort to specifying it in the init.el where it gets loaded AFTER the app has already launched, not at launch. This would be sort of acceptable if it would work at all but after some searching this part of Emacs 26 was never finished. All it does is turn off the title bar, leaving a bigass gap on the screen top area. Also this doesn't seem to be documented as people find this stuff out by accident it seems.

Also I tried to fix it by stepping back one version and got this error message.

brew search emacs-plus
==> Searching local taps...
d12frosted/emacs-plus/emacs-plus โœ”
==> Searching taps on GitHub...
==> Searching blacklisted, migrated and deleted formulae...

Is there some special trick to step back to working versions?

regression

Most helpful comment

@mclearc not at all similar. This just darkens the title bar and sets the text to white somewhen after the application has already launched. This just skins the window. --with-no-title-bars removed them.

@d12frosted the workaround you're noting in the caveats to get the exact same behaviour, doesn't yield a similar result. It just darkens the title bar and leaves the text black.

The behaviour that --with-no-title-bars brought was exactly that. No title bars. The frame started right below the menubar and either filled the entire screen or just left stuff of windows that wasn't necessary for Emacs.

All 35 comments

I'm using 26.1 on High Sierra and it works fine for me. The code I'm using is:

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

@mclearc yeah, exactly

@frankjonen sorry for inconvenience, I've updated the readme and added few words to caveats section to reflect required actions (52192f0).

@mclearc not at all similar. This just darkens the title bar and sets the text to white somewhen after the application has already launched. This just skins the window. --with-no-title-bars removed them.

@d12frosted the workaround you're noting in the caveats to get the exact same behaviour, doesn't yield a similar result. It just darkens the title bar and leaves the text black.

The behaviour that --with-no-title-bars brought was exactly that. No title bars. The frame started right below the menubar and either filled the entire screen or just left stuff of windows that wasn't necessary for Emacs.

@frankjonen Ok, possibly that was a bad decision to remove this option. Sorry for that. I will look into it ASAP, but I doubt that it'll happen before the weekends.

If someone wants to step in, you know, PRs are WARMLY welcome! ๐Ÿ˜ธ

I too support this happening. I have had great experience with -no-title-bar. It allows things like these to happen:

img

!img2

Ok. It seems that Emacs 26.1 already has all the necessary stuff to make it working. As @frankjonen said, it's not documented (or at least, I could not find any relevant documentation). After some trial I've managed to make it working by adding following code to the beginning of my init.el file:

(add-to-list 'default-frame-alist '(undecorated . t))
(add-to-list 'default-frame-alist '(fullscreen . maximized))

@frankjonen and @CestDiego, could you please check if it works for you? ๐Ÿ˜ธ If not, please checkout what other options are in default-frame-alist and let me know if you are using HEAD or 26.1.

It's a well-meaning setting (and one that I had commented on before). Unfortunately it leaves you with a gap where the title bar used to be and no way to grab on to the window to scale it up vertically. Probably could do it with an AppleScript (example on my Pastebin) but I have no idea how to trigger it from the init.el / spacemacs.el setup.

Using normal installation.

In Emacs Preferences I've searched high and low for anything remotely resembling title bar related stuff. Absolutely nothing.

@frankjonen
If I add only (add-to-list 'default-frame-alist '(undecorated . t)) I see the gap. Once I add (add-to-list 'default-frame-alist '(fullscreen . maximized)) the gap goes away. Do you set fullscreen to maximized?

BTW, you didn't specify any configurations you are making in any of your comments. It would be super helpful if you said in the first comment that you tried setting undecorated to t.

Oh right. I sort of implied neither of them making a difference to the gapishness.

  • undecorated . t = gap
  • undecorated . t + fullscreen . maximized = gap

No --HEAD setup, just the normal one.

@d12frosted as you can see in this github issue: https://github.com/koekeishiya/chunkwm/issues/265#issuecomment-394801114

This has problems with the chunkwm window manager. It would be better if we had the no-title-bar option back. Would this just be a revert on the commit that removed it? I'm not familiar with the quirks of this but I would love to help make this happen.

Thanks for checking @frankjonen and @CestDiego

Would this just be a revert on the commit that removed it?

@CestDiego unfortunately no, as the patch behind the toggle has no sense on 26.1+. That patch was an experimental hack until 26.1 comes out. Right now Emacs has a means of creating undecorated frames, but it seems to behave differently. Quick look at nsterm.m didn't help to understand me why.

Since I don't use this option I didn't notice it before we've spent some time trying to understand what's wrong.

Anyways, I'll try to take care of this issue during this week.

Great to know. Thanks for the support.

On Wed, Jun 6, 2018, 1:55 AM Boris notifications@github.com wrote:

Thanks for checking @frankjonen https://github.com/frankjonen and
@CestDiego https://github.com/CestDiego

Would this just be a revert on the commit that removed it?

@CestDiego https://github.com/CestDiego unfortunately no, as the patch
behind the toggle has no sense on 26.1+. That patch was an experimental
hack until 26.1 comes out. Right now Emacs has a means of creating
undecorated frames, but it seems to behave differently. Quick look at
nsterm.m didn't help to understand me why.

Since I don't use this option I didn't notice it before we've spent some
time trying to understand what's wrong.

Anyways, I'll try to take care of this issue during this week.

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/d12frosted/homebrew-emacs-plus/issues/82#issuecomment-394948901,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADI540r2sOCHPi1rX3a61TZAk5GCEHmzks5t527AgaJpZM4UQtH3
.

>

Diego Berrocal
http://diegoberrocal.com

I've tried adding several changes to nterm.m, but it didn't help. Following the thread I've started on mailing list, gonna file a bug, cause I don't know why it doesn't allow to resize even after the changes.

Thanks for keeping us updated. Do you think there is a way to use the
previous emacs formula in the meantime
?

On Mon, Jun 11, 2018, 1:40 AM Boris notifications@github.com wrote:

I've tried adding several changes to nterm.m, but it didn't help.
Following the thread I've started on mailing list, gonna file a bug, cause
I don't know why it doesn't allow to resize even after the changes.

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/d12frosted/homebrew-emacs-plus/issues/82#issuecomment-396127703,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADI548Qn0DkUcL8eVYPtFJjkTBbIki3Tks5t7gK3gaJpZM4UQtH3
.

>

Diego Berrocal
http://diegoberrocal.com

Yes, I thought about providing emacs-plus@25 formulae for you guys. Looks like issue with title bar won't be fixed ASAP.

Short update:

$ brew install emacs-plus@25 [all-your-favourite-options]

That works. Thanks. However I hope that we can eventually use emacs 26 T_T

However I hope that we can eventually use emacs 26 T_T

Haha. I understand. Though right now I can't promise fast resolution for this issue on Emacs 26.1.

Good news everyone!

I've pushed a patch that does borderless Emacs (fe4dc95). The option is called --with-no-titlebar. And it's even more experimental than before :D

Please note, that I highly advice against using this option, instead use ns-transparent-titlebar frame setting. I'll update readme file soon.

@CestDiego @frankjonen

@d12frosted I get this:
image

@d12frosted this is what I get:

~
โžœ brew install emacs-plus --with-no-titlebar
==> Installing emacs-plus from d12frosted/emacs-plus
==> Downloading https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/borderless-frame-on-macOS.patch
Already downloaded: /Users/dberrocal/Library/Caches/Homebrew/emacs-plus-frame.patch
==> Downloading https://gist.githubusercontent.com/aatxe/260261daf70865fbf1749095de9172c5/raw/214b50c62450be1cbee9f11cecba846dd66c7d06/patch-multicolor-font.diff
Already downloaded: /Users/dberrocal/Library/Caches/Homebrew/emacs-plus--patch-5af2587e986db70999d1a791fca58df027ccbabd75f45e4a2af1602c75511a8c.diff
==> Downloading https://lists.gnu.org/archive/html/emacs-devel/2018-02/txtshOHDg6PmW.txt
Already downloaded: /Users/dberrocal/Library/Caches/Homebrew/emacs-plus--patch-ba9d9555256f91409c4a7b233c36119514ba3d61f4acdb15d7d017db0fb9f00c.txt
==> Downloading https://lists.gnu.org/archive/html/emacs-devel/2018-02/txtzUNqW9dNDT.txt
Already downloaded: /Users/dberrocal/Library/Caches/Homebrew/emacs-plus--patch-500b437c3ed03e0ef1341b800919aa85cc9a9f13ecbaea8d5fc67bf74510317a.txt
==> Patching
==> Applying patch-multicolor-font.diff
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/src/macfont.m b/src/macfont.m
|index 0445628..c9082a5 100644
|--- a/src/macfont.m
|+++ b/src/macfont.m
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
Error: Failure while executing: patch -g 0 -f -p1 -i /private/tmp/emacs-plus--patch-20180612-18212-rrfvli/patch-multicolor-font.diff

Does it fail when you build without no-title-bar option?

On Tue, Jun 12, 2018 at 21:24 Diego Berrocal notifications@github.com
wrote:

@d12frosted https://github.com/d12frosted this is what I get:

~
โžœ brew install emacs-plus --with-no-titlebar
==> Installing emacs-plus from d12frosted/emacs-plus
==> Downloading https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/borderless-frame-on-macOS.patch
Already downloaded: /Users/dberrocal/Library/Caches/Homebrew/emacs-plus-frame.patch
==> Downloading https://gist.githubusercontent.com/aatxe/260261daf70865fbf1749095de9172c5/raw/214b50c62450be1cbee9f11cecba846dd66c7d06/patch-multicolor-font.diff
Already downloaded: /Users/dberrocal/Library/Caches/Homebrew/emacs-plus--patch-5af2587e986db70999d1a791fca58df027ccbabd75f45e4a2af1602c75511a8c.diff
==> Downloading https://lists.gnu.org/archive/html/emacs-devel/2018-02/txtshOHDg6PmW.txt
Already downloaded: /Users/dberrocal/Library/Caches/Homebrew/emacs-plus--patch-ba9d9555256f91409c4a7b233c36119514ba3d61f4acdb15d7d017db0fb9f00c.txt
==> Downloading https://lists.gnu.org/archive/html/emacs-devel/2018-02/txtzUNqW9dNDT.txt
Already downloaded: /Users/dberrocal/Library/Caches/Homebrew/emacs-plus--patch-500b437c3ed03e0ef1341b800919aa85cc9a9f13ecbaea8d5fc67bf74510317a.txt
==> Patching
==> Applying patch-multicolor-font.diff
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?

The text leading up to this was:

|diff --git a/src/macfont.m b/src/macfont.m
|index 0445628..c9082a5 100644
|--- a/src/macfont.m

|+++ b/src/macfont.m

No file to patch. Skipping patch.
1 out of 1 hunk ignored
Error: Failure while executing: patch -g 0 -f -p1 -i /private/tmp/emacs-plus--patch-20180612-18212-rrfvli/patch-multicolor-font.diff

โ€”
You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
https://github.com/d12frosted/homebrew-emacs-plus/issues/82#issuecomment-396687691,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGNNiTunxsxN5txoxw4k0VuFEx1JfvOcks5t8AdegaJpZM4UQtH3
.

>

Cheers,
Boris

It does not fail

Ah, my apologises. I made a mistake in a formula that I pushed. Was creating patch and applying it on two different machines and didn't copy paste everything.

I was planning also to add a test for this.

Sounds good. I'm happy to test it again when you are ready.

On Tue, Jun 12, 2018, 3:23 PM Boris notifications@github.com wrote:

Ah, my apologises. I made a mistake in a formula that I pushed. Was
creating patch and applying it on two different machines and didn't copy
paste everything.

I was planning also to add a test for this.

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/d12frosted/homebrew-emacs-plus/issues/82#issuecomment-396704554,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADI54-GrW-iU3pUxBhnLDe3AjdMUAbedks5t8BVCgaJpZM4UQtH3
.

>

Diego Berrocal
http://diegoberrocal.com

Already

On Tue, Jun 12, 2018 at 22:30 Diego Berrocal notifications@github.com
wrote:

Sounds good. I'm happy to test it again when you are ready.

On Tue, Jun 12, 2018, 3:23 PM Boris notifications@github.com wrote:

Ah, my apologises. I made a mistake in a formula that I pushed. Was
creating patch and applying it on two different machines and didn't copy
paste everything.

I was planning also to add a test for this.

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<
https://github.com/d12frosted/homebrew-emacs-plus/issues/82#issuecomment-396704554
,
or mute the thread
<
https://github.com/notifications/unsubscribe-auth/ADI54-GrW-iU3pUxBhnLDe3AjdMUAbedks5t8BVCgaJpZM4UQtH3

.

>

Diego Berrocal
http://diegoberrocal.com

โ€”
You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
https://github.com/d12frosted/homebrew-emacs-plus/issues/82#issuecomment-396706506,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGNNiRBP-_GQUln1oJ07Sa2pVsuXTLMWks5t8BbigaJpZM4UQtH3
.

>

Cheers,
Boris

It works :D

On Tue, Jun 12, 2018 at 10:07 PM Boris notifications@github.com wrote:

Already

On Tue, Jun 12, 2018 at 22:30 Diego Berrocal notifications@github.com
wrote:

Sounds good. I'm happy to test it again when you are ready.

On Tue, Jun 12, 2018, 3:23 PM Boris notifications@github.com wrote:

Ah, my apologises. I made a mistake in a formula that I pushed. Was
creating patch and applying it on two different machines and didn't
copy
paste everything.

I was planning also to add a test for this.

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<

https://github.com/d12frosted/homebrew-emacs-plus/issues/82#issuecomment-396704554

,
or mute the thread
<

https://github.com/notifications/unsubscribe-auth/ADI54-GrW-iU3pUxBhnLDe3AjdMUAbedks5t8BVCgaJpZM4UQtH3
>

.

>

Diego Berrocal
http://diegoberrocal.com

โ€”
You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
<
https://github.com/d12frosted/homebrew-emacs-plus/issues/82#issuecomment-396706506
,
or mute the thread
<
https://github.com/notifications/unsubscribe-auth/AGNNiRBP-_GQUln1oJ07Sa2pVsuXTLMWks5t8BbigaJpZM4UQtH3

.

>

Cheers,
Boris

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/d12frosted/homebrew-emacs-plus/issues/82#issuecomment-396790429,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADI54xGx5ETcpvVLK3A9foecTeGwU-sXks5t8HPXgaJpZM4UQtH3
.

>

Diego Berrocal
http://diegoberrocal.com

Glad to hear ๐Ÿ˜ธ

So I am closing this issue. If there is something wrong with current implementation, just let me know (either in this issue or fire new one).

Failing for me with --HEAD:

==> Installing d12frosted/emacs-plus/emacs-plus --HEAD --with-no-titlebar
==> Cloning https://github.com/emacs-mirror/emacs.git
Cloning into '/Users/br/Library/Caches/Homebrew/emacs-plus--git'...
Checking out files: 100% (3897/3897), done.
==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
==> Downloading https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/borde
######################################################################## 100.0%
==> Downloading https://gist.githubusercontent.com/aatxe/260261daf70865fbf1749095de9172c5/raw/214b50c
######################################################################## 100.0%
==> Downloading https://github.com/emacs-mirror/emacs/compare/scratch/ns-drawing.patch
######################################################################## 100.0%
==> Downloading http://emacs.1067599.n8.nabble.com/attachment/465838/0/0001-Fix-crash-on-flush-to-dis
######################################################################## 100.0%
==> Patching
==> Applying borderless-frame-on-macOS.patch
patching file src/nsterm.m
Hunk #1 FAILED at 425.
Hunk #2 FAILED at 1888.
Hunk #3 FAILED at 6842.
Hunk #4 succeeded at 7328 (offset 110 lines).
Hunk #5 succeeded at 7363 (offset 110 lines).
3 out of 5 hunks FAILED -- saving rejects to file src/nsterm.m.rej
Error: undefined method `shelljoin' for nil:NilClass
Please report this bug:
  https://docs.brew.sh/Troubleshooting
/usr/local/Homebrew/Library/Homebrew/exceptions.rb:547:in `initialize'
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:7:in `new'
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:7:in `rewrite_child_error'
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:84:in `block (3 levels) in safe_fork'
/usr/local/Homebrew/Library/Homebrew/utils.rb:402:in `ignore_interrupts'
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:60:in `block (2 levels) in safe_fork'
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:29:in `open'
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:29:in `block in safe_fork'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/tmpdir.rb:89:in `mktmpdir'
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:28:in `safe_fork'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:729:in `build'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:317:in `install'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:325:in `install_formula'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:256:in `block in install'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:254:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:254:in `install'
/usr/local/Homebrew/Library/Homebrew/brew.rb:91:in `<main>'

This is with a completely fresh install of homebrew, fwiw.

Please try without --with-no-titlebar. I will take a look why this one fails.

@d12frosted Hi Boris without the --with-no-titlebar flag it installs fine from --HEAD. I'm reporting/bringing it up for your information. ๐Ÿ˜ƒ

P.S. If I omit the --HEAD flag, --with-no-titlebar patches successfully, I'm doing it right this second.

Oh totally forgot about this. The non --HEAD version with no titlebar works fine now. Had to re-install recently because my Homebrew install fk'd itself into oblivion.

Thanks @d12frosted for coming through with this.

@benjamin-rood nice! I haven't checked why --with-no-titlebar fails, but I will take a look.

@frankjonen ๐Ÿ‘Œ thanks for checking ๐Ÿ˜ธ

P. S. I hope these fixes for macOS Mojave will be merged soon into master branch of Emacs.

@benjamin-rood --with-no-titlebar should work now on Mojave HEAD. Note that building on Mojave without HEAD is not supported yet.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brabalan picture brabalan  ยท  3Comments

thomasheartman picture thomasheartman  ยท  5Comments

nwolfe picture nwolfe  ยท  6Comments

AbstProcDo picture AbstProcDo  ยท  3Comments

d12frosted picture d12frosted  ยท  6Comments