From: xah lee <xah@xahlee.org>
To: bug-gnu-emacs@gnu.org
Subject: bug#1120: issues on (put 'insert-date 'delete-selection t)
Date: Wed, 8 Oct 2008 09:55:27 -0700 [thread overview]
Message-ID: <51DE3BC4-A565-472C-90A5-028B38C523BC@xahlee.org> (raw)
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/
☄
next reply other threads:[~2008-10-08 16:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-08 16:55 xah lee [this message]
2008-10-09 2:59 ` bug#1120: issues on (put 'insert-date 'delete-selection t) Richard M. Stallman
2008-10-09 7:45 ` xah lee
2008-10-09 19:00 ` Richard M. Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51DE3BC4-A565-472C-90A5-028B38C523BC@xahlee.org \
--to=xah@xahlee.org \
--cc=1120@emacsbugs.donarmstrong.com \
--cc=bug-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).