【发布时间】:2020-04-21 03:30:19
【问题描述】:
在 emacs shell 中,当我输入命令“echo %”时,emacs 将死机,当我取消命令时,消息 显示如下错误:
comint-simple-send-around: Format string ends in middle of format specifier
我调试错误,因为 Emacs 使用 format 函数,%% 可以为 % 工作,但仍然发送带有 %% 字符的 shell。
以下是定义:
(defun comint-simple-send-around (simle-function proc string)
(dolist (item name-variable-map)
(let ((name (car item))
(value (symbol-value (cdr item))))
(setq string (replace-regexp-in-string name value string))
))
(message string)
(funcall simle-function proc string)
)
(advice-add #'comint-simple-send :around #'comint-simple-send-around)
【问题讨论】:
-
M-x eshell或M-x shell?无论哪种情况,我都无法复制该问题。请告诉我们M-x emacs-version所说的内容,并提供从emacs -Q开始的配方以重现问题。 -
@Drew,感谢您的回复,我使用的是 shell,而不是 eshell。版本:“2017-09-13 的 GNU Emacs 25.3.2(x86_64-pc-linux-gnu,GTK+ 版本 3.18.9)”这很奇怪,emacs -Q 工作正常。什么时候开始没有“-Q”选项,消息是“comint-simple-send-around:格式字符串在格式说明符中间结束”,我更新问题中的定义和设置。