various updates
authorIan Kelling <iank@fsf.org>
Fri, 3 Jul 2020 21:42:31 +0000 (17:42 -0400)
committerIan Kelling <iank@fsf.org>
Fri, 3 Jul 2020 21:42:31 +0000 (17:42 -0400)
ian-notes.org
init.el

index 2b373f165818f61076613440838329275bd7931a..b666fdfa5413c8a342e3eab417c10e6d39ec3837 100644 (file)
@@ -1814,7 +1814,7 @@ plan to use calc.
   | r               | isearch-backward          | org-clock-out          |                         |                         |
   | a               | copy-all                  |                        |                         |                         |
   | s               | C-x prefix                |                        | split-window-vertically |                         |
   | r               | isearch-backward          | org-clock-out          |                         |                         |
   | a               | copy-all                  |                        |                         |                         |
   | s               | C-x prefix                |                        | split-window-vertically |                         |
-  | d               | C-c prefix                |                        | swap buffer             |                         |
+  | d               | C-c prefix                | run                    | swap buffer             |                         |
   | f               | kill-whole-line           | print-var-at-point     | kill rest of line       |                         |
   | g               | other-window / cancel     | abort-recursive-edit   | gnus                    |                         |
   | z               | undo-tree-undo            |                        |                         |                         |
   | f               | kill-whole-line           | print-var-at-point     | kill rest of line       |                         |
   | g               | other-window / cancel     | abort-recursive-edit   | gnus                    |                         |
   | z               | undo-tree-undo            |                        |                         |                         |
diff --git a/init.el b/init.el
index 25d0445fb10b2a915f648e865207ba2057a5fe22..9ada6bdf5c2f01acca66fe746e63b3d50edefc28 100644 (file)
--- a/init.el
+++ b/init.el
@@ -667,6 +667,8 @@ A non-nil CURRENT-ONLY argument means save only current buffer."
     (load-theme arg t))
   (setq color-theme-is-global 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)
   (defun toggle-night ()
     (interactive)
     (cond  ((equal (car custom-enabled-themes) 'naquadah)
@@ -751,7 +753,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer."
 
   ;; Save a list of recent files visited.
   (recentf-mode 1)
 
   ;; 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)
 
 
         recentf-max-menu-items 15)
 
 
@@ -854,6 +856,8 @@ A non-nil CURRENT-ONLY argument means save only current buffer."
   (eval-after-load "mu4e" '(my-mu4e-init))
 
   (setq
   (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
    ;; 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
@@ -879,6 +883,12 @@ A non-nil CURRENT-ONLY argument means save only current buffer."
    mu4e-cache-maildir-list t
    ;; default is 8, way too small for my big monitors
    mu4e-headers-visible-lines 50
    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
    )
 
   ;; fucks up reading unread bookmark. when that is fixed, enable it
@@ -904,7 +914,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer."
         )))
   (add-hook 'mu4e-view-mode-hook 'my-decrypt)
 
         )))
   (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
     "If we find an address matching regex, then set that address as the to,
 and whatever was used"
     (when mu4e-compose-parent-message
@@ -914,17 +924,21 @@ and whatever was used"
                 regexes (cdr regexes)
                 found (mu4e-message-contact-field-matches
                        mu4e-compose-parent-message :to re)))
                 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)))
         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)
     "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 (cdr (mu4e-message-contact-field-matches
                             mu4e-compose-parent-message :to re))))
         (when found (setq user-mail-address found
@@ -932,16 +946,6 @@ and Ian Kelling as the name"
         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 mu-exit-wait ()
     (interactive)
     ;; taken from the mu source
@@ -959,19 +963,9 @@ and Ian Kelling as the name"
      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.
      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")
+     mail-signature fsf-sig
      ) ;; end setq
      ) ;; end setq
-    (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
 
 
     (mu4e)) ;; end defun fsf-mu4e
 
 
@@ -1336,7 +1330,8 @@ https://fsf.org | https://gnu.org
   ;;(require 'csv-mode)
   ;;(add-to-list 'auto-mode-alist '("\\.[Cc][Ss][Vv]\\'" . csv-mode))
 
   ;;(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 org-caldav-url "https://cal.iankelling.org"
         org-caldav-calendar-id "ian"
@@ -1551,8 +1546,15 @@ https://fsf.org | https://gnu.org
   (setq tramp-default-method "ssh")
 ;;; misc general settings
 
   (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
   (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)
 
    auto-revert-verbose nil
    auto-revert-remote-files t)
 
@@ -2137,6 +2139,12 @@ indent yanked text (with prefix arg don't indent)."
 
 
 ;;; shell mode
 
 
 ;;; 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
   ;; avoid stupid git crap like "warning, terminal not fully functional"
   (setenv "PAGER" "cat")
   ;; don't store successive duplicates in comint command history
@@ -2294,9 +2302,16 @@ indent yanked text (with prefix arg don't indent)."
   (defun chirp()
     (interactive)
     (setq vol 50)
   (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
   ;; 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)))
 
   (defun erc-my-privmsg-sound (proc parsed)
     (let* ((tgt (car (erc-response.command-args parsed)))
@@ -2321,9 +2336,9 @@ indent yanked text (with prefix arg don't indent)."
    erc-track-visibility 'visible
    ;; switch to buffer where i've been mentioned, etc instead of oldest
    erc-track-switch-direction 'importance
    erc-track-visibility 'visible
    ;; switch to buffer where i've been mentioned, etc instead of oldest
    erc-track-switch-direction 'importance
-   ;; defaults minus fill
+   ;; defaults minus fill. todo: modify the list instead of specifying it explicitly in case the defaults change
    erc-modules
    erc-modules
-     '(autojoin button completion irccontrols list match menu move-to-prompt netsplit networks noncommands readonly ring stamp track)
+   '(autojoin button completion irccontrols list match menu move-to-prompt netsplit networks noncommands readonly ring stamp track)
    )
 
 
    )
 
 
@@ -2350,9 +2365,11 @@ indent yanked text (with prefix arg don't indent)."
   (dolist
       (r `(
            (?i (file . ,"~/.emacs.d/init.el"))
   (dolist
       (r `(
            (?i (file . ,"~/.emacs.d/init.el"))
-           (?w (file . ,"/a/work.org"))
+           (?o (file . ,"/a/work.org"))
            (?t (file . ,"/a/t.org"))
            (?s (file . ,"/usr/share/doc/exim4-base/spec.txt.gz"))
            (?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)))
            (?x (file . ,"/a/x.txt"))
            ))
     (set-register (car r) (cadr r)))
@@ -2928,6 +2945,11 @@ modes like org-mode which have their own yank function."
   (global-set-key (kbd "C-M-s") 'split-window-vertically)
 
 ;;;;; C-d - C-c prefix
   (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
 
 ;;;;; C-M-d - swap buffer across windows
   ;; from http://www.emacswiki.org/emacs/TransposeWindows
 
@@ -2957,7 +2979,7 @@ modes like org-mode which have their own yank function."
 
   (global-set-key (kbd "C-M-d") 'swap-buffers-in-windows)
 
 
   (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)
 
   (global-set-key (kbd "C-f") 'kill-whole-line-wrapper)
   (defun kill-whole-line-wrapper (&optional arg)
@@ -3332,32 +3354,12 @@ modes like org-mode which have their own yank function."
   (global-set-key (kbd "C-M-,") 'find-file-in-project)
 
 ;;;;; C-. - find recent file
   (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)
 
   (add-hook 'flyspell-mode-hook
             (lambda () (define-key flyspell-mode-map (kbd "C-.") nil)))
   (define-key dot-mode-map (kbd "C-.") nil)
-  (define-key terminal-key-map (kbd "4c") 'recentf-ido-find-file)
-  (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)))
 
   (add-hook 'php-mode-hook
             (lambda () (define-key php-mode-map (kbd "C-.") nil)))