Mercurial > hg > xemacs-beta
comparison lisp/lisp.el @ 4705:7b90173970ad
Unbreak `beginning-of-defun'.
2009-09-30 Mike Sperber <mike@xemacs.org>
* lisp.el (beginning-of-defun-raw): Unbreak; clean up sloppy
coding.
author | Mike Sperber <sperber@deinprogramm.de> |
---|---|
date | Wed, 30 Sep 2009 21:17:24 +0200 |
parents | ecc468b62551 |
children | a46d7513a364 |
comparison
equal
deleted
inserted
replaced
4704:44c9d1005ce2 | 4705:7b90173970ad |
---|---|
188 (defun beginning-of-defun-raw (&optional arg) | 188 (defun beginning-of-defun-raw (&optional arg) |
189 "Move point to the character that starts a defun. | 189 "Move point to the character that starts a defun. |
190 This is identical to beginning-of-defun, except that point does not move | 190 This is identical to beginning-of-defun, except that point does not move |
191 to the beginning of the line when `defun-prompt-regexp' is non-nil." | 191 to the beginning of the line when `defun-prompt-regexp' is non-nil." |
192 (interactive "p") | 192 (interactive "p") |
193 ;; (and arg (< arg 0) (not (eobp)) (forward-char 1)) | |
194 (unless arg (setq arg 1)) | 193 (unless arg (setq arg 1)) |
195 (cond | 194 (if beginning-of-defun-function |
196 (beginning-of-defun-function | 195 (funcall beginning-of-defun-function arg) |
197 (funcall beginning-of-defun-function arg)) | 196 (and (< arg 0) (not (eobp)) (forward-char 1)) |
198 (t (re-search-backward (if defun-prompt-regexp | 197 (and |
199 (concat "^\\s(\\|" | 198 (re-search-backward (if defun-prompt-regexp |
200 "\\(" defun-prompt-regexp "\\)\\s(") | 199 (concat "^\\s(\\|" |
201 "^\\s(") | 200 "\\(" defun-prompt-regexp "\\)\\s(") |
202 nil 'move (or arg 1)) | 201 "^\\s(") |
203 (progn (goto-char (1- (match-end 0)))) t))) | 202 nil 'move arg) |
203 (progn (goto-char (1- (match-end 0)))) t))) | |
204 | 204 |
205 ;; XEmacs change (optional buffer parameter) | 205 ;; XEmacs change (optional buffer parameter) |
206 (defun buffer-end (arg &optional buffer) | 206 (defun buffer-end (arg &optional buffer) |
207 "Return `point-max' of BUFFER if ARG is > 0; return `point-min' otherwise. | 207 "Return `point-max' of BUFFER if ARG is > 0; return `point-min' otherwise. |
208 BUFFER defaults to the current buffer if omitted." | 208 BUFFER defaults to the current buffer if omitted." |