* Trying to set an abbreviation in a custom mode
@ 2008-12-08 2:40 Davin Pearson
2008-12-08 6:03 ` Ian Eure
[not found] ` <mailman.2197.1228716190.26697.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 5+ messages in thread
From: Davin Pearson @ 2008-12-08 2:40 UTC (permalink / raw)
To: help-gnu-emacs
I tried the following code to get "sop" as an abbreviation for
"System.out.println" in a custom mode but it doesn't appear to work:
(define-abbrev global-abbrev-table "sop" "System.out.println(")
Another alternative would be for me to import java-mode-abbrev-table
into the current mode. Any hints on how to do this?
Here is my version info (from M-x report-emacs-bug)
In GNU Emacs 22.2.1 (i386-mingw-nt5.1.2600)
of 2008-03-27 on RELEASE
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4)'
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Trying to set an abbreviation in a custom mode
2008-12-08 2:40 Trying to set an abbreviation in a custom mode Davin Pearson
@ 2008-12-08 6:03 ` Ian Eure
[not found] ` <mailman.2197.1228716190.26697.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 5+ messages in thread
From: Ian Eure @ 2008-12-08 6:03 UTC (permalink / raw)
To: Davin Pearson; +Cc: help-gnu-emacs, Mike Ashmore
On Dec 7, 2008, at 6:40 PM, Davin Pearson wrote:
> I tried the following code to get "sop" as an abbreviation for
> "System.out.println" in a custom mode but it doesn't appear to work:
>
> (define-abbrev global-abbrev-table "sop" "System.out.println(")
>
If you enable abbrev-mode in your buffer, you get bindings to define
abbrevs:
C-x a l - `add-mode-abbrev' (define abbrev for sexp at point)
C-x a i l - `inverse-add-mode-abbrev' (define expansion for sexp at
point)
- Ian
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Trying to set an abbreviation in a custom mode
[not found] ` <mailman.2197.1228716190.26697.help-gnu-emacs@gnu.org>
@ 2008-12-08 9:51 ` Davin Pearson
2008-12-08 9:57 ` Davin Pearson
0 siblings, 1 reply; 5+ messages in thread
From: Davin Pearson @ 2008-12-08 9:51 UTC (permalink / raw)
To: help-gnu-emacs
On Dec 8, 7:03 pm, Ian Eure <i...@digg.com> wrote:
> C-x a l - `add-mode-abbrev' (define abbrev for sexp at point)
> C-x a i l - `inverse-add-mode-abbrev' (define expansion for sexp at
> point)
This is not helpful because I want to add the abbreviation
programmatically, that is to say automatically every time I run Emacs.
C-h f add-mode-abbrev says:
Don't use this function in a Lisp program; use `define-abbrev'
instead.
I am stuck because I don't know how to get java-mode-abbrev-table into
my custom mode.
Please help me!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Trying to set an abbreviation in a custom mode
2008-12-08 9:51 ` Davin Pearson
@ 2008-12-08 9:57 ` Davin Pearson
2008-12-09 14:22 ` Kevin Rodgers
0 siblings, 1 reply; 5+ messages in thread
From: Davin Pearson @ 2008-12-08 9:57 UTC (permalink / raw)
To: help-gnu-emacs
On Dec 8, 10:51 pm, Davin Pearson <davin.pear...@gmail.com> wrote:
> I am stuck because I don't know how to get java-mode-abbrev-table into
> my custom mode.
I get it.. you need to call (abbrev-mode) to define the abbrev minor
mode.
Thanx for your help anyway.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Trying to set an abbreviation in a custom mode
2008-12-08 9:57 ` Davin Pearson
@ 2008-12-09 14:22 ` Kevin Rodgers
0 siblings, 0 replies; 5+ messages in thread
From: Kevin Rodgers @ 2008-12-09 14:22 UTC (permalink / raw)
To: help-gnu-emacs
Davin Pearson wrote:
> On Dec 8, 10:51 pm, Davin Pearson <davin.pear...@gmail.com> wrote:
>> I am stuck because I don't know how to get java-mode-abbrev-table into
>> my custom mode.
>
> I get it.. you need to call (abbrev-mode) to define the abbrev minor
> mode.
Just to be safe: (abbrev-mode 1)
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-12-09 14:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-08 2:40 Trying to set an abbreviation in a custom mode Davin Pearson
2008-12-08 6:03 ` Ian Eure
[not found] ` <mailman.2197.1228716190.26697.help-gnu-emacs@gnu.org>
2008-12-08 9:51 ` Davin Pearson
2008-12-08 9:57 ` Davin Pearson
2008-12-09 14:22 ` Kevin Rodgers
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.