[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: simplifying beginning-of-defun

From: Stefan Monnier
Subject: Re: simplifying beginning-of-defun
Date: Mon, 28 Sep 2009 18:46:51 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

>> I was pointing out incompatibilities. 
> Can't see any. If you write
>>>> Apparently it makes beginning-of-defun-raw ignore
>>>> beginning-of-defun-function,
> it should do exactly that IMHO.

Maybe it should, maybe it shouuldn't.  My point is that it currently
does whereas in your patch it doesn't, so that's an incompatibility.
That doesn't mean it's a problem, just a place that requires
careful attention.

> Why not let modes say what they want and need? An argument must not mean a
> repeat BTW. In python-mode is a selection to deliver too.

end-of-defun's docstring says "With argument, do it that many times", so
if a major mode uses it for other purposes, it's abusing it.  It would
probably be better in such a case to just define a new command and remap
keys to that new command.

>>> Mentioned code of a end-of-defun-function in lisp.el is a bug.
>>> Suggest to cancel it.
>> I do not know which code nor which bug you talking about.  Your code?
>> Emacs's code?
> from GNU lisp.el.

> "(defvar end-of-defun-function
>   (lambda () ...."

> Giving it a value here, it will be called.  Which is
> to avoid, as only languages-modes should set and use it.

Who says?

> This setting reintroduces all the mess,
> beginning/end-of-defun-function are invented for.

I do not know what you're referring to.

>>> Funcalls of beginning-of-defun-function, end-of-defun-function should
>>> be reserved for progmodes.
>> I have no idea what you mean by "progmodes".
> Modes of other programming languages than emacs-lisp

Why would such a concept matter here?  emacs-lisp-mode should not be
treated specially.

>>> BTW if mode-specific, probably it should be introduced as a local var
>>> from the very beginning?
>> I'm not sure I understand.  Are you suggesting we
>> (make-varible-buffer-local 'beginning-of-defun-function)?
> Yes, that's the question. I.e it should be mode-specific, in any case
> not global.

It's definitely meant to be buffer-local.  That doesn't mean there
shouldn't be a meaningful default for those buffers which don't want to
bother to set it themselves.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]