;;; readline complete fix
- ;; I need this function here, where INSIDE_EMACS is replaced with RLC_INSIDE_EMACS.
+ ;; I need this function here, where INSIDE_EMACS is replaced with LC_INSIDE_EMACS.
;; ian: last update 2017-1-7. update this periodically from upstream
;; like when we do a major emacs update
(defun comint-exec-1 (name buffer command switches)
(format "COLUMNS=%d" (window-width)))
(list "TERM=emacs"
(format "TERMCAP=emacs:co#%d:tc=unknown:" (window-width))))
- (list (format "RLC_INSIDE_EMACS=%s,comint" emacs-version))
+ (list (format "LC_INSIDE_EMACS=%s,comint" emacs-version))
process-environment))
(default-directory
(if (file-accessible-directory-p default-directory)
found (mu4e-message-contact-field-matches
mu4e-compose-parent-message :to re)))
(when found
- (message "%s\n" found)
+ (setq user-full-name (car found))
+ ;; we get an error unless we do this. that is a bug. I could
+ ;; send a patch... also a bug: setting message-from-style nil
+ ;; doesnt work in mu4e unless user-full-name is also nil.
+ (unless user-full-name
+ (setq message-from-style nil))
(setq user-mail-address (cdr found)
- user-full-name (car found)
- mail-signature sig))
+ mail-signature nil))
found)))
(defun iank-set-from (regexes)
"If we find an address matching regex, then set that address as the to,
(my-mu4e-commmon)
(setq
user-mail-address "iank@fsf.org"
+ iank-user-mail-address user-mail-address
;; 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 fsf-sig
) ;; end setq
(add-hook 'mu4e-compose-pre-hook 'my-mu4e-to)
- (mu4e)) ;; end defun fsf-mu4e
+ (mu4e))
;; 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)
+ (customize-set-variable 'tramp-use-ssh-controlmaster-options nil)
(setq
auto-revert-interval 2
;; give us a shell to start instead of scratch
;;(setq initial-buffer-choice (lambda () (new-shell)))
- ;; disable this nasty function, as I always use a gui
- (defun suspend-frame() (interactive))
;; Seed the random-number generator
(random t)
;; easier to remember than keybinds
(defalias 'scrypt 'mml-secure-message-encrypt-pgpmime)
(defalias 'sign 'mml-secure-message-sign-pgpmime)
+ ;; otherwise we get error on sending:
+ ;; mml-secure-epg-sign: Couldn’t find any signer names; try setting `mml-secure-smime-sign-with-sender'.
+ ;; i dunno why sign+encrypt doesnt cause this, seems kinda dumb,
+ ;;
+ (setq mml-secure-openpgp-sign-with-sender t)
+ ;; i dun use smime, the smime signing fails complaining it doesnt have
+ ;; my key. todo: learn about smime
+ (setq mml-secure-smime-sign-with-sender t)
(defun encrypt ()
(interactive)
(mml-secure-message-encrypt-pgpmime 'dontsign))
;;; shell mode
-;; # eval: (outline-minor-mode)
-;; # outline-regexp: "\\( *\\)# [*]\\{1,8\\} "
+ ;; # eval: (outline-minor-mode)
+ ;; # outline-regexp: "\\( *\\)# [*]\\{1,8\\} "
;; avoid stupid git crap like "warning, terminal not fully functional"
;;;; single/special keys
;;;;; tab - isearch
- (define-key isearch-mode-map (kbd "<tab>") 'isearch-query-replace)
+ (define-key isearch-mode-map (kbd "TAB") 'isearch-query-replace)
;;;;; f12 - isearch-forward
;; explained in http://stackoverflow.com/questions/7411920/how-to-bind-search-and-search-repeat-to-c-f-in-emacs
(global-set-key (kbd "<home>") 'back-to-indentation-or-beginning)
;;;;; s-tab - indent-buffer
+ ;; graphical
(global-set-key (kbd "<S-iso-lefttab>") 'indent-buffer)
+ ;; terminal
+ (global-set-key (kbd "<backtab>") 'indent-buffer)
;;;;; s-delete - send-shell
(global-set-key (kbd "<S-delete>") 'send-shell)
;; stop splitting windows verticallly when I open a buffer or shell
(setq split-height-threshold nil)
-;;;;; s-left arrow - shell
- (global-set-key (kbd "<S-left>") 'shell-wrap)
- (add-hook 'org-mode-hook
- (lambda ()
- (define-key org-mode-map (kbd "<S-left>") nil)))
+;;;;; s-left arrow - ---
+ ;; cant be used in terminal
+ ;; When I had a binding, i did this so org-mode wouldnt clobber it
+ ;; (add-hook 'org-mode-hook
+ ;; (lambda ()
+ ;; (define-key org-mode-map (kbd "<S-left>") nil)))
;;;;; s-right arrow - keyboard-yank-primary
(defun keyboard-yank-primary ()
;; kp-enter is shift return in terminal
(global-set-key (kbd "<kp-enter>") 'flyspell-auto-correct-previous-word)
-;;;;; s-down arrow - my-contract-region
+;;;;; s-up arrow - my-contract-region
(global-set-key (kbd "<S-up>") 'my-contract-region)
;;;;; c-up/down move 8 lines
;;;; left primary
-;;;;; C-2 copy-symbol
-
- (global-unset-key (kbd "C-2"))
- (defun copy-symbol (&optional arg)
- "Copy symbol at point into kill-ring"
- (interactive "P")
- (kill-new (thing-at-point 'symbol)))
-
- (global-set-key (kbd "C-2") 'copy-symbol)
-
;;;;; M-2 shell-cd-to-file
(message "%s" "shell-cd-to-file: buffer has no file name"))))
(global-set-key (kbd "M-2") 'shell-cd-to-file)
-;;;;; C-M-2 ---
- ; todo. whats going on here?
+;;;;; C-M-2 copy-symbol
(global-unset-key (kbd "C-M-2"))
+ (defun copy-symbol (&optional arg)
+ "Copy symbol at point into kill-ring"
+ (interactive "P")
+ (kill-new (thing-at-point 'symbol)))
+
+ (global-set-key (kbd "C-M-2") 'copy-symbol)
-;;;;; C-3 dot-mode-execute
+;;;;; M-3 dot-mode-execute
- (global-set-key (kbd "C-3") 'dot-mode-execute)
+ (global-set-key (kbd "M-3") 'dot-mode-execute)
;;;;; C-M-3 recenter-top-bottom
(global-set-key (kbd "C-M-q") 'quoted-insert)
-;;;;; C-w
+;;;;; C-w counsel-find-file
(global-set-key (kbd "C-w") 'counsel-find-file)
-;;;;; M-w org-clock-in
+;;;;; M-w shell
- (global-set-key (kbd "M-w") 'org-clock-in)
+ (global-set-key (kbd "M-w") 'shell-wrap)
;;;;; C-e copy-line
(define-key org-mode-map (kbd "C-M-f") 'org-kill-line)))
(global-set-key (kbd "C-M-f") 'kill-line)
-;;;;; C-g - cancel / other window
-
- (global-set-key (kbd "C-g") 'other-window)
-
+;;;;; C-g - keyboard-quit
;;;;; M-g - abort-recursive-edit
(global-set-key (kbd "M-g") 'abort-recursive-edit)
(global-set-key (kbd "C-M-g") 'mu4e)
;;;;; C-z - undo-only
-
(global-set-key (kbd "C-z") 'undo-tree-undo)
+;;;;; C-M-z - suspend-frame
+ (global-set-key (kbd "C-z") 'suspend-frame)
+ ;; previously, i meant to only use gui and ran this to
+ ;; be sure it never got ran
+ ;;(defun suspend-frame() (interactive))
;;;;; C-x - kill-region
(define-key c-mode-base-map (kbd "<deletechar>") 'c-electric-delete-forward)))
-;;;;; M-c - org-capture
+;;;;; M-c - delete-other-windows
- (define-key global-map "\M-c" 'org-capture)
+ ;; todo, consider binding/using org-capture
+ (define-key global-map "\M-c" 'delete-other-windows)
;;;;; C-M-c - copy-to-register
(global-set-key (kbd "C-M-v") 'yank-pop)
-;;;;; C-b - delete-other-windows
+;;;;; C-b - other-window
- (global-set-key (kbd "C-b") 'delete-other-windows)
+ (global-set-key (kbd "C-b") 'other-window)
;;;;; M-b - isearch-backward-current-symbol
(global-set-key (kbd "<C-M-backspace>") 'backward-kill-sexp)
;;;; right primary
-;;;;; C-* - split-window-horizontally
-
- (global-set-key (kbd "C-*") 'split-window-horizontally)
-
-;;;;; C-M-* - calc-dispatch
+;;;;; M-8 - delete-window-or-exit
- (global-set-key (kbd "C-M-*") 'calc-dispatch)
-
-;;;;; C-9 - delete-window-or-exit
-
- (global-set-key (kbd "C-9") 'delete-window-or-exit)
+ (global-set-key (kbd "M-8") 'delete-window-or-exit)
(defun delete-window-or-exit ()
"Delete window or exit emacs."
(progn (basic-save-buffer) (delete-frame))
(save-buffers-kill-terminal t))))
+;;;;; C-* - split-window-horizontally
+ (global-set-key (kbd "C-*") 'split-window-horizontally)
+;;;;; C-M-* - calc-dispatch
+
+ (global-set-key (kbd "C-M-*") 'calc-dispatch)
+
;;;;; M-9 - kill-buffer
(defun kill-buffer-no-ido ()
))
;;;;; C-i -
- (define-key input-decode-map [?\C-i] [C-i])
+ ;; todo: try making use
+ ;; this is the key in terminal
+ ;;M-[ 4 d is undefined
+
+ ;; previously had this for enhancing graphical keybinds,
+ ;; but afaik its no help since i want terminal to work
+ ;; the same.
+ ;; (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 - ---
+ ;; terminal/console needs this. otherwise, we could do this
+ ;; to make C-m be a valid key in graphical mode.
+ ;; (define-key input-decode-map [?\C-m] [C-m])
;;;;; C-M-m - recursive grep
(define-key global-map (kbd "C-M-m") 'rgrep)
-;;;;; C-8 - calc-embedded-word
-
- (global-set-key (kbd "C-8") 'calc-embedded-word)
-
;;;;; C-up-arrow - org prev headline
;; disabled just because i don't want to accidentally hit it
(global-set-key (kbd "C-M-6") 'insert-small-copyright)
+;;;;; M-7 - calc-embedded-word
+
+ (global-set-key (kbd "M-7") 'calc-embedded-word)
+
;;;;; C-M-7 - insert-full-copyright
(defun insert-full-copyright ()