emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Abbrev tables in elisp with some extra stuff


From: Andreas Röhler
Subject: Re: Abbrev tables in elisp with some extra stuff
Date: Mon, 15 Oct 2007 20:04:51 +0200
User-agent: KMail/1.9.5

Am Montag, 15. Oktober 2007 18:04 schrieb Richard Stallman:
>     BTW: when doing translations it might be of interest to
>     expand the word/phrase after point instead before.
>
> I would rather not add a feature solely for the goal of maximum generality.
> So let's leave this out.
>

It's not for the sake of generalisation. Below a first
draft and example --with some explanation for the less
experienced--:

Put these definitions at the right place in your
.abbrev_defs, M-x read-abbrev-file,

evaluate the function, put the cursor at the beginning
of the example sentence below:

The first call of `expand-abbrev-after-point' should
deliver "No expansion available" - because no
translation/abbreviation was defined. But the cursor
moved and with repeated calls that sentence is
translated word by word.

("is" "ist" nil 0) 
("the" "der" nil 0) 
("extensible" "erweiterbare" nil 0) 
("customizable" "einrichtbare" nil 0) 
("self-documenting" "selbsterklärende" nil 0) 
("real-time" "Echtzeit" nil 0) 
("display" "Display" nil 0) 
("editor" "Editor" nil 0) 

(defun expand-abbrev-after-point ()
  "Expand abbrev after point if any. "
  (interactive "*")
  (forward-word 1)
  (or (expand-abbrev)
      (message "%s" "No translation available")))

Emacs is the extensible, customizable, self-documenting real-time display 
editor.  

Grüße

Andreas Röhler




reply via email to

[Prev in Thread] Current Thread [Next in Thread]