emacs

Emacs Lisp, how to monitor changes of a file/directory

I'm looking for a way to check periodically if a files under a certain directory were changed from the last check (a functionality symilar to FAM daemon or to gio.monitor_directory). In emacs lisp. Are there any library/snippet that provide this functionality? If not, how can I implement such a function? ...

Carbon emacs problem

I installed Carbon EMACS tody but I have a problem with the shift key: I can't select region hoding down shift and moving with harrows. Do you have any suggestion? Best Riccardo ...

showkey equivalent on mac os x?

I'm debugging an emacs keyboard binding on my mac (C-/ to undo, if you're curious), and I came across a suggestion on EmacsWiki that I could use "showkey" to find the scancode. But it looks like a GNU/Linux-only kinda thing. Didn't find it on MacPorts. Anyone know of an alternative or something I'm missing? ...

Emacs/Auctex: Automatically enabling/disabling LaTeX-Math-mode

Hello, I'm using Emacs in conjunction with AucTeX (running Ubuntu 10.04, if that matters). Does anyone know if there is a way to automatically enable LaTeX-math-mode (a minor mode of AucTeX) if the point is in any maths environment (i.e. in a $...$, a $$...$$, begin{equation}...\end{equation}, and so on)? I suppose there is a relative...

How to use SSH and SUDO together with TRAMP in Emacs

I want to open a file using sudo (say, /etc/hosts) on a remote machine connected by ssh using TRAMP on Emacs. I tried couple of options, but none of them worked. Can anybody tell me how to go about it? Thank you ...

emacs: remapping C-[ (currently ESC)

I'm using emacs 23 on ubuntu 10.04. I would like to remap the "C-[" binding. Currently, when I press it, it gives me "ESC". Is there a way to remap it? ...

Emacs, unicode, xterm mouse escape sequences, and wide terminals

Hi all, Short version: When using emacs' xterm-mouse-mode, Somebody (emacs? bash? xterm?) intercepts xterm's control sequences and replaces them with \0. This is a pain on wide monitors because only the first 223 columns have mouse. What is the culprit, and how can I work around it? From what I can tell this has something to do with ...

How do I connect a clojure source file to a running clojure repl on Emacs?

I'm currently in the process of adding functionality to an existing J2EE webapp, in a Tomcat container, and I'm writing my additions using Clojure. My setup is simple: I just add calls to static methods generated by clojure, and code all the hard work from the clojure side. The build process consists in compiling clojure code (lein uberj...

How to get emacs to highlight and link file paths

Is there some emacs lisp code that would automatically find /nfs file paths in the buffer and highlight/link to them? So clicking on them would open that file? Example path: /nfs/foo/bar/file.txt ...

Emacs 23.1.1 with gdb - forcing source windows

I'm using emacs 23.1.1 with gdb and gdb-many-windows. My question is if it's possible to force gdb to always use the main source window for stepping through the code. What happens is that as I move through stack frames, if I happen to have the source file up in another emacs frames, emacs brings that frame to the foreground while leavin...

Popping an element from an association list in lisp (elisp)

I'm searching for a way to "pop" an element from an association list, in other words a "destructive" assoc: (setq alist '((a . 1) (b . 2)) (assoc-pop 'a alist) ;; -> (a . 1) ;; alist -> ((b . 2)) Are there any function in the elisp harness? What's the most elegant way to obtain a symilar functionality? (not sure about that this sort o...

Emacs print margin column

Hey guys, is there any way to show a real print margin at a specific column (e.g. 80), such that the background gets another color for columns above "n" or a solid line is shown at this column? I found ColumnMarker (see here), unfortunately, this addon only highlights text that is beyond the specified column. What I've also tried is c...

Show Keys In Emacs Keymap Value

When I query the current value of the keymap it shows me something along these lines: Value: (keymap (S-mouse-2 . muse-follow-name-at-mouse-other-window) (mouse-2 . muse-follow-name-at-mouse) (33554445 . muse-follow-name-at-point-other-window) (S-return . muse-follow-name-at-point-other-window) (13 . muse-follow-name-at-point) (...

Unreadable buffer names in Emacs 23.2

I just upgraded from Emacs 21.2 to 23.2 (on Windows XP) and while I managed to tweak my .emacs to fit the new changes, I couldn't find a solution for the unreadable buffer names: Neither in the minibuffer, nor in the buffer menu can the characters be displayed normally. Instead, all I see are the infamous Unicode blank rectangles. Any ...

Emacs - random color theme every hour?

I know that to (funcall (car (nth (random (length color-themes)) color-themes))) gives me a random color theme on every Emacs startup; but I hardly restart Emacs. How do I cycle between random color themes, say, every hour? ...

Is there any ECB (or other)-enhanced find file mojo?

Can I use ECB (or some other project aware thing, like eproject, ibuffer, etc.) to enhance emacs's find-file goodness? Imagine this scenario: I have several projects/directories specified in my ecb-source-path, let's call them Project1 and Project2, and they look like so: Project1 foo.c bar.c Project2 foo.c baz.c I'd like to...

emacs term kill word strange behavior

I have noticed strange behavior when using term-mode if I kill word in termmode using shell shortcuts (Alt-d), word disappears, but actually does not get killed. Here is an example andrey@localhost:~ yes no-such-file # press Alt-d andrey@localhost:~ no-such-file no-such-file no-such-file no-such-file rather than andrey@localhost:~ n...

Emacs modes for flex and bison, or removing auto indent for these modes?

Emacs has poor handling of auto-indentation in Flex and Bison. In fact, it seems to have no support for flex mode. So, how does an emacs user cope with these? I like VIm but I would prefer not to switch because I am much faster and more comfortable in Emacs. I had a third party elisp module for Bison a few months ago but when its inden...

Is there a good Vi(m) command for transposing arguments in a function call? Bonus points for Emacs

For example if I have some code like: foo = bar("abc", "def", true, callback); Is there a nice command to move true to the 1st or 2nd position leaving the commas intact? P.S as a bonus my friend want to know if this works in Emacs too. ...

define bash aliases for Aquamacs shell

Hi, for Emacs you can define your shell-mode aliases in .emacs.d/init_bash.sh, but Aquamacs (2.0 on OS X 10.5) does not seem to use this. Is there another place where these can be defined? ...