Mercurial > emacs
comparison lisp/emacs-lisp/easy-mmode.el @ 52881:a2ef3d8f83d4
(easy-mmode-define-navigation): Avoid
incf in macro expansion.
author | Dave Love <fx@gnu.org> |
---|---|
date | Mon, 20 Oct 2003 19:05:51 +0000 |
parents | 695cf19ef79e |
children | a9d324df91c7 |
comparison
equal
deleted
inserted
replaced
52880:9417a94488d3 | 52881:a2ef3d8f83d4 |
---|---|
1 ;;; easy-mmode.el --- easy definition for major and minor modes | 1 ;;; easy-mmode.el --- easy definition for major and minor modes |
2 | 2 |
3 ;; Copyright (C) 1997, 2000, 2001, 2003 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1997, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: Georges Brun-Cottan <Georges.Brun-Cottan@inria.fr> | 5 ;; Author: Georges Brun-Cottan <Georges.Brun-Cottan@inria.fr> |
6 ;; Maintainer: Stefan Monnier <monnier@gnu.org> | 6 ;; Maintainer: Stefan Monnier <monnier@gnu.org> |
7 | 7 |
8 ;; Keywords: extensions lisp | 8 ;; Keywords: extensions lisp |
438 (defun ,next-sym (&optional count) | 438 (defun ,next-sym (&optional count) |
439 ,(format "Go to the next COUNT'th %s." name) | 439 ,(format "Go to the next COUNT'th %s." name) |
440 (interactive) | 440 (interactive) |
441 (unless count (setq count 1)) | 441 (unless count (setq count 1)) |
442 (if (< count 0) (,prev-sym (- count)) | 442 (if (< count 0) (,prev-sym (- count)) |
443 (if (looking-at ,re) (incf count)) | 443 (if (looking-at ,re) (setq count (1+ count))) |
444 (if (not (re-search-forward ,re nil t count)) | 444 (if (not (re-search-forward ,re nil t count)) |
445 (if (looking-at ,re) | 445 (if (looking-at ,re) |
446 (goto-char (or ,(if endfun `(,endfun)) (point-max))) | 446 (goto-char (or ,(if endfun `(,endfun)) (point-max))) |
447 (error "No next %s" ,name)) | 447 (error "No next %s" ,name)) |
448 (goto-char (match-beginning 0)) | 448 (goto-char (match-beginning 0)) |