* BUG: indenting lisp code marks buffer as dirty when it shouldn't
@ 2002-11-24 11:02 Karl Chen
2002-11-24 11:09 ` Karl Chen
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Karl Chen @ 2002-11-24 11:02 UTC (permalink / raw)
This bug exists in Emacs 21.2 as well as CVS HEAD 2002-11-23.
Synopsis:
emacs -q
C-space
insert "t ;; blah\n" [ in scratch or any lisp buffer ]
M-: (buffer-modified-tick)
C-M-\ [ or M-x indent-region ]
M-: (buffer-modified-tick)
The buffer is not modified. Thus the two `buffer-modified-tick's should
report the same value, but they don't. another way to test this is to save the
buffer before `indent-region', and see that `indent-region' makes the buffer
dirty, even though it ahsn't actually changed.
Emacs seems to be trying to move the ";;" to the same indentation level as
the rest of the code (which in this case would be the first column since
we're at top level), but there's text "blocking" it (the "t" in this case).
Pressing TAB on the "t ;; comment" line works fine (oesn't tick the buffer
modification).
Putting a double-semicolon comment after a line of code probably doesn't
follow GNU lisp coding style (I didn't write this myself anyway), but taht
shouldn't cause incorrect behavior when trying to indent it.
--
Karl Chen / quarl@quarl.org
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: BUG: indenting lisp code marks buffer as dirty when it shouldn't
2002-11-24 11:02 BUG: indenting lisp code marks buffer as dirty when it shouldn't Karl Chen
@ 2002-11-24 11:09 ` Karl Chen
2002-11-24 15:08 ` Kai Großjohann
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Karl Chen @ 2002-11-24 11:09 UTC (permalink / raw)
The same also happens when you do M-; (comment-dwim) on such a line
--
Karl Chen / quarl@quarl.org
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: BUG: indenting lisp code marks buffer as dirty when it shouldn't
2002-11-24 11:02 BUG: indenting lisp code marks buffer as dirty when it shouldn't Karl Chen
2002-11-24 11:09 ` Karl Chen
@ 2002-11-24 15:08 ` Kai Großjohann
2002-11-27 14:49 ` Francesco Potorti`
2002-11-25 12:36 ` Richard Stallman
2002-11-25 14:28 ` Stefan Monnier
3 siblings, 1 reply; 7+ messages in thread
From: Kai Großjohann @ 2002-11-24 15:08 UTC (permalink / raw)
Karl Chen <quarl@hkn.eecs.berkeley.edu> writes:
> The buffer is not modified. Thus the two `buffer-modified-tick's should
> report the same value, but they don't. another way to test this is to save the
> buffer before `indent-region', and see that `indent-region' makes the buffer
> dirty, even though it ahsn't actually changed.
M-q has the same problem, but is it really _that_ important?
It took me 7 years of using Emacs to notice the M-q problem...
kai
--
~/.signature is: umop ap!sdn (Frank Nobis)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: BUG: indenting lisp code marks buffer as dirty when it shouldn't
2002-11-24 11:02 BUG: indenting lisp code marks buffer as dirty when it shouldn't Karl Chen
2002-11-24 11:09 ` Karl Chen
2002-11-24 15:08 ` Kai Großjohann
@ 2002-11-25 12:36 ` Richard Stallman
2002-11-25 14:28 ` Stefan Monnier
3 siblings, 0 replies; 7+ messages in thread
From: Richard Stallman @ 2002-11-25 12:36 UTC (permalink / raw)
Cc: emacs-devel
The buffer is not modified. Thus the two `buffer-modified-tick's should
report the same value, but they don't. another way to test this is to save the
buffer before `indent-region', and see that `indent-region' makes the buffer
dirty, even though it ahsn't actually changed.
It is not a bug to mark the buffer modified in this case.
However, it would be a nice touch to avoid doing so.
If someone wants to work on it, please go ahead.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: BUG: indenting lisp code marks buffer as dirty when it shouldn't
2002-11-24 11:02 BUG: indenting lisp code marks buffer as dirty when it shouldn't Karl Chen
` (2 preceding siblings ...)
2002-11-25 12:36 ` Richard Stallman
@ 2002-11-25 14:28 ` Stefan Monnier
2002-11-25 20:23 ` Karl Chen
3 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2002-11-25 14:28 UTC (permalink / raw)
Cc: emacs-devel
> This bug exists in Emacs 21.2 as well as CVS HEAD 2002-11-23.
as well as in Emacs-20.7.
> Synopsis:
>
> emacs -q
>
> C-space
>
> insert "t ;; blah\n" [ in scratch or any lisp buffer ]
Does it really ? That's odd. It doesn't for me. The reason why it doesn't
is that the ;; is inside a string, so it doesn't try to reindent it
(Emacs-20.7 behaves as you describe because I doesn't pay attention to the
string quotes).
But the problem would appear if you removed the quotes, because the
reindentation would try to reindent the comment and that code is not
careful to modify the text "only if needed". I'll see how hard it
would be to fix it.
Stefan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: BUG: indenting lisp code marks buffer as dirty when it shouldn't
2002-11-25 14:28 ` Stefan Monnier
@ 2002-11-25 20:23 ` Karl Chen
0 siblings, 0 replies; 7+ messages in thread
From: Karl Chen @ 2002-11-25 20:23 UTC (permalink / raw)
Cc: emacs-devel
Stefan> Does it really ? That's odd. It doesn't for me. The reason why it doesn't
Stefan> is that the ;; is inside a string, so it doesn't try to reindent it
Stefan> (Emacs-20.7 behaves as you describe because I doesn't pay attention to the
Stefan> string quotes).
Stefan> But the problem would appear if you removed the quotes, because the
Stefan> reindentation would try to reindent the comment and that code is not
Stefan> careful to modify the text "only if needed". I'll see how hard it
Stefan> would be to fix it.
sorry - that's what I meant, insert the text without the quotes. I quoted it
in the bug report because the spaces typed are important.
--
Karl Chen / quarl@quarl.org
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2002-11-27 14:49 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-24 11:02 BUG: indenting lisp code marks buffer as dirty when it shouldn't Karl Chen
2002-11-24 11:09 ` Karl Chen
2002-11-24 15:08 ` Kai Großjohann
2002-11-27 14:49 ` Francesco Potorti`
2002-11-25 12:36 ` Richard Stallman
2002-11-25 14:28 ` Stefan Monnier
2002-11-25 20:23 ` Karl Chen
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.