Category: Programming
Not Killing Emacs on Windows
On windows, many people use the built-in server and emacsclientw to make startup faster. The basics for this are discussed here. I have a slightly modified version that closes a buffer opened through the server mode. I often open up code through emacsclientw, edit, save then close. The following code helps make this a more automatic process and give the feel of opening the editor, editing and then closing through normal keystrokes.
(defun bnb/exit ()
(interactive)
; Check for a server-buffer before closing the server-buffer
(if server-clients
(server-edit))
(make-frame-invisible nil t))
(global-set-key (kbd "C-x C-c") ‘bnb/exit)
While that code is great, it does not stop me from clicking the ‘X’ to close emacs. To ensure that this does not kill emacs, I advise the kill-emacs function. The advice … Read More »
SyntaxHighlighter elisp brush
I plan to post some of my elisp code from emacs customizations. I want them to be pretty and useful, so I wrote an elisp brush for the SyntaxHighlighter javascript library.
There are only a few styles defined, but I think it adds to the code’s readability. I have included the comments, strings, tags and hashes of elisp in the styles. I have also set special coloring for a collection of the ‘def’ commands. A sample set is shown below.
;; Comment
(defun declared-function-name
(basic-function "string1")
(another-function :tag value))
;; Another comment
(defcustom custom-var t)
(defface face)
(defvar variable ‘setting)
(defmacro like/a/function)
;; Last Comment
(defadvice printMsg (before ‘basic-function)
(message "Marco!"))
That example is a bit too colorful for my taste, but I am hopeful that the highlighting will add something to real world elisp examples.
The implementation … Read More »