From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: master 5a125fb5a97 1/2: Update to Org 9.7.3 Date: Thu, 13 Jun 2024 13:00:58 +0000 Message-ID: <878qz9gfp1.fsf@localhost> References: <171796793548.23337.12512115872160390161@vcs2.savannah.gnu.org> <20240609211858.A2C31C1F9FB@vcs2.savannah.gnu.org> <87a5jtd403.fsf@yahoo.com> <87h6e1lhtd.fsf@kyleam.com> <868qzd9hjg.fsf@gnu.org> <871q53u75e.fsf@localhost> <8634pj7jni.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19236"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , kyle@kyleam.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 13 15:00:22 2024 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 1sHk3x-0004nM-PH for ged-emacs-devel@m.gmane-mx.org; Thu, 13 Jun 2024 15:00:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sHk3C-0004nJ-Ui; Thu, 13 Jun 2024 08:59:35 -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 1sHk3B-0004n7-B9 for emacs-devel@gnu.org; Thu, 13 Jun 2024 08:59:33 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sHk39-00043o-3a for emacs-devel@gnu.org; Thu, 13 Jun 2024 08:59:33 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id AF047240028 for ; Thu, 13 Jun 2024 14:59:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1718283560; bh=RnL3by8brUeQ2SD9hYRhqj4e5cZWB3jfvyLo8hP5p8M=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=nGe3KSpLhNJp8w7fllvu4QN+0rZ4DjIUHrQuHZ5FFp+6NByMolq12eTbL3hxBQNd4 4NTG1a67lmNdzGuci+/gUSIX/zzusLl1ruCiZHSCuIwGi2nljV+rXyM7EgMF2UPlUa maRSkgTHKE14wMm3ul9BmBKhfyCf54u/wwDxxGRoJt7MW83ZMXIQl4f2NxYwPoxwP5 4zTZtFnbkgKKqpv7uNnw1P6IbGKQQ9vvOrhCbsMspuAr8OGB5BuciafQ7KJqYm5CWU Ufqo3VFrSvdSTk9AiSB0jmRpwKnNWcMOwtuJ/oc+kwUGNSH91OsQZJlTlZ5QG23sYk L4cKcWOjg/chg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4W0Mtb5tmbz6twK; Thu, 13 Jun 2024 14:59:19 +0200 (CEST) In-Reply-To: <8634pj7jni.fsf@gnu.org> Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-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:320018 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> (defcustom org-num-skip-tags nil > ... >> :safe (lambda (val) (and (listp val) (cl-every #'stringp val)))) >> >> Note that org-num.el where `org-num-skip-tags' is defined does have >> (require 'cl-lib). >> >> IMHO, there is some problem either with loaddefs generation or with the >> fact that loaddefs file is compiled at all. > > No, the problem is that this variable uses cl-lib stuff for safep > functions. IMO, this is not a good idea, and the above situation is > precisely the evidence for that. > >> Of course, we can always convert that lambda into a proper function, >> which will likely get rid of the warning. > > Yes, please. Emacs 28 and later has list-of-strings-p, but if you > want to support older versions of Emacs, perhaps that's not usable. > Or maybe we could add that to compat.el. Org cannot directly use compat.el for now. I am attaching tentative patch that defines a compatibility alias and autoloads it. Is this approach good enough? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-num-skip-tags-Avoid-using-function-that-is-not-p.patch >From e70b7ce648aa54d5c6a3c91a2fd9982cd0a6e790 Mon Sep 17 00:00:00 2001 Message-ID: From: Ihor Radchenko Date: Thu, 13 Jun 2024 14:53:03 +0200 Subject: [PATCH] org-num-skip-tags: Avoid using function that is not pre-loaded in autoloads * lisp/org-num.el (org-num-skip-tags): Make sure that function used for :safe `defcustom' slot does not require functions that are not defined in org-loaddefs.el. This is because `org-num-skip-tags' is autoloaded and cannot rely upon requires in org-num.el. Instead, it may only use pre-loaded functions and other autoloaded Org mode functions. Reported-by: Eli Zaretskii Link: https://yhetil.org/emacs-devel/868qzd9hjg.fsf@gnu.org/ --- lisp/org-compat.el | 11 +++++++++++ lisp/org-num.el | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index d6620f962..41c26ad72 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -251,6 +251,17 @@ (defun org-format-prompt (prompt default &rest format-args) default))) ": "))) +(if (fboundp 'list-of-strings-p) + (defalias 'org-list-of-strings-p #'list-of-strings-p) + ;; From Emacs subr.el. +;;;###autoload + (defun org-list-of-strings-p (object) + "Return t if OBJECT is nil or a list of strings." + (declare (pure t) (side-effect-free error-free)) + (while (and (consp object) (stringp (car object))) + (setq object (cdr object))) + (null object))) + ;;; Emacs < 27.1 compatibility diff --git a/lisp/org-num.el b/lisp/org-num.el index aebfef050..a8fcf3333 100644 --- a/lisp/org-num.el +++ b/lisp/org-num.el @@ -144,7 +144,7 @@ (defcustom org-num-skip-tags nil :group 'org-appearance :package-version '(Org . "9.3") :type '(repeat (string :tag "Tag")) - :safe (lambda (val) (and (listp val) (cl-every #'stringp val)))) + :safe #'org-list-of-strings-p) ;;;###autoload (defcustom org-num-skip-unnumbered nil -- 2.45.1 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--