(following-char) (preceding-char) (char-after) (skip-chars-forward) (bury-buffer) (browser-url) (expand-file-name) (file-name-as-directory) ; append a slash (directory-file-name) ; remove final slash (file-name-directory) ; directory component (file-name-nondirectory) ; filename (directory-files) ; get files list in a directory emacs -batch -f batch-byte-compile thefile.el (defun quote-range (ch &optional pair) (if (region-active-p) (let ((begin (region-beginning)) (end (+ (region-end) (length ch)))) (goto-char begin) (insert ch) (goto-char end) (insert (or pair ch))) (insert ch))) (global-set-key "'" '(lambda () (interactive) (quote-range "'"))) (global-set-key "\"" '(lambda () (interactive) (quote-range "\""))) (global-set-key "(" '(lambda () (interactive) (quote-range "(" ")"))) ;; Compile your .emacs (defun autocompile nil "compile itself if ~/.emacs" (interactive) (require 'bytecomp) (let ((dotemacs (expand-file-name "~/.emacs"))) (if (string= (buffer-file-name) (file-chase-links dotemacs)) (byte-compile-file dotemacs)))) (add-hook 'after-save-hook 'autocompile) ;; Compile2 (require 'bytecomp) (setq compiled-init-file (byte-compile-dest-file user-init-file)) (if (or (not (file-exists-p compiled-init-file)) (file-newer-than-file-p user-init-file compiled-init-file) (equal (nth 4 (file-attributes user-init-file)) (list 0 0))) (load user-init-file) (load compiled-init-file)) (add-hook 'kill-emacs-hook '(lambda () (if (file-newer-than-file-p user-init-file compiled-init-file) (byte-compile-file user-init-file)))) ;; http://www.emacswiki.org/emacs/OptimizingEmacsStartup ;; autoload & eval-after-load