bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#18009: 24.4.50; Add hooks for `rename-file' and `delete-file'


From: Stefan Monnier
Subject: bug#18009: 24.4.50; Add hooks for `rename-file' and `delete-file'
Date: Fri, 18 Jul 2014 22:34:21 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

> Please add a hook for each of these basic operations.  It is not unusual
> to want to be able to carry out some action associated with
> (successfully) renaming or deleting a file.  The hooks would be run at
> the end of the operation, and only upon success.

It's not unreasonable, but these are rather low-level operations, I'm
not sure I want to run hooks from them.

> One use case: Bookmark+ autofile bookmarks have the same name as their
> files.  (There can be multiple bookmarks with the same name,
> corresponding to files with the same name in different directories.)
> With a hook it would be trivial to automatically rename or delete the
> associated bookmark.

Of course you can use an `advice' in the mean time, but maybe a better
long-term answer is the file-notification API so that your code would
know about renames not only when they're performed from the same Emacs
session but also from any other process.


        Stefan





reply via email to

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