unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* undoing changes automatically
@ 2007-11-12  1:13 Roland Winkler
  2007-11-12 10:07 ` Johan Bockgård
  2007-11-12 20:12 ` David Kastrup
  0 siblings, 2 replies; 16+ messages in thread
From: Roland Winkler @ 2007-11-12  1:13 UTC (permalink / raw)
  To: emacs-devel

Who can please explain to me the following?

bibtex.el contains the function bibtex-format-entry that performs
various formatting operations on a BibTeX entry. Along the way, it
also checks in several ways whether syntax and content of the entry
are correct. It throws an error if any of these checks indicates
that something is incorrect. But this happens while it is in the
midst of its formatting job. This is very confusing because it
leaves the buffer in an odd state. One always needs to do an `undo'
after such an error message.

So I want to put the call to undo in the code such that it undoes
all the formatting before it throws the error.

However, one thing confuses me: a simple call of `undo' is not
enough. Instead, I need to call first `undo-boundary'. Why does
`undo' ignore the latest entries in buffer-undo-list past (i.e.,
newer than) the last undo boundary? Is this behavior intended? If
yes, is it documented somewhere?

Thanks,

Roland

PS: I am also a bit unhappy that using the buffer-undo-list for this
always makes this list grow, although there is no need to keep these
entries in buffer-undo-list if they are undone immediately. So is
there a cleaner way to achieve what I want? I have in mind something
like a (noninteractive) undo function that deletes those entries
from buffer-undo-list that are undone. (An alternative would be that
the code performed first all the error checking and did the
formatting afterwards. However, this would duplicate a lot of code
and also duplicate work done in bibtex-format-entry. So I would like
to avoid that.)

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2008-01-11 13:58 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-12  1:13 undoing changes automatically Roland Winkler
2007-11-12 10:07 ` Johan Bockgård
2007-11-12 21:23   ` Leo
2007-11-12 20:12 ` David Kastrup
2007-11-12 21:21   ` Roland Winkler
2007-11-13 20:03     ` Richard Stallman
2007-11-13 21:11       ` Stefan Monnier
2007-11-15  5:06       ` Roland Winkler
2008-01-09  1:51       ` Roland Winkler
2008-01-09  5:24         ` Stefan Monnier
2008-01-09  9:10           ` Roland Winkler
2008-01-09 10:11             ` Roland Winkler
2008-01-09 15:07               ` Stefan Monnier
2008-01-10 12:20                 ` Richard Stallman
2008-01-10 14:43                   ` Stefan Monnier
2008-01-11 13:58                     ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).