[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Useless change in lisp.el?
From: |
Andreas Röhler |
Subject: |
Re: Useless change in lisp.el? |
Date: |
Mon, 26 Nov 2007 19:14:34 +0100 |
User-agent: |
KMail/1.9.5 |
Am Montag, 26. November 2007 16:09 schrieben Sie:
> > -The function (of no args) should go to the line on which the current
> > -defun starts, and return non-nil, or should return nil if it can't
> > -find the beginning.")
> > +The function takes the same argument as `beginning-of-defun' and should
> > +behave similarly, returning non-nil if it found the beginning of a
> > defun. +Ideally it should move to a point right before an open-paren
> > which encloses +the body of the defun.")
> >
> > As `beginning-of-defun-function' expressivly is
> > introduced for all possible function definitions, it
> > makes no sence to require or even to mention an open
> > paren.
>
> Sure it does: end-of-defun does basically
> "(progn (beginning-of-defun-raw) (forward-sexp)", so if
> beginning-of-defun-function stops right before an "open paren",
> end-of-defun will do the right thing. Otherwise, the programmer will
> have to supply his own end-of-defun-function.
I read here
(and (beginning-of-defun-raw arg)
(progn (beginning-of-line) t)))
where `beginning-of-line' would be the part in
question. As `beginning-of-line' comes after
customized `beginning-of-defun-function' it must not be
the right thing. But that's another question.
Should you not cling to much to that disputed change
and no one else defends it, I would appreciate much
seeing it reverted.
Andreas Röhler
> Note that since
> forward-sexp can be customized with forward-sexp-function, the notion of
> "open paren" may include things like "begin...end".
>
> [ Yes, I know end-of-defun currently doesn't always use forward-sexp,
> I'm working on fixing that. ]
>
> If you see how to improve the doc to make this more clear, patches
> are welcome.
>
> > Other languages are completely free to design function
> > definitions. Emacs should be able to follow them without specifying
> > things no one may know at this time.
>
> Indeed. I did not write that the function *must* do it, just that it
> should ideally do that.
>
> > Too I pointed just these days at the fact, `beginning-of-defun' will
> > be understood as top-level-form here rather than strictly
> > a function-beginning.
>
> Agreed. I tried to keep this in mind when writing the above text, but
> again, if you see a way to make it more clear, go for it.
>
> > + ;; we used to use end-of-defun for that, but it's not supposed to do
> > + ;; the same thing (it moves to the end of a defun not to the
> > beginning + ;; of the next).
> >
> > That's not the case.
>
> Yes it is: try it in elisp-mode (with enough empty lines between defuns
> that the difference caqn be noticed, of course).
>
> > As `beginning-of-defun-function' together with `end-of-defun-function'
> > are freely to design, progmodes could do that at their will.
>
> No: end-of-defun can't know that it's called by beginning-of-defun.
>
>
> Stefan