From: Kevin Harriss <special.kevin@gmail.com>
Subject: using custom emacs abbreviations
Date: Fri, 10 Nov 2006 00:09:36 -0600 [thread overview]
Message-ID: <1163138976.25107.18.camel@localhost.localdomain> (raw)
I am wanting to use a set of custom abbreviation in python-mode for
emacs. The layout for my files I have is follows a ~/.emacs,
~/.emacs-dir/abbrevs.el, ~/.emacs-dir/recipe-abbrevs.el. I will post
the contents of those files below. When I open a python file with emacs
it says that it loads recipe-abbrevs.el but when I do M-x list-abbrevs
it only shows the default abbrevs with python-mode, so my custom abbrevs
are not being loaded.
=== ~/.emacs ===
(setq-default abbrev-mode t)
(setq save-abbrevs t)
(setq abbrev-file-name "~/.emacs-dir/abbrevs.el")
(if (file-readable-p abbrev-file-name)
(read-abbrev-file abbrev-file-name))
(setq auto-mode-alist
(append
'(
("\\.recipe$" . python-mode)
("\\.py$" . python-mode)
) auto-mode-alist))
(add-hook 'python-mode-hook
'(lambda()
(load-file "~/.emacs-dir/recipe-abbrevs.el")))
=== ~/.emacs-dir/abbrevs.el ===
(define-abbrev-table 'text-mode-abbrev-table '(
("\\a" "\alpha" nil 0)
("\\auto" "" recipe-abbrev-auto 0)
)
)
=== ~/.emacs-dir/recipe-abbrevs.el ===
(defun smart-space()
(interactive)
(if (not (expand-abbrev))
(insert " ")
)
)
(local-set-key [(space)] 'smart-space)
(defun recipe-abbrevs-auto ()
(interactive)
(insert "class (AutoPackageRecipe):")
)
Thanks,
Kevin
next reply other threads:[~2006-11-10 6:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-10 6:09 Kevin Harriss [this message]
[not found] <mailman.392.1163138841.2155.help-gnu-emacs@gnu.org>
2006-11-10 16:05 ` using custom emacs abbreviations Malte Spiess
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1163138976.25107.18.camel@localhost.localdomain \
--to=special.kevin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.