 {jpw: 03/2005}"
   (interactive)
   (save-excursion
-    (let* ((posn-pair-stack (list (jpw-phpBB-tag-find-enclosing nil nil t)))
-         );;end var defs
+    (let* ((posn-pair-stack '())
+           (current-tag (jpw-phpBB-tag-find-enclosing nil nil t))
+           );;end var defs
+      (while (car current-tag)
+        (setq posn-pair-stack (append posn-pair-stack (list current-tag)))
+        (setq current-tag 
+              (jpw-phpBB-tag-find-enclosing (1- (caadr current-tag))
+                                            (1+ (cadadr current-tag))
+                                            t))
+        )
       (message "%S" posn-pair-stack)
       );;end let
     );;end excursion

  )


;; TODO:
;; Refactor `jpw-phpBB-tag-*' to be tag-blind.  Specifically, refactor
;; anything that references a phpBB tag vs. and XML tag out into separate
;; variables and/or functions.
;; Can be done as a defconst so it compiles into the functions.


(defsubst jpw-phpBB-tag-find-last (&optional pos)
  "Searches backward from `pos' (defaults to `point') for the nearest phpBB
tag.  Returns a list of the form:

    (progn
      (setq phpBB-mode-map (make-sparse-keymap))
      ;;(define-key phpBB-mode-map "\M-\"" 'phpBB-unfill-paragraphs)

      (define-key phpBB-mode-map "\C-c\C-s" 'jpw-phpBB-tag-analysis)

      (define-key phpBB-mode-map "\M-g\M-[i" 'phpBB-insert-italic)
      (define-key phpBB-mode-map "\M-pi" 'phpBB-insert-italic)
