I'm part of a big project and, sadly, the .annot files are not located in the .ml files directory. So, naturally, when I do C-c C-t it answers
No annotation file. Compile with option "-annot" or set 'caml-annot-dir'.
I checked, my .annot files are in a directory (let's say in ../build) and I'd like to tell tuareg that when I'm working on this project it should look in this directory (by setting caml-annot-dir which I can't find) but I have no idea of how to set this variable and even more how to set if forever but only for this project (maybe with Local variables ?).
Note first that directories in caml-types-build-dirs are searched in parent directories of your file. In your case, you should do (add-to-list 'caml-types-build-dirs "build"). If completing this list does not work, you can set the location on a file basis, using local variables: put at the end of your file
(* Local Variables: *)
(* caml-annot-dir: "/path/to/directory/annot" *)
(* End: *)
Related
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).
I recently switched to the use of emacs' package manager packages.
Since then, some emacs path variables get set beyond what I do in my .emacs file: Both load-path and Info-directory-list get perpended with stuff from the packages. But I don't understand where these customisations are done.
Let's concentrate on Info-directory-list: In my .emacs file I don't set it so it should be nil (so that later when info starts up, its initialised from Info-default-directory-list. However with my new packaging it is already intialised and some package directories are added. This messes up my dir structure in info. I have checked the autoload files, but they don't set Info-directory-list in any way - and no other elisp file in the packages (pandoc-mode in particular) do so.
Where is the Info-directory-list variable set and how can I regain control over the order in this variable?
After evaluating your init file, Emacs calls package-initialize (which does what it sounds like). After initializing the packages, Emacs runs after-init-hook, so if you want to manipulate variables which have been modified during package initialisation, you can put the following in your init file:
(add-hook 'after-init-hook 'my-after-init-hook)
(defun my-after-init-hook ()
"After package initialisation."
;; do something with Info-directory-list
)
You can also call package-initialize yourself, provided that you ensure that any necessary package-related variables are set beforehand. See Emacs 24 Package System Initialization Problems for details.
As for how and why Info-directory-list is being modified, the manual comments on that aspect in (elisp) Multi-file Packages:
A multi-file package is less convenient to create than a single-file
package, but it offers more features: it can include multiple Emacs
Lisp files, an Info manual, and other file types (such as images).
[...]
If the content directory contains a file named dir, this is
assumed to be an Info directory file made with install-info. *Note
Invoking install-info: (texinfo)Invoking install-info. The relevant
Info files should also be present in the content directory. In this
case, Emacs will automatically add the content directory to
Info-directory-list when the package is activated.
Specifically, package-activate-1 does this:
(when (file-exists-p (expand-file-name "dir" pkg-dir))
;; FIXME: not the friendliest, but simple.
(require 'info)
(info-initialize)
(push pkg-dir Info-directory-list))
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.
Rather than individually specifing each subdirectory in my plugins directory I want to be able to automatically load them, to that end I included the following to my .emacs file:
(let ((base "~/.emacs.d/plugins/"))
(normal-top-level-add-subdirs-to-load-path))
require 'rinari
require 'yasnippet
Unfortunately the above results in: File error: Cannot open load file, rinari
Anyone know what's wrong and how to fix it?
You're so close...
(let ((default-directory "~/.emacs.d/plugins/"))
(normal-top-level-add-subdirs-to-load-path))
normal-top-level-add-subdirs-to-load-path works off the current directory, which you can set via the variable default-directory - not base like you tried.
You might investigate the role of the subdirs.el files during startup. It is a good way get subdirectories into your load-path.
For example, much of the default load-path arises as a consequence of the files discovered by this command:
find /usr -name subdirs.el
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)