From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Could you possibly DTRT with this for me? Date: Wed, 18 Feb 2004 03:39:24 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1077094230 10662 80.91.224.253 (18 Feb 2004 08:50:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 18 Feb 2004 08:50:30 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Feb 18 09:50:20 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AtNPQ-0000Vx-00 for ; Wed, 18 Feb 2004 09:50:20 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AtNPP-00036c-01 for ; Wed, 18 Feb 2004 09:50:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AtNMJ-0003CU-JQ for emacs-devel@quimby.gnus.org; Wed, 18 Feb 2004 03:47:07 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AtNIV-0001T4-Tr for emacs-devel@gnu.org; Wed, 18 Feb 2004 03:43:11 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AtNIE-0001JX-NA for emacs-devel@gnu.org; Wed, 18 Feb 2004 03:43:02 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AtNID-0001HU-KL for emacs-devel@gnu.org; Wed, 18 Feb 2004 03:42:53 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.24) id 1AtNEq-0004U2-Sn for emacs-devel@gnu.org; Wed, 18 Feb 2004 03:39:24 -0500 Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:20041 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:20041 Matthieu sent this change, and I asked him to explain it. He now has explained it. I see it is a real minor bug, but I am not sure what the best clean fix is here. Is there anyone who can think about it? From: Richard Stallman To: matthieu.moy@st.com In-reply-to: (matthieu.moy@st.com) Subject: Re: Small bug in term.el -- With correction. bcc: rms-outgoing@gnu.org Reply-to: rms@gnu.org References: --text follows this line-- I am not sure what to do with this. It doesn't seem to be a correction to anything in term.el. Can you explain what problem it is meant to solve? I'm using the following : (defun term-mouse-paste-secondary (click arg) "Insert the last stretch of killed text at the position clicked on." (interactive "e\nP") (term-if-xemacs (term-send-raw-string (or (condition-case () (x-get-selection 'SECONDARY) (error ())) (x-get-cutbuffer) (error "No selection or cut buffer available")))) (term-ifnot-xemacs ;; Give temporary modes such as isearch a chance to turn off. (run-hooks 'mouse-leave-buffer-hook) (setq this-command 'yank) (term-send-raw-string (condition-case () (x-get-selection 'SECONDARY) (error ()))))) (defun my-mouse-yank-secondary (CLICK) "Insert the secondary selection at point regardless of where you click." (interactive "e") (if (eq major-mode 'term-mode) (term-mouse-paste-secondary CLICK nil) (mouse-yank-secondary CLICK))) and I call my-mouse-yank-secondary instead of mouse-yank-secondary. This should be doable also with defadvice. X-Authentication-Warning: crx753.crocrd: mm43 set sender to Matthieu.Moy@st.com using -f To: rms@gnu.org Subject: Re: Small bug in term.el -- With correction. From: Matthieu Moy Date: Mon, 12 Jan 2004 19:10:22 +0100 In-Reply-To: (rms@gnu.org's message of "Sat, 3 Jan 2004 22:53:06 -0500") X-Spam-Status: No, hits=-3.4 required=5.0 tests=EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_GNUS_UA,X_AUTH_WARNING version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) rms@gnu.org writes: > I am not sure what to do with this. It doesn't seem to be > a correction to anything in term.el. Can you explain what > problem it is meant to solve? Mouse secondary selection paste doesn't really work inside a terminal emulation : If you make a secondary selection on the word "ls", then, go to a *ansi-term* buffer, and M-mouse2, then the text is /inserted/ in the buffer, but not passed to the shell. Type for example : Nothing happens because the shell has received an empty command line. This is why term.el has a re-implementation of mouse-yank-at-click, but the problem is that this works only for primary selection. rms@gnu.org writes: > I'm using the following workaround : > > (define-key term-raw-map (kbd "") '(lambda (c a) > (interactive "e\nP") > (mouse-set-point c) > (term-mouse-paste c > a))) If you have mouse-yank-at-point to t, yes. But I don't, and I often have my cursor in the term buffer, and use mouse to secondary-select text in another buffer, and then, M-mouse-2 in the other buffer. This is why (define-key term-raw-map (kbd "") ...) is not sufficient, and I have to use this > (if (eq major-mode 'term-mode) > (term-mouse-paste-secondary CLICK nil) > (mouse-yank-secondary CLICK))) Because this tells me in which mode *the buffer containing the cursor* is, and not the buffer in which i clicked. The advantage : It works. The inconveinient : It adds references to term.el outside term.el ... Is it more clear ? -- Matthieu MOY