From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: Escape syntax in docstrings Date: Thu, 23 Mar 2023 23:02:08 +0100 Message-ID: <6F82ED30-8C89-4DEE-B4B0-6F58E118BB41@gmail.com> References: <87edpfnqln.fsf@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.14\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37083"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Chen Zhaoyang Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 24 16:44:25 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 1pfjab-0009Hj-0H for ged-emacs-devel@m.gmane-mx.org; Fri, 24 Mar 2023 16:44:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pfZzw-00045Y-5b; Fri, 24 Mar 2023 01:29: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 1pfT1P-0006Pt-KN for emacs-devel@gnu.org; Thu, 23 Mar 2023 18:03:00 -0400 Original-Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pfT1C-0002wz-QB for emacs-devel@gnu.org; Thu, 23 Mar 2023 18:02:59 -0400 Original-Received: by mail-lf1-x12a.google.com with SMTP id i13so13977622lfe.9 for ; Thu, 23 Mar 2023 15:02:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679608931; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=wkNE4gZiTfwZF9dmKsp3aELrIwlaeBXC4U35aDSOd78=; b=E8Z+OSyLNlrPBVadnXw2mL1flyYA6wDiQkdP1zPrjrmwPV9V59DTVSEx7qVR0NKV10 y3U+tQ5lsyAoCOM2ggDSjNAduQw5ZSI6q1pAt01brZE25lrzVw4r4F3X/7lNcusUOhTG IcR2iOjLUBg2N83uQvAm51d1x2kOb5nm2b85dgFKy4ZAXyE/0fd8C8kViNaqjRwM2gEm c8QypIHxaSnhDJRk7Zba3t0nTzBWr/zoWUwkB4xvgq3j8nJY43R4c2QY3WSR05iI9kWc gYu0gZDLDvbj0060w8S3bt5ljurPQ7V1lUwCXnKTLi3+9FffDx8TjqD7ncoWdIYFYsJZ tu7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679608931; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=wkNE4gZiTfwZF9dmKsp3aELrIwlaeBXC4U35aDSOd78=; b=qM5frr1cXMXZsu5eYidGvPzqyEs69VhY3ChADDRcSJl2XPdgUTxldsw7jMO363z5NM NTiVR6N1e0tiVhZh7WmgIjofU9/rlVj3zl6vLmGknJhPb10FFP0gO0b0gM/754Kui1QO sYYapK+RRPvyUi7weOnLUXQuH+747XrNT7BxzIcMklp0I5mtKQn/4ZibW5QeH6R3lWg2 RWzmM6HLWn+s0y9yBzM+AMDfBkvaY/vs6qpk72+5RrHS+wV2TeIMGIs+wAXais4J2dsQ JwfQWoENHekVU/hWE2scP+Ms7DFfCLygvoqQbeTrMb5X7mRI+8jM2ETzeEbiUydUrlLK nMWA== X-Gm-Message-State: AO0yUKXwMpRPuV8OzSrQMpuJ1xaJE8CAGh3CxWLrQMha2yhlADJFs8Js MPAWEshe7wXI8l7LJGHLTvU= X-Google-Smtp-Source: AK7set+EXCAK5VbfgUJ+PVirWSRO8eAf74NGA9nbe8KM5QQMTQK5P/8FiVCi0J1n6FkXJDiqHWiMbw== X-Received: by 2002:a05:6512:239b:b0:4ea:e695:27 with SMTP id c27-20020a056512239b00b004eae6950027mr2142459lfv.7.1679608929810; Thu, 23 Mar 2023 15:02:09 -0700 (PDT) Original-Received: from smtpclient.apple (c188-150-171-209.bredband.tele2.se. [188.150.171.209]) by smtp.gmail.com with ESMTPSA id q4-20020ac25104000000b004cb23904bd9sm3073095lfb.144.2023.03.23.15.02.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Mar 2023 15:02:09 -0700 (PDT) In-Reply-To: <87edpfnqln.fsf@gmail.com> X-Mailer: Apple Mail (2.3654.120.0.1.14) Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=mattias.engdegard@gmail.com; helo=mail-lf1-x12a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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-Mailman-Approved-At: Fri, 24 Mar 2023 01:29:54 -0400 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:304750 Archived-At: 23 mars 2023 kl. 21.46 skrev Chen Zhaoyang : > Since when did emacs become stricter when enforcing the escape syntax = in > docstrings? On 27.1 (built by debian), this function evals to no = error: >=20 > (defun slash-in-docstring () > "\x -> x" Yes, this was changed recently, but I feel vindicated by your report: = "\x" never meant what the author thought it did (or at least what I = think the author thought it did): it is a hex escape without digits and = used to be equivalent to "\000", yielding the control character NUL. Run = `C-h f slash-in-docstring` in Emacs 29 or older and see for yourself. The probability of anyone writing \x expecting NUL is, well, nil. It's = guaranteed to be a mistake. In fact, if you alpha-rename that doc string to "\y -> y" then Emacs = won't complain but the doc string will still be wrong and behave as if = you wrote "y -> y". (The 'relint' tool finds these things as an extra = service.) (That Emacs doesn't reject undefined character escape sequences such as = "\y" is not only a constant source of bugs, it also makes it difficult = for us to add new escape sequences without worrying about breaking some = (misguided) code. Almost every other language complain about this.) Thanks for your report -- I scanned all packages on my disk for = occurrences of \x without digits when making the change and found none. = Shame on me for not using HOL! > (defun agda-input-compose (f g) > "\x -> concatMap F (G x)" Good catch. Would you tell the Agdas about it? > Can we document this change of behavior?=20 Will do.