Received: (at 68593) by debbugs.gnu.org; 20 Jan 2024 06:48:05 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 20 01:48:05 2024 Received: from localhost ([127.0.0.1]:60738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rR59B-0001EO-5h for submit <at> debbugs.gnu.org; Sat, 20 Jan 2024 01:48:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1rR599-0001DL-3p for 68593 <at> debbugs.gnu.org; Sat, 20 Jan 2024 01:48:04 -0500 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 <eliz@HIDDEN>) id 1rR591-0000ZB-2C; Sat, 20 Jan 2024 01:47:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=s8dScSry/h0xakg23vSwAgvzfOXiHg5429C/Y3LsmLA=; b=UW9vxmTl0dmr 39sK0F6yXNA9z/+HnD7fUyMXVcT9AFos1oZE9R5m8p/fvQ7xW+a6eZ89Nk+cuU77dfAI9XzKt3gSq O6nI2x/zJuw6Z4pABoRQFHL5Z/Z5e+aS8Z+Khhx5qsSmX4dwL0d+EgtJQGTHzseAWmHI0GcPsJgqA h2bgt0IjvVGsQ3GEtdP+7IgD05RaPOeAkRyarDd3mEpb/BG/XOD2iE5GIZEYtuLITbmLkqQ7ibj1X mgFDwN9IEm52A5fLnSBmY574wXdvCRfRWwJVqev+JjpGl/ccY6vY8nWM8HGew2WmYc1pgjEnPknnj O6TunJPCabn0xOtmuGCySA==; Date: Sat, 20 Jan 2024 08:47:34 +0200 Message-Id: <83edecv6ux.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Frank Ruben <frankruben27@HIDDEN> In-Reply-To: <CAOi78yCQcZsRK54eJ5BC1rhrMbb7sGLJrMs40UeHiOBoTbtZ7w@HIDDEN> (message from Frank Ruben on Fri, 19 Jan 2024 22:16:04 +0100) Subject: Re: bug#68593: 29.1; comment-dwim: Args out of range: "", 0, 1 References: <CAOi78yCQcZsRK54eJ5BC1rhrMbb7sGLJrMs40UeHiOBoTbtZ7w@HIDDEN> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 68593 Cc: 68593 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Frank Ruben <frankruben27@HIDDEN> > Date: Fri, 19 Jan 2024 22:16:04 +0100 > > When in c-ts-mode.el and when having '(setq comment-end " ")' and when I then > then run e.g. 'comment-dwim' or simpler '(comment-normalize-vars)', I'm getting > 'comment-dwim: Args out of range: "", 0, 1'. > > The error comes from the two 'substring' calls in this s-sexp - where the code > already contains my "fix" - both calls to 'substring' have been guarded by > '(if (string-equal ce "") "" ...)'. Can you tell why do you set comment-end to such a value in c-ts-mode? What is the purpose of such a strange setting?
bug-gnu-emacs@HIDDEN
:bug#68593
; Package emacs
.
Full text available.Received: (at submit) by debbugs.gnu.org; 19 Jan 2024 21:16:37 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 19 16:16:37 2024 Received: from localhost ([127.0.0.1]:60200 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rQwE8-0001Os-4g for submit <at> debbugs.gnu.org; Fri, 19 Jan 2024 16:16:37 -0500 Received: from lists.gnu.org ([2001:470:142::17]:55912) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <frankruben27@HIDDEN>) id 1rQwE6-0001II-4r for submit <at> debbugs.gnu.org; Fri, 19 Jan 2024 16:16:35 -0500 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 <frankruben27@HIDDEN>) id 1rQwDx-0001OI-NW for bug-gnu-emacs@HIDDEN; Fri, 19 Jan 2024 16:16:25 -0500 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <frankruben27@HIDDEN>) id 1rQwDr-0001Kw-E6 for bug-gnu-emacs@HIDDEN; Fri, 19 Jan 2024 16:16:21 -0500 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2cddb0ee311so14205111fa.0 for <bug-gnu-emacs@HIDDEN>; Fri, 19 Jan 2024 13:16:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705698975; x=1706303775; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=jYOs9uDC38vYxmvqwPnMIHDAGNZYNe3TZuCAWtm8e8w=; b=Iwzb6nf+qKGq1ZdAWxsaXtgKHlk6hrvezY6vVsmRtVtMDaCHM2UZxaYOSMeu3rNoET XYBhPHVySb0MqaXkEmMMYvgGGzxWyBBu9BKkfoS4N4zs4DJ7HVu9L89i6y0l17mcCzoR pDnW4f8J9zkG+/AthnpWxhA2mphbc4Z1hTlz79mvLYnNx65JeqwkDmh8Nju/G0Su9Y3V e6q5SfBjfPxNxkYZb82Vbgm7GL2c5sbpZoFF/JP+w4DrtQOXsaWC/iG0fUoSEPPzEVxJ l74st0Jv35D4vp2xevdOkZ4ktdap7TUvH3//Kao9hxFSEWM8D7lONNV+8bNt0bUrIBwN lXwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705698975; x=1706303775; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=jYOs9uDC38vYxmvqwPnMIHDAGNZYNe3TZuCAWtm8e8w=; b=XsGBf180s1wER2kJ6SAbRLv0XybHZxqeUug18nN7cyG6V2PmeOv6zgw7ArzMohZWNi sqWH81Fy+unZ9tz/5NmRSeho8MxLqKrsL5UBZaybAd7xOHJ4Qxem96MrQ9+gr0XA00OO WFJpgvJboGD9+tnhte9SOQxN0OcWY7gZ9Trsm9YAFYsrMR8339wvK9YRb3YAypAv2lM1 UIaTynjxbqIZ+jGuLwrN2sn0r4s9iaA9i1dXpFwdKFMTM6JR05Q8YFF3Je7cY24mjjAe a3z+KA3V0rYE7a6bQYV6jQe/C1HndnE6T9yn3ky+L4rEzb/ZKNEQN7wG755PzHfWKca4 MU+Q== X-Gm-Message-State: AOJu0YwqVJWMmp/fTv2zS+rJMI8JIIRZQEzW1GadiMAfWI7fZRJj7nsf LkBJXN18jbvIkWP5Dso6VXA862BGhVUnN4tn0oxz18Gl7WeGTZb5YVTWUn+44ZW4I1jzqVENKDp UsqcgvMLZFQ1ZBhVrieBrNvfchsZwxc4JEmI= X-Google-Smtp-Source: AGHT+IFrWDz+EAXBLRuONK4wE/guB/nzaoZTV1KxhgpYCuimSdwiPfH6hfRhfJn08UAf57QgFt/qHKXoorxW4hzdbGo= X-Received: by 2002:a05:651c:10bb:b0:2cc:7913:f349 with SMTP id k27-20020a05651c10bb00b002cc7913f349mr77087ljn.128.1705698974446; Fri, 19 Jan 2024 13:16:14 -0800 (PST) MIME-Version: 1.0 From: Frank Ruben <frankruben27@HIDDEN> Date: Fri, 19 Jan 2024 22:16:04 +0100 Message-ID: <CAOi78yCQcZsRK54eJ5BC1rhrMbb7sGLJrMs40UeHiOBoTbtZ7w@HIDDEN> Subject: 29.1; comment-dwim: Args out of range: "", 0, 1 To: bug-gnu-emacs@HIDDEN Content-Type: multipart/alternative; boundary="00000000000077377c060f52fd87" Received-SPF: pass client-ip=2a00:1450:4864:20::229; envelope-from=frankruben27@HIDDEN; helo=mail-lj1-x229.google.com 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.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 the administrator of that system for details. Content preview: In GNU Emacs 29.1 (build 2, x86_64-w64-mingw32) of 2023-08-02 built on AVALON Windowing system distributor 'Microsoft Corp.', version 10.0.19045 System Description: Microsoft Windows 10 Pro (v10.0.200 [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (frankruben27[at]gmail.com) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (frankruben27[at]gmail.com) 0.0 HTML_MESSAGE BODY: HTML included in message -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.2 (/) --00000000000077377c060f52fd87 Content-Type: text/plain; charset="UTF-8" In GNU Emacs 29.1 (build 2, x86_64-w64-mingw32) of 2023-08-02 built on AVALON Windowing system distributor 'Microsoft Corp.', version 10.0.19045 System Description: Microsoft Windows 10 Pro (v10.0.2009.19045.3930) Configured using: 'configure --with-modules --without-dbus --with-native-compilation=aot --without-compress-install --with-tree-sitter CFLAGS=-O2' Configured features: ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XPM ZLIB (NATIVE_COMP present but libgccjit not available) Important settings: value of $LANG: ENU locale-coding-system: utf-8 Major mode: C Minor modes in effect: save-place-mode: t recentf-mode: t which-function-mode: t desktop-save-mode: t key-chord-mode: t override-global-mode: t global-auto-revert-mode: t global-so-long-mode: t flyspell-mode: t icomplete-mode: t fido-mode: t whitespace-mode: t electric-pair-mode: t savehist-mode: t display-time-mode: t shell-dirtrack-mode: t auto-insert-mode: t delete-selection-mode: t cua-mode: t global-eldoc-mode: t show-paren-mode: t mouse-wheel-mode: t prettify-symbols-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t size-indication-mode: t column-number-mode: 1 line-number-mode: 1 transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t auto-save-visited-mode: t abbrev-mode: t Load-path shadows: c:/usr/home/.emacs.d2/src/prolog hides c:/usr/local/emacs/share/emacs/29.1/lisp/progmodes/prolog Features: (shadow sort mail-extr emacsbug message yank-media puny rfc822 mml mml-sec ...) Memory information: ((conses 16 1328082 122098) (symbols 48 35374 0) (strings 32 187080 7259) (string-bytes 1 5454999) (vectors 16 81243) (vector-slots 8 1843247 151854) (floats 8 515 546) (intervals 56 162466 825) (buffers 984 88)) When in c-ts-mode.el and when having '(setq comment-end " ")' and when I then then run e.g. 'comment-dwim' or simpler '(comment-normalize-vars)', I'm getting 'comment-dwim: Args out of range: "", 0, 1'. The error comes from the two 'substring' calls in this s-sexp - where the code already contains my "fix" - both calls to 'substring' have been guarded by '(if (string-equal ce "") "" ...)'. There are surely smarter ways to fix that - if one knows what is supposed to happen here :). But maybe that fix gives you a hint to the appropriate solution. (let ((ce (if (string= "" comment-end) "\n" (comment-string-strip comment-end t t)))) (setq-local comment-end-skip ;; We use [ \t] rather than \s- because we don't want to ;; remove ^L in C mode when uncommenting. (concat "[ \t]*\\(\\s>" (if comment-quote-nested "" "+") "\\|" (regexp-quote (if (string-equal ce "") "" (substring ce 0 1))) (if (and comment-quote-nested (<= (length ce) 1)) "" "+") (regexp-quote (if (string-equal ce "") "" (substring ce 1))) "\\)"))) --00000000000077377c060f52fd87 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><br><br><br><br>In GNU Emacs 29.1 (build 2, x86_64-w64-min= gw32) of 2023-08-02 built on AVALON<br>Windowing system distributor 'Mi= crosoft Corp.', version 10.0.19045<br>System Description: Microsoft Win= dows 10 Pro (v10.0.2009.19045.3930)<br><br>Configured using:<br>=C2=A0'= configure --with-modules --without-dbus --with-native-compilation=3Daot<br>= =C2=A0--without-compress-install --with-tree-sitter CFLAGS=3D-O2'<br><b= r>Configured features:<br>ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXM= L2 MODULES NATIVE_COMP NOTIFY<br>W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 T= HREADS TIFF TOOLKIT_SCROLL_BARS<br>TREE_SITTER WEBP XPM ZLIB<br><br>(NATIVE= _COMP present but libgccjit not available)<br><br>Important settings:<br>= =C2=A0 value of $LANG: ENU<br>=C2=A0 locale-coding-system: utf-8<br><br>Maj= or mode: C<br><br>Minor modes in effect:<br>=C2=A0 save-place-mode: t<br>= =C2=A0 recentf-mode: t<br>=C2=A0 which-function-mode: t<br>=C2=A0 desktop-s= ave-mode: t<br>=C2=A0 key-chord-mode: t<br>=C2=A0 override-global-mode: t<b= r>=C2=A0 global-auto-revert-mode: t<br>=C2=A0 global-so-long-mode: t<br>=C2= =A0 flyspell-mode: t<br>=C2=A0 icomplete-mode: t<br>=C2=A0 fido-mode: t<br>= =C2=A0 whitespace-mode: t<br>=C2=A0 electric-pair-mode: t<br>=C2=A0 savehis= t-mode: t<br>=C2=A0 display-time-mode: t<br>=C2=A0 shell-dirtrack-mode: t<b= r>=C2=A0 auto-insert-mode: t<br>=C2=A0 delete-selection-mode: t<br>=C2=A0 c= ua-mode: t<br>=C2=A0 global-eldoc-mode: t<br>=C2=A0 show-paren-mode: t<br>= =C2=A0 mouse-wheel-mode: t<br>=C2=A0 prettify-symbols-mode: t<br>=C2=A0 fil= e-name-shadow-mode: t<br>=C2=A0 global-font-lock-mode: t<br>=C2=A0 font-loc= k-mode: t<br>=C2=A0 size-indication-mode: t<br>=C2=A0 column-number-mode: 1= <br>=C2=A0 line-number-mode: 1<br>=C2=A0 transient-mark-mode: t<br>=C2=A0 a= uto-composition-mode: t<br>=C2=A0 auto-encryption-mode: t<br>=C2=A0 auto-co= mpression-mode: t<br>=C2=A0 auto-save-visited-mode: t<br>=C2=A0 abbrev-mode= : t<br><br>Load-path shadows:<br>c:/usr/home/.emacs.d2/src/prolog hides c:/= usr/local/emacs/share/emacs/29.1/lisp/progmodes/prolog<br><br>Features:<br>= (shadow sort mail-extr emacsbug message yank-media puny rfc822 mml mml-sec = ...)<br><br>Memory information:<br>((conses 16 1328082 122098)<br>=C2=A0(sy= mbols 48 35374 0)<br>=C2=A0(strings 32 187080 7259)<br>=C2=A0(string-bytes = 1 5454999)<br>=C2=A0(vectors 16 81243)<br>=C2=A0(vector-slots 8 1843247 151= 854)<br>=C2=A0(floats 8 515 546)<br>=C2=A0(intervals 56 162466 825)<br>=C2= =A0(buffers 984 88))<br><br>When in c-ts-mode.el and when having '(setq= comment-end " ")' and when I then<br>then run e.g. 'comm= ent-dwim' or simpler '(comment-normalize-vars)', I'm gettin= g<br>'comment-dwim: Args out of range: "", 0, 1'.<br><br>= The error comes from the two 'substring' calls in this s-sexp - whe= re the code<br>already contains my "fix" - both calls to 'sub= string' have been guarded by<br>'(if (string-equal ce "")= "" ...)'.<br><br>There are surely smarter ways to fix that -= if one knows what is supposed to<br>happen here :). But maybe that fix giv= es you a hint to the appropriate<br>solution.<br><br>(let ((ce (if (string= =3D "" comment-end) "\n"<br> =C2=A0(comment-string-st= rip comment-end t t))))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq-local comment-= end-skip<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 ;; We use [ \t] rather than \s- because we don't want to<br>=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; remov= e ^L in C mode when uncommenting.<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (concat "[ \t]*\\(\\s>" (if co= mment-quote-nested "" "+")<br>=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &= quot;\\|" (regexp-quote (if (string-equal ce "") ""= ; (substring ce 0 1)))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (and comment-quote-nes= ted (<=3D (length ce) 1)) "" "+")<br>=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (regexp-quote (if (string-equal ce "") "" (s= ubstring ce 1)))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "\\)")))<br></div> --00000000000077377c060f52fd87--
Frank Ruben <frankruben27@HIDDEN>
:bug-gnu-emacs@HIDDEN
.
Full text available.bug-gnu-emacs@HIDDEN
:bug#68593
; Package emacs
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.