;; nnfolder-generate-active-file
;; to reset things, when changing mail group. I duno all the proper way, but it works to delete
- ;; ~/Mail ~/.newsrc.eld ~/.dribble (or something)
+ ;; ~/Mail ~/.newsrc.eld ~/.newsrc-dribble
;;;;; mail sources vs select methods background
;;; things that should be at the beginning
- ;; todo, evaluating this manually disables debug on error instead of toggling it
- (toggle-debug-on-error) ;uncomment to help debug and catch errors
;; packages installed from package manager: i pretty much prioritize repos this way: gnu, then melpa, then marmalade.
+
;;; abreviations
;; turn on abbrev mode globally
(setq-default abbrev-mode t)
(load-theme arg t))
(setq color-theme-is-global t)
+ ;; temporary, make night be default
+
(defun toggle-night ()
(interactive)
(cond ((equal (car custom-enabled-themes) 'naquadah)
;; Save a list of recent files visited.
(recentf-mode 1)
- (setq recentf-max-saved-items 200
+ (setq recentf-max-saved-items 400
recentf-max-menu-items 15)
(eval-after-load "mu4e" '(my-mu4e-init))
(setq
+ ;; https://github.com/djcb/mu/issues/1025
+ mail-user-agent 'mu4e-user-agent
;; 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-cache-maildir-list t
;; default is 8, way too small for my big monitors
mu4e-headers-visible-lines 50
+ message-sendmail-envelope-from 'header
+ ;; trying this out
+ ;;mu4e-view-use-gnus t
+ ;; had problems where mu4e and gnus would hang verifying signatures, gnus man
+ ;; said this should help, but it didnt work. they still got verified.
+ ;; mm-verify-option 'never
)
;; fucks up reading unread bookmark. when that is fixed, enable it
)))
(add-hook 'mu4e-view-mode-hook 'my-decrypt)
- (defun mu-set-from-name (regexes)
+ (defun iank-set-from-name (regexes)
"If we find an address matching regex, then set that address as the to,
and whatever was used"
(when mu4e-compose-parent-message
regexes (cdr regexes)
found (mu4e-message-contact-field-matches
mu4e-compose-parent-message :to re)))
- (when found (setq user-mail-address (cdr found)
- user-full-name (car found)))
+ (when found
+ (message "%s\n" found)
+ (setq user-mail-address (cdr found)
+ user-full-name (car found)
+ mail-signature sig))
found)))
- (defun mu-set-from (regexes)
+ (defun iank-set-from (regexes)
"If we find an address matching regex, then set that address as the to,
and Ian Kelling as the name"
(when mu4e-compose-parent-message
(let ((found nil))
(while (and regexes (not found))
(setq re (car regexes)
- regexes (cdr regexes)
+ sig (cadr regexes)
+ regexes (cddr regexes)
found (cdr (mu4e-message-contact-field-matches
mu4e-compose-parent-message :to re))))
(when found (setq user-mail-address found
found)))
- (defun my-mu4e-to-fsf ()
- "inspired by mu4e info manual, search for mu4e-compose-pre-hook."
- (cond
- ((mu-set-from '("iank@fsf.org"
- "iank@gnu.org")))
- ((setq user-mail-address "iank@fsf.org"
- user-full-name "Ian Kelling"))))
-
-
- ;; on first run mkdir -p /nocow/user/.mufsf; mu index --maildir=/nocow/user/fsfmd
(defun mu-exit-wait ()
(interactive)
;; taken from the mu source
(defun fsf-mu4e ()
(interactive)
- (require 'mu4e)
- (unless (equal mu4e-maildir "/nocow/user/fsfmd") (mu-exit-wait))
+ (my-mu4e-commmon)
(setq
- ;; fsf monitor is smaller
- mu4e-headers-visible-lines 15
- mu4e-maildir "/nocow/user/fsfmd"
- mu4e-refile-folder "/Spam"
- mu4e-index-lazy-check nil
- mu4e-get-mail-command "true"
user-mail-address "iank@fsf.org"
;; WARNING: be careful editing this, there needs to be a space after --, and my editor
;; and git will automatically remove it unless i manually disable it.
- 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
-"
-
- mu4e-user-mail-address-list '("iank@fsf.org"
- "iank@gnu.org")
- mu4e-maildir-shortcuts
- '( ("/INBOX" . ?i)
- ("/sysadmin" . ?a)
- ("/sec" . ?x)
- ("/rtcc" . ?c)
- ("/Drafts" . ?d)
- ("/Sent" . ?s)
- )
+ mail-signature fsf-sig
) ;; end setq
- (call-process "/a/exe/lnf" nil nil nil "-T" "/nocow/user/.mufsf" (concat (getenv "HOME") "/.mu"))
- (add-hook 'mu4e-compose-pre-hook 'my-mu4e-to-fsf)
- (remove-hook 'mu4e-compose-pre-hook 'my-mu4e-to)
+ (add-hook 'mu4e-compose-pre-hook 'my-mu4e-to)
(mu4e)) ;; end defun fsf-mu4e
(add-hook 'haskell-mode-hook
(lambda () (define-key haskell-mode-map (kbd "C-(")
- (lambda () (interactive)
- (basic-save-buffer)
- (haskell-compile)
- (run-with-timer .3 nil 'repeat-shell)))))
+ (lambda () (interactive)
+ (basic-save-buffer)
+ (haskell-compile)
+ (run-with-timer .3 nil 'repeat-shell)))))
(add-hook 'haskell-cabal-mode-hook
(lambda () (define-key haskell-cabal-mode-map (kbd "C-(") 'haskell-compile)))
;;(require 'csv-mode)
;;(add-to-list 'auto-mode-alist '("\\.[Cc][Ss][Vv]\\'" . csv-mode))
- (add-hook 'outline-minor-mode-hook 'outshine-mode)
+ ;; disabled temporarily
+ ;;(add-hook 'outline-minor-mode-hook 'outshine-mode)
(setq org-caldav-url "https://cal.iankelling.org"
org-caldav-calendar-id "ian"
(setq tramp-default-method "ssh")
;;; misc general settings
+ ;; from tramp manual, use the same ssh controlmaster. I was having problems with
+ ;; tramp prompting me for a username and pass.
+(customize-set-variable 'tramp-use-ssh-controlmaster-options nil)
+
(setq
auto-revert-interval 2
+ ;; fix eof end of file newline
+ mode-require-final-newline t
+ require-final-newline t
auto-revert-verbose nil
auto-revert-remote-files t)
(dot-mode . "")
(yas-global-mode . "")
(yas-minor-mode . "")
+ (undo-tree-mode . "")
(volatile-highlights-mode . "")
(highlight-symbol-mode . "")
;; Major modes
org-extend-today-until 0
org-startup-truncated nil
org-clock-persist t
+ org-use-sub-superscripts "{}"
+ org-export-with-sub-superscripts nil
org-clock-mode-line-total 'today
;; global STYLE property values for completion
org-global-properties (quote (("STYLE_ALL" . "habit")))
;;; shell mode
+
+
+;; # eval: (outline-minor-mode)
+;; # outline-regexp: "\\( *\\)# [*]\\{1,8\\} "
+
+
;; avoid stupid git crap like "warning, terminal not fully functional"
(setenv "PAGER" "cat")
;; don't store successive duplicates in comint command history
(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)))
+ (when (string= (system-name) "kd") (setq vol 80))
+ ;; speed is there so i can adjust and make it go slow so it plays long enough to adjust in pavucontrol
+ (start-process-shell-command "ignoreme" nil (format "mpv --speed=1 --no-terminal --vo=null --volume=%d /a/bin/data/bird.mp3" vol)))
;; from https://www.emacswiki.org/emacs/ErcSound
+ (defun chirp-slow()
+ (interactive)
+ (setq vol 50)
+ (when (string= (system-name) "tp") (setq vol 80))
+ ;; speed is there so i can adjust and make it go slow so it plays long enough to adjust in pavucontrol
+ (start-process-shell-command "ignoreme" nil (format "mpv --speed=.2 --no-terminal --vo=null --volume=%d /a/bin/data/bird.mp3" vol)))
(defun erc-my-privmsg-sound (proc parsed)
(let* ((tgt (car (erc-response.command-args parsed)))
;; consider invisible frames to be unseen. seems like an obvious default
erc-track-visibility 'visible
;; switch to buffer where i've been mentioned, etc instead of oldest
- erc-track-switch-direction 'importance)
+ erc-track-switch-direction 'importance
+ ;; defaults minus fill. todo: modify the list instead of specifying it explicitly in case the defaults change
+ erc-modules
+ '(autojoin button completion irccontrols list match menu move-to-prompt netsplit networks noncommands readonly ring stamp track)
+ )
;;; named commands
(dolist
(r `(
(?i (file . ,"~/.emacs.d/init.el"))
+ (?o (file . ,"/a/work.org"))
(?t (file . ,"/a/t.org"))
+ (?s (file . ,"/usr/share/doc/exim4-base/spec.txt.gz"))
+ (?w (file . ,"/p/w.org"))
+ (?k (file . ,"/a/bin/ds/Arduino/Model01-Firmware/Model01-Firmware.ino"))
(?x (file . ,"/a/x.txt"))
))
(set-register (car r) (cadr r)))
undo-limit 500000000 ; undo history limit
undo-strong-limit 600000000) ; undo history limit plus some extra
+
+;;; undo tree mode
+
+ ;; note, this has weird errors when it was before recentf-mode
+
+ ;; more resilient undo-tree-history if we have its location set up front.
+ (setq undo-tree-history-directory-alist '(("." . "~/.undo-tree-history")))
+
+
+ ;; todo, send patch undo-tree-visualize should scroll with the scroll key, instead of just pgup pgdn (aka next/prior)
+ (global-undo-tree-mode)
+ ;; disabled due to bug, something like unknown entry in undo tree canary
+ ;; (setq undo-tree-auto-save-history t)
+ (setq undo-outer-limit 100000000 ; per undo command
+ undo-limit 500000000 ; undo history limit
+ undo-strong-limit 600000000) ; undo history limit plus some extra
+ ;; Undo in region just happens accidentally, and throws me off
+ (setq undo-tree-enable-undo-in-region nil)
+
;;; keybinds
;;;; misc
+
+ (define-prefix-command 'terminal-key-map)
+ (global-set-key (kbd "\e[") 'terminal-key-map)
+
+
+
(global-set-key (kbd "C-x C-b") 'ibuffer)
(global-set-key (kbd "C-M-q") 'quoted-insert)
-;;;;; C-w ---
- ;; in terminal, it's ctrl-backspace, duplicate keybind.
+;;;;; C-w
+
+ (global-set-key (kbd "C-w") 'counsel-find-file)
+
;;;;; M-w org-clock-in
(global-set-key (kbd "M-w") 'org-clock-in)
(global-set-key (kbd "C-M-s") 'split-window-vertically)
;;;;; C-d - C-c prefix
+
+;;;;; M-d - run
+
+ (global-set-key (kbd "M-d") 'run)
+
;;;;; C-M-d - swap buffer across windows
;; from http://www.emacswiki.org/emacs/TransposeWindows
(global-set-key (kbd "C-M-d") 'swap-buffers-in-windows)
-;;;;; C-f] - kill-whole-line
+;;;;; C-f - kill-whole-line
(global-set-key (kbd "C-f") 'kill-whole-line-wrapper)
(defun kill-whole-line-wrapper (&optional arg)
;;;;; C-z - undo-only
- (global-set-key (kbd "C-z") 'undo-only)
+ (global-set-key (kbd "C-z") 'undo-tree-undo)
;;;;; C-x - kill-region
;;;;; C-backspace - backward-kill-symbol
+ (define-key terminal-key-map (kbd "4b") 'backward-kill-symbol) ;c-backspace in my konsole
+
+ ;; c-w is duplicate in terminal
(global-set-key (kbd "<C-backspace>") 'backward-kill-symbol)
(add-hook 'comint-mode-hook
(lambda ()
(delete-windows-on "*Help*")
))
-;;;;; C-i - -----
+;;;;; C-i -
+ (define-key input-decode-map [?\C-i] [C-i])
;;;;; C-M-i - query-replace-regexp
(global-set-key (kbd "C-M-i") 'query-replace-regexp)
(move-beginning-of-line 2))
(global-set-key (kbd "C-M-;") 'comment-current-line-dwim)
+;;;;; C-m
+ (define-key input-decode-map [?\C-m] [C-m])
;;;;; C-M-m - recursive grep
(define-key global-map (kbd "C-M-m") 'rgrep)
-;;;;; C-, - counsel-find-file
+;;;;; C-, - ---
+ ;; not recognized by terminal, can't get konsole keydef file to recognize comma,
+ ;; todo: dig into konsole sources, or try newer version than t8
- (global-set-key (kbd "C-,") 'counsel-find-file)
(add-hook 'flyspell-mode-hook
(lambda () (define-key flyspell-mode-map (kbd "C-,") nil)))
(global-set-key (kbd "C-M-,") 'find-file-in-project)
;;;;; C-. - find recent file
- ;; Taken from starter kit.
-
- (defun recentf-ido-find-file ()
- "Find a recent file using Ido."
- (interactive)
- (let* ((file-assoc-list
- (mapcar (lambda (x)
- (cons (file-name-nondirectory x)
- x))
- recentf-list))
- (filename-list
- (remove-duplicates (mapcar #'car file-assoc-list)
- :test #'string=))
- (filename (ido-completing-read "Choose recent file: "
- filename-list
- nil
- t)))
- (when filename
- (find-file (cdr (assoc filename
- file-assoc-list))))))
(add-hook 'flyspell-mode-hook
(lambda () (define-key flyspell-mode-map (kbd "C-.") nil)))
(define-key dot-mode-map (kbd "C-.") nil)
- (global-set-key (kbd "C-.") 'recentf-ido-find-file)
+ (define-key terminal-key-map (kbd "4c") 'counsel-recentf)
+ (global-set-key (kbd "C-.") 'counsel-recentf)
(add-hook 'php-mode-hook
(lambda () (define-key php-mode-map (kbd "C-.") nil)))
(interactive)
(join-line '(4)))
(global-set-key (kbd "C-/") 'vim-style-join-line)
+ (define-key undo-tree-map (kbd "C-/") nil)
;;;;; C-M-/ - copy-buffer-file-name
;;;;; C-S-down-arrow - m-x for major mode
-;; todo, update this for ivy
+ ;; todo, update this for ivy
(global-set-key (kbd "<C-S-kp-enter>") 'smex-major-mode-commands)
;;;;; C-lbracket - ----
(global-set-key (kbd "<M-return>") 'plain-newline)
-;;;;; C-M-return - newline-anywhere-previous
- (defun newline-anywhere-previous ()
- "Add a newline from anywhere in the line."
- (interactive)
- (forward-line -1)
- (end-of-line)
- (newline-and-indent))
- (global-set-key (kbd "<C-M-return>") 'newline-anywhere-previous)
-
;;;;; C-space - org-edit-special
;; commented due to new keyboard needing ctrl-space for mark
;;;;; C-home - start of buffer
;;;;; C-end - end of buffer
;;;; right secondary
-;;;;; C-6 - save-buffers-kill-emacs
+;;;;; C-^ - save-buffers-kill-emacs
- (global-set-key (kbd "C-6") 'save-buffers-kill-emacs)
+ (global-set-key (kbd "C-^") 'save-buffers-kill-emacs)
;;;;; C-M-6 - insert-small-copyright
(interactive)
(beginning-of-line)
(let ((beg (point)))
- (insert "Copyright (C) 2017 Ian Kelling\nThis program is under GPL v. 3 or later, see <http://www.gnu.org/licenses/>")
+ (insert "Copyright (C) 2019 Ian Kelling\nThis program is under GPL v. 3 or later, see <http://www.gnu.org/licenses/>")
(comment-region beg (point))))
(global-set-key (kbd "C-M-6") 'insert-small-copyright)
(interactive)
(beginning-of-line)
(let ((beg (point)))
- (insert "Copyright (C) 2017 Ian Kelling\n")
+ (insert "Copyright (C) 2019 Ian Kelling\n")
(insert "\n")
(insert "This program is free software: you can redistribute it and/or modify\n")
(insert "it under the terms of the GNU General Public License as published by\n")
;;;;; C-M-- - org-edit-src-exit
;;;;; C-y - undo
- (global-set-key (kbd "C-y") 'undo)
+ (global-set-key (kbd "C-y") 'undo-tree-redo)
(add-hook 'org-mode-hook
(lambda () (define-key org-mode-map (kbd "C-y") nil)))
;;;;; C-escape - find-tag
(global-set-key (kbd "<C-escape>") 'find-tag)
- ) ;; end let
+
+;;; end let from start of file
+ )
;; Local Variables:
;; eval: (outline-minor-mode)