[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
beginning-of-defun
From: |
Andreas Roehler |
Subject: |
beginning-of-defun |
Date: |
Sat, 08 Jul 2006 12:23:25 +0200 |
User-agent: |
Thunderbird 1.5.0.4 (X11/20060516) |
Problems with (beginning-of-defun):
Cursor at roof-sign
(when t
(defun foo ()
" "
(interactive)
(message "%s" "baz")))
^
M-x beginning-of-defun
==>
(when t
^ (defun foo ()
" "
(interactive)
(message "%s" "baz")))
Wrong, as at the start of the enclosing form.
Set `defun-prompt-regexp' via customize at
[ \t]*
(when t
(defun foo ()
" "
(interactive)
(message "%s" "baz")))
^
M-x beginning-of-defun
==>
(when t
(defun foo ()
" "
(interactive)
(message "%s" "baz")))
^
Also wrong: cursor at the beginning of line now.
The reason seems the conception of the variable
`defun-prompt-regexp' which solely takes spaces before the defuns
beginning in consideration.
It could be avoided, if this var would take instead of
`a regexp to ignore before a defun'
a regexp `describing the beginning of a defun'
Then we could specify "[ \t]*(defun" for example in Emacs Lisp
mode and it would not fail if we are inside a defun or just after
it already.
__
Andreas Roehler
- beginning-of-defun,
Andreas Roehler <=