emacs

Working in both emacs and Textmate

I have an Ubuntu Linux development machine and a Macbook that I work on. On my laptop I use Textmate for PHP development on the go. The problem is that when I return to my Ubuntu dev machine and open my files in emacs, the formatting is off. I think it looks like one tab in Textmate is for some reason several tabs in emacs. So my code ta...

How can I remap the prefix keys 'c', 'd' etc. in Emacs viper-mode

I'm using the Colemak keyboard layout, and want to try the Vim layout from here with Vimpulse. However, the layout remaps the command prefix Vim keys 'c' and 'd' among others, and these keys don't seem to be easily remappable with the standard Viper key remap command. They are all mapped to "viper-command-argument" in the viper keymap, a...

What unix text editor should I learn?

Maybe this should be a community wiki page... What unix text editor should I learn? My co-workers mostly use vi. I am thinking about vim because the syntax highlighting seems appealing. Is there any advantage to vi over vim? I know that there are a lot of emacs fans out there too? Is there any reason to learn a specific editor? ...

Default string for grep-find in emacs

I often use the command grep-find in emacs to search through my source files, but it's annying that it always finds matches in temporary files and backup files and so on. The default command for grep-find is: find . -type f -print0 | xargs -0 -e grep -nH -e I know I can modify it before I run it to match my needs but how do I change i...

Code completion key bindings in Emacs

When doing a M-x describe-mode in a .el file, I noticed that the Emacs-Lisp mode actually does code completion. However, lisp-complete-symbol is bound to M-TAB. In Windows, this key binding is taken by Windows for switching the active window. Most IDE's use C-SPC, but that's taken in Emacs as well. What is a good, fairly common key b...

Can I detect the display size/resolution in Emacs?

I'd like to change the window/frame size of my XEmacs based on the current display resolution. This is useful when I run my laptop either by itself or attached to a docking station with an external monitor. In either situation, I'd like Emacs to detect the primary screen resolution and adjust its main window frame size accordingly when ...

File, Edit, Options, etc. menus don't work on Emacs 23, any ideas?

Hi - I upgraded to Emacs 23 a while back and when I did the File, Edit, Options, and other menu options are not available on OS X Snow Leopard. Any ideas how to get them back? Thanks! ...

sending buffer region to the repl in emacs

hi i'm using quack mode with mzscheme, is there a way to send(evaluate) the whole toplevel contents to the REPL window? i checked the key bindings but i don't see any commands for this, there are options only for sending last sexp, last definition etc. ...

Is there a good Emacs mode or method for lex/flex/yacc/bison files?

Editing lex or yacc files with Emacs is a nuisance: if I use C mode the indenting goes wrong, and if I don't use C mode I can't use indenting. Does anyone have a trick, a method, or an editing mode to get around it? ...

Colorize snippets of text in emacs

Hello. Suppose I have a few words I would like to highlight, so I want to change the color of those few words only to, say, green. Is there an easy way to do this in emacs? Thank you. ...

how to get grep working in Emacs on Windows (EmacsW32)

M-x grep, M-x lgrep, M-x rgrep don't work in EmacsW32 for me. I do M-x lgrep and it says grep is not a command: grep -i -n "hello" * NUL 'grep' is not recognized as an internal or external command, operable program or batch file. Grep finished with no matches found at Sun Jan 31 05:59:06 Also what is that NUL thing? EmacsW32 homepag...

Writing "Hello World" in Emacs?

I would like to write a few Unix scripts in Emacs Lisp. However, there doesn't seem to be a clean way to write to STDOUT so I can redirect the results to a file or pipe the output to another command. The print function places double quotes around the output strings so I get "Hello world!" instead of Hello world!. Here's the emacs scri...

I want to change the way text is represented internally in ANY Text Editor

I want to use a algorithm to reduce memory used to save the particular text file.I don't really know how text is stored but i have an idea in mind. Would it be better to extend a open source text editor (if yes than which one) or write a text editor myself. It would be nice if someone could also give me a link or tutorial to some basic...

Emacs: how to evaluate the smallest s-expression the cursor is in, or the following s-expression

What is a good way to evaluate the (+ 100 (+ 100 100)) part in (+ (+ 1 2) (+ 100 (+ 100 100))) ? For now, I do it by C-x C-e, which means I need to locate the ending parenthesis, which is difficult in most cases. Options > Paren Matching Highlighting helps, but still I need to move the cursor toward the ending parenthesis until the h...

Emacs equivalents of Vim's dd,o,O

Hi there, I am currently playing around with emacs and happy with most of the concepts. But I really adored the convenience of the three vim commands: dd,o,O Hopefully you can tell me how to mirror them in emacs :) dd - deletes whole line, including newline, no matter where the cursor is. I found something similar to do the trick:...

How to switch to a different buffer from a terminal buffer

I've been using emacs for few weeks and it's been great so far - coming from vim was easier than I expected (actually - emacs' keyboard shortcuts feel more... natural). I have added few customizations like moving between buffers using M-Left/Right/Up/Down because C-x o felt a little bit too slow when I had four files opened at once. S...

Open file via SSH and Sudo with Emacs

I want to open a file inside Emacs which is located on a remote server, with sudo powers on the server. I can open local files with sudo via Tramp like this: C-x C-f /sudo::/home/user/file But I want to use sudo on the server: C-x C-f /sudo::user@server/home/user/file But this gives me sudo powers on my local machine, it asks for m...

How to copy to clipboard in Emacs Lisp

I want to copy a string to the clipboard (not a region of any particular buffer, just a plain string). It would be nice if it were also added to the kill-ring. Here's an example: (copy-to-clipboard "Hello World") Does this function exist? If so, what is it called and how did you find it? Is there also a paste-from-clipboard funct...

Minor Mode for tracking changes in a buffer

Is there a minor mode in Emacs that will highlight changes made to a buffer? I'm picturing something like highlight tails without a timeout feature. I would use highlight tails for this and change the timeout rate to be something huge, but the mode seems to consume a bit of CPU to do the timing (a feature I wouldn't use). ...

What’s a good way to deal with a german keyboard when using Emacs on Mac OS X?

Maybe it’s a bit weird to ask this question in English because my problem is a rather non-English one. I’m an Mac OS X user and I’m on my way to learning Emacs. I decided to use the Emacs 23.1 Cocoa build that by default uses the Mac keyboard’s alt/option key as the meta key. But because I am German and I’m using a German keyboard, of co...