;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
+;; batch mode doesn't do package-initialize, so we need to call it to
+;; setup the load-path for dash
+
+(setq force (getenv "FORCE_RECOMPILE"))
+(package-initialize)
(require 'dash)
+;; i was using git versions of gnus & bbdb and they
+;; needed to run make instead of just byte compile the dir.
+;; I'm not anymore, but leaving this in case I do or there
+;; are similar packages.
(cd "~/.emacs.d/src")
(--map (when (and (not (string= it "gnus"))
(not (string= it "bbdb"))
+ (not (string= it "."))
+ (not (string= it ".."))
(file-directory-p it))
- (byte-recompile-directory (expand-file-name it) 0 t))
+ (byte-recompile-directory (expand-file-name it) 0 force))
(directory-files "."))
-(byte-recompile-directory (expand-file-name "~/.emacs.d/elpa") 0 t)
-(byte-recompile-file (expand-file-name "~/.emacs.d/my-init.el") t)
+(byte-recompile-directory (expand-file-name "~/.emacs.d/elpa") 0 force)
+(byte-recompile-file (expand-file-name "~/.emacs.d/my-init.el") force)
;; (toggle-debug-on-error) ;uncomment to help debug
-;; stop from minimizing & freezing the gui
+;; Package.el added this a long time ago. emacs 26 gives a warning that
+;; this is obsolete, but it doesn't happen automatically in batch mode,
+;; and then emacs dies on error, so it doesn't seem obsolete to me.
+
+
+;; stop from minimizing & freezing the gui
;; used to freeze emacs and was really annoying,
;; seems its changed now. no harm in keeping this though.
(global-unset-key (kbd "C-z"))
-;; these need to be done before the hook in order to satisfy the byte compiler
-;; (add-to-list 'load-path "~/.emacs.d/elpa/smartparens-20140328.809")
-;; (add-to-list 'load-path "~/.emacs.d/elpa/dash-20140308.656")
-
-;;(add-to-list 'load-path "~/.emacs.d/src/ghci-completion")
+;; these need to be done before the hook in order to satisfy the byte compiler or batch mode
(add-to-list 'load-path "~/.emacs.d/emacs/site-lisp/org")
+(add-to-list 'load-path "~/.emacs.d/src/readline-complete")
+(add-to-list 'load-path "~/.emacs.d/src/bbdb-csv-import")
+(add-to-list 'load-path "~/.emacs.d/src/ghci-completion")
+(add-to-list 'load-path "~/.emacs.d/src/mediawiki-el")
+(add-to-list 'load-path "~/.emacs.d/src/spray")
+(add-to-list 'load-path "~/.emacs.d/src/visible-mark")
+
;; git version of gnus
;; (add-to-list 'load-path "~/.emacs.d/src/gnus/lisp")
;;(require 'haskell-mode-autoloads)
;;(add-to-list 'Info-default-directory-list "~/.emacs.d/src/haskell-mode")
-(require 'bbdb-loaddefs "~/.emacs.d/src/bbdb/lisp/bbdb-loaddefs.el")
-(setq bbdb-print-tex-path "~/.emacs.d/src/bbdb/tex")
+;; for using custom/upstream bbdb
+;;(require 'bbdb-loaddefs "~/.emacs.d/src/bbdb/lisp/bbdb-loaddefs.el")
+;;(setq bbdb-print-tex-path "~/.emacs.d/src/bbdb/tex")
;;(add-hook 'server-visit-hook 'raise-frame)
* things that should be at the beginning
#+begin_src emacs-lisp
;; todo, evaluating this manually disables debug on error instead of toggling it
-;(toggle-debug-on-error) ;uncomment to help debug and catch errors
-
+;;(toggle-debug-on-error) ;uncomment to help debug and catch errors
#+end_src
;; little kit to help remove a down server
;; (setq package-archives nil)
-(add-to-list 'package-archives
- '("marmalade" .
- "http://marmalade-repo.org/packages/"))
+;;(add-to-list 'package-archives
+;; '("marmalade" .
+;; "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)
-;; if this is a new machine/config, get package list
-;; not sure why we need it, but it is recommended in starter kit,
-;; and doesn't seem like a bad thing
-(unless package-archive-contents (package-refresh-contents))
-
#+end_src
* auto-complete readline-complete
#+begin_src emacs-lisp
-(add-to-list 'load-path "~/.emacs.d/src/readline-complete")
(require 'readline-complete)
;; not sure how I made these, but I deleted, and
;; it would be nice to make them again sometime
(add-hook 'bbdb-mode-hook
(lambda () (define-key bbdb-mode-map (kbd "C-k") nil)))
-(add-to-list 'load-path "~/.emacs.d/src/bbdb-csv-import")
(require 'bbdb-csv-import)
#+end_src
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"
+ mu4e-get-mail-command "true"
user-mail-address "iank@fsf.org"
mail-signature "
(setq mu4e-bookmarks
`( ,(make-mu4e-bookmark
:name "Unread messages"
- :query "flag:unread AND NOT flag:trashed AND NOT maildir:/Junk AND NOT maildir:/fwfw AND NOT maildir:/log"
+ ;; old less restrictive unread, for adapting in the future:
+ ;; flag:unread AND NOT flag:trashed AND NOT maildir:/Junk AND NOT maildir:/fwfw AND NOT maildir:/log
+ :query "flag:unread maildir:/INBOX"
:key ?u)
,(make-mu4e-bookmark
:name "Today's messages"
-(add-to-list 'load-path "~/.emacs.d/src/ghci-completion")
;; from the package readme for ghci-completion
(require 'ghci-completion)
(add-hook 'inferior-haskell-mode-hook 'turn-on-ghci-completion)
* mediawiki
#+begin_src emacs-lisp
-(add-to-list 'load-path "~/.emacs.d/src/mediawiki-el")
(eval-after-load "mediawiki"
'(progn
(remove-hook 'outline-minor-mode-hook 'mediawiki-outline-magic-keys)
#+end_src
* modes with little configuration needed
#+begin_src emacs-lisp
+;; busted:
+ ;;(require 'csv-mode)
+;;(add-to-list 'auto-mode-alist '("\\.[Cc][Ss][Vv]\\'" . csv-mode))
(require 'outshine)
(add-hook 'outline-minor-mode-hook 'outshine-hook-function)
;; here we use the standard sendmail interface, which I use postfix for
(setq send-mail-function (quote sendmail-send-it))
-(add-to-list 'load-path "~/.emacs.d/src/spray")
(require 'spray)
(global-set-key (kbd "C-M-w") 'spray-mode)
;; remember, h/l = move. f/s = faster/slower, space = pause, all others quit
(add-hook 'fundamental-mode-hook 'variable-pitch-on)
(add-hook 'org-mode-hook 'variable-pitch-on)
(add-hook 'text-mode-hook 'variable-pitch-on)
+(defun variable-pitch-off ()
+ (variable-pitch-mode 0))
+(add-hook 'yaml-mode-hook 'variable-pitch-on)
+
(set-face-attribute 'org-table nil :family (face-attribute 'fixed-pitch :family))
(set-face-attribute 'org-code nil :family (face-attribute 'fixed-pitch :family))
#+begin_src emacs-lisp
-(add-to-list 'load-path "~/.emacs.d/src/visible-mark")
;; since it is not easy to change the mark overlay priority, I change this one.
(setq show-paren-priority 999)
(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 (chirp)
-
;; We must return nil. See help for `erc-server-PRIVMSG-functions'
nil)))
+
(add-hook 'erc-server-PRIVMSG-functions
'erc-my-privmsg-sound)