From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nathan Trapuzzano Newsgroups: gmane.emacs.bugs Subject: bug#15848: 24.3.50; cperl-mode + which-function: Improve reporting (corner case) Date: Sun, 10 Nov 2013 11:48:50 -0500 Message-ID: <87d2m8w6bx.fsf@nbtrap.com> References: <87d2m8pwts.fsf@gmail.com> <87d2m8bhk1.fsf@nbtrap.com> <87iow0quc6.fsf@gmail.com> <87bo1squ1q.fsf@gmail.com> <87ob5sw8zm.fsf@nbtrap.com> <87txfkp6si.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1384102214 18159 80.91.229.3 (10 Nov 2013 16:50:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Nov 2013 16:50:14 +0000 (UTC) Cc: 15848@debbugs.gnu.org To: Jambunathan K Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 10 17:50:19 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VfYDK-0008Ib-GA for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Nov 2013 17:50:18 +0100 Original-Received: from localhost ([::1]:60873 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfYDK-0001iB-3x for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Nov 2013 11:50:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55994) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfYDA-0001hN-QT for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2013 11:50:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VfYD4-0001Hf-M0 for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2013 11:50:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59933) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VfYD4-0001GU-EY for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2013 11:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VfYD3-0007pi-Sn for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2013 11:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Nathan Trapuzzano Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Nov 2013 16:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15848 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15848-submit@debbugs.gnu.org id=B15848.138410216230052 (code B ref 15848); Sun, 10 Nov 2013 16:50:01 +0000 Original-Received: (at 15848) by debbugs.gnu.org; 10 Nov 2013 16:49:22 +0000 Original-Received: from localhost ([127.0.0.1]:45719 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VfYCP-0007od-8b for submit@debbugs.gnu.org; Sun, 10 Nov 2013 11:49:21 -0500 Original-Received: from oproxy9-pub.mail.unifiedlayer.com ([69.89.24.6]:34936) by debbugs.gnu.org with smtp (Exim 4.80) (envelope-from ) id 1VfYC7-0007oD-NJ for 15848@debbugs.gnu.org; Sun, 10 Nov 2013 11:49:19 -0500 Original-Received: (qmail 24677 invoked by uid 0); 10 Nov 2013 16:49:01 -0000 Original-Received: from unknown (HELO host393.hostmonster.com) (66.147.240.193) by oproxy9.mail.unifiedlayer.com with SMTP; 10 Nov 2013 16:49:01 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbtrap.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=3ywhOBuqNZahqkZlTRxcnRF5yo1Ux3qsQQeeHGj1Kdg=; b=q/Sha4H//TjxOO6pBjU39QOWd9V0C/PeoaWa4CZBCt0m+QW0YIg4wgNhZoPz59gEqdclyy0jXFPZVF1p96Mr2wn+DOi2ikVIXoJKlQaRImRsszhI3B41jOpbWAbht8ez; Original-Received: from [50.90.253.209] (port=54894 helo=Nathan-GNU) by host393.hostmonster.com with esmtpsa (TLSv1:CAMELLIA128-SHA:128) (Exim 4.80) (envelope-from ) id 1VfYC4-0004Uj-KU; Sun, 10 Nov 2013 09:49:01 -0700 In-Reply-To: <87txfkp6si.fsf@gmail.com> (Jambunathan K.'s message of "Sun, 10 Nov 2013 21:50:45 +0530") User-Agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3.50 (gnu/linux) X-Identified-User: {1585:host393.hostmonster.com:nbtrapco:nbtrap.com} {sentby:smtp auth 50.90.253.209 authed with nbtrap@nbtrap.com} X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:80222 Archived-At: --=-=-= Content-Type: text/plain Jambunathan K writes: > perl-mode behaves differently and correctly. I think you've misunderstood. cperl-mode does exactly what it's supposed to do, which is more than what perl-mode tries to do. > Is it possible to show the sub name when within a function and show > the head1 or head2 string when within a perldoc string. (I am new to > perl so I can talk only fuzzily about the language or it's features) It's not really feasible, though it has nothing to do with Perl per se. Like I said before, the "function" name displayed by which-function-mode is the function containing point or, if none, the nearest function before point. In cperl-mode pod =head directives count for this purpose as "functions", and regular subroutines begin at the position following their name. > My gut feeling is that the way cperl mode treats POD directives also > limits it from doing outlining. After a brief skim of the cperl source, I had the opposite impression. > I would really like to get outlining work when in cperl-mode. I'll take a look at that later. With luck, it'll be as easy as this one. > I think anything that doesn't show "= " would do for me. Again, the "= " means that the "current function" (according to the above definition) is a pod =head directive. Try the attached patch. Make sure you set cperl-imenu-index-pod to nil before invoking cperl-mode. If it does what you want, we can ask for it to be installed. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=cperl-mode.patch # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: nbtrap@nbtrap.com-20131110162047-2pqh1c9up17hfzkd # target_branch: file:///home/nathan/opt/etc/bzr-repos/emacs/trunk/ # testament_sha1: fd4a0d8284f9bbda92ca8a31dc190cfa3b8adb78 # timestamp: 2013-11-10 11:41:32 -0500 # base_revision_id: jan.h.d@swipnet.se-20131110121803-bv908hul7t8ji6c8 # # Begin patch === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-10 08:35:04 +0000 +++ lisp/ChangeLog 2013-11-10 16:20:47 +0000 @@ -1,3 +1,10 @@ +2013-11-10 Nathan Trapuzzano + + * progmodes/cperl-mode.el (cperl-imenu-index-pod) + (cperl-imenu--create-perl-index): Define and implement + `cperl-imenu-index-pod' to optionally disable cperl's indexing of + POD directives for imenu. (Bug#15848) + 2013-11-10 Michael Albinus * net/tramp.el (tramp-methods): === 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-10 16:15:36 +0000 @@ -511,6 +511,13 @@ :type 'boolean :group 'cperl-help-system) +(defcustom cperl-imenu-index-pod t + "*Whether POD `=head' directives should be indexed by imenu. +Non-nil means `which-function-mode' won't count POD directives as +top-level definitions." + :type 'boolean + :group 'cperl-help-system) + (defcustom cperl-max-help-size 66 "*Non-nil means shrink-wrapping of info-buffer allowed up to these percents." :type '(choice integer (const nil)) @@ -844,7 +851,8 @@ interactive sweep over the buffer); d) Has support for imenu, including: 1) Separate unordered list of \"interesting places\"; - 2) Separate TOC of POD sections; + 2) Separate TOC of POD sections by default + (cf. `cperl-imenu-index-pod'); 3) Separate list of packages; 4) Hierarchical view of methods in (sub)packages; 5) and functions (by the full name - with package); @@ -5551,7 +5559,7 @@ (push index index-alist)) (if meth (push index index-meth-alist)) (push index index-unsorted-alist))) - ((match-beginning 16) ; POD section + ((and cperl-imenu-index-pod (match-beginning 16)) ; POD section (setq name (buffer-substring (match-beginning 17) (match-end 17)) marker (make-marker)) (set-marker marker (match-beginning 17)) # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWXtrJDAABhbfgAA02PP//38F zID////wYAn9sU+alUAKAhqtgrKoADQKhJITQRpNPQGJkyRoJhqABoMgBJTQJpkaBNEmJqGQ9I0B oAAAOYBMBMjACMTEwmEwQ0xNMCJlNGpoYmRoGJ6g0xAA0yaaAAOYBMBMjACMTEwmEwQ0xNMAqSRG IAjQNSeNTFMNAU09R6h6mmT0T1BMuINEW/xgOa1cQhUAEQAaQg6P1BQQyhQDx0mSkUESuitzKMnM BUcsMNX+BogwchDB5UJxbIJA/F79D5E8J968ywCAZWWl0kD5H4sf96NuoPop0yGYTMzDNs+wiuAS gyq0vfq8pXQUE5RsljIoM9q4DojPcnbM4agbrbzKcxfhfXoRyIvtuHDFYzEB7vzlu7/f38SoeZDX EGa0P4gKhZTUqHkFPdlhAPbRgMicePAopl/rlVjjbj18FVoW9PYJubsm9OiHRm4e0RCaaeEjIRTF GkaCzYDjl49r+4Y4zU29Ltnfu3ZJf3ptcBpHuOCWfD0z79ZvkHJMjejTzI9tp+nCFzZ6D3FiZI2r 1xmLPInht60eZjlN/Fb2+/pbvXzzzuWARur6CN1ws/INb17/Xh0xZmZmZm6qNEE3dkuLsiz1VmJw LFuyhF10gy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