[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: beginning-of-defun (again)
From: |
Oleh Krehel |
Subject: |
Re: beginning-of-defun (again) |
Date: |
Thu, 29 Oct 2015 14:07:17 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
David Kastrup <address@hidden> writes:
> Oleh Krehel <address@hidden> writes:
>
>> Hi Andreas,
>>
>> Andreas Röhler <address@hidden> writes:
>>
>>> maybe it's time to have a reasonable default-behavior of
>>> beginning-of-defun in Emacs Lisp.
>>
>> I think it works pretty well as is.
>>
>>> open-paren-in-column-0-is-defun-start
>>
>> It's a strange variable that doesn't seem to do anything.
>
> Huh?
Please give an example then. I'm not able to see a difference when it's
unset.
>> The only relevant setting is 0 or non-zero (the default).
>
> Huh?!? The only relevant settings are nil and non-nil.
The only relevant use is:
if (!open_paren_in_column_0_is_defun_start)
{
find_start_value = BEGV;
find_start_value_byte = BEGV_BYTE;
goto found;
}
Note that it's not checked against Qnil. It may be that Qnil is
conveniently defined to be 0 though, I'm not sure.
> Speeds up syntax highlighting by giving it anchor points. If you
> encounter
>
> (
>
> in a file, that counts as the start of some list even without looking
> whether it might be part of something like
I see. I wonder what the speed-up factor is. For example in org.el.
>>> A function resp. top-level-form starts if the beginning of a list is
>>> followed by a respective keyword.
>>> The list of keywords being customizable seems a plus :)
>>
>> There's no reason for a defun to not start on a newline.
>
> But there's a reason for non-defuns to start on a newline.
I call these defuns anyway.