Mercurial > hg > xemacs-beta
diff 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 |
line wrap: on
line diff
--- a/lisp/lisp.el Wed Sep 30 21:15:04 2009 +0200 +++ b/lisp/lisp.el Wed Sep 30 21:17:24 2009 +0200 @@ -190,17 +190,17 @@ This is identical to beginning-of-defun, except that point does not move to the beginning of the line when `defun-prompt-regexp' is non-nil." (interactive "p") - ;; (and arg (< arg 0) (not (eobp)) (forward-char 1)) (unless arg (setq arg 1)) - (cond - (beginning-of-defun-function - (funcall beginning-of-defun-function arg)) - (t (re-search-backward (if defun-prompt-regexp - (concat "^\\s(\\|" - "\\(" defun-prompt-regexp "\\)\\s(") - "^\\s(") - nil 'move (or arg 1)) - (progn (goto-char (1- (match-end 0)))) t))) + (if beginning-of-defun-function + (funcall beginning-of-defun-function arg) + (and (< arg 0) (not (eobp)) (forward-char 1)) + (and + (re-search-backward (if defun-prompt-regexp + (concat "^\\s(\\|" + "\\(" defun-prompt-regexp "\\)\\s(") + "^\\s(") + nil 'move arg) + (progn (goto-char (1- (match-end 0)))) t))) ;; XEmacs change (optional buffer parameter) (defun buffer-end (arg &optional buffer)