bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#15854: 24.3.50; cperl-mode: Support for outlining (much like that in


From: Nathan Trapuzzano
Subject: 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
User-agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3.50 (gnu/linux)

Jambunathan K <address@hidden> writes:

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

Try the attached patch and let me know.

# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: address@hidden
# 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: address@hidden
#   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  <address@hidden>
+
+       * progmodes/cperl-mode.el (cperl-outline-regexp)
+       (cperl-outline-level): Fix outline level detection bug.  (Bug#15854)
+
 2013-11-11  Stefan Monnier  <address@hidden>
 
        * 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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