fix for emacs update, various improvements
[dot-emacs] / init.el
diff --git a/init.el b/init.el
index 22068c8a263858d2a9e2a92d63fd57b8ebf2fcd5..0553e7c17f7dcb8d4eb2b56847d052f528cea22a 100644 (file)
--- a/init.el
+++ b/init.el
           ;; taken from wiegley, dunno why the t is there.
           t)
 
-;; stuff to allow an alternate location for ~/.emacs.d
-(setq user-emacs-directory (file-name-directory user-init-file))
-(when (getenv "EHOME")
-  (setenv "HOME" (getenv "EHOME")))
-
 ;; 2019-6-26, 1.26s
 ;; ; to profile init:
 ;; ; uncomment the following block
@@ -64,8 +59,9 @@
 ;; ; emacs -f benchmark-init/deactivate
 
 
-;; these need to be done before the hook in order to satisfy the byte compiler or batch mode
+(setq init-dir (file-name-directory load-file-name))
 
+;; these need to be done before the hook in order to satisfy the byte compiler or batch mode
 (add-to-list 'load-path (concat user-emacs-directory "src/readline-complete"))
 
 ;; disabled since not used.
@@ -76,7 +72,6 @@
 
 
 
-(setq init-dir (file-name-directory load-file-name))
 ;; previously, i was doing byte-recompile-directory, but
 ;; now i just have one init file
 (unless (equal (user-uid) 0) ; don't make root owned files
@@ -1110,10 +1105,6 @@ A non-nil CURRENT-ONLY argument means save only current buffer."
 ;; this fixes save error for python example code
 (define-coding-system-alias 'UTF-8 'utf-8)
 
-;; i don't use frame titles, but if I ever do
-;; this starter kit setting is probably good
-(if window-system (setq frame-title-format '(buffer-file-name "%f" ("%b"))))
-
 
 ;;(prefer-coding-system 'utf-8-unix)
 
@@ -1314,7 +1305,10 @@ Go to the next directory based on where the cursor is."
 
 ;;; mode line
 ;; make window title be the buffer name
-(setq frame-title-format "%b")
+(setq
+ frame-title-format "e-iak %b"
+ icon-title-format "e-iak %b"
+ )
 
 (defun my-after-change-major-mode-hook ()
   (setq mode-line-mule-info nil
@@ -1747,47 +1741,83 @@ or else the number of characters matched by `outline-regexp'."
         erc-track-visibility 'visible
         ;; switch to buffer where i've been mentioned, etc instead of oldest
         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 imenu irccontrols list match menu move-to-prompt netsplit networks noncommands readonly ring stamp track)
+        ;; when starting erc, open #fsfsys. otherwise it is super
+        ;; annoying to always have to manually switch buffers.
+        erc-join-hook (lambda () (when (string= (buffer-name(current-buffer)) "#fsfsys") (switch-to-buffer (current-buffer))))
+        ;; defaults minus fill. you can find defaults by searching for
+        ;; defcustom erc-modules in erc.el, or customize group erc.
+        erc-modules (remove 'fill erc-modules)
         ;; expanded from https://www.emacswiki.org/emacs/ErcChannelTracking,
         ;; ignore various messages
         erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE"
                                   "324" "329" "332" "333" "353")
         ;; seems good, i don't care about the server buffer generally
         erc-track-exclude-server-buffer t
-        ;; dont highlight channels just cuz of new messages
-        erc-track-priority-faces-only 'all
-        ;; so that we don't show channels where i havent been mmentioned
-        erc-track-faces-priority-list '(erc-current-nick-face
-                                erc-keyword-face
-                                erc-pal-face
-                                erc-nick-msg-face
-                                erc-direct-msg-face
-                                erc-fool-face)
-
-
-        ) ; end setq
-
-  :config
-  (add-hook 'erc-server-PRIVMSG-functions
-            'erc-my-privmsg-sound)
-  (add-hook 'erc-text-matched-hook 'erc-sound-if-not-server)
-  (erc-track-mode 1)
-  (defun erc-track--switch-buffer (fun arg)
-    (if (not erc-track-mode)
-        (message (concat "Enable the ERC track module if you want to use the"
-                        " tracking minor mode"))
-      (cond (erc-modified-channels-alist
-            ;; if we're not in erc-mode, set this buffer to return to
-             (if-let ((buf (erc-track-get-active-buffer arg))
-                      ((buffer-live-p buf)))
-                 (funcall fun buf)
-               (erc-modified-channels-update)
-               (erc-track--switch-buffer fun arg)))
-           ;; if no active channels, switch back to what we were doing before
-           (t (switch-to-buffer "#fsfsys")))))
-  )
+        ;; dont highlight channels just cuz of new messages, except for pms or some new channel I haven't listed in my config.
+
+        erc-track-shorten-cutoff 40
+        ;; sed -rn 's/.*(#[^>]*).*/"\1"/p' /p/c/machine_specific/li/filesystem/var/lib/znc/configs/znc.conf
+        erc-track-priority-faces-only (list
+                                        "#conservancy"
+                                        "#fosdem"
+                                        "#fsf"
+                                        "#fsf-licensing"
+                                        "#fsfe"
+                                        "#fsfsys"
+                                        "#gnu"
+                                        "#librecmc"
+                                        "#libreplanet"
+                                        "#mnt-reform"
+                                        "#nouveau"
+                                        "#pump.io"
+                                        "#savannah"
+                                        "#seagl"
+                                        "#social"
+                                        "#spamassassin"
+                                        "#talos-workstation"
+                                        "#trisquel"
+                                        "#trisquel-dev"
+                                        "#overseers"
+                                        "#gdb"
+                                        "#gcc"
+                                        "#glibc"
+                                        "#binutils"
+                                        "#gnu-linux-libre"
+                                        "#parabola"
+                                        "#guix"
+                                        "#gnu-ops"
+                                        "#gcc"
+                                        )
+  ;; so that we don't show channels where i havent been mmentioned
+  erc-track-faces-priority-list '(erc-current-nick-face
+                                  erc-keyword-face
+                                  erc-pal-face
+                                  erc-nick-msg-face
+                                  erc-direct-msg-face
+                                  erc-fool-face)
+
+
+  ) ; end setq
+
+:config
+(add-hook 'erc-server-PRIVMSG-functions
+          'erc-my-privmsg-sound)
+(add-hook 'erc-text-matched-hook 'erc-sound-if-not-server)
+(erc-track-mode 1)
+(defun erc-track--switch-buffer (fun arg)
+  (if (not erc-track-mode)
+      (message (concat "Enable the ERC track module if you want to use the"
+                      " tracking minor mode"))
+    (cond (erc-modified-channels-alist
+          ;; if we're not in erc-mode, set this buffer to return to
+           (if-let ((buf (erc-track-get-active-buffer arg))
+                    ((buffer-live-p buf)))
+               (funcall fun buf)
+             (erc-modified-channels-update)
+             (erc-track--switch-buffer fun arg)))
+         ;; if no active channels, switch back to what we were doing before
+         (t (switch-to-buffer "#fsfsys")))))
+)
 ;;; named commands
 (defun rm-file-and-buffer ()
   "Removes file connected to current buffer and kills buffer."
@@ -1811,7 +1841,7 @@ or else the number of characters matched by `outline-regexp'."
 (dolist
     (r `(
          (?i (file . ,(concat user-emacs-directory "init.el")))
-         (?o (file . ,"/a/work.org"))
+         (?o (file . ,"/b/w/work.org"))
          (?t (file . ,"/a/t.org"))
          (?s (file . ,"/usr/share/doc/exim4-base/spec.txt.gz"))
          (?w (file . ,"/p/w.org"))