how to parse files using ebrowse - emacs

I have a folder tree which contains my C++ files. After reading this document,
http://www.gnu.org/software/emacs/manual/html_node/ebrowse/Generating-browser-files.html#Generating-browser-files
still don't know how to parse all my c++ files in folder tree easily.
I can execute the command below in each folder manually, but looks stupid. I can write some scripts to do it recursively, but want to know any better idea here.
ebrowse *.h

I use ebrowse at work. I don't have my bash alias at hand, but from memory it looks like that:
ebrowse $(find . -name "*.[hc]pp")
Don't hesitate to replace the . with the path to the root of your project.

How about open it in dired buffer, then M-xfind-name-diredRETRET*.ht!ebrowse * ?
In other words: use dired to locate all files you need, then run shell command on them, shell command being ebrowse?

How'bout ebrowse **/*.h **/*.cpp? Don't know which shells support ** nowadays, but at least Zsh has supported it for a decade or two.

Related

Refactor java classes on windows file system using cygwin

I'm trying to refactor classes from my local working copy due to an urgent refactor needed after a bug fix.
So what i am doing is, using cygwin, move to the dir where my exlipse workspace is located and run this query
find . -name "*.java" -exec sed -i 's/bug/big fix/' {} \;
I simply need to replace 1 line of code,
The issue is, that this affects also classes that does not contain tat bug, i see that by looking at the java files in svn, right after running my command on the java files icons in eclipse it appears the brows asterisk appears, and if i run a diff, i see that all lines differs, even though i thought not even one line should be modified.
My local working copy is on a windows file system, any advise?
#Aurand is probably right, it sounds like a line-ending issue. Reset the repo, then add the -b option to sed to preserve line endings.

Using external files and modules in perl PAR Packer

I'm having some trouble using the pp command to create standalone executables on a Linux machine. It seems that every tutorial says a different thing and I'm a bit confused. I'd like your help regarding two issues:
1. I'm trying to include a module created by me (.pm file), but not sure how to do so and keep getting error messages. Should I use the -M option? or should it be -B? And once the module is included, how do I call it from the script? the usual way (i.e. "use module" and then "module::sub")?
2. I want to include some text files too. So far, I've tried -a and -l options, but not sure if they actually work. Which one should I use? Also, how do I open these files? For instance, if I pack the file tmp.txt, what should the open command look like?
Thank you very much!
Adding modules with the -M option and use the module as usual.
Adding your text file with the -a option, from pp's manual:
By default, files are placed under / inside the package with their original names.
so you should be able to read these text files with:
my $content = PAR::read_file('your_file.txt');

DOS Copy File up multiple directories

I can't figure out how to copy a file in Windows Dos up multiple directories. Basically I want to replicate this linux command for windows
cp ../../../Dir/Item.o Item.o
Basically I need to copy an item that is up 3 folders from a folder called "Dir" into my current directory. I use this (in linux) as part of a build step and would like to do the same for windows. I have tried changing ".." and it didn't work.
Any help will be appreciated.
It's is almost the same on Windows. You need the correct command, and you need to use back slash instead of forward slash
copy ..\..\..\Dir\Item.o Item.o
copy ..\..\Dir\Item.o .
You need to use the back-slash as directory separators. . denotes the current directory

Emacs: How can I find a file in my project quickly?

Now, I'm using ede to manage my cpp project, and I try to find a file in my project quickly, but I failed. I used ede-find-file to find "db.h", it sits in "d:/projects/leveldb/include/db.h", unfortunately, it said cannot find.
My config is put below
(setq leveldb_root "d:/projects/leveldb/")
(ede-cpp-root-project
"leveldb"
:file (concat leveldb_root ".gitignore")
:system-include-path '("C:/Program Files/Microsoft SDKs/Windows/v7.1/Include"
"C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/include")
:include-path '("/"
"/include"))
And, is there any suggestion for project management and file find solution? (I also tried find-file-in-project).
I use ede because I need the ede-cpp-root-project to automatically set semanticdb.
Have a look at projectile. Projectile is a project interaction library for Emacs. Its goal is to provide a nice set of features operating on a project level without introducing external dependencies. For instance - finding project files is done in pure elisp without the use of GNU find.
This library provides easy project management and navigation. The concept of a project is pretty basic - just a folder containing special file. Currently git, mercurial and bazaar repos are considered projects by default. If you want to mark a folder manually as a project just create an empty .projectile file in it.
One of the solutions that I use for my C/C++ projects is using GNU Global. You can use gtags module with Emacs, which is superior than the built-in tag system. Once you have GNU Global installed, and Emacs gtags configured, you can run gtags from the top level of your source tree to generate the tags. Now, if you run the M-x gtags-find-file to open a file that was indexed by Global. For usability, you can bind this command with a keystroke that is convenient for you.
For the original ede project types, such as the ones that generate or
read Automake files, EDE knows all the files and where they are if they
are being compiled into your program.
For ede-cpp-root, it has no list of files to use, so it will only really
search in the current directory or include path. The include path is
key since it is needed for smart completion.
If you would like to use ede-find-file for general file discovery, you
can integrate in an external tool such as GNU Global, or idutils as a
backend database for both files. You could also enable the use of your
system's locate command.
Customize ede-locate-setup-options to include whichever tool you would
like to use, and then it should work as desired.
Well, I don't really know how to solve your particular problem, but I can try to remedy it. If you install the ido package (http://www.emacswiki.org/emacs/InteractivelyDoThings), you can usually find files quickly that way. It's a find-file solution for everything in my opinion.
Or you can try xcscope.el, it is blazingly fast to find the files you want(+more) provided
you have setup your cscope database properly.
The one more alternative is gpicker. It's actually an external tool, but there's an integration plugin for emacs. It provides fuzzy search for project files regarding its relative paths and makes it pretty fast. I'm using it for about three years and strongly recommend trying gpicker other emacs users.

ttf2ufm: command not found

I'm trying to install a font for use with TCPDF. To do so, I need to run the included command line utility ttf2ufm. (Included with TCPDF in fonts/utils/ttf2ufm) When I run it though, I get the error -bash: ttf2ufm: command not found. I'm probably just overlooking something simple, but I've searched and can't find what I'm missing here.
Should mention I'm using Debian Lenny.
Perhaps you do not know how commands are executed in bash.
If the program is not in the path, you need to specify the path to get it to run.
If you are in the right directory.
.../fonts/utils/ $ ./ttf2ufm ....
Note the ./ in front of it, that gives the file a path, in the present working directory, or the full path will work, or any other relative path. Just using ttf2ufm on its own will not, as the current directory is not usually part of the executable path.
Additionally, the program will need its executable bit set.