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 ms9.migadu.com with LMTPS id MOEPOd3DomQflAAASxT56A (envelope-from ) for ; Mon, 03 Jul 2023 14:49:33 +0200 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 uEIDOd3DomTvawAA9RJhRA (envelope-from ) for ; Mon, 03 Jul 2023 14:49:33 +0200 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 CB0B519499 for ; Mon, 3 Jul 2023 14:49:33 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; none Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qGIyh-0007JW-J2; Mon, 03 Jul 2023 08:48:27 -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 1qGIyf-0007Fz-G8 for emacs-orgmode@gnu.org; Mon, 03 Jul 2023 08:48:25 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGIya-0007rR-65 for emacs-orgmode@gnu.org; Mon, 03 Jul 2023 08:48:21 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id A38F8240101 for ; Mon, 3 Jul 2023 14:48:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1688388497; bh=wLoojQOjcfll9EBezw8zTvY82MNNK1TzAeL68T0imyo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=Zir6vy/Yij7dewypn5Yf7xka67vpvO9cGiicc6/3GXJHFqJt070vGQPpwsvg6rR5k iAl0ILYrbF5n49RrrTw8SqyekQmdacqVN3V2jfIM2WFs6n1ZrWDizrzdj8n/3PItE5 sFYrh+pevsX9eOQNkvxKHpMLr6thRJW+S5GoCNYgU1vP3+SAQLJldt/ZQqUcnSXN/5 gy8tUOzkSYzkAuZTGWfXRVKVoqusYzr2HuWbOdpQacMwoiIedfHxBuw7ie7Fm95Taa p5bupr5KFqo7LTzIi2G/aiSygBYANe3Wz9U46gXwC+uFzvm+hQWsBgJwgS/SixbsTL 4fWFDaAdceV3g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Qvm1X70ghz6twt; Mon, 3 Jul 2023 14:48:16 +0200 (CEST) From: Ihor Radchenko To: Evgenii Klimov Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] Keep the link if the command was cancelled In-Reply-To: <20230630221120.21657-1-eugene.dev@lipklim.org> References: <20230630221120.21657-1-eugene.dev@lipklim.org> Date: Mon, 03 Jul 2023 12:48:15 +0000 Message-ID: <87fs65gnzk.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -4.00 X-Migadu-Queue-Id: CB0B519499 X-Spam-Score: -4.00 X-TUID: 1wsGmbVSZJzx Evgenii Klimov writes: > * lisp/ol.el (org-insert-link): Keep the link in `org-stored-links' if > the command was interrupted by the user during the reading of a > description from the minibuffer. > --- > Currently the link is lost if the user chooses the link but cancells > the comand while writing the description. Thanks! This makes sense, but the patch may break removing stored link in certain scenarios. > - (when (funcall (if (equal complete-file '(64)) 'not 'identity) > - (not org-link-keep-stored-after-insertion)) > - (setq org-stored-links (delq (assoc link org-stored-links) > - org-stored-links))) > - > (when (and (string-match org-link-plain-re link) > (not (string-match org-ts-regexp link))) > ;; URL-like link, normalize the use of angular brackets. > @@ -1995,6 +1990,10 @@ Use TAB to complete link prefixes, then RET for type-specific completion support > (read-string "Description: " initial-input) > initial-input))) The code below the removed form can modify `link' variable. If such modification does happen, your patch will fail to remove the link from `org-stored-links' - (assoc link org-stored-links) will no longer return non-nil. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at