X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/ff2ed6c7f7e6be21ed9ab2d454de08fc8a5d66b8..d21fc79671899d088bd7de78a4c96a5193ff6def:/lisp/tempo.el diff --git a/lisp/tempo.el b/lisp/tempo.el index 8e290222cb..004e128a32 100644 --- a/lisp/tempo.el +++ b/lisp/tempo.el @@ -1,8 +1,8 @@ ;;; tempo.el --- Flexible template insertion -;; Copyright (C) 1994, 1995 Free Software Foundation, Inc. +;; Copyright (C) 1994, 1995, 2004 Free Software Foundation, Inc. -;; Author: David K}gedal +;; Author: David K}gedal ;; Created: 16 Feb 1994 ;; K}gedal's last version number: 1.2.4 ;; Keywords: extensions, languages, tools @@ -21,8 +21,8 @@ ;; 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., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -107,8 +107,6 @@ ;;; Code: -;; (provide 'tempo) - ;;; User options (defgroup tempo nil @@ -127,7 +125,7 @@ user for text to insert in the templates" "*Automatically insert current region when there is a `r' in the template If this variable is nil, `r' elements will be treated just like `p' elements, unless the template function is given a prefix (or a non-nil -argument). If this variable is non-nil, the behaviour is reversed. +argument). If this variable is non-nil, the behavior is reversed. In Transient Mark mode, this option is unused." :type 'boolean @@ -174,7 +172,7 @@ documentation for the function `tempo-complete-tag' for more info. (defvar tempo-marks nil "A list of marks to jump to with `\\[tempo-forward-mark]' and `\\[tempo-backward-mark]'.") -(defvar tempo-match-finder "\\b\\([^\\b]+\\)\\=" +(defvar tempo-match-finder "\\b\\([[:word:]]+\\)\\=" "The regexp or function used to find the string to match against tags. If `tempo-match-finder is a string, it should contain a regular @@ -184,7 +182,7 @@ the string between the first \\( and \\) is used for matching against each string in the tag list. If one is found, the whole text between the first \\( and the point is replaced with the inserted template. -You will probably want to include \\ \= at the end of the regexp to +You will probably want to include \\=\\= at the end of the regexp to make sure that the string is matched only against text adjacent to the point. @@ -281,7 +279,7 @@ The elements in ELEMENTS can be of several types: (command-name template-name)) (set template-name elements) (fset command-name (list 'lambda (list '&optional 'arg) - (or documentation + (or documentation (concat "Insert a " name ".")) (list 'interactive "*P") (list 'tempo-insert-template (list 'quote @@ -305,7 +303,7 @@ mode, ON-REGION is ignored and assumed true if the region is active." (if (or (and (boundp 'transient-mark-mode) ; For Emacs transient-mark-mode mark-active) - (and (boundp 'zmacs-regions) ; For XEmacs + (if (featurep 'xemacs) zmacs-regions (mark))) (setq on-region t)) (and on-region @@ -542,7 +540,7 @@ and insert the results." (setq lp (cdr lp))) (if (not (= mark (car lp))) (setcdr lp (cons mark (cdr lp)))))))) - + ;;; ;;; tempo-forward-mark @@ -579,7 +577,7 @@ and insert the results." last)))) (if prev-mark (goto-char prev-mark)))) - + ;;; ;;; tempo-add-tag @@ -757,4 +755,5 @@ space bar, and looks something like this: (provide 'tempo) +;;; arch-tag: b3c0ee36-db3b-47bc-875f-091b4e27a063 ;;; tempo.el ends here