* Autoloading comment-forward
@ 2007-07-06 19:20 Ralf Angeli
2007-07-07 1:34 ` Stefan Monnier
2007-07-07 20:47 ` Richard Stallman
0 siblings, 2 replies; 14+ messages in thread
From: Ralf Angeli @ 2007-07-06 19:20 UTC (permalink / raw)
To: emacs-devel
Hi,
RefTeX and AUCTeX use `comment-forward' when skipping over multiple TeX
groups. The function -- while being quite useful -- is not autoloaded
at the moment. Perhaps it should be?
The current situation is not a big problem for AUCTeX since it contains
a compatibility function for `comment-forward' anyway. The reason for
this being XEmacs not containing `comment-forward' at all. RefTeX
likely will get a compatibilty function as well due to the same reason.
Currently some RefTeX functionality is not working as long as
newcomment.el is not loaded.
--
Ralf
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Autoloading comment-forward
2007-07-06 19:20 Autoloading comment-forward Ralf Angeli
@ 2007-07-07 1:34 ` Stefan Monnier
2007-07-07 6:24 ` Ralf Angeli
2007-07-07 20:47 ` Richard Stallman
1 sibling, 1 reply; 14+ messages in thread
From: Stefan Monnier @ 2007-07-07 1:34 UTC (permalink / raw)
To: Ralf Angeli; +Cc: emacs-devel
> RefTeX and AUCTeX use `comment-forward' when skipping over multiple TeX
> groups. The function -- while being quite useful -- is not autoloaded
> at the moment. Perhaps it should be?
Before calling comment-forward, you need to call comment-normalize-vars
which *is* autoloaded.
Stefan
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Autoloading comment-forward
2007-07-07 1:34 ` Stefan Monnier
@ 2007-07-07 6:24 ` Ralf Angeli
2007-07-08 13:55 ` Stefan Monnier
0 siblings, 1 reply; 14+ messages in thread
From: Ralf Angeli @ 2007-07-07 6:24 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
* Stefan Monnier (2007-07-07) writes:
>> RefTeX and AUCTeX use `comment-forward' when skipping over multiple TeX
>> groups. The function -- while being quite useful -- is not autoloaded
>> at the moment. Perhaps it should be?
>
> Before calling comment-forward, you need to call comment-normalize-vars
> which *is* autoloaded.
Oh, okay. Thanks for the hint. Is this documented somewhere? Should
it be done everytime `comment-forward' is called?
I saw that other functions in newcomment.el call
`comment-normalize-vars' themselves. Would it make sense if
`comment-forward' did the same (and was autoloaded)?
--
Ralf
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Autoloading comment-forward
2007-07-06 19:20 Autoloading comment-forward Ralf Angeli
2007-07-07 1:34 ` Stefan Monnier
@ 2007-07-07 20:47 ` Richard Stallman
1 sibling, 0 replies; 14+ messages in thread
From: Richard Stallman @ 2007-07-07 20:47 UTC (permalink / raw)
To: Ralf Angeli; +Cc: emacs-devel
It seems confusing to have both `comment-forward' and
`forward-comment'. Is it possible to make `comment-forward' support
backward motion? Then we could rename `forward-comment' to
`comment-forward-internal' and alias it to `comment-forward'.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Autoloading comment-forward
2007-07-07 6:24 ` Ralf Angeli
@ 2007-07-08 13:55 ` Stefan Monnier
2007-07-09 18:55 ` Ralf Angeli
0 siblings, 1 reply; 14+ messages in thread
From: Stefan Monnier @ 2007-07-08 13:55 UTC (permalink / raw)
To: Ralf Angeli; +Cc: emacs-devel
>>> RefTeX and AUCTeX use `comment-forward' when skipping over multiple TeX
>>> groups. The function -- while being quite useful -- is not autoloaded
>>> at the moment. Perhaps it should be?
>>
>> Before calling comment-forward, you need to call comment-normalize-vars
>> which *is* autoloaded.
> Oh, okay. Thanks for the hint. Is this documented somewhere? Should
> it be done everytime `comment-forward' is called?
Once is enough: It simply should be called at some point after the major
mode is set but before internal functions such as comment-forward are used.
> I saw that other functions in newcomment.el call
> `comment-normalize-vars' themselves. Would it make sense if
> `comment-forward' did the same (and was autoloaded)?
Could be. What kind of situation do you have in mind where this is useful?
Stefan
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Autoloading comment-forward
2007-07-08 13:55 ` Stefan Monnier
@ 2007-07-09 18:55 ` Ralf Angeli
2007-07-09 19:51 ` Stefan Monnier
0 siblings, 1 reply; 14+ messages in thread
From: Ralf Angeli @ 2007-07-09 18:55 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
* Stefan Monnier (2007-07-08) writes:
>> Oh, okay. Thanks for the hint. Is this documented somewhere? Should
>> it be done everytime `comment-forward' is called?
>
> Once is enough: It simply should be called at some point after the major
> mode is set but before internal functions such as comment-forward are used.
Okay.
>> I saw that other functions in newcomment.el call
>> `comment-normalize-vars' themselves. Would it make sense if
>> `comment-forward' did the same (and was autoloaded)?
>
> Could be. What kind of situation do you have in mind where this is useful?
I'm not sure I understand the question. AUCTeX uses `comment-forward'
to skip empty or commented lines when traversing LaTeX macro arguments.
So for me `comment-forward' is not so much an internal function of
newcomment.el but rather one which is useful for other parts of Emacs or
packages like AUCTeX. That's also why I think it makes sense for it to
be autoloaded.
Anyway, I will put a call to `comment-normalize-vars' into the
compatibility function for `comment-forward' in AUCTeX before
`comment-forward' is actually called (if available). This will get rid
of the issue. And the call to `comment-forward' in RefTeX has actually
only been present in my local copy. RefTeX actually uses a different
mechanism for skipping over comments.
--
Ralf
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Autoloading comment-forward
2007-07-09 18:55 ` Ralf Angeli
@ 2007-07-09 19:51 ` Stefan Monnier
2007-07-09 20:01 ` Ralf Angeli
0 siblings, 1 reply; 14+ messages in thread
From: Stefan Monnier @ 2007-07-09 19:51 UTC (permalink / raw)
To: Ralf Angeli; +Cc: emacs-devel
> I'm not sure I understand the question. AUCTeX uses `comment-forward'
> to skip empty or commented lines when traversing LaTeX macro arguments.
Why doesn't it use forward-comment instead?
Stefan
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Autoloading comment-forward
2007-07-09 19:51 ` Stefan Monnier
@ 2007-07-09 20:01 ` Ralf Angeli
2007-07-10 2:55 ` Stefan Monnier
0 siblings, 1 reply; 14+ messages in thread
From: Ralf Angeli @ 2007-07-09 20:01 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
* Stefan Monnier (2007-07-09) writes:
>> I'm not sure I understand the question. AUCTeX uses `comment-forward'
>> to skip empty or commented lines when traversing LaTeX macro arguments.
>
> Why doesn't it use forward-comment instead?
Because it has to deal with Texinfo files as well.
--
Ralf
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Autoloading comment-forward
2007-07-09 20:01 ` Ralf Angeli
@ 2007-07-10 2:55 ` Stefan Monnier
2007-07-10 22:01 ` Richard Stallman
0 siblings, 1 reply; 14+ messages in thread
From: Stefan Monnier @ 2007-07-10 2:55 UTC (permalink / raw)
To: Ralf Angeli; +Cc: emacs-devel
>>> I'm not sure I understand the question. AUCTeX uses `comment-forward'
>>> to skip empty or commented lines when traversing LaTeX macro arguments.
>> Why doesn't it use forward-comment instead?
> Because it has to deal with Texinfo files as well.
I see. Then I think Richard's suggestion makes a lot of sense. Except that
it means comment-forward (and hence newcomment.el) should not be autoloaded
but preloaded. I'm all in favor of such a change (after all, the
functionality provided by newcomment.el used to be preloaded (it was in
simple.el) before I rewrote it).
Richard, do you have an objection to preloading newcomment.el (after
changing forward-comment to comment-forward-internal, adding backward
motion to comment-forward and making forward-comment an alias of
comment-forward).
Stefan
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Autoloading comment-forward
2007-07-10 2:55 ` Stefan Monnier
@ 2007-07-10 22:01 ` Richard Stallman
2007-07-11 2:26 ` Stefan Monnier
0 siblings, 1 reply; 14+ messages in thread
From: Richard Stallman @ 2007-07-10 22:01 UTC (permalink / raw)
To: Stefan Monnier; +Cc: angeli, emacs-devel
Richard, do you have an objection to preloading newcomment.el (after
changing forward-comment to comment-forward-internal, adding backward
motion to comment-forward and making forward-comment an alias of
comment-forward).
It is ok if it can't cleanly be avoided. But I'd rather look
for a way to avoid it, and I expect that should be possible.
For instance, the code of comment-forward could call a new
preloaded function equivalent to `comment-normalize-vars',
and `comment-normalize-vars' itself could call that new function
to do the work. This way, calls to `comment-normalize-vars'
will still be a good way to cause newcomment.el to get loaded,
and everything that works now will continue to work.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Autoloading comment-forward
2007-07-10 22:01 ` Richard Stallman
@ 2007-07-11 2:26 ` Stefan Monnier
2007-07-11 21:03 ` Richard Stallman
0 siblings, 1 reply; 14+ messages in thread
From: Stefan Monnier @ 2007-07-11 2:26 UTC (permalink / raw)
To: rms; +Cc: angeli, emacs-devel
> Richard, do you have an objection to preloading newcomment.el (after
> changing forward-comment to comment-forward-internal, adding backward
> motion to comment-forward and making forward-comment an alias of
> comment-forward).
> It is ok if it can't cleanly be avoided. But I'd rather look
> for a way to avoid it, and I expect that should be possible.
> For instance, the code of comment-forward could call a new
> preloaded function equivalent to `comment-normalize-vars',
> and `comment-normalize-vars' itself could call that new function
> to do the work. This way, calls to `comment-normalize-vars'
> will still be a good way to cause newcomment.el to get loaded,
> and everything that works now will continue to work.
If someone else wants to do that, I can't prevent it, but spreading the code
like this just in the hope to avoid a few KB in the default build (most
people will load newcomment.el sooner or later since it's loaded as soon as
you hit M-; or use auto-fill-mode or ...), is just a waste of time IMNSHO.
Stefan
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Autoloading comment-forward
2007-07-11 2:26 ` Stefan Monnier
@ 2007-07-11 21:03 ` Richard Stallman
2007-07-12 3:17 ` Stefan Monnier
0 siblings, 1 reply; 14+ messages in thread
From: Richard Stallman @ 2007-07-11 21:03 UTC (permalink / raw)
To: Stefan Monnier; +Cc: angeli, emacs-devel
> For instance, the code of comment-forward could call a new
> preloaded function equivalent to `comment-normalize-vars',
> and `comment-normalize-vars' itself could call that new function
> to do the work. This way, calls to `comment-normalize-vars'
> will still be a good way to cause newcomment.el to get loaded,
> and everything that works now will continue to work.
If someone else wants to do that, I can't prevent it, but spreading the code
like this just in the hope to avoid a few KB in the default build (most
people will load newcomment.el sooner or later since it's loaded as soon as
you hit M-; or use auto-fill-mode or ...), is just a waste of time IMNSHO.
Why does auto-fill-mode load newcomment when used in Text mode?
That seems like a bug, since Text mode has no comment syntax.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Autoloading comment-forward
2007-07-11 21:03 ` Richard Stallman
@ 2007-07-12 3:17 ` Stefan Monnier
2007-07-12 21:23 ` Richard Stallman
0 siblings, 1 reply; 14+ messages in thread
From: Stefan Monnier @ 2007-07-12 3:17 UTC (permalink / raw)
To: rms; +Cc: angeli, emacs-devel
>> For instance, the code of comment-forward could call a new
>> preloaded function equivalent to `comment-normalize-vars',
>> and `comment-normalize-vars' itself could call that new function
>> to do the work. This way, calls to `comment-normalize-vars'
>> will still be a good way to cause newcomment.el to get loaded,
>> and everything that works now will continue to work.
> If someone else wants to do that, I can't prevent it, but spreading
> the code like this just in the hope to avoid a few KB in the default
> build (most people will load newcomment.el sooner or later since it's
> loaded as soon as you hit M-; or use auto-fill-mode or ...), is just
> a waste of time IMNSHO.
> Why does auto-fill-mode load newcomment when used in Text mode?
Not sure. Maybe it doesn't in this case.
Stefan
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Autoloading comment-forward
2007-07-12 3:17 ` Stefan Monnier
@ 2007-07-12 21:23 ` Richard Stallman
0 siblings, 0 replies; 14+ messages in thread
From: Richard Stallman @ 2007-07-12 21:23 UTC (permalink / raw)
To: Stefan Monnier; +Cc: angeli, emacs-devel
> Why does auto-fill-mode load newcomment when used in Text mode?
Not sure. Maybe it doesn't in this case.
There is a bug. The doc string of comment-line-break-function
says it is called only in comments, but in fact it is called
unconditionally.
I will make a change that takes a step in avoiding calling
it when you're not in a comment.
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2007-07-12 21:23 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-06 19:20 Autoloading comment-forward Ralf Angeli
2007-07-07 1:34 ` Stefan Monnier
2007-07-07 6:24 ` Ralf Angeli
2007-07-08 13:55 ` Stefan Monnier
2007-07-09 18:55 ` Ralf Angeli
2007-07-09 19:51 ` Stefan Monnier
2007-07-09 20:01 ` Ralf Angeli
2007-07-10 2:55 ` Stefan Monnier
2007-07-10 22:01 ` Richard Stallman
2007-07-11 2:26 ` Stefan Monnier
2007-07-11 21:03 ` Richard Stallman
2007-07-12 3:17 ` Stefan Monnier
2007-07-12 21:23 ` Richard Stallman
2007-07-07 20:47 ` Richard Stallman
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.