loading cscope database in emacs - emacs

I want to use cscope in emacs. Due to my directory structure i only want to use files from certain subdirectories in the tree.
In the shell i create my cscope.files list (includes a listing of all the source files i want)
the i do:
cscope -q -R -b -i cscope.files
This will create the cscope.out file i want. Now i want to read this file into emacs to use it for source code parsing etc ...
So the question is:
How do i have emacs load it? It seems that all the options i get (ie M-x cscope-wahtever) are for creating a new cscope.out file.

Ok,
i guess i am answering my own question.
So the problem was not exactly with cscope.
First, in order to point cscope to the database file one set the initial directory:
M-x cscope-set-initial-directory
to where the cscope database is located.
However, it appears that the input file from which the database is constructed needs to have relative paths in it (or the initial directory need to be pointing to '/'). I had absolute paths in it and thus nothing was found after setting the initial directory to the source root.

Related

how to tell emacs to actually use the ctags file I created

Not finding what i'm looking for.
Want to enable/start using Ctags with emacs & Vim (setting this up for a team, some use vi some use emacs)
I can: Run "ctags -e -f ./.ctags LONG_LIST_OF_FILES (I do this in a Makefile)
note: I need to do it this way, because I need to control what is and is not scanned.
A recursive search will be a problem - as there are C files in sub directories that
do not apply to this situation
Result: the file exists, it seems happy but .. how do I tell emacs - yea, there is a ctags file here..
Actually - its more like this:
PROJECT_DOG=/home/foobar/dog
$(CTAG_FILE) = $(PROJECT_DOG)/.ctags
Then I have a number of subdirectories - sort of like this:
$(PROJECT_DOG)/libtail/src
$(PROJECT_DOG)/libtail/include
$(PROJECT_DOG)/liblegs/src
$(PROJECT_DOG)/liblegs/include
$(PROJECT_DOG)/libtail/src
$(PROJECT_DOG)/libtail/include
$(PROJECT_DOG)/libnose/src
$(PROJECT_DOG)/libnose/include
.. and numerous other "lib" like directories ..
The single top level .ctags file covers the entire project... (all "lib directories")
Problem statement:
I "visit" a file in emacs - I'm expecting ctags to appear.. but it is not
Same problem with VI and GVIM.
It seems that both tools do not know the tags file exist...
Tried looking here:
Google finds plenty of examples of how to install ctags, and run ctags
but - nothing about how to "activate?" (if that is the correct word) the tags.
https://www.emacswiki.org/emacs/BuildTags
Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctags
http://timothypratley.blogspot.com/2008/07/ctags.html
And a number of other places - no luck.
MY HOPE IS THIS:
When I visit a file in a directory - the tool (emacs/vi) automatically discovers the "tags" file in that directory, or one of the several parent directories up unto the root. The example being: I open the file: $(PROJECT_DOG)/libtail/src, but the ctags file is 2 levels up.
Or something like that..

Coq: Issue with Require Export

my issue seems to be a common one, but none of the found answers could solve it.
I am following the software foundations course on Coq, and so I come to the command:
> From LF Require Export Basics.
Whatever I try, I get always the following answer:
"Cannot find a physical path bound to logical path matching suffix <>
and prefix LF."
I compiled Basics.v from coqIde, and the Basics.vo file is created correctly.
I also compiled it from the coqc command line, as suggested somewhere
My _CoqProject file exists, in the same folder as Basics.v, and states: -Q . LF
the _CoqProject parameter is set to "appended to arguments".
when I load Basics.v I see on the bottom of CoqIde "Reading Options from ..._CoqProject"
I put the lf folder into a folder which is in the LoadPath of coq.
What else could I check?
My system is Windows 10. I run CoqIde 8.9.1
Thank you!
I usually work under a Linux machine, but here something I did using a virtual machine.
I downloaded the windows installer from https://github.com/coq/coq/releases/tag/V8.9.1
I downladed the lf.tgz file from https://softwarefoundations.cis.upenn.edu/lf-current/index.html
I ran the windows installer for Coq. It placed the coq system in C:\coq
I used cygwin tools to expand the file lf.tgz so that I had a directory C:\Users\user\foundations\lf containing Basics.v, _CoqProject etc.
Then I used the search command to find coqide as an installed app. I then proceeded with the following steps:
start coqide
open the file Basics.v
use the option Compile->Compile buffer
I could then observe that the directory C:\Users\user\foundations\lf contained a file named Basics.vo
Then I opened a new buffer, and wrote From LF Require Export Basics. and did not try to execute this line
I saved this buffer in a file in directory C:\Users\user\foundations\lf. Let's assume this file is named toto.v
I closed the toto.v buffer.
I re-opened the toto.v using the option File->Open
I executed the file contents.
This process is the result of trial-and-error. What I know is that Require Export ... only works if there are ...vo files on you disk, but coqide needs to know where to look for these files. For this it maintains a "load path". When opening a file from a given directory, coqide looks in this directory (and ancestors) to find a _CoqProject file, and the latter may contain directives to modify the load path. It is the case here "-Q . LF" indicates that all .vo files in the current directory should be considered, and that their symbolic name should start with the prefix "LF."
The problem is that when you start from an empty buffer, no _CoqProject file gets read and coqide does not where to look for your data. This is why I did the steps 5-6-7: when reading the file toto.v, I provoked the reading of the _CoqProject file.
Takeaway lesson: Make sure the Basics.vo file exists, and then make sure the buffer you are working on was obtained through a reading operation from the same directory. If needed, save, close, and re-open to make sure this is the case.

Force AUCTeX to parse the whole document

I'm using AUCTeX 11.87 along with emacs 24.3 for writing my LaTeX documents. This is working nicely with one exception: The parsing.
My document structure is as follows:
./
Master.tex
Chapter_1.tex
Chapter_2.tex
...
header/
header/header.tex
header/packages.tex
header/options.tex
...
Where Master.tex \inputs header.tex which in turn inputs all files in header/. Furthermore Master.tex includes the Chapter_N.tex files within the document environment.
Here comes the problem: AUCTeX does not generate the parse files (the ones in the auto folder) until I have actually opened the file. Meaning that until I have not opened and saved the header/packages.tex and header/header.tex files AUCTeX does not know about the loaded packages and thus their commands/environments.
An now the question: Can I force AUCTeX to (re)parse the whole source-tree (and then reload the style hooks for all open documents)?
If all files are in the same directory, or in subdirectories under it, open the master file and issue M-x TeX-auto-generate RET and as TeX file or directory insert the directory of the master file and as AUTO lisp directory the auto/ subdirectory of the previous directory.
For instance, if your master file is placed in ~/my-document/, insert ~/my-document/ at the first prompt and ~/my-document/auto at the second one (you can also use relative paths if you prefer them).

Where are Doxygen output files put?

I have just run Doxygen from the command line and am unsure where it put it...
It doesn't show up in the directory I ran it from
Is there an easy way to find it?
From the Doxygen manual:
The default output directory is the directory in which doxygen is started. The root directory to which the output is written can be changed using the OUTPUT_DIRECTORY. The format specific directory within the output directory can be selected using the HTML_OUTPUT, RTF_OUTPUT, LATEX_OUTPUT, XML_OUTPUT, and MAN_OUTPUT tags of the configuration file. If the output directory does not exist, doxygen will try to create it for you (but it will not try to create a whole path recursively, like mkdir -p does).
If you are having some problems getting it to do what you want use doxywizard it makes writing the configuration file much easier.

How do I "source" something in my .vimrc file?

I've been working on expanding my vim-foo lately and I've run across a couple of plugins (autotag.vim for example) that require them to be "sourced" in my .vimrc file. What exactly does this mean and how do I do it?
Sourcing a file is 'executing' it. Essentially, each line of the file is considered a command. Sourcing it is the same as typing each command in order. You source with the command :source (usually shortened to :so).
So if you source myStuff.vim
:so myStuff.vim
and if myStuff.vim contained these lines
set xx iI just intersted this<C-]>
set yy bbbb4dw
It's the same as if you typed those commands into Vim
:set xx iI just intersted this<C-]>
:set yy bbbb4dw
The only file sourced by default is the .vimrc(_vimrc on windows) so that's a place you can keep all the commands you use to set up Vim every time.
Where it gets interesting is the fact that since a sourced file is just a series of commands, and sourcing is a command, you can source files from your source files. So plugins you use every time could be sourced when you start up Vim by adding a line to your .vimrc like this
so myPlugin.vim
Files in your .vim/plugin directory are sourced (loaded) automatically.
There is always the :source file command. I usually write .vimrc that contains custom commands and what not for the console application and then a .gvimrc that contains additional goodies that are appropriate for a windowed version. My .gvimrc starts with source $HOME/.vimrc to pick up everything from the console version before adding in new stuff.
There are normally two vimrc files, one is _vimrc and the other _gvimrc (in the first one are the things for vim, and in the second for gvim - graphical things) - although most people I know just put everything in _vimrc.
A good practice is to keep all your extra files (plugins, colorschemes, snippets ...) in a separate (your own) vimfiles directory (which you can take with you).
If you do
:help vimfiles
vim will tell your vimfiles directory should be located. It depends somewhat on the platform (win, unix). On windows the usual is in your user folder (documents and settings, then user ...).
In vimfiles directory there are a couple of subdirectories. Amongst them is the "plugin" subdirectory. Plugins put in that dir will be loaded automatically (also plugins put in subdirectories of "plugin").
If you do not wish to load it automatically, just put it in your "vimfiles", or some other directory, and
:so plugin_name.vim (with the appropriate path)
(you can use the $vim, $vimfiles, and $home as shortcuts when defining path to plugin)