Emacs Mac Port 毛玻璃背景

请问 Emacs Mac Port 欢迎界面的毛玻璃背景效果是怎么来的?如何让它在其它的 Buffer 中也生效呢?

这个是没有加载任何配置的 Emacs 的启动界面,可以看到有毛玻璃的背景效果。

这个是在 Doom Emacs 里设置里透明度,与 Terminal 的毛玻璃效果对比。

仅仅设置透明度字体也会变透明的 :thinking: 想请教一下怎么才能使用图1中的背景效果呢?

3 个赞

同想知道怎么让背景透明 文字不透明,,,

最近在 Reddit 上提问, 网友给出了一个办法。太开心了眼泪都快流出来了。

(set-face-background 'default "mac:windowBackgroundColor")
(dolist (f (face-list)) (set-face-stipple f "alpha:60%"))
(setq face-remapping-alist (append face-remapping-alist '((default my/default-blurred))))
(defface my/default-blurred
   '((t :inherit 'default :stipple "alpha:60%"))
   "Like 'default but blurred."
   :group 'my)

13 个赞

可惜好像只有mac-port才可以。

是呀,紫薯布丁

homebrew版的emacs-mac也可以!:blush:

GNU Emacs 毛玻璃背景 背景透明,文字不透明 被网友实现了。

https://www.reddit.com/r/emacs/comments/qm3tsv/i_implemented_partial_support_for_background/

Transparency is supported through a frame parameter alpha-background that steers the background alpha,. This differs from the old alpha frame parameter in that it only makes the background transparent, i.e. the text is still fully opaque.

This feature is only implemented for build configurations using Xlib+GTK3+Cairo. I hope this patch can spark some conversation of full support for background transparency in Emacs, as it is a topic that pops up here in r/emacs from time to time, and is also mentioned on the page about transparency on EmacsWiki.

为啥我把这段加进 Doom 的 config 然后就启动卡住了……

我天, 一开始没留心, 真的很漂亮. :stuck_out_tongue_closed_eyes:

遗憾的是图中红色区域的几个 face 似乎很难设置成同样的效果, 造成了违和. (当然本人对 Emacs 的 face 研究不是很深… 若是大佬能给出解决方案那就太好了)

title-bar 部分我估计比较难弄. 希望尽可能减少颜色冲突吧.

P.S. 底部那个红框画错了… 请无视它… 我偷懒就加行字不重新画图了2333

试试把 fringe 的 foreground 和 background 设置为 nil

1 个赞

不好意思,我现在不用 Doom 了,所以对这个问题不了解。emacs -Q 能用的话,就要向 Doom 的开发者提 issue 了。

mini buffer 有信息的时候,有时候也会有不透明的背景,Esc 一下就消失了, title bar 的适配就等以后大佬来解决了。

1 个赞

谢谢你, 已解决.


关于 title-bar 的事情我尝试 at 一下 railwaycat 吧.

@railwaycat : 麻烦您看一下, 对这件事情是否有兴趣进行开发:

很抱歉打扰您. 我不希望因为这些事情耽误您的时间. 只是希望了解您对此是否有开发的想法?

Linux KDE Gnome用户可以通过devilspie实现