From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 16 04:51:35 2023 Received: (at submit) by debbugs.gnu.org; 16 Jun 2023 08:51:35 +0000 Received: from localhost ([127.0.0.1]:48590 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qA5B8-0007v4-Uu for submit@debbugs.gnu.org; Fri, 16 Jun 2023 04:51:35 -0400 Received: from lists.gnu.org ([209.51.188.17]:44988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qA5B7-0007uw-BH for submit@debbugs.gnu.org; Fri, 16 Jun 2023 04:51:33 -0400 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 1qA5B6-0006Bn-LB for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2023 04:51:32 -0400 Received: from mout.kundenserver.de ([212.227.126.135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qA5B3-0005lv-2q for bug-gnu-emacs@gnu.org; Fri, 16 Jun 2023 04:51:31 -0400 Received: from [192.168.178.61] ([89.247.171.230]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MOzCW-1qSse83MCq-00PQv0 for ; Fri, 16 Jun 2023 10:51:24 +0200 Message-ID: <2570aabb-1d9d-79fa-0124-9261bf179083@easy-emacs.de> Date: Fri, 16 Jun 2023 10:51:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Content-Language: en-US To: bug-gnu-emacs@gnu.org From: =?UTF-8?Q?Andreas_R=c3=b6hler?= Subject: Subject: 30.0.50; uncomment-region-default-1 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:4ByJ0YHnO+qRkD8rPKsVL/2OeS7gB1KPI6ubY8E31zPdXv9avoE e/d+E7Ycud7x3qsRVohNQVB+pjww9PpCPw2TOijchXKnJpuRLMH/Kb6YbuymuSjf9m1sJrm J/yknji5O6URB8KU6u3DX8b9pciPwtbez+Zdb45/Iu48vkuyjYTIkgmW9DfHOLF43ckABbW 21qR7jEMjFsbSlVOkbzjg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:0drHkNZoWG8=;EeqYNjG/zqyGoVOw+2uk/aM15QW ZE/EtsGfdM/ELChOvAIHr2FxPOwQDJNX6vk32V0bGQe6QeAgZgX4nl5/RzFcJ4jMVlXnYGsz5 +fFNKtxJH9a1DaQCBq1pzUN2zuj+i52b3btySmalLS72QK+CMrUPb1me7EFnMkxuMrByrMZ/M 5a931H0PUUuw8DU5fKWO0ts+cAxwMg+GlfK37sxkoobi59vuktQ3SQt7gwcZf/ZJEPUOBFtX4 I99O3OzIM0cWoCAPKp9yZYyEYnChPQbHSNpgOiut/D95V/PXlEDU1rbfS/DZ80uCfp4m1B8lo +/IifR7NAcBx1SVyBqzt18TFGxSimi7iiLLZhdz6dXeGYaYm9rvqDkmPYlsTh8wMb2Gm0d63e 4Vx+7NyYNSHSH4JVfjRd2eJd2uOGxCGApjnkRXtoPdT9UJwl19UoHLWN66bpZKCbCnxkrYeuZ 0E7NwoeYpz2U7jTsptp9xUEmE4oVFbMspCYMwvqv0E9Ha+IXO9uaGuQxLm47Cam96ownR1EF4 H7RpY0p35WmoLebOMi/lBb4cc/G+KHaLC3EzhAgvme7gvgTZDaW6p8zjVMUUaWdz8vFRCkpwa vWn+M7NtKe4buXWgsPIJ8wML0rcdVWdR1er4fjuExnn86PcvbRB8eZhqKuiejoNPbAvuU8Qc1 vZKvxlSIBJ49VfGbVzOsUFE36A/xG75hKRtQDXk18A== Received-SPF: pass client-ip=212.227.126.135; envelope-from=andreas.roehler@easy-emacs.de; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-Spam-Score: -1.3 (-) 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.3 (--) Hi, C-u comment-dwim RET with an active region of the following Python code: --- # for i in text: #     print("(i): {}".format(str(i))) --- results in error saying uncomment-region-default-1: Beginning of buffer AFAIU the culprit is in newcomment.el, line 933: (numarg (prefix-numeric-value arg)) and later in line 978 it tries (delete-char (- numarg)) which at the beginning of buffer causes that error. comment-dwin says: if a prefix ARG is specified, call ‘comment-kill’ which is my intended use-case. Thanks, Andreas Röhler In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version  3.24.33, cairo version 1.16.0) of 2023-06-16 built on kanu Repository revision: f2aae8b879baa4986b69af7ee54fe4eb987b99d6 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101004 System Description: Ubuntu 22.04.2 LTS Configured using:  'configure --with-tree-sitter --with-modules --with-mailutils' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings:   value of $LANG: de_DE.UTF-8   value of $XMODIFIERS: @im=ibus   locale-coding-system: utf-8-unix Major mode: Python Minor modes in effect:   tooltip-mode: t   global-eldoc-mode: t   eldoc-mode: t   show-paren-mode: t   electric-indent-mode: t   mouse-wheel-mode: t   tool-bar-mode: t   menu-bar-mode: t   file-name-shadow-mode: t   global-font-lock-mode: t   font-lock-mode: t   blink-cursor-mode: t   line-number-mode: t   transient-mark-mode: t   auto-composition-mode: t   auto-encryption-mode: t   auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils vc-git diff-mode easy-mmode vc-dispatcher python json map rx project byte-opt gv bytecomp byte-compile pcase treesit cl-seq comint ansi-osc ring ansi-color dired-aux dired dired-loaddefs time-date subr-x wheatgrass-theme cus-theme cus-edit pp cus-start cus-load icons wid-edit cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 135452 11240)  (symbols 48 20124 0)  (strings 32 48692 1931)  (string-bytes 1 1037720)  (vectors 16 17224)  (vector-slots 8 230171 13481)  (floats 8 39 46)  (intervals 56 1109 13)  (buffers 984 15)) From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 17 04:38:34 2023 Received: (at 64104) by debbugs.gnu.org; 17 Jun 2023 08:38:34 +0000 Received: from localhost ([127.0.0.1]:50843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qARS6-0000kU-4y for submit@debbugs.gnu.org; Sat, 17 Jun 2023 04:38:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48498) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qARS3-0000kD-B5 for 64104@debbugs.gnu.org; Sat, 17 Jun 2023 04:38:32 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qARRx-0001jk-OW; Sat, 17 Jun 2023 04:38:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=0nVKWdSaP4WxjpPkiKwVq9bC2p/cxMGQiCA/dFb1MK4=; b=jaIvwdLnmSRuXRGAvIzQ MpF7Ne5G+XY5oIRmY9N6+emHr5mDe63A//0Tr+jNCfDa890nq1Zm+yzAHgvi31sa9Ctkj1Y3WKdif 3YvD5f9lzm18rz3h8YlZRKrHZYmVFSa1Tt42sC4bjaUI0Zcrx12RnhvyTR5cuxBBB1e01Tu2VlJZ8 OAJvtiJj+KjID/2efs7pbEoPkVCghv4jQOFe0hVIQzw+yD4laDvoUhjdmLfWMR82kkReGEJAVBy/a Q03c4s2wUOI4gcqHgT6AFKIc25yTT6x7hE0lfWsvE7XpQ5BcquH/uTGxuhIIXzRtk0BbzwwVgSLYl SecziRhgPBX39Q==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qARRx-0004eC-8a; Sat, 17 Jun 2023 04:38:25 -0400 Date: Sat, 17 Jun 2023 11:38:24 +0300 Message-Id: <83pm5uqy9r.fsf@gnu.org> From: Eli Zaretskii To: Andreas =?utf-8?Q?R=C3=B6hler?= , Stefan Monnier In-Reply-To: <2570aabb-1d9d-79fa-0124-9261bf179083@easy-emacs.de> (message from Andreas =?utf-8?Q?R=C3=B6hler?= on Fri, 16 Jun 2023 10:51:24 +0200) Subject: Re: bug#64104: Subject: 30.0.50; uncomment-region-default-1 References: <2570aabb-1d9d-79fa-0124-9261bf179083@easy-emacs.de> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64104 Cc: 64104@debbugs.gnu.org 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 (---) > Date: Fri, 16 Jun 2023 10:51:24 +0200 > From: Andreas Röhler > > C-u comment-dwim RET with an active region of the following Python code: > > --- > # for i in text: > #     print("(i): {}".format(str(i))) > --- > > results in error saying > > uncomment-region-default-1: Beginning of buffer AFAICT, that's because invoking comment-dwim with C-u in this case makes no sense: the comment delimiters have just 1 character in this case. Try "C-u 1 M-x comment-dwim" instead. > comment-dwin says: > > if a prefix ARG is specified, call ‘comment-kill’ > > which is my intended use-case. If this is what you wanted, then you should invoke "C-u comment-dwin" without having an active region. The doc string says that if the region is active, it will call comment-region or uncomment-region, and will call comment-kill only "otherwise" (i.e. if there's no active region). I suggest to read the node "Comment Commands" in the Emacs manual, it describes this in more detail. I've now made the doc string slightly more detailed, especially wrt how the prefix argument is used in the various use cases, but other than that, I don't think there's a bug here. Stefan, any comments? From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 17 14:39:18 2023 Received: (at 64104) by debbugs.gnu.org; 17 Jun 2023 18:39:18 +0000 Received: from localhost ([127.0.0.1]:52619 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAapS-00050T-7g for submit@debbugs.gnu.org; Sat, 17 Jun 2023 14:39:18 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:4469) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAapQ-00050G-3L for 64104@debbugs.gnu.org; Sat, 17 Jun 2023 14:39:17 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C13F3441320; Sat, 17 Jun 2023 14:39:10 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id A3A3E4412DD; Sat, 17 Jun 2023 14:39:09 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1687027149; bh=zn1m89BwQANuXkRlY9GOIEp10f1zK02PxyumPvx/xD0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=EIJ2GUr1wXropqoMxoHWf0KvWzBcSyb9NbMDMu4rIJEwYmBjF0WZkAc7lWFdS1aJ1 3BUWB5URw/FNjByH1HeqWQiqzGmb8W1fI78/2t9Xk9+S5aE1j2MBqSreaZM9QzSMeh qJVWH+dAIiVE1KGlqAxqc+W2lzf9wND9STZWVclfwcCiqMPTfTrYIoJ7Ax9RGW1nL5 0b+H03oyk1viwUMPa1d2KJ8N9vtQhXxRjcbvwIvSWnndHT/igaOLXiaKudZHn/1yfa 8UJcGGMya/6nQcpFRBlTVHzRQ5bzTM4IHm1FJOq+Ga6XDNe1EBq6XeK0iqOPnTVqq6 hrA4nmt4Cr1iw== Received: from pastel (unknown [45.72.207.87]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7C1B012062C; Sat, 17 Jun 2023 14:39:09 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#64104: Subject: 30.0.50; uncomment-region-default-1 In-Reply-To: <83pm5uqy9r.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 17 Jun 2023 11:38:24 +0300") Message-ID: References: <2570aabb-1d9d-79fa-0124-9261bf179083@easy-emacs.de> <83pm5uqy9r.fsf@gnu.org> Date: Sat, 17 Jun 2023 14:39:08 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.206 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain KAM_NUMSUBJECT 0.5 Subject ends in numbers excluding current years T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64104 Cc: 64104@debbugs.gnu.org, Andreas =?windows-1252?Q?R=F6hler?= 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 (---) >> C-u comment-dwim RET with an active region of the following Python code: >>=20 >> --- >> # for i in text: >> #=A0=A0=A0=A0 print("(i): {}".format(str(i))) >> --- >>=20 >> results in error saying >>=20 >> uncomment-region-default-1: Beginning of buffer > Stefan, any comments? - The error we give is not very user-friendly, so it might be good to catch it and re-raise it as something more meaning ful the specific operation performed. - I have the vague impression that in some earlier version of that code we would not signal an error but just remove as many comment markers as possible (but no more than requested). That could be a more friendly behavior. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 18 01:53:14 2023 Received: (at 64104) by debbugs.gnu.org; 18 Jun 2023 05:53:14 +0000 Received: from localhost ([127.0.0.1]:52954 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAlLe-0000XY-Hg for submit@debbugs.gnu.org; Sun, 18 Jun 2023 01:53:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAlLZ-0000XD-IZ for 64104@debbugs.gnu.org; Sun, 18 Jun 2023 01:53:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qAlLT-0005Bq-Sh; Sun, 18 Jun 2023 01:53:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=BaXed0Zzw7dkx/436VrNislRF1ijV95IJGGleRs8MHQ=; b=Ek0tp+YVfL79m9qUaubJ 743BqtbvPDNclRZLmho4JzRAm6Srn2XRuvZLsWZq6vbvXbmOG9+97VOiWiqj+j8S2bQg21mHZ96Xj CeQVYpwtQkoYX8hoR0/PXJ9o/Qr8mFSvSabNF5aD9eT49EJi88VVAkA3q1aOu8fXILZ7or8wjWXTN THOvpF+KN+h41sQ4yMOOnhh/zCc8eY9m9x9L0eK/W4kwFUOHHWPvfPDQw7XixmXCZiOmovCIWF1WK tBzthH/9JJEyMWj2g5oBoWo9NJumkOlYz7WqjbKwdlLpE4InMQRAVrbYg47AcdySZoXTiJk9D87E/ tlpX4RfpchWSoA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qAlLS-0001nO-SH; Sun, 18 Jun 2023 01:53:03 -0400 Date: Sun, 18 Jun 2023 08:53:03 +0300 Message-Id: <83ilblpb9c.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Sat, 17 Jun 2023 14:39:08 -0400) Subject: Re: bug#64104: Subject: 30.0.50; uncomment-region-default-1 References: <2570aabb-1d9d-79fa-0124-9261bf179083@easy-emacs.de> <83pm5uqy9r.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64104 Cc: 64104@debbugs.gnu.org, andreas.roehler@easy-emacs.de 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 (---) > From: Stefan Monnier > Cc: Andreas Röhler , > 64104@debbugs.gnu.org > Date: Sat, 17 Jun 2023 14:39:08 -0400 > > >> C-u comment-dwim RET with an active region of the following Python code: > >> > >> --- > >> # for i in text: > >> #     print("(i): {}".format(str(i))) > >> --- > >> > >> results in error saying > >> > >> uncomment-region-default-1: Beginning of buffer > > > Stefan, any comments? > > - The error we give is not very user-friendly, so it might be good to > catch it and re-raise it as something more meaning ful the specific > operation performed. > > - I have the vague impression that in some earlier version of that code we > would not signal an error but just remove as many comment markers as > possible (but no more than requested). > That could be a more friendly behavior. I'll leave the bug open, then. Patches to improve this command are welcome. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 18 09:00:31 2023 Received: (at 64104) by debbugs.gnu.org; 18 Jun 2023 13:00:31 +0000 Received: from localhost ([127.0.0.1]:53498 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAs19-0000Ej-Bv for submit@debbugs.gnu.org; Sun, 18 Jun 2023 09:00:31 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:49279) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAs17-0000EV-5J for 64104@debbugs.gnu.org; Sun, 18 Jun 2023 09:00:30 -0400 Received: from [192.168.178.61] ([89.247.171.231]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mn2iP-1piuuZ156d-00k9Og; Sun, 18 Jun 2023 15:00:20 +0200 Message-ID: <137fcc22-3014-6899-a2e1-189f58f55cf2@easy-emacs.de> Date: Sun, 18 Jun 2023 15:00:19 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: bug#64104: Subject: 30.0.50; uncomment-region-default-1 To: Eli Zaretskii , Stefan Monnier References: <2570aabb-1d9d-79fa-0124-9261bf179083@easy-emacs.de> <83pm5uqy9r.fsf@gnu.org> <83ilblpb9c.fsf@gnu.org> Content-Language: en-US From: =?UTF-8?Q?Andreas_R=c3=b6hler?= In-Reply-To: <83ilblpb9c.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:E/e3Z9umzzgEW3K+vlqXGY2yxlRva3vkuH4ug8NoFbEPb7BWCLL APZ8JGPewTkuft6NUSqQgeajYWyj3ewz70hC2cw3xMfYyQ42YC1HZDQKmMC9z2hlpBePSj6 h9ZzLUVOA748u0fJr3vXz7hLGzkSPMK3QOvHoJaX6MzDKiBujo+kgGDi1MO85kStRT5qk40 puCBrrrkg/XaSds66xERA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:Gdwp35ygWQ8=;KEN9IuW63TU9jeTaPMyuH/brMwc SX3vcLsGTVodUlf8X64gHVrEAb80OnPsoZB6WzclOwZ2McjReHtQWUVKcZH63T/u8BnmlBlfq 0ssO/ZU/zWNLQI5uygaRz36hkPq5cw+NiyjwWmNZaTf/S+lxLZFnFG/pvXD1qLgJ74mknnMtE ZpMiLu2O2yzTslr/rgicV8ce29v8CJQmYQNuE0A85h16D1/tVT27wKZG0VDaIMcADTuonLtsA EYGEPqqEULCohLCfV6M5tzPXdZON8kcykOPITTzt/dmbmK6l7Xb52u9HLjiTH5visXFaamkwD Nhsizk8MZrB1V3EDs5mi0jnGbEQhPR1XI37wTX2eoPQ6KMQnYv8O3wgqNV6lV6avnawW9hSab wlWC3md1qGzvKCE3ROiAfc67H8ErzIGmPfFbj5Y+5MSu9Je8p92BlZQuAIDtOIs7g0/KSvupQ l9TB1ds8RcJ94eYkFphdju4ORkoOdV0uQxVRqvaHENkIv5kpTUzJ6nRgf7yFiCvBecacLPcCX d70uFkdg4SQ9emS5Kg1o1DAio01BPhwzlOyjGzD7Xy47z3fJmTatF6RIwtI0XZ5LHAz7ztofM WCyG8BcVkyBFzTReOibz9DKjwjkK7dmLiTD1bWFSoT8CKx1eV1C1w08BQZSH/6lXNcWBt9uYp pBUYX8Xm6rgx+e7GIP0osAs1nHW9oYc8ODK8ODtOuQ== X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: 64104 Cc: 64104@debbugs.gnu.org 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.1 (--) Am 18.06.23 um 07:53 schrieb Eli Zaretskii: >> From: Stefan Monnier >> Cc: Andreas Röhler , >> 64104@debbugs.gnu.org >> Date: Sat, 17 Jun 2023 14:39:08 -0400 >> >>>> C-u comment-dwim RET with an active region of the following Python code: >>>> >>>> --- >>>> # for i in text: >>>> #     print("(i): {}".format(str(i))) >>>> --- >>>> >>>> results in error saying >>>> >>>> uncomment-region-default-1: Beginning of buffer >>> Stefan, any comments? >> - The error we give is not very user-friendly, so it might be good to >> catch it and re-raise it as something more meaning ful the specific >> operation performed. >> >> - I have the vague impression that in some earlier version of that code we >> would not signal an error but just remove as many comment markers as >> possible (but no more than requested). >> That could be a more friendly behavior. > I'll leave the bug open, then. Patches to improve this command are > welcome. Unfortunately don't have a trivial fix. Suggest a simplified caller: (defun comment-dwim (arg)   "Call the comment command you want (Do What I Mean). Comment or uncomment the current line, or, if active, the region. With \\[universal-argument] copy line or region before changing it. You can configure `comment-style' to change the way regions are commented."   (interactive "*P")   (comment-normalize-vars)   (when (eq 4 (prefix-numeric-value))     (copy-region-as-kill (or (region-beginning) (line-beginning-position)) (or (region-end) (line-end-position))))   (comment-or-uncomment-region (or (region-beginning) (line-beginning-position)) (or (region-end)) (line-end-position)))