     (if (empty? errs)
       (do
         (search-dirs (get-search-dirs settings) settings)
-        []
-      )
-      errs
-    )
-  )
-)
-
+        [])
+      errs)))

            nextlinesafter
              (if (> (:linesafter settings) 0)
                (concat (rest linesafter) (take 1 lines))
                [])
            ]
          ; (if (not (empty? nextresults))
          ;   (do
          ;     (log-msg "nextresults:")
          ;     (log-msg nextresults)))
          (search-lines nextlinenum nextline (rest lines) nextlinesbefore
            nextlinesafter (concat results nextresults) settings)
      )
      results
    )
  )
)

(defn search-text-file-lines [f settings]
  (with-open [rdr (reader f)]

                       line
                       linesbefore
                       linesafter)]
          (search-line-for-pattern linenum line linesbefore linesafter m
            endmatchindex (concat results [result]) settings)))
      results)))

(defn search-line [linenum line linesbefore linesafter settings]
