unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Copy variable to system clipboard (as simpleclip)
@ 2017-08-07 23:11 Tim Johnson
  2017-08-08  0:23 ` Emanuel Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Tim Johnson @ 2017-08-07 23:11 UTC (permalink / raw)
  To: Emacs

Using emacs 25.1.1 in graphic mode on linux ubuntu 14.04. Clipboard
manager is glipper 2.4

I use simpleclip routinely so that I can copy and paste from the
system clipboard without affecting the emacs kill ring. However, I
could use a function that would copy any string variable (such as
output from buffer-file-name) to the system clipboard. 

Is such function available?

thanks
-- 
Tim 
http://www.akwebsoft.com, http://www.tj49.com



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Copy variable to system clipboard (as simpleclip)
  2017-08-07 23:11 Copy variable to system clipboard (as simpleclip) Tim Johnson
@ 2017-08-08  0:23 ` Emanuel Berg
  2017-08-08  0:58   ` Tim Johnson
  0 siblings, 1 reply; 6+ messages in thread
From: Emanuel Berg @ 2017-08-08  0:23 UTC (permalink / raw)
  To: help-gnu-emacs

Tim Johnson wrote:

> I use simpleclip routinely so that I can copy
> and paste from the system clipboard without
> affecting the emacs kill ring. However,
> I could use a function that would copy any
> string variable (such as output from
> buffer-file-name) to the system clipboard.
>
> Is such function available?

Yes, use xsel(1x) as I did here - one of the
first things I wrote in Elisp by the way -
could probably benefit from an upgrade, but
hey, if it ain't broke, fix it, to make sure
it is!

    http://user.it.uu.se/~embe8573/emacs-init/xsel.el

-- 
underground experts united
http://user.it.uu.se/~embe8573




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Copy variable to system clipboard (as simpleclip)
  2017-08-08  0:23 ` Emanuel Berg
@ 2017-08-08  0:58   ` Tim Johnson
  2017-08-08  1:15     ` Tim Johnson
  0 siblings, 1 reply; 6+ messages in thread
From: Tim Johnson @ 2017-08-08  0:58 UTC (permalink / raw)
  To: help-gnu-emacs

* Emanuel Berg <moasen@zoho.com> [170807 16:36]:
> Tim Johnson wrote:
> 
> > I use simpleclip routinely so that I can copy
> > and paste from the system clipboard without
> > affecting the emacs kill ring. However,
> > I could use a function that would copy any
> > string variable (such as output from
> > buffer-file-name) to the system clipboard.
> >
> > Is such function available?
> 
> Yes, use xsel(1x) as I did here - one of the
> first things I wrote in Elisp by the way -
> could probably benefit from an upgrade, but
> hey, if it ain't broke, fix it, to make sure
> it is!
> 
>     http://user.it.uu.se/~embe8573/emacs-init/xsel.el

  Thanks Emanuel. I just installed xsel and will play with your code
  later (or tomorrow).

  cheers
-- 
Tim 
http://www.akwebsoft.com, http://www.tj49.com



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Copy variable to system clipboard (as simpleclip)
  2017-08-08  0:58   ` Tim Johnson
@ 2017-08-08  1:15     ` Tim Johnson
  2017-08-08 18:09       ` Emanuel Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Tim Johnson @ 2017-08-08  1:15 UTC (permalink / raw)
  To: help-gnu-emacs

* Tim Johnson <tim@akwebsoft.com> [170807 17:01]:
> * Emanuel Berg <moasen@zoho.com> [170807 16:36]:
> > Tim Johnson wrote:
> > 
> > > I use simpleclip routinely so that I can copy
> > > and paste from the system clipboard without
> > > affecting the emacs kill ring. However,
> > > I could use a function that would copy any
> > > string variable (such as output from
> > > buffer-file-name) to the system clipboard.
> > >
> > > Is such function available?
> > 
> > Yes, use xsel(1x) as I did here - one of the
> > first things I wrote in Elisp by the way -
> > could probably benefit from an upgrade, but
> > hey, if it ain't broke, fix it, to make sure
> > it is!
> > 
> >     http://user.it.uu.se/~embe8573/emacs-init/xsel.el
> 
>   Thanks Emanuel. I just installed xsel and will play with your code
>   later (or tomorrow).
   Update: Seems to work. I owe you a beer. :)
-- 
Tim 
http://www.akwebsoft.com, http://www.tj49.com



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Copy variable to system clipboard (as simpleclip)
  2017-08-08  1:15     ` Tim Johnson
@ 2017-08-08 18:09       ` Emanuel Berg
  2017-08-08 23:49         ` Tim Johnson
  0 siblings, 1 reply; 6+ messages in thread
From: Emanuel Berg @ 2017-08-08 18:09 UTC (permalink / raw)
  To: help-gnu-emacs

Tim Johnson wrote:

> Update: Seems to work. I owe you a beer. :)

Owe me a beer? Have you never heard of free
software, with "free" as in free beer?

Anyway I went thru the code today after all
these years, and found a couple of small things
to change:

    http://user.it.uu.se/~embe8573/emacs-init/xsel.el

I also added this:

    (defun x-copy-symbol (sym)
      "Copy the value of SYM to the X clipboard."
      (interactive "S Symbol: ")
      (let*((val (symbol-value sym))
            (str (format "%s" val)) )
        (set-X-clipboard-to-string str) ))
    ;; Test:
    ;; (progn (x-copy-symbol 'fill-column)         (insert-X-clipboard))
    ;; (progn (call-interactively #'x-copy-symbol) (insert-X-clipboard))

Keep it up :)

-- 
underground experts united
http://user.it.uu.se/~embe8573




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Copy variable to system clipboard (as simpleclip)
  2017-08-08 18:09       ` Emanuel Berg
@ 2017-08-08 23:49         ` Tim Johnson
  0 siblings, 0 replies; 6+ messages in thread
From: Tim Johnson @ 2017-08-08 23:49 UTC (permalink / raw)
  To: help-gnu-emacs

* Emanuel Berg <moasen@zoho.com> [170808 10:22]:
> Tim Johnson wrote:
> 
> > Update: Seems to work. I owe you a beer. :)
> 
> Owe me a beer? Have you never heard of free
> software, with "free" as in free beer?
> 
> Anyway I went thru the code today after all
> these years, and found a couple of small things
> to change:
> 
>     http://user.it.uu.se/~embe8573/emacs-init/xsel.el
> 
> I also added this:
> 
>     (defun x-copy-symbol (sym)
>       "Copy the value of SYM to the X clipboard."
>       (interactive "S Symbol: ")
>       (let*((val (symbol-value sym))
>             (str (format "%s" val)) )
>         (set-X-clipboard-to-string str) ))
>     ;; Test:
>     ;; (progn (x-copy-symbol 'fill-column)         (insert-X-clipboard))
>     ;; (progn (call-interactively #'x-copy-symbol) (insert-X-clipboard))
> 
> Keep it up :)
  Thanks again!
-- 
Tim 
http://www.akwebsoft.com, http://www.tj49.com



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-08-08 23:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-07 23:11 Copy variable to system clipboard (as simpleclip) Tim Johnson
2017-08-08  0:23 ` Emanuel Berg
2017-08-08  0:58   ` Tim Johnson
2017-08-08  1:15     ` Tim Johnson
2017-08-08 18:09       ` Emanuel Berg
2017-08-08 23:49         ` Tim Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).