ctags doesn't understand -e option (no exuberant tags option) - ctags

When I type ctags -e it returns an error saying it doesn't know that command line option. I thought it should know about exuberant tags because etags works on cli.
Also, I recieve the following error: ctags: unrecognized option --langdef=arc and I have the following in my ~/.ctags file:
--langdef=arc
--langmap=arc:.arc
--regex-arc=/^\(def ([a-zA-Z1-9_*\/<>-]+)/\1/
--regex-arc=/^\(= ([a-zA-Z1-9_*\/<>-]+)/\1/
--regex-scheme=/^\(xdef ([a-zA-Z1-9_*\/<>-]+)/\1/

etags is short for "Emacs tags", not "exuberant ctags". It sounds like you have Emacs' etags command installed, not exuberant-ctags'.

It turns out that my system has basic ctags installed, but not exuberant-ctags. so even though some etags command existed, exuberant-ctags is still different in some way or another.
sudo apt-get install ctags fixed the problem

sudo apt-get install exuberant-ctags
solved the problem for me.
I was running Debian Jessie on an ARM development board, cubietruck.

On windows, Emacs comes with etags and a similar executable file called ctags. In the emacs distribution, etags.exe = ctags.exe in the bin directory.
You should download Exuberant Ctags from http://ctags.sourceforge.net/
Only exuberant ctags recognize -e option.

I had the same issue, but my error occurred because I had installed emacs with flatpak which came bundled with its own version of ctags, distinct from the one I installed with my linux package manager.
In such case the solution is to either specify the ctags path in the emacs config or use the normal non flatpak version.

Related

Is it possible to debug bash scripts line-by-line?

I'll love something like Microsoft Visual Studio's line-by-line debugging in bash, with current variables values and so.
Is there any tool or way to do it? set -x and set -v are nice but not perfect.
See bashdb.
If it's installed on your system, see man bashdb.
If it's not installed, see http://bashdb.sourceforge.net
Yes. Use "bashdb" from http://bashdb.sourceforge.net/
Latest version at time of writing
http://sourceforge.net/projects/bashdb/files/bashdb/4.2-0.8/
If you are on a Mac (like I was) then you might need to install the GNU version of Bash.
I did that using "MacPorts"
http://www.macports.org/
Once you have MacPorts...
port install bash
Then follow the instructions to
./configure (in bashdb unpacked directory)
make
sudo make install
Then add the folder where bashdb can be found in your PATH

upgrading console emacs (/usr/bin/emacs) on Mac

I extensively use /usr/bin/emacs in Terminal.
I have Emacs 22 and I'd like to upgrade it to 23. I wonder how to do it.
Googling "emacs download mac" gives me Emacs.app which has its own window and user interface, but I don't want that.
I am not sure how I have /usr/bin/emacs in the first place, maybe it came with Mac OS?
You can run the Emacs.app version in a terminal like this:
/Applications/Emacs.app/Contents/MacOS/Emacs -nw
In my .cshrc file, I use an alias to make this easier to invoke:
alias enw '/Applications/Emacs.app/Contents/MacOS/Emacs -nw'
It is a standard editor included with OS X and a lot of other *nix systems along with vi/vim, and pico. Personally i wouldnt upgrade the pre-installed one. I would install from Macports, Fink, or Homebrew or compile from source myself to a different location (like /usr/local).
Install emacs from macports.
% sudo port install emacs
Then launch it from the terminal
Or you can install Emacs.app, follow the instructions here to create a ~/bin/emacs script and then launch as emacs -nw or any other options.
#!/bin/sh
exec /Applications/Emacs.app/Contents/MacOS/Emacs "$#"
I was on this same search and ended up installing with Homebrew so I could get the latest version along with several libraries, as described in this answer at the Emacs Stack Exchange site:
Nowadays, I use just GNU Emacs snapshot builds. These have reasonably good OS X support, and are by far the easiest to install, and best supported by the community.
I used to get them from Emacs for Mac OS X, but now I use Homebrew, because it supports more libraries, notably GNU TLS for encrypted network connections.
All in all: Use brew install emacs --HEAD --use-git-head --with-cocoa --with-gnutls --with-rsvg --with-imagemagick :).
(Note that GNU Emacs is what comes preinstalled on Mac OS X, at least on mine as of 10.10.5)
This added a new Emacs binary at /usr/local/bin/emacs, leaving the existing installation and /usr/bin/emacs in place.
I created a symlink in /usr/local/bin pointing to the new version of emacs which was in Applications/Emacs.app/Contents/MacOS/
For those who installed Emacs from source (or any other way that doesn't overwrite command line called emacs) and want to use this version in the command line, I suggest one of these two approaches:
ln -s ~/path/to/cloned/emacs/src/emacs /usr/local/bin/emacs
make sure /usr/local/bin is in your $PATH and located before /usr/bin, by executing echo $PATH
if it is not, add line export $PATH=/usr/local/bin:$PATH to the file ~/.bash_profile, then refresh $PATH by executing in the terminal source ~/.bash_profile
add ~/path/to/cloned/emacs/src to your $PATH.
for example, add line export $PATH=~/path/to/cloned/emacs/src:$PATH to the file ~/.bash_profile, then refresh $PATH by executing in the terminal source ~/.bash_profile
And yes, MacOS is shipped with many packages pre-installed. But, unfortunately, usually with outdated ones and no official package manager to easily upgrade those libraries. That's actually why we have Homebrew, Macports, maybe others: they serve us as MacOS package managers.

How Do I Install Lua on MacOS?

I just downloaded Lua from the official website.
I want to install it on my Mac but I have no clue how. And I've never tried using Mac to install and use compilers other then (xcode , titanium , corona) so easy on me please :)
I tried this link but it does not work.
Also Is there a fully guided on how to install and start using Lua on mac? Because all I see is windows :S
note: Before I asked this question I searched on SOV but I could not find my answer.
This Wiki has few listing:
http://lua-users.org/wiki/MacOsxLua
If you use Homebrew (https://brew.sh/), just type:
brew update
brew install lua
Compiling from source code is not that painful.
Lua 5.1.4 here: http://www.lua.org/ftp/lua-5.1.4.tar.gz
Lua 5.2 alpha here: http://www.lua.org/work/lua-5.2.0-alpha.tar.gz
Take Lua 5.2 as example:
Open your Terminal.app
wget http://www.lua.org/work/lua-5.3.0-work3.tar.gz
tar xvzf lua-5.3.0-work3.tar.gz
cd lua-5.3.0-work3/src
make macosx(I believe you have Xcode installed)
After that, you can see 'lua' binary under current dir.
sudo cp lua /usr/bin/lua
Now you can enter lua to have a try. :)
If you have brew installed, just try:
brew install lua
You just follow this guide on http://www.lua.org/start.html:
Fire up your terminal and type in:
curl -R -O http://www.lua.org/ftp/lua-5.3.5.tar.gz
tar zxf lua-5.3.5.tar.gz
cd lua-5.3.5
make macosx test
make install
You can even combine the last two steps to
make macosx install
After that I could just type in
lua
into my terminal and something like:
Lua 5.3.5 Copyright (C) 1994-2018 Lua.org, PUC-Rio
should appear. This means that lua is installed correctly.
With MacPorts:
sudo port install lua
If you have brew, use the following code:
brew update
brew install lua
That works for me.
Compile using source on mac
tar -zxvf lua-x.x.x.tar.gz
cd lua-x.x.x
make macosx
cd src
sudo cp lua /usr/bin/
Type lua and you should get the prompt.
I have just follow the Prajna's answer and go to http://www.lua.org/versions.html#5.3 to download the lua-5.3.6.tar.gz
And then use the terminal:
$cd lua-5.3.6/src
$make macosx
After that, you can see 'lua' binary under current dir.
After execute:
$sudo cp lua /usr/bin/lua
You can run the lua
You don't "install" it. It should just be a binary that runs from wherever you extract it to.
If you can't find a binary (there should be one linked somewhere on the Lua site) then just follow the instructions to build it from source.
Ah, here are the binaries: http://luabinaries.sourceforge.net/download.html
You'll probably want the file labelled "MacOS X Intel Executables"
The download url show below.
http://www.lua.org/download.html
lua-5.3.1.tar.gz
2015-06-10, 276K

Installing vim with ruby support (+ruby)

I'm trying to get command-t installed for vim but my current version of vim doesn't have the (+ruby) flag. The command "which ruby" shows that ruby is installed.
What do I need to do in order to activate the +ruby flag in vim?
Also, what does the +ruby flag technically mean?
Some package provides vim-ruby on Ubuntu, for example vim-nox.
simply:
sudo apt-get install vim-nox;
will get you vim with ruby, as well as compiled in "support for scripting with Perl, Python, Ruby, and TCL but no GUI."
sudo apt-get install vim-rails
will install a "selection of vimscripts that make editing Ruby on Rails applications extremely easy." but as it depends on vim-full and vim-addon-manager, it will also install the vim-gnome version of the GUI, that is "a version of vim compiled with a GNOME2 GUI and support for scripting with Perl, Python, Ruby, and TCL."
I think "Compiling Vim With Ruby Integration On Snow Leopard" might actually help. I'm on exactly same boat at the moment.
Ok... got it to work. Took me like half hour or so.
This should help (I got Ubuntu):
sudo apt-get install mercurial
hg clone https://vim.googlecode.com/hg/ vim
cd vim
./configure --enable-rubyinterp
make
sudo make install
To test if things look fancy:
vim --version | grep ruby
Should return something like:
-python3 +quickfix +reltime -rightleft +ruby +scrollbind +signs +smartindent
Ruby should have plus now. Another trick to test it - enter vim and hit :ruby 1. Should not fail.
On mac os x, assuming you have Homebrew installed:
brew install https://raw.github.com/Homebrew/homebrew-dupes/master/vim.rb
This version of vim has ruby support enabled
Source: http://blog.jerodsanto.net/2011/08/brew-install-vim/
EDIT: edited the url, thanks #david-xia for mentioning the change
UPDATE: Apparently, homebrew vim now comes with ruby support enabled by default so you just need to do brew install vim (see comment below)
If there isn't a Ruby enabled Vim available for your operating system, you'll have to recompile. This is very easy and there are some instructions on the Vim website I believe. If you're on Linux, you use configure to choose what you want. Have a look at the output of:
./configure --help
in the Vim source directory. Read it carefully, there are a lot of options in there. The main one you want is --enable-rubyinterp, but you may also want to add --with-features=HUGE among others. As I said, read the help provided.
when you run ./configure you need to add the folowing --enable-rubyinterp
./configure --enable-rubyinterp
On Mac OS X, I find that the easiest is to install MacVim with brew install macvim which includes +ruby. And then symlink /usr/local/bin/vim to /usr/local/bin/mvim. That way to get a recent Vim version, with the huge feature set, +ruby, both GUI and command line vim just using the standard HomeBrew repository. No need for external repository like in Pierre answer
To avoid issues it's better to use the use the system ruby during installation so:
rvm use system
brew install macvim
ln -s /usr/local/bin/mvim /usr/local/bin/vim
Flag +ruby means that vim is compiled with ruby support and linked against ruby interpreter library. You cannot get this flag without recompiling vim or installing another version which is compiled with this flag.
Pulling the vim source using Mercurial and changing into the directory will give you the ability to configure your vim install before you compile it.
hg clone https://vim.googlecode.com/hg/ vim
cd vim
./configure --enable-rubyinterp
The --enable-xxinterp option can be used for Python, Perl, or any other language that Vim will support. Just type it in where the xx is and it will work.
Running the help option with the configure command will allow you to see all of the configuration options.
./configure --help
Under Windows you can install Vim from here:
http://sourceforge.net/projects/cream/files/Vim/
Version 7.3.3 seems to be compiled with Ruby support (see release notes file). The newest 7.3.x currently is not.
Installing vim-rails will add Ruby (+ruby) support. I just tried and verified that it works and Command-T runs fine now.
sudo apt-get install vim-rails
If you are using MacPorts in OSX, you may try
sudo port install vim +ruby
To specify a different ruby version, you may try
sudo port install vim +ruby18
or
sudo port install vim +ruby19
It looks like you need to have ruby installed before install vim-nox.
This works for me on Ubuntu 18.10
sudo apt-get install ruby rubygems vim-nox
Source: https://junegunn.kr/2013/09/installing-vim-with-ruby-support
If you are lazzy and don't want to recompile you can try to find a package with a vim version including ruby. On debian it's vim-ruby so something like
apt-get install vim-ruby
might work. (I can't try it, I m on mac. On mac , MacVim come with ruby enabled)

Need help in compiling lighttpd on MacOSx

I try download lighttpd 1.4.23 source, and compile it on MacOSX 10.5.5.
This is the error I am getting:
$ ./autogen.sh
./autogen.sh: running `libtoolize --copy --force'
./autogen.sh: line 19: libtoolize: command not found
I tried ask the same question on lighttpd forum, but I can't get any help there.
Thanks in advance.
libtoolize is part of GNU libtool, a package for building libraries portably. On the Mac, one option for getting it is to use MacPorts, a package manager which works in a similar fashion as Gentoo and FreeBSD, in that it compiles packages on your machine. See http://www.macports.org/install.php.
Beware, though, that it will be installed as glibtoolize, i.e. with a 'g' prefixed. That is a standard way to make GNU tools live in parallel with UNIX tools of the same name, that might be present (even though there isn't one in this particular case).
The command for installing libtool from MacPorts is: sudo port install libtool
Add a '-d' flag after the 'port' command to see the build output.
Here's what I use to install lighttpd 1.4.25 on Mac OS X 10.6.2. If I remember correctly, the same thing worked for me in a recent version of Mac OS X 10.5.
Install Xcode Developer Tools
Either install them from the DVD that came with your Mac (under Optional Installs) or download them from Apple's developer page.
Install PCRE
curl -O http://softlayer.dl.sourceforge.net/project/pcre/pcre/7.9/pcre-7.9.tar.gz
tar xzf pcre-7.9.tar.gz
cd pcre-7.9
./configure
make && sudo make install
cd ../
Install lighttpd
curl -O http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.25.tar.gz
tar xzf lighttpd-*.tar.gz
cd lighttpd-*
./configure
make && sudo make install
Note that the URLs above will quickly go out of date; you may need to download the latest versions of the .tar.gz packages from a different location.

Resources