From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 sUTeKVpUPWPH9QAAbAwnHQ (envelope-from ) for ; Wed, 05 Oct 2022 11:54:34 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id mK7NJ1pUPWOXVQAAG6o9tA (envelope-from ) for ; Wed, 05 Oct 2022 11:54:34 +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 F1B4812FC3 for ; Wed, 5 Oct 2022 11:54:33 +0200 (CEST) Received: from localhost ([::1]:32968 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1og16m-0002pk-VA for larch@yhetil.org; Wed, 05 Oct 2022 05:54:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1og123-00013y-Gd for emacs-orgmode@gnu.org; Wed, 05 Oct 2022 05:49:46 -0400 Received: from mout02.posteo.de ([185.67.36.66]:52225) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1og121-0002HM-3p for emacs-orgmode@gnu.org; Wed, 05 Oct 2022 05:49:39 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 9BC2C240106 for ; Wed, 5 Oct 2022 11:49:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1664963373; bh=8nGkZIsFi1G6DMGSbtHqvbqmj72SV6QQLD5j0w+mqe8=; h=From:To:Subject:Date:From; b=YW+EY50Oj6BuT7Ibe5xFFrKQgPdN5sNcDiThUcfdwWkvW1m9z+vyqkxZDW8tUmF1L cXGK2WCy0LADnphALBAU9d652wEGnO6YCTOl/LFz0MbiW2njZ+HJykPDlkk2uhZC0g x6pNU8FJ/tMXmsDe6l/SK2uFjRudFEhedN3O+JmwXPiVrPGiJFQl6rzy/0g0ThKVHo kyw6l1+kE9VDRsAtJSYRZ6yrc88h32OuC+bXU6RbJ8Wg9ikHPdPHnRfbmGqxDy1XJm wUjPtUcyRtV6IfKOLZlfvU2gOJWAt5kWN8OK+RYojO29G6mjBsFubVZfgKBDmQs12r fZ8oTvJ7RQN5A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Mj8tN0hMPz6trH for ; Wed, 5 Oct 2022 11:49:29 +0200 (CEST) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: orgmode Subject: A function to perform Org related searches in several places Date: Wed, 05 Oct 2022 09:49:27 +0000 Message-ID: <87lepulhw8.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=maciaschain@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, 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.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=1664963674; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=8nGkZIsFi1G6DMGSbtHqvbqmj72SV6QQLD5j0w+mqe8=; b=cYApoy0SGxwv1TKj+wr3DKPamaiZuQ1NN+Hm7Qg5V9RjjCubuJyBKO5vnCb9+yT1i7u+Nq OvWWl+lVXzDZCcqxXnTuI3PDN0ZBtKAUSoWmF9FjzXzmQ7V8ysQWOvGQCVNvCJfZMDUmX/ 1AfvivbxatY05TKu9MoxNPcsz3K846ji0Y+cl6mur7JyNHlEVQjpR/z3gTBnlt3r7jLhTz QzhnhSzzDWuKp01I/FQ/H1GTxX8jZBkwDpsxGJE2pZDVMf/KnB1PUhBvXaeM0mFKqIkpbC cnUZh90P7S2Uyv8DMx7lCJkKEWGhM0nhqNEVJpW/eTRgKbPFifd8q1FWiuCKFA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664963674; a=rsa-sha256; cv=none; b=mCbAMtVQBkcsoP6eu2s+o2KIGp0rIGrCHgAqAwCRgTDQUV5fNesINbl5llOsMoHVS+G5St 5mopsnGYCFvE74Mic1UozQEf8EPx770CjfDA0V+UTJ9oInMg0u2qBPzJu1T5TvENWUm91V 3bwlQCSX+8S9yCbY6rpTApSFfljhopRuhXvr2Z+MxWTkYOLTjHbp69EfxQ4pu+5A7U+Jyv g/Qva6BHQE93w6vSIc1P0vP9OFuiFxPfE8201UQ/Kb6ZfMxTSZ30HiMCM57K/Q5Ic8SyEu s2oIKzP8DS5EheY0g9ftYAgQNM3yfJ7zIk8rZwg3bQYYYaubJPC5fzIqK7C4kQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=YW+EY50O; dmarc=pass (policy=none) header.from=posteo.net; 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.56 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=YW+EY50O; dmarc=pass (policy=none) header.from=posteo.net; 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: F1B4812FC3 X-Spam-Score: -2.56 X-Migadu-Scanner: scn1.migadu.com X-TUID: 4KYdQvjnyLba --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi all, For my personal use I have written a function which performs Org related searches in different places. The list of places is expandable, but so far I found them useful: this mailing list, the Org Manual (via org-ql), the Git log and the Org Reddit. The idea was that everything would be done without leaving Emacs confort, so the results from the internet are returned in EWW. Before entering the search term, it defaults to the word at point or the marked region. The function has two versions. The first version does not depend on any external packages to display the options. The second version includes a simple hydra. The hydra version has the advantage that you can have the hydra buffer open and continue running more searches on the same term. I don=E2=80=99t know if it=E2=80=99s very orthodox to include the definition = of the hydra inside the function (I would say no, I don=E2=80=99t know), but I couldn=E2= =80=99t think of another way to pass the argument to the different heads of the hydra=E2= =80=A6 It=E2=80=99s homemade and improvable code, but I=E2=80=99m attaching it her= e in an Org document, in case someone finds it useful :-). Best regards, Juan Manuel --=-=-= Content-Type: application/vnd.lotus-organizer Content-Disposition: attachment; filename=function.org Content-Transfer-Encoding: base64 IytUSVRMRTogQSBmdW5jdGlvbiB0byBwZXJmb3JtIE9yZyByZWxhdGVkIHNlYXJjaGVzIGluIHNl dmVyYWwgcGxhY2VzCiMrQVV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