From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 2OAQBAvHMWF5WQAAgWs5BA (envelope-from ) for ; Fri, 03 Sep 2021 08:56:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id KM1MOwrHMWHcPQAA1q6Kng (envelope-from ) for ; Fri, 03 Sep 2021 06:56:10 +0000 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 4C9331A53E for ; Fri, 3 Sep 2021 08:56:10 +0200 (CEST) Received: from localhost ([::1]:41654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mM37Q-0003A8-No for larch@yhetil.org; Fri, 03 Sep 2021 02:56:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mM33G-00081j-8H for emacs-orgmode@gnu.org; Fri, 03 Sep 2021 02:51:50 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]:46784) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mM33D-0001xY-8l for emacs-orgmode@gnu.org; Fri, 03 Sep 2021 02:51:49 -0400 Received: by mail-pl1-x62e.google.com with SMTP id bg1so2722890plb.13 for ; Thu, 02 Sep 2021 23:51:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=felesatra-moe.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=BNDO834rVAGIyhtLk90tqC1kk++UozspTm4Sulma0AI=; b=2G5wZPnM2w5R/2TLsLUzb/39tVrVbP57/PZhyWfHbF5BSg03nulUuDHfspII7vGjLw CXNmcjp78di4NMZmCZma4cpFEpvTizbpt5IzO7U7aFwCfZwUGWxoG2iWALmQlhyTS4LW kDum9KtZ4Toa/RLTTjIo0e0NaG3KgNqOkAxY6a9Y/A6gmsqx5AKixNeWdQ1htpYxdxbp AjlP04UTD+hYlnhcwgDu308vWkUtNiPj6qm0UIUSIolBfQTfZMSk3EVX7I/57pf3AVJx LEtCREqCfXkHGBw06fka/J5SG0rc5BuVptP6f+rEpW6yWN2w4m06sQds6W6cnDXFFKgI nurA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=BNDO834rVAGIyhtLk90tqC1kk++UozspTm4Sulma0AI=; b=XllC2hPbGu0dqgpOc+dctg7X8KLGu9MdADTk7r35EUaehPucSwDnxrQNiNsfD1f8k8 vTs7Kudt//PLKAO2dlmy8DSlTaJ3hjvv++YlmumRnct5YE24G1ocmAnexxCZVUyXsh57 1qyctGIINpTNdHouuqu0xBM21H4KtSlmlORRs5LmQro9f+YsEREyYBYmjWuQRT4KhH0z 7Sm+gCGEXzDd5WeF9bVqmSZSW0kaol2RDh2LKH9JV0yaPENs80yIMrhQApb4fE01Hfoh y2vRKfxfBOPx1BOZ9o5GaH4nXDAHGshvg/CRdRVfWbCge5LqDe8voCc8B6klLCRf8OeC aWOQ== X-Gm-Message-State: AOAM530bZD9PnN1Fi39iPvrj4nZFdey1trCtXuBAru6HWlg+I59W0zGb MvL7Xc8Fv2xTGrcWlw9lX69vdA== X-Google-Smtp-Source: ABdhPJwkbEGC/hiyCbvvjMsfZODIHbSF+RHtKlCS0Kb1hl+mBZ6MvM0kNzBJJ/K0SdBdHM2Y8Ikq4Q== X-Received: by 2002:a17:90a:c290:: with SMTP id f16mr2260953pjt.0.1630651904167; Thu, 02 Sep 2021 23:51:44 -0700 (PDT) Received: from localhost ([2600:1700:7270:7d1f:fa59:71ff:fe00:10cc]) by smtp.gmail.com with ESMTPSA id u8sm5105343pgc.69.2021.09.02.23.51.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 23:51:43 -0700 (PDT) From: Allen Li To: No Wayman Subject: Re: [BUG] [BUG] inconsistent behavior when reading multiple tags [9.4.6 (9.4.6-g366444 @ /home/n/.emacs.d/straight/build/org/)] References: <87a6l4b0bx.fsf@gmail.com> Date: Thu, 02 Sep 2021 23:51:42 -0700 In-Reply-To: <87a6l4b0bx.fsf@gmail.com> (No Wayman's message of "Thu, 26 Aug 2021 13:04:20 -0400") Message-ID: <80pmtqp2wx.fsf@felesatra.moe> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=darkfeline@felesatra.moe; helo=mail-pl1-x62e.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, 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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630652170; 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=BNDO834rVAGIyhtLk90tqC1kk++UozspTm4Sulma0AI=; b=FHAIq6CyBoW6qfUkML+gPIPUO42RijSRiboNHowq8wNXo7LnGIJ9rJkECmzetyJBe8F9nO FN1GS+zzunSbzeMBUDIrEXasIUL5656N8EQCa+Fq1/OtIP0+Dd2axeME0n9xVTUj+mJFC6 V5xiVFAZU/y2X5Ipofvl7K91bdRH496HbN+nTDVhbY0JKefWJU4NwON2o9srTciVLbMDcR Z7rTFwxDlu8geG9RVFJV2hwF4J2HC+cn58YT1clW+8L9s5xf/ntiYhIQABXkHo/z9Bj75m NGGvYoIPFguS8cJH+rt+UebYrILLyELQ1zwQstd2QAPsD/Rvgj3izpLo4gdAmA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630652170; a=rsa-sha256; cv=none; b=GdeqtsctqjYdoabjSiMS+58dkOqT/SJn9LgSiQrxXrNROq3jRzo0WqevhIYpuYHJjtwj2E 6y7WruBhrWo+opTi5uMSK1HEMvdF5O7vBjMD8g6KFoNINHGPXZrBN6gz2I41yRJr7RIHHg v7712XBLBA9XT1eJZn8G0eZup6NC6W8kVW6CyEmr9J4rMAXB2+GwJClcRjgxzcrdgwr/K3 GkFRYWqsNYFKgagBtLtXe4Qvd52KGitAXRnTlppjbYMlxw50IxY6cZ4c6jbn4DcCw1bRsx hgOGV1O3XJI7JTxujlqYx8qjC159r6h5sENXJmAi+K1DMn6D+0ty3y0fFTR5fA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=felesatra-moe.20150623.gappssmtp.com header.s=20150623 header.b=2G5wZPnM; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=felesatra-moe.20150623.gappssmtp.com header.s=20150623 header.b=2G5wZPnM; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 4C9331A53E X-Spam-Score: -1.12 X-Migadu-Scanner: scn1.migadu.com X-TUID: Bs56oflFC/dY No Wayman writes: > org-set-tags-command correctly parses the tags when using a comma > (the default > crm-separator) to separate them, but completion is broken unless > ":" is used as > the separator. > org-capture-fill-template incorrectly parses this. > > Reproducible from emacs -Q: > > org-set-tags-command: > 1. Insert a new Org entry in the a buffer > 2. M-x org-set-tags-command > 3. At the prompt enter "one,two,three" > 4. Entry's tags are correctly set to :one:two:three: > > org-capture-fill-template: > 1. evaluate (org-capture-fill-template "%^g") > 2. At the prompt enter "one,two,three" > 3. String returned is incorrect: ":one,two,three:" Sorry about that (I wrote the crm patch). I did not consider people deliberately using invalid tag characters to separate tags. It's an (un?)happy coincidence that org-set-tags-commands retains this behavior, because the fast tags selection logic gets in the way. The inconsistency in behavior can be easily fixed by deleting the code in org-set-tags-commands that replaces invalid tag characters with ":". The question here is, which behavior do we want? My philosphy is that programs shouldn't try to silently re-interpret the user's intentions. For example, if I accidentally mistyped the tag "green_blue" as "green-blue", I don't want Org to "helpfully" split one tag into two tags "green:blue". I may not realize the data corruption until too late. If we want the other behavior (invalid tag characters can separate tags), then it's also a simple matter of changing crm-separator wherever only tags are completed to recognize all invalid tag characters. There's also the option to only allow ":" and "," as separators. > Note this does not change the case of org-todo-list, which binds > crm-separator to "|". I chose not to touch that because I'm not > fully aware > of what the restrictions on characters for todo-keywords are, if > any. > org-todo-list also does the right thing by mentioning the > separator in the prompt. Agreed, org-todo-list is out of scope. > > We could also combine the approaches: > > - Introduce a defcustom that determines if we're going to > contextually rebind crm-separator > - Use a broader regexp when contextually binding crm-separator > - Mention the separator in the prompt when rebound Whichever behavior we choose, I don't think it's worth making it customizable. > > Thoughts? > > > Emacs : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ > Version 3.24.30, cairo version 1.17.4) > of 2021-08-02 > Package: Org mode version 9.4.6 (9.4.6-g366444 @ > /home/n/.emacs.d/straight/build/org/)