Say I've got two web based xml files that I would like to diff (test output vs. baseline). My current work-flow is to manually download the files to a temporary folder and load them into Emacs for diffing. I'm pretty sure there are better ways to do this but I'm stumped, especially as all the Emacs functions seem to open the URL in a browser,
Any solutions \ suggestions greatly appreciated.
As that answer suggests, browse-url-emacs should do the trick.
I personally use (url-handler-mode 1) so you can visit a web page with C-x C-f http://foo/bar RET.
Related
I want to keep my .emacs in my Dropbox folder, to sync it between work and home.
I moved my .emacs to my dropbox folder and then (hard) linked it like:
ln ~/Dropbox/.emacs ~/.emacs
Then if I open ~/.emacs in emacs, edit and save it, it deletes the .emacs hard link and overwrites it with a fresh .emacs so the linkage is gone. I have two seperate copies, a newer ~/.emacs and an out-of-date ~/Dropbox/.emacs.
I could edit the ~/Dropbox/.emacs file instead, but sometimes emacs write something into the .emacs by itself (say customizing variables) and the issue occurs again.
How can I get emacs to not overwrite that particular file? Or is there a way to launch emacs and tell it where to read the .emacs from?
[edit SOLVED]
Some guy posted a comment about using soft-symlinks instead of hard-links. This actually works for me and solved the issue. But then the guy who posted the comment deleted it again for some reason. ~thank you who ever it was~
I would heartily recommend that you place your emacs configuration files into a GIT repository.
I have a github repository for all of my elisp file, which enables me to share the files with any computer and track changes.
I used softlinks instead, which solved the issue.
An alternative suggestion (which I use): Let ~/.emacs (or ~/.emacs.d/init.el) be different for each computer you use. Use that file to set up system-dependent paths— the location of your Dropbox directory, the path to diff, the colors that work best on that monitor, whatever. Then load (require) a common file that contains all of your usual (system-independent) configuration. Call it "leo-init" or something.
And I heartily agree with the prior suggestion to put your emacs config into a git repository (or other vcs). It's fantastic peace of mind to know that if you screw something up, you can go back to the way it was— or examine in detail what exactly you changed and when.
Is there a way to configure emacs so that whenever I open a file under a certain path it will automatically search (and in case load) a TAGS file in a part of the path? So for instance when opening
/usr/src/foo/baz/bar.c.It will load
/usr/src/foo/TAGS file?
I'd suggest you going through this wiki. There is a good example of doing the same with etags (Auto refresh of the tags file) (which I won't post here), but hopefully it's no so hard to make it work for ctags.
Check out this package http://www.emacswiki.org/emacs/EtagsTable It's available on MELPA and does exactly what you want.
http://blog.binchen.org/posts/how-to-use-ctags-in-emacs-effectively-3.html
The point is in this case, a little bit elisp code is more versatile, I've been using this solution for two years.
I created a TAGS file for emacs in my django project using the following command on my Linux machine
ctags -eR *
I can now jump to a symbol definition using M-. and specifying the symbol name.In my project i have py,html and css files so is there also a way i can make emacs automatically open a file, if i specify the file name ?.
Thank You
I think you are looking for project management. There are few packages to manage project directory in emacs. The best one may be ede. but Its not easy to setup. It does have some learning curve and its limitations.
Thankfully there are many easy ones. like eproject. https://github.com/jrockway/eproject/wiki
anyway you can also check out emacswiki page for more details. http://www.emacswiki.org/ProjectSettings
http://www.emacswiki.org/emacs/find-file-in-tags.el
IDO (Interactive Do) mode does this. If you activate it, C-x C-f searches for files matching what you are typing, interactively. Beware though, it may take some time to get used to it.
[edit] The search is based on files or directories you've recently visited, and you can use M-s to force a search.
From the comments, I figured that you are looking for has nothing to do with tags, you just want a better find-file that makes good automatic guesses for the path given only the file name.
For this, I use the entirely awesome ido-mode: http://emacswiki.org/emacs/InteractivelyDoThings
A while ago I saw something go by for 'search in project' etc support in Emacs where the definition of a project was simply looking from the current directory up til a .git or other source control directory was found.
I unfortunately didn't bookmark the project as I was off in Smalltalk land and didn't need Emacs at the time. I'd really appreciate pointers to the specific project I'm vaguely referencing or one that does the same thing. I've looked at eproject which seems close, but isn't quite what I'm remembering.
So what I was looking for, I finally found.
Textmate minor mode:
https://github.com/defunkt/textmate.el/
Have a look at this SO question. It sounds like what you're looking for is find-file-in-project.el. The EMACS Wiki is usually a good source for this kind of question.
You are probably looking for eproject and its eproject-find-file and/or eproject-grep functions.
I use TAGS for my project, and recently wrote this answer for igrep-in-tags, which does a regexp search through all the files in the TAGS and gives the output in a compilation style buffer.
From what I can tell from the docs, semantic works by slowly building up an idea of what's in your project by analysing each file (and possibly its neighbours) as you visit them. This is too slow. I'd like to just have it visit all the files in my project. Is there an easy way to do this? Having to visit hundreds of files before I can get decent autocomplete working seems crazy.
I've also got a etags file generated. Can I leverage that somehow?
Relevant info: Emacs on Windows, version 23.2.1
CEDET will automatically parse all files references via #include statements, thus providing pretty good completion. If you are looking to jump around in your files, you can setup CEDET to use GNU Global, CScope, to provide the database needed to move around a project by tag name.
In addition, CEDET will parse your headers and nearby files in idle time, so eventually you will have a complete database of all your local files in about 10 minutes after using the tools the first time. You can speed it up by opening a file, and calling
M-x semantic-debug-idle-work-function
which will go off and do that stuff without waiting.
In the end, I've found that the best solution is to brute-force the parsing of the files manually using a bit of elisp. The best answer I've found to this is here.