50 lines
1.3 KiB
EmacsLisp
50 lines
1.3 KiB
EmacsLisp
(defgroup agw nil
|
|
"Alison G. Watson's customizations."
|
|
:prefix "agw-"
|
|
:group 'convenience)
|
|
|
|
(defvar agw-mode-map (make-sparse-keymap)
|
|
"Global keymap for `agw-mode'.")
|
|
|
|
(define-minor-mode agw-key-map
|
|
"Minor mode for key bindings."
|
|
:global t
|
|
:keymap agw-mode-map)
|
|
|
|
(defun agw-set-key (key def)
|
|
"Binds a key into `agw-mode-map'."
|
|
(define-key agw-mode-map (kbd (concat "C-<tab> " key)) def))
|
|
|
|
(defun agw-touch (fname)
|
|
"Touches a file asynchronously."
|
|
(interactive "FFile to touch: ")
|
|
(start-process "agw-touch" nil "touch" (expand-file-name fname)))
|
|
|
|
(defun agw-fp-mode ()
|
|
"Sets up lisp and other functional language major modes."
|
|
(setq-local indent-tabs-mode nil)
|
|
(setq-local standard-indent 2)
|
|
(setq-local tab-width 2))
|
|
|
|
(defun agw-org-mode ()
|
|
"Sets up `org-mode'."
|
|
(setq-local indent-tabs-mode nil)
|
|
(setq-local standard-indent 2)
|
|
(setq-local tab-width 2))
|
|
|
|
(defun agw-dired-mode ()
|
|
"Sets up `dired-mode'."
|
|
(local-set-key (kbd "C-c t") #'agw-touch))
|
|
|
|
(defun agw-remove-elc ()
|
|
"Removes an elc file if it exists."
|
|
(let ((elc (concat buffer-file-name "c")))
|
|
(if (file-exists-p elc)
|
|
(delete-file elc))))
|
|
|
|
(defun agw-el-mode ()
|
|
"Sets up `emacs-lisp-mode'."
|
|
(add-hook 'after-save-hook #'agw-remove-elc nil t))
|
|
|
|
;; EOF
|