Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

define-abbrev-table 缩写展开无法生效 #42

Closed
ziyuanjun opened this issue Apr 17, 2016 · 10 comments
Closed

define-abbrev-table 缩写展开无法生效 #42

ziyuanjun opened this issue Apr 17, 2016 · 10 comments

Comments

@ziyuanjun
Copy link

Emacs 版本#: GNU Emacs 25.1.50.1

操作系统#: LXLE 14.04 LTS

语句#:

(abbrev-mode t)
(define-abbrev-table 'global-abbrev-table '(
;;me
("8zy" "ziyuan")
;;mic
("8ms" "Microsoft")
))

现象#:敲完8zy后按空格或tab都不会变成我想要的字符串。

@ghost
Copy link

ghost commented Apr 17, 2016

;; Abbreviation Mode and Setting
(abbrev-mode 1)
(define-abbrev-table 'global-abbrev-table '(
                        ("3lxy" "li-xinyang")

我这里没问题,能不能给你全部编辑器的配置信息。空格后会自动展开,在缩写表中定义的字符串。1t 的效果其实是一样的。

@ghost ghost changed the title define-abbrev-table 不起作用 define-abbrev-table 缩写展开无法生效 Apr 17, 2016
@ziyuanjun
Copy link
Author

我编辑器的全部配置都是照着山人的视频一句一句敲的,我也觉得很奇怪

@ziyuanjun
Copy link
Author

在define-abbrev-table的最后 C-x C-e,输出字符nil,
你的也是这样的吗?

@zilongshanren
Copy link
Member

@ziyuanjun 我也是输出 nil... 不过这并不影响。

@zilongshanren
Copy link
Member

@ziyuanjun 你试一下手动在当前 buffer 调用 M-x abbrev-mode 试试

@zilongshanren
Copy link
Member

@ziyuanjun C-h m 把你的输出拿出来看看。。

@ziyuanjun
Copy link
Author

@zilongshanren 在当前buffer 调用 M-x abbrev-mode就可以啦!
C-h m 的输出(调用 M-x abbrev-mode之前):
Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption
Blink-Cursor Company Delete-Selection Diff-Auto-Refine Electric-Indent
File-Name-Shadow Font-Lock Global-Auto-Revert Global-Company
Global-Eldoc Global-Font-Lock Global-Hl-Line Global-Hungry-Delete
Global-Linum Hungry-Delete Ivy Line-Number Linum Menu-Bar Mouse-Wheel
Popwin Recentf Show-Paren Smartparens Smartparens-Global Tooltip
Transient-Mark

调用后:
Enabled minor modes: Abbrev Auto-Composition Auto-Compression
Auto-Encryption Blink-Cursor Company Delete-Selection Diff-Auto-Refine
Electric-Indent File-Name-Shadow Font-Lock Global-Auto-Revert
Global-Company Global-Eldoc Global-Font-Lock Global-Hl-Line
Global-Hungry-Delete Global-Linum Hungry-Delete Ivy Line-Number Linum
Menu-Bar Mouse-Wheel Popwin Recentf Show-Paren Smartparens
Smartparens-Global Tooltip Transient-Mark

@ghost
Copy link

ghost commented Apr 19, 2016

@ziyuanjun 我觉得你也需要检查下配置文件诶 一句句敲可能会敲错的,之前我全部都是自己敲的然后发现不对的时候就直接拷贝粘贴师傅的配置,然后就好了... @zilongshanren 师傅,我回 S 国了,可以更新文字版啦。

@zilongshanren
Copy link
Member

@li-xinyang 上周的视频我这周末补上,上周比较忙,没有来得及录。

@zilongshanren
Copy link
Member

@ziyuanjun

在你的配置里面添加 : (setq only-global-abbrevs t) 就好了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants