]> code.delx.au - gnu-emacs/blobdiff - lisp/mouse-sel.el
* vc/vc.el (vc-modify-change-comment): Change *VC-log* to *vc-log*
[gnu-emacs] / lisp / mouse-sel.el
index 412f8ac0be2820cb5c62c19e47dec5e26701c2e6..1f601377ad45829d01ce575cc9368b5d9106b95a 100644 (file)
@@ -1,7 +1,6 @@
-;;; mouse-sel.el --- multi-click selection support for Emacs 19
+;;; mouse-sel.el --- multi-click selection support
 
 
-;; Copyright (C) 1993, 1994, 1995, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1995, 2001-2011  Free Software Foundation, Inc.
 
 ;; Author: Mike Williams <mdub@bigfoot.com>
 ;; Keywords: mouse
 
 ;; Author: Mike Williams <mdub@bigfoot.com>
 ;; Keywords: mouse
@@ -98,7 +97,7 @@
 ;;
 ;;       Selection/kill-ring interaction is retained
 ;;         interprogram-cut-function   = x-select-text
 ;;
 ;;       Selection/kill-ring interaction is retained
 ;;         interprogram-cut-function   = x-select-text
-;;         interprogram-paste-function = x-cut-buffer-or-selection-value
+;;         interprogram-paste-function = x-selection-value
 ;;
 ;;       What you lose is the ability to select some text in
 ;;       delete-selection-mode and yank over the top of it.
 ;;
 ;;       What you lose is the ability to select some text in
 ;;       delete-selection-mode and yank over the top of it.
 ;; * I like to leave point at the end of the region nearest to where the
 ;;   mouse was, even though this makes region highlighting mis-leading (the
 ;;   cursor makes it look like one extra character is selected).  You can
 ;; * I like to leave point at the end of the region nearest to where the
 ;;   mouse was, even though this makes region highlighting mis-leading (the
 ;;   cursor makes it look like one extra character is selected).  You can
-;;   disable this behaviour with:
+;;   disable this behavior with:
 ;;
 ;;     (setq mouse-sel-leave-point-near-mouse nil)
 ;;
 ;; * By default, mouse-select cycles the click count after 4 clicks.  That
 ;;   is, clicking mouse-1 five times has the same effect as clicking it
 ;;   once, clicking six times has the same effect as clicking twice, etc.
 ;;
 ;;     (setq mouse-sel-leave-point-near-mouse nil)
 ;;
 ;; * By default, mouse-select cycles the click count after 4 clicks.  That
 ;;   is, clicking mouse-1 five times has the same effect as clicking it
 ;;   once, clicking six times has the same effect as clicking twice, etc.
-;;   Disable this behaviour with:
+;;   Disable this behavior with:
 ;;
 ;;     (setq mouse-sel-cycle-clicks nil)
 ;;
 ;;
 ;;     (setq mouse-sel-cycle-clicks nil)
 ;;
 ;;   that the X primary selection is used.  Under other windowing systems,
 ;;   alternate functions are used, which simply store the selection value
 ;;   in a variable.
 ;;   that the X primary selection is used.  Under other windowing systems,
 ;;   alternate functions are used, which simply store the selection value
 ;;   in a variable.
-;;
-;; * You can change the selection highlight face by altering the properties
-;;   of mouse-drag-overlay, eg.
-;;
-;;     (overlay-put mouse-drag-overlay 'face 'bold)
 
 ;;; Code:
 
 
 ;;; Code:
 
   :group 'mouse)
 
 (defcustom mouse-sel-leave-point-near-mouse t
   :group 'mouse)
 
 (defcustom mouse-sel-leave-point-near-mouse t
-  "*Leave point near last mouse position.
+  "Leave point near last mouse position.
 If non-nil, \\[mouse-select] and \\[mouse-extend] will leave point at the end
 of the region nearest to where the mouse last was.
 If nil, point will always be placed at the beginning of the region."
 If non-nil, \\[mouse-select] and \\[mouse-extend] will leave point at the end
 of the region nearest to where the mouse last was.
 If nil, point will always be placed at the beginning of the region."
@@ -158,12 +152,12 @@ If nil, point will always be placed at the beginning of the region."
   :group 'mouse-sel)
 
 (defcustom mouse-sel-cycle-clicks t
   :group 'mouse-sel)
 
 (defcustom mouse-sel-cycle-clicks t
-  "*If non-nil, \\[mouse-select] cycles the click-counts after 4 clicks."
+  "If non-nil, \\[mouse-select] cycles the click-counts after 4 clicks."
   :type 'boolean
   :group 'mouse-sel)
 
 (defcustom mouse-sel-default-bindings t
   :type 'boolean
   :group 'mouse-sel)
 
 (defcustom mouse-sel-default-bindings t
-  "*Control mouse bindings."
+  "Control mouse bindings."
   :type '(choice (const :tag "none" nil)
                 (const :tag "cut and paste" interprogram-cut-paste)
                 (other :tag "default bindings" t))
   :type '(choice (const :tag "none" nil)
                 (const :tag "cut and paste" interprogram-cut-paste)
                 (other :tag "default bindings" t))
@@ -293,8 +287,7 @@ primary selection and region."
   (overlay-put mouse-secondary-overlay 'face 'secondary-selection))
 
 (defconst mouse-sel-selection-alist
   (overlay-put mouse-secondary-overlay 'face 'secondary-selection))
 
 (defconst mouse-sel-selection-alist
-  '((PRIMARY mouse-drag-overlay mouse-sel-primary-thing)
-    (SECONDARY mouse-secondary-overlay mouse-sel-secondary-thing))
+  '((SECONDARY mouse-secondary-overlay mouse-sel-secondary-thing))
   "Alist associating selections with variables.
 Each element is of the form:
 
   "Alist associating selections with variables.
 Each element is of the form:
 
@@ -305,6 +298,8 @@ where   SELECTION-NAME          = name of selection
        SELECTION-THING-SYMBOL  = name of variable where the current selection
                                  type for this selection should be stored.")
 
        SELECTION-THING-SYMBOL  = name of variable where the current selection
                                  type for this selection should be stored.")
 
+(declare-function x-select-text "term/common-win" (text))
+
 (defvar mouse-sel-set-selection-function
   (if (eq mouse-sel-default-bindings 'interprogram-cut-paste)
       'x-set-selection
 (defvar mouse-sel-set-selection-function
   (if (eq mouse-sel-default-bindings 'interprogram-cut-paste)
       'x-set-selection
@@ -318,13 +313,15 @@ Called with two arguments:
   SELECTION, the name of the selection concerned, and
   VALUE, the text to store.
 
   SELECTION, the name of the selection concerned, and
   VALUE, the text to store.
 
-This sets the selection as well as the cut buffer for the older applications,
-unless `mouse-sel-default-bindings' is `interprogram-cut-paste'.")
+This sets the selection, unless `mouse-sel-default-bindings'
+is `interprogram-cut-paste'.")
+
+(declare-function x-selection-value "term/x-win" ())
 
 (defvar mouse-sel-get-selection-function
   (lambda (selection)
     (if (eq selection 'PRIMARY)
 
 (defvar mouse-sel-get-selection-function
   (lambda (selection)
     (if (eq selection 'PRIMARY)
-       (or (x-cut-buffer-or-selection-value)
+       (or (x-selection-value)
            (bound-and-true-p x-last-selected-text)
            (bound-and-true-p x-last-selected-text-primary))
       (x-get-selection selection)))
            (bound-and-true-p x-last-selected-text)
            (bound-and-true-p x-last-selected-text-primary))
       (x-get-selection selection)))
@@ -551,7 +548,6 @@ See documentation for mouse-select-internal for more details."
          (let* ((thing-symbol (mouse-sel-selection-thing selection))
                 (overlay (mouse-sel-selection-overlay selection))
                 (orig-window (selected-window))
          (let* ((thing-symbol (mouse-sel-selection-thing selection))
                 (overlay (mouse-sel-selection-overlay selection))
                 (orig-window (selected-window))
-                (orig-window-frame (window-frame orig-window))
                 (top (nth 1 (window-edges orig-window)))
                 (bottom (nth 3 (window-edges orig-window)))
                 (mark-active nil)      ; inhibit normal region highlight
                 (top (nth 1 (window-edges orig-window)))
                 (bottom (nth 3 (window-edges orig-window)))
                 (mark-active nil)      ; inhibit normal region highlight
@@ -751,5 +747,4 @@ If `mouse-yank-at-point' is non-nil, insert at point instead."
 
 (provide 'mouse-sel)
 
 
 (provide 'mouse-sel)
 
-;; arch-tag: 86e6c73f-deaa-48d3-a24e-c565fda1f7d7
 ;;; mouse-sel.el ends here
 ;;; mouse-sel.el ends here