From a029721a791af99a69952be35446eea1a7f7fa72 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 2 Jan 2019 15:19:03 +1300 Subject: Add new filetype pattern for muttrc --- vim/filetype.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/vim/filetype.vim b/vim/filetype.vim index 3ac816d4..2a5725dc 100644 --- a/vim/filetype.vim +++ b/vim/filetype.vim @@ -204,6 +204,7 @@ augroup filetypedetect \ Muttrc \,*/.muttrc.d/*.rc \,.muttrc + \,muttrc \,/etc/Muttrc.d/* \ setfiletype muttrc " BIND configuration file -- cgit v1.2.3 From 1944feefc4d426ed43b94ec39fa8d4c15e1fa2a6 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 2 Jan 2019 21:00:18 +1300 Subject: Don't edit message headers using Emacs Until such time as I can figure out how to make format=flowed work sanely with these. --- mutt/muttrc.d/src | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mutt/muttrc.d/src b/mutt/muttrc.d/src index 584a2785..cc2eb4ef 100755 --- a/mutt/muttrc.d/src +++ b/mutt/muttrc.d/src @@ -4,3 +4,10 @@ for rc in "$HOME"/.muttrc.d/*.rc ; do [ -e "$rc" ] || continue cat -- "$rc" done + +# Special case: if using GNU Emacs, emit a line to disable edit_headers, just +# because at the moment I haven't worked out how to make this work sanely with +# messages-are-flowing in message-mode. +case $VISUAL in + emacs|emacsclient) printf 'set edit_headers = no\n' ;; +esac -- cgit v1.2.3 From b1cb59184d3e35a961d0139ae657a330ad9b1a13 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 2 Jan 2019 21:45:46 +1300 Subject: Add emacsclient logic to $VISUAL set --- sh/profile.d/visual.sh | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/sh/profile.d/visual.sh b/sh/profile.d/visual.sh index 94aee963..359bf13a 100644 --- a/sh/profile.d/visual.sh +++ b/sh/profile.d/visual.sh @@ -1,9 +1,25 @@ -# If emacs is installed, and ~/.emacs exists, use emacs as the visual editor; -# otherwise, use the system's vi +# If an Emacs is installed, and ~/.emacs exists, use emacs as the visual +# editor; otherwise, use the system's vi if command -v emacs >/dev/null 2>&1 && - [ -f "$HOME"/.emacs ] ; then - VISUAL=emacs + [ -f "$HOME"/.emacs ] ; then + + # Use or start a GNU Emacs client, if possible + if command -v pgrep >/dev/null 2>&1 && + pgrep --exact --full --euid="$USER" \ + 'emacs --daemon' >/dev/null || + emacs --daemon >/dev/null ; then + VISUAL=emacsclient + + # If no GNU Emacs daemon is available, just create a new instance every + # time + else + VISUAL=emacs + fi + +# If an Emacs isn't installed, just use good old vi else VISUAL=vi fi + +# Export final editor decision export VISUAL -- cgit v1.2.3 From 09e5eaba616ad1f2ee1de783a7acbd52afdc1f4e Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 2 Jan 2019 21:49:45 +1300 Subject: Tidy packages list in .emacs a bit --- emacs/emacs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/emacs/emacs b/emacs/emacs index a80f36a1..f305f99a 100644 --- a/emacs/emacs +++ b/emacs/emacs @@ -4,4 +4,8 @@ (package-initialize) (custom-set-variables '(package-selected-packages - (quote (markdown-mode fireplace)))) + (quote ( + fireplace + markdown-mode + vimrc-mode + )))) -- cgit v1.2.3 From ae73bbd57e975e089671b551a3a4f7e619ff87aa Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 2 Jan 2019 21:50:01 +1300 Subject: Add Emacs settings for message-mode --- emacs/emacs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/emacs/emacs b/emacs/emacs index f305f99a..119a98d3 100644 --- a/emacs/emacs +++ b/emacs/emacs @@ -9,3 +9,7 @@ markdown-mode vimrc-mode )))) + +(add-to-list 'auto-mode-alist '("/mutt" . message-mode)) +(add-hook 'message-mode-hook 'auto-fill-mode) +(add-hook 'message-mode-hook (lambda () (use-hard-newlines 1 'always))) -- cgit v1.2.3 From 93c74c47a31cf1a65368f51bedc03a33f38c9451 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 2 Jan 2019 22:46:51 +1300 Subject: Add some more elementary Emacs configuration Now I remember how it felt to try to use Vim for the first time. --- emacs/emacs | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/emacs/emacs b/emacs/emacs index 119a98d3..637f8053 100644 --- a/emacs/emacs +++ b/emacs/emacs @@ -1,3 +1,4 @@ +;; Package setup (require 'package) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) @@ -10,6 +11,24 @@ vimrc-mode )))) -(add-to-list 'auto-mode-alist '("/mutt" . message-mode)) -(add-hook 'message-mode-hook 'auto-fill-mode) -(add-hook 'message-mode-hook (lambda () (use-hard-newlines 1 'always))) +;; Still trying to get mail to behave properly +(add-to-list 'auto-mode-alist '("/mutt" . mail-mode)) +(add-hook 'mail-mode-hook 'auto-fill-mode) +(add-hook 'mail-mode-hook 'use-hard-newlines) + +;; From better-defaults.el +(show-paren-mode 1) +(setq-default indent-tabs-mode nil) +(setq + require-final-newline t + visible-bell t + save-place-file (concat user-emacs-directory "places") + backup-directory-alist `(("." . ,(concat user-emacs-directory "backups"))) +) + +;; A few more options I've found around the web +(customize-set-variable 'inhibit-startup-screen t) +(column-number-mode 1) +(line-number-mode 1) +(menu-bar-mode -1) +(tool-bar-mode -1) -- cgit v1.2.3 From 912464e67fbc1eb1e61d49ddade68a3bf9053a61 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 2 Jan 2019 23:29:09 +1300 Subject: Bump VERSION --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 02fd4e9d..0666ce00 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -tejr dotfiles v4.4.0 -Mon Dec 31 23:39:00 UTC 2018 +tejr dotfiles v4.5.0 +Wed Jan 2 10:29:09 UTC 2019 -- cgit v1.2.3