From unknown Thu Jun 19 12:30:05 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#16695 <16695@debbugs.gnu.org> To: bug#16695 <16695@debbugs.gnu.org> Subject: Status: 24.3; comment-dwim (args out of range) Reply-To: bug#16695 <16695@debbugs.gnu.org> Date: Thu, 19 Jun 2025 19:30:05 +0000 retitle 16695 24.3; comment-dwim (args out of range) reassign 16695 emacs,cc-mode submitter 16695 eg5cue@gmail.com severity 16695 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 08 14:56:59 2014 Received: (at submit) by debbugs.gnu.org; 8 Feb 2014 19:56:59 +0000 Received: from localhost ([127.0.0.1]:58157 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCE1K-0000CE-BZ for submit@debbugs.gnu.org; Sat, 08 Feb 2014 14:56:58 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33124) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WC8xB-00070p-4s for submit@debbugs.gnu.org; Sat, 08 Feb 2014 09:32:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WC8x2-0003gy-L7 for submit@debbugs.gnu.org; Sat, 08 Feb 2014 09:32:20 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:45923) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WC8x2-0003gt-Hi for submit@debbugs.gnu.org; Sat, 08 Feb 2014 09:32:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WC8wu-00086w-4E for bug-gnu-emacs@gnu.org; Sat, 08 Feb 2014 09:32:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WC8wi-0003cw-34 for bug-gnu-emacs@gnu.org; Sat, 08 Feb 2014 09:32:04 -0500 Received: from mail-ea0-x232.google.com ([2a00:1450:4013:c01::232]:53325) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WC8wh-0003co-SL for bug-gnu-emacs@gnu.org; Sat, 08 Feb 2014 09:31:52 -0500 Received: by mail-ea0-f178.google.com with SMTP id a15so2076552eae.23 for ; Sat, 08 Feb 2014 06:31:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=iC7OsU3sAbSX0hf6p7akbFFsKEmIv/tW7tMmL1+rQMw=; b=dO3/04xYXw1+fo9mkGZJnmPsBICGy+HOqQ6Y7qXkN1pPOE6otn/9lBHGHI5FUCiUo9 TWpDpx2pqslhhKz4cHUczF9RIDKSn9A2Qnw++dBQAuAI+ql0a0RjfxlUJadNXFQe5Ch3 7itXamv2KpDUM/j+/eMsQUav0uOmp+hRTKAPWcUyVJs28qIdSCTvDDqQJv/JlmQ+DST5 vYcpDoJItnNinCbbhsgnAbR0BR7gaxb8aM0KHJTtx2ZkJORhiTNj6/yir0jS0U2zHIgC lZ5hsYN0DyOHe2RrKSlfKo8FkzmKCfkvnCRwrqCJZ4BdaqOIILpIv5Ajv3aX4bPCrFOi cv3w== X-Received: by 10.14.176.133 with SMTP id b5mr507631eem.105.1391869910601; Sat, 08 Feb 2014 06:31:50 -0800 (PST) Received: from cux ([2.145.181.136]) by mx.google.com with ESMTPSA id x6sm29717827eew.20.2014.02.08.06.31.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Feb 2014 06:31:49 -0800 (PST) From: eg5cue@gmail.com To: bug-gnu-emacs@gnu.org Subject: 24.3; comment-dwim (args out of range) Date: Sat, 08 Feb 2014 14:32:51 +0000 Message-ID: <84sirtd698.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 08 Feb 2014 14:56:54 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -4.0 (----) this is a longstanding bug since 24.3(i don't tried older versions) till now (the latest git version - github mirror), and is very annoying. it happens when trying to comment out (a line/multiple lines) except the first line from a C family file that: it's first line isn't empty or a comment. isn't modified after it's opened. comment function: comment-dwim (M-;) emacs args: emacs -Q From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 08 15:09:51 2014 Received: (at 16695) by debbugs.gnu.org; 8 Feb 2014 20:09:51 +0000 Received: from localhost ([127.0.0.1]:58197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCEDn-0000b6-71 for submit@debbugs.gnu.org; Sat, 08 Feb 2014 15:09:51 -0500 Received: from mtaout25.012.net.il ([80.179.55.181]:56640) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCEDl-0000ax-0p for 16695@debbugs.gnu.org; Sat, 08 Feb 2014 15:09:49 -0500 Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0N0P00I0014AFO00@mtaout25.012.net.il> for 16695@debbugs.gnu.org; Sat, 08 Feb 2014 22:08:58 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N0P00H1H1AXEG20@mtaout25.012.net.il>; Sat, 08 Feb 2014 22:08:58 +0200 (IST) Date: Sat, 08 Feb 2014 22:09:38 +0200 From: Eli Zaretskii Subject: Re: bug#16695: 24.3; comment-dwim (args out of range) In-reply-to: <84sirtd698.fsf@gmail.com> X-012-Sender: halo1@inter.net.il To: eg5cue@gmail.com Message-id: <834n49wem5.fsf@gnu.org> References: <84sirtd698.fsf@gmail.com> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 16695 Cc: 16695@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii 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.0 (+) > From: eg5cue@gmail.com > Date: Sat, 08 Feb 2014 14:32:51 +0000 > > this is a longstanding bug since 24.3(i don't tried older versions) till now (the latest git version - github mirror), and is very annoying. > it happens when trying to comment out (a line/multiple lines) except the first line from a C family file that: > > it's first line isn't empty or a comment. > isn't modified after it's opened. > > comment function: comment-dwim (M-;) > emacs args: emacs -Q I cannot reproduce this. Could you please provide a detailed, key by key recipe, starting with "emacs -Q", and a sample C file to go with it? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 08 15:12:24 2014 Received: (at 16695) by debbugs.gnu.org; 8 Feb 2014 20:12:24 +0000 Received: from localhost ([127.0.0.1]:58201 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCEGF-0000fl-PC for submit@debbugs.gnu.org; Sat, 08 Feb 2014 15:12:24 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:42650) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCEGD-0000fa-Gi for 16695@debbugs.gnu.org; Sat, 08 Feb 2014 15:12:21 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1WCEGC-0007Ie-TK; Sat, 08 Feb 2014 15:12:20 -0500 From: Glenn Morris To: eg5cue@gmail.com Subject: Re: bug#16695: 24.3; comment-dwim (args out of range) References: <84sirtd698.fsf@gmail.com> X-Spook: Maple Guantanamo fraud John Kerry AIMSX SAPO Plame Dick X-Ran: M0fUk9B>~*R7#f>^)/'Vr*|($[1t<6xFbq9\8B/4[ha~;X*7TURzx"g;$1bcE3= (eg5cue@gmail.com's message of "Sat, 08 Feb 2014 14:32:51 +0000") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.5 (-----) X-Debbugs-Envelope-To: 16695 Cc: 16695@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.5 (-----) eg5cue@gmail.com wrote: > this is a longstanding bug since 24.3(i don't tried older versions) > till now (the latest git version - github mirror), and is very > annoying. it happens when trying to comment out (a line/multiple > lines) except the first line from a C family file that: > > it's first line isn't empty or a comment. > isn't modified after it's opened. > > comment function: comment-dwim (M-;) > emacs args: emacs -Q Thanks. For future reference, please do M-x toggle-debug-on-error and include the basktrace in the report: Debugger entered--Lisp error: (args-out-of-range 1 2) remove-text-properties(# 2 (category nil)) c-invalidate-state-cache(17) c-before-change(17 17) comment-region-internal(17 45 "/* " " */" nil nil nil nil t) comment-region-default(16 46 nil) comment-region(16 46 nil) comment-or-uncomment-region(16 46 nil) comment-dwim(nil) call-interactively(comment-dwim nil nil) command-execute(comment-dwim) From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 08 15:14:37 2014 Received: (at control) by debbugs.gnu.org; 8 Feb 2014 20:14:37 +0000 Received: from localhost ([127.0.0.1]:58212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCEIP-0000k9-FE for submit@debbugs.gnu.org; Sat, 08 Feb 2014 15:14:37 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:42705) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCEIO-0000k2-2K for control@debbugs.gnu.org; Sat, 08 Feb 2014 15:14:36 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1WCEIN-0007a3-Rb for control@debbugs.gnu.org; Sat, 08 Feb 2014 15:14:35 -0500 Date: Sat, 08 Feb 2014 15:14:35 -0500 Message-Id: Subject: control message for bug 16695 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -5.5 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.5 (-----) merge 15611 16695 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 08 15:15:22 2014 Received: (at control) by debbugs.gnu.org; 8 Feb 2014 20:15:23 +0000 Received: from localhost ([127.0.0.1]:58216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCEJ7-000190-Uz for submit@debbugs.gnu.org; Sat, 08 Feb 2014 15:15:22 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:42712) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCEJ5-000165-LE for control@debbugs.gnu.org; Sat, 08 Feb 2014 15:15:19 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1WCEJ5-0007jM-Bb for control@debbugs.gnu.org; Sat, 08 Feb 2014 15:15:19 -0500 Date: Sat, 08 Feb 2014 15:15:19 -0500 Message-Id: Subject: control message for bug 15611 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -5.5 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.5 (-----) # typo in previous control message unmerge 15611 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 08 15:15:39 2014 Received: (at control) by debbugs.gnu.org; 8 Feb 2014 20:15:39 +0000 Received: from localhost ([127.0.0.1]:58219 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCEJO-0001TE-UG for submit@debbugs.gnu.org; Sat, 08 Feb 2014 15:15:39 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:42716) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCEJM-0001QJ-Aw for control@debbugs.gnu.org; Sat, 08 Feb 2014 15:15:36 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1WCEJM-0007nR-1I for control@debbugs.gnu.org; Sat, 08 Feb 2014 15:15:36 -0500 Date: Sat, 08 Feb 2014 15:15:36 -0500 Message-Id: Subject: control message for bug 16695 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -5.5 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.5 (-----) merge 15881 16695 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 08 17:54:32 2014 Received: (at 16695) by debbugs.gnu.org; 8 Feb 2014 22:54:32 +0000 Received: from localhost ([127.0.0.1]:58321 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCGnA-0008M5-4c for submit@debbugs.gnu.org; Sat, 08 Feb 2014 17:54:32 -0500 Received: from colin.muc.de ([193.149.48.1]:54476 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCGn6-0008Lv-Vy for 16695@debbugs.gnu.org; Sat, 08 Feb 2014 17:54:30 -0500 Received: (qmail 73274 invoked by uid 3782); 8 Feb 2014 22:54:27 -0000 Received: from acm.muc.de (pD951823D.dip0.t-ipconnect.de [217.81.130.61]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 08 Feb 2014 23:54:26 +0100 Received: (qmail 5152 invoked by uid 1000); 8 Feb 2014 22:51:07 -0000 Date: Sat, 8 Feb 2014 22:51:07 +0000 To: Glenn Morris Subject: Re: bug#16695: 24.3; comment-dwim (args out of range) Message-ID: <20140208225107.GB4063@acm.acm> References: <84sirtd698.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 16695 Cc: 16695@debbugs.gnu.org, eg5cue@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.2 (-) Hi, Glenn. On Sat, Feb 08, 2014 at 03:12:20PM -0500, Glenn Morris wrote: > eg5cue@gmail.com wrote: > > this is a longstanding bug since 24.3(i don't tried older versions) > > till now (the latest git version - github mirror), and is very > > annoying. it happens when trying to comment out (a line/multiple > > lines) except the first line from a C family file that: > > it's first line isn't empty or a comment. > > isn't modified after it's opened. > > comment function: comment-dwim (M-;) > > emacs args: emacs -Q > Thanks. For future reference, please do > M-x toggle-debug-on-error > and include the basktrace in the report: > Debugger entered--Lisp error: (args-out-of-range 1 2) > remove-text-properties(# 2 (category nil)) > c-invalidate-state-cache(17) > c-before-change(17 17) > comment-region-internal(17 45 "/* " " */" nil nil nil nil t) > comment-region-default(16 46 nil) > comment-region(16 46 nil) > comment-or-uncomment-region(16 46 nil) > comment-dwim(nil) > call-interactively(comment-dwim nil nil) > command-execute(comment-dwim) I think this is the same bug as #16585, which I've just posted a patch for. Here is the patch again. After applying this patch, recompile progmodes/cc-defs.el, then recompile progmodes/cc-engine.el. To the Original Poster: please try this out, and confirm it fixes the bug. Thanks! === modified file 'lisp/progmodes/cc-defs.el' *** lisp/progmodes/cc-defs.el 2014-02-02 10:25:29 +0000 --- lisp/progmodes/cc-defs.el 2014-02-08 22:21:01 +0000 *************** *** 1293,1302 **** ;; suppressed. `(unwind-protect (c-save-buffer-state () ! (c-clear-cpp-delimiters ,beg ,end) ,`(c-with-cpps-commented-out ,@forms)) (c-save-buffer-state () ! (c-set-cpp-delimiters ,beg ,end)))) (defsubst c-intersect-lists (list alist) ;; return the element of ALIST that matches the first element found --- 1293,1306 ---- ;; suppressed. `(unwind-protect (c-save-buffer-state () ! (save-restriction ! (widen) ! (c-clear-cpp-delimiters ,beg ,end)) ,`(c-with-cpps-commented-out ,@forms)) (c-save-buffer-state () ! (save-restriction ! (widen) ! (c-set-cpp-delimiters ,beg ,end))))) (defsubst c-intersect-lists (list alist) ;; return the element of ALIST that matches the first element found -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 08 18:23:08 2014 Received: (at 16695) by debbugs.gnu.org; 8 Feb 2014 23:23:08 +0000 Received: from localhost ([127.0.0.1]:58360 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCHEq-0000gf-HA for submit@debbugs.gnu.org; Sat, 08 Feb 2014 18:23:08 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:45072) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCHEo-0000gY-Tq for 16695@debbugs.gnu.org; Sat, 08 Feb 2014 18:23:07 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1WCHEn-0003ez-Ra; Sat, 08 Feb 2014 18:23:05 -0500 From: Glenn Morris To: Alan Mackenzie Subject: Re: bug#16695: 24.3; comment-dwim (args out of range) References: <84sirtd698.fsf@gmail.com> <20140208225107.GB4063@acm.acm> X-Spook: Glock Rumsfeld Janet Reno arrangements tempest Jiang X-Ran: =!J(uJ1Q"0]gtGZ]tO1$j>!ztG.m?qro.)uD[]R]cy5u~L8Z[bo4i(Kdi#HQ`;:=XH(sN/ X-Hue: red X-Debbugs-No-Ack: yes X-Attribution: GM Date: Sat, 08 Feb 2014 18:23:05 -0500 In-Reply-To: <20140208225107.GB4063@acm.acm> (Alan Mackenzie's message of "Sat, 8 Feb 2014 22:51:07 +0000") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.5 (-----) X-Debbugs-Envelope-To: 16695 Cc: 16695@debbugs.gnu.org, eg5cue@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.5 (-----) Alan Mackenzie wrote: > I think this is the same bug as #16585 I don't about that, but it is certainly the same as #15881. From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 09 05:33:29 2014 Received: (at 16695) by debbugs.gnu.org; 9 Feb 2014 10:33:29 +0000 Received: from localhost ([127.0.0.1]:59304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCRhY-0007GQ-Cm for submit@debbugs.gnu.org; Sun, 09 Feb 2014 05:33:29 -0500 Received: from mail-qa0-f53.google.com ([209.85.216.53]:63329) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCRhU-0007GC-24 for 16695@debbugs.gnu.org; Sun, 09 Feb 2014 05:33:25 -0500 Received: by mail-qa0-f53.google.com with SMTP id cm18so7886754qab.40 for <16695@debbugs.gnu.org>; Sun, 09 Feb 2014 02:33:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ST6Y8utqyjQ0IZ8dqv2DmUpzBm7ecg6S0xwXJio5U2I=; b=TbmCLvwRJk3paTPJMUqq+SjIHNhozOGdSp1I/81ziIx+f161re/WquVoZl9qZMlGAK f0b0plFWIE9ObjnIxrp705iq/B51Ua8b9XCbcAopd69SsD9QJQyLQLVCJq7Kz7nxmt8S mr+hAkTFNGtybto0v3uebzIZWgx+7ftKO814KaReRI4nLlrXSCH2OUoSaaC/yoKHc8mh Jrgm2TDFUyFmwc6Ego2Y6BVpRu8ejp0gKhqIbPEd9y1N6mIZ1w6UrYQAErfguFgH0iFy l03DagEVNBFEltGYWW2GgJER75tx8Xtnp8j3KGVIA7uRQfs+nzbZc4QlN9iDp17VGBbT RSSQ== MIME-Version: 1.0 X-Received: by 10.140.81.74 with SMTP id e68mr35463920qgd.99.1391942003490; Sun, 09 Feb 2014 02:33:23 -0800 (PST) Received: by 10.96.69.136 with HTTP; Sun, 9 Feb 2014 02:33:23 -0800 (PST) In-Reply-To: References: <84sirtd698.fsf@gmail.com> <20140208225107.GB4063@acm.acm> Date: Sun, 9 Feb 2014 10:33:23 +0000 Message-ID: Subject: Re: bug#16695: 24.3; comment-dwim (args out of range) From: Arash Cue To: Alan Mackenzie Content-Type: multipart/alternative; boundary=001a11c11d12aaa04504f1f6c0c3 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16695 Cc: 16695@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -0.7 (/) --001a11c11d12aaa04504f1f6c0c3 Content-Type: text/plain; charset=ISO-8859-1 this patch fixed the problem for me. thanks On Sat, Feb 8, 2014 at 10:51 PM, Alan Mackenzie wrote: > Hi, Glenn. > > On Sat, Feb 08, 2014 at 03:12:20PM -0500, Glenn Morris wrote: > > eg5cue@gmail.com wrote: > > > > this is a longstanding bug since 24.3(i don't tried older versions) > > > till now (the latest git version - github mirror), and is very > > > annoying. it happens when trying to comment out (a line/multiple > > > lines) except the first line from a C family file that: > > > > it's first line isn't empty or a comment. > > > isn't modified after it's opened. > > > > comment function: comment-dwim (M-;) > > > emacs args: emacs -Q > > > Thanks. For future reference, please do > > > M-x toggle-debug-on-error > > > and include the basktrace in the report: > > > Debugger entered--Lisp error: (args-out-of-range 1 2) > > remove-text-properties(# 2 (category nil)) > > c-invalidate-state-cache(17) > > c-before-change(17 17) > > comment-region-internal(17 45 "/* " " */" nil nil nil nil t) > > comment-region-default(16 46 nil) > > comment-region(16 46 nil) > > comment-or-uncomment-region(16 46 nil) > > comment-dwim(nil) > > call-interactively(comment-dwim nil nil) > > command-execute(comment-dwim) > > I think this is the same bug as #16585, which I've just posted a patch > for. Here is the patch again. After applying this patch, recompile > progmodes/cc-defs.el, then recompile progmodes/cc-engine.el. > > To the Original Poster: please try this out, and confirm it fixes the > bug. Thanks! > > > === modified file 'lisp/progmodes/cc-defs.el' > *** lisp/progmodes/cc-defs.el 2014-02-02 10:25:29 +0000 > --- lisp/progmodes/cc-defs.el 2014-02-08 22:21:01 +0000 > *************** > *** 1293,1302 **** > ;; suppressed. > `(unwind-protect > (c-save-buffer-state () > ! (c-clear-cpp-delimiters ,beg ,end) > ,`(c-with-cpps-commented-out ,@forms)) > (c-save-buffer-state () > ! (c-set-cpp-delimiters ,beg ,end)))) > > (defsubst c-intersect-lists (list alist) > ;; return the element of ALIST that matches the first element found > --- 1293,1306 ---- > ;; suppressed. > `(unwind-protect > (c-save-buffer-state () > ! (save-restriction > ! (widen) > ! (c-clear-cpp-delimiters ,beg ,end)) > ,`(c-with-cpps-commented-out ,@forms)) > (c-save-buffer-state () > ! (save-restriction > ! (widen) > ! (c-set-cpp-delimiters ,beg ,end))))) > > (defsubst c-intersect-lists (list alist) > ;; return the element of ALIST that matches the first element found > > > -- > Alan Mackenzie (Nuremberg, Germany). > --001a11c11d12aaa04504f1f6c0c3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
this patch fixed the problem for me. thanks


On Sat, Feb 8, 2014 at 10:51 PM,= Alan Mackenzie <acm@muc.de> wrote:
Hi, Glenn.

On Sat, Feb 08, 2014 at 03:12:20PM -0500, Glenn Morris wrote:
> eg5cue@gmail.com= wrote:

> > this is a longstanding bug since 24.3(i don't tried older ver= sions)
> > till now (the latest git version - github mirror), and is very > > annoying. it happens when trying to comment out (a line/multiple<= br> > > lines) except the first line from a C family file that:

> > it's first line isn't empty or a comment.
> > isn't modified after it's opened.

> > comment function: comment-dwim (M-;)
> > emacs args: emacs -Q

> Thanks. For future reference, please do

> =A0M-x toggle-debug-on-error

> and include the basktrace in the report:

> Debugger entered--Lisp error: (args-out-of-range 1 2)
> =A0 remove-text-properties(#<marker at 1 in foo.c> 2 (category n= il))
> =A0 c-invalidate-state-cache(17)
> =A0 c-before-change(17 17)
> =A0 comment-region-internal(17 45 "/* " " */" nil = nil nil nil t)
> =A0 comment-region-default(16 46 nil)
> =A0 comment-region(16 46 nil)
> =A0 comment-or-uncomment-region(16 46 nil)
> =A0 comment-dwim(nil)
> =A0 call-interactively(comment-dwim nil nil)
> =A0 command-execute(comment-dwim)

I think this is the same bug as #16585, which I've just pos= ted a patch
for. =A0Here is the patch again. =A0After applying this patch, recompile progmodes/cc-defs.el, then recompile progmodes/cc-engine.el.

To the Original Poster: please try this out, and confirm it fixes the
bug. =A0Thanks!


=3D=3D=3D modified file 'lisp/progmodes/cc-defs.el'
*** lisp/progmodes/cc-defs.el =A0 2014-02-02 10:25:29 +0000
--- lisp/progmodes/cc-defs.el =A0 2014-02-08 22:21:01 +0000
***************
*** 1293,1302 ****
=A0 =A0 ;; suppressed.
=A0 =A0 `(unwind-protect
=A0 =A0 =A0 =A0 =A0(c-save-buffer-state ()
! =A0 =A0 =A0 =A0(c-clear-cpp-delimiters ,beg ,end)
=A0 =A0 =A0 =A0 =A0,`(c-with-cpps-commented-out ,@forms))
=A0 =A0 =A0 =A0(c-save-buffer-state ()
! =A0 =A0 =A0 =A0(c-set-cpp-delimiters ,beg ,end))))

=A0 (defsubst c-intersect-lists (list alist)
=A0 =A0 ;; return the element of ALIST that matches the first element found=
--- 1293,1306 ----
=A0 =A0 ;; suppressed.
=A0 =A0 `(unwind-protect
=A0 =A0 =A0 =A0 =A0(c-save-buffer-state ()
! =A0 =A0 =A0 =A0(save-restriction
! =A0 =A0 =A0 =A0 =A0(widen)
! =A0 =A0 =A0 =A0 =A0(c-clear-cpp-delimiters ,beg ,end))
=A0 =A0 =A0 =A0 =A0,`(c-with-cpps-commented-out ,@forms))
=A0 =A0 =A0 =A0(c-save-buffer-state ()
! =A0 =A0 =A0 =A0(save-restriction
! =A0 =A0 =A0 =A0(widen)
! =A0 =A0 =A0 =A0(c-set-cpp-delimiters ,beg ,end)))))

=A0 (defsubst c-intersect-lists (list alist)
=A0 =A0 ;; return the element of ALIST that matches the first element found=


--
Alan Mackenzie (Nuremberg, Germany).

--001a11c11d12aaa04504f1f6c0c3-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 09 07:44:41 2014 Received: (at 16695-done) by debbugs.gnu.org; 9 Feb 2014 12:44:41 +0000 Received: from localhost ([127.0.0.1]:59374 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCTkX-0006YW-AZ for submit@debbugs.gnu.org; Sun, 09 Feb 2014 07:44:41 -0500 Received: from colin.muc.de ([193.149.48.1]:44108 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCTkU-0006YG-On for 16695-done@debbugs.gnu.org; Sun, 09 Feb 2014 07:44:39 -0500 Received: (qmail 7801 invoked by uid 3782); 9 Feb 2014 12:44:37 -0000 Received: from acm.muc.de (p5492C804.dip0.t-ipconnect.de [84.146.200.4]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 09 Feb 2014 13:44:36 +0100 Received: (qmail 4476 invoked by uid 1000); 9 Feb 2014 12:41:17 -0000 Date: Sun, 9 Feb 2014 12:41:17 +0000 To: 16695-done@debbugs.gnu.org Subject: Re: bug#16695: 24.3; comment-dwim (args out of range) Message-ID: <20140209124117.GA3593@acm.acm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 16695-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.3 (-) Bug fixed. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 10 13:26:46 2014 Received: (at control) by debbugs.gnu.org; 10 Feb 2014 18:26:46 +0000 Received: from localhost ([127.0.0.1]:41674 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCvZ7-00074g-HN for submit@debbugs.gnu.org; Mon, 10 Feb 2014 13:26:45 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:50067 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCvZ4-00074W-Ix for control@debbugs.gnu.org; Mon, 10 Feb 2014 13:26:43 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1WCvZ3-0004ko-TN for control@debbugs.gnu.org; Mon, 10 Feb 2014 13:26:42 -0500 Date: Mon, 10 Feb 2014 13:26:41 -0500 Message-Id: Subject: subj To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -5.6 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.6 (-----) fixed 15881 24.4 From unknown Thu Jun 19 12:30:05 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 11 Mar 2014 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator