From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id YLMWK6G8omQM6wAASxT56A (envelope-from ) for ; Mon, 03 Jul 2023 14:18:41 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id aF4jKqG8omQzbQEAG6o9tA (envelope-from ) for ; Mon, 03 Jul 2023 14:18:41 +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 30CB028B7 for ; Mon, 3 Jul 2023 14:18:41 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qGIV5-0000fX-N3; Mon, 03 Jul 2023 08:17:51 -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 1qFMLD-0003s4-1e for emacs-orgmode@gnu.org; Fri, 30 Jun 2023 18:11:47 -0400 Received: from out-63.mta1.migadu.com ([2001:41d0:203:375::3f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFMLA-0003E4-Lj for emacs-orgmode@gnu.org; Fri, 30 Jun 2023 18:11:46 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lipklim.org; s=key1; t=1688163097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=qpKiwnkevb8BGzeLlgwAhARqh8J5+pWv2dHDrm/sYIM=; b=FAzu+YO2E/yJtUqgdlgafRhserrfaluequMh8+XQTUvBmiSFEmnB/g/cTzPyDCwf3MOKIB Dl3Eb1LlWkvbeKpM/VxZ7fvQD/yBRWq++AwkFOAEbGCId9adQBjz3HcFeFuXLjq0pIUREM rcktvVvOMGeQzT2141X5YJTxqPfNUtc= From: Evgenii Klimov To: emacs-orgmode@gnu.org Cc: Evgenii Klimov Subject: [PATCH] Keep the link if the command was cancelled Date: Fri, 30 Jun 2023 23:11:20 +0100 Message-Id: <20230630221120.21657-1-eugene.dev@lipklim.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2001:41d0:203:375::3f; envelope-from=eugene.dev@lipklim.org; helo=out-63.mta1.migadu.com 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, 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-Mailman-Approved-At: Mon, 03 Jul 2023 08:17:48 -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-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1688386721; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=qpKiwnkevb8BGzeLlgwAhARqh8J5+pWv2dHDrm/sYIM=; b=E3DXJAtxnyJ/gcwK9PKRmkMrSuTdiN7zAW3F3EiOHkGUGKZXpmACAMcOM3M/pmZreCbRLZ GQ0RxQE02OfwhFMfV77H58VZRQ8b/P8/Hq0OBpJ1MUF0eC8SHJ7mB5x61ul25iHq8yaAFl +zLSpEJnmjueiRDFfnrvIuMBy48c2xHS98iJNGtOLVsKw/FdOFKElEs9wn2Q5hDaMp4DHF FoSFRwjD12mxnG988DLQAu68B3gkQ4kqukAks4Wm0/rtqg7b8sHWGh2q1ODkQXRHILziCj Ro73w5FlAAKUR3npFFak+5vIZNITfTIh7+GOgOAX198zance71rWp3Aaw8hgdA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=lipklim.org header.s=key1 header.b=FAzu+YO2; dmarc=pass (policy=quarantine) header.from=lipklim.org; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1688386721; a=rsa-sha256; cv=none; b=SsdbwwCY9fkkyqTRr04ckkkKREZypH+AjtSH3fiLd7LNwFzO3ZiqlIP2mCNON3JhLxmQbM JlkH/16Ctwbn+Z8MyWjWOoYjPg744I0hUct5gBz6EJg1voHS1zLqHzSGViPfi34mKtGRcc PoKDGWLooLzXcr/SpEef591/HdlFZdsG7GhzsenviSpIhwd3QVWv6NvPuzJE/MbKAv0gRi qbvkvKhODfzhUiL1IMnmXKuPw+kEDf/0QDYjioe0ORCGG9AR9IaJ2Gq9BgB/L6hgeSD0A1 BhXtYhESMlOVU65wWhDx+FniV/T2hCSUHnu9TCRUvZ6cqcQ3aPGSOr39OJ+YMw== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -1.76 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=lipklim.org header.s=key1 header.b=FAzu+YO2; dmarc=pass (policy=quarantine) header.from=lipklim.org; 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: 30CB028B7 X-Spam-Score: -1.76 X-TUID: yxi8wsJPzWDK * 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. lisp/ol.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lisp/ol.el b/lisp/ol.el index e2bf90acd..e48138ef9 100644 --- a/lisp/ol.el +++ b/lisp/ol.el @@ -1896,11 +1896,6 @@ Use TAB to complete link prefixes, then RET for type-specific completion support (or entry (push link org-link--insert-history)) (setq desc (or desc (nth 1 entry))))) - (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))) + (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))) (unless (org-string-nw-p desc) (setq desc nil)) (when remove (apply #'delete-region remove)) (insert (org-link-make-string link desc)) -- 2.34.1