emacs-devel
[Top][All Lists]
Advanced

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

Re: BUG REPORT: "delsel.el"


From: Le Wang
Subject: Re: BUG REPORT: "delsel.el"
Date: Sun, 02 Mar 2003 17:30:35 -0500
User-agent: KNode/0.7.1

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





reply via email to

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