From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#48404: 28.0.50; "Invalid version syntax" errors with read-extended-command Date: Fri, 14 May 2021 10:18:40 +0300 Message-ID: <83czttzstr.fsf@gnu.org> References: <875yzms6im.fsf@gnu.org> <83wns1zvhs.fsf@gnu.org> <871ra9kdgs.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7063"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 48404@debbugs.gnu.org, stefan@marxist.se To: Tassilo Horn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 14 09:19:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1lhS6I-0001jB-J1 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 May 2021 09:19:10 +0200 Original-Received: from localhost ([::1]:46376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhS6H-0001xw-MD for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 May 2021 03:19:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47726) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhS6A-0001xW-MX for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 03:19:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33285) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lhS6A-00073z-FT for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 03:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lhS6A-00075I-9g for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 03:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 May 2021 07:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48404 X-GNU-PR-Package: emacs Original-Received: via spool by 48404-submit@debbugs.gnu.org id=B48404.162097671727196 (code B ref 48404); Fri, 14 May 2021 07:19:02 +0000 Original-Received: (at 48404) by debbugs.gnu.org; 14 May 2021 07:18:37 +0000 Original-Received: from localhost ([127.0.0.1]:44831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhS5l-00074a-4D for submit@debbugs.gnu.org; Fri, 14 May 2021 03:18:37 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53978) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhS5i-00074M-I2 for 48404@debbugs.gnu.org; Fri, 14 May 2021 03:18:36 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:45004) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhS5d-0006hT-5D; Fri, 14 May 2021 03:18:29 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2048 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhS5c-00059M-M6; Fri, 14 May 2021 03:18:29 -0400 In-Reply-To: <871ra9kdgs.fsf@gnu.org> (message from Tassilo Horn on Fri, 14 May 2021 08:47:32 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:206489 Archived-At: > From: Tassilo Horn > Cc: 48404@debbugs.gnu.org, stefan@marxist.se > Date: Fri, 14 May 2021 08:47:32 +0200 > > > In any case, it sounds like blindly trusting the value of that > > property is not a good idea, and we should wrap the call to > > version-to-list there in condition-case. Could you try that? > > I've tried this > > --8<---------------cut here---------------start------------->8--- > diff --git a/lisp/simple.el b/lisp/simple.el > index 0255f69e42..573e344fea 100644 > --- a/lisp/simple.el > +++ b/lisp/simple.el > @@ -2020,8 +2020,10 @@ read-extended-command > ;; Has a current-name. > (functionp (car obsolete)) > ;; when >= emacs-major-version > - (>= (car (version-to-list (caddr obsolete))) > - emacs-major-version)))))) > + (condition-case nil > + (>= (car (version-to-list (caddr obsolete))) > + emacs-major-version) > + (t nil))))))) > pred))) > (complete-with-action action obarray string pred)))) > --8<---------------cut here---------------end--------------->8--- > > which does the trick. Thanks, I think this should be installed unless someone comes up with a better idea (but see below). > Should I write bug reports for Magit and Yasnippets so that they should > only specify the version number in `make-obsolete' / > `make-obsolete-variable'? Or should emacs support the " > " syntax? I don't think we will support the deviant syntax in version-to-list, no. But I don't really understand why we compare versions in the snippet above -- the command is already established as being obsolete, so we've got to be running an Emacs version where it is indeed obsolete, and the version text sounds redundant to me. Stefan? If we remove the version check, the problem with 3rd-party packages will be automatically resolved. Otherwise, I don't think we can solve this except by ignoring those non-Emacs versions, because there's no way for us to know whether, e.g., "Magit 3.0.0" is older or newer that Emacs whose version is emacs-major-version. IOW, if we insist on checking the version, AFAIU this feature cannot possibly work for obsolete commands from 3rd-party packages, they will always be included in completion lists.