                 (buffer-substring (point) funcend)))))
     (when (and (> linestart parenopen) linesym funcsym)
       (setq funcsym nil))
-    (or exprsym funcsym linesym "nothing found")))
+    (replace-regexp-in-string ":$" "" (or exprsym funcsym linesym "nothing found"))))
 
 (defun zomp-symbol-at-point ()
   (let ((w (word-at-point)))


(defun zomp-goto-definition ()
  (interactive)
  (let (symbol doc-line source-location file line)
    (setq symbol (zomp-symbol-at-point))
    (unless symbol
      (error "No symbol at point"))
    (save-excursion
      (zomp-build-symbol-buffer)
      (setq doc-line (zomp-get-doc-line-for-symbol symbol))
      (unless doc-line
        (error "Symbol \"%s\" is not defined anywhere" symbol))
      (unless (string-match ".* @\\([a-zA-Z_0-9\\./-]*\\):\\([0-9]+\\)" doc-line)
        (error "Symbol \"%s\" does not have location info" symbol))
      (setq file (match-string 1 doc-line))
      (setq line (string-to-int (match-string 2 doc-line)))
      (message "Symbol is at file %s line %s" file line))
    (if (equal "builtin" file)
        (message "Symbol %s is a compiler built-in" symbol)
      (ring-insert find-tag-marker-ring (point-marker))
      (find-file-existing file)
      (goto-line line)
      (recenter))))

(defun zomp-get-doc-line-for-symbol (symbol)
  (condition-case nil
      (save-excursion
        (set-buffer (get-buffer-create zomp-symbol-buffer))
        (goto-char (point-max))
        (search-backward-regexp (concat "^" symbol " ="))
        (search-forward " =")
        (let ((startpos (point)))
          (end-of-line)
          (concat symbol ": " (buffer-substring startpos (point)))))
    (error nil)))

(defun zomp-get-short-doc-for-symbol (symbol)
  (let ((docline (zomp-get-doc-line-for-symbol symbol)))
    (replace-regexp-in-string " @.*" "" docline)))

(defun zomp-get-eldoc-string ()
  (let ((symbol "???"))
    (ignore-errors
      (save-excursion
        (zomp-build-symbol-buffer)
        (zomp-get-short-doc-for-symbol (zomp-symbol-at-point))))))

(defun zomp-region-to-html (regbegin regend)
  "Will replace the current region with html. Requires a matching

  ;; display documentation for methods/macros/... in status line
  (set (make-local-variable 'eldoc-documentation-function) 'zomp-get-eldoc-string)
  (eldoc-mode t)
  (make-variable-buffer-local 'ac-sources)
  (add-to-list 'ac-sources 'zomp-ac-source)
  (ignore-errors
    (auto-complete-mode 1))

  ;; auto indenting
  (setq indent-line-function 'zomp-indent-line)
