From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Platon Pronko Newsgroups: gmane.emacs.help Subject: Re: Changes to `make-obsolete` and similar functions make upgrades nearly impossible. Date: Mon, 24 Apr 2023 14:24:08 +0800 Message-ID: <7e85ff18-09c7-f02d-0226-e16aa272802f@gmail.com> References: <19fa8e27-3fac-bc1d-0ed7-4c56d40a5351@potamuses.net> 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="5523"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 To: Lloyd Zusman , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 24 08:25:27 2023 Return-path: Envelope-to: geh-help-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 1pqpde-0001Cs-N2 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 24 Apr 2023 08:25:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pqpce-0008VE-Qa; Mon, 24 Apr 2023 02:24:24 -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 1pqpcY-0008Tr-3v for help-gnu-emacs@gnu.org; Mon, 24 Apr 2023 02:24:19 -0400 Original-Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pqpcW-000615-8I for help-gnu-emacs@gnu.org; Mon, 24 Apr 2023 02:24:17 -0400 Original-Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-63b5c48ea09so3484316b3a.1 for ; Sun, 23 Apr 2023 23:24:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682317453; x=1684909453; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ivWE7rUCQsG8DJfDgbxzh+wAN41Nsp4RWVRT9nWHbyk=; b=qfKwHw4Imp6p3zKD0zJem/8RcqxMCsqxvMm2nF095IaVrNv8fyuiTPXA2jxGpFNbbO gUhO8phnwrtK/8hHArwC9Sk5W4nlYLbaudRlwKBr1goreG2kaL3xtwWUMzTT71BWkgur 60rZOVwmvca6rM/YphTQmVg0MYaNaiUTDpX5duC6nj43Fy5bPXgxQ5gzepip3QT7MWIG T+RSldJJ+uotI5UIuA0YQ3Z3y7VtBV9DHcSBfZc8QZL6XQO2ExBmEvOKK3rrRyw9Btdz JkANYrUhY/ezUSRL5HVoDVf33L37iJBdwDoypIvpELTH/4mrKhlzgupGdIsH+suXvKyP 0Wew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682317453; x=1684909453; h=content-transfer-encoding:in-reply-to:from:references: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=ivWE7rUCQsG8DJfDgbxzh+wAN41Nsp4RWVRT9nWHbyk=; b=UapgORJ0XuvLe9H3egGmhq+J6gelGqka2HmXriomJbJ87iw39mHt4BGYjd629BHR/C XzNpHkjeNtNbSa5OBSbfEEKJ6FUGC0z7tpRcpQkT0fZsKL5E+8tcA4FuMuDygm13Eni8 cGvIqIiYtd3w/Xbpb6Mad1A5dcp3IT+aJUOjMiw04il+2rdAV5trkymaBf+cG/2e5UsI uQGnHjGglyXOzkD3CGxQMdSKknYJEtIEUDf6PU6oiFq0Hb4Q7Tc1BaN8bQcrrh6G4ERM JQEDaqSeEqrsDL5SILM6sX5FlEjptzXuiI41Uibqg7D4TzmNq8yb66uUSqb88GqMcJE9 1X4g== X-Gm-Message-State: AAQBX9d1genUazCGtLnWB0ShHT8t8FjyF20atIjrn15ZyAm1pUhmyOaF 21MHyL3YJjCErSgOrYNNHq8dL2rUaV60nQ== X-Google-Smtp-Source: AKy350aK18Ae8aoZaAy138uw2LMeO9VTYiBD+JGadOZLD5fI+f+aXMTkf0oHkFTBUUBlXjjtYln+Qg== X-Received: by 2002:a05:6a00:23c4:b0:626:29ed:941f with SMTP id g4-20020a056a0023c400b0062629ed941fmr18120980pfc.5.1682317452710; Sun, 23 Apr 2023 23:24:12 -0700 (PDT) Original-Received: from [192.170.1.133] ([103.24.106.35]) by smtp.gmail.com with ESMTPSA id v7-20020a056a00148700b0063f534f8060sm1766069pfu.168.2023.04.23.23.24.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 23 Apr 2023 23:24:12 -0700 (PDT) Content-Language: en-US In-Reply-To: <19fa8e27-3fac-bc1d-0ed7-4c56d40a5351@potamuses.net> Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=platon7pronko@gmail.com; helo=mail-pf1-x42e.google.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 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=-2.143, RCVD_IN_DNSWL_NONE=-0.0001, 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: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:143360 Archived-At: On 2023-04-23 21:56, Lloyd Zusman wrote: > I'm a very long-term GNU emacs user: since the 1980's. > > I have been using numerous elisp packages, lots of which date > back many years, and a few of my own elisp modules go all the > way back to the 1980's. > > I have been using emacs-27.2 for a few years, and now I decided > to upgrade again. However, when going to emacs-28.2, I hit an > issue with the following emacs enhancement (this comes from the > emacs change log): > >> 2021-01-03  Stefan Monnier  >> >>        * lisp/emacs-lisp/byte-run.el (make-obsolete): Make `when` mandatory >> >>        (define-obsolete-function-alias, make-obsolete-variable) >>        (define-obsolete-variable-alias): Adjust similarly. > > Because of `when` becoming mandatory, I now get literally hundreds > of messages which look like this when starting up emacs-28.2 ... > >> Warning (comp): /path/to/some-elisp-module.el: Error: Wrong number of arguments make-obsolete-variable > > I know that I can get rid of these messages by upgrading each and > every one of my installed emacs packages. However, I have several > dozens of these packages, and some are old, no-longer-maintained > modules. It would take me a huge amount of time to replace the > packages that are upgradable and to manually go into all of the > no-longer-maintained packages and change the calling sequence of > `make-obsolete` and the others. > > If the `when` parameter was not made mandatory in `make-obsolete` > and its cousins, I would not have to do this huge amount of work > to upgrade emacs. The commit message for the change states that usages without `when` were marked obsolete in version 23.1, which was released in 2009 (14 years ago). It seems you have dozens of packages that haven't been updated for 14+ years. While some may argue the "security" aspect, I won't, because I don't fully agree that everyone needs to sacrifice everything for imaginary "security." Old, tried, and tested software can be great. However, I question the wisdom of upgrading one part of the system without upgrading everything else. If you're okay with running such ancient packages, maybe you don't need to upgrade Emacs? Even the 23.1 release should compile and run fine today. In general, there are two approaches to upgrades: 1. Gradually and in sync update everything (e.g., rolling releases like Arch Linux are a great example). This approach spreads the pain of breakage evenly over time, and you get to enjoy the benefits of fresh software. 2. Fix everything at a single point in time, and keep it that way for a long time. This brings the benefit of stability and everything working exactly the same at all times. However, at some point, you might need to upgrade, and then you'll have to endure the pain of upgrading everything at once, with many things breaking down and needing a complete overhaul. I don't think that anything in between these approaches really works – you'll get downsides of both approaches without much benefit. > The `make-obsolete` family of functions are meant to help during > upgrading. However, changing the mandatory/non-mandatory parameter > semantics of those functions is actually an *impediment* to > upgrading. > > Is there any existing fix for this problem short of the massive > amount of work needed for me to upgrade and fix all my existing > emacs packages? Perhaps contributing back to the community by fixing the packages might be the best way forward? This task involves relatively straightforward and easy changes, something that can be done in several hours at most. > I'm thinking of doing something like the following. Put code like > this at the top of my $HOME/.emacs file: > >> (if (not (fboundp 'orig-make-obsolete)) >>     (fset 'orig-make-obsolete >>           (symbol-function 'make-obsolete))) >> (fmakunbound 'make-obsolete) >> (unintern 'make-obsolete) >> (defun make-obsolete (obsolete-name current-name &optional when-var) >>   (when when-var >>       (orig-make-obsolete obsolete-name current-name when-var))) > > ... or something like that. > > Is this kind of workaround my only hope for avoiding the huge amount > of work necessary to upgrade and fix the code in all of my existing > emacs packages? This workaround (or something similar) should work. However, consider other deprecations, obsoletions, and breakages that have accumulated over the years. At some point, you'll still need to bite the bullet and upgrade. -- Best regards, Platon Pronko PGP 2A62D77A7A2CB94E