Skip to content

Commit

Permalink
global, enh: set a timeout on citre-global-dbpath
Browse files Browse the repository at this point in the history
This is a workaround for #163. See also #150.
  • Loading branch information
AmaiKinono committed Jan 14, 2024
1 parent 68b99c3 commit a900987
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions citre-global.el
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,15 @@ as global program is needed to get the database path."
(_ (let ((default-directory (or dir default-directory)))
(condition-case nil
(setq citre--global-dbpath
(car (citre-global--get-output-lines
'("--print-dbpath"))))
;; Several users have reported that global runs forever in
;; certain occasions, and it seems to have something to do
;; with org-mode, see
;; https://github.com/universal-ctags/citre/issues/163 and
;; https://github.com/universal-ctags/citre/issues/150.
;; This is a workaround.
(with-timeout (1 nil)
(car (citre-global--get-output-lines
'("--print-dbpath")))))
(error (setq citre--global-dbpath 'none)
nil)))))))

Expand Down

0 comments on commit a900987

Please sign in to comment.