From unknown Mon Aug 18 19:30:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11733: 24.1; cperl indentation bugs Resent-From: Vincent Lefevre Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Jun 2012 10:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11733 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 11733@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.134001654126086 (code B ref -1); Mon, 18 Jun 2012 10:49:02 +0000 Received: (at submit) by debbugs.gnu.org; 18 Jun 2012 10:49:01 +0000 Received: from localhost ([127.0.0.1]:46557 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SgZW0-0006mh-Tz for submit@debbugs.gnu.org; Mon, 18 Jun 2012 06:49:01 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42653) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SgZVy-0006ma-FH for submit@debbugs.gnu.org; Mon, 18 Jun 2012 06:48:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SgZSj-0005PX-6h for submit@debbugs.gnu.org; Mon, 18 Jun 2012 06:45:43 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:37603) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgZSj-0005PO-31 for submit@debbugs.gnu.org; Mon, 18 Jun 2012 06:45:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgZSc-00066g-Pg for bug-gnu-emacs@gnu.org; Mon, 18 Jun 2012 06:45:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SgZSW-0005NE-2J for bug-gnu-emacs@gnu.org; Mon, 18 Jun 2012 06:45:30 -0400 Received: from ypig.lip.ens-lyon.fr ([140.77.13.48]:55942) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgZSV-0005Mh-Ri for bug-gnu-emacs@gnu.org; Mon, 18 Jun 2012 06:45:23 -0400 Received: from vlefevre by ypig.lip.ens-lyon.fr with local (Exim 4.80) (envelope-from ) id 1SgZSS-00009t-VX; Mon, 18 Jun 2012 12:45:21 +0200 From: Vincent Lefevre Date: Mon, 18 Jun 2012 12:45:20 +0200 Message-ID: <871ulcdhkv.fsf@ypig.lip.ens-lyon.fr> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) The indentation in CPerl mode is buggy on sub, even with the default configuration (emacs -Q). Open the following file: ---------------------------------------- #!/usr/bin/env perl # -*- mode: cperl -*- sub foo { } sub bar { } ---------------------------------------- and hit the [TAB] key over the "sub bar" line. This line is indented by 2 columns instead of being left on the first column. More generally this happens on all subs except the first one. [TAB] on the '{' of sub bar (line 9 of the script) gives a 4-column indentation instead of 2, but this may be a consequence of the above problem. Other indentation bugs: ---------------------------------------- #!/usr/bin/env perl # -*- mode: cperl -*- while (<>) { m:^ \d+ p: or die; m:^ \d+ : or die; } ---------------------------------------- [TAB] on "or die;" gives: * a 4-column indentation instead of 6 for the 1st one, * a 8-column indentation instead of 6 for the 2nd one. Note: my old Debian bug report about these indentation bugs: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=405684 In GNU Emacs 24.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10) of 2012-06-15 on ypig Windowing system distributor `The X.Org Foundation', version 11.0.11201902 Configured using: `configure '--prefix=/usr/local/emacs-24.1' '--enable-asserts'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: POSIX value of $LC_CTYPE: en_US.UTF-8 value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: en_DK value of $LANG: POSIX value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: display-time-mode: t show-paren-mode: t tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: x r e p o r t - b u Recent messages: Loading /home/vlefevre/share/emacs/site-lisp/mutteditor.el (source)...done Loading time...done For information about GNU Emacs and the GNU system, type C-h C-a. Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr warnings emacsbug message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils time cus-start cus-load paren cc-styles cc-align cc-engine cc-vars cc-defs regexp-opt time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) From unknown Mon Aug 18 19:30:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11733: 24.1; cperl indentation bugs Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Jun 2012 16:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11733 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Vincent Lefevre Cc: 11733@debbugs.gnu.org Received: via spool by 11733-submit@debbugs.gnu.org id=B11733.134012321011773 (code B ref 11733); Tue, 19 Jun 2012 16:27:01 +0000 Received: (at 11733) by debbugs.gnu.org; 19 Jun 2012 16:26:50 +0000 Received: from localhost ([127.0.0.1]:48772 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sh1GT-00033p-Gb for submit@debbugs.gnu.org; Tue, 19 Jun 2012 12:26:49 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:45223) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sh1GR-00033h-2l for 11733@debbugs.gnu.org; Tue, 19 Jun 2012 12:26:48 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1Sh1D9-0000We-Mu; Tue, 19 Jun 2012 12:23:23 -0400 From: Glenn Morris References: <871ulcdhkv.fsf@ypig.lip.ens-lyon.fr> X-Spook: espionage Agfa Venezuela CipherTAC-2000 assassinate CIA X-Ran: X/P9?v^6$V0x\a|;aI/'3EJP3&z`{]{OAnZ|r^~j7SnhVe?1/1uVQ(DacmI?}S:|d3 X-Hue: white X-Attribution: GM Date: Tue, 19 Jun 2012 12:23:23 -0400 In-Reply-To: <871ulcdhkv.fsf@ypig.lip.ens-lyon.fr> (Vincent Lefevre's message of "Mon, 18 Jun 2012 12:45:20 +0200") 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: -6.9 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) Vincent Lefevre wrote: > The indentation in CPerl mode is buggy on sub, Here at Emacs, we are discouraged from changing cperl-mode (not that I want to myself); see eg bugs 10934, 8802. But upstream [1] doesn't appear to have changed it in 4 years, so you're kind of stuck AFAICS. [1] http://math.berkeley.edu/~ilya/software/emacs/ From unknown Mon Aug 18 19:30:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11733: 24.1; cperl indentation bugs References: <871ulcdhkv.fsf@ypig.lip.ens-lyon.fr> In-Reply-To: <871ulcdhkv.fsf@ypig.lip.ens-lyon.fr> Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Sep 2019 00:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11733 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Vincent Lefevre Cc: 11733@debbugs.gnu.org Received: via spool by 11733-submit@debbugs.gnu.org id=B11733.15690270771368 (code B ref 11733); Sat, 21 Sep 2019 00:52:01 +0000 Received: (at 11733) by debbugs.gnu.org; 21 Sep 2019 00:51:17 +0000 Received: from localhost ([127.0.0.1]:58842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBTcK-0000Lz-Mi for submit@debbugs.gnu.org; Fri, 20 Sep 2019 20:51:16 -0400 Received: from mail-pf1-f180.google.com ([209.85.210.180]:33074) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBTcG-0000Li-4u for 11733@debbugs.gnu.org; Fri, 20 Sep 2019 20:51:15 -0400 Received: by mail-pf1-f180.google.com with SMTP id q10so5696820pfl.0 for <11733@debbugs.gnu.org>; Fri, 20 Sep 2019 17:51:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=b0TQwwH+EyPN94X0UTRkVc0l/CHjtwZ6is+MINicuAc=; b=aE4UPwD4qsEOfp8y7vZTg3BKHVIoPSjRJKM9RsKiISivKMVo4uF+jsMrg+2aCqAvL1 oCc8XLp4vq6E/gR4ZPAYtLFPPaHQ0M0imm92b3STYDEgF3vfn24w5AAT+sYNpC5lKJmi ycQIeKxLoM7fOqfU634nHUvSw9MILCQ4yL+DCyqFyQ4F/p2/kOc2ETWUek+dl5mzuKYz IT0XeR+ZBc52jkQRIlh9cQv7SCE9z/lMNWn7t2P6bSu6BCrdqxrlpJfcl97GGC1xhfpB V0KLms5ccCeY64BViNxbQ64TR8oJTLCvjPt1yz3W8KFyMCTPGNLgcI8osVUvgknY9ond pmSg== X-Gm-Message-State: APjAAAVG/NbTQZDcuZTaF2YCqxkAIu54pATBM25GR9ULT1RKPTFSCfUa RBadOVpNvy8m0v6V5uH8TQDHA+INkRqMQxup8S0= X-Google-Smtp-Source: APXvYqzpwh8Zu+k91AAckzJC87m08YGGDNhYVszAF99Exb4KPoPffy6BXgG9PTjIOiZlbmBgGo06baOwwM/8YffLrxo= X-Received: by 2002:a17:90b:8d1:: with SMTP id ds17mr1231233pjb.106.1569027066244; Fri, 20 Sep 2019 17:51:06 -0700 (PDT) MIME-Version: 1.0 From: Stefan Kangas Date: Sat, 21 Sep 2019 02:50:55 +0200 Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.4 (/) 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: -0.6 (/) Vincent Lefevre writes: > The indentation in CPerl mode is buggy on sub, even with the default > configuration (emacs -Q). Open the following file: > > ---------------------------------------- > #!/usr/bin/env perl > # -*- mode: cperl -*- > > sub foo > { > } > > sub bar > { > } > ---------------------------------------- > > and hit the [TAB] key over the "sub bar" line. This line is indented > by 2 columns instead of being left on the first column. More generally > this happens on all subs except the first one. > > [TAB] on the '{' of sub bar (line 9 of the script) gives a 4-column > indentation instead of 2, but this may be a consequence of the above > problem. I can reproduce this on Emacs 26.1. > Other indentation bugs: > > ---------------------------------------- > #!/usr/bin/env perl > # -*- mode: cperl -*- > > while (<>) > { > m:^ \d+ p: > or die; > m:^ \d+ : > or die; > } > ---------------------------------------- I can reproduce this too. Best regards, Stefan Kangas From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 20 20:52:20 2019 Received: (at control) by debbugs.gnu.org; 21 Sep 2019 00:52:20 +0000 Received: from localhost ([127.0.0.1]:58846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBTdM-0000Nt-39 for submit@debbugs.gnu.org; Fri, 20 Sep 2019 20:52:20 -0400 Received: from mail-pl1-f174.google.com ([209.85.214.174]:42307) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBTdL-0000Ng-D2 for control@debbugs.gnu.org; Fri, 20 Sep 2019 20:52:19 -0400 Received: by mail-pl1-f174.google.com with SMTP id e5so3977640pls.9 for ; Fri, 20 Sep 2019 17:52:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=k/12n1T8Q6MrvaVDlGQiQGQHbbO2bvKsm2USCiBC9OE=; b=Ff1Kk7I6z7g83w7mnYdAJQDKON169hxPCUWAQhJRSXoGWOCcY2uwGNRVVeQKLLeI63 Uvqe/bDWMrYXsrb7uvBfw9kGa3JON+gnlWLEyu/wB5FPmz+Iv02lS4vAVpbw+0ey7lcW zZw0GtoVW7xftQ5NgaveVtHFERaD0mSVmUo0+R8eIIayO3lQE0ROhxfbrJ9wmjsWepn3 /6tu8YM4CPID724HAdgUAUDOoy22o+0l9tPyyNz3ZNXnNkS09qngEPfGH8ttKqDVt/LU SUyEgEIYXcl6uIJV+23AyEEWnUmzeG11A5buChmQA6TZpvMfBml9NbG8c2yYI8vdpgSD 8Neg== X-Gm-Message-State: APjAAAWag/SO3H9Xa5ol/2Yfc0Fgq+QiyXofhEqzbQd8bQc8HpUjOb7y nTFbLZY0jZoXf8rrkKa3OdL/+EvoOEYeVaPzvOvt05u2 X-Google-Smtp-Source: APXvYqwktANvURUIyZoTBii4XQOPw0/A34h4cdDOtY3Y9A+aFmlNoksgNIlEe0ex1mWsODJDD7+7wyu/QvC3ecvH+vg= X-Received: by 2002:a17:902:d88f:: with SMTP id b15mr5839986plz.251.1569027133413; Fri, 20 Sep 2019 17:52:13 -0700 (PDT) MIME-Version: 1.0 From: Stefan Kangas Date: Sat, 21 Sep 2019 02:52:02 +0200 Message-ID: Subject: Re: bug#11733: 24.1; cperl indentation bugs To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: control 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: -0.6 (/) found 11733 26.1 tags 11733 + confirmed severity 11733 minor quit From unknown Mon Aug 18 19:30:55 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Vincent Lefevre Subject: bug#11733: closed (Indentation has been fixed in the master branch.) Message-ID: References: <875y73nt5s.fsf@oook.m.uunet.de> <871ulcdhkv.fsf@ypig.lip.ens-lyon.fr> X-Gnu-PR-Message: they-closed 11733 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: confirmed Reply-To: 11733@debbugs.gnu.org Date: Sat, 01 Jul 2023 22:51:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1688251861-11191-1" This is a multi-part message in MIME format... ------------=_1688251861-11191-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #11733: 24.1; cperl indentation bugs which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 11733@debbugs.gnu.org. --=20 11733: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D11733 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1688251861-11191-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 11733-done) by debbugs.gnu.org; 1 Jul 2023 22:50:18 +0000 Received: from localhost ([127.0.0.1]:58872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFjQ2-0002tX-3p for submit@debbugs.gnu.org; Sat, 01 Jul 2023 18:50:18 -0400 Received: from mout01.posteo.de ([185.67.36.65]:36377) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFjPz-0002tH-5M for 11733-done@debbugs.gnu.org; Sat, 01 Jul 2023 18:50:17 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id B7530240027 for <11733-done@debbugs.gnu.org>; Sun, 2 Jul 2023 00:50:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1688251808; bh=NzM9gigrqnAAS49jxrLCovwKIiapp85/uSccHS0kPNQ=; h=From:To:Subject:Date:Message-ID:MIME-Version:From; b=BVEQ6oAnhtgqxlF6a62Ff08UMUL6W+0uxWeFckohynjIz1AXApXUe8Ri3kMCRTdmw k6CmKA59o6sMTyrUFuypl9Pj/U3BGsJhjRHSs7esZN2ZXnqQWq6o1hwr1Cygq4G+Zb a7dM+10pmxZxmdeZYO9athRiwNO9RCLVGt55H3fmxi9dnMvmJrnYKaeM18/QXQDzg+ fHhAoQvm2lM3jESHw7k7W5ZG4kqOBzCApkZVKL1nl2uU+l/Da9Pn7yHMXwcp0sTmT4 cpWFkVyDXgGSjesBhVhMyKf0IPbrRWGKfbDivIhNK+ia6HEC5hsejf9myrZLjOubGt EKhZhL8SbzjSQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QtnSw2Rlyz6tsB for <11733-done@debbugs.gnu.org>; Sun, 2 Jul 2023 00:50:08 +0200 (CEST) From: =?utf-8?Q?Harald_J=C3=B6rg?= To: 11733-done@debbugs.gnu.org Subject: Indentation has been fixed in the master branch. Date: Sat, 01 Jul 2023 22:50:07 +0000 Message-ID: <875y73nt5s.fsf@oook.m.uunet.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 11733-done 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 (---) Eventually, the reworking of the indentation code allows to fix these bugs (again, thanks for the clear recipes). The first example will now be indented like this: -------------------------------------------------- #!/usr/bin/env perl # -*- mode: cperl -*- sub foo { } sub bar { } -------------------------------------------------- This is in line with the Perl style guide https://perldoc.perl.org/perlstyle. The second example is a masterpiece of edge cases: -------------------------------------------------- #!/usr/bin/env perl # -*- mode: cperl -*- while (<>) { m:^ \d+ p: or die; m:^ \d+ : or die; } -------------------------------------------------- The strings 'm:' and 'p:' look like labels, and cperl-mode must take extra measures to detect these situations. This is now done. When indented line-by-line, cperl-mode will now the leave the indentation unchanged. cperl-mode.el from the repository works with Emacs versions 27 and newer. Therefore, I am declaring this bug "done". -- Cheers, haj ------------=_1688251861-11191-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 18 Jun 2012 10:49:01 +0000 Received: from localhost ([127.0.0.1]:46557 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SgZW0-0006mh-Tz for submit@debbugs.gnu.org; Mon, 18 Jun 2012 06:49:01 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42653) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SgZVy-0006ma-FH for submit@debbugs.gnu.org; Mon, 18 Jun 2012 06:48:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SgZSj-0005PX-6h for submit@debbugs.gnu.org; Mon, 18 Jun 2012 06:45:43 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:37603) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgZSj-0005PO-31 for submit@debbugs.gnu.org; Mon, 18 Jun 2012 06:45:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgZSc-00066g-Pg for bug-gnu-emacs@gnu.org; Mon, 18 Jun 2012 06:45:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SgZSW-0005NE-2J for bug-gnu-emacs@gnu.org; Mon, 18 Jun 2012 06:45:30 -0400 Received: from ypig.lip.ens-lyon.fr ([140.77.13.48]:55942) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgZSV-0005Mh-Ri for bug-gnu-emacs@gnu.org; Mon, 18 Jun 2012 06:45:23 -0400 Received: from vlefevre by ypig.lip.ens-lyon.fr with local (Exim 4.80) (envelope-from ) id 1SgZSS-00009t-VX; Mon, 18 Jun 2012 12:45:21 +0200 From: Vincent Lefevre To: bug-gnu-emacs@gnu.org Subject: 24.1; cperl indentation bugs Date: Mon, 18 Jun 2012 12:45:20 +0200 Message-ID: <871ulcdhkv.fsf@ypig.lip.ens-lyon.fr> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) The indentation in CPerl mode is buggy on sub, even with the default configuration (emacs -Q). Open the following file: ---------------------------------------- #!/usr/bin/env perl # -*- mode: cperl -*- sub foo { } sub bar { } ---------------------------------------- and hit the [TAB] key over the "sub bar" line. This line is indented by 2 columns instead of being left on the first column. More generally this happens on all subs except the first one. [TAB] on the '{' of sub bar (line 9 of the script) gives a 4-column indentation instead of 2, but this may be a consequence of the above problem. Other indentation bugs: ---------------------------------------- #!/usr/bin/env perl # -*- mode: cperl -*- while (<>) { m:^ \d+ p: or die; m:^ \d+ : or die; } ---------------------------------------- [TAB] on "or die;" gives: * a 4-column indentation instead of 6 for the 1st one, * a 8-column indentation instead of 6 for the 2nd one. Note: my old Debian bug report about these indentation bugs: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=405684 In GNU Emacs 24.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10) of 2012-06-15 on ypig Windowing system distributor `The X.Org Foundation', version 11.0.11201902 Configured using: `configure '--prefix=/usr/local/emacs-24.1' '--enable-asserts'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: POSIX value of $LC_CTYPE: en_US.UTF-8 value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: en_DK value of $LANG: POSIX value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: display-time-mode: t show-paren-mode: t tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: x r e p o r t - b u Recent messages: Loading /home/vlefevre/share/emacs/site-lisp/mutteditor.el (source)...done Loading time...done For information about GNU Emacs and the GNU system, type C-h C-a. Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr warnings emacsbug message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils time cus-start cus-load paren cc-styles cc-align cc-engine cc-vars cc-defs regexp-opt time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) ------------=_1688251861-11191-1--