emacs-devel
[Top][All Lists]
Advanced

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

Re: sh-script beg-end of function


From: Andreas Röhler
Subject: Re: sh-script beg-end of function
Date: Sat, 24 Nov 2007 14:45:25 +0100
User-agent: KMail/1.9.5

Am Freitag, 23. November 2007 17:34 schrieb Stefan Monnier:
> >> replacement should be at least as good.  Most importantly: jumping to
> >> the end of a real function should jump to the closing "}".
> >
> > Not, if exists usually no closing "}" while writing. I prefer to
> > set closings last and manually - the reports I get then
> > are more valuable than possible savings before.
>
> The case where a function is not yet completed is the rare exception and
> shouldn't drive the decision as to what the main behavior should be.
>
> > Here a small diff to enable modes to set beginning-of-defun-function
> > without disturbing each other:
>
> They can (and should/must) already do that by using
> `make-local-variable'.  Grep for   beginning-of-defun-function in
> lisp/**/*.el to see how other modes do it.
>
> >> - the docstring of `comment-beginning' says "Find the beginning of the
> >> enclosing comment" so I'm wondering why you decided to use that in
> >> a context where you have no idea whether or not you're inside
> >> a comment.  Why don't you just use (forward-comment (- (point-max)))
> >
> > Thanks. Simply wasn't aware of that.
>
> That's odd: seeing your posts on this list, you clearly spent a fair bit
> of time dealing with `comment-beginning': 

Sure? Can you prove this? Or better let's come to more
serious questions: 

Indeed I stumbled over commenting at a time quite early
 with Emacs. Estimate it's now two years I sent you
 as maintainer my concerns with newcomment.el.

And still I think, as commenting (and fontifying) are
basics for all editors, everyone would expect Emacs
being strong here. But is not, rather bug-ridden,
sometimes lacking basic-features.

Just to give a visual impression:

open an empty buffer in Emacs-lisp mode, write "foo"
and M-x comment-dwim

`comment-dwim' places a comment-sign in column 41.

foo                                     ;

No one would expect that. DWIM could mean before or
after, but not at column 41.

Certainly there is more than one way to change that, I
could spent 10 minutes, one or two hours or half a day
digging trough newcomment.el. Probably I simply should
set this or another variable. BTW, checked
comment-column: is a variable defined in
`newcomment.el'.  Its value is 0

But that's all not the point: An
Editor should meet expectations of a wider range of
people first and than offer more. Emacs sometimes comes
with a lot of more, missing the first.

Notwithstanding I use Emacs with growing pleasure. I'm
not criticing Emacs as such: idea is valid, Emacs Lisp
is fine, altogether an excellent tool.

So why not simply cure things? 

Consider the amount of code spent to commenting in
C-source already, simple.el deals with it a lot, then
newcomment.el. Also we have "Comments in C" and
probably in a lot of mode-files. The amount of code
seems reciprocal to the outcome. Well, that's life. We
all have experienced that situation. It's not your
fault, not mine.

Looking through the commenting-code I got the
impression: fiddling one bug might be produce the next
that way. Considering my decent Emacs Lisp knowledge,
there was nothing to do for me this time. That may
change slowly. 

> the first thing you should do 
> in such a case is read its docstring.
>


Sincerely

Andreas Röhler




reply via email to

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