From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 sPIgLYNWRGMZzgAAbAwnHQ (envelope-from ) for ; Mon, 10 Oct 2022 19:29:39 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id CPW8LINWRGONfQEA9RJhRA (envelope-from ) for ; Mon, 10 Oct 2022 19:29:39 +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 777D22FBA3 for ; Mon, 10 Oct 2022 19:29:39 +0200 (CEST) Received: from localhost ([::1]:40332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohwaw-0007V5-HK for larch@yhetil.org; Mon, 10 Oct 2022 13:29:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohwOs-000569-Ti for emacs-orgmode@gnu.org; Mon, 10 Oct 2022 13:17:10 -0400 Received: from ciao.gmane.io ([116.202.254.214]:56210) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohwOp-0003NG-1i for emacs-orgmode@gnu.org; Mon, 10 Oct 2022 13:17:10 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1ohwOm-0002AD-1g for emacs-orgmode@gnu.org; Mon, 10 Oct 2022 19:17:04 +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: Tue, 11 Oct 2022 00:16:55 +0700 Message-ID: References: <87sgbsq2t5.fsf@gmail.com> <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: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 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.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-2.007, 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=1665422979; 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=x3iszsVYqDZYjXD8oVgCP/v5LLoKf3QVsn5LsAtEWfc=; b=a7ng1gVvy2Tzyp4bJuXIrNWfVHjvSx7QYoN9UbBYrJjM63G+ZhR08EeHAieKkgkDlwNk20 FgPi4H2RTGUg/DAr/yxV3lBU59L7u58vfyjdtmuKkWixi5HN6zKeJMhP78+hfnu0sGzngx AjQUs20LW1yLeVJ8B8X73rPQkYwz8sN6v13p6rLdYBCBY9sW/aX0UEjZpzpvdqT1K8XUdM 6QYW1VrBKK7ugv79wKCco6aqHBd3gooCr1RWZzE4qZ2N9d9TdFSlr9bKmVnuSY2IopMCAk IVD9CV0rBBkslFEv62krMASl5xpSO26BRIiXFer2/QCcbGPZZRViuZajJhZvrA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665422979; a=rsa-sha256; cv=none; b=lh9lDPfiqZ/z3w2csJHggH+2LLvp1R1fdrEbN9oUTg6r27M9EK3vkFv68LSkbQoL/Gddhc KW9XXPfrtjdYf/obiID5uOhp97rFXldyYI7ewmjwYCEjKV9uEs30CBO2tlClHcqqPTTW6T Nde/rUU3xpVYIskHj0K5pNOljXsI54Dhv5FT0p9yeMXGph/DE+KdKho3ThT79B+nDD6MhD 5/M7scuyKHQDJdOrVHcvKnL0wuJAX8YtKMJrlDGcvE6ZyUrQQrQ66pnj4GsUFhCYz3fqim Z8Bh9VGFUR1l8QxSWbFV2o5Xn2SXNe8uYv0tinGznk8Edn+CYLLl0cGCz9Ft1g== 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.81 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: 777D22FBA3 X-Spam-Score: 2.81 X-Migadu-Scanner: scn0.migadu.com X-TUID: APrviywZGOcG On 10/10/2022 00:08, Jean Louis wrote: > * Max Nikulin [2022-10-09 19:41]: >> On 09/10/2022 21:47, Jean Louis wrote: >>> >>> File: ~/bin/capture-x-selection.sh >>> >>> #!/usr/bin/bash >>> TEMP=/tmp/xselection.txt >>> xsel -o > $TEMP >> >> (perhaps unsafe) intermediate file is redundant. Emacs can >> access text/plain target of PRIMARY_SELECTION and CLIPBOARD directly > > Directly of courseworks, but that would mean that you have to make > several clicks, not just one click. It also implies you must have > Emacs in front of you, and not sitting around as server in background > or anywhere. Jean, make a pause and think ones more. It does not mean extra click and implies nothing different from you recipe. Years ago I was taught to the following approach: when you came to a solution, look at it and try to figure out if it is possible to achieve the same in a shorter and more clear way. If `yank' command can get selection contents then you can do the same in your function and avoid problems with intermediate files. In Org it can be achieved with a simple capture template (even org-protocol is not necessary), but you prefer your own solution having enough limitations. 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. >> The idea of org-protocol is to pass more data. > > It is structured data, something like '(:url "https://www.example.com" > :title "Something" :body "More here") and it may be anything in > general. > > But no, I don't find it appealing in itself apart from using those > ready made browser extensions. A browser extension is a straightforward way to add page URL to the quoted text. > In fact when we speak of capturing any selection from X, I would not > like relying on Emacs, it would be better using SQLite or PostgreSQL > for that. Plain text files stored in a version control system allows to review changes done at specific time interval. Databases require a non-trivial layer to allow reverting of particular changes. So a database is not better, it is *different* use case.