修改自定义defun以与Magit不冲突
-
05-07-2019 - |
题
我在.emacs中使用以下智能选项卡defun来完成单词或只是执行标准选项卡:
(global-set-key [(tab)] 'smart-tab)
(defun smart-tab ()
"This smart tab is minibuffer compliant: it acts as usual in
the minibuffer. Else, if mark is active, indents region. Else if
point is at the end of a symbol, expands it. Else indents the
current line."
(interactive)
(if (minibufferp)
(unless (minibuffer-complete)
(dabbrev-expand nil))
(if mark-active
(indent-region (region-beginning)
(region-end))
(if (looking-at "\\_>")
(dabbrev-expand nil)
(indent-for-tab-command)))))
然而,当我使用magit-status
进行git Git集成时,我之前可以选择一个已修改的文件,点击标签,并立即在该文件上看到差异以查看已修改的内容。但是,每当我现在尝试选项卡时,我的迷你缓冲区中都会出现以下错误。
indent-relative: Buffer is read-only: #<buffer *magit: my_project*
有关接近此问题的想法,并且可能仅将智能标签应用于某些模式吗?
谢谢!
不隶属于 StackOverflow