changeset 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 44c9d1005ce2
children 7e79c8559ad1
files lisp/ChangeLog lisp/lisp.el
diffstat 2 files changed, 15 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Sep 30 21:15:04 2009 +0200
+++ b/lisp/ChangeLog	Wed Sep 30 21:17:24 2009 +0200
@@ -1,3 +1,8 @@
+2009-09-30  Mike Sperber  <mike@xemacs.org>
+
+	* lisp.el (beginning-of-defun-raw): Unbreak; clean up sloppy
+	coding.
+
 2009-09-28  Mike Sperber  <mike@xemacs.org>
 
 	* autoload.el (make-autoload): Only try to add arguments to
--- 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)