unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#1120: issues on (put 'insert-date 'delete-selection t)
@ 2008-10-08 16:55 xah lee
  2008-10-09  2:59 ` Richard M. Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: xah lee @ 2008-10-08 16:55 UTC (permalink / raw)
  To: bug-gnu-emacs

according to delete-selection-mode's header file, elisp code that  
insert text that wants to respect delete-selection-mode should set  
the symbol's delete-selection property to true.

However, this works only when the command is called by a keyboard,  
not by M-x.

This appears to be a bug?

Example for reproduction:

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


then call M-x insert-date, and it'll not replace text selection.

(PS thanks to Drew Adams and Chetan on gnu.emacs.help)

   Xah
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-10-09 19:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-08 16:55 bug#1120: issues on (put 'insert-date 'delete-selection t) xah lee
2008-10-09  2:59 ` Richard M. Stallman
2008-10-09  7:45   ` xah lee
2008-10-09 19:00     ` Richard M. 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).