Skip to content

Commit

Permalink
Mark rtags-start-process-maybe as obsolete and add some more document…
Browse files Browse the repository at this point in the history
…ation.
  • Loading branch information
casch-at committed Mar 3, 2016
1 parent 1378b33 commit dbf1ca3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
32 changes: 24 additions & 8 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,23 @@ $ rc --follow-location Job.cpp:20:10
* Elisp
There are lots of interactive functions to call:

#+BEGIN_SRC sh
#+BEGIN_SRC emacs-lisp
(rtags-start-process-unless-running)
#+END_SRC
Start the =rdm= process unless the process is already running. You may create hook to
automatically call this function upon entering, e.g. c-mode or c++mode.
For example:
#+BEGIN_SRC emacs-lisp
(add-hook 'c-mode-common-hook 'rtags-start-process-unless-running)
(add-hook 'c++-mode-common-hook 'rtags-start-process-unless-running)
#+END_SRC

#+begin_src emacs-lisp
(rtags-restart-process)
#+end_src
Restart the =rdm= process.

#+BEGIN_SRC emacs-lisp
(rtags-find-symbol-at-point)
#+END_SRC

Expand All @@ -444,13 +460,13 @@ file, limit to the narrowed region. This prefix argument is the same
for: =rtags-find-references-at-point=, =rtags-find-symbol=,
=rtags-find-references=

#+BEGIN_SRC sh
#+BEGIN_SRC emacs-lisp
(rtags-find-references-at-point)
#+END_SRC
Find all references to symbol under cursor. If symbol is itself a
reference it will find all references to the referenced symbol

#+BEGIN_SRC sh
#+BEGIN_SRC emacs-lisp
(rtags-find-symbol)
#+END_SRC
Prompt for name of symbol to go to. Imagine the following code:
Expand Down Expand Up @@ -730,19 +746,19 @@ to work.
following:
...TODO...
* RTags Flycheck integration
To turn on RTags Flycheck support you need to load the `flycheck-rtags` package.
#+begin_src emacs-lisp
To turn on RTags Flycheck support you need to load the =flycheck-rtags= package.
#+BEGIN_SRC emacs-lisp
(require 'flycheck-rtags)
#+end_src
#+END_SRC
** Optional
You may explicitly select the RTags Flycheck checker for some major modes, it
will than be the preferred syntax checker for the major mode.
#+begin_src emacs-lisp
#+BEGIN_SRC emacs-lisp
(defun my-flycheck-rtags-setup ()
(flycheck-select-checker 'rtags))
(add-hook 'c-mode-common-hook 'my-flycheck-rtags-setup)
(add-hook 'c++-mode-common-hook 'my-flycheck-rtags-setup)
#+end_src
#+END_SRC

* Videos
Here are some videos demonstrating how to use RTags with Emacs though
Expand Down
6 changes: 3 additions & 3 deletions src/rtags.el
Original file line number Diff line number Diff line change
Expand Up @@ -3404,6 +3404,7 @@ definition."

;;;###autoload
(defun rtags-quit-rdm ()
"Quit the RTags process (rdm)."
(interactive)
(let ((rc (rtags-executable-find "rc")))
(when rc
Expand Down Expand Up @@ -3431,8 +3432,8 @@ definition."

;;;###autoload
(defun rtags-restart-process ()
(interactive)
"Restart the RTags process (rdm)."
(interactive)
(rtags-cancel-process)
(rtags-start-process-unless-running))

Expand Down Expand Up @@ -3464,8 +3465,7 @@ definition."
(and rtags-autostart-diagnostics (rtags-diagnostics))
(set-process-query-on-exit-flag rtags-rdm-process nil)
(set-process-sentinel rtags-rdm-process 'rtags-sentinel)))))

(defalias 'rtags-start-process-maybe 'rtags-start-process-unless-running)
(define-obsolete-function-alias 'rtags-start-process-maybe 'rtags-start-process-unless-running)

(defun rtags-sentinel (process event)
"Watch the activity of RTags process (rdm)."
Expand Down

0 comments on commit dbf1ca3

Please sign in to comment.