-#+TITLE: My Personal Init Customization
+#+title: My Personal Init Customization
#+OPTIONS: toc:nil num:nil ^:nil
* copyright
# Copyright (C) 2017 Ian Kelling
* things that should be at the beginning
#+begin_src emacs-lisp
;; todo, evaluating this manually disables debug on error instead of toggling it
-;(toggle-debug-on-error) ;uncomment to help debug and catch errors
-
+;;(toggle-debug-on-error) ;uncomment to help debug and catch errors
#+end_src
;; little kit to help remove a down server
;; (setq package-archives nil)
-(add-to-list 'package-archives
- '("marmalade" .
- "http://marmalade-repo.org/packages/"))
+;;(add-to-list 'package-archives
+;; '("marmalade" .
+;; "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)
-;; if this is a new machine/config, get package list
-;; not sure why we need it, but it is recommended in starter kit,
-;; and doesn't seem like a bad thing
-(unless package-archive-contents (package-refresh-contents))
-
#+end_src
If it is different, emacs will give a message about recovering it when you open it.
+* TODO try out which key mode
+* TODO make installed emacs package declarative
* TODO see if there are more cool functions in sh-script
like sh-cd-here, and bind that to a key
* TODO assign a key to append-next-kill
* auto-complete readline-complete
#+begin_src emacs-lisp
-(add-to-list 'load-path "~/.emacs.d/src/readline-complete")
(require 'readline-complete)
;; not sure how I made these, but I deleted, and
;; it would be nice to make them again sometime
(add-hook 'bbdb-mode-hook
(lambda () (define-key bbdb-mode-map (kbd "C-k") nil)))
-(add-to-list 'load-path "~/.emacs.d/src/bbdb-csv-import")
(require 'bbdb-csv-import)
#+end_src
#+end_src
* yasnippet
+
cd ~/.emacs.d/src
git clone --recursive https://github.com/capitaomorte/yasnippet
touch snippets/.yas-make-groups
#+begin_src emacs-lisp
;;(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e")
+;;(add-to-list 'load-path "/usr/share/emacs/site-lisp/mu4e")
(require 'mu4e)
;; (setq mu4e-headers-results-limit 2000)
(read-only-mode 0)
(let ((start (match-beginning 0))
(end (search-forward "-----END PGP MESSAGE-----" nil t)))
- (shell-command-on-region start end "gpg -dq" nil t shell-command-default-error-buffer t)
+ (shell-command-on-region start end "gpg2 -dq" nil t shell-command-default-error-buffer t)
)))
(add-hook 'mu4e-view-mode-hook 'my-decrypt)
mu4e-headers-visible-lines 15
mu4e-maildir "/nocow/user/fsfmd"
mu4e-refile-folder "/Spam"
- mu4e-get-mail-command "/a/bin/distro-setup/fsf-get-mail"
+ mu4e-index-lazy-check nil
+ mu4e-get-mail-command "true"
user-mail-address "iank@fsf.org"
mail-signature "
(setq mu4e-bookmarks
`( ,(make-mu4e-bookmark
:name "Unread messages"
- :query "flag:unread AND NOT flag:trashed AND NOT maildir:/Junk AND NOT maildir:/fwfw AND NOT maildir:/log"
+ ;; old less restrictive unread, for adapting in the future:
+ ;; flag:unread AND NOT flag:trashed AND NOT maildir:/Junk AND NOT maildir:/fwfw AND NOT maildir:/log
+ :query "flag:unread maildir:/INBOX"
:key ?u)
,(make-mu4e-bookmark
:name "Today's messages"
-(add-to-list 'load-path "~/.emacs.d/src/ghci-completion")
;; from the package readme for ghci-completion
(require 'ghci-completion)
(add-hook 'inferior-haskell-mode-hook 'turn-on-ghci-completion)
(define-key haskell-mode-map (kbd "C-a") 'nil)
(define-key haskell-mode-map (kbd "C-j") 'nil)))
+(eval-after-load "python-mode"
+ '(progn
+(define-key python-mode-map (kbd "C-j") nil)))
+
(defun pretty-lambdas-haskell ()
(font-lock-add-keywords
nil `((,(concat "(?\\(" (regexp-quote "\\") "\\)")
* mediawiki
#+begin_src emacs-lisp
-(add-to-list 'load-path "~/.emacs.d/src/mediawiki-el")
(eval-after-load "mediawiki"
'(progn
(remove-hook 'outline-minor-mode-hook 'mediawiki-outline-magic-keys)
#+end_src
* modes with little configuration needed
#+begin_src emacs-lisp
+;; busted:
+ ;;(require 'csv-mode)
+;;(add-to-list 'auto-mode-alist '("\\.[Cc][Ss][Vv]\\'" . csv-mode))
+
+(require 'outshine)
+(add-hook 'outline-minor-mode-hook 'outshine-hook-function)
+(add-hook 'emacs-lisp-mode-hook 'outline-minor-mode)
+(add-hook 'sh-mode-hook 'outline-minor-mode)
+
+
(setq org-caldav-url "https://cal.iankelling.org"
org-caldav-calendar-id "ian"
;; here we use the standard sendmail interface, which I use postfix for
(setq send-mail-function (quote sendmail-send-it))
-(add-to-list 'load-path "~/.emacs.d/src/spray")
(require 'spray)
(global-set-key (kbd "C-M-w") 'spray-mode)
;; remember, h/l = move. f/s = faster/slower, space = pause, all others quit
* misc general settings
#+begin_src emacs-lisp
+;; https://www.emacswiki.org/emacs/FillParagraph
+;; make list items start paragraphs.
+(setq paragraph-start "\f\\|[ \t]*$\\|[ \t]*[-+*] ")
+
(setq sh-basic-offset 2)
(setq vc-follow-symlinks t)
#+begin_src emacs-lisp
-
+(defun fill-buffer ()
+ (interactive)
+ (save-mark-and-excursion
+ (beginning-of-buffer)
+ (while (= (forward-line) 0)
+ (fill-paragraph))))
(defun next-backup-dir ()
(defun sudo-edit (&optional arg)
(interactive "P")
(if (or arg (not buffer-file-name))
- (find-file (concat "/sudo:root@localhost:" (ido-read-file-name "File: ")))
- (find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))
+ (find-file (concat "/sudo::" (ido-read-file-name "File: ")))
+ (find-alternate-file (concat "/sudo::" buffer-file-name))))
(add-hook 'fundamental-mode-hook 'variable-pitch-on)
(add-hook 'org-mode-hook 'variable-pitch-on)
(add-hook 'text-mode-hook 'variable-pitch-on)
+(defun variable-pitch-off ()
+ (variable-pitch-mode 0))
+(add-hook 'yaml-mode-hook 'variable-pitch-off)
+
(set-face-attribute 'org-table nil :family (face-attribute 'fixed-pitch :family))
(set-face-attribute 'org-code nil :family (face-attribute 'fixed-pitch :family))
#+begin_src emacs-lisp
-(add-to-list 'load-path "~/.emacs.d/src/visible-mark")
;; since it is not easy to change the mark overlay priority, I change this one.
(setq show-paren-priority 999)
* zrc
#+begin_src emacs-lisp
(require 'znc)
+(setq erc-fill-prefix "")
(defun chirp()
(interactive)
- (start-process-shell-command "ignoreme" nil "mpv --no-terminal --vo=null --volume=50 /a/bin/data/bird.mp3"))
+ (setq vol 50)
+ (when (string= (system-name) "tp") (setq vol 40))
+ (start-process-shell-command "ignoreme" nil (format "mpv --no-terminal --vo=null --volume=%d /a/bin/data/bird.mp3" vol)))
;; from https://www.emacswiki.org/emacs/ErcSound
+
(defun erc-my-privmsg-sound (proc parsed)
(let* ((tgt (car (erc-response.command-args parsed)))
(privp (erc-current-nick-p tgt)))
(and
privp (chirp)
-
;; We must return nil. See help for `erc-server-PRIVMSG-functions'
nil)))
+
(add-hook 'erc-server-PRIVMSG-functions
'erc-my-privmsg-sound)
(defun erc-sound-if-not-server (match-type nickuserhost msg)
(unless (string-match "Server:[0-9]+" nickuserhost)
- (start-process-shell-command "ignoreme" nil "mpv --no-terminal --vo=null /a/bin/data/bird.mp3")))
+ (chirp)))
(add-hook 'erc-text-matched-hook 'erc-sound-if-not-server)
(erc-track-mode 1)
*** C-q
org-cycle, comint previous arg
#+begin_src emacs-lisp
+(global-set-key (kbd "C-q") 'outline-cycle)
(add-hook 'org-mode-hook
(lambda () (define-key org-mode-map (kbd "C-q") 'org-cycle)))
(define-key widget-keymap (kbd "C-q") 'widget-forward)
*** C-space]
org-edit-special
#+begin_src emacs-lisp
+;; commented due to new keyboard needing ctrl-space for mark
;; (kbd "<C-space>") does not work, (kbd "C-SPC") should work
-(add-hook 'org-mode-hook
- (lambda ()
- (define-key org-mode-map (kbd "C-SPC") 'org-edit-special)
- ;; org-src-mode-map is broken in git version of emacs.
- ;; temporarily use this for exiting edit-special mode.
- (global-set-key (kbd "C-M--") 'org-edit-src-exit)
- (define-key org-src-mode-map (kbd "C-SPC") 'org-edit-src-exit)))
+;; (add-hook 'org-mode-hook
+;; (lambda ()
+;; (define-key org-mode-map (kbd "C-SPC") 'org-edit-special)
+;; ;; org-src-mode-map is broken in git version of emacs.
+;; ;; temporarily use this for exiting edit-special mode.
+;; (global-set-key (kbd "C-M--") 'org-edit-src-exit)
+;; (define-key org-src-mode-map (kbd "C-SPC") 'org-edit-src-exit)))
#+end_src
*** M-space
*** C-M-space