 ;;             (tagval (jpw-phpBB-get-tag-at tagspec))
 ;;             )
 ;;       (message tagval))))
-(defun phpBB-test-find-nested-quotes ()
-  (interactive)
-  (save-excursion
-    (goto-char (point-min))
-    (phpBB-find-nested-quotes (point-max))
-    ))
+;; (defun phpBB-test-find-nested-quotes ()
+;;   (interactive)
+;;   (save-excursion
+;;     (goto-char (point-min))
+;;     (phpBB-find-nested-quotes (point-max))
+;;     ))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;



(defun phpBB-find-nested-quotes (upper-limit)
  ;; Leave docstring blank; use doc-comments, instead.

  ;; Examines region between `point' and `upper-limit', looking for all
  ;; multiply-nested quotes.  Highlights any quote-tag with internal quote-tags

  ;; We have two cases we need to deal with:
  ;; 1. We're starting afresh, from the bobp.
  ;; 2. We're starting inside of a tag, one already fontified.  The immediate
  ;;    enclosing tag *may* be a quote.  Or, it may not.  We dunno.


  ;; This only works with the first case.  it may not work with the second
  ;; case. 
  (let* (tag-end-pos
         quote-match-data
         );; end var defs

    (if (bobp) (setq phpBB-nested-quote-level 0))

    (and
     (re-search-forward "\\[/?quote" upper-limit t)
     (setq quote-match-data (list (match-beginning 0) nil))
     (goto-char (match-beginning 0))
     (cond
      ((looking-at phpBB-re-quote-start)
       (nconc quote-match-data 
              (list (match-beginning 1) (match-end 1)
                    (match-beginning 3) (match-end 3)
                    )
              )
       (setq phpBB-nested-quote-level (1+ phpBB-nested-quote-level))
       t
       );;end quote-start case
      ((looking-at phpBB-re-quote-end)
       (nconc quote-match-data 
              (list (match-beginning 0) (match-end 0)
                    nil nil)
              )
       (setq phpBB-nested-quote-level (1- phpBB-nested-quote-level))
       t
       );;end quote-end case
      );;end cond

     ;; Only reaches here if the `cond' was true
     (goto-char (match-end 0))
     (setq tag-end-pos (point))
     ;; Look for the next quote-tag.
     (if (and (> phpBB-nested-quote-level 0)
              (re-search-forward "\\[/?quote" upper-limit t)
              )
         (progn
           (if (> phpBB-nested-quote-level 1)
               (nconc quote-match-data 
                      (list nil nil
                            tag-end-pos (match-beginning 0)
                            )
                      )
             ;; else
             (nconc quote-match-data 
                    (list tag-end-pos (match-beginning 0)
                          nil nil)
                    )
             );; end if quote-level
           (setcar (cdr quote-match-data) (match-beginning 0))
           (goto-char (match-beginning 0))
           );;end progn
       ;;else
       ;; No more quote tags.  Reset the quote-level.
       (setq phpBB-nested-quote-level 0)
       (setcar (cdr quote-match-data) tag-end-pos)
       );end if
     (or (set-match-data quote-match-data) t)
     (message "found: %S" (match-data))
     );; end and
    );; end let
  )

        );;end list
  )

(defconst phpBB-font-lock-keywords-2-common
  (append phpBB-font-lock-keywords-1
          (list phpBB-font-lock-size-face-key-2
                phpBB-font-lock-string-face-key-2
                );;end list
          );;end append
  )
(defconst phpBB-font-lock-keywords-2
  (append phpBB-font-lock-keywords-2-common
          (list phpBB-font-lock-quote-face-key-2)
          );;end append
  )

(defconst phpBB-font-lock-keywords-3
  (append phpBB-font-lock-keywords-2-common
          (list phpBB-font-lock-list1-face-key-3
                phpBB-font-lock-list2-face-key-3
                phpBB-font-lock-multi-quote-face-key-3
                ;; The phpBB-font-lock-multi-quote-face-key-3 successfully
                ;; fontifies plain quotes, too.  So, we don't need it here.
                phpBB-font-lock-code-face-key-3
                phpBB-font-lock-color-face-key-3
                phpBB-font-lock-url-face-key-3
