[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fossil-users
Subject:    [fossil-users] Mini-HOWTO: rtags + Emacs + Fossil
From:       Johan Kuuse <johan () kuu ! se>
Date:       2018-04-05 16:50:37
Message-ID: CAGUU1d3gLbaz2Vw73PQQFVm3B5JK2eycdMRxe=Nw9CwhWpi3UA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,

This mail is focused to Emacs users on *NIX platforms who are browsing the
Fossil source code.

I have recently started using rtags, a powerful source code indexer for C
and C++, and just wanted to share my positive experiences.
Read more at

https://github.com/Andersbakken/rtags

I attach an "interactive help" Makefile which shows the setup steps for
using rtags with the Fossil source code in a simplified way.
If you consider this should be included in a developer's Wiki, please let
me know.

Best Regards,
Johan


------------------------------------------------------------


# Helper Makefile for setting up rtags with fossil

SHELL := /bin/sh
THIS_DIR      := `pwd`
THIS_MAKEFILE := `if [ -n "$(MAKEFILE_LIST)" ];then echo
"$(MAKEFILE_LIST)";else if [ -n "$(.PARSEFILE)" ];then echo
"$(.PARSEFILE)";else echo Makefile; fi; fi`

.PHONY: help setup

# Help
help:
    @echo
    @echo "1. To use rtags, you need:"
    @echo
    @echo "    BSD|Linux|Mac OS + Emacs"
    @echo "    At the time of writing this, MS Windows is not supported.
:-("
    @echo
    @echo "2. Read the 'rtags' docs and get the source code:"
    @echo
    @echo "    https://github.com/Andersbakken/rtags"
    @echo
    @echo "3. rtags dependencies basically are (read the docs for details):"
    @echo
    @echo "    llvm"
    @echo "    cmake"
    @echo "    bear"
    @echo
    @echo "4. For details about how to setup rtags to work with Fossil,
type:"
    @echo
    @echo "    make setup -f $(THIS_MAKEFILE)"
    @echo

setup:
    @echo
    @echo "1. If not done already, create a 'rtags' cache directory in your
home directory '$$HOME':"
    @echo
    @echo "    mkdir -p ~/.rtags"
    @echo "    echo '--data-dir=~/.rtags' > ~/.rdmrc"
    @echo
    @echo "2. In the root directory of a Fossil checkout, create a JSON
Compilation Database for this project, based on a clean build."
    @echo "   Note that some files are not compiled by default (for example
src/json*.c), so they will not be indexed by 'rtags' unless configured"
    @echo
    @echo "    make clean"
    @echo "    ./configure --json --with-th1-hooks --with-your-options-here
(optional)"
    @echo "    bear make"
    @echo
    @echo "3. Tweek the database for Fossil:"
    @echo
    @echo '    sed  -i"" -e
"s,$(THIS_DIR)/bld/\([A-Za-z]*\)_\.c,$(THIS_DIR)/src/\1.c,g" -e
"s,bld/\([A-Za-z]*\)_\.c,$(THIS_DIR)/src/\1.c,g" compile_commands.json'
    @echo
    @echo "4. If not done already, start the rtags daemon, 'rdm' (this can
also be done inside Emacs):"
    @echo
    @echo "    rdm --daemon"
    @echo
    @echo "5. Start the rtags client in this directory (this can also be
done inside Emacs):"
    @echo
    @echo "    rc -J ."
    @echo
    @echo "6. Start Emacs and configure 'rtags.el' to browse the 'src/'
directory."
    @echo


------------------------------------------------------------

[Attachment #5 (text/html)]

<div dir="ltr"><div><div>Hi,<br><br></div><div>This mail is focused to Emacs users on \
*NIX platforms who are browsing the Fossil source code.<br></div><div><br></div>I \
have recently started using rtags, a powerful source code indexer for C and C++, and \
just wanted to share my positive experiences.<br></div>Read more \
at<br><div><div><br><a href="https://github.com/Andersbakken/rtags"><font \
size="1"><span style="font-family:monospace,monospace">https://github.com/Andersbakken/rtags</span></font><br></a><br></div><div>I \
attach an &quot;interactive help&quot; Makefile which shows the setup steps for using \
rtags with the Fossil source code in a simplified way.<br></div><div>If you consider \
this should be included in a developer&#39;s Wiki, please let me \
know.<br></div><div><br></div><div>Best \
Regards,<br></div><div>Johan<br></div><div><br><br><font size="1"><span \
style="font-family:monospace,monospace">------------------------------------------------------------<br></span></font><br><br><font \
size="1"><span style="font-family:monospace,monospace"># Helper Makefile for setting \
up rtags with fossil<br><br>SHELL := /bin/sh<br>THIS_DIR         := \
`pwd`<br>THIS_MAKEFILE := `if [ -n &quot;$(MAKEFILE_LIST)&quot; ];then echo \
&quot;$(MAKEFILE_LIST)&quot;;else if [ -n &quot;$(.PARSEFILE)&quot; ];then echo \
&quot;$(.PARSEFILE)&quot;;else echo Makefile; fi; fi`<br><br>.PHONY: help \
setup<br><br># Help<br>help:<br>      @echo<br>      @echo &quot;1. To use rtags, you \
need:&quot;<br>      @echo<br>      @echo &quot;      BSD|Linux|Mac OS + \
Emacs&quot;<br>      @echo &quot;      At the time of writing this, MS Windows is not \
supported. :-(&quot;<br>      @echo<br>      @echo &quot;2. Read the &#39;rtags&#39; \
docs and get the source code:&quot;<br>      @echo<br>      @echo &quot;      <a \
href="https://github.com/Andersbakken/rtags">https://github.com/Andersbakken/rtags</a>&quot;<br> \
@echo<br>      @echo &quot;3. rtags dependencies basically are (read the docs for \
details):&quot;<br>      @echo<br>      @echo &quot;      llvm&quot;<br>      @echo \
&quot;      cmake&quot;<br>      @echo &quot;      bear&quot;<br>      @echo<br>      \
@echo &quot;4. For details about how to setup rtags to work with Fossil, \
type:&quot;<br>      @echo<br>      @echo &quot;      make setup -f \
$(THIS_MAKEFILE)&quot;<br>      @echo<br><br>setup:<br>      @echo<br>      @echo \
&quot;1. If not done already, create a &#39;rtags&#39; cache directory in your home \
directory &#39;$$HOME&#39;:&quot;<br>      @echo<br>      @echo &quot;      mkdir -p \
~/.rtags&quot;<br>      @echo &quot;      echo &#39;--data-dir=~/.rtags&#39; &gt; \
~/.rdmrc&quot;<br>      @echo<br>      @echo &quot;2. In the root directory of a \
Fossil checkout, create a JSON Compilation Database for this project, based on a \
clean build.&quot;<br>      @echo &quot;    Note that some files are not compiled by \
default (for example src/json*.c), so they will not be indexed by &#39;rtags&#39; \
unless configured&quot;<br>      @echo<br>      @echo &quot;      make \
clean&quot;<br>      @echo &quot;      ./configure --json --with-th1-hooks \
--with-your-options-here (optional)&quot;<br>      @echo &quot;      bear \
make&quot;<br>      @echo<br>      @echo &quot;3. Tweek the database for \
Fossil:&quot;<br>      @echo<br>      @echo &#39;      sed   -i&quot;&quot; -e \
&quot;s,$(THIS_DIR)/bld/\([A-Za-z]*\)_\.c,$(THIS_DIR)/src/\1.c,g&quot; -e \
&quot;s,bld/\([A-Za-z]*\)_\.c,$(THIS_DIR)/src/\1.c,g&quot; \
compile_commands.json&#39;<br>      @echo<br>      @echo &quot;4. If not done \
already, start the rtags daemon, &#39;rdm&#39; (this can also be done inside \
Emacs):&quot;<br>      @echo<br>      @echo &quot;      rdm --daemon&quot;<br>      \
@echo<br>      @echo &quot;5. Start the rtags client in this directory (this can also \
be done inside Emacs):&quot;<br>      @echo<br>      @echo &quot;      rc -J \
.&quot;<br>      @echo<br>      @echo &quot;6. Start Emacs and configure \
&#39;rtags.el&#39; to browse the &#39;src/&#39; directory.&quot;<br>      \
@echo<br><br><br>------------------------------------------------------------<br><br></span></font></div></div></div>



["Makefile.rtags" (application/octet-stream)]
[Attachment #7 (text/plain)]

_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic