emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] When deleting in bookmark menu, prompt for confirmation.


From: Karl Fogel
Subject: Re: [PATCH] When deleting in bookmark menu, prompt for confirmation.
Date: Wed, 05 May 2021 16:38:10 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

On 05 May 2021, Stefan Monnier wrote:
Hmm, I can understand, but... let me give you my best argument for why to do
this instead of implementing undo:

Makes a lot of sense to me, yes.
While the idea of "undo" was brought up in response to your proposal and can indeed be seen as providing a similar functionality, I think the two
are mostly orthogonal.

Glad to hear that. +1 to the rest of your analysis below, too, including that last part about how for undo purposes the Bookmark Menu buffer can be thought of as "visiting" the file in which bookmarks are saved. (However, users are much less directly exposed to the bookmark file than they are to the regular kind of file that one visits, edits, and saves -- so the analogy fits mostly but perhaps not perfectly. A person could in theory use bookmarks regularly without ever needing to be aware that the file even exists.)

I don't plan to implement the undo functionality myself. It's a larger task than I want to take on. Or rather, if I were going to find time to do something of that size in Emacs, there are other things I would pick before this. However, it's good to have all these thoughts archived here, in case anyone else decides to do it.
Best regards,
-Karl

First of all, I think this option is useful on its own, with or without
undo.

Agreed.  And similarly undo would be useful with or without such
a confirmation prompt.

Also, implementing undo functionality would open up a whole lot
of questions.

Yes, it's an interesting field. I hope someone will tackle this problem.

If Bookmark Menu mode supports undo, do Bookmark operations in
general support undo?

I'd say yes, but in order to save the user the trouble of saying "undo bookmark operation" (as opposed to undoing other things), I think it's
OK to limit oneself to supporting the `undo` command within the
bookmark-menu buffer.

I think to make it work well, we'd also want to make sure the bookmark menu is always up-to-date with the bookmark data structure (i.e. any external change to the bookmarks would be immediately reflected in a
bookmark menu if there is one (with a corresponding undo entry)).

If so, which ones?  And even just within Bookmark
Menu, what else should be undo-able?

I think it would make sense to make "everything" in there undoable.
We might even be able to support `undo-in-region` ;-)

And there's the usual bevy of undo-boundary questions: suppose someone does 'x' to execute deletions, then 's' to save the current state of the bookmarks list. If they then undo, should it undo the deletions but not
 save the result, or should it also save?

If you think of the bookmark-menu as the buffer that visits the bookmark file, then it would be natural that "save" is not part of the operations that are recorded in the undo log (and the `**` in the modeline might
try and reflect the "saved" state like we do for normal files).


       Stefan



reply via email to

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