From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id mIMGOCvfQmP+LwEAbAwnHQ (envelope-from ) for ; Sun, 09 Oct 2022 16:48:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id FzQVOCvfQmN6cAEA9RJhRA (envelope-from ) for ; Sun, 09 Oct 2022 16:48:11 +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 4B14F32C90 for ; Sun, 9 Oct 2022 16:48:11 +0200 (CEST) Received: from localhost ([::1]:38166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohXb8-0000OF-EI for larch@yhetil.org; Sun, 09 Oct 2022 10:48:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohXab-0000O6-7K for emacs-orgmode@gnu.org; Sun, 09 Oct 2022 10:47:37 -0400 Received: from stw1.rcdrun.com ([217.170.207.13]:56835) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohXaY-0001SH-U4 for emacs-orgmode@gnu.org; Sun, 09 Oct 2022 10:47:36 -0400 Received: from localhost ([::ffff:197.239.6.155]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 00000000000BBD14.000000006342DF05.00002414; Sun, 09 Oct 2022 07:47:31 -0700 Date: Sun, 9 Oct 2022 17:47:07 +0300 From: Jean Louis To: Samuel Wales Cc: Nick Econopouly , Maxim Nikulin , emacs-orgmode@gnu.org Subject: Re: idea for capture anywhere in x Message-ID: Mail-Followup-To: Samuel Wales , Nick Econopouly , Maxim Nikulin , emacs-orgmode@gnu.org References: <87sgbsq2t5.fsf@gmail.com> <87tuw31iub.fsf@mm.st> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/2.2.7+37 (a90f69b) (2022-09-02) Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_SBL=0.141, SPF_HELO_PASS=-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=1665326891; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=t+SvdRfB/6q8Lrj/PMcW7+NCa1Sk4y/J37BLoCOTdEI=; b=WkNPPK+UmEDcOXXTnAVS0QTl5ZmGzueIA9szE7FEEgtwBKZJV7GR3oGi/yzjgSe8fumLmq AW/nwX8FSxRE0L71YWiYax05sBlRbBIqeF4w3mJwvNbN4nL6eHsxOhfzK+zBKenj/F1sKV /Iqfoc4lMxl69FUqOvnHWwy+TBZKBiZp29aS1AhPagofR5q5wOZ2Q6kO6wIzmqPgA+AA75 yOew6YtY1/2/6SN70RVAKlHOQRUxOgE2ZQz8hONEB4WloSOcTVYIvbTpPAh19byj2XwUVp 5tXsUs+IKh09TFU33MGdYewpUz0ZxA7KuXv2WqSCHVssc6mzvmz15wU/5eDLfg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665326891; a=rsa-sha256; cv=none; b=lch8p4y/AbaPly+88F7HimmBHri3vJh4Vf6Y+aVPIe5ISMiRQyVe3CwFpPqU4y4BTS/a+o enwL+NgpOMczeXBBWcDsG1KeKFyds+BPmGPeSPRkHozlX/JRHWTxW3zQhnYaXEmH4yXb0p CbxFzhXzyoDBwcl3PlsoLO83ulcvnXGaMWxoDvLvs8Qhf7F+mIZ9iqi+P65WGz8lUgvEE8 BvHvHgNi3YPE1AA2n7DuhiTeKDiIXPU/cmhcaQZrKSc6hammqouwbZHZGzsBY5DRRlwHmJ wP3YsISBS5K8DkTzC9RGn5Aahasvdr4pmb4bGR5W4HCek9tcyyfXdNbO78+L7Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=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: 0.12 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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: 4B14F32C90 X-Spam-Score: 0.12 X-Migadu-Scanner: scn1.migadu.com X-TUID: UGuC3lc/6yxS * Samuel Wales [2022-06-10 05:37]: > with the org capture firefox extension broken, i recalled this old > thread, thinking it might be a fix, and i think i understand the > issue. so i thought i would summarize here in this one post. > > i think i was not clear in this thread in a few places. apologies for that. > > 1. > > [current need, urgent] i want to select text with mouse in firefox, > then have plain text and url save to an org entry. > > this would then replace the need for the firefox org-capture > extension. I have basic concept to capture X selection in file and get it in Emacs. It is not really related to Org, one can capture X selection and record it anyhow. There is no need for org-protocol this way. File: ~/bin/capture-x-selection.sh #!/usr/bin/bash TEMP=/tmp/xselection.txt xsel -o > $TEMP emacsclient -e "(rcd-handle-x-selection)" Settings in my IceWM window manager, in the file: ~/.icewm/keys: key Ctrl+F9 /home/data1/protected/bin/rcd/capture-x-selection.sh That means anywhere in X I press C-F9 and will invoke the function 'rcd-handle-x-selection (defun rcd-handle-x-selection () "Sample function to read X selection from file and switch to buffer." (raise-frame) (let* ((my-org-files '("~/myorg1.org" "~/myorg2.org")) (my-org-file (completing-read "Choose Org file: " my-org-files))) (find-file my-org-file) (goto-char (point-max)) (rcd-my-note) (save-some-buffers t))) (define-skeleton rcd-my-note "Fill template by using variables" nil "** " (skeleton-read "Heading: ") "\n\n" (skeleton-read "Describe this capture: ") (when (file-exists-p "/tmp/xselection.txt") (with-temp-buffer (insert-file-contents "/tmp/xselection.txt") (buffer-string))) "\n\n") I could as well connect it to org-protocol, but I ask myself why, as I do not append stuff to Org files, I don't like feeling maltreated by limitations of Org programs. 👀 Workflow: Condition is to use Emacs server with emacsclient. 1. Mark anything in X like any selection; 2. Press your favorite key binding in the X manager like Ctrl-F9 3. Emacs appears and runs skeleton rcd-my-note which in this case does something similar like Org, but it is not related to Org really. One can as well make this way Markdown notes or any other types of notes by using Emacs. Let us say this way for Asciidoc notes: --------------------------------------- File: ~/bin/capture-x-selection.sh #!/usr/bin/bash TEMP=/tmp/xselection.txt xsel -o > $TEMP emacsclient -e "(rcd-handle-x-selection)" Settings in my IceWM window manager, in the file: ~/.icewm/keys: key Ctrl+F9 /home/data1/protected/bin/rcd/capture-x-selection.sh (defun rcd-handle-x-selection () "Sample function to read X selection from file and switch to buffer." (raise-frame) (let* ((my-files '("~/mynotes1.adoc" "~/mynotes2.adoc")) (my-file (completing-read "Choose Asciidoc file: " my-files))) (find-file my-file) (goto-char (point-max)) (rcd-my-note) (save-some-buffers t))) (define-skeleton rcd-my-note "Fill template by using variables" nil "== " (skeleton-read "Heading: ") "\n\n" (skeleton-read "Describe this capture: ") (when (file-exists-p "/tmp/xselection.txt") (with-temp-buffer (insert-file-contents "/tmp/xselection.txt") (buffer-string))) "\n\n") -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/