From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id CP+LJutTlWHMIAEAgWs5BA (envelope-from ) for ; Wed, 17 Nov 2021 20:11:39 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id uGNJIutTlWGXWAAAB5/wlQ (envelope-from ) for ; Wed, 17 Nov 2021 19:11:39 +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 2D2472F1BE for ; Wed, 17 Nov 2021 20:11:39 +0100 (CET) Received: from localhost ([::1]:38300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mnQLJ-0001QG-Mj for larch@yhetil.org; Wed, 17 Nov 2021 14:11:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnQKW-0000wF-4E for emacs-orgmode@gnu.org; Wed, 17 Nov 2021 14:10:48 -0500 Received: from basilikum.nobis-admin.de ([89.238.71.130]:37242) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnQKT-0004eL-VN for emacs-orgmode@gnu.org; Wed, 17 Nov 2021 14:10:47 -0500 From: Stefan Nobis DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=snobis.de; s=default; t=1637176242; bh=0cyVfK2OB9N3Lc5Ims45VFCaV38CHzlsYOmhM19gaOg=; h=From:To:Subject:References:Date:In-Reply-To:From; b=UI1M9M27tUu4b0bn3kUgB4TU28g2/apNK2hjihWazld4gwotSRpsAVhc8DwmjAtbc 39Z50teeUgPH7Mzl5wFycSeAYYDKRWp83BrZxP7XTj8xHTR4jI6+oZKloSmx8MTP1i iBTqo0sOGPfvXqffGh1QA5opbhLr+8+xKYJcrssc= To: emacs-orgmode@gnu.org Subject: Re: insert automatically a reference to a section header and a link References: <877dd7mdx7.fsf@mat.ucm.es> <87r1bfnln2.fsf@ucl.ac.uk> <87o86ilw9a.fsf@mat.ucm.es> <87ilwqlvh5.fsf@mat.ucm.es> <87bl2ilqtr.fsf@mat.ucm.es> <87a6i2k90e.fsf@mat.ucm.es> Mail-Followup-To: emacs-orgmode@gnu.org Date: Wed, 17 Nov 2021 20:10:42 +0100 In-Reply-To: <87a6i2k90e.fsf@mat.ucm.es> (Uwe Brauer's message of "Wed, 17 Nov 2021 18:05:37 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=89.238.71.130; envelope-from=stefan-ml@snobis.de; helo=basilikum.nobis-admin.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1637176299; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=0cyVfK2OB9N3Lc5Ims45VFCaV38CHzlsYOmhM19gaOg=; b=dQRlSrue+nqNysekGonoSN+LfMlWWwjTMdX9FvgYpEb4xn9qoJViRbaqi9+SDG+PKuSJbH 0gVSdPRNSWKIxRk1wROlUqug748672534+2HVqiYQDdKihw0TE3axXVn9BYxMTOtB/Tr46 SGQ4IQ3tjA2/OQe472ew/qAvvkF55VKV0LFKW3IrgvVzQfD+Ft1nAXAxkAJWpWZrrG7fiC 756F9Eu0bZuWyc9wVrWlgv7AvB8F9NqMRO7socxMglq48xSJWY4ZxNs9LrxFq+sRATrCsk BhkPXL6GeqrQFUQShgdEsIBeYnOWxqTpMDQn6zb4GfxcgbZyXnT8jum4hHWFpQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637176299; a=rsa-sha256; cv=none; b=K4lm7m+t1fqCUiD8/4o1Rz4evQgjbeuIYIfbX4uFK0rlvV+L9oPt4q/rtamI6R6pH8U85z F/VRtNxXUKS/WrfBC0/YeZplG3pGnPJzlMKzGFQF+SSHImmkZus3AML9g5Az4uQhCbY9R1 ZkaGCYQAHpFEhG5VJ8XdbO5LRL1+sdZEap8B8Q+22iyLktNhqayLn96pImzDPSt3AtCA/P CeiGhKniTOSZD0gw3ChtsoN14pItcDbpM++e1LccUsJsQNH1OJffEbtKPe7gulPxByPj5z /dH2xlzIN694jS+l/46A5evxo7JieirVFACXS1qovfseegSA9IA53wov3zWGcQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=snobis.de header.s=default header.b=UI1M9M27; 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-Migadu-Spam-Score: -4.06 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=snobis.de header.s=default header.b=UI1M9M27; dmarc=pass (policy=reject) header.from=snobis.de; 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-Migadu-Queue-Id: 2D2472F1BE X-Spam-Score: -4.06 X-Migadu-Scanner: scn1.migadu.com X-TUID: JYlc05PFU9YF Uwe Brauer writes: > Yes, but, what do you do, if you have a 10 header and each has 20 > subheaders. I avoid writing such complex documents for the moment. :) [Some custom functions] > Thanks but this did not work! Sorry. The code is meant as an inspiration, not to be used out-of-the box. I never tested the functions outside my highly adjusted default configuration. As I read in another post you seem to be a helm user. Therefore it might be a better idea to use helm helper functions. I assume, helm has also some function to jump around in Org files, with headings as targets. If you find such a function, try to copy and adapt (as I did with the similar `counsel-outline' function): I assume such a function will use some helper function to collect the candidates for completion and after the user selected a candidate there is code to jump to the selected destination. Just try to change this part so that instead of jumping, a link is inserted at the proper place (that's the part my function `sn/org-insert-internal-link-action' is responsible for). Maybe someone with more knowledge about helm might help you with a complete solution. -- Until the next mail..., Stefan.