From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id MFITJPZ4Fmf3NQAAe85BDQ:P1 (envelope-from ) for ; Mon, 21 Oct 2024 15:53:26 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id MFITJPZ4Fmf3NQAAe85BDQ (envelope-from ) for ; Mon, 21 Oct 2024 17:53:26 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=eauchat.org header.s=mail header.b=xa3Xr2um; 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"; dmarc=pass (policy=none) header.from=eauchat.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1729526006; 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: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=NOSXWIRXhR4A6mr+oKOeMwzM69O6tHSsflYtPmiQkPA=; b=KRj5WcALLDwqD2nPGpZZa82HvJjtijt5Z8lxvw5urvIXGu7amdsRK/nX1EB5vg+fuscX3V FoYPns1kYqjI7pqe9A+EuFcek1fZSDPqKLK45CsnN4bK81Pw0iBRGNGY3fqo7By56xjlap Zdw1hBhV/XStLcGneDWamIbdyQOAkW81XLikX4dJ3sh0aHMj2Bjmuk06esCgyMugIPX5EA dCLqVpsl1I4PvXCcHhgSJH5df4i4wnzmRH8aO1yCWK7f25pXZUY9sYnuCFL7fHjTxVSzN9 LZi6SYN6wux/kyf0c986FbaGo2vmlieno0GPgMKdOG6zRJtuqB/RC0HDYM/FSw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1729526006; a=rsa-sha256; cv=none; b=N9SBiEs0f9aSnc/GbMmKd0ABqJy6PmFT3Eb4CRT/g0d+UMSpVK68IAAUZ1kLJBs/pCZT0F Y9PojOhHtRSFDACW+eBRUBBRc6hRUC0f4a+ot7A7qQ1IAb7fzNn8ctUTtEQvnyxpzk9wAS 5BL5kXBvAeYo+J/GrNdmESf5wF9J+H/7sDuIFvMHkAKu+QT72kH+mf9btIALZKPDGnmkKx ouivm3bbzqROo/5a/mVniBp6stYohMBf4cXDYmwJ9K6+NeU/GvwWVmnfceivOHYZoSojTB zxLfEErkhMBgNx9lCbCPq69qa4bMiPaJdfJLTtwquqrZNZxnNoHG4qHDGNAQsg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=eauchat.org header.s=mail header.b=xa3Xr2um; 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"; dmarc=pass (policy=none) header.from=eauchat.org 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 2C75F5FE8F for ; Mon, 21 Oct 2024 17:53:26 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t2ui7-0004JX-Re; Mon, 21 Oct 2024 11:52:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2tq6-0006nH-5E for emacs-orgmode@gnu.org; Mon, 21 Oct 2024 10:56:58 -0400 Received: from elegua.eauchat.org ([91.224.149.118] helo=eauchat.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t2tq4-0002E4-2y for emacs-orgmode@gnu.org; Mon, 21 Oct 2024 10:56:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eauchat.org; s=mail; t=1729522593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NOSXWIRXhR4A6mr+oKOeMwzM69O6tHSsflYtPmiQkPA=; b=xa3Xr2umVn67pdTVrT8DEa6JvaWDPVle6wDrd2dPxihUCTSS8ey3LIYctY73e2VO9Spw+5 1Ybvq5wCNvovR1yzeJr58jUyCd4vTDTBhcHohgkEjkf0bOcU3khCOJFpAX9fcb8YaQQhJC ON5GqJVnYPEstHiIUpwQwrbxBqsnEUY= From: =?utf-8?Q?S=C3=A9bastien_Lerique?= To: emacs-orgmode@gnu.org Subject: An org-follow-mode following org/org-roam links Date: Mon, 21 Oct 2024 16:56:32 +0200 Message-ID: <87a5ex1p3z.fsf@eauchat.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=91.224.149.118; envelope-from=sl@eauchat.org; helo=eauchat.org 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, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 21 Oct 2024 11:52:41 -0400 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -2.76 X-Spam-Score: -2.76 X-Migadu-Queue-Id: 2C75F5FE8F X-Migadu-Scanner: mx13.migadu.com X-TUID: Rf6xwWidk2Zc Hello all, First of all thanks to everybody for org (file, agenda, and much more), such an amazing tool! I'm trying to add a minor "org-follow-mode" somewhere between "org-agenda-follow-mode" and "org-roam-ui-follow-mode" (request also posted on ). My intuition so far was to start from a copy of "org-agenda-follow-mode" (and subcommands), adapting it to an org file being the main window. --8<---------------cut here---------------start------------->8--- (defvar org-follow-mode nil) (defvar org-pre-follow-window-conf nil) (defun org-marked-tree-to-indirect-buffer (arg) ;; TODO needed? ;; (interactive "P") ;; (org-agenda-check-no-diary) (let* ((marker ;;(or (org-get-at-bol 'org-marker) ;; (org-agenda-error) ;; ) ) (buffer (marker-buffer marker)) (pos (marker-position marker))) (with-current-buffer buffer (save-excursion (goto-char pos) (org-tree-to-indirect-buffer arg)))) ;; TODO needed? ;; (setq org-agenda-last-indirect-buffer org-last-indirect-buffer) ) (defcustom org-follow-indirect nil "Non-nil means `org-follow-mode' displays only the current item's tree, in an indirect buffer." :group 'org :version "29.4" :type 'boolean) (defun org-do-context-action () "Show outline path and, maybe, follow mode window." (let ((m (org-get-at-bol 'org-marker))) (when (and (markerp m) (marker-buffer m)) (and org-follow-mode (if org-follow-indirect (let ((org-indirect-buffer-display 'other-window)) ;; TODO or org-marked-tree-to-indirect-buffer from above (org-tree-to-indirect-buffer nil)) ;; TODO needed? ;; (org-agenda-show) ;; TODO ;; (and org-agenda-show-outline-path ;; (org-with-point-at m (org-display-outline-path org-age= nda-show-outline-path))) ))))) (defun org-follow-mode () "Toggle follow mode in a buffer." (interactive) (unless org-follow-mode (setq org-pre-follow-window-conf (current-window-configuration))) (setq org-follow-mode (not org-follow-mode)) (unless org-follow-mode (set-window-configuration org-pre-follow-window-conf)) ;; TODO needed? ;; (org-set-mode-name) (org-do-context-action) (message "Follow mode is %s" (if org-follow-mode "on" "off"))) --8<---------------cut here---------------end--------------->8--- Now this obviously doesn't work, primarily because I have no `org-marker` defined as no agenda line is selected. I then went over the "org-roam-ui-follow-mode" code, little of which I could use for this as most of the follow-mode looks simpler, directly using the network instead of having to manage windows. Would anyone have some advice to set this up? How to replace the use of `marker` and read the current org position instead? Thanks again for reading, and best to y'all --=20 S=C3=A9bastien Lerique https://slvh.fr/