工具与资源facebook.com
让 Emacs 丝般顺滑
Buttery Smooth Emacs
2016 — 2018,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这篇文章讨论如何让 Emacs 的图形界面渲染变得“如黄油般顺滑”,重点分析 Emacs 作为老式终端程序运行在现代 GUI 环境时出现的闪烁与重绘问题,以及作者为消除这些问题所做的调整。文中涉及 Emacs 显示架构、平台差异和 GUI 事件处理等底层细节。
为什么经久不衰:它把 Emacs 数十年的老架构与现代 GUI 的摩擦讲得很具体,对理解编辑器渲染、跨平台兼容和老软件维护仍有启发。
HN 评论精选
macOS 线程断言暴露了 Emacs GUI 层依赖大量历史 hack,线程分离并不干净。
这正好呼应“Emacs 是带了很多巧妙 hack 才跑在 GUI 里的终端程序”这个说法。我在 macOS 10.12 Sierra 上遇到一个大问题:系统对 GUI 线程和非 GUI 线程变得更严格,如果在非主线程取 GUI 事件就会断言失败,以防内存损坏。这个 bug 只在用 10.12 编译 Emacs 时出现;用旧框架编译的版本则“正常”。考虑到让 Emacs 跑在现代 GUI 上的 hack 越积越多,我很好奇这个问题会怎么解决,因为 Emacs 显然没有把 GUI 和非 GUI 线程干净分离。
AceJohnny2查看英文原文
Related to the topic of "Emacs is a terminal program with lots of clever hacks to run in a GUI", I recently encountered a big problem on macOS 10.12 "Sierra", which I found reported at [1] The crux of it is that macOS became more strict about what you were doing in GUI- vs non-GUI-threads, and now asserts if you fetch GUI events (I think?) in not the main thread, because of the risk of memory corruption. Ostensibly. This bug only manifests if you compile Emacs on 10.12 (so if you install the "emacs-app" in MacPorts, for example), because then it'll link against the asserting framework. If you use Emacs from another source that compiles it on 10.11 (such as from https://emacsformacosx.com/), then it links against an older framework that doesn't have the assert, and it'll work "fine". Considering the fractal accumulation of "clever hacks" that make Emacs work on modern GUI systems, I'm curious to see how this issue will be resolved, because I doubt it's something so simple where Emacs has proper separation of GUI vs non-GUI threads, as QED by the article ;) [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24678
推荐了学习文本编辑器内部原理的书籍和视频资源。
有哪些学习文本编辑器内部原理或从零构建编辑器的好资源?我目前找到并喜欢这些:《The Craft of Text Editing》、Gary Bernhardt 的 Twitch 从零写编辑器视频、以及一个用 Rust 构建现代文本编辑器的视频。
bonquesha99查看英文原文
What are some good resources to learn more about the inner workings of text editors or building one from scratch? So far I've found and enjoyed reading/watching the resources below and would love to learn more. * The Craft of Text Editing: https://www.finseth.com/craft/ * Writing a Text Editor From Scratch: https://www.twitch.tv/gary_bernhardt/v/90796516 * A Modern Text Editor Built in Rust: https://www.youtube.com/watch?v=SKtQgFBRUvQ
Emacs 在终端/SSH 下的能力依然强大,是它持久生命力的体现。
反过来看,Emacs 在纯文本终端上还能做这么多事也很酷:多窗口、鼠标、自动补全弹窗,通过 SSH 会话都能舒服地用。
rayiner查看英文原文
On the flip side, it's pretty cool what Emacs can still do on a text terminal. Multiple windows, mouse, auto completion pop-ups--all work comfortably over an SSH session.
老软件虽复杂度高,但 Emacs 的集成环境仍无可替代;作者期待更现代的 Emacs 生态。
我认为任何足够老、足够复杂的软件都会遇到“年龄与复杂度”问题。Unix 选择简单,但今天真正的 Unix 已不复存在;ITS、Emacs、LispM、Alto 选择集成与完整,除了 Emacs 基本都死了。现代软件倾向模块化,但复杂现代软件同样一团乱。我个人最近把 Emacs 当作主要计算环境,尽管问题很多,它仍是我用过最有效的环境。我梦想一个“现代 Emacs”:EXWM 和各种 GUI 良好配合、连贯完整的邮件客户端、以及在 org-mode 里用 GuixSD 管理整个桌面配置。
xte查看英文原文
IMO any "old enough" and complex enough software suffer some kind of "age&complexity" problems... No matter how you design it, unix choose simplicity and we see that today no real unix exists anymore (yes, they do exists per name, but in fact they do not follow unix principles), ITS, Emacs, LispM, Alto, ... choose integration and completeness and except Emacs they are essentially dead... Modern software try to choose modularity and if you find a modern complex enough software you know well how messy pachyderm is... Personally I choose (recently) Emacs as my main computing environment because even with it's many problems (there are and recent evolution solve some and add others) it's the most effective computing environment I have ever found. So in conclusion I dream a "modern Emacs" with an EXWM that play nice with any kind of GUIs (it gets a bit worse recently for floating windows or floating windows apps change for the worse I do not know exactly), I dream a damn coherent and complete MUA instead of my actual super-spaghetti-code mess mix of mbsync+notmuch+afew+homegrown crappy scripts + ... just to have a damn good modern and efficient email solution NO ONE, web(cr)app(y) UIs included seems to provide... I dream a GuixSD in org-mode in my own personal config so I have an "my_desktop.org" that contain anything from OS to Emacs config and I can export, change, replicate it in a snap... But that's a bit of a dream for now. New nice stuff arrive (doom modeline is really nice, for instance) but change the entire ecosystem, perhaps re-writing it in Guile Scheme... Well It's unlike to happen more than a timid POC by few smart guys...
历次讨论
同类还值得读
直接在浏览器中启动 Linux 内核
Boot a linux kernel right inside your browser.
Fabrice Bellard 的 JSLinux 页面,用 JavaScript 在浏览器里启动一个 Linux 内核,并提供一个可交互的终端环境。
工具与资源上首页 5 次 · 2011–2025bellard.orgHacker News 未公开功能与行为清单(2018)
A List of Hacker News's Undocumented Features and Behaviors (2018)
数据科学家 Max Woolf 整理的 Hacker News 未公开功能与行为清单,涵盖投票机制、排名算法、账号惩罚等社区运作细节。
工具与资源上首页 5 次 · 2019–2025github.comMapSCII:在终端中用盲文和 ASCII 渲染地图
MapSCII – Braille and ASCII map renderer for the console
MapSCII 是一个在命令行终端里渲染地图的开源工具,用盲文字符和 ASCII 字符把地理数据画成可交互浏览的字符地图。
工具与资源上首页 5 次 · 2017–2025github.com顶尖大学的免费在线课程
Free Online Courses from Top Universities
Open Culture 整理的一份免费在线课程合集,汇集了全球顶尖大学(如 MIT、斯坦福、耶鲁等)向公众开放的网络课程资源,涵盖音频、视频等多种形式。
工具与资源上首页 5 次 · 2010–2022openculture.com淘气字符串:容易引发用户输入问题的字符串清单
Naughty Strings: A list of strings likely to cause issues as user-input data
一个 GitHub 仓库,收录了大量容易让程序出问题的用户输入字符串,如特殊字符、emoji、SQL 注入片段、系统命令等,供开发者用于测试输入处理逻辑。
工具与资源上首页 4 次 · 2015–2020github.com