【发布时间】:2015-06-25 02:25:52
【问题描述】:
当我在 Emacs 上处于 matlab 模式时(我使用 Aquamacs),RET 在下面添加一行,但不会跳转到该行(即,它充当 C-o 应该做的)。如果 RET 的行为符合预期,即在下方添加一行并将光标移至该行,则此行为不会在其他模式下发生。
当我在 matlab 模式下按 RET 时,我会收到此消息
错误的类型参数“wholenump -1”
我不知道这是从哪里来的。我已将所有与 matlab 相关的文件重新安装到 .emacs,查看了 .emacs、Preferences.el、customizations.el,并查看了 customise-apropos 'matlab' 的所有选项。我还没有找到任何可以给我线索的东西。我不知道任何 lisp,即使我已经使用 emacs 几年了,也可以被认为是菜鸟。有人可以帮我追踪问题吗?
我正在使用 Aquatics 3.2 GNU Emacs 24.4.51.2。几年前,我最初运行的是一个未知来源的matlab-mode,但在尝试解决此问题时,我通过运行update script 从https://github.com/pronobis/matlab-mode 升级到最新版本。这并没有解决我的问题。
正如在 this SO chat 中发现的那样,某些东西正在将 fill-column 设置为值 -1:
fill-column is a variable defined in `C source code'.
Its value is -1
Original value was 70
Local in buffer funfzero.m; global value is the same.
手动将其设置回 70 暂时解决了我的问题。但是是什么导致它被设置为这样的虚假值?我怎样才能知道这是在哪里设置的?
这是调试输出
Debugger entered--Lisp error: (wrong-type-argument wholenump -1)
move-to-column(-1)
(save-excursion (move-to-column fill-column) (if (not (bobp)) (forward-char -1)) (if (matlab-cursor-in-string (quote incomplete)) 4 3))
(if matlab-fill-count-ellipsis-flag (save-excursion (move-to-column fill-column) (if (not (bobp)) (forward-char -1)) (if (matlab-cursor-in-string (quote incomplete)) 4 3)) 0)
(- fill-column (if matlab-fill-count-ellipsis-flag (save-excursion (move-to-column fill-column) (if (not (bobp)) (forward-char -1)) (if (matlab-cursor-in-string (quote incomplete)) 4 3)) 0))
(let ((fill-prefix fill-prefix) (fill-column (- fill-column (if matlab-fill-count-ellipsis-flag (save-excursion (move-to-column fill-column) (if (not ...) (forward-char -1)) (if (matlab-cursor-in-string ...) 4 3)) 0)))) (if (> (current-column) fill-column) (cond ((matlab-ltype-comm-ignore) nil) ((or (matlab-ltype-comm) (and (save-excursion (move-to-column fill-column) (matlab-cursor-in-comment)) (matlab-lattr-comm))) (matlab-set-comm-fill-prefix) (do-auto-fill) (matlab-reset-fill-prefix)) ((and (matlab-ltype-code) (not (matlab-lattr-cont)) matlab-fill-code) (let ((m (make-marker))) (move-marker m (point)) (set-marker-insertion-type m t) (if (not (matlab-find-convenient-line-break)) nil (if (not ...) (progn ... ... ...) (if matlab-fill-strings-flag ...))) (goto-char m))))))
matlab-auto-fill()
self-insert-command(1)
newline()
matlab-plain-ret()
funcall(matlab-plain-ret)
matlab-return()
call-interactively(matlab-return nil nil)
command-execute(matlab-return)
【问题讨论】: