]> git.eshelyaron.com Git - emacs.git/commitdiff
(mouse-yank-primary): New function (almost same as mouse-yank-secondary).
authorRichard M. Stallman <rms@gnu.org>
Tue, 25 Dec 2007 20:09:05 +0000 (20:09 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 25 Dec 2007 20:09:05 +0000 (20:09 +0000)
etc/NEWS
lisp/ChangeLog
lisp/mouse.el

index d7e7f0f93c6df657557138df47240d9473697683..f23204c1cd5c75dd872902c7a65c71a0e346040a 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -157,9 +157,13 @@ in Transient Mark mode should make commands operate on that empty region.
 
 ** New command kill-matching-buffers kills buffers whose name matches a regexp.
 
-** `interprogram-paste-function' can now return one string or a list
-of strings.  In the latter case, Emacs puts the second and following
-strings on the kill ring.
+** You can disable kill ring commands from accessing the primary selection
+by setting `x-select-enable-primary' to nil.
+
+** If `select-active-regions' is t, setting the mark automatically
+makes the new region into the primary selection (for interaction with
+other window applications).  If you enable this, you might want to bind
+`mouse-yank-primary' to Mouse-2.
 
 ** Minibuffer changes:
 
@@ -457,6 +461,10 @@ the specified files).
 
 ** The new function `read-color' reads a color name using the minibuffer.
 
+** `interprogram-paste-function' can now return one string or a list
+of strings.  In the latter case, Emacs puts the second and following
+strings on the kill ring.
+
 ** Changes related to multiple tty support.
 
 *** $TERM is now set to `dumb' for subprocesses.  If you want to know the
index cca6ee0b296fb77737fc48b1e030a4fc83a547f2..27a302d7d015bb403339260d2601a0543b963fec 100644 (file)
@@ -1,3 +1,16 @@
+2007-12-25  Richard Stallman  <rms@gnu.org>
+
+       * simple.el (select-active-regions): New option.
+       (set-mark): Obey it.
+
+2007-12-25  David Golden  <david.delaharpe.golden@gmail.com>  (tiny change)
+
+       * term/x-win.el (x-select-enable-primary): New option.
+       (x-select-text, x-cut-buffer-or-selection-value): Obey it.
+
+       * mouse.el (mouse-yank-primary): New function (almost same
+       as mouse-yank-secondary).
+
 2007-12-25  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * calculator.el:
index 39882ca33c0250a1c243b630488bbd1156a4e7bd..8802aa983177ee1279b4458f33a1cec4882af9f7 100644 (file)
@@ -1358,6 +1358,20 @@ regardless of where you click."
   (setq mouse-selection-click-count 0)
   (yank arg))
 
+(defun mouse-yank-primary (click)
+  "Insert the primary selection at the position clicked on.
+Move point to the end of the inserted text.
+If `mouse-yank-at-point' is non-nil, insert at point
+regardless of where you click."
+  (interactive "e")
+  ;; Give temporary modes such as isearch a chance to turn off.
+  (run-hooks 'mouse-leave-buffer-hook)
+  (or mouse-yank-at-point (mouse-set-point click))
+  (let ((primary (x-get-selection 'PRIMARY)))
+    (if primary
+        (insert (x-get-selection 'PRIMARY))
+      (error "No primary selection"))))
+
 (defun mouse-kill-ring-save (click)
   "Copy the region between point and the mouse click in the kill ring.
 This does not delete the region; it acts like \\[kill-ring-save]."