GNU bug report logs - #17880
24.4.50; [FEATURE] abbrev with skeleton

Previous Next

Package: emacs;

Reported by: Leo Liu <sdl.web <at> gmail.com>

Date: Mon, 30 Jun 2014 01:12:02 UTC

Severity: wishlist

Found in version 24.4.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Leo Liu <sdl.web <at> gmail.com>
To: 17880 <at> debbugs.gnu.org
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: bug#17880: 24.4.50; [FEATURE] abbrev with skeleton
Date: Mon, 30 Jun 2014 09:10:58 +0800
I was looking for packages to obsolete and find this expand.el. The
skeleton DSL is certainly more powerful. Comments?

BTW, we should be able to extend skeleton to cover snippet.el or
whatever nicely. I mean snippet.el/yas-snippet.el might not be the one
we want to converge to.

=== modified file 'lisp/abbrev.el'
--- lisp/abbrev.el	2014-05-27 01:09:45 +0000
+++ lisp/abbrev.el	2014-06-30 01:02:15 +0000
@@ -776,7 +776,7 @@
   (let ((value abbrev))
     ;; If this abbrev has an expansion, delete the abbrev
     ;; and insert the expansion.
-    (when (stringp (symbol-value abbrev))
+    (cond ((stringp (symbol-value abbrev))
       (goto-char wordstart)
       ;; Insert at beginning so that markers at the end (e.g. point)
       ;; are preserved.
@@ -806,6 +806,9 @@
               ;; Change just that.
               (upcase-initials-region (point) (1+ (point)))
               (goto-char end))))))
+	  ((consp (symbol-value abbrev))
+	   (delete-char (- wordstart wordend))
+	   (skeleton-insert (symbol-value abbrev))))
     ;; Now point is at the end of the expansion and the beginning is
     ;; in last-abbrev-location.
     (when (symbol-function abbrev)




This bug report was last modified 3 years and 314 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.