emacs:abbrev-mode不能在python模式下工作 [英] emacs: abbrev-mode can't work in python-mode

查看:231
本文介绍了emacs:abbrev-mode不能在python模式下工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用这样的代码为python模式定义了一些缩写

I have defined some abbreviations for python mode by using code like this

(define-abbrev-table 'python-mode-abbrev-table
  '(
    ("i_settings" "from django.conf import settings")
    ("i_requestcontext" "from django.template import RequestContext")
    ("i_model" "from django.db import models")
    ("i_form" "from django import forms")
    ))

但它无法正常工作。例如,我输入i_settings然后输入一个空格,emacs不扩展到从django.conf导入设置。我已尝试所有配置禁用,但没有帮助。

but it can't work correctly. for example, I input "i_settings" then input a space, emacs doesn't expand to "from django.conf import settings". I have tried it with all configuration disabled, but no help.

推荐答案

似乎下划线 _ 正在阻止扩展。尝试相同的表而不使用下划线

It seems the underscore _ is preventing the expansion. Try the same table without underscores

(define-abbrev-table 'python-mode-abbrev-table
  '(
    ("isettings" "from django.conf import settings")
    ("irequestcontext" "from django.template import RequestContext")
    ("imodel" "from django.db import models")
    ("iform" "from django import forms")
    ))

,它将按预期工作。

这篇关于emacs:abbrev-mode不能在python模式下工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆