 ;; Author: Dan Harms <danielrharms@gmail.com>
 ;; Created: Wednesday, June  1, 2016
 ;; Version: 1.0
-;; Modified Time-stamp: <2016-06-14 17:55:08 dharms>
+;; Modified Time-stamp: <2016-06-16 07:52:53 dharms>
 ;; Modified by: Dan Harms
 ;; Keywords: c++ namespace
 

  "Scan current buffer for all namespaces.
Store in result `outre-list'."
  (interactive)
  (setq outre-list (outre--scan-all-ns)))

;;;###autoload
(defun outre-goto-namespace-next ()


(defun outre--find-enclosing-ns ()
  "Return the namespace around point, if any."
  (save-excursion
    (let* ((pt (point))
           (beg (outre--find-ns-previous))
           (ns (and beg (outre-parse-namespace beg))))
      (and ns (outre--get-distance-from-begin pt ns) ns))))

(defun outre-change-enclosing-ns-name ()
  "Change the name of the enclosing namespace, if one exists."
  (interactive)
  (let ((ns (outre--find-enclosing-ns))
        start end name)
    (if ns
        (progn
          (setq name
                (read-string
                 (concat "Change namespace "
                         (car (outre--get-ns-names ns))
                         " to: ")))
          (setq start (car (outre--get-ns-name-pos ns)))
          (setq end (cadr (outre--get-ns-name-pos ns)))
          (delete-region start end)
          (goto-char start)
          (insert name)
          ;; todo: change comment after ending delimiter
          )
      (message "No enclosing namespace"))))

(defun outre-jump-to-ns (ns)
  "Jump to the beginning of namespace NAME."
