From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id UHo+ENj2RmP3LAEAbAwnHQ (envelope-from ) for ; Wed, 12 Oct 2022 19:18:16 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 2NlbENj2RmPL7QAAauVa8A (envelope-from ) for ; Wed, 12 Oct 2022 19:18:16 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1B885136CE for ; Wed, 12 Oct 2022 19:17:46 +0200 (CEST) Received: from localhost ([::1]:46152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oifMX-0005Ls-8J for larch@yhetil.org; Wed, 12 Oct 2022 13:17:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oifLe-0005Kg-Ho for emacs-orgmode@gnu.org; Wed, 12 Oct 2022 13:16:50 -0400 Received: from ciao.gmane.io ([116.202.254.214]:43348) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oifLc-0008WD-PY for emacs-orgmode@gnu.org; Wed, 12 Oct 2022 13:16:50 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1oifLa-0002ai-AM for emacs-orgmode@gnu.org; Wed, 12 Oct 2022 19:16:46 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: idea for capture anywhere in x Date: Thu, 13 Oct 2022 00:16:38 +0700 Message-ID: References: <87tuw31iub.fsf@mm.st> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 23 X-Spam_score: 2.3 X-Spam_bar: ++ X-Spam_report: (2.3 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-0.528, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1665595066; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ZvBwaBmndpl9OS2tHMOL7QnTGZ3uxIzHVtUcB2awa4s=; b=LGmS3dpCF/wHwr0Z2z4SKjChBH2zzWeJ+xTO0mMG8BCakWmt7Sp6ztxECWmsr3O+ybx49B UhGJGYYeF08ad2ME6QRFPi2LgKnVN4+Sd83oEUVUbfE8HuzARMyXKo08eiLOt+q7vbnaqd 38ZuZcmx9VO6r/jHeZQKPgaM0eGqGQEqxJsdB7/Q+rp2VpjBKu7BJjtGcssrX/YRX+jA9y Rf09GoAkIr9NNgVdqDR24khNN5Ow0qGhryaqG+361ikWGOTzBIenObF7mJPyRr9zj2s4w1 H1+ragbbB7RV96kjTQ9u6WPLKi7+2o20w/S5BH3Y06Hsl42CRF8L+IzZTvsMLA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665595066; a=rsa-sha256; cv=none; b=GZ8RPjCyXjMPlJFkbcYuxssSd6ODMDzdXIbus0qrESxWdVHlfkqzI9jKXMs3pmqg0KppDO pIkHBxNv4pcFWBtRZhN2UpwNuwLKeVH6q79ervUP5oOPGI2W9znr69g2kJhhNaO7NO1xlK go/n/xuOkDRkZCOQssANWnmEwLFDTzdBy7QgHP36nInkkoCaxTdgC0bJT5HktNUs2Wobiu dFSxUodJUI73fmqkfDFzi/iT9SOfO7lIm+F6CzfHHt16S/42ws5UXJFx8pVYS7HvBAumqZ DjSNDW7/AVHugoT5nRd600BEkT2A2+LaRX4w2wi4ccnfolmwYnIu8rwQSN5zjQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 2.00 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 1B885136CE X-Spam-Score: 2.00 X-Migadu-Scanner: scn0.migadu.com X-TUID: 85B/NZKgJ5sJ On 11/10/2022 05:06, Jean Louis wrote: >> Jean, make a pause and think ones more. It does not mean extra click >> and implies nothing different from you recipe. > > Instead of thinking, I am doing it. I consider it as a problem. It is better to think at first. > Did you try to invoke Emacs without having Emacs in front of you? Just because actually selected text in browser may be quite different from expectations (due to various tricks on web pages, not to mention that JS may completely overwrite clipboard content) I prefer to see capture result. That is why I decided to ensure that an emacs frame is created (if no one exists yet) when I invoke capture. (Without additional efforts from my side the frame is marked as required attention even if it is on another virtual desktop, so I can switch to it using a DE shortcut.) Perhaps requirement of a frame is the reason why I avoided a kind of pitfall you have in mind. If there is no running Emacs daemon yet, it may be started on demand either through systemd socket activation or by emacsclient -a "" ... I do not see any problem here. If you mean that Emacs can not access X selection if no frames created yet then I agree, behavior is strange. On the other hand I do not understand why Emacs must be in front of me. A frame may be hidden. emacsclient -a "" --eval "(server-select-display (getenv \"DISPLAY\"))" emacsclient --eval "(require 'org-compat)" --eval "(org-get-x-clipboard 'CLIPBOARD)" Emacs is not "in front of me", but selection is accessible. Such kind of action may be assigned to DE or WM shortcut so I do not see any reason why mouse must be involved to get selection (in a way quite similar to C-y). > Here is updated bash file, .. > > #!/usr/bin/bash > TEMP=/tmp/xselection.txt > xsel -o > $TEMP Such way to work with temporary files is unsafe. > Capturing notes shall not IMHO be limited to Org mode as that limits > users to specific lightweight markup language (Org). I do not mind, but nobody has created a more generic solution that Org can use as a base to implement its features. That is why I wrote >> If Emacs had generic enough functions to create captures then Org would >> reuse it as it extends outline mode. Maybe such tools should be added to >> Emacs, but they should be designed at first. >> A browser extension is a straightforward way to add page URL to the >> quoted text. > > I don't know which quoted text you mean and how to add page URL to > quoted text. I mean a note consisting of page title, page URL, and a quote with text selected on the page. Firefox exposes URL to selection, but I consider a browser extension as a better variant. You mentioned one extension, another one is https://github.com/sprig/org-capture-extension/ >> Plain text files stored in a version control system allows to review >> changes done at specific time interval. > > To use version control system is non-trivial. To use Emacs is > non-trivial. Org, anything. What is trivial is to use simple > applications how they are designed on mobile devices. Backups, history of changes, and compatibility over decades may be serious issues with "simple applications". > Computer thinks for me.