GNU bug report logs - #46704
X clipboard is always empty with emacs server without emacsclient running

Previous Next

Package: emacs;

Reported by: Parvesh Monu <parvesh.dhullmonu <at> gmail.com>

Date: Mon, 22 Feb 2021 10:03:02 UTC

Severity: normal

Tags: notabug

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 46704 in the body.
You can then email your comments to 46704 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#46704; Package emacs. (Mon, 22 Feb 2021 10:03:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Parvesh Monu <parvesh.dhullmonu <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 22 Feb 2021 10:03:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Parvesh Monu <parvesh.dhullmonu <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: X clipboard is always empty with emacs server without emacsclient
 running
Date: Mon, 22 Feb 2021 14:07:39 +0530
[Message part 1 (text/plain, inline)]
I have this template which captures clipboard content in file. It works 
fine when emacsclient is running, but if no client is running then 
server adds empty entry.

(add-to-list 'org-capture-templates
       '("x" "Clips" entry (file+headline "/home/user/desktop/clips" 
"Clips")
         "** %x" :immediate-finish t :prepend t))


*System:* 5.10.16-arch1-1
*Desktop Environment:* xfce
*GNU Emacs 27.1*

[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#46704; Package emacs. (Mon, 22 Feb 2021 14:56:01 GMT) Full text and rfc822 format available.

Message #8 received at 46704 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Parvesh Monu <parvesh.dhullmonu <at> gmail.com>
Cc: 46704 <at> debbugs.gnu.org
Subject: Re: bug#46704: X clipboard is always empty with emacs server
 without emacsclient running
Date: Mon, 22 Feb 2021 15:55:15 +0100
Parvesh Monu <parvesh.dhullmonu <at> gmail.com> writes:

> I have this template which captures clipboard content in file. It works fine when
> emacsclient is running, but if no client is running then server adds empty entry.
>
> (add-to-list 'org-capture-templates
>        '("x" "Clips" entry (file+headline "/home/user/desktop/clips" "Clips")
>          "** %x" :immediate-finish t :prepend t))

I'm not quite sure I understand you correctly here -- but I think you're
saying that if you start "emacs --daemon", then that daemonised Emacs
can't communicate with the X clipboard?

I'm not sure, but doesn't that sound quite natural?  If you don't have
an X window open, then you can't talk to the X server, so you can't
access the clipboard, either.

I don't know how Org is talking to the clipboard, though.  Anybody?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#46704; Package emacs. (Mon, 22 Feb 2021 15:54:01 GMT) Full text and rfc822 format available.

Message #11 received at 46704 <at> debbugs.gnu.org (full text, mbox):

From: Parvesh Monu <parvesh.dhullmonu <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 46704 <at> debbugs.gnu.org
Subject: Re: bug#46704: X clipboard is always empty with emacs server without
 emacsclient running
Date: Mon, 22 Feb 2021 21:22:57 +0530
[Message part 1 (text/plain, inline)]
I don't know if it will help, but I found workaround to capture X-clipboard.

Since %x doesn't work with daemon, I used %i and passed X-clipboard's
content using xsel. Like,

xdg-open "org-protocol://capture?template=h&body=`xsel`"

On Mon, Feb 22, 2021, 8:25 PM Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

> Parvesh Monu <parvesh.dhullmonu <at> gmail.com> writes:
>
> > I have this template which captures clipboard content in file. It works
> fine when
> > emacsclient is running, but if no client is running then server adds
> empty entry.
> >
> > (add-to-list 'org-capture-templates
> >        '("x" "Clips" entry (file+headline "/home/user/desktop/clips"
> "Clips")
> >          "** %x" :immediate-finish t :prepend t))
>
> I'm not quite sure I understand you correctly here -- but I think you're
> saying that if you start "emacs --daemon", then that daemonised Emacs
> can't communicate with the X clipboard?
>
> I'm not sure, but doesn't that sound quite natural?  If you don't have
> an X window open, then you can't talk to the X server, so you can't
> access the clipboard, either.
>
> I don't know how Org is talking to the clipboard, though.  Anybody?
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#46704; Package emacs. (Sun, 19 Jun 2022 13:52:02 GMT) Full text and rfc822 format available.

Message #14 received at 46704 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Parvesh Monu <parvesh.dhullmonu <at> gmail.com>
Cc: 46704 <at> debbugs.gnu.org
Subject: Re: bug#46704: X clipboard is always empty with emacs server
 without emacsclient running
Date: Sun, 19 Jun 2022 15:51:27 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I'm not quite sure I understand you correctly here -- but I think you're
> saying that if you start "emacs --daemon", then that daemonised Emacs
> can't communicate with the X clipboard?
>
> I'm not sure, but doesn't that sound quite natural?  If you don't have
> an X window open, then you can't talk to the X server, so you can't
> access the clipboard, either.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

I think the conclusion here is that this is working as it should, so I'm
closing this bug report.  If I misunderstood, please respond to the
debbugs address and we'll reopen.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) notabug. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 19 Jun 2022 13:52:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 46704 <at> debbugs.gnu.org and Parvesh Monu <parvesh.dhullmonu <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 19 Jun 2022 13:52:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#46704; Package emacs. (Mon, 20 Jun 2022 01:22:02 GMT) Full text and rfc822 format available.

Message #21 received at 46704 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 46704 <at> debbugs.gnu.org, Parvesh Monu <parvesh.dhullmonu <at> gmail.com>
Subject: Re: bug#46704: X clipboard is always empty with emacs server
 without emacsclient running
Date: Mon, 20 Jun 2022 09:21:12 +0800
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

>> I'm not sure, but doesn't that sound quite natural?  If you don't have
>> an X window open, then you can't talk to the X server, so you can't
>> access the clipboard, either.

Actually, that's not quite correct: Emacs can talk to the X server as
long as the terminal object remains available, but there is no way for
_other_ clients to ask for the contents of Emacs's selections if it
doesn't have at least one open frame that can be used as the owner for
the selection(s).




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 18 Jul 2022 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 358 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.