branch: master commit 2c58a116c0c2a909fb57a1423e2e84c23a186eff Author: Stefan Monnier <monn...@iro.umontreal.ca> Commit: Stefan Monnier <monn...@iro.umontreal.ca>
* packages/xclip/xclip.el: Fix it when loaded before term/xterm.el (gui-backend-set-selection): Make sure our override indeed takes precedence. --- packages/xclip/xclip.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/xclip/xclip.el b/packages/xclip/xclip.el index ead5111..7e5cae7 100644 --- a/packages/xclip/xclip.el +++ b/packages/xclip/xclip.el @@ -1,11 +1,11 @@ ;;; xclip.el --- Copy&paste GUI clipboard from text terminal -*- lexical-binding:t -*- -;; Copyright (C) 2007-2019 Free Software Foundation, Inc. +;; Copyright (C) 2007-2020 Free Software Foundation, Inc. ;; Author: Leo Liu <sdl....@gmail.com> ;; Keywords: convenience, tools ;; Created: 2007-12-30 -;; Version: 1.9 +;; Version: 1.10 ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -266,15 +266,18 @@ Emacs-NN and is then later run by Emacs>NN." nil)) ;; BIG UGLY HACK! - ;; xterm.el has a defmethod to use some (poorly supported) escape + ;; term/xterm.el has a defmethod to use some (poorly supported) escape ;; sequences (code named OSC 52) for clipboard interaction, and enables ;; it by default. - ;; Problem is, that its defmethod takes precedence over our defmethod, + ;; Problem is that its defmethod takes precedence over our defmethod, ;; so we need to disable it in order to be called. (cl-defmethod gui-backend-set-selection :extra "xclip-override" (selection-symbol value &context (window-system nil) - ((terminal-parameter nil 'xterm--set-selection) (eql t))) + ((terminal-parameter nil 'xterm--set-selection) (eql t)) + ;; This extra test gives this method higher precedence + ;; over the one in term/xterm.el. + ((featurep 'term/xterm) (eql t))) ;; Disable this method which doesn't work anyway in 99% of the cases! (setf (terminal-parameter nil 'xterm--set-selection) nil) ;; Try again!