From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mauro Aranda Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Improve find-sibling-rules option type Date: Sun, 24 Sep 2023 06:44:48 -0300 Message-ID: <8a5727cb-0914-715e-75be-3b57b5c512ea@gmail.com> References: <20230924010433.1770-1-hello@paulwrankin.com> <837cog3zkl.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37081"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Cc: emacs-devel@gnu.org To: Eli Zaretskii , "Paul W. Rankin" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Sep 24 11:45:29 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkLg8-0009O7-Cl for ged-emacs-devel@m.gmane-mx.org; Sun, 24 Sep 2023 11:45:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkLfc-0007Wh-Bn; Sun, 24 Sep 2023 05:44:56 -0400 Original-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 1qkLfb-0007WY-5J for emacs-devel@gnu.org; Sun, 24 Sep 2023 05:44:55 -0400 Original-Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qkLfZ-0007g7-IU; Sun, 24 Sep 2023 05:44:54 -0400 Original-Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-6c4e30a3604so412703a34.2; Sun, 24 Sep 2023 02:44:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695548691; x=1696153491; darn=gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=W6axyBM7U9hVqjCHU1GQfSPwNQ2o5zAMtW3jTIZWm+k=; b=gOdPlq43T6DTeKGAHSYeziCUruoCxv5ILcSSkuXJ2OVZzrXu/9/3XIQL6d+Xz/SUiO 1/+YfpJClJ/MoKnPIxROJou8eEyIcPStOnQC7J9TNyXkKIBTlASC7r/wVeIUKZiFNPwG gu5b8ktARxP8o10r3FeRMk2epmlgX99qXeniZDOXUIgSiJQc2+qCJR7aRRDID2DzxDdk TDvC/DbrDLa9UgLIbMpebx+Mz3RmU9YSUT/msygYRH4PBQyqaZ3TaUjEGSpNoSxgFXiG BJC+5ovvRS8ifnWrWWBn6jyGtROebS6lAFX1Bh96kfFnuYb5HGFvIvm1PmoBL0d7sKjH VJGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695548691; x=1696153491; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=W6axyBM7U9hVqjCHU1GQfSPwNQ2o5zAMtW3jTIZWm+k=; b=qL1ox1xzB3w6E7Cql1E4WGeYuPOyku2oKEdpcwJymNBKwjAsDcm43IlsPl2YLVVIZC wLAnd1glqdJyEOLmBWO8nw1AZHRWjdAxYWlUMAPn5AlLufh4zk6Inn92FMgaxPGVwFEW nXA9tDPWaYA2uEjwajT3csX2TWg3YuuX21lNjIsQOZEwHtMuzLCtk0cdRL9SdmwUW6KI IIr9C96/UsqEpzvxQzFCJ9y4P7O81I9em2lfgWFU9P6rYavmyAXfEPuvCWT6qaKXR1VT lURSNzmsS/DFk+ibVfMHUy+nuhcDiaA92RCtzsnAyZCspDp+pBAAotXsv5JOMc8jo6cO 1EvA== X-Gm-Message-State: AOJu0YxErR71jKKv0wLRDQbfXCJjioqaYLHMZEy8aVvRrbCEXajf0LhG S4S84jf8s9tr+xqwRcwx9BeFVR/jEG4= X-Google-Smtp-Source: AGHT+IEhS9ByZ7ueRmFofGE1fTV24QKBpAsMqXavFyIBgWTB2Ovqrzr6wKqRLig6r4S8lqx+zIwpGA== X-Received: by 2002:a05:6830:1557:b0:6b8:dcd2:8b9e with SMTP id l23-20020a056830155700b006b8dcd28b9emr4534126otp.7.1695548691116; Sun, 24 Sep 2023 02:44:51 -0700 (PDT) Original-Received: from [192.168.0.234] ([152.168.142.156]) by smtp.gmail.com with ESMTPSA id m1-20020a656a01000000b0056c5454105csm5090389pgu.93.2023.09.24.02.44.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 24 Sep 2023 02:44:50 -0700 (PDT) Content-Language: en-US In-Reply-To: <837cog3zkl.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::32e; envelope-from=maurooaranda@gmail.com; helo=mail-ot1-x32e.google.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 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_FROM=0.001, NICE_REPLY_A=-1.473, 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-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:311018 Archived-At: On 24/9/23 02:33, Eli Zaretskii wrote: >> Cc: "Paul W. Rankin" >> Date: Sun, 24 Sep 2023 11:03:27 +1000 >> From:  "Paul W. Rankin" via "Emacs development discussions." >> >> * lisp/files.el (find-sibling-rules): use alist with tags for custom >>   type >> --- >> This is preferable than having to enter a sexp as a user option. > > Thanks. > > Mauro, any comments? In particular, AFAICT there could be more than one EXPANSION.  In that case, :value-type should be a repeat of strings, not just a string.  In addition, regexp should be used as the :key-type type.  (I see that Philip already spotted this) In general, when converting from sexp to a more specific type, I think we have to take extra precaution and check the code for how the variable it's used (i.e., the docstring might not tell the whole story). If ever in doubt, then it might be better and safer to offer a choice with the more specific type first, and keep sexp as a catch-all alternative.