diff options
| author | Pierre Courtieu | 2004-02-19 14:09:14 +0000 |
|---|---|---|
| committer | Pierre Courtieu | 2004-02-19 14:09:14 +0000 |
| commit | 4fe4a30c1ae5853f7bfcd91dc6ea1dfb603139d5 (patch) | |
| tree | e931e27e39da2e90444a1a6fc4ffb96ba36f82df /generic | |
| parent | acc38950cbf229bc6cdc1cc38138762b219e7b1a (diff) | |
added submenus for command insertion for coq. menu uses abbrev
expansion to build holes.
Diffstat (limited to 'generic')
| -rw-r--r-- | generic/holes.el | 10 |
1 files changed, 8 insertions, 2 deletions
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) |
