-;;; skeleton.el --- Lisp language extension for writing statement skeletons
+;;; skeleton.el --- Lisp language extension for writing statement skeletons -*- coding: utf-8 -*-
;; Copyright (C) 1993, 1994, 1995, 1996, 2001, 2002, 2003,
-;; 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
;; Author: Daniel Pfeiffer <occitan@esperanto.org>
;; Maintainer: FSF
;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
interesting point set by _
> indent line (or interregion if > _) according to major mode
@ add position to `skeleton-positions'
- & do next ELEMENT iff previous moved point
- | do next ELEMENT iff previous didn't move point
+ & do next ELEMENT if previous moved point
+ | do next ELEMENT if previous didn't move point
-num delete num preceding characters (see `skeleton-untabify')
resume: skipped, continue here if quit is signaled
nil skipped
(defun skeleton-internal-1 (element &optional literal recursive)
(cond
- ((char-or-string-p element)
+ ((or (integerp element) (stringp element))
(if (and (integerp element) ; -num
(< element 0))
(if skeleton-untabify
(defvar skeleton-pair-alist ()
- "An override alist of pairing partners matched against `last-command-char'.
+ "An override alist of pairing partners matched against `last-command-event'.
Each alist element, which looks like (ELEMENT ...), is passed to
`skeleton-insert' with no interactor. Variable `str' does nothing.
(?[ _ ?]) (?\])
(?{ _ ?}) (?\})
(?< _ ?>) (?\>)
- (?« _ ?») (?\»)
+ (?« _ ?») (?\»)
(?` _ ?')))
;;;###autoload
(or (eq last-command 'mouse-drag-region)
(and transient-mark-mode mark-active))))
(skeleton-end-hook)
- (char last-command-char)
+ (char last-command-event)
(skeleton (or (assq char skeleton-pair-alist)
(assq char skeleton-pair-default-alist)
`(,char _ ,char))))
\f
;; A more serious example can be found in sh-script.el
-;;; (defun mirror-mode ()
+;; (defun mirror-mode ()
;; "This major mode is an amusing little example of paired insertion.
;;All printable characters do a paired self insert, while the other commands
;;work normally."
(provide 'skeleton)
-;;; arch-tag: ccad7bd5-eb5d-40de-9ded-900197215c3e
+;; arch-tag: ccad7bd5-eb5d-40de-9ded-900197215c3e
;;; skeleton.el ends here