This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar adv-destination-room-overlay nil) | |
(make-variable-buffer-local 'adv-destination-room-overlay) | |
(defun adv-fontify-destination-room (s) | |
(set-text-properties | |
0 (length s) | |
`(face (:foreground ,(format "#%02x%02x%02x" 30 30 30))) | |
s) | |
s) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Keep emacs Custom-settings in separate file | |
(setq custom-file (expand-file-name "custom.el" user-emacs-directory)) | |
(load custom-file) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Use lambda for anonymous functions | |
(font-lock-add-keywords | |
'js2-mode `(("\\(function\\) *(" | |
(0 (progn (compose-region (match-beginning 1) | |
(match-end 1) "\u0192") | |
nil))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 's) | |
(require 'cl) | |
(require 'assoc) | |
(defvar kmbot--file ".kmbot-memory.el") | |
(defvar kmbot--definitions nil) | |
(defun kmbot--dump-list (list-symbol) | |
"Insert (setq LIST-SYMBOL LIST-VALUE) to current buffer." | |
(let ((value (symbol-value list-symbol))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(add-hook | |
'find-file-hook | |
(lambda () | |
(when (string-match-p "projects/my-project" (buffer-file-name)) | |
(setq js2-additional-externs '("my" "additional" "externs"))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; To use, replace these values in your hippie-expand-try-functions-list: | |
;; | |
;; try-expand-dabbrev => try-expand-dabbrev-closest-first | |
;; try-expand-line => try-expand-line-closest-first | |
;; | |
(defvar he-search-loc-backward (make-marker)) | |
(defvar he-search-loc-forward (make-marker)) | |
(defun try-expand-dabbrev-closest-first (old) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Elisp go-to-definition with M-. and back again with M-, | |
(autoload 'elisp-slime-nav-mode "elisp-slime-nav") | |
(add-hook 'emacs-lisp-mode-hook (lambda () (elisp-slime-nav-mode t))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun create-scratch-buffer nil | |
"create a new scratch buffer to work in. (could be *scratch* - *scratchX*)" | |
(interactive) | |
(let ((n 0) | |
bufname) | |
(while (progn | |
(setq bufname (concat "*scratch" | |
(if (= n 0) "" (int-to-string n)) | |
"*")) | |
(setq n (1+ n)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Add spaces and proper formatting to linum-mode. It uses more room than | |
;; necessary, but that's not a problem since it's only in use when going to | |
;; lines. | |
(setq linum-format (lambda (line) | |
(propertize | |
(format (concat " %" | |
(number-to-string | |
(length (number-to-string | |
(line-number-at-pos (point-max))))) | |
"d ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; turn line numbers off by default | |
(global-linum-mode -1) | |
(defun goto-line-with-feedback (&optional line) | |
"Show line numbers temporarily, while prompting for the line number input" | |
(interactive "P") | |
(if line | |
(goto-line line) | |
(unwind-protect | |
(progn |