emacs-devel
[Top][All Lists]
Advanced

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

Re: simplifying beginning-of-defun


From: Andreas Roehler
Subject: Re: simplifying beginning-of-defun
Date: Tue, 29 Sep 2009 08:53:34 +0200
User-agent: Thunderbird 2.0.0.19 (X11/20081227)

Stefan Monnier wrote:
>>> 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.


Just did range things differently - and weeded out a little bit.

Maybe lets rest the issue for now. Should a bug report hit the matter. I'll
point you to it again.


> 
>> 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.

This docstring now belongs to the -raw function. (Or -intern, as I will
call it.) Thanks for the hint.



  It would
> probably be better in such a case to just define a new command and remap
> keys to that new command.
>

No need for such things. Everything should work as before,
but some bugs shall be gone. (Beside the GNU-push-mark case, but didn't 
encounter any
broken function from it for now)

>>>> 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.

Why not? Its a special mode and deserves its attention.


> 
>>>> 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.

Ok. So I introduce these forms still:

(make-variable-buffer-local 'beginning-of-defun-function)
(make-variable-buffer-local 'end-of-defun-function)

Thanks again

Andreas
> 
> 
>         Stefan
> 
> 
> 





reply via email to

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