Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Cut and paste to Linux console
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
chipschap  
View profile  
 More options Oct 9 2012, 4:40 pm
Newsgroups: gnu.emacs.sources
From: chipschap <chipsc...@gmail.com>
Date: Tue, 9 Oct 2012 13:40:23 -0700 (PDT)
Local: Tues, Oct 9 2012 4:40 pm
Subject: Cut and paste to Linux console
I'd like to cut and paste between X-windows and EMACS in a Linux console (as in a Ctrl-Alt-F1 console). I put together the following small hack, which seems to work for my environment. But my question is, surely this has been done before? But I can't find it. Can anyone point me to a better way?

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Display assumed to be :0. This should become defcustom.

(defvar conclip-display)
(setq conclip-display ":0")

(defun conpaste ()
"Insert X-windows selection in console at point"
(interactive)

;; Insert X-windows selection at point in an emacs
;; console. (A real console, as gotten by
;; Ctrl-Alt-F1 etc.)

;; Load in .emacs (or equivalent)
;; (load-library "/whatever path you use/conclip.el")
;; or .elc if byte-compiled. Also maybe define a
;; global key sequence, like C-c C-y perhaps.
;; xsel must be installed. In Ubuntu, sudo apt-get xsel.

 (insert
   (shell-command-to-string
     (concat "xsel -b -o --display " conclip-display)))
)

(defun concopy ()
"Copy from console to X-windows clipboard"
(interactive)

;; Copy the current region to the X-windows clipboard.
;; As above, xclip is required, and this would be best
;; tied to a sequence like C-c C-w.

  (shell-command-on-region (point) (mark)
   (concat "xsel -b -i --display " conclip-display))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Monnier  
View profile  
 More options Oct 10 2012, 9:02 pm
Newsgroups: gnu.emacs.sources
From: Stefan Monnier <monn...@iro.umontreal.ca>
Date: Wed, 10 Oct 2012 21:02:21 -0400
Local: Wed, Oct 10 2012 9:02 pm
Subject: Re: Cut and paste to Linux console

> I'd like to cut and paste between X-windows and EMACS in a Linux
> console (as in a Ctrl-Alt-F1 console). I put together the following
> small hack, which seems to work for my environment. But my question
> is, surely this has been done before? But I can't find it. Can anyone
> point me to a better way?

There's xclip.el.
Also, you might be able to do it without an external program: let Emacs
itself open a discrete connection to the X server (you can only create
such a connection by creating a frame on that display, but you can make
that frame invisible; see server-select-display for an example) and
query/set the clipboard.

        Stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bob Newell  
View profile  
 More options Oct 11 2012, 1:47 am
Newsgroups: gnu.emacs.sources
From: Bob Newell <bobnew...@bobnewell.net>
Date: Wed, 10 Oct 2012 19:47:32 -1000
Local: Thurs, Oct 11 2012 1:47 am
Subject: Re: Cut and paste to Linux console

Stefan Monnier <monn...@iro.umontreal.ca> writes:
> Also, you might be able to do it without an external program: let Emacs
> itself open a discrete connection to the X server (you can only create
> such a connection by creating a frame on that display, but you can make
> that frame invisible; see server-select-display for an example) and
> query/set the clipboard.

Very interesting suggestion, I must try this out. Thank you.

--
Bob Newell
Honolulu, Hawai`i
* Sent via NoGnus 0.18-Emacs 23.1-Ubuntu Linux 10.04 *

--- news://freenews.netfront.net/ - complaints: n...@netfront.net ---


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kevin Ryde  
View profile  
 More options Oct 11 2012, 6:35 pm
Newsgroups: gnu.emacs.sources
From: Kevin Ryde <use...@zip.com.au>
Date: Fri, 12 Oct 2012 09:33:59 +1100
Local: Thurs, Oct 11 2012 6:33 pm
Subject: Re: Cut and paste to Linux console

chipschap <chipsc...@gmail.com> writes:

> I'd like to cut and paste between X-windows and EMACS in a Linux
> console (as in a Ctrl-Alt-F1 console). I put together the following
> small hack, which seems to work for my environment. But my question
> is, surely this has been done before?

I use a daemon to paste from X to gpm, or rather listen for a button
press using gpm and paste into the console ioctl.  Works into anything
on the console, such as a shell prompt etc.  In Emacs must turn off
gpm-mouse-mode so it doesn't take over the normal gpm operation.

http://user42.tuxfamily.org/x2gpm/index.html


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »