Skip to content

Commit

Permalink
define before use
Browse files Browse the repository at this point in the history
  • Loading branch information
jhanssen committed Jun 13, 2016
1 parent 0eccb78 commit 65676cf
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions src/rtags.el
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,23 @@ prepare completions."
:type '(choice (const :tag "Unset" nil) number)
:safe 'numberp)

(defun rtags--update-periodic-reparse-timer ()
(when (and (not rtags-periodic-reparse-timer)
rtags-periodic-reparse-timeout)
(setq rtags-periodic-reparse-timer
(run-with-idle-timer rtags-periodic-reparse-timeout t
#'rtags-reparse-file-if-needed nil t))))

(defvar rtags-periodic-reparse-timer nil)
;;;###autoload
(defun rtags-set-periodic-reparse-timeout (time)
"Set `rtags-periodic-reparse-timeout' to TIME."
(interactive "P")
(when rtags-periodic-reparse-timer
(cancel-timer rtags-periodic-reparse-timer))
(setq rtags-periodic-reparse-timeout (if time (abs time) time))
(setq rtags-periodic-reparse-timer nil)
(rtags--update-periodic-reparse-timer))

(defcustom rtags-periodic-reparse-timeout nil
"Interval, in seconds, for async idle parsing of unsaved buffers.
Expand Down Expand Up @@ -3928,24 +3945,6 @@ force means do it regardless of rtags-enable-unsaved-reparsing "
((= rtags-completions-timer-interval 0) (rtags-prepare-completions))
(t (setq rtags-completions-timer (run-with-idle-timer rtags-completions-timer-interval nil #'rtags-prepare-completions)))))

(defvar rtags-periodic-reparse-timer nil)
;;;###autoload
(defun rtags-set-periodic-reparse-timeout (time)
"Set `rtags-periodic-reparse-timeout' to TIME."
(interactive "P")
(when rtags-periodic-reparse-timer
(cancel-timer rtags-periodic-reparse-timer))
(setq rtags-periodic-reparse-timeout (if time (abs time) time))
(setq rtags-periodic-reparse-timer nil)
(rtags--update-periodic-reparse-timer))

(defun rtags--update-periodic-reparse-timer ()
(when (and (not rtags-periodic-reparse-timer)
rtags-periodic-reparse-timeout)
(setq rtags-periodic-reparse-timer
(run-with-idle-timer rtags-periodic-reparse-timeout t
#'rtags-reparse-file-if-needed nil t))))

(defun rtags-code-complete-enabled ()
(and rtags-completions-enabled
(memq major-mode rtags-supported-major-modes)
Expand Down

0 comments on commit 65676cf

Please sign in to comment.