abo*_*abo 5 emacs elisp emacs-helm
我想helm
用作替代品display-completion-list
.唯一的问题是它在顶部显示这一行,我不想要:
C-z: I don't want this line here (keeping session)
.
这是代码来说明:
(helm :sources `((name . "Do you have?")
(candidates . ("Red Leicester"
"Tilsit"
"Caerphilly"
"Bel Paese"
"Red Windsor"
"Stilton"))
(action . identity)
(persistent-help . "I don't want this line here"))
:buffer "*cheese shop*")
Run Code Online (Sandbox Code Playgroud)
我已经尝试设置persistent-help
为nil,或者根本没有设置它,但它仍然出现.我怎么能把它关掉?
该属性helm-persistent-help-string
随库一起提供helm-plugin
.如果你没有加载它,你得到没有帮助字符串.如果helm-plugin
由于某种原因需要加载,则可以helm-persistent-help-string
通过以下方式禁用该功能:
(defadvice helm-persistent-help-string (around avoid-help-message activate)
"Avoid help message"
)
Run Code Online (Sandbox Code Playgroud)
如果要完全删除灰色标题行,可以执行以下操作:
(defadvice helm-display-mode-line (after undisplay-header activate)
(setq header-line-format nil))
Run Code Online (Sandbox Code Playgroud)
随着defadvice
你改变helm
全局的行为.如果您想helm-display-mode-line
暂时更改helm
命令的执行,可以使用:
(defmacro save-function (func &rest body)
"Save the definition of func in symbol ad-func and execute body like `progn'
Afterwards the old definition of func is restored."
`(let ((ad-func (if (autoloadp (symbol-function ',func)) (autoload-do-load (symbol-function ',func)) (symbol-function ',func))))
(unwind-protect
(progn
,@body
)
(fset ',func ad-func)
)))
(save-function helm-display-mode-line
(fset 'helm-display-mode-line '(lambda (source)
(apply ad-func (list source))
(setq header-line-format nil)))
(helm :sources `((name . "Do you have?")
(candidates . ("Red Leicester"
"Tilsit"
"Caerphilly"
"Bel Paese"
"Red Windsor"
"Stilton"))
(action . identity)
(persistent-help . "I don't want this line here"))
:buffer "*cheese shop*"))
Run Code Online (Sandbox Code Playgroud)
(注意,像这样的东西cl-flet
不起作用.)
归档时间: |
|
查看次数: |
896 次 |
最近记录: |