unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stefan Monnier" <monnier@IRO.UMontreal.CA>
Subject: Marking with the mouse
Date: 09 Sep 2003 16:38:56 -0400	[thread overview]
Message-ID: <jwvvfs1ae8v.fsf@noir.iro.umontreal.ca> (raw)
In-Reply-To: <ubrtukpjt.fsf@boost-consulting.com>


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)))))
 \f
 ;; Commands to handle xterm-style multiple clicks.

  parent reply	other threads:[~2003-09-09 20:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-09 14:24 Recent compilation-mode misbehavior David Abrahams
2003-09-09 18:20 ` Karl Eichwalder
2003-09-09 20:38 ` Stefan Monnier [this message]
2003-09-10  0:14   ` Marking with the mouse Miles Bader
2003-09-11 13:16     ` Richard Stallman
2003-09-10  0:24   ` Glenn Morris
2003-09-10 19:35     ` Alex Schroeder
2003-09-10 23:33       ` Kevin Rodgers
2003-09-11  1:30         ` Miles Bader
2003-09-11 16:31       ` Stefan Monnier
2003-09-11 13:16     ` Richard Stallman
2003-09-11 13:50       ` Glenn Morris
2003-09-11 13:15   ` Richard Stallman
2003-09-11 20:41     ` Stefan Monnier
2003-09-12 21:06       ` 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=jwvvfs1ae8v.fsf@noir.iro.umontreal.ca \
    --to=monnier@iro.umontreal.ca \
    /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).