all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* abbrev-mode can't work in python-mode
@ 2013-11-11  9:09 Yu Yang
  2013-11-11 15:43 ` Andreas Röhler
  0 siblings, 1 reply; 3+ messages in thread
From: Yu Yang @ 2013-11-11  9:09 UTC (permalink / raw)
  To: help-gnu-emacs

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

> (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")
>     ))
>
but it can't work correctly. for example, if I input "isettings" 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.if I change
*python-mode-abbrev-table
*to *sh-mode-abbrev-table*, then in a shell script source file , emacs can
expand the "isettings" correctly. so I think there is something wrong with
pyhon-mode.my emacs version is 24.3. os is linux mint 15. Does Anyone has
similar problem?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: abbrev-mode can't work in python-mode
  2013-11-11  9:09 abbrev-mode can't work in python-mode Yu Yang
@ 2013-11-11 15:43 ` Andreas Röhler
       [not found]   ` <CAHvdkjgMhx8EEUnQOU1DMEWM9hFA65g1tCpP-kU+c5XxqbCZug@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Röhler @ 2013-11-11 15:43 UTC (permalink / raw)
  To: help-gnu-emacs

Am 11.11.2013 10:09, schrieb Yu Yang:
> I have defined some abbreviations for python mode by using code like this
>
>> (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")
>>      ))
>>
> but it can't work correctly. for example, if I input "isettings" 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.if I change
> *python-mode-abbrev-table
> *to *sh-mode-abbrev-table*, then in a shell script source file , emacs can
> expand the "isettings" correctly. so I think there is something wrong with
> pyhon-mode.my emacs version is 24.3. os is linux mint 15. Does Anyone has
> similar problem?
>

If you do M-x edit-abbrevs RET, what is the result?
Do you see the abbrevs defined previously?



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: abbrev-mode can't work in python-mode
       [not found]   ` <CAHvdkjgMhx8EEUnQOU1DMEWM9hFA65g1tCpP-kU+c5XxqbCZug@mail.gmail.com>
@ 2013-11-12  7:15     ` Andreas Röhler
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Röhler @ 2013-11-12  7:15 UTC (permalink / raw)
  To: Yu Yang; +Cc: help-gnu-emacs@gnu.org List

Am 12.11.2013 03:15, schrieb Yu Yang:
> yes. the result is :
>
> (python-mode-abbrev-table)
>
> "class" (sys)       0 ""                     python-skeleton-class
> "def" (sys)         0 ""                     python-skeleton-def
> "for" (sys)         0 ""                     python-skeleton-for
> "if" (sys)          0 ""                     python-skeleton-if
> "iform"        0    "from django import forms"
> "imodel"       0    "from django.db import models"
> "irequestcontext" 0 "from django.template import RequestContext"
> "isettings"    0    "from django.conf import settings"
>
>

Okay.

M-x expand-abbrev RET does it here with your code,
while SPACE, which should expand also, fails.

Looks like a bug for me.

GNU Emacs 24.3.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.10) of 2013-07-06




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-11-12  7:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-11  9:09 abbrev-mode can't work in python-mode Yu Yang
2013-11-11 15:43 ` Andreas Röhler
     [not found]   ` <CAHvdkjgMhx8EEUnQOU1DMEWM9hFA65g1tCpP-kU+c5XxqbCZug@mail.gmail.com>
2013-11-12  7:15     ` Andreas Röhler

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.