From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id IPVjGAKcFWJbZgAAgWs5BA (envelope-from ) for ; Wed, 23 Feb 2022 03:29:22 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 6EvzFAKcFWJH5AAAauVa8A (envelope-from ) for ; Wed, 23 Feb 2022 03:29:22 +0100 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 E391333960 for ; Wed, 23 Feb 2022 03:29:21 +0100 (CET) Received: from localhost ([::1]:54390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMhP4-0003wf-VD for larch@yhetil.org; Tue, 22 Feb 2022 21:29:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMhM3-0001wR-Dd for emacs-orgmode@gnu.org; Tue, 22 Feb 2022 21:26:11 -0500 Received: from mout01.posteo.de ([185.67.36.65]:51857) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMhLy-00062x-Ay for emacs-orgmode@gnu.org; Tue, 22 Feb 2022 21:26:10 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 51A57240026 for ; Wed, 23 Feb 2022 03:26:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1645583164; bh=hh+SkjvjCUH+eR6pYR3WE7Y650IovdaaSphwViMBQ9c=; h=From:To:Cc:Subject:Date:From; b=ewlY1950zpnO3s2uJMdU4h9Mzybvd0q6MKLcm+6oQqTMeRpvYky9kscEEFtXR70+g dKcJfPa3B1pqijxkqNWHM1S1heALU1ck4Txlj7J3G4BayBvkGQeeY8HJYXFnK1XEGk wgW9L83AnlliYI+1JeRMWVvffVHSIXWpglWrazUmGPboLOAX3j8xV8W4Ba0YqI5CoG z5tFF7EGI7/GBExcym0m9GdS0es7hitRvJwhE752zLcgP0/GEwfSZz6A4AvjBcXQBT MYCmV+ZzplOloME5RxPzsSTmPsvrSFQxCOP/M16RO2vaEz9l7iVHmsooHoZVDQkCMJ xJp05vPkEE3JQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4K3Kf35N6Kz6tmL; Wed, 23 Feb 2022 03:26:03 +0100 (CET) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Ypo Subject: Re: Footnote tooltips (an attempt) References: <63ab1106-8aa7-4dd1-923b-04ac8fd4470a@gmail.com> Date: Wed, 23 Feb 2022 02:26:00 +0000 In-Reply-To: <63ab1106-8aa7-4dd1-923b-04ac8fd4470a@gmail.com> (Ypo's message of "Tue, 22 Feb 2022 22:30:22 +0000 (UTC)") Message-ID: <87ee3u8gjr.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=maciaschain@posteo.net; helo=mout01.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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Cc: orgmode 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=1645583362; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=sbJf+hedg9pUQdNr9rhyg5bHP+p/QsRaOV+Mdh6Yrxg=; b=NNtfNJlQibp32QEaH1ckiQ8u+DC6vvG3fvdjQAA8Xq0goNHm5PdYBqZVgEhb3u3ANXnAA9 5QII1f7aQZ5nl2Ts9qY4uouTcOdv1bSSXQdmtFeaZL9s6ARyUAytGo4f9YlvaFLMvzqxyt h7Gu9/JKlwfBN0/bBls6fWwiEA//t1K9jHC1zOt6rR1YvAnrCFvuX2rqWGJO5p5Sv7kRjS wq13CBqZ8xp3tJcXcZtoDcGkFd15FkFE7wi3xdxiM44Ya2xaQ3cRs9AxZhS17xr5eJrQtt ML9IvjJEHTegPzeBXqoUFllx0ioVkCHE2cI0QOaXXSIzcQx0wIACRkYNgB3g0w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645583362; a=rsa-sha256; cv=none; b=HiQEVeuyBSBE8F0Z3mIMatwPLAHTa8Chmhp+5+J5U9l3X5V6U5xBY55b63+B35UbJFZ4oc 5vc7Snv7WXE80KXJCMwRgRCFZM1ZKMtVzdcfvwTCHYSgmprA3nzZSrT5HC3VN8hjBeah1Y zumli+vYD//Z/vlRPM0Y+9HWgK7OzDyx93bh3B6+bk9N7VJS67lgXOfLYg93A+baOiq0fc NH77vDUJX6mVmX28Tawl3NXgN7yaNzHdfjOwgQadHWNmsmPoHbtK+CaQJPUdBvX9e8/kOR FUWR40Eg1/P7LU9GqjOHdfYHw+QNYFfiuffiwlxrApMolabVBWbn7D/0Hh8j7g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=ewlY1950; 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: -9.83 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=ewlY1950; 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: E391333960 X-Spam-Score: -9.83 X-Migadu-Scanner: scn0.migadu.com X-TUID: fWJIFMgah37K Ypo writes: > I love it! > I am going to read your code, Juan Manuel, I won't understand anything > but that function is very interesting for me, since it could be used > too with internal links, I suppose. Org links already have tooltips out of the box. You can also display the tooltip in the echo area by pressing (`display-local-help'). If you want to try the code from my first post, please replace the `my-org-fn-make-tooltips' function with this new version, which is much simpler and doesn't have time-consuming issues to create or update tooltips. (However, I find the function I put in my second post more useful (for my use case: I don't use the mouse very much). #+begin_src emacs-lisp (defun my-org-fn-make-tooltips () (interactive) (org-element-map (org-element-parse-buffer) 'footnote-reference (lambda (ref) (let* ((label (org-element-property :label ref)) (label-from (org-element-property :begin ref)) (label-to (org-element-property :end ref)) (def (org-with-wide-buffer (org-footnote-goto-definition label) (let* ((e (org-element-context)) (from (org-element-property :contents-begin e)) (to (org-element-property :contents-end e))) (buffer-substring-no-properties from to)))) (tooltip def)) (add-text-properties label-from label-to `(help-echo ,tooltip)))) nil nil)) #+end_src Best regards, Juan Manuel