Skip to content

Commit

Permalink
Partial fix for issue Andersbakken#779. Make sure file exists before …
Browse files Browse the repository at this point in the history
…returning a

non-nil rtags-buffer-status
  • Loading branch information
Andersbakken committed Sep 2, 2016
1 parent 769681e commit 8da84a5
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/rtags.el
Original file line number Diff line number Diff line change
Expand Up @@ -3099,12 +3099,11 @@ This includes both declarations and definitions."

(defun rtags-buffer-status (&optional buffer)
(when rtags-enabled
(let ((path (expand-file-name (cond ((and (buffer-file-name buffer)
(file-exists-p (buffer-file-name buffer)))
(buffer-file-name buffer))
(dired-directory)
(default-directory)
(t nil)))))
(let* ((fn (buffer-file-name buffer))
(path (expand-file-name (cond (fn (and (file-exists-p fn) fn))
(dired-directory)
(default-directory)
(t nil)))))
(with-temp-buffer
(rtags-call-rc :noerror t :silent-query t :path path "-T" path)
(goto-char (point-min))
Expand Down

0 comments on commit 8da84a5

Please sign in to comment.