From: Le Wang <lewang@yahoo.com>
Subject: Re: BUG REPORT: "delsel.el"
Date: Sun, 02 Mar 2003 17:30:35 -0500 [thread overview]
Message-ID: <b3u0p5$3pr$1@main.gmane.org> (raw)
In-Reply-To: 200303022033.h22KXsT02320@rum.cs.yale.edu
Stefan Monnier wrote:
>> Hi,
>>
>> I gave the `kill-line' symbol a property of 'kill for 'delete-selection.
>>
>> After the region is killed, "delsel.el" attempts to deactivate the region,
>> but of course in transient-mark-mode buffer modification deactivates the
>> region automatically, leading to an error.
>
> What error do you get ?
1. emacs -q
2. <M-x> transient-mark-mode
3. <M-x> delete-selection-mode
4. insert into scratch, and evaluate:
(put 'kill-line 'delete-selection 'kill)
5. Error: the mark is not active now.
>> I've got a patch (see atached), I don't
>> know if it's too simplistic, though. I'm no lisp expert.
>
> I don't understand the actual problem (I need the answer to the above
> question for that), but a better patch along the lines of what you
> sent is the one attached.
The problem is (I believe) that buffer modification already causes the mark to
deactivate in transient-mark-mode. So mark shouldn't be deactivated at all.
As such, your patch doesn't address this specific problem. But it is better
coding style to deactivate the mark through the API.
Actually, I just tried to use delete-selection mode w/o transient-mark-mode,
and it doesnt work at all. Maybe this is best?
cd /usr/local/share/emacs/21.3.50/lisp/
diff -c /usr/local/share/emacs/21.3.50/lisp/delsel.el
/tmp/buffer-content-278329Vo
*** /usr/local/share/emacs/21.3.50/lisp/delsel.el Mon Nov 19 01:21:11 2001
--- /tmp/buffer-content-278329Vo Sun Mar 2 17:28:13 2003
***************
*** 75,82 ****
(if killp
(kill-region (point) (mark))
(delete-region (point) (mark)))
- (setq mark-active nil)
- (run-hooks 'deactivate-mark-hook)
t)
(defun delete-selection-pre-hook ()
--- 75,80 ----
Diff finished at Sun Mar 2 17:28:13
--
Le
next prev parent reply other threads:[~2003-03-02 22:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-28 0:07 BUG REPORT: "delsel.el" Le Wang
2003-03-02 20:33 ` Stefan Monnier
2003-03-02 22:30 ` Le Wang [this message]
2003-03-04 18:22 ` Richard Stallman
2003-03-04 19:28 ` Le Wang
2003-03-03 18:58 ` Richard Stallman
2003-03-03 23:08 ` Le Wang
2003-03-05 20:47 ` Richard 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='b3u0p5$3pr$1@main.gmane.org' \
--to=lewang@yahoo.com \
/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).