unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Nathan Trapuzzano <nbtrap@nbtrap.com>
To: Jambunathan K <kjambunathan@gmail.com>
Cc: 15854@debbugs.gnu.org
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	[thread overview]
Message-ID: <87d2m61htj.fsf@nbtrap.com> (raw)
In-Reply-To: <874n7kaa9t.fsf@gmail.com> (Jambunathan K.'s message of "Sun, 10 Nov 2013 14:44:38 +0530")

[-- Attachment #1: Type: text/plain, Size: 144 bytes --]

Jambunathan K <kjambunathan@gmail.com> writes:

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

Try the attached patch and let me know.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: cperl-mode.el.patch --]
[-- Type: text/x-diff, Size: 4878 bytes --]

# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: nbtrap@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@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@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@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
 
 \f
 (defun cperl-windowed-init ()

# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWWu4kq8AA4BfgGAwWP///9sF
FAX/7//0YAbulL4FAFRCgAAENEamQU9T0ngk8U8o2KaeoPUaDQNPU9QAcwCYCZGAEYmJhMJghpia
YHMAm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reply	other threads:[~2013-11-12  2:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-10  9:14 bug#15854: 24.3.50; cperl-mode: Support for outlining (much like that in perl-mode) Jambunathan K
2013-11-12  2:20 ` Nathan Trapuzzano [this message]
2013-11-12  4:31   ` Jambunathan K
2013-11-12 11:29     ` Nathan Trapuzzano
2013-11-12 13:59       ` Stefan Monnier
2013-11-15  5:14 ` Jambunathan K
2013-11-15 11:30   ` Nathan Trapuzzano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d2m61htj.fsf@nbtrap.com \
    --to=nbtrap@nbtrap.com \
    --cc=15854@debbugs.gnu.org \
    --cc=kjambunathan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).