I was searching for a bison mode for emacs. I found one implementation (rather old, as it turns out). I have copied it to my .emacs file, (require 'font-lock) and (require 'cc-mode) as suggested on the emacs wiki page. But, the bison-mode.el file has the following line (require 'make-regexp) which gives the error
Cannot open load file: make-regexp
Has the name of the library changed or do I need to install something else to make the file work?
Google "make-regexp.el" (with the double-quotes). You will see that you can download that file separately. Then put it in your load-path.
(I am not a Bison user --- just doing what seems reasonable to find the file you need. But it might be that you already have that file somewhere on your disk. So search your disk first for it. Once you have it, ensure that its location is in your load-path.)
Related
My question is similar to this post:
OCaml: Can't run utop after installing it
I try to open the core library, and end up with the same problem:
$ open Core.Std
Couldn't get a file descriptor referring to the console
I have tried the following command with correct quote mark:
eval `opam config env`
But nothing happens and the problem persists despite I have installed core. I also tried to follow installation instructions on this webpage (https://github.com/realworldocaml/book/wiki/Installation-Instructions), but it does not mention this strange problem.
I am using Ubuntu 24 in virtual machine by Hyper-V on windows 8. Another question I want to ask is many webpages like (http://kwangyulseo.com/2014/03/04/installing-ocamlopamutopcore-library-on-ubuntu-saucy/) suggested to compile certain lines of command in ".ocamlinit file". But I do not know where to find this file and how to modify it in linux. I have been an windows user for most of the time in my life.
Sorry if the question's level is too low.
Oh, man. open Core.Std is not a bash command. You need to open OCaml toplevel (i.e. to execute utop or ocaml) and execute this command there. Probably it is not written explicitly in manual. If you see
#use "topfind";;
#thread;;
#camlp4o;;
#require "core.top";;
#require "core.syntax";;
It means that you should enter (or add to .ocamlinit) this by hand. I mean that you should enter # too. So, if you will use ocaml you will see two #. It's normal.
About OCaml init file. As you see they refer to it as ~/.ocamlinit. Character ~ means home directory in POSIX systems. So you will probably need some GUI text editor (gedit or kwrite, for example), create new file, put content there ans save it you home directory. N.B. POSIX systems have no concept of file extension, i.e. leading dot is part of file name.
I'm facing a problem and I couldn't find any documentation at all. Also I downloaded the github sharpdx solution but I didn't found an answer.
When I'm executing tkfxc.exe in net40 directory, the .fx effect compiles successfully but as I read on many forums, a .tkfxo file shall be generated. Instead of that I got a .tkb file.
This is the command line command I'm using:
tkfxc.exe /FoInverted.tkfxo Inverted.fx
Even if I try to change the extension to the file or just load this file as a filter, sharpDX said that is invalid file, some other CHUNK expected.
i just installed YouCompleteMe for Vim through vundle. It works, but it shows only the words contained in the current file. I want to use it to develop c++ programs, how can i configure it to show autocompletion from c++ headers file in /usr/include for example? Thanks a lot.
You need to navigate to ~/.vim/bundles/YouCompleteMe and run the installation script with --clang-completer, so do ./install.sh --clang-completer. After it finishes you should have support for C like languages.
You may also need to place let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py' in your ~/.vimrc.
I have installed with pathogen. I tried the above instructions with ./install.sh --clang-complete. After this, it did not work, and I indeed had to add the path. But it was different than in another reply here, namely
let g:ycm_global_ycm_extra_conf = '.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
so there is an extra "third_party/ycmd" in the path.
While the suggestions here might work in the beginning, I am not sure it's the proper way to go. According to YCM developer, whenever you start a project, you need a new .ycm_extra_conf.py file
From https://valloric.github.io/YouCompleteMe/#ubuntu-linux-x64-super-quick-installation
YCM looks for a .ycm_extra_conf.py file in the directory of the opened file or in any directory above it in the hierarchy (recursively); when the file is found, it is loaded (only once!) as a Python module. YCM calls a FlagsForFile method in that module which should provide it with the information necessary to compile the current file. You can also provide a path to a global .ycm_extra_conf.py file, which will be used as a fallback. To prevent the execution of malicious code from a file you didn't write YCM will ask you once per .ycm_extra_conf.py if it is safe to load. This can be disabled and you can white-/blacklist files. See the Options section for more details.
While you might only need to modify the compile flags from the vanilla .ycm_extra_conf.py, I feel it is advisable to create a new file for every project you start.
Everything that the folks here have said is correct. I just want to add that as of 2017, the "install.sh" script is deprecated. Now, you have to use the install.py script instead by typing
./install.py --clang-completer
Also, in your .vimrc file, instead of ".vim/bundle/blahblahblah", you'll need to add a "~/" in front of the address by adding:
let g:ycm_global_ycm_extra_conf = "~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py"
to your .vimrc file, to give it an absolute path from the Home directory so that Vim can find the ".ycm_extra_conf.py" file. Otherwise, you might experience some funny behavior.
I just wanted to add if you don't want to manually define a config file there is this neat little repository that will auto generate it. https://github.com/rdnetto/YCM-Generator
I'm trying out clojure on my second day and I don't understand almost anything yet. I am working with the Programming Clojure 2nd ed. and I am stuck with libraries.
I have Leiningen and have the REPL running. The book first tells the reader to run a simple
(require 'clojure.java.io)
which works just fine (I get a nil). Then it wants to load a file called introduction.clj by running another simple
(require 'examples.introduction)
where I get an error message
FileNotFoundException Could not locate clojure/java/introduction__init.class
or clojure/java/introduction.clj on classpath: clojure.lang.RT.load (RT.java:432)
I downloaded the introduction.clj file and looked where should I place it. The error and the book says the command will search in my classpath, but I have no idea where or what that is (after 1h of searching and reading I still don't get it, sorry). I ran a few commands and I had many classpaths listed (from which none contain a clojure/java/io.clj).
So I tried another approach - find the io.clj file on my disk and simply copy the file there and run it with a command
(require 'clojure.java.introduction)
This doesn't seem to work either. By the way, the io.clj file I found was in "C:\Program Files\clojure\src\clj\clojure\java". I tried running several other .clj files from the java folder as well from the clojure folder, like javadoc.clj or inspector.clj and all seem to work just fine with the above mentioned command. Only the new file doesn't seem to load this way.
Any help appreciated :)
Clojure runs on the Java Virtual Machine, so you will need to learn a bit about PATH and CLASSPATH concepts:
See: http://docs.oracle.com/javase/tutorial/essential/environment/paths.html
Regarding the error message, the Clojure runtime is expecting to find introduction.clj in the directory clojure\java\example\introduction.clj (not where it really should be - see below).
The convention for Clojure namespaces is that the last component is the file name, while any previous components are parent directories. So
clojure.java.introduction
would have to be in the directory (relative to your source "root" or classpath)
clojure\java\introduction.clj
(The lein REPL automatically adds your source root to the classpath).
Another concept you need to understand is where the "root" of your source code is located. For Leiningen (the build tool you are using) the default is either "src" or "src/main/clojure" - as documented in the Leiningen sample project file on GitHub).
Finally, if you get really stuck, it seems the complete project for the book is available on GitHub.
Looking at the project, I see that you should actually be placing the file under src\examples\introduction.clj
Are you reading the book "Programming Clojure"?
I have encountered the same problem. It ban be sovled as follows:
If you start clojure by java:
I work in windows, the clojure.jar is placed in D:\backup\clojure-1.5.1, and the source code of the book "Programming Clojure" is placed in D:\study\clojure\shcloj-code\code. You should first delete the user.clj file in folder D:\study\clojure\shcloj-code\code.
java -cp d:\backup\clojure-1.5.1\clojure-1.5.1.jar;d:\study\clojure\shcloj-code\code clojure.main -r
If you work in linux, replace the ";" with ":"
If you start clojure by lein
You should first cd to the D:\study\clojure\shcloj-code\code folder, and then
lein repl
You should also delete the user.clj file in folder D:\study\clojure\shcloj-code\code.
So in my process of switching to emacs I find it very difficult to forgo Visual Studio 2010 for C++. Trying to setup cedet for emacs didn't make it any easier. So I used the gentle introduction by Alex Ott and my init file looks similar to the one provided :
(load-file "~/.emacs.d/plugins/cedet/common/cedet.el")
(global-ede-mode 1)
(semantic-load-enable-excessive-code-helpers)
(require 'semanticdb)
(global-semanticdb-minor-mode 1)
(setq semantic-ectag-program "C:/devel/ctags/ctags58/ctags.exe")
(semantic-load-enable-secondary-exuberent-ctags-support)
(require 'semantic-ia)
(require 'semantic-gcc)
(setq-mode-local c-mode semanticdb-find-default-throttle
'(local unloaded system recursive))
(ede-enable-generic-projects)
(global-srecode-minor-mode 1)
All good and dandy but when I try to open a cpp file which has a header (array_loader.h) in the same directory and try to do code completion for the register_reader() method:
array_loader al; al.register_reader();
I get "cannot find types for 'array_loader al' ". Paradoxically, auto-complete-mode works seamlessly. Do they interfere?
I just checked out 1.1 beta using bazaar and then byte compiled it. I didn't setup a project because all my projects are cmake based and they don't have a single path for include files. each sub-library of my project has the headers in the same directory. Is there a way to parse a CMakeLists.txt and feed that information to ede or semantic? Even if there wasn't this basic example should work. Am I doing something wrong?
Well in case anyone has this problem again, I managed to solve it by setting up my cedet init files as indicated by Alex Ott:
https://github.com/alexott/emacs-configs/blob/master/rc/emacs-rc-cedet.el
Also I defined my cmake project and used the recursive find to go through my cmake project folders to find the headers.
It is still strange how cpp files external to the project could not find the signature of the classes/methods although they were defined in headers found in the same folder. the semanticcdb throttle was set as follows
(setq-mode-local cpp-mode semanticdb-find-default-throttle
'(project local unloaded system recursive))