From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id IHHTCZNiiWbEVQEAqHPOHw:P1 (envelope-from ) for ; Sat, 06 Jul 2024 15:28:19 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id IHHTCZNiiWbEVQEAqHPOHw (envelope-from ) for ; Sat, 06 Jul 2024 17:28:19 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=IGq4ZE7v; 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=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1720279699; 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=HvlT4/zD56ToQoSd+eS34+o7lW4AJLfFPTmHXosfV/o=; b=h9YJIPCnvpY669vaDoywGck3rhp9CE4u2isPK5zWNrkuB8aD67LXslPPkvklBh7nWwddYg erVI6nIP1MT9RiA3XT1+mv/WrNxICwrl9Yyem1YuIio/GsUQs7iW9crI3ae0N1nbSDk4x6 9pbAd9Z3o+D47o+qtThZ5Lq2UX6M9vKbVAhnECmEVCThe1yHXMwITUUd+sjE7B1tH0AesX 7hw+4vJKHTY3yz3h0abmaZYWXniQduVXwivSq0zE5Qf49TOyq5T+n9rikKhyb25V5hlWLe BYRjoy4L1o7YBHGAIU6nZ8iJIfUxt/EOUiuyNj1BFxnehFhU9xMYBczQftX0Hw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=IGq4ZE7v; 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=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1720279699; a=rsa-sha256; cv=none; b=m0adkg90SSJPDw9TNy4QywNORJ/9JU8umLjjyH1wBKWOGYOMZkxBHxLdbbZpfhVH/SQxcG /oCjs0bCic7EnsqnHZRwqYtuHiuAs75yvKNUzRlJZ/3jMgvtAorbgKmepukxtfElYy6MGX robUo2F6GqEMNGPoWTDME3YGHjz6rXy6ESbeXHcsnpzQWSr6kI7iHKdLa+SwT5s8TJwHSI 4TNBCbW+r0iypIpDBHHpOCnDBcA57+oI/NbVAdGARfaBi0ecbQIM1xPQ+dxferxzasvd4o gIw9Fu9QQZ4XwKoAeWoxRSpbe+5M1ePyV8/LDfLlmoKcuQ29n8eIMqTj3AayvA== 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 E292A7C875 for ; Sat, 6 Jul 2024 17:28:18 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQ7Jy-0000PR-1N; Sat, 06 Jul 2024 11:27:30 -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 1sQ7Jw-0000Oz-NO for emacs-orgmode@gnu.org; Sat, 06 Jul 2024 11:27:28 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sQ7Jt-0005Bj-Mh for emacs-orgmode@gnu.org; Sat, 06 Jul 2024 11:27:28 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 485D9240029 for ; Sat, 6 Jul 2024 17:27:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1720279643; bh=HIyRbdO1XmAaGvCl1n4VFom3VYpTMn2DvoZTYyTFO8A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=IGq4ZE7vBOsy6nFPVkMTCos3TaRIdr6mMFp0shK3zmo562PeiADHKrEoEubSVOF5S ++Ltx6roM+qt4IM8AKBx74kssdHmMydbtyERLq8l+0h6ZulFFgSeAKpKRrMsElHPQr ev6BIp9fJLRcCWuJ0TWzchK+F9cu9hl3n6p8tJAlTCjp3m7dqHfc704LmP4xwUcEHR asxwiyc+opSwtgbgPEIRyFAbxyv9i0g+hg3pMWAx46bNTpH93npaP576DETDDmrQgq 5sn4IJlhPXRkO0/Y60n1E59OCi9cIf9AjRwxuickUShvqd8YyGql4L7qBP1SUdlVvV 55yDQ+kCJ+vLw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WGZ4p2dSSz9rxB; Sat, 6 Jul 2024 17:27:22 +0200 (CEST) From: Ihor Radchenko To: Samuel Wales Cc: emacs-orgmode@gnu.org Subject: Re: [fr] refile goto: push mark in the target buffer first In-Reply-To: References: Date: Sat, 06 Jul 2024 15:28:54 +0000 Message-ID: <87v81iilop.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@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_H3=0.001, RCVD_IN_MSPIKE_WL=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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -9.61 X-Migadu-Queue-Id: E292A7C875 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -9.61 X-TUID: haALlRgV1xCU --=-=-= Content-Type: text/plain Samuel Wales writes: > at least for my use case, refile goto should push mark in the target buffer > after visiting the buffer, before jumping. rationale: it can be a big > jump. m-< pushes mark for that reason. i think i saw that in the manual > years ago. :) > > i am often in my-big-subtree, someplace, and go someplace else. i want to > return to that place in my-big-subtree. refile goto loses the previous > position. i want to c-u c-spc to get to where i was. See the attached tentative patch. This is an easy addition. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-refile-Push-point-to-Org-mark-ring-before-jumpin.patch >From b3a80c70bfca02287ca8ecdcba98cea170d9783b Mon Sep 17 00:00:00 2001 Message-ID: From: Ihor Radchenko Date: Sat, 6 Jul 2024 17:26:08 +0200 Subject: [PATCH] org-refile: Push point to Org mark ring before jumping * lisp/org-refile.el (org-refile): (org-refile-goto-last-stored): Save position to the Org mark ring if we are about to jump to a different position. * etc/ORG-NEWS (~org-refile~ now saves current position to Org mark ring when jumping to heading): Document the new feature. Link: https://orgmode.org/list/CAJcAo8vYLJ3YGH0+nZs1rgtdq2iRKzJ8tuGxJKRD-XyEwEm4FA@mail.gmail.com --- etc/ORG-NEWS | 8 +++++++- lisp/org-refile.el | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index b9f51667d..4e9d1bf8d 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -93,8 +93,14 @@ Runtime error near line 2: attempt to write a readonly database (8) [ Babel evaluation exited with code 1 ] #+end_example - ** Miscellaneous +*** ~org-refile~ now saves current position to Org mark ring when jumping to heading + +When ~org-refile~ is called with =C-u= or =C-u C-u= prefix argument +(to jump to heading or to jump to the last refiled heading), it saves +point to Org mark ring before jumping. Then, the user can return back +via ~org-mark-ring-goto~. + *** Trailing =-= is now allowed in plain links Previously, plain links like diff --git a/lisp/org-refile.el b/lisp/org-refile.el index c8e64903c..44361c143 100644 --- a/lisp/org-refile.el +++ b/lisp/org-refile.el @@ -544,6 +544,7 @@ (defun org-refile (&optional arg default-buffer rfloc msg) (setq nbuf (find-file-noselect file 'nowarn)) (if (and arg (not (equal arg 3))) (progn + (org-mark-ring-push) (pop-to-buffer-same-window nbuf) (goto-char (cond (pos) ((org-notes-order-reversed-p) (point-min)) @@ -634,6 +635,7 @@ (defun org-refile (&optional arg default-buffer rfloc msg) (defun org-refile-goto-last-stored () "Go to the location where the last refile was stored." (interactive) + (org-mark-ring-push) (bookmark-jump (plist-get org-bookmark-names-plist :last-refile)) (message "This is the location of the last refile")) -- 2.45.2 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--