[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lispref/abbrevs.texi [emacs-unicode-2]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lispref/abbrevs.texi [emacs-unicode-2] |
Date: |
Fri, 23 Jul 2004 00:47:06 -0400 |
Index: emacs/lispref/abbrevs.texi
diff -c emacs/lispref/abbrevs.texi:1.16.2.1 emacs/lispref/abbrevs.texi:1.16.2.2
*** emacs/lispref/abbrevs.texi:1.16.2.1 Mon Apr 19 07:01:40 2004
--- emacs/lispref/abbrevs.texi Fri Jul 23 04:30:39 2004
***************
*** 335,344 ****
@end defvar
The following sample code shows a simple use of
! @code{pre-abbrev-expand-hook}. If the user terminates an abbrev with a
! punctuation character, the hook function asks for confirmation. Thus,
! this hook allows the user to decide whether to expand the abbrev, and
! aborts expansion if it is not confirmed.
@smallexample
(add-hook 'pre-abbrev-expand-hook 'query-if-not-space)
--- 335,343 ----
@end defvar
The following sample code shows a simple use of
! @code{pre-abbrev-expand-hook}. If the user terminates an abbrev with
! a punctuation character, the hook function asks for confirmation. It
! aborts expansion if the user does not confirm.
@smallexample
(add-hook 'pre-abbrev-expand-hook 'query-if-not-space)
***************
*** 350,361 ****
;; @r{user entered some other character, this function asks whether}
;; @r{expansion should continue.}
! ;; @r{If the user answers the prompt with @kbd{y}, the function returns}
! ;; @address@hidden (because of the @code{not} function), but that is}
! ;; @r{acceptable; the return value has no effect on expansion.}
(defun query-if-not-space ()
! (if (/= ?\s (preceding-char))
(if (not (y-or-n-p "Do you want to expand this abbrev? "))
(error "Not expanding this abbrev"))))
@end smallexample
--- 349,358 ----
;; @r{user entered some other character, this function asks whether}
;; @r{expansion should continue.}
! ;; @r{The function's return value makes no difference.}
(defun query-if-not-space ()
! (if (/= ?\s last-command-char)
(if (not (y-or-n-p "Do you want to expand this abbrev? "))
(error "Not expanding this abbrev"))))
@end smallexample
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lispref/abbrevs.texi [emacs-unicode-2],
Miles Bader <=