From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Marking with the mouse Date: 09 Sep 2003 16:38:56 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1063143464 1385 80.91.224.253 (9 Sep 2003 21:37:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 9 Sep 2003 21:37:44 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Sep 09 23:37:42 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19wqBC-00070q-00 for ; Tue, 09 Sep 2003 23:37:42 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19wqBH-00046P-00 for ; Tue, 09 Sep 2003 23:37:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 19wqA5-0007fd-7g for emacs-devel@quimby.gnus.org; Tue, 09 Sep 2003 17:36:33 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.22) id 19wpGT-0006I6-QY for emacs-devel@gnu.org; Tue, 09 Sep 2003 16:39:05 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.22) id 19wpGR-0006HM-Jb for emacs-devel@gnu.org; Tue, 09 Sep 2003 16:39:04 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.22) id 19wpGQ-0006Gi-SE for emacs-devel@gnu.org; Tue, 09 Sep 2003 16:39:02 -0400 Original-Received: from noir.iro.umontreal.ca (noir.iro.umontreal.ca [132.204.26.236]) by mercure.iro.umontreal.ca (8.12.9/8.12.9) with ESMTP id h89KcwHD013195 for ; Tue, 9 Sep 2003 16:38:58 -0400 Original-Received: (from monnier@localhost) by noir.iro.umontreal.ca (8.12.9/8.12.9) id h89KcwuF032196; Tue, 9 Sep 2003 16:38:58 -0400 Original-To: emacs-devel@gnu.org In-Reply-To: Original-Lines: 56 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-MailScanner-DIRO: Found to be clean X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:16250 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:16250 Someone in gnu.emacs.help recently complained about the weird behavior of the highlighting when you drag the mouse while pressing mouse-1: the selected text is highlighted during the drag but the highlighting disappears immediately after that. I was thinking that maybe it's a good idea to use the transient transient-mark-mode in this case, so that marking with the mouse always behaves like transient-mark-mode. This is based on the idea that those who dislike transient-mark-mode probably don't often use the mouse to select the region. Any comment ? Stefan --- mouse.el.~1.243.~ Mon Sep 8 19:10:04 2003 +++ mouse.el Tue Sep 9 16:34:00 2003 @@ -1,6 +1,6 @@ ;;; mouse.el --- window system-independent mouse support -;; Copyright (C) 1993, 1994, 1995, 1999, 2000, 2001 +;; Copyright (C) 1993, 1994, 1995, 1999, 2000, 2001, 2003 ;; Free Software Foundation, Inc. ;; Maintainer: FSF @@ -622,6 +622,8 @@ (mouse-set-region-1))) (defun mouse-set-region-1 () + ;; Set transient-mark-mode for a little while. + (setq transient-mark-mode 'lambda) (setq mouse-last-region-beg (region-beginning)) (setq mouse-last-region-end (region-end)) (setq mouse-last-region-tick (buffer-modified-tick))) @@ -702,8 +704,8 @@ If the click is in the echo area, display the `*Messages*' buffer." (interactive "e") (let ((w (posn-window (event-start start-event)))) - (if (not (or (not (window-minibuffer-p w)) - (minibuffer-window-active-p w))) + (if (and (window-minibuffer-p w) + (not (minibuffer-window-active-p w))) (save-excursion (read-event) (set-buffer "*Messages*") @@ -858,8 +860,7 @@ (or end-point (= (window-start start-window) start-window-start))) - (setq unread-command-events - (cons event unread-command-events))))) + (push event unread-command-events)))) (delete-overlay mouse-drag-overlay))))) ;; Commands to handle xterm-style multiple clicks.