 ; SyntaxHighlighter brushes are associated with files if the language is
 ; supplied or can be worked out from the file suffix.
 (defn maybe-associate-brush [path lang]
-  (when-let [b (and lang (second (languages lang)))]
+  (when-let [b (and lang (lang-brush lang))]
     (when-not (@*brushes* b)
       (message "Associating "path " with brush " b)
       (swap! *brushes* conj b))))

                            :static-brushes (:brush amap)
                            :verbose? (:verbose amap)}
                *single-comment* (:comment amap)
                *language* (or (:language amap) *language*)]

; When no output file is given, the program renders to standard-out.
        (if (= 1 (count tail))

                       (rest ll)))
             (if c (int c) -1))))))))

(defmulti code-anchor-id (fn [_ _] *language*) :default :default)

(defmethod code-anchor-id :clojure [line reader]
  (when (re-find #"^\(" line)
    (let [code (read reader)]
      (and (re-find #"^def" (str (first code)))
           (second code)))))

(defmethod code-anchor-id :vim [line reader]
  (second (re-find #"^function!?\s+([a-zA-Z_][a-zA-Z_0-9]+)" line)))

(defmethod code-anchor-id :default [_ _] nil)

(defn maybe-code-anchor [line reader]
  (if-let [id (code-anchor-id line reader)]
    [[:anchor (str *path* "/" id)]]
    []))

; Each line of a source file will be either code, comment, anchor, or include.
; Headings are treated as both anchors and comments.
