From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6JqoBptnFGKK2wAAgWs5BA (envelope-from ) for ; Tue, 22 Feb 2022 05:33:31 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id eID5A5tnFGK3nwAA9RJhRA (envelope-from ) for ; Tue, 22 Feb 2022 05:33:31 +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 7488428166 for ; Tue, 22 Feb 2022 05:33:30 +0100 (CET) Received: from localhost ([::1]:36126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMMrh-0001tk-9D for larch@yhetil.org; Mon, 21 Feb 2022 23:33:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47284) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMMrE-0001tM-IQ for emacs-orgmode@gnu.org; Mon, 21 Feb 2022 23:33:00 -0500 Received: from mout01.posteo.de ([185.67.36.65]:50673) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMMrC-00031K-Fu for emacs-orgmode@gnu.org; Mon, 21 Feb 2022 23:33:00 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 2CFA4240026 for ; Tue, 22 Feb 2022 05:32:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1645504375; bh=4YqTGDax1a6fNVi1HN9epiMQuumTjiNcB+lgMNkrh6k=; h=From:To:Subject:Date:From; b=jZPytYTi444uia2Mph6UkJ0tMKPddW8D4CDHWdF0CR9SmLf4n8xixWNhLHrLzmKjX 9g9Chx5IrQcYqtJobYj35JQfzSw11U46APNP2+bJGk35RMFKbXY5PtZ7/v4NWmkExF s4XqISPXqAJM8SALdoCImKJ1hxutiVUDabirSLPJIrC0BRjlZcOwwne+kDQZWv2Nsn YhHkIdcc8H5lw/jf4Gc0QLEUkWnIexauNVumvRBTj7+MYr82jjS299zy6hSAgAZBCT QVIcJc9a4bz3ZHC29OyMpSVBndWuo7PehKGesajtnNo8ekBNbwa/L0BuYvRYhlwHSb D8C8nz0LUHnQQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4K2mVt3L2sz6tmQ for ; Tue, 22 Feb 2022 05:32:54 +0100 (CET) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: orgmode Subject: Footnote tooltips (an attempt) Date: Tue, 22 Feb 2022 04:32:51 +0000 Message-ID: <87tucrzfkc.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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: , 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=1645504410; 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=4YqTGDax1a6fNVi1HN9epiMQuumTjiNcB+lgMNkrh6k=; b=n6aiXDsmcdx8iFtw23qRoWlGDTjjqPMq3CGroRAENH9WXPNyKTQRh67wzmWVySpXC1NKNb PV9PNZ/gKHP/KeMqxwSf1XfjHNz1RFOZA1sud07I7plFl5SrIjJ18G98EbsUSsFHLEHHPG LvuXLG7WURiCOA3HCcukwciDzrvGFwTrFAKoxQLGeHZppO0BX1TacwCWYWB8I+ZH47u7wO qJOc1d6cB3CvGzvsyLD3n2KS5cjM+BWwMz+Y/NSoDjnoo8NeSGWjr9yp41BZWoC8sne285 I35YQaC6bIJPbXtYs70RHIMsscwraFdjQ/9cD8KbcWxWBmx9e/5TLZOHUc7kUA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645504410; a=rsa-sha256; cv=none; b=MxPh+0SB8NvZga4tg0kqC+1/m33+p6srg16jT5bQ8oVwp0Erzd03dgGk2VbX/cf93T2841 QSDrZQWjmSGzX0M7qIcS8fhjVkITiHAmp2xlERcyO3SWxqAqbs81LgYtVNxcyHWTRRRuk/ O8vksIlMxSWwrIYRcr8tIhYTlH5vVD19qQsxjdMVz5PGpY2/LfEDBveR5sPQAODhJdyMh7 WqSadw8ywytTbjwIcdFuDYbt2smJDZhKvYH5GLeMDT2AX/AhMiUobzW/FIXLwVrjBHdN1c gTg600PYs4A+wLMgNvPHHFNRsrbBxwwdVLnKMXRLMBkfRc5G0bFxvO9Y/tetiw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=jZPytYTi; 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: -6.63 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=jZPytYTi; 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: 7488428166 X-Spam-Score: -6.63 X-Migadu-Scanner: scn0.migadu.com X-TUID: U4p1Lm2LffDt --=-=-= Content-Type: text/plain Hi all, I think sometimes it would be nice to have tooltips in the footnote references, so I can see the contents of each footnote definition, especially when I'm in a narrowed subtree; so I've tried to write some code. I have achieved a "semi-automatic" solution. It doesn't work bad at all, but I'm not entirely convinced either. With a minor mode the `org-activate-footnote-links' function is overridden, and tooltips content for all footnotes in the document are added or updated after a couple of actions when you finish writing or editing a footnote: `org-edit-src-exit' and `org-mark-ring-goto'. And that's where the automatic part ends. Beyond that, tooltips must be updated/added by calling the `my-org-fn-make-tooltips' function. Here is a short video demo: https://cloud.disroot.org/s/a4gejYc6PSwNWHY I attach the code of my poor man's footnote tooltips. Of course, any comment and/or feedback is appreciated. Best regards, Juan Manuel --=-=-= Content-Type: application/vnd.lotus-organizer Content-Disposition: attachment; filename=fn-tooltips.org Content-Transfer-Encoding: base64 WW91IG5lZWQgdG8gcmVwbGFjZSA9b3JnLWFjdGl2YXRlLWZvb3Rub3RlLWxpbmtzPSB3aXRoIHRo aXMgdmVyc2lvbiB3aXRob3V0IHRvb2x0aXBzCgojK2JlZ2luX3NyYyBlbWFjcy1saXNwCiAgKGRl ZnVuIG15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