From unknown Tue Jun 17 20:19:49 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#54613 <54613@debbugs.gnu.org> To: bug#54613 <54613@debbugs.gnu.org> Subject: Status: 29.0.50; uncomment-region in sh-mode deletes extra char Reply-To: bug#54613 <54613@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:19:49 +0000 retitle 54613 29.0.50; uncomment-region in sh-mode deletes extra char reassign 54613 emacs submitter 54613 Filipp Gunbin severity 54613 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 28 13:19:47 2022 Received: (at submit) by debbugs.gnu.org; 28 Mar 2022 17:19:47 +0000 Received: from localhost ([127.0.0.1]:59104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYt1u-0007mK-PO for submit@debbugs.gnu.org; Mon, 28 Mar 2022 13:19:47 -0400 Received: from lists.gnu.org ([209.51.188.17]:32860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYt1t-0007mC-6z for submit@debbugs.gnu.org; Mon, 28 Mar 2022 13:19:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYt1t-0005tM-25 for bug-gnu-emacs@gnu.org; Mon, 28 Mar 2022 13:19:45 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:42967) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYt1q-0002L7-Tg for bug-gnu-emacs@gnu.org; Mon, 28 Mar 2022 13:19:44 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 1B2035C01D7 for ; Mon, 28 Mar 2022 13:19:42 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 28 Mar 2022 13:19:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to; s=fm3; bh=i +f+PnupQjskYwyOgACMtDFLBi7iW5nfbAPxFS4wg7c=; b=WPg21RvbmGRyKgR+D w7tNhMFpHh8bhaZj8+3WvipSFKD0/cSi3Y0Pah9S1LnN6kCMK5wkiHilN9QBv7kP Dw/GSNyyzd5gH5blNY/7DebiqicX0VbeYHVFOdpg4TE41EsBMdVgG4d8WJ2Y+Nm+ NU1VDNDyEpy/vtgPWdqmsu3V2tw+XKOJRGIufzR82vXc8S0y9R+5MuUNJRme/8RX 88Z1tbalJNHnT27LcS8PFfku2IhaOJGyHJ4P9AdcYpcZezMhW2r8AmKGYLxblyPl BR7WzjUb7G1Nssj44XiedBDS8urxcQ6n4m8QGC0Bh/MkSKh3QWw1097YGchsmgQw +9xZQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:from:from :in-reply-to:message-id:mime-version: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=i+f+PnupQjskYwyOgACMtDFLBi7iW5nfbAPxFS4wg 7c=; b=UdKQ3NrdKHnZdbFLsrTg80XcQD5pJvfBPPsI4ZuPV/6jIxlnr4/yBtNhM hBSvmZuVQ7wDCFL8/Tr0yMtbEwMTm0oL4epU3+l7BG6TdBeSMNF/tmbOdG7hbcuA emJJsK8HLNEoTh/ZV06zddcJl6oJ2ONlnILT1LFXGBQy1EWuPbFzwY+JHV5c8es+ 08gh/CYxda9F9ofWZwvLr+rFQ6VLxZeSbdihrVx0a5cOXIaGCjpLI4CQaTzC8zp3 53uAx6bLlYrll1iH86x1lb+lUgtEmYWUBcWGp3T2G6Y89FniQYQ7IafGgQwGGMAe n5BL4I0Z60jihVEjkPdCeRnWU4aUA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudehjedgudduvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufgffffkgggtsehttdertd dtredtnecuhfhrohhmpefhihhlihhpphcuifhunhgsihhnuceofhhguhhnsghinhesfhgr shhtmhgrihhlrdhfmheqnecuggftrfgrthhtvghrnhepueejfeevudejleefiedvjeeggf eufeduiedvgfeiieeuledugffhleeuffehgfdunecuffhomhgrihhnpegvgigrmhhplhgv rdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epfhhguhhnsghinhesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 28 Mar 2022 13:19:41 -0400 (EDT) From: Filipp Gunbin To: bug-gnu-emacs@gnu.org Subject: 29.0.50; uncomment-region in sh-mode deletes extra char User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) Mail-Followup-To: bug-gnu-emacs@gnu.org Date: Mon, 28 Mar 2022 20:19:38 +0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=66.111.4.28; envelope-from=fgunbin@fastmail.fm; helo=out4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) - emacs -Q - Visit this file: --8<---------------cut here---------------start------------->8--- #!/bin/bash curl -s -d @- http://example.org <8--- - Put point at bol on the second line (where "curl" is) - M-x comment-region - M-x uncomment-region - Notice that `-' after "cat" disappeared Thanks. In GNU Emacs 29.0.50 (build 11, x86_64-apple-darwin20.6.0, NS appkit-2022.60 Version 11.6.1 (Build 20G224)) of 2022-03-28 built on fgunbin.local Repository revision: 3f19a23c1f60757c54a0ec7d84c625d83766ee08 Repository branch: HEAD System Description: macOS 11.6.1 Configured using: 'configure --enable-check-lisp-object-type --with-file-notification=no' Configured features: ACL GLIB GNUTLS LCMS2 LIBXML2 MODULES NS PDUMPER PNG RSVG SQLITE3 THREADS TOOLKIT_SCROLL_BARS WEBP XIM ZLIB Important settings: value of $LC_CTYPE: UTF-8 value of $LANG: ru_RU.UTF-8 locale-coding-system: utf-8-unix Major mode: Shell-script Minor modes in effect: csv-field-index-mode: t sh-electric-here-document-mode: t shell-dirtrack-mode: t minibuffer-depth-indicate-mode: t midnight-mode: t epa-global-mail-mode: t display-time-mode: t display-battery-mode: t desktop-save-mode: t tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t file-name-shadow-mode: t jit-lock-debug-mode: t line-number-mode: t indent-tabs-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow mail-extr emacsbug gnus-async gnus-ml disp-table cursor-sensor qp imap rfc2104 nndraft nnmh utf-7 epa-file gnutls network-stream nsm nnml nnfolder nnnil gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig nntp gnus-cache gnus-sum shr pixel-fill kinsoku url-file url-dired svg dom gnus-group gnus-undo gnus-start gnus-dbus gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range gnus-win gnus nnheader range term/xterm xterm cus-start csv-mode sort dired-aux sql-indent vc-git diff-mode vc-dispatcher noutline outline easy-mmode sh-script smie executable w3m-load w3m doc-view jka-compr image-mode exif timezone w3m-hist w3m-fb bookmark-w3m w3m-ems w3m-favicon w3m-image w3m-proc w3m-util vlf-setup advice tramp-hdfs tramp-sh docker-tramp tramp-cache tramp tramp-loaddefs ...) Memory information: ((conses 16 250501 21292) (symbols 48 23802 6) (strings 32 84371 3359) (string-bytes 1 3043075) (vectors 16 46528) (vector-slots 8 1146153 195358) (floats 8 289 657) (intervals 56 864 89) (buffers 992 29)) From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 28 14:21:35 2022 Received: (at 54613) by debbugs.gnu.org; 28 Mar 2022 18:21:35 +0000 Received: from localhost ([127.0.0.1]:59176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYtzj-0000wb-Ez for submit@debbugs.gnu.org; Mon, 28 Mar 2022 14:21:35 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:53905) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYtzh-0000wN-Nj for 54613@debbugs.gnu.org; Mon, 28 Mar 2022 14:21:34 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id D51213201591 for <54613@debbugs.gnu.org>; Mon, 28 Mar 2022 14:21:27 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 28 Mar 2022 14:21:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= 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=4jlPHQz/nHXMKiCsZwZt03PxM8j/oDxmca43lR s6fw0=; b=rInJXKNoPs8dcSGx5+nJrUiALSuYDb+ZyHU3MaTD1NdzJPViQThPVn Lq5s8rYOqLu1BtEYfhN7o+rY9yJBd0XKmNeVECL8As4P/k/4YF7cCp7NaWPe0NXg TjfTRBUioKkXGYPGr0heBHsL/07QPN25xuFdSSDgjj6GdwqyQprtFhfb0m+zvM/X yT7jxGRD/HkBccsTEFMf9hW6GRbhp7GqT15BgM2MIleS3VEpk16F2bCqyrcsyZR2 tN5HFrZQd3XXTaf/k4oEuQKAGHF12nV7f7p11o2dqOFD0bIb8zZ/OG8tpJrl8SyM oYsv/gSaw4uW0f011OBczTrju8G0hIug== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=4jlPHQz/nHXMKiCsZ wZt03PxM8j/oDxmca43lRs6fw0=; b=LHy2k2fsUjwQbhp6t4Tca/ZcbwA6VsFQF DE9jpp5Rmvuj36ygn9+TUcvnPk4SFZG//X86yQ94uUMrPkFmNrl/+hIsoxJF9yEL auF2a16Kq1Gdm1ULwksl25b7ag6/3YIhUiT6/+jQZH+XfLyk2qxiPqgZuu6vro2R 9+zGnQNSM+iNRmEiJ2+oGQAECTp17Ij/z5mhH6rwu4gO15P+rDVFzf1FC2mmkSLm NSO4L5CVoDQOHLdrAU/6JRAa31DLV3B2mbsNoKZ4ywPTVcHhwKi/g8cVSI+O2b3L m7On1GCQ7yleJfeKFCl+3LxKNs0H7BHtOFKeYeSz1+ZfvNnrp2mzQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudehjedguddvfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufgjfhgffffkgggtsehttd ertddtredtnecuhfhrohhmpefhihhlihhpphcuifhunhgsihhnuceofhhguhhnsghinhes fhgrshhtmhgrihhlrdhfmheqnecuggftrfgrthhtvghrnhepvdevkeffvdeuvefhuddtje ehkedvueefveettddtveduudfgieffieevieevhfdtnecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomhepfhhguhhnsghinhesfhgrshhtmhgrihhlrd hfmh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for <54613@debbugs.gnu.org>; Mon, 28 Mar 2022 14:21:26 -0400 (EDT) From: Filipp Gunbin To: 54613@debbugs.gnu.org Subject: Re: bug#54613: 29.0.50; uncomment-region in sh-mode deletes extra char In-Reply-To: (Filipp Gunbin's message of "Mon, 28 Mar 2022 20:19:38 +0300") References: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) Date: Mon, 28 Mar 2022 21:21:24 +0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54613 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 28/03/2022 20:19 +0300, Filipp Gunbin wrote: > - Put point at bol on the second line (where "curl" is) Here, I meant "and select region up to eob" From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 29 08:59:33 2022 Received: (at 54613) by debbugs.gnu.org; 29 Mar 2022 12:59:33 +0000 Received: from localhost ([127.0.0.1]:60149 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZBRc-0004uq-Ve for submit@debbugs.gnu.org; Tue, 29 Mar 2022 08:59:33 -0400 Received: from quimby.gnus.org ([95.216.78.240]:60198) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZBRW-0004uY-Ua for 54613@debbugs.gnu.org; Tue, 29 Mar 2022 08:59:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=v1U9AzwyUk/JKi33clXXDdNTno77b6BQgl2RSmTSzy4=; b=dZjiMgTGOwXUI0TVcNmz1lhMu9 azNgSMk0H7RWG+TD8q73qFWEfJY0cHHeQYXQPpkzjFcZD2rPoeWYESgg9Rl41hGe0kFJ0UNF+C/5N 5jGDGFHU+uzsieMqppOLUFPsig7X4oxwNzJZ6fcTP3B04Zppwit2Je4RThEgYn9HA+z0=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nZBRN-00031Y-AE; Tue, 29 Mar 2022 14:59:19 +0200 From: Lars Ingebrigtsen To: 54613@debbugs.gnu.org Subject: Re: bug#54613: 29.0.50; uncomment-region in sh-mode deletes extra char References: Date: Tue, 29 Mar 2022 14:59:16 +0200 In-Reply-To: (Filipp Gunbin's message of "Mon, 28 Mar 2022 20:19:38 +0300") Message-ID: <871qykc3tn.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Filipp Gunbin writes: > - Notice that `-' after "cat" disappeared I can reproduce this issue, too. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54613 Cc: Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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 <\\| \\)" 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've added Stefan to the CCs; perhaps he'll have some comments. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 29 11:17:48 2022 Received: (at 54613) by debbugs.gnu.org; 29 Mar 2022 15:17:48 +0000 Received: from localhost ([127.0.0.1]:33397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZDbP-0006nb-Ry for submit@debbugs.gnu.org; Tue, 29 Mar 2022 11:17:48 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:55721) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZDbN-0006nN-5m for 54613@debbugs.gnu.org; Tue, 29 Mar 2022 11:17:45 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id E24705C0112; Tue, 29 Mar 2022 11:17:39 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 29 Mar 2022 11:17:39 -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=rui/RHm4LsMmMV6mmWaD9BELKK2VJ/28OdEHwN pu4t4=; b=WZIgN0GWJz+dOZtZvOfLtTe05Jr5ad6UHmwc6enf/Yiojh5Go3zigB X49KR42Q8jfl/b5UA8b4uJxXrJdGEWNCLA4etpSOKzbMT8rqyRkLFaFPyNZUmHHu kgPfll+XMYhoKNr7U8RiQEIXS0/7B75E2G9YxM0mvF+XPyJu+9p7z8gaY7Sl4NcV /cEcgfQu0FtYCQvhSWyUZHxkRh73bW9u8zEpv7YOhV2s9azL8pSTa//j0sFVSyew +RHjmqziM9wI2X8+1g5e6YMi2BLs56auZUk8pi3gOqsGiStIR7XKsMgMf5pw/ptd wWvAliLH8V+sMA1LixidERAe5YEQXn+w== 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=rui/RHm4LsMmMV6mm WaD9BELKK2VJ/28OdEHwNpu4t4=; b=aEedJ9noqjv9BIANT5X1mnH6iq/pdT9LD vfnIQwKD2vARkL4XaeeoasnA2wP2NawTzu/TVeZp7LTy8t2ntl+w7XSx1CkREN2/ WamYnJjfPvS5d4RA0FlE3LaP4gqdDSNnhPDUpCBgTSRYG7G9YnP/pke/UTSlvHSg flN/5b33nKCKkIPcm6sHgONFLpVWWtq4P4YRHG4OtlNY8ksZgXVWwm+JhmO7/hBM wxnxtPlOjfb+GmXb8HrbRuqEMPP8Dy2egxBIOpVCiGxwZccu3Jsg3wIfnxUigaY/ m9d+iGuoPSAnqLRf3hZcEOKb6Z8HFl+WX1qbWl5Py0Qshx01QGwPw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudeitddgiedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhgffffkgggtsehttdertddtredtnecuhfhrohhmpefhihhlihhp phcuifhunhgsihhnuceofhhguhhnsghinhesfhgrshhtmhgrihhlrdhfmheqnecuggftrf grthhtvghrnhephfevgfetueehkeffkeeuleejieevueelvdeklefgkefhieegtdevfeej vdejleefnecuffhomhgrihhnpegvgigrmhhplhgvrdhorhhgnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepfhhguhhnsghinhesfhgrshhtmhgr ihhlrdhfmh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 29 Mar 2022 11:17:38 -0400 (EDT) From: Filipp Gunbin To: Lars Ingebrigtsen Subject: Re: bug#54613: 29.0.50; uncomment-region in sh-mode deletes extra char In-Reply-To: <871qykc3tn.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 29 Mar 2022 14:59:16 +0200") References: <871qykc3tn.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) Date: Tue, 29 Mar 2022 18:17:35 +0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54613 Cc: 54613@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 29 15:07:42 2022 Received: (at 54613) by debbugs.gnu.org; 29 Mar 2022 19:07:42 +0000 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 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 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) 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: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 29 Mar 2022 15:07:32 -0400 (EDT) From: Filipp Gunbin To: Lars Ingebrigtsen Subject: Re: bug#54613: 29.0.50; uncomment-region in sh-mode deletes extra char In-Reply-To: (Filipp Gunbin's message of "Tue, 29 Mar 2022 18:17:35 +0300") References: <871qykc3tn.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) Date: Tue, 29 Mar 2022 22:07:29 +0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54613 Cc: 54613@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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