From 4fe4a30c1ae5853f7bfcd91dc6ea1dfb603139d5 Mon Sep 17 00:00:00 2001 From: Pierre Courtieu Date: Thu, 19 Feb 2004 14:09:14 +0000 Subject: added submenus for command insertion for coq. menu uses abbrev expansion to build holes. --- generic/holes.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'generic') diff --git a/generic/holes.el b/generic/holes.el index ab68925f..aefa519c 100644 --- a/generic/holes.el +++ b/generic/holes.el @@ -841,10 +841,16 @@ created" (count-holes-in-last-expand) empty-hole-string) ) +; insert the expansion of abbrev s, and replace #s by holes. It was +; possible to implement it with a simple ((insert s) (expand-abbrev)) +; but undo would show the 2 steps, which is bad. (defun insert-and-expand (s) - (insert s) - (expand-abbrev) + (let* ((exp (abbrev-expansion s)) + (c (count-char-in-string empty-hole-string exp))) + (insert exp) + (replace-string-by-holes-backward-move-point c empty-hole-string) + ) ) (provide 'holes) -- cgit v1.2.3