From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] Add compat.el Date: Thu, 07 Oct 2021 20:49:12 +0000 Message-ID: <87y274mugn.fsf@posteo.net> References: <877dfavmzw.fsf@posteo.net> <87y278ieeh.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="547"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 07 22:59:46 2021 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 1mYaUU-000AUH-0f for ged-emacs-devel@m.gmane-mx.org; Thu, 07 Oct 2021 22:59:46 +0200 Original-Received: from localhost ([::1]:49822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mYaUS-0004uM-9j for ged-emacs-devel@m.gmane-mx.org; Thu, 07 Oct 2021 16:59:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYaKP-0000w0-Ua for emacs-devel@gnu.org; Thu, 07 Oct 2021 16:49:23 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:52673) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYaKL-000186-78 for emacs-devel@gnu.org; Thu, 07 Oct 2021 16:49:21 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 3ED02240101 for ; Thu, 7 Oct 2021 22:49:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1633639754; bh=w+zrBxTGw9qjOMzcMFwwPco9yGbYXX1KnGuJsq1ObZE=; h=From:To:Subject:Autocrypt:Date:From; b=mRk4AZeHPY1RExCrkwQdSBAZgS7LRFVBKyq7T8EBsL7/ES3+1C++AU1HcxTwDUJTx bdzGfGimOiheGGR9hUI0YhXBES/JISFAXmUlazfxz0Hdxrkhrcghqn5uOCCg0RzJql VTnZ3JOXSCbtn5UpA3xclqP4jIqOZ+HXCT786syc3KG8N41cwsDr7eaw5SG3bbeAc2 xw6gAu8iC+tl/yZRHrI7twnaXFGuwMVIhUGoiM3/Aias4VD3XwgLYYbvGJAnV0blUr Td/g7AJNAxDsVIxpF+aJYROKW2nOBjpnFB14BvWoTeMPR35Raq7KcWAqGU8iHOU0mQ S0rnhtDO6R0xA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4HQNj54gj9z9rxM for ; Thu, 7 Oct 2021 22:49:13 +0200 (CEST) Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB In-Reply-To: <87y278ieeh.fsf@posteo.net> (Philip Kaludercic's message of "Mon, 04 Oct 2021 23:00:38 +0000") Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.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_H2=-0.001, 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.23 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" Xref: news.gmane.io gmane.emacs.devel:276519 Archived-At: Philip Kaludercic writes: > Hello again, > > I have been working on compat.el over the last week, and have written a > number of tests. The source code has been uploaded here: > > https://git.sr.ht/~pkal/compat > > The library should be usable in it's current state, but I'd be > interested to hear from other people and developers too. There might be > missing functions or macros, edge cases that could be added to the > tests, etc. that could be improved. An interesting issue I found when testing compat.el with older versions is that string-replace and string-search fail, due to the same kind of issue. >From Emacs 27 onwards, this works as expected: (string-replace "\377" "x" "a\377b") ;; => "axb" internally, the compatibility function for string-replace uses replace-regexp-in-string. The same code, when evaluated by a version of Emacs older than 27 fails to replace the character (string-replace "\377" "x" "a\377b") ;; => "a\377b" For string-search, using string-match internally, the "unusual" byte cannot be found: (string-search (string-to-multibyte "\377") "ab\377c") ;; => nil whereas the expected answer is 2. I couldn't find anything in NEWS.27 to indicate that something had changed, so I wonder if there was a bug that was fixed? Does anyone know or remember why this behaviour changed? -- Philip Kaludercic