From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id uAMBBy2VWF8nBwAA0tVLHw (envelope-from ) for ; Wed, 09 Sep 2020 08:41:17 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 5xrKAi2VWF/AEwAAbx9fmQ (envelope-from ) for ; Wed, 09 Sep 2020 08:41:17 +0000 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 B6F7D9401D0 for ; Wed, 9 Sep 2020 08:41:16 +0000 (UTC) Received: from localhost ([::1]:44800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kFvfH-0003dx-J6 for larch@yhetil.org; Wed, 09 Sep 2020 04:41:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFved-0003VM-41 for emacs-orgmode@gnu.org; Wed, 09 Sep 2020 04:40:35 -0400 Received: from se13.route25.eu ([2a00:f10:121:a00:1c00:efff:fe00:1854]:54902) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFveZ-0007Ji-1A for emacs-orgmode@gnu.org; Wed, 09 Sep 2020 04:40:34 -0400 Date: Wed, 9 Sep 2020 10:40:02 +0200 From: Russell Adams To: emacs-orgmode@gnu.org Subject: Re: idea for capture anywhere in x Message-ID: <20200909084002.GE1036@maokai> Mail-Followup-To: emacs-orgmode@gnu.org References: <87sgbsq2t5.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Originating-IP: 185.87.184.57 X-SpamExperts-Domain: out.pcextreme.nl X-SpamExperts-Username: 185.87.184.57 X-SpamExperts-Outgoing-Class: ham X-SpamExperts-Outgoing-Evidence: Combined (0.15) X-Recommended-Action: accept X-Filter-ID: Mvzo4OR0dZXEDF/gcnlw0Ux9i8jFyHj5FzBttN4d2CmpSDasLI4SayDByyq9LIhVUZbR67CQ7/vm /hHDJU4RXkTNWdUk1Ol2OGx3IfrIJKywOmJyM1qr8uRnWBrbSAGDLZy6c0DmV/7RK6letuHor9Q5 3pMmTXeVbblO3cSIiVDX1rtb/nddqbCfNiFIvurkJODXbtOodkPED+RkHjVGH9gpfPe2lDQBFQc5 pWKjU8U1TnR+f0U9cu064nZcMieLAqdkk6hppCDsqsBwLjHur1XxB26GtR7aQdGQ3RxVouuEZ9Nq eiQHl0oUF/vn0ZGBaHwJ2eESrUp0Iw/gSJ3HqMuR600P9eQ3vodupN36MrkzGQZS068e3EYTgNAB jZkD8TzPF4eG61o+cxFZrUIXowfXJosMX5ZQSlYSVlCDu2na8Lc2iK0mXNgodhRh0E6+UMVFei1G 2PrSIU9EwioS70yFBF2moUWeHNDS4qZDIDBdjx85xQq9VD42UbTRudBo31/E3ahF5MMcDI7KdpjQ KULbtCr8aoTjHIUEuG3LCVsCW2UOyugPPaOGK1ZclZhyJ1oAKHx1qHjvOGXm6QB+mk6ZTzCPKsFf twxbkg5OTEJBSZDxFdMdjhWKQRs1y634PNxyi5hJyfZTqqCPnGEeWnCZYEPFJ9jPhhI9UQAFTdAQ Sl4MOiTsldmbnxghFoVtB5hQ6nsDvccjqgmDvD9Wh3hTQMCZFfPbwKEtSeDoMAHujwN5vAr2fQEN gxhN/KmvEyoAEK4rsNWk4mvtBc9RUVZYb+q6sUBKbKRJ7t2JzkiGuP0YIX8qMA5MLNz4roJ5Jm3R 99HCaEpvRaTkQbxEayoo0newVayJffSOdgrBcx9m4zuNRcgRKiGg7nXFaZTxgU2GYuFGsyYan9g/ rMdRGcvAcA8+rx4YwgeE+t2FESF6coSh1XA3fOLJ37wDhYziv06NVNr5OEQYW/2Y/CoVJPIjQKAZ fI/jcX6o1g9K5ZwJhmYqJ0PIxX89f7dLTMqse5FhVBQaO03dzx9rAMZnZXrgXdZHl2vqCbCSy9Ix 3eltOv8yJ5cKtwxhveW3ZWTI X-Report-Abuse-To: spam@semaster01.route25.eu Received-SPF: pass client-ip=2a00:f10:121:a00:1c00:efff:fe00:1854; envelope-from=rladams@adamsinfoserv.com; helo=se13.route25.eu X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/09 04:40:24 X-ACL-Warn: Detected OS = ??? X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 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-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -0.51 X-TUID: zj0XkqYu3xF/ On Mon, Sep 07, 2020 at 10:05:38PM -0700, Samuel Wales wrote: > well for a non-emacs application, i want to select text and capture > using wm menu. I routinely capture programming and UNIX history. I select text (X11 clipboard), and then I have a skel/abbrev to insert it into Emacs. I type "pexa" and it creates an example source block and pastes the clipboard into it with proper indentation. "pexa" stands for "paste example". This is *so* fast compared to creating a new source block (C-c C-, e), then entering it (C-c C-'), pasting (C-y), and then exiting (C-c C-'). ;; Org mode skeletons instead of yasnippet (define-skeleton rla-paste-example "Insert an Org-mode example source block and paste the clipboard into it." nil "#+BEGIN_EXAMPLE\n" ;; indent to match the src block (concat " " (replace-regexp-in-string "\n" "\n " (replace-regexp-in-string "\n$" "" (current-kill 0)))) "\n" "#+END_EXAMPLE\n" "\n" -) (define-abbrev-table 'org-mode-abbrev-table '(("pexa" "" rla-paste-example 0))) Mind you this is in the current buffer I'm typing in. If I wanted to add from the CLI, I'd use a capture template with a predefined location and make sure it includes the clipboard in expansion. As some of the other replies have shown, triggering capture externally isn't too hard. You'll just need to figure out the WM hook. ------------------------------------------------------------------ Russell Adams RLAdams@AdamsInfoServ.com PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3