-#+TITLE: My Personal Init Customization
+#+title: My Personal Init Customization
#+OPTIONS: toc:nil num:nil ^:nil
* copyright
# Copyright (C) 2017 Ian Kelling
(with-temp-message ""
(basic-save-buffer)))))
-(defun my-as-off ()
+;; in the message-send-and-exit advice, got an error because it passed an arg.
+;; didn't look into why, just add ignored args.
+(defun my-as-off (&rest ignore)
(interactive)
(setq my-as nil))
-(defun my-as-off-local ()
+(defun my-as-off-local (&rest ignore)
(interactive)
(setq-local my-as nil))
-(defun my-as-on ()
+(defun my-as-on (&rest ignore)
(interactive)
(setq my-as t))
-(defun my-as-on-local ()
+(defun my-as-on-local (&rest ignore)
(interactive)
(setq-local my-as on))
#+end_src
* yasnippet
+
cd ~/.emacs.d/src
git clone --recursive https://github.com/capitaomorte/yasnippet
touch snippets/.yas-make-groups
;; (setq mu4e-headers-results-limit 2000)
-(setq send-mail-function (quote sendmail-send-it) ;; common to gnus also
+(setq
+;; common to gnus. default sendmail-query-once asks us, then sets this via customize.
+send-mail-function (quote sendmail-send-it)
;; use the standard imap folders
mu4e-sent-folder "/Sent"
mu4e-drafts-folder "/Drafts"
mu4e-headers-fields (delq (assoc :mailing-list mu4e-headers-fields) mu4e-headers-fields)
;; default 500.
mu4e-headers-results-limit 1000
+ ;; tell exim to use from: as envelope from.
+ ;; exim's default is use outgoing_msg_localpart@hostname.
+ mail-specify-envelope-from t
;; looking up the list of maildirs when doing jo from summary
;; can take a few seconds if we have a ton of messages.
(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)
;; on first run mkdir -p /nocow/user/.mufsf; mu index --maildir=/nocow/user/fsfmd
(defun mu-exit-wait ()
(interactive)
- (let ((wait (= 0 (call-process "/bin/pidof" nil nil nil "mu"))))
+ ;; taken from the mu source
+ (let* ((buf (get-buffer mu4e~proc-name))
+ (proc (and (buffer-live-p buf) (get-buffer-process buf))))
(mu4e-quit)
;; without sleep, we get database locked by another process error when hitting u
;; if another mu was running.
- (when wait (sleep-for 0 300))))
+ (if proc (sleep-for 0 1000))))
+
(defun fsf-mu4e ()
(interactive)
(unless (equal mu4e-maildir "/nocow/user/fsfmd") (mu-exit-wait))
mu4e-headers-visible-lines 15
mu4e-maildir "/nocow/user/fsfmd"
mu4e-refile-folder "/Spam"
+ mu4e-index-lazy-check nil
mu4e-get-mail-command "/a/bin/distro-setup/fsf-get-mail"
user-mail-address "iank@fsf.org"
mail-signature "
---
+--
Ian Kelling | Senior Systems Administrator, Free Software Foundation
GPG Key: B125 F60B 7B28 7FF6 A2B7 DF8F 170A F0E2 9542 95DF
https://fsf.org | https://gnu.org
(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 "\\") "\\)")
* modes with little configuration needed
#+begin_src emacs-lisp
+(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"
org-caldav-inbox "/p/cal.org")
* 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)
;; give us a shell to start instead of scratch
#+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 ()
#+RESULTS:
: t
+
* zrc
#+begin_src emacs-lisp
(require 'znc)
+(setq erc-fill-prefix "")
+(defun chirp()
+ (interactive)
+ (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
- (start-process-shell-command "ignoreme" nil "mpv --no-terminal --vo=null --volume=25 /a/bin/data/bird.mp3")
+ privp (chirp)
+
;; We must return nil. See help for `erc-server-PRIVMSG-functions'
nil)))
(add-hook 'erc-server-PRIVMSG-functions
(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