Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • But as time goes by I get less inclined to. POD gets written down after the __END__ and the module gets written up in learning order, but in the body of the code, stuff falls where it will (usually near to where it got extracted from) and etags claims its own.

    If I'm coding in Ruby, it goes 'public, protected, private' (and when I do sort perl methods, that's the kind of gradient I go with as well, even though perl doesn't make those distinctions.)

    • Same.  Between etags and imenu (*), I can find things quickly enough without putting them in any particular order.

      PS -- Thanks to use.perl's craptastic version of "HTML formatted," which doesn't allow PRE or some equivalent, the only way to post code seems to be to post the whole thing as "Code."

      (* with some help)

      (defun my-imenu-fixup (list)
        (mapcan (lambda (x) (if (consp (cdr x)) (my-imenu-fixup (cdr x)) (list x)))

      (defun uniquify (list)
        (let ((h (make-hash-table :test 'equal)))
          (dolist (x list)
            (puthash x t h))
          (hash-table-keys h)))

      (autoload 'imenu--make-index-alist "imenu" nil t)

      (defun my-imenu-jump-to-function ()
      "Jump to a function found by Imenu within the current buffer with
      ido-style completion.  NOTE: if a mode's imenu function does
      something fancy (e.g. cperl's), this function breaks horribly."
        (let* ((tmp (uniquify
                       (lambda (x)
                         (or (string= "*Rescan*" (car x))
                             (and (member major-mode '(cperl-mode sepia-mode))
                                  (or (string= "+Unsorted List+..." (car x))
                                      (string= "+POD headers+..." (car x))))))
                       (save-excursion (imenu--make-index-alist))))))
               (thing (assoc (my-icompleting-read "Go to: " (mapcar #'car tmp))
          (when thing
            (funcall imenu-default-goto-function (car thing) (cdr thing))

      (defun my-icompleting-read (prompt choices)
        "Like `ido'.  Hard to describe."
        (or ido-buffer-completion-map (ido-init-completion-maps))
        (flet ((ido-make-buffer-list (default)
                 (setq ido-temp-list choices)))
          ;; XXX - why do I have to do this?
          (let (minibuffer-setup-hook)
            (add-hook 'minibuffer-setup-hook 'ido-minibuffer-setup)
            ;; (ido-setup-completion-map)
            (ido-read-buffer prompt))))
      • ... or >ecode<

        • Heh. I tried the standard HTML tags [] "PRE" and "CODE," but didn't think to add an "e." I assume the rationale is something like "it's better break our 'HTML formatted' by adding an 'e' to the tag name than to break it by rendering 'CODE' or 'PRE' in a way that differs from the standard." There are levels of suck to which the only appropriate response is to point and laugh.