刚做的一大段 Elisp 的学习笔记因为 Emacs 崩溃没了,以前没有发生这样的情况,系统反馈是软件出错才导致的,不知道是不是升级到最新版 28.1 的关系,暂时无法定位错误发生的原因。
比较奇怪,我其实已经用了一个自动保存的 mode:
(require 'real-auto-save)
(add-hook 'prog-mode-hook 'real-auto-save-mode)
(add-hook 'org-mode-hook 'real-auto-save-mode)
(setq real-auto-save-interval 5) ;; in seconds
你这个包我没用过。我说的那两个是目前社区用的比较多的。你可以设置保存间隔再小一些 。我设置的 1.5s,这样基本上都是实时保存的,不存在丢文档的情况。
1 个赞
28.1 太不稳定了 (我安装的是 emacsformacos.com 在 2022-05-11 编译的 Emacs-28.1-4-universal.dmg),有时候用不到几分钟就崩溃。
不过我很少用 28.1 正式版,一直都是用开发板,没遇到情况,估计是最近发布的版本合并了有问题的代码进来。
我先前写了一个测试配置(代码和步骤详见 minad/corfu#212),意外地使得随便按几个键 28.1 必崩溃:
$ /Applications/Emacs-28.1.app/Contents/MacOS/Emacs -Q -l ~/.scratch/emacs/2022-07/test-corfu-elpl.el
2022-08-15 09:43:00.394 Emacs-x86_64-10_11[11903:27040162] -[EmacsView flushWindow]: unrecognized selector sent to instance 0x7f8613c29d90
2022-08-15 09:43:00.394 Emacs-x86_64-10_11[11903:27040162] -[EmacsView flushWindow]: unrecognized selector sent to instance 0x7f8613c29d90
2022-08-15 09:43:00.408 Emacs-x86_64-10_11[11903:27040162] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[EmacsView flushWindow]: unrecognized selector sent to instance 0x7f8613c29d90'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff31544f3b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fff5889d942 objc_exception_throw + 48
2 CoreFoundation 0x00007fff315dc414 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x00007fff314bbf03 ___forwarding___ + 1443
4 CoreFoundation 0x00007fff314bb8d8 _CF_forwarding_prep_0 + 120
5 Emacs-x86_64-10_11 0x0000000108687430 -[EmacsView unlockFocus] + 176
6 AppKit 0x00007fff2ebdc230 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 3493
7 AppKit 0x00007fff2ebdc01f -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2964
8 AppKit 0x00007fff2ebdc01f -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2964
9 AppKit 0x00007fff2eb91656 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 938
10 AppKit 0x00007fff2f2fc4e0 -[NSView _oldDisplayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 2051
11 AppKit 0x00007fff2eb8fe5d -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 253
12 AppKit 0x00007fff2eb8c0b4 -[NSView displayIfNeeded] + 1581
13 AppKit 0x00007fff2eb8ba52 -[NSWindow displayIfNeeded] + 321
14 AppKit 0x00007fff2eb66e4a -[NSWindow _setColorSpace:sendNotification:displayIfChanged:] + 454
15 AppKit 0x00007fff2eb66bfe -[NSWindow _adjustColorSpace:] + 210
16 AppKit 0x00007fff2ec1c932 -[NSWindow _commonAwake] + 1520
17 AppKit 0x00007fff2ebe2814 -[NSWindow addChildWindow:ordered:] + 807
18 Emacs-x86_64-10_11 0x0000000108689e0b -[EmacsWindow setParentChildRelationships] + 731
19 Emacs-x86_64-10_11 0x000000010868927a -[EmacsWindow initWithEmacsFrame:fullscreen:screen:] + 1450
20 Emacs-x86_64-10_11 0x0000000108688cc5 -[EmacsWindow initWithEmacsFrame:] + 69
21 Emacs-x86_64-10_11 0x0000000108684978 -[EmacsView initFrameFromEmacs:] + 1208
22 Emacs-x86_64-10_11 0x00000001086a0796 Fx_create_frame + 8262
23 Emacs-x86_64-10_11 0x000000010856823b funcall_subr + 507
24 Emacs-x86_64-10_11 0x0000000108566f33 Ffuncall + 515
25 Emacs-x86_64-10_11 0x00000001085e3498 exec_byte_code + 13208
26 Emacs-x86_64-10_11 0x000000010856b98f fetch_and_exec_byte_code + 175
27 Emacs-x86_64-10_11 0x000000010856863b funcall_lambda + 395
28 Emacs-x86_64-10_11 0x0000000108566f8e Ffuncall + 606
29 Emacs-x86_64-10_11 0x00000001085e3498 exec_byte_code + 13208
30 Emacs-x86_64-10_11 0x000000010856b98f fetch_and_exec_byte_code + 175
31 Emacs-x86_64-10_11 0x000000010856863b funcall_lambda + 395
32 Emacs-x86_64-10_11 0x0000000108566f8e Ffuncall + 606
33 Emacs-x86_64-10_11 0x00000001085614fe Fapply + 254
34 Emacs-x86_64-10_11 0x000000010856815d funcall_subr + 285
35 Emacs-x86_64-10_11 0x0000000108566f33 Ffuncall + 515
36 Emacs-x86_64-10_11 0x00000001085e3498 exec_byte_code + 13208
37 Emacs-x86_64-10_11 0x000000010856b98f fetch_and_exec_byte_code + 175
38 Emacs-x86_64-10_11 0x000000010856863b funcall_lambda + 395
39 Emacs-x86_64-10_11 0x0000000108566f8e Ffuncall + 606
40 Emacs-x86_64-10_11 0x00000001085e3498 exec_byte_code + 13208
41 Emacs-x86_64-10_11 0x000000010856b98f fetch_and_exec_byte_code + 175
42 Emacs-x86_64-10_11 0x000000010856863b funcall_lambda + 395
43 Emacs-x86_64-10_11 0x0000000108561342 apply_lambda + 9538
44 Emacs-x86_64-10_11 0x00000001085572b3 eval_sub + 12579
45 Emacs-x86_64-10_11 0x0000000108557a49 Fsetq + 249
46 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
47 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
48 Emacs-x86_64-10_11 0x000000010855777c Fif + 108
49 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
50 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
51 Emacs-x86_64-10_11 0x00000001085591e6 FletX + 582
52 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
53 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
54 Emacs-x86_64-10_11 0x0000000108568a27 funcall_lambda + 1399
55 Emacs-x86_64-10_11 0x0000000108561342 apply_lambda + 9538
56 Emacs-x86_64-10_11 0x0000000108557549 eval_sub + 13241
57 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
58 Emacs-x86_64-10_11 0x00000001085591e6 FletX + 582
59 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
60 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
61 Emacs-x86_64-10_11 0x0000000108568a27 funcall_lambda + 1399
62 Emacs-x86_64-10_11 0x0000000108561342 apply_lambda + 9538
63 Emacs-x86_64-10_11 0x0000000108557549 eval_sub + 13241
64 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
65 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
66 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
67 Emacs-x86_64-10_11 0x00000001085591e6 FletX + 582
68 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
69 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
70 Emacs-x86_64-10_11 0x000000010855bb36 Flet + 10230
71 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
72 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
73 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
74 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
75 Emacs-x86_64-10_11 0x00000001085591e6 FletX + 582
76 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
77 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
78 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
79 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
80 Emacs-x86_64-10_11 0x00000001085591e6 FletX + 582
81 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
82 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
83 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
84 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
85 Emacs-x86_64-10_11 0x00000001085591e6 FletX + 582
86 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
87 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
88 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
89 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
90 Emacs-x86_64-10_11 0x00000001085591e6 FletX + 582
91 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
92 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
93 Emacs-x86_64-10_11 0x000000010855bb36 Flet + 10230
94 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
95 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
96 Emacs-x86_64-10_11 0x00000001085591e6 FletX + 582
97 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
98 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
99 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
100 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
101 Emacs-x86_64-10_11 0x00000001085591e6 FletX + 582
102 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
103 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
104 Emacs-x86_64-10_11 0x0000000108568a27 funcall_lambda + 1399
105 Emacs-x86_64-10_11 0x0000000108561342 apply_lambda + 9538
106 Emacs-x86_64-10_11 0x0000000108557549 eval_sub + 13241
107 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
108 Emacs-x86_64-10_11 0x00000001085578be Fcond + 174
109 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
110 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
111 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
112 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
113 Emacs-x86_64-10_11 0x00000001085591e6 FletX + 582
114 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
115 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
116 Emacs-x86_64-10_11 0x000000010855bb36 Flet + 10230
117 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
118 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
119 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
120 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
121 Emacs-x86_64-10_11 0x00000001085591e6 FletX + 582
122 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
123 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
124 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
125 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
126 Emacs-x86_64-10_11 0x00000001085591e6 FletX + 582
127 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
128 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
129 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
130 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
131 Emacs-x86_64-10_11 0x00000001085591e6 FletX + 582
132 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
133 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
134 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
135 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
136 Emacs-x86_64-10_11 0x00000001085591e6 FletX + 582
137 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
138 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
139 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
140 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
141 Emacs-x86_64-10_11 0x0000000108568a27 funcall_lambda + 1399
142 Emacs-x86_64-10_11 0x0000000108561342 apply_lambda + 9538
143 Emacs-x86_64-10_11 0x0000000108557549 eval_sub + 13241
144 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
145 Emacs-x86_64-10_11 0x000000010855bb36 Flet + 10230
146 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
147 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
148 Emacs-x86_64-10_11 0x000000010855bb36 Flet + 10230
149 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
150 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
151 Emacs-x86_64-10_11 0x00000001085591e6 FletX + 582
152 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
153 Emacs-x86_64-10_11 0x000000010855775e Fif + 78
154 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
155 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
156 Emacs-x86_64-10_11 0x00000001085591e6 FletX + 582
157 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
158 Emacs-x86_64-10_11 0x000000010855775e Fif + 78
159 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
160 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
161 Emacs-x86_64-10_11 0x00000001085591e6 FletX + 582
162 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
163 Emacs-x86_64-10_11 0x000000010855775e Fif + 78
164 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
165 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
166 Emacs-x86_64-10_11 0x00000001085591e6 FletX + 582
167 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
168 Emacs-x86_64-10_11 0x000000010855775e Fif + 78
169 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
170 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
171 Emacs-x86_64-10_11 0x00000001085591e6 FletX + 582
172 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
173 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
174 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
175 Emacs-x86_64-10_11 0x000000010855775e Fif + 78
176 Emacs-x86_64-10_11 0x00000001085545c7 eval_sub + 1079
177 Emacs-x86_64-10_11 0x00000001085577fa Fprogn + 106
178 Emacs-x86_64-10_11 0x0000000108568a27 funcall_lambda + 1399
179 Emacs-x86_64-10_11 0x000000010856709d Ffuncall + 877
180 Emacs-x86_64-10_11 0x00000001085614fe Fapply + 254
181 Emacs-x86_64-10_11 0x000000010856815d funcall_subr + 285
182 Emacs-x86_64-10_11 0x0000000108566f33 Ffuncall + 515
183 Emacs-x86_64-10_11 0x00000001085e3498 exec_byte_code + 13208
184 Emacs-x86_64-10_11 0x000000010856b98f fetch_and_exec_byte_code + 175
185 Emacs-x86_64-10_11 0x000000010856863b funcall_lambda + 395
186 Emacs-x86_64-10_11 0x0000000108566f8e Ffuncall + 606
187 Emacs-x86_64-10_11 0x0000000108567b24 call1 + 68
188 Emacs-x86_64-10_11 0x000000010844af53 timer_check_2 + 1795
189 Emacs-x86_64-10_11 0x000000010844a7c8 timer_check + 168
190 Emacs-x86_64-10_11 0x0000000108447f45 readable_events + 37
191 Emacs-x86_64-10_11 0x000000010844a680 get_input_pending + 64
192 Emacs-x86_64-10_11 0x00000001084469b6 detect_input_pending_run_timers + 54
193 Emacs-x86_64-10_11 0x00000001085fa3e9 wait_reading_process_output + 6057
194 Emacs-x86_64-10_11 0x00000001082c7b91 sit_for + 849
195 Emacs-x86_64-10_11 0x0000000108444e5f read_char + 5679
196 Emacs-x86_64-10_11 0x000000010844102b read_key_sequence + 2011
197 Emacs-x86_64-10_11 0x000000010843f48d command_loop_1 + 1501
198 Emacs-x86_64-10_11 0x000000010855cdd3 internal_condition_case + 131
199 Emacs-x86_64-10_11 0x000000010843ee73 command_loop_2 + 35
200 Emacs-x86_64-10_11 0x000000010855c30c internal_catch + 76
201 Emacs-x86_64-10_11 0x000000010843e3c6 command_loop + 294
202 Emacs-x86_64-10_11 0x000000010843e1d3 recursive_edit_1 + 195
203 Emacs-x86_64-10_11 0x000000010843e5a2 Frecursive_edit + 322
204 Emacs-x86_64-10_11 0x000000010843b6ee main + 7278
205 libdyld.dylib 0x00007fff594b8015 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Fatal error 6: Aborted
fish: Job 1, '/Applications/Emacs-28.1.app/Co…' terminated by signal SIGABRT (Abort)
简化配置和步骤:
- 克隆相关包的源代码
$ git clone https://github.com/minad/corfu ~/repos/emacs-corfu
$ git clone https://github.com/minad/cape ~/repos/emacs-cape
$ git clone https://github.com/twlz0ne/elpl ~/repos/emacs-elpl
- 启动 Emacs
$ /path/to/emacs-28.1 -Q --eval "
(progn
(add-to-list 'load-path \"~/repos/emacs-elpl\")
(require 'elpl)
(add-to-list 'load-path \"~/repos/emacs-corfu\")
(require 'corfu)
(setq corfu-auto t)
(global-corfu-mode)
(add-to-list 'load-path \"~/repos/emacs-cape\")
(require 'cape)
(advice-add #'elpl-completion-at-point :around #'cape-wrap-noninterruptible)
(elpl))"
-
在
ELPL>
输入glo
,等待补全菜单显示(或 Emacs 崩溃) -
如果没有发生崩溃,删除输入,然后重复步骤 2
在Win11上遇到过28.1崩溃,后来在Win上就换回26.3了…
上一个发布的稳定版本是27.2
今天我用Emacs 28.2在macOS 12.6 上测试了数十次,功能一切正常,没有发生崩溃。供参考。
1 个赞
我用自己编译的 macport 28.1 (直接从 git repo拉的)在 intel mac 上没这问题,当前系统版本 12.6
我自己编译和从 MacPorts 下载的 Emacs 28.2 也没问题,看来的确是 emacsformacosx.com 编译的有问题,但是它上面下载 Nightly 版本又是正常的。
鉴于后二者是同一套脚本、同一个环境编译的,所以很难说跟问题跟 Emacs 28 本身没有关系。
测试了不同来源的不同版本:
Version | From | Result |
---|---|---|
27.1 (NS appkit-1348.17 Version 10.10.5) | emacsformacosx.com | Passed |
27.2 (NS appkit-1404.47 Version 10.11.6) | emacsformacosx.com | Passed |
28.1 (NS appkit-1404.47 Version 10.11.6) | emacsformacosx.com | Crashed |
28.2 (NS appkit-1404.47 Version 10.11.6) | emacsformacosx.com | Crashed |
29.0 (NS appkit-1404.47 Version 10.11.6) | emacsformacosx.com | Passed |
28.2 (NS appkit-1561.61 Version 10.13.6) | MacPorts | Passed |
28.2 (NS appkit-1561.61 Version 10.13.6) | Build from source | Passed |
29.0 (NS appkit-1561.61 Version 10.13.6) | Build from source | Passed |
不好判断,编译环境并不相同,SDK和系统版本都不一样。也许macOS SDK有问题也不一定。