emacs-devel
[Top][All Lists]
Advanced

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

Re: beginning-of-defun (again)


From: David Kastrup
Subject: Re: beginning-of-defun (again)
Date: Thu, 29 Oct 2015 13:03:34 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

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?

> The only relevant setting is 0 or non-zero (the default).

Huh?!?  The only relevant settings are nil and non-nil.

> Setting it to 0 seems to do nothing. Maybe someone could explain what
> it actually does.

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

   "This is a string and it continues
(on the next line..."

or

(list
(missing-indentation

or something like that.

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

> And there's nothing else that makes "(" be on a new line, except for
> rare cases in docstrings, where it can be escaped.

In Elisp perhaps, but that variable is equally valid in Scheme.  And
rewrapping a comment string might move a ( to the start of a line
without auto-escaping it in the process.  Though the frequency of this
happening to me when editing Scheme files has decreased to a degree
where I suspect Emacs to be actively avoiding it these days.

> So it seems that the problem is already solved in a good way, without
> having to customize anything.

-- 
David Kastrup



reply via email to

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