emacs

Single most useful example of using dired (Emacs)

What is your single most useful example of using dired mode in Emacs? Any nice tricks? Please one example per answer. ...

How do I enable line numbers (on the left) everytime I Open Emacs?

I enable them by pressing: M-x linum-mode. How can I "translate" that into my.emacs file in order to enable it automatically every time I open EMACS? ...

Is it possible to use align-regexp in wdired mode (Emacs)?

Is it possible to use align-regexp in wdired mode (Emacs)? I want to align folder names that contain a space after the first word. So: folder1xxx xxxxx folder2xx xxxxxx folder3xxxx xxxxx where x can be any alphanumeric character, should become something like this: folder1xxx xxxxx folder2xx xxxxxx folder3xxxx xxxxx As of now ...

Highlight block scope under point ?

I remember seeing this functionnality while editing elisp code, using a config cloned from someone on github. However, I can't find it anymore, and would especially like to know if this feature is possible using other major modes (especially javascript, ruby, and maybe nXhtml). ...

Emacs mode 1, 2 and t (what t stands for)?

For instance, global-linum-mode 1 enables line numbers global-linum-mode 0 disables line numbers, what global-linum-mode t would do? and I've seen another parameter: nil. What do they do? ...

Can't make Yasnippets work in Emacs, help!

I can't make Yasnippets work (normal version). When I start Emacs it says: error: Error ~/.emacs.d/plugins/yasnippet-0.6.1c/snippets/ not a directory I added this to my .emacs file: (add-to-list 'load-path "~/.emacs.d/plugins/yasnippet-0.6.1c") (require 'yasnippet) ;; not yasnippet-bundle (yas/initialize) (yas/load-di...

I need help with YASnippet and tab width

I'm used to have 4 spaces of Tab width. YASnippets uses 2 spaces in its snippets for instance: <div id="$1"> $0 </div> I thought this would turn it into 4 spaces: <div id="$1"> $0 </div> but no luck... So I also tried: (setq-default tab-width 4) (setq-default indent-tabs-mode t) (setq tab-stop-list '(4 8 12 16)) but no lu...

How to open files in web browsers (e.g Firefox) within editors like vim or emacs?

How to open files in browsers (e.g Firefox) within editors like vim or emacs? Notepad++ open files in browsers by pressing Ctrl+Shift+Alt+X (Firefox). Is there a way to do this in gVim or Emacs? ...

Emacs slow startup when changing theme and adding some plugins

Is it normal form Emacs to delay and flash during 4 seconds after changing theme, adding plugins and configuration? (this doesn't happened with Vim). Here is my .emacs: ;; set tab width ;; turn on tabs (setq indent-tabs-mode t) (setq-default indent-tabs-mode t) ;; bind the tab key (global-set-key (kbd "TAB") 'self-insert-command) ;...

Simple way to add escape characters to a string

Does anyone have a simple tool that can convert a non-escaped string to an escaped string? For example, I'm trying to paste the following data into a Java String datatype: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> I manually have to add the slashes: <?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?> Then...

Emacs VCS interface commits only one file

When I commit changes with Emacs' built-in VCS interface (I use it with Bazaar) it commits only one file - that's open in current buffer. So when I press C-c v v, enter message and C-c C-c, it does something like bzr commit -m "my message" file/open/in.buffer instead of bzr commit -m "my message" How to commit all changes with Emac...

how to setup common emacs environment for windows and linux computers?

I use emacs for text editing and script development. I use both windows and ubuntu emacs 23.1 distribution. Now I want both my linux and windows environment to replicate the same environment. I will save my emacs environment here https://bitbucket.org/krish/emacs/, so file synchronisation will not be problem. I don't have any differe...

Since Emacs and VIM are just text editors, does that mean I have to copy paste the code into an IDE so it can be compiled?

Not much else to ask. ...

cannot open file cua in second instance of emacs

i get the following error when trying to open a second instance of emacs: File error: "Cannot open load file" , "cua" I guess I don't HAVE to open another instance of emacs (that is the beauty after all), I was just trying to keep some things separated (specifically work - like code and debug - and play - like news). Would there be a...

^M in file names & find-file

Update: This only occurs when I access the particular server from a Windows machine With emacs tramp (plink) I'm logging on to 2 different servers, and am experiencing a problem in one of them with find-file. If I do tab completion in a directory, all file names have ^M appended to them, e.g.: Click <mouse-2> on a completion to select...

Emacs php-mode: Removing duplicate <?php in header-line of php files

Hi all, I use emacs php-mode.el and php-electric.el. I want to get rid of the duplicate <?php overlay that shows up at the top of any php file. The extra <?php is not actually in the file, but is a semi transparent visual overlay that emacs is adding. I've done some research, and I think changing this might involve the emacs lisp heade...

Text editor and text-file-based hyperlinks

Background: It seems that some text editors and IDEs are starting to get more "browser-like" in their features. Specifically, one such feature is the ability to treat ordinary text in an open text buffer as a hyperlink to another file, resource, or even a runnable command. Programming this as an editor plugin or macro Since this seems...

Unindenting code snippets

There are times that I have a code snippet that I want to post on a defect tracker, wiki, forum, etc. but it's deeply indented in the code. I usually have to highlight the code snippet, hit <shift>-<tab> until the indents aren't so bad, then copy/paste and then revert the code. It gets somewhat painful. Is there a tool that can remo...

OpenGL context inside Emacs buffer

I'm looking for a way to render an opengl scene inside an emacs buffer. Is there a best-practice way of doing this? ...

save and compile automatically

Hello GNU 23.1.1 By clicking the F5 button I can compile my project. However, I want to extend this so that any unsaved work would be saved and then compiled. Normally I just do C-x-s to save then click F5. But can I add a line that will save without having to ask me do I want to save then it will compile, all done automatically? ; ...