[Top][All Lists]

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

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

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

> 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.

> 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).


reply via email to

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