~rgrjr/rgr-hacks

1bf2d97dd15285ad86deff16247c1dde7fd8337e — Bob Rogers 9 months ago c407f7b
Handle subheads in Perl POD method doc

* rgr-perl-hacks.el:
   + (rgr-perl-update-method-documentation):  Bug fix:  Handle subheads
     within method documentation gracefully.  Previously, they would be
     treated as oddly-named methods, which fails when they sort badly.
1 files changed, 15 insertions(+), 6 deletions(-)

M rgr-perl-hacks.el
M rgr-perl-hacks.el => rgr-perl-hacks.el +15 -6
@@ 2,7 2,7 @@
;;;
;;;; Hacking perl mode.
;;;
;;; Copyright (C) 1996-2011  Robert G. Rogers Jr
;;; Copyright (C) 1996-2024  Robert G. Rogers Jr
;;;
;;; This file is not part of GNU Emacs, but it customizes perl-mode, which is.
;;; Accordingly, it is distributed under the same terms as GNU Emacs:


@@ 633,11 633,20 @@ and too impatient to wait.  -- rgr, 1-Jul-13.]")
			  ;; defined-names.  -- rgr, 12-Nov-19.]
			  (not (eobp)))
		(let* ((name (car tail))
		       (name-regexp (format "\n=head3 %s\n" name)))
		  (while (and (looking-at "\n=head3 \\(.+\\)\n")
			      (string-lessp (match-string 1) name))
		    (let ((new-name (match-string-no-properties 1)))
		      (unless (or (= (aref new-name 0) ?_)
		       (name-regexp (format "\n=head3 %s\n" name))
		       (level 0))
		  (while (and (looking-at "\n=head\\([0-9]\\) \\(.+\\)\n")
			      (setq level (string-to-int (match-string 1)))
			      ;; Keep going past subheadings, or if we're
			      ;; alphabetically before the name of interest.
			      ;; (We don't worry about documented names that
			      ;; aren't defined in the code; they may be for API
			      ;; methods that have no default implementation.)
			      (or (> level 3)
				  (string-lessp (match-string 2) name)))
		    (let ((new-name (match-string-no-properties 2)))
		      (unless (or (> level 3)
				  (= (aref new-name 0) ?_)
				  (member (intern new-name)
					  rgr-perl-sub-names-to-ignore))
			(message "%s is no longer implemented, %s"