From ef71eedb6bcc3889128af24df3aa668dde3e2c6f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 22 Aug 2015 03:46:53 -0400 Subject: emacs/init.el: tidy --- .config/emacs/init.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to '.config/emacs/init.el') diff --git a/.config/emacs/init.el b/.config/emacs/init.el index e14d0f5..e635b77 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -149,7 +149,8 @@ "Use spaces for alignment" (let ((indent-tabs-mode nil)) (apply orig-fun args))) -(advice-add 'align-regexp :around #'align-regexp--use-spaces) +(advice-add 'align-regexp :around + #'align-regexp--use-spaces) (defun sh-smie-sh-rules--fix (args) "Replace :after \"then\" with :after \"if\" because Emacs 24 @@ -157,7 +158,8 @@ sh-script.el is broken." (if (equal args (list :after "then")) (list :after "if") args)) -(advice-add 'sh-smie-sh-rules :filter-args #'sh-smie-sh-rules--fix) +(advice-add 'sh-smie-sh-rules :filter-args + #'sh-smie-sh-rules--fix) (require 'go-mode-load nil t) -- cgit v1.2.3 From 1ae109d7abae11a327f362bfdfb623ac0ac770e0 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 22 Aug 2015 03:51:52 -0400 Subject: Clean up bash configuration, and bash-emacs integration --- .config/emacs/init.el | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to '.config/emacs/init.el') diff --git a/.config/emacs/init.el b/.config/emacs/init.el index e635b77..90fda1b 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -161,6 +161,32 @@ sh-script.el is broken." (advice-add 'sh-smie-sh-rules :filter-args #'sh-smie-sh-rules--fix) +;; Ideally, figuring this out should be done by uniquify, but I +;; haven't determined how to get uniquify to think that it manages the +;; term buffer. +(defun term-get-short-cwd () + ;; local base=$PWD + ;; local suffix='' + ;; # The regex here is a list of directory names + ;; # that aren't really helpful, and that the + ;; # parent directory should be included also. + ;; if [[ $base =~ (/(src|pkg|doc|pkg-libre|src-libre|trunk|tags|branches))*$ ]]; then + ;; suffix=$BASH_REMATCH + ;; base=${base%$suffix} + ;; fi + ;; base=${base##*/} + ;; echo ${base}${suffix} + (directory-file-name default-directory)) +(defun term-handle-ansi-terminal-messages--uniquify (args) + (rename-buffer (concat + (replace-regexp-in-string "<.*>$" "" (buffer-name)) + "<" + (term-get-short-cwd) + ">") + t)) +(advice-add 'term-handle-ansi-terminal-messages :after + #'term-handle-ansi-terminal-messages--uniquify) + (require 'go-mode-load nil t) -- cgit v1.2.3 From 890e856fce07001fd82018b1a075faa684a198aa Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 4 Oct 2015 14:57:45 -0400 Subject: Emacs: newer go-mode --- .config/emacs/init.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.config/emacs/init.el') diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 90fda1b..38f6e77 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -112,6 +112,7 @@ (:name nginx-mode :type elpa :after (put 'nginx-indent-level 'safe-local-variable 'integerp)) (:name scss-mode :type elpa) + (:name go-mode :type elpa) )) ;; What packages el-get should install, both from above, and it's ;; internal list of sources. @@ -130,6 +131,7 @@ ;;nxhtml ; nxhtml is invasive, only enable if actively using bison-mode coffee-mode + go-mode graphviz-dot-mode haml-mode markdown-mode @@ -187,8 +189,6 @@ sh-script.el is broken." (advice-add 'term-handle-ansi-terminal-messages :after #'term-handle-ansi-terminal-messages--uniquify) -(require 'go-mode-load nil t) - ;; Make the mouse work in an xterm -- cgit v1.2.3