emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: [Fwd: Re: beginning-of-defun]


From: Richard Stallman
Subject: Re: [Fwd: Re: beginning-of-defun]
Date: Sun, 16 Jul 2006 02:25:55 -0400

Thanks for starting to explore this issue.

Because it only finds `defun' calls, it fails to find other constructs
that define functions or macros.  Also, it would get rather confused
when dealing with top-level forms that don't define functions at all:
it just skips them.

The example suggests that this code avoids finding a match inside a
string, but in fact there is no code to check that.  It just checks
that the (defun doesn't follow any non-indentation and that it includes
a function name and argument list.

I think it would be more useful to specially recognize certain
top-level combining constructs, such as eval-when-compile and `when',
and treat their subforms as defuns.

    ;; The mode should set this, if possible
    (defcustom beginning-of-function-return-value t
      "Specify the return value if function succeeds: either t or the value 
    of point"
      :group 'lisp
        :type '(choice (const t)
               (sexp :tag "Return function" (point))))

I think that feature is unhelpful complexity.  It would be better to
have just one return value convention.  If the caller of
beginning-of-function wants the value of point, it can do (if
(beginning-of-function) (point))




reply via email to

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