emacs: have command overwrite selection

i have this code that inserts date.

(defun insert-date ()
"Insert current date."
(insert (format-time-string "%Y-%m-%d"))
(put 'insert-date 'delete-selection t)

the last line is to make sure that if i have a text selection, just overwrite it.

but it doesn't work.

i wrote to FSF about it i think last year, i think Richard Stallman himself turned it down.

but in my daily use, this is quite annoying.

with i think recent interest in behavior of text selection, can this be made to work?



No comments:

Post a Comment