From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Filipp Gunbin Newsgroups: gmane.emacs.bugs Subject: bug#54613: 29.0.50; uncomment-region in sh-mode deletes extra char Date: Tue, 29 Mar 2022 22:07:29 +0300 Message-ID: References: <871qykc3tn.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29977"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) Cc: 54613@debbugs.gnu.org, Stefan Monnier To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 29 21:08:59 2022 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 1nZHD8-0007Sw-7l for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Mar 2022 21:08:58 +0200 Original-Received: from localhost ([::1]:49002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nZHD6-0007iH-Sz for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Mar 2022 15:08:56 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47756) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZHCJ-000709-7a for bug-gnu-emacs@gnu.org; Tue, 29 Mar 2022 15:08:08 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39638) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nZHCE-0002Tu-EL for bug-gnu-emacs@gnu.org; Tue, 29 Mar 2022 15:08:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nZHCE-00040x-4P for bug-gnu-emacs@gnu.org; Tue, 29 Mar 2022 15:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Filipp Gunbin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Mar 2022 19:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54613 X-GNU-PR-Package: emacs Original-Received: via spool by 54613-submit@debbugs.gnu.org id=B54613.164858086215393 (code B ref 54613); Tue, 29 Mar 2022 19:08:02 +0000 Original-Received: (at 54613) by debbugs.gnu.org; 29 Mar 2022 19:07:42 +0000 Original-Received: from localhost ([127.0.0.1]:33535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZHBu-00040B-1J for submit@debbugs.gnu.org; Tue, 29 Mar 2022 15:07:42 -0400 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:48545) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZHBr-0003zv-Rg for 54613@debbugs.gnu.org; Tue, 29 Mar 2022 15:07:40 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id D15E95C0046; Tue, 29 Mar 2022 15:07:33 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 29 Mar 2022 15:07:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; bh=ilfLv5Ai05ixDMsNIamgmBao9SCFlv03f9qebm ih0Sc=; b=DUY5egvrSIpiKPGbqC6jEr4xRSTuQHHmNZAxHxWmuse4Y4IkvoMW9t 7GuKWzTdzOLnIYpBnAgl6vw3448pppakO8YlcjJOqukoP3Vxt1jVHazrbId1CXCO uArk4vPRb/ZyR/1V7lGfn/Xmjqjl6Sc21Ril4V+0sRXqqcFdWfueliobmYZJEpZw MGtJCIepdpYmx7v5gsHI/vmfKrA4G/e1Ac+n7GmDMcsywweIVcju8UQPJDkLB6f6 F794xzP0tURxCPif+8Rx1UCiSpmVN/YkvPYXAIv7QKMGJ2+13pRQBqm47fW2ds20 LmhUQ2iubTxIKJII5Dss+oBkTZHxiAvQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=ilfLv5Ai05ixDMsNI amgmBao9SCFlv03f9qebmih0Sc=; b=LyQJt+XQhtlw7nvt0QepIm5UZHWaby2dS AltcXanxndn21CdFaeXNnQ/2Nt7jMgAzCze3xUIk1R3OCjZShwH4h8p7vq5fU4XH ftKbKmb4yHWu+Kk1YN5qTshYMh1xSjForM2KGUkLtAcQYCsOEfL9E1jNbqLqSN51 41dSPwbvw4RJQfipEaETuimuqNHq4itFXBJK1DF2GMFtkoBa4lZYoTCa1IaFIiVZ CNakYVAsQdhx8YXDhnjBpSYGtDfJNCy2Fn1qxh3kTZ8efniNfv2xkD0VQAKELNmP 8ODHl+xTwae+RummmoigNmpAPT4SzjhOSa5f3FCHHrxqap7N7tXiQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudeitddguddtiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffujghffgffkfggtgesthdtredttdertdenucfhrhhomhephfhilhhi phhpucfiuhhnsghinhcuoehfghhunhgsihhnsehfrghsthhmrghilhdrfhhmqeenucggtf frrghtthgvrhhnpefhvefgteeuheekffekueeljeeiveeuledvkeelgfekhfeigedtveef jedvjeelfeenucffohhmrghinhepvgigrghmphhlvgdrohhrghenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehfghhunhgsihhnsehfrghsthhm rghilhdrfhhm X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 29 Mar 2022 15:07:32 -0400 (EDT) In-Reply-To: (Filipp Gunbin's message of "Tue, 29 Mar 2022 18:17:35 +0300") 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:229072 Archived-At: On 29/03/2022 18:17 +0300, Filipp Gunbin wrote: > On 29/03/2022 14:59 +0200, Lars Ingebrigtsen wrote: > >> Filipp Gunbin writes: >> >>> - Notice that `-' after "cat" disappeared >> >> I can reproduce this issue, too. >> >> What happens is that we have the following: >> >> curl -s -d @- http://example.org <> # cat - >> >> with point after "cat -". In that case, (comment-enter-backward) will >> skip back past the " -", because comment-end-skip is >> >> "[ ]*\\(\\s>\\| >> \\)" >> >> And... \s> matches the " -\\'"? Hm. I'm not sure what's the real >> problem here is. Should comment-end-skip have that value in shell >> scripts? On the other hand, commenting out bits of a heredoc-introduced >> command with a continuation line is pretty hairy in itself. >> > > I'm seeing in debugging that "-" after "cat" gets syntax-class "comment > end", which seems wrong. Just in buffer, outside of running > uncomment-region, it doesn't happen. > > Filipp This is the suspect, in sh-font-lock-open-heredoc: --8<---------------cut here---------------start------------->8--- (if (nth 4 ppss) ;; The \n not only starts the heredoc but also closes a comment. ;; Let's close the comment just before the \n. (put-text-property (1- eol) eol 'syntax-table '(12))) ;">" --8<---------------cut here---------------end--------------->8--- So we put ">" syntax on the "-" char, and it gets removed in uncomment-region. Don't know how to fix it, though. Filipp