Emacs Lisp: difference between (function (lambda …)) and (lambda …)?

What is the difference between (function (lambda …)) and (lambda …) and ‘(lambda …) ? It seems three are interchangeable in a lot of cases. Answer They are pretty interchangeable. The answer is that function enables the lambda to be byte compiled, whereas the other two do not (and are equivalent). Note: this does not … Read more

Emacs: Often switching between Emacs and my IDE’s editor, how to automatically ‘synch’ the files?

I very often need to do some Emacs magic on some files and I need to go back and forth between my IDE (IntelliJ IDEA) and Emacs. When a change is made under Emacs (and after I’ve saved the file) and I go back to IntelliJ the change appears immediately (if I recall correctly I … Read more

Emacs Brace and Bracket Highlighting?

When entering code Emacs transiently highlights the matching brace or bracket. With existing code however is there a way to ask it to highlight a matching brace or bracket if I highlight its twin? I am often trying to do a sanity check when dealing with compiler errors and warnings. I do enter both braces … Read more

Open in emacs: No connection could be made because the target machine actively refuse it

I have followed post to enable emacs in windows explorer by adding following registry: Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell\Open In Emacs] [HKEY_CLASSES_ROOT\*\shell\Open In Emacs\Command] @=”\”C:\\Unix-Bin\\emacs-24.3\\bin\\emacsclientw.exe\” -a \”C:\\Unix-Bin\\emacs-24.3\\bin\\runemacs.exe\” \”%1\”” Before today it works good. But today I find when to open file with “Open in Emacs” menu, following error will popup. And later the file … Read more

Check if current Emacs buffer contains a string

I have a buffer open in emacs. I want a function that will return t if the current buffer contains the string, otherwise it returns nil. (defun buffer-contains-substring (string) … ) Answer This is careful to not change where you are, or damage any match data. (defun buffer-contains-substring (string) (save-excursion (save-match-data (goto-char (point-min)) (search-forward string … Read more