help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to copy and paste from unity to emacs in the terminal version ?


From: Grant Rettke
Subject: Re: How to copy and paste from unity to emacs in the terminal version ?
Date: Sat, 16 Aug 2014 07:51:44 -0500

Untested:

http://blog.binchen.org/posts/paste-string-from-clipboard-into-minibuffer-in-emacs.html
Grant Rettke | ACM, ASA, FSF, IEEE, SIAM
gcr@wisdomandwonder.com | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson


On Sat, Aug 16, 2014 at 6:29 AM, Quanyang Liu <lqymgt@gmail.com> wrote:
> On Sat, Aug 16 2014 at 19:09:27 +0800, David Hume wrote:
>> Kro Ly <mnmnmnmna@gmail.com> writes:
>>
>>> Hi, i'm using emacs in the terminal and I'd like to know how to copy
>>> and paste something from firefox to emacs for instance ?
>>> Thanks.
>>
>> That depends on the terminal I think. If it is xterm you can press the
>> middle mouse button to paste.
> Maybe you can try to use xsel. The way I use is below:
>
> ;; use xsel to copy/paste in emacs-nox
> (unless window-system
>   (when (getenv "DISPLAY")
>         (defun xsel-cut-function (text &optional push)
>           (with-temp-buffer
>                 (insert text)
>                 (call-process-region (point-min) (point-max) "xsel" nil 0 nil 
> "--clipboard" "--input")))
>         (defun xsel-paste-function()
>           (let ((xsel-output (shell-command-to-string "xsel --clipboard 
> --output")))
>                 (unless (string= (car kill-ring) xsel-output)
>                   xsel-output )))
>         (setq interprogram-cut-function 'xsel-cut-function)
>         (setq interprogram-paste-function 'xsel-paste-function)
>         ))
>
> --
> Quanyang Liu (刘全阳)
> Undergraduate
> Department of Computer Science and Engineering
> Shanghai Jiao Tong University
>



reply via email to

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