From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Le Wang Newsgroups: gmane.emacs.devel Subject: Re: BUG REPORT: "delsel.el" Date: Sun, 02 Mar 2003 17:30:35 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <200303022033.h22KXsT02320@rum.cs.yale.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: main.gmane.org 1046644389 4070 80.91.224.249 (2 Mar 2003 22:33:09 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 2 Mar 2003 22:33:09 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18pc15-00013W-00 for ; Sun, 02 Mar 2003 23:33:07 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18pcJf-0003eO-00 for ; Sun, 02 Mar 2003 23:52:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18pc0w-00015y-02 for emacs-devel@quimby.gnus.org; Sun, 02 Mar 2003 17:32:58 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18pc0c-00015a-00 for emacs-devel@gnu.org; Sun, 02 Mar 2003 17:32:38 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18pc0Z-00013G-00 for emacs-devel@gnu.org; Sun, 02 Mar 2003 17:32:37 -0500 Original-Received: from main.gmane.org ([80.91.224.249]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18pc0Z-00013C-00 for emacs-devel@gnu.org; Sun, 02 Mar 2003 17:32:35 -0500 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 18pc08-000119-00 for ; Sun, 02 Mar 2003 23:32:08 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Received: from news by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 18pc06-00010v-00 for ; Sun, 02 Mar 2003 23:32:06 +0100 Original-Lines: 62 Original-X-Complaints-To: usenet@main.gmane.org User-Agent: KNode/0.7.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:12068 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:12068 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. transient-mark-mode 3. 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