From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 OHVrKBB/KWMmFAAAbAwnHQ (envelope-from ) for ; Tue, 20 Sep 2022 10:51:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id aMFdKBB/KWPdJwAAauVa8A (envelope-from ) for ; Tue, 20 Sep 2022 10:51:28 +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 5A1EF294A2 for ; Tue, 20 Sep 2022 10:51:28 +0200 (CEST) Received: from localhost ([::1]:39560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaYyV-0007Ru-28 for larch@yhetil.org; Tue, 20 Sep 2022 04:51:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52076) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaYKh-0000n4-2n for emacs-orgmode@gnu.org; Tue, 20 Sep 2022 04:10:19 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:41516) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oaYKf-00060F-FV for emacs-orgmode@gnu.org; Tue, 20 Sep 2022 04:10:18 -0400 Received: by mail-pl1-x62c.google.com with SMTP id p18so1603082plr.8 for ; Tue, 20 Sep 2022 01:10:17 -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:subject:date; bh=Pmx5QXaNE3PynP1GXzC5R0A9YuPB89t3E8/tLE2/zrA=; b=O6/FZ5bgwwKXKfmWxj1Uf/gu9w3FiT4jdErOkahdcmbryOJjNO0lm/gw4E0wuuNkOw axU7XCXbyV6TADYOt2G4mUfTyzrDuET9g1E2OcQI27yR9HR5xu3zUinnHt0WRmKXZ2PI avBO3BXmlBuUZM+ASNXtHWxbBzEejTBTxvv4Z8v53V0WeN3ql5BDlv5A7ggbhxaiiwkS DABJV7rSHHsyj0IjVkICYsi01QlsQkGPexeu6kfRML7r+i47o4/E5oZ1RensXbCqkKqp 9GKYcJFs6/qjnGqxE2Ii/VSE0nRYf1rDfqcOEn7OzaNBiztCbwED+VyOc4AnD7dQwfEK aJwg== 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:subject:date; bh=Pmx5QXaNE3PynP1GXzC5R0A9YuPB89t3E8/tLE2/zrA=; b=0iGqJO+F6YO52RmkjyB8PLWfaiXEEAmqla9PBuL3jJmWB2uExGf5X/SoUATQnL9cBs j92HVYhg3n5Q/szBH9MgOHs77U9lI3M//rykXmjOJRFkRvU1SljL+KIM2n7O/TMpFGjR t5uNaH74UYGKbIVwHkWPjFbCdB3GrcysMksqLH6dXZ/yOBkU+MwXbKIRinNr3iFGbwXv +RaIroebTmXu5piY3bSNzSc4ep9iaf7CKNp3j/NRqwq0FBZFLYtB10akAtolszDx6Q7x skBmHayY5VfFlgGmke4vGSKpcEU8fR6BZlKFbzpinVq5n10BgR5QJLIPYLwXCnjMMnoa vKyA== X-Gm-Message-State: ACrzQf00BxEykfZr13QNpg+LDEt0J5WQBxy1jg0YPPfaAdtfDouC3k8m HkCKy4moFjul2wpb9myKOCo= X-Google-Smtp-Source: AMsMyM76IYcODIyGDwRyeiY3PD/9jJfKVun0VG/jajvHCmFuYjJBJXvoK2/My1ORmZ340ACqJbSRPg== X-Received: by 2002:a17:90b:4ac4:b0:202:6d3d:3b60 with SMTP id mh4-20020a17090b4ac400b002026d3d3b60mr2555588pjb.197.1663661415761; Tue, 20 Sep 2022 01:10:15 -0700 (PDT) Received: from localhost ([2409:8970:a80:3a4:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id w17-20020a170902e89100b0017824e7065fsm767905plg.180.2022.09.20.01.10.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Sep 2022 01:10:14 -0700 (PDT) From: Ihor Radchenko To: Janek F Cc: "emacs-orgmode@gnu.org" Subject: Re: Properly handle defaults in org-set-property In-Reply-To: References: Date: Tue, 20 Sep 2022 16:11:09 +0800 Message-ID: <871qs6sbxe.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=yantar92@gmail.com; helo=mail-pl1-x62c.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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 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=1663663888; 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=Pmx5QXaNE3PynP1GXzC5R0A9YuPB89t3E8/tLE2/zrA=; b=Td9iO+a9tvUcylE7RCXzn+4qHxVYAiPsW8DQ6MITXeXS/JS7tmZQ+YzwioRhGWUuZWp16I 0Sx91CuWkWUb67yl3friRl66MVnQ39ZQ6whZcuiHYUM2/vuJbbycvuEsl6cNr32aghP1GA rhmacjHVpcpcAha4sEGqnZANbmnfHjgzviazfw2EH9HpbFjFt81ZqNPvSo7GZ1RAWsLM24 RQfsl0cFiAsKU1JcC6B1xuyOJVI3xPrhTPMR8E+v7B5Gc85y9/aWU7IXEKeURPiBfUZn7S 3GY7P3lEfmJhGOPBKBR6lzafWnzF563bVntoIFgRZQScKx+osRqPoUPOxqqqgQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1663663888; a=rsa-sha256; cv=none; b=e++k3AU4Mrj4M2s6WGiQHLZtINWAx6XKHDRilEVxj2rziKxbHUwHedCWk0VfIiUDaFdmRr qvtFIp25oLgiMksx8Gvm/NmKLj1sTm9HJe3vOII8GYSJ81YfTq4HdtOG7JZyjoeuSNJYj3 12AxOInwz1207HGw8qtBr/2wLSJd0HCaeBLd1w8sbY79DoWQPbgKf4EmVt5NUaR6nkfQ7i IcSIpQZIW1ppdFIjlzkLFGirLPxSK7sSNZ44yJRIz7JllCOptU7arDgarOLZbTZ312taNt RmRvqip28KcFPM3T48H9T2tZTfXnfwGz/ALH/+vhhK1DQpWE63kEkyV2n1QqEA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="O6/FZ5bg"; 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: -1.84 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="O6/FZ5bg"; 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: 5A1EF294A2 X-Spam-Score: -1.84 X-Migadu-Scanner: scn1.migadu.com X-TUID: l1MuRAPMW/Gw Janek F writes: > As discussed in https://emacs.stackexchange.com/questions/71774/pass-default-value-to-org-set-property/71777, providing a default to org-set-property does not always work. > > It calls `org-read-property-value`, which only uses the supplied default value if it can compute a list of allowed values for the property. But then, the default value has to be part of that `_ALL` list. > > Can this be changed so it always uses the given default? Why don't you just use (map! :desc "Set ID property" "lI" '(lambda () (interactive) (org-set-property "ID" (org-read-property-value "ID" nil "default-value")))) ? -- 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