diff options
author | Karoly Lorentey <lorentey@elte.hu> | 2004-02-02 19:19:08 +0000 |
---|---|---|
committer | Karoly Lorentey <lorentey@elte.hu> | 2004-02-02 19:19:08 +0000 |
commit | d3a6748c5b378a86fc8408222c7dd26e47218af9 (patch) | |
tree | 33f9334088634447425b8c926dd45d1e83fa80e2 /lisp/emacs-lisp/lisp.el | |
parent | 465fc071a1aa48e87f37bff460410eec921eaa53 (diff) | |
parent | d83a97ab5fbcde063e4a87042cd721a23f13fbe0 (diff) | |
download | emacs-d3a6748c5b378a86fc8408222c7dd26e47218af9.tar.gz emacs-d3a6748c5b378a86fc8408222c7dd26e47218af9.tar.bz2 emacs-d3a6748c5b378a86fc8408222c7dd26e47218af9.zip |
Merged in changes from CVS HEAD
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-57
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-58
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-59
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-60
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-61
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-62
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-63
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-64
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-65
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-66
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-67
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-68
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-69
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-71
Diffstat (limited to 'lisp/emacs-lisp/lisp.el')
-rw-r--r-- | lisp/emacs-lisp/lisp.el | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 7f059d3f99f..4d90abd9f4e 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -188,7 +188,8 @@ If variable `beginning-of-defun-function' is non-nil, its value is called as a function to find the defun's beginning." (interactive "p") (if beginning-of-defun-function - (funcall beginning-of-defun-function) + (dotimes (i (or arg 1)) + (funcall beginning-of-defun-function)) (and arg (< arg 0) (not (eobp)) (forward-char 1)) (and (re-search-backward (if defun-prompt-regexp (concat (if open-paren-in-column-0-is-defun-start @@ -219,7 +220,8 @@ If variable `end-of-defun-function' is non-nil, its value is called as a function to find the defun's end." (interactive "p") (if end-of-defun-function - (funcall end-of-defun-function) + (dotimes (i (or arg 1)) + (funcall end-of-defun-function)) (if (or (null arg) (= arg 0)) (setq arg 1)) (let ((first t)) (while (and (> arg 0) (< (point) (point-max))) @@ -267,10 +269,14 @@ already marked." (end-of-defun) (point)))) (t + ;; Do it in this order for the sake of languages with nested + ;; functions where several can end at the same place as with + ;; the offside rule, e.g. Python. (push-mark (point)) - (end-of-defun) - (push-mark (point) nil t) (beginning-of-defun) + (push-mark (point) nil t) + (end-of-defun) + (exchange-point-and-mark) (re-search-backward "^\n" (- (point) 1) t)))) (defun narrow-to-defun (&optional arg) @@ -280,10 +286,13 @@ Optional ARG is ignored." (interactive) (save-excursion (widen) - (end-of-defun) - (let ((end (point))) - (beginning-of-defun) - (narrow-to-region (point) end)))) + ;; Do it in this order for the sake of languages with nested + ;; functions where several can end at the same place as with the + ;; offside rule, e.g. Python. + (beginning-of-defun) + (let ((beg (point))) + (end-of-defun) + (narrow-to-region beg (point))))) (defun insert-parentheses (arg) "Enclose following ARG sexps in parentheses. Leave point after open-paren. |