[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mouse-yank-secondary when no secondary

From: Drew Adams
Subject: mouse-yank-secondary when no secondary
Date: Wed, 30 Jan 2008 13:27:29 -0800

emacs -Q
M-mouse-2 gives this error:
Wrong type argument: char-or-string-p, nil
I've used this in my own code for years; it might be a sufficient fix:
(defun mouse-yank-secondary (event)
  "Insert the secondary 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 event))
  (let ((secondary (x-get-selection 'SECONDARY)))
    (if secondary
        (insert (x-get-selection 'SECONDARY))
      (error "No secondary selection"))))
In GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600)
 of 2007-06-02 on RELEASE
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --cflags -Ic:/gnuwin32/include'

reply via email to

[Prev in Thread] Current Thread [Next in Thread]