emacs-devel
[Top][All Lists]
Advanced

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

Re: beginning-of-defun (again)


From: Andreas Röhler
Subject: Re: beginning-of-defun (again)
Date: Thu, 29 Oct 2015 13:11:38 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4

 On 29.10.2015 12:52, Oleh Krehel wrote:
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.


Unfortunatly not. When started from inside a string, which has an open paren at column 0, the default will stop there.
Try from "bar":

(defun foo ()
  (insert "
(bar)"))

open-paren-in-column-0-is-defun-start
It's a strange variable that doesn't seem to do anything.  The only
relevant setting is 0 or non-zero (the default). Setting it to 0 seems
to do nothing. Maybe someone could explain what it actually does.

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.

Modes should honor the syntax, not impose conventions.

  And there's
nothing else that makes "(" be on a new line, except for rare cases

There is a plenty of rare cases, notably when meta-programming, i.e. if code is delivered by strings for insertion.

in
docstrings, where it can be escaped.  So it seems that the problem is
already solved in a good way, without having to customize anything.

     Oleh




reply via email to

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