GNU bug report logs - #15854
24.3.50; cperl-mode: Support for outlining (much like that in perl-mode)

Previous Next

Package: emacs;

Reported by: Jambunathan K <kjambunathan <at> gmail.com>

Date: Sun, 10 Nov 2013 09:15:01 UTC

Severity: wishlist

Found in version 24.3.50

Done: Jambunathan K <kjambunathan <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15854 in the body.
You can then email your comments to 15854 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#15854; Package emacs. (Sun, 10 Nov 2013 09:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jambunathan K <kjambunathan <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 10 Nov 2013 09:15:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50;
 cperl-mode: Support for outlining (much like that in perl-mode)
Date: Sun, 10 Nov 2013 14:44:38 +0530
[Message part 1 (text/plain, inline)]
This is either a bug or a feature request.

Summary: cperl-mode: Support for outlining (much like that in perl-mode)

1. Add this to your .emacs

      (add-hook 'perl-mode-hook 'outline-minor-mode)
      (add-hook 'cperl-mode-hook 'outline-minor-mode)

      (add-hook 'outline-minor-mode-hook
        (lambda ()
          (define-key outline-minor-mode-map [(control tab)] 'org-cycle)
          ;; (define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)
          (define-key outline-minor-mode-map [backtab] 'org-global-cycle)
          ))

2. C-x C-f org.pl
3. M-x perl-mode

4. Do this <S-iso-lefttab>, <S-iso-lefttab>

   See the attached screenshot for what I get.

5. M-x cperl-mode
6. Repeat step 4.

   Nothing interesting happens.  Only thing I see is this message.

      --8<---------------cut here---------------start------------->8---
         hide-sublevels: Must keep at least one level of headers [3 times]
      --8<---------------cut here---------------end--------------->8---


Expected behaviour
==================

I should be able to "cycle" through the visibility.

[perl-mode-outlining-and-org-cycle.png (image/png, attachment)]
[Message part 3 (text/plain, inline)]

----------------------------------------------------------------
In GNU Emacs 24.3.50.4 (i686-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2013-11-09 on debian-6.05
Bzr revision: 115051 jan.h.d <at> swipnet.se-20131109111953-cysfi19meuidy96q
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
System Description:	Debian GNU/Linux 6.0.5 (squeeze)

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15854; Package emacs. (Tue, 12 Nov 2013 02:22:01 GMT) Full text and rfc822 format available.

Message #8 received at 15854 <at> debbugs.gnu.org (full text, mbox):

From: Nathan Trapuzzano <nbtrap <at> nbtrap.com>
To: Jambunathan K <kjambunathan <at> gmail.com>
Cc: 15854 <at> debbugs.gnu.org
Subject: Re: bug#15854: 24.3.50;
 cperl-mode: Support for outlining (much like that in perl-mode)
Date: Mon, 11 Nov 2013 21:20:56 -0500
[Message part 1 (text/plain, inline)]
Jambunathan K <kjambunathan <at> gmail.com> writes:

> I should be able to "cycle" through the visibility.

Try the attached patch and let me know.

[cperl-mode.el.patch (text/x-diff, inline)]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: nbtrap <at> nbtrap.com-20131112021806-7r8z68lcggolglmd
# target_branch: file:///home/nathan/opt/etc/bzr-repos/emacs/trunk/
# testament_sha1: 96915ca7a15c022348d563dc4bdda8cd383c1843
# timestamp: 2013-11-11 21:18:47 -0500
# base_revision_id: monnier <at> iro.umontreal.ca-20131111180547-\
#   6k3t8pomzwp8zbtf
# 
# Begin patch
=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog	2013-11-11 18:05:47 +0000
+++ lisp/ChangeLog	2013-11-12 02:18:06 +0000
@@ -1,3 +1,8 @@
+2013-11-12  Nathan Trapuzzano  <nbtrap <at> nbtrap.com>
+
+	* progmodes/cperl-mode.el (cperl-outline-regexp)
+	(cperl-outline-level): Fix outline level detection bug.  (Bug#15854)
+
 2013-11-11  Stefan Monnier  <monnier <at> iro.umontreal.ca>
 
 	* subr.el (force-mode-line-update): Delete, move to buffer.c.

=== modified file 'lisp/progmodes/cperl-mode.el'
--- lisp/progmodes/cperl-mode.el	2013-11-04 03:44:23 +0000
+++ lisp/progmodes/cperl-mode.el	2013-11-12 02:13:34 +0000
@@ -1438,11 +1438,11 @@
    ))
 
 ;;; Details of groups in this are used in `cperl-imenu--create-perl-index'
-;;;  and `cperl-outline-level'.
+;;; and `cperl-imenu--function-name-regexp-perl'.
 ;;;; Was: 2=sub|package; now 2=package-group, 5=package-name 8=sub-name (+3)
-(defvar cperl-imenu--function-name-regexp-perl
+(defvar cperl-outline-regexp
   (concat
-   "^\\("				; 1 = all
+   "\\("				; 1 = all
        "\\([ \t]*package"		; 2 = package-group
           "\\("				; 3 = package-name-group
 	    cperl-white-and-comment-rex ; 4 = pre-package-name
@@ -1456,8 +1456,8 @@
      "\\([^\n]+\\)$"			; 17=text
    "\\)"))
 
-(defvar cperl-outline-regexp
-  (concat cperl-imenu--function-name-regexp-perl "\\|" "\\`"))
+(defvar cperl-imenu--function-name-regexp-perl
+  (concat "^" cperl-outline-regexp))
 
 (defvar cperl-mode-syntax-table nil
   "Syntax table in use in CPerl mode buffers.")
@@ -5623,13 +5623,12 @@
 ;; Suggested by Mark A. Hershberger
 (defun cperl-outline-level ()
   (looking-at outline-regexp)
-  (cond ((not (match-beginning 1)) 0)	; beginning-of-file
-;;;; 2=package-group, 5=package-name 8=sub-name 16=head-level
-	((match-beginning 2) 0)		; package
-	((match-beginning 8) 1)		; sub
+  (cond ;;;; 2=package-group, 5=package-name 8=sub-name 16=head-level
+	((match-beginning 2) 1)		; package
+	((match-beginning 8) 2)		; sub
 	((match-beginning 16)
-	 (- (char-after (match-beginning 16)) ?0)) ; headN ==> N
-	(t 5)))				; should not happen
+	 (1+ (- (char-after (match-beginning 16)) ?0))) ; headN ==> N
+	(t 6)))				; should not happen
 
 
 (defun cperl-windowed-init ()

# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWWu4kq8AA4BfgGAwWP///9sF
FAX/7//0YAbulL4FAFRCgAAENEamQU9T0ngk8U8o2KaeoPUaDQNPU9QAcwCYCZGAEYmJhMJghpia
YHMAmAmRgBGJiYTCYIaYmmAkkGkVPaT00ZUaeKNN6U8o9T1G0Ro9QaGhoHMAmAmRgBGJiYTCYIaY
mmAkiEMgJoBkTKaZTJtKfqJ+o0TTQGnklSxGAYJsBNBLEnl3OYM1LmoRAvc6xB2+u7aLNoivulAs
eccWFcc0LuhkgzkyRjWTIwqjseyI1Ia64F2WXKLOi6pl5hkfvYOHQZGYIzFO4i0twiaFjVVSiG01
mSzVJI+GrRjFWsRFHWc51wvQPiCyagQ2uc9rJidyzx005aA6+sn5r76Hh+WHmZObfQlU5OFnhZW5
DjXEJDBp8XfkWZyHZdx5DNXLJPasxrhPF6oEiKrIGQD35FBPSM+kPAjPEGJQu/XLBGk6GokPYJon
nvBtu99ihigJhiHwoO1/RDBJUPgGYWTdvXYa9ZtLTplqQRO2LlR2CmjRoHFxORhCVumyaJiCoPxR
2MuXlsxrd3uysEXMMy36n7Q7l5w9wtpOy0ihH0vdJXflKwrkK0RURkwsPa+IrEVkjbxQbplQzIlU
+xK25wowzEGPGXoYPzDH3l0Qp2tgDJBETpJ2FUVku8Ulf84kMqb6ZuRNjIRUKaD98ifmK08ZKaDT
ubCCwP7WEKMxhf0kOLxkK7wzzDYbiJ4SOJx6GmUtqz5te7M5mLewIkkpCaVEEWFcaCuD2POKZ8tS
54DUL6JSlXAmabTd9UG6dWFjkcoUfF6umVQI3ynFoiu5Z9YoMKo2oLnOTOOVVy37zGQ2PNsy42b6
fmG3KFS4WQQXR5md8RRHru254VCxGzL3KK4YVwr3DbIqHgOEM4dFzHCgOWlYYbZhaQrry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nfPq1CK2i1dTZ0egmRBLh7xgQfemRjRkWC
L7TyJBMp5shOjiilhrU54VlbVOL+Ns5GnBBW5AwyZM1xhYA5WdWBofjYFaVej7T4SxyaPImDjnUM
iAOV78S8PE5hWoAxdl2Mg3rgLBLEU6AgdKthWDHYVRTfX9GUMj80MWwrZLVeCCR7CjvV4nxgInaJ
jzDAWUkKpbmDxE9SgE1M2BeuX/F3JFOFCQa7iSrw

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15854; Package emacs. (Tue, 12 Nov 2013 04:31:01 GMT) Full text and rfc822 format available.

Message #11 received at 15854 <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: Nathan Trapuzzano <nbtrap <at> nbtrap.com>
Cc: 15854 <at> debbugs.gnu.org
Subject: Re: bug#15854: 24.3.50;
 cperl-mode: Support for outlining (much like that in perl-mode)
Date: Tue, 12 Nov 2013 10:01:06 +0530
Nathan Trapuzzano <nbtrap <at> nbtrap.com> writes:

>> I should be able to "cycle" through the visibility.
>
> Try the attached patch and let me know.

Thanks.  Looks good to me.

ps: You don't have to send a bzr bundle.  Maintainers don't insist on
it.  The presence of ChangeLog diffs in my work area led to workarea
conflicts and made my life very difficult when 'bzr update-d'.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15854; Package emacs. (Tue, 12 Nov 2013 11:30:03 GMT) Full text and rfc822 format available.

Message #14 received at 15854 <at> debbugs.gnu.org (full text, mbox):

From: Nathan Trapuzzano <nbtrap <at> nbtrap.com>
To: Jambunathan K <kjambunathan <at> gmail.com>
Cc: 15854 <at> debbugs.gnu.org
Subject: Re: bug#15854: 24.3.50;
 cperl-mode: Support for outlining (much like that in perl-mode)
Date: Tue, 12 Nov 2013 06:29:26 -0500
Jambunathan K <kjambunathan <at> gmail.com> writes:

> Thanks.  Looks good to me.

Can someone install this?

> ps: You don't have to send a bzr bundle.  Maintainers don't insist on
> it.  The presence of ChangeLog diffs in my work area led to workarea
> conflicts and made my life very difficult when 'bzr update-d'.

The manual doesn't call for a bzr merge directive, but I'm pretty sure
it asks for the patch submitter to include the ChangeLog entry in the
patch.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15854; Package emacs. (Tue, 12 Nov 2013 14:00:04 GMT) Full text and rfc822 format available.

Message #17 received at 15854 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Nathan Trapuzzano <nbtrap <at> nbtrap.com>
Cc: 15854 <at> debbugs.gnu.org, Jambunathan K <kjambunathan <at> gmail.com>
Subject: Re: bug#15854: 24.3.50;
 cperl-mode: Support for outlining (much like that in perl-mode)
Date: Tue, 12 Nov 2013 08:59:33 -0500
> The manual doesn't call for a bzr merge directive, but I'm pretty sure
> it asks for the patch submitter to include the ChangeLog entry in the
> patch.

A bzr bundle is fine, yes.  A patch with the ChangeLog inside is fine.
A patch with a ChangeLog alongside is fine.
A patch without ChangeLog is suboptimal, but it's pretty good as well.


        Stefan




Reply sent to Jambunathan K <kjambunathan <at> gmail.com>:
You have taken responsibility. (Fri, 15 Nov 2013 05:16:03 GMT) Full text and rfc822 format available.

Notification sent to Jambunathan K <kjambunathan <at> gmail.com>:
bug acknowledged by developer. (Fri, 15 Nov 2013 05:16:04 GMT) Full text and rfc822 format available.

Message #22 received at 15854-done <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: 15854-done <at> debbugs.gnu.org
Subject: Re: bug#15854: 24.3.50;
 cperl-mode: Support for outlining (much like that in perl-mode)
Date: Fri, 15 Nov 2013 10:44:54 +0530
OP here.  Closed.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15854; Package emacs. (Fri, 15 Nov 2013 11:31:01 GMT) Full text and rfc822 format available.

Message #25 received at 15854 <at> debbugs.gnu.org (full text, mbox):

From: Nathan Trapuzzano <nbtrap <at> nbtrap.com>
To: 15854 <at> debbugs.gnu.org
Cc: kjambunathan <at> gmail.com
Subject: Re: bug#15854: 24.3.50;
 cperl-mode: Support for outlining (much like that in perl-mode)
Date: Fri, 15 Nov 2013 06:30:30 -0500
Jambunathan K <kjambunathan <at> gmail.com> writes:

> OP here.  Closed.

This patch hasn't been installed yet.  No reason to close it.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 13 Dec 2013 12:24:22 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 193 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.