From 0a9a992e818b56136ab1ae0efbb2331dbf02c6e1 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 27 Dec 2017 00:49:08 -0500 Subject: [PATCH] lang/cc: remove +cc|init-rtags-server-maybe The rtags-start-process-unless-running function does exactly the same thing, making +cc|init-rtags-server-maybe redundant. Relevant to #305 --- modules/lang/cc/config.el | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/modules/lang/cc/config.el b/modules/lang/cc/config.el index 75c26cbed..aa5021713 100644 --- a/modules/lang/cc/config.el +++ b/modules/lang/cc/config.el @@ -204,27 +204,16 @@ compilation database is present in the project.") ;; ...and don't auto-jump to first match before making a selection. rtags-jump-to-first-match nil) - (defun +cc|init-rtags-server-maybe () - "Start the rtags server if it isn't already running." - (unless (or (processp rtags-rdm-process) - (cl-loop for proc in (list-system-processes) - for cmd = (cdr (assq 'args (process-attributes proc))) - if (string-match-p "/rdm\\_>" cmd) - return t)) - (message "Starting rtags server") - (rtags-start-process-unless-running) - ;; Emacs-spawned rdm should be temporary - (add-hook! kill-emacs (ignore-errors (rtags-cancel-process))))) - (let ((bins (cl-remove-if-not #'executable-find '("rdm" "rc")))) (if (/= (length bins) 2) (warn "cc-mode: couldn't find %s, disabling rtags support" bins) - (add-hook! (c-mode c++-mode) #'+cc|init-rtags-server-maybe) + (add-hook! (c-mode c++-mode) #'rtags-start-process-unless-running) (set! :jump '(c-mode c++-mode) :definition #'rtags-find-symbol-at-point :references #'rtags-find-references-at-point))) (add-hook 'doom-cleanup-hook #'rtags-cancel-process) + (add-hook! kill-emacs (ignore-errors (rtags-cancel-process))) ;; Use rtags-imenu instead of imenu/counsel-imenu (map! :map (c-mode-map c++-mode-map) [remap imenu] #'rtags-imenu)