From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id kE3wLDAw92J3UwEAbAwnHQ (envelope-from ) for ; Sat, 13 Aug 2022 07:01:36 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id GHwwLDAw92LANwEAG6o9tA (envelope-from ) for ; Sat, 13 Aug 2022 07:01:36 +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 60B7025E49 for ; Sat, 13 Aug 2022 07:01:36 +0200 (CEST) Received: from localhost ([::1]:52638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oMjHC-0005r1-UG for larch@yhetil.org; Sat, 13 Aug 2022 01:01:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMjFr-0005Xa-6m for emacs-orgmode@gnu.org; Sat, 13 Aug 2022 01:00:11 -0400 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:35697) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oMjFo-00088y-7m for emacs-orgmode@gnu.org; Sat, 13 Aug 2022 01:00:10 -0400 Received: by mail-pg1-x529.google.com with SMTP id r69so2371163pgr.2 for ; Fri, 12 Aug 2022 22:00:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc; bh=ZtyBE5zGVyGACdtkueE06E82ImP1hznreiUAEF7ijzI=; b=PBmZtohDeK7NeLh2jpMeDDYaIjVAhYH0dSrl5unk8s+8PYieEVMUDkaClDmKH+/kWu ocdWyBVFl2lYNLzXxsCdW8RWz4gD5FQVunFH+CkTaAmwgzAhaQ4EUPQfkIAkwYUBTiHs DVRF7X3OOa8bJ5S6HAaakmcpNbIPQsOCWQLWDosIchN4MetWdqwyOlCH2xK2H3lEiZoo fL0HqqxZMrCQ73YynhOsmSfu6eKkIVIb3Cn0wBg2/WxfN1BQ2AK5EP6EnSdouLo7vlXZ mSLn/B2gCn5arE5RgbAobSIL/s5+1Fd6m/rnDTIFL4dK1v8Ia4EeA42++FlVaHvCtCi8 5zjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc; bh=ZtyBE5zGVyGACdtkueE06E82ImP1hznreiUAEF7ijzI=; b=yMx93Knsv8ugl5g5zVLn1s5w6Pg7et2xUUza1NAMOEF6AlSjGRF6g4+Ve3vmP0aD4b JfoiBHQrCP1Blva2CfIuaznTim905fFSXKXl1U+4Km3IVPNr3dXre/ULnlnJypqV1rEt gvvIUUqjyKDzjh5Xp5kGcV7nbsbP2ulTHomUU08FJPZjZvpp/l+jbdK5q9aFPZRN7bo1 oWFeJO2+9U0yrIxWBYy7LPf0phRHcdZ1K+qS8fjtQRau6YBU38VjIaKtqZgPB3rsxSzL RCYe1SoG0qbGJViOCw9y8CsxwzzxcavndcdkaWuNG8g20augw2e4RWuMZNQQXmTgIkdG YJVA== X-Gm-Message-State: ACgBeo3M8TcFkqj0BAnfJN7zr4aHObb9A/gh6duSob2ZI8uE5WY6RWcT S/ogDwh8sstpTDBDZDi1cJk= X-Google-Smtp-Source: AA6agR5CK9gmfhxi7yrnh3pEbv3mpB015alvhRuv2mVoPE9VPDmAi2sv2ZzbTmS6aO2SfxQrjR9iBg== X-Received: by 2002:a63:1205:0:b0:41c:cd74:a743 with SMTP id h5-20020a631205000000b0041ccd74a743mr5796217pgl.418.1660366806605; Fri, 12 Aug 2022 22:00:06 -0700 (PDT) Received: from localhost ([2409:8a70:2bf:80b0:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id y10-20020aa79aea000000b005289a50e4c2sm2515357pfp.23.2022.08.12.22.00.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Aug 2022 22:00:05 -0700 (PDT) From: Ihor Radchenko To: Carlos Pita Cc: Max Nikulin , emacs-orgmode Subject: [PATCH v2] Re: Adding target and custom id links doesn't ask for description In-Reply-To: References: <87a68c4pyc.fsf@localhost> Date: Sat, 13 Aug 2022 13:01:08 +0800 Message-ID: <8735e091pn.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=yantar92@gmail.com; helo=mail-pg1-x529.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1660366896; 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=ZtyBE5zGVyGACdtkueE06E82ImP1hznreiUAEF7ijzI=; b=npEf85Ucl9ByjmMvQCVzXKO/jbgDcUFmsiJAGufP2Yf2x5jS6YpbPjk7KjQ+mmvia5wBmZ VNmxv8LUclSWT7m1wVgc5obeWY+fLRuTMXU+mnMtg+FVhy1gEa4V/G7ojXaMGS+6pmmhEy ZeAmbJfHLXpBAj+ku0sfU54kwzRlRln/0HCM3Eiuo9jW2kAmv0g5/V4Qd6kJ18Q7cSGthk LM8OfAPv4xskiMwY4TXtU4jOdUwkI/pdYEb87GgIypuXHGhxcpSpLtG+2ZwreaPI2QXDuU xUii8eRyTjzbFDeEJ6+r3oB9rEov7oyWnE4YQ1doNrI+d+watqFGNX5J+JnbYA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1660366896; a=rsa-sha256; cv=none; b=kAKPmQtcOgt8GpQXLsPqVSiDVZnyAbzzWVXgHchf+SGGR4/RidVRaDwM8ckpjoLzhArRWn nV/fD/mFgaJllCdb256jegrgdSvPVFu2bROZXvCKhNfOteqz29OQ6z13CZM11AA72DvHz9 0KdRsyVcJobZvYkVzHaXNp5FtSHrLtTyXgo5d9HSOZkcwb/3HwNtB+1FTrm0n1oC7oltRW 9mAu8eojoCe+LDJYI7xCn+IVvRCGjQKEzeLJuN1AQuXeVoE8TxZ8UriVEz4dcmxTEb/uqu PaW3XuTD76wxJGUP5gOWO6YwWrwaOXc0Loc/HiE3EWSmkJqrS7s6XPGzWVxt5g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=PBmZtohD; dmarc=pass (policy=none) header.from=gmail.com; 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: -7.16 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=PBmZtohD; dmarc=pass (policy=none) header.from=gmail.com; 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: 60B7025E49 X-Spam-Score: -7.16 X-Migadu-Scanner: scn0.migadu.com X-TUID: iJ0ejft/Za5E --=-=-= Content-Type: text/plain Carlos Pita writes: >> Carlos, have you tried Ihor's patch? I like the intention, but I do not >> see any effect. >> > > Yes, I've tested it with target and custom_id links and, as you said, there > is no change in behavior. The entire URL is still pasted and no chance to > edit it is given to the user. Oops. Somehow some way things worked for me at some point when I was making the patch. See the updated version of the patch attached. It works on my side. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=v2-0001-org-store-link-Default-to-empty-description-for-t.patch >From 64c85eed9471b73e379e063dc3becefceb1ec650 Mon Sep 17 00:00:00 2001 Message-Id: <64c85eed9471b73e379e063dc3becefceb1ec650.1660366803.git.yantar92@gmail.com> From: Ihor Radchenko Date: Wed, 10 Aug 2022 13:25:26 +0800 Subject: [PATCH v2] org-store-link: Default to empty description for target/custom-id links * lisp/ol.el (org-store-link): Use empty description by default (ask user). Fixes https://orgmode.org/list/D99A712C-18D1-4A4F-8093-35A0BFB469C4@gmail.com --- lisp/ol.el | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lisp/ol.el b/lisp/ol.el index b7d74d0bf..358a96aae 100644 --- a/lisp/ol.el +++ b/lisp/ol.el @@ -1577,10 +1577,8 @@ (defun org-store-link (arg &optional interactive?) t)))) (setq link (plist-get org-store-link-plist :link)) ;; If store function actually set `:description' property, use - ;; it, even if it is nil. Otherwise, fallback to link value. - (setq desc (if (plist-member org-store-link-plist :description) - (plist-get org-store-link-plist :description) - link))) + ;; it, even if it is nil. Otherwise, fallback to nil (ask user). + (setq desc (plist-get org-store-link-plist :description))) ;; Store a link from a remote editing buffer. ((org-src-edit-buffer-p) @@ -1697,9 +1695,7 @@ (defun org-store-link (arg &optional interactive?) (and org-id-link-to-org-use-id (org-entry-get nil "ID")))) (setq link (condition-case nil (prog1 (org-id-store-link) - (setq desc (or (plist-get org-store-link-plist - :description) - ""))) + (setq desc (plist-get org-store-link-plist :description))) (error ;; Probably before first headline, link only to file. (concat "file:" @@ -1761,8 +1757,7 @@ (defun org-store-link (arg &optional interactive?) ;; We're done setting link and desc, clean up (when (consp link) (setq cpltxt (car link) link (cdr link))) - (setq link (or link cpltxt) - desc (or desc cpltxt)) + (setq link (or link cpltxt)) (cond ((not desc)) ((equal desc "NONE") (setq desc nil)) (t (setq desc (org-link-display-format desc)))) -- 2.35.1 --=-=-= Content-Type: text/plain -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92 --=-=-=--