emacs

Changing font-lock color in SMerge mode

In Emacs 23.1 I'm opening up a file with conflict markers from a svn merge and consequently it opens it up in SMerge mode. The conflicted text is highlighted in bright yellow. From what I could find this is whatever the font-lock color is set to, correct? I'd like to change the highlight color in SMerge mode. What would I need to a...

How to choose system type in Emacs

Hello all, I'm trying to configure my .emacs file to work in a Windows, Linux, and Mac environment--specifically, I need it to choose the correct font and a certain directory for org-mode. I have tried the following which loads the correct font, but does not load the path specified for org-mode: ;; On Windows (if (eq system-type 'win...

Adding Completion to (interactive)

Is there any way to add my own completion to an (interactive) elisp function? Ideally, I'd like to pass it a list of strings that it would tab-complete from. I know that using (interactive "D"), (interactive "F") or (interactive "b") give you completion for directories, files and buffer-names respectively, but what about more general inp...

Emacs, Django templates and script blocks

I use emacs when working with Django. .py files work great with Python-mode, .js files work great with js2-mode, .djhtml (templates) work great with django-html-mode -- except for Javascript blocks which aren't auto-indented nor highlighted. Does anyone know of a way to get syntax-highlighting for Javascript blocks in Django templates i...

Emacs: same buffer, two windows, one narrowed, one not

I find the narrow-to-region command useful, however it applies to the buffer and not to the current window. I'd like to have one window display a narrowed version of the buffer, while the buffer is displayed widened if it occurs in any other window. Is this possible? ...

I can't find this: How do I use 4 SPACES instead of a TAB in EMACS?

I am making the jump to EMACS, and I can't find what I need to do in my .emacs file to get php-mode AND all other modes to insert 4 spaces instead of a TAB. Help? UPDATE: When I hit tab I still get 8 spaces in a plain file with the given answers. In php-mode I still get 2 spaces. Hitting tab in php mode does nothing, tab in regular EMA...

Featureful commercial text editors?

I'm willing to buy tools if they add genuine value over a FOSS equivalent. One thing I wouldn't mind having is an editor with the power of Emacs, but made more user-friendly. There seem to be several commercial editors out there, but I can't find much discussion of them online. Maybe it's because the kind of people who use commercial sof...

Is it possible to use js2-mode as javascript mode with nxhtml?

Is it possible to use js2-mode as javascript mode with nxhtml? ...

Auto-detect language in Emacs

If i have a Python (or any other language) file in a buffer in fundamental mode, is there a command that i can use to make the buffer auto detect what language it should be in and switch accordingly? ...

Setting input method of Emacs on launch

I have set my default-input-method variable to "english-dvorak": (custom-set-variables '(default-input-method "english-dvorak")) When I launch Emacs, this input method is not selected. How can I make it so that all buffers by default open in this input method? ...

Any good Emacs intro videos?

I was wondering if anyone knew of any good Emacs videos. I've found a few Vi ones like: http://vimeo.com/6999927 [~25min overview] http://www.youtube.com/watch?v=71YTkxUNwmg [~11min introduction] http://www.derekwyatt.org/vim/vim-tutorial-videos/ [Tutorial series] And hoped that I might find something similar for Emacs so I could ...

How do I set Org Mode Agenda default formatting in Emacs?

I want the Org Mode Agenda to have very different formatting to the rest of Emacs. How can I make this happen every time the Agenda is generated? (N.b. this is not the same question as this because Org Mode specifies different faces depending on how near a deadline is, and other information that is not given in the Agenda buffer.) Than...

matching keys in association lists in emacs lisp

Hi, I'm using folding-mode in emacs and was trying to make a function to insert the appropriate folding marker (start or end) depending on mode. So far I have (defun insert-folding-mode-mark () (interactive) (let ((st "##{{{") (en "##}}}") string-to-insert) (save-excursion (setq string-to-insert ...

Let emacs send F<n> keys to programs in 'ansi-term'

Any hints on how to let emacs send unbinded F1..F12 keys to programs just like in regular terminal when in 'ansi-term' buffer? ...

declaring the mode an emacs file should be opened in

how can I write, as a comment within a file, the mode that this particular file should be opened with in emacs? for example, suppose I have a script called "foo". In the body of foo, I'd like to put something like: # sh-mode # rest of my script here... to emacs that "sh-mode" should be used when "foo" is opened in emacs. Note, I do...

Adding a submode to nXhtml

Having made the jump just recently from XEmacs to GNU Emacs, I'm really loving nXhtml mode for writing web code. I'd like to be able to add a sub mode to it, though, and I'm not sure how. There doesn't seem to be a good reference to do so. I have a mode for Perl's Template Toolkit, loaded as tt-mode and the default for .tmpl files, an...

How do I set up the Clojure classpath in Emacs after installing with ELPA?

I'm trying to add paths to my classpath in the Clojure REPL that I've set up in Emacs using ELPA. Apparently, this isn't the $CLASSPATH environment variable, but rather the swank-clojure-classpath variable that Swank sets up. Because I used ELPA to install Swank, Clojure, etc., there are a ton of .el files that take care of everything in...

Why is there no code-folding in emacs ?

There are several questions on SO about how to get code folding in emacs, without having to add any special characters like "markers" in the comments for example. Someone said that there was "no perfect solution." It seems that it could be done by parsing the source of the program being written and look for matching parenthesis or bracke...

Which conveniences does CEDET bring to dynamic languages ?

I've been looking into CEDET, but it seems that most of its features would appeal more to developpers working in statically typed languages, and I'm kind of getting cold feet from the amount of tinkering it seems to require. As I work mainly with ruby and javascript, I'm wondering what kind of improvements it could bring when working ...

Overriding a function in Emacs Lisp

I would like to temporarily override the kill-new function. I have a way I want to reimplement kill-new that works in only in certain contexts, but I don't want to reimplement a special version of kill-region on top of that. (kill-new is called from kill-region) Since Emacs Lisp uses dynamic scoping, this should be possible, right? (...