From e0470f5f075996f2e6a91fb80f4efda6d5573ac4 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 15 Sep 2014 11:57:57 +0900 Subject: set path to web browser on Windows --- .emacs.d/init.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 5276f4c4..55eae700 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1918,7 +1918,7 @@ BINDEE may be a command or another keymap, but whatever it is, it should not be ;(add-hook 'electric-indent-functions 'electric-indent-ignore-python) ;; browser -(setq browse-url-generic-program "iceweasel" +(setq browse-url-generic-program "C:\\Program Files\\Mozilla Firefox\\firefox.exe" browse-url-browser-function 'browse-url-generic) ;; clipboard & primary selection: see https://www.gnu.org/software/emacs/manual/html_node/emacs/Clipboard.html @@ -2052,7 +2052,7 @@ ARG, PRED ignored." (setq TeX-output-view-style (quote (("^pdf$" "." "evince %o") - ("^html?$" "." "iceweasel %o")))) + ("^html?$" "." "C:\\Program Files\\Mozilla Firefox\\firefox.exe %o")))) ;;; fixes for exporting from Org-mode -- cgit v1.2.3 From e045d1fdc07dee904fade1b19ef9b403fb23a4d3 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 6 Oct 2014 16:51:39 +0900 Subject: disable jabber, eimp on Windows --- .emacs.d/init.el | 1 + 1 file changed, 1 insertion(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 55eae700..374ae4e6 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -880,6 +880,7 @@ ;;; allow Emacs to resize images: keybinding S f (use-package eimp + :disabled t :ensure :init (add-hook 'image-mode-hook 'eimp-mode)) -- cgit v1.2.3 From 2110f960f6034b30eab6e241626a3d17b6a2ccfb Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Wed, 8 Oct 2014 13:41:17 +0900 Subject: Emacs mode for editing AutoHotkey scripts --- .emacs.d/init.el | 6 + .emacs.d/site-lisp/ahk-mode.el | 640 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 646 insertions(+) create mode 100644 .emacs.d/site-lisp/ahk-mode.el diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 374ae4e6..6e415bf6 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -557,6 +557,12 @@ (use-package php-mode :ensure :mode (("\\.php" . php-mode))) +;;; AHK mode + +(use-package ahk-mode + :mode "\\.ahk" + :init (setq ahk-syntax-directory "c:/Program Files/AutoHotKey/Extras/Editors/Syntax")) + ;;; Deft (use-package deft diff --git a/.emacs.d/site-lisp/ahk-mode.el b/.emacs.d/site-lisp/ahk-mode.el new file mode 100644 index 00000000..c668024c --- /dev/null +++ b/.emacs.d/site-lisp/ahk-mode.el @@ -0,0 +1,640 @@ +;;; ahk-mode.el --- major mode for editing AutoHotKey scripts for X/GNU Emacs + +;; Copyright (C) 2005 Robert Widhopf-Fenk + +;; Author: Robert Widhopf-Fenk +;; Keywords: AutoHotKey, major mode +;; X-URL: http://www.robf.de/Hacking/elisp +;; arch-tag: 1ae180cb-002e-4656-bd9e-a209acd4a3d4 +;; Version: $Id$ + +;; This code is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; + +;;; Commentary: +;; +;; AutoHotKey: Automation, Hotkeys and Scripting for Windows at +;; http://www.autohotkey.com/ is a cool tool to make daily life +;; with Windows easier or even fun! +;; +;; This is a X/GNU Emacs mode for editing AutoHotKey scripts. +;; +;; Place this file somewhere in your load-path, byte-compile it and add the +;; following line to your ~/.xemacs/init.el resp. ~/.emacs: +;; +;; (setq ahk-syntax-directory "PATHTO/AutoHotkey/Extras/Editors/Syntax/") +;; (add-to-list 'auto-mode-alist '("\\.ahk$" . ahk-mode)) +;; (autoload 'ahk-mode "ahk-mode") +;; +;; The first time ahk-mode.el is started it will ask you for the path to the +;; Syntax directory if not set already. You will find it as a subdirectory +;; of your AHK installation. +;; +;; For example if you installed AHK at C:\Programms\AutoHotKey it will be +;; C:/Programms/AutoHotKey/Extras/Editors/Syntax or a corresponding cygwin +;; path! +;; +;; When opening a script file you will get: +;; - syntax highlighting +;; - indention, completion and command help (bound to "TAB") +;; - insertion of command templates (bound to "C-c C-i") +;; - electric braces (typing "{" will also insert "}" and place point in +;; between) +;; - lookup the docs on a command via w3 (place point on command and type +;; "C-c C-h") +;; +;; Please send bug-reports or feature suggestions to hackATrobfDOTde. + +;;; Bugs: +;; +;; - completions is not really context aware +;; - multi-line comments are not fontified correctly while editing, +;; but only when fontifying the whole buffer. If you know how to +;; fix this, please let me know! + +;;; History: +;; +;; The CHANGELOG is stored in my arch repository. +;; +;; If you wonder what arch is, take a look at http://wiki.gnuarch.org/ ! + +(eval-when-compile + (require 'font-lock) + (if (locate-library "w3") (require 'w3)) + (require 'cl)) + +;;; Code: +(defgroup ahk-mode nil + "A mode for AutoHotKey" + :group 'languages + :prefix "ahk-") + +(defcustom ahk-mode-hook '(ahk-mode-hook-activate-filling) + "Hook functions run by `ahk-mode'." + :type 'hook + :group 'ahk-mode) + +(defcustom ahk-indetion 2 + "The indetion level." + :type 'integer + :group 'ahk-mode) + +(defcustom ahk-syntax-directory nil + "The indetion level." + :type 'directory + :group 'ahk-mode) + +;;;###autoload +(add-to-list 'auto-mode-alist + '("\\.ahk$" . ahk-mode)) + +(defvar ahk-mode-syntax-table + (let ((table (make-syntax-table))) + ;; these are also allowed in variable names + (modify-syntax-entry ?# "w" table) + (modify-syntax-entry ?_ "w" table) + (modify-syntax-entry ?@ "w" table) + (modify-syntax-entry ?$ "w" table) + (modify-syntax-entry ?? "w" table) + (modify-syntax-entry ?[ "w" table) + (modify-syntax-entry ?] "w" table) + ;; some additional characters used in paths and switches + (modify-syntax-entry ?\\ "w" table) +; (modify-syntax-entry ?/ "w" table) + (modify-syntax-entry ?- "w" table) + (modify-syntax-entry ?: "w" table) + (modify-syntax-entry ?. "w" table) + ;; for multiline comments (taken from cc-mode) + (modify-syntax-entry ?/ ". 14" table) + (modify-syntax-entry ?* ". 23" table) + ;; Give CR the same syntax as newline, for selective-display + (modify-syntax-entry ?\^m "> b" table) + (modify-syntax-entry ?\n "> b" table) + table) + "Syntax table used in `ahk-mode' buffers.") + +(defvar ahk-mode-abbrev-table + (let ((a (make-abbrev-table))) + a) + "Abbreviation table used in `ahk-mode' buffers.") + +(defvar ahk-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "\C-c\C-h" 'ahk-www-help-at-point) + (define-key map "\C-c\C-c" 'ahk-comment-region) + (define-key map "\C-c\C-i" 'ahk-insert-command-template) + (define-key map "\t" 'ahk-indent-line-and-complete) + (define-key map "{" 'ahk-electric-brace) + (define-key map "}" 'ahk-electric-brace) + (define-key map "\r" 'ahk-electric-return) + map) + "Keymap used in `ahk-mode' buffers.") + +(defvar ahk-Commands-list nil + "A list of ahk commands and parameters. +Will be initialized by `ahk-init'") + +(defvar ahk-Keys-list nil + "A list of ahk key names. +Will be initialized by `ahk-init'") + +(defvar ahk-Keywords-list nil + "A list of ahks keywords. +Will be initialized by `ahk-init'") + +(defvar ahk-Variables-list nil + "A list of ahks variables. +Will be initialized by `ahk-init'") + +(defvar ahk-mode-font-lock-keywords nil + "Syntax highlighting for `ahk-mode'. +Will be initialized by `ahk-init'") + +(defvar ahk-completion-list nil + "A list of all symbols available for completion +Will be initialized by `ahk-init'") + +(easy-menu-define ahk-menu ahk-mode-map "AHK Mode Commands" + '("AHK" + ["Insert Command Template" ahk-insert-command-template] + ["Lookup webdocs on command" ahk-www-help-at-point] + )) + +(defun ahk-init () + "Initialize ahk-mode variables. +An AHK installation provides a subdirectory \"Extras/Editors/Syntax\" +containing a list of keywords, variables, commands and keys. + +This directory must be specified in the variable `ahk-syntax-directory'." + (interactive) + + (message "Initializing ahk-mode variables ...") + (when (null ahk-syntax-directory) + (customize-save-variable + 'ahk-syntax-directory + (read-file-name "Please give the AHK-Syntax directory: ")) + (custom-save-all)) + + (save-excursion + (set-buffer (get-buffer-create " *ahk-mode-temp*")) + + ;; read commands + (erase-buffer) + (insert-file-contents (expand-file-name "Commands.txt" + ahk-syntax-directory)) + (setq ahk-Commands-list nil) + (goto-char 0) + (while (not (eobp)) + (if (not (looking-at "\\([^;\r\n][^(\t\r\n, ]+\\)\\([^\r\n]*\\)")) + nil;; (error "Unknown file syntax") + (setq ahk-Commands-list (cons (list + (match-string 1) + (match-string 2)) + ahk-Commands-list))) + (forward-line 1)) + + ;; read keys + (erase-buffer) + (insert-file-contents (expand-file-name "Keys.txt" + ahk-syntax-directory)) + (setq ahk-Keys-list nil) + (goto-char 0) + (while (not (eobp)) + (if (not (looking-at "\\([^;\r\n][^\t\r\n ]+\\)")) + nil;; (error "Unknown file syntax of Keys.txt") + (setq ahk-Keys-list (cons (match-string 1) ahk-Keys-list))) + (forward-line 1)) + + ;; read keywords + (erase-buffer) + (insert-file-contents (expand-file-name "Keywords.txt" + ahk-syntax-directory)) + (setq ahk-Keywords-list nil) + (goto-char 0) + (while (not (eobp)) + (if (not (looking-at "\\([^;\r\n][^\t\r\n ]+\\)")) + nil;; (error "Unknown file syntax of Keywords.txt") + (setq ahk-Keywords-list (cons (match-string 1) ahk-Keywords-list))) + (forward-line 1)) + ;; read variables + (erase-buffer) + (insert-file-contents (expand-file-name "Variables.txt" + ahk-syntax-directory)) + (setq ahk-Variables-list nil) + (goto-char 0) + (while (not (eobp)) + (if (not (looking-at "\\([^;\r\n][^\t\r\n]+\\)")) + nil;; (error "Unknown file syntax of Variables.txt") + (setq ahk-Variables-list (cons (match-string 1) ahk-Variables-list))) + (forward-line 1)) + + ;; built completion list + (setq ahk-completion-list + (mapcar (lambda (c) (list c)) + (append (mapcar 'car ahk-Commands-list) + ahk-Keywords-list + ahk-Variables-list + ahk-Keys-list))) + + (setq ahk-mode-font-lock-keywords + (list + '("\\s-*;.*$" . + font-lock-comment-face) + '("^/\\*\\(.*\r?\n\\)*\\(\\*/\\)?" . +; '(ahk-fontify-comment . + font-lock-comment-face) + '("^\\([^ \t\n:]+\\):" . + (1 font-lock-builtin-face)) + '("[^, %\"]*%[^% ]+%" . + font-lock-variable-name-face) + ;; I get an error when using regexp-opt instead of simply + ;; concatenating the keywords and I do not understand why ;-( + ;; (warning/warning) Error caught in `font-lock-pre-idle-hook': (invalid-regexp Invalid preceding regular expression) + (cons + (concat "\\b\\(" + (mapconcat 'regexp-quote ahk-Variables-list "\\|") + "\\)\\b") + 'font-lock-variable-name-face) + (list + (concat "\\(^[ \t]*\\|::[ \t]*\\)\\(" + ;; special tokens must come first + "Else[ \t]+If[A-Za-z]*" + "\\|" + (mapconcat 'regexp-quote (mapcar 'car ahk-Commands-list) "\\|") + "\\)") + 2 + 'font-lock-function-name-face) + (cons + (concat "\\b\\(" + (mapconcat 'regexp-quote ahk-Keywords-list "\\|") + "\\)\\b") + 'font-lock-keyword-face) + (cons + (concat "\\b\\(" + (mapconcat 'regexp-quote ahk-Keys-list "\\|") + "\\)\\b") + 'font-lock-constant-face) + ))) + + (message "Initializing ahk-mode variables done.")) + +;; this was an attempt to get multi-line comments correctly highlighted, I +;; tried to understand how cc-mode is doing it, but I have to admit I do not +;; understand it! +(defun ahk-fontify-comment (limit) +; (setq limit (point-max)) + (save-excursion + (let (start end) +; (setq bstart (save-excursion +; (re-search-backward "^/\\*" (point-min) t))) +; (setq bend (save-excursion +; (re-search-backward "^\\*/" (point-min) t))) +; (if (and bstart bend (< bend bstart)) +; (goto-char bstart)) + (setq start (save-excursion + (re-search-forward "^/\\*" limit t))) + (setq end (save-excursion + (re-search-forward "^\\*/" limit t))) + + (cond + ((and start end (< end start)) + (save-excursion + (re-search-forward "^\\*/" limit t) + t)) + ((and start end (< start end)) + (save-excursion + (re-search-forward "^/\\*\\(.*\r?\n\\)*\\*/" limit t) + t)) + ((and start (not end)) + (save-excursion + (re-search-forward "^/\\*\\(.*\r?\n\\)*" limit t) + t)) + )))) + +(defun ahk-mode-hook-activate-filling () + "Activates `auto-fill-mode' and `filladapt-mode'." + (auto-fill-mode 1) + (if (locate-library "filladapt") + (filladapt-mode 1))) + +;;;###autoload +(defun ahk-mode () + "Major mode for editing AutoHotKey Scripts. + +The hook functions in `ahk-mode-hook' are run after mode initialization. + +Key bindings: +\\{ahk-mode-map}" + (interactive) + (if (null ahk-Commands-list) + (ahk-init)) + (kill-all-local-variables) + (set-syntax-table ahk-mode-syntax-table) + (setq major-mode 'ahk-mode + mode-name "AHK" + local-abbrev-table ahk-mode-abbrev-table + abbrev-mode t + indent-region-function 'ahk-indent-region) + (put 'ahk-mode 'font-lock-defaults '(ahk-mode-font-lock-keywords t)) + (put 'ahk-mode 'font-lock-keywords-case-fold-search t) + + (when (not (featurep 'xemacs)) + (setq font-lock-defaults '(ahk-mode-font-lock-keywords)) + (setq font-lock-keywords-case-fold-search t)) + + (use-local-map ahk-mode-map) + (easy-menu-add ahk-menu) + (setq comment-start ";") + (font-lock-mode 1) + (force-mode-line-update) + (run-hooks 'ahk-mode-hook)) + +(defun ahk-calc-indention (str &optional offset) + (let ((i (* (or offset 0) ahk-indetion))) + (while (string-match "\t" str) + (setq i (+ i tab-width) + str (replace-match "" nil t str))) + (setq i (+ i (length str))) + i)) + +; the follwing regexp is used to detect if a condition is a one line statement or not, +; i.e. it matches one line statements but should not match those where the THEN resp. +; ELSE body is on its own line ... +(defvar ahk-one-line-if-regexp + (concat "^\\([ \t]*\\)" ;; this is used for indention + "\\(" + "If\\(Not\\)?\\(" + (regexp-opt '("InString" "InStr" + "Less" "Greater" "Equal" + "LessOrEqual" "GreaterOrEqual" + )) + "\\)[^,\n]*,[^,\n]*,[^,\n]*," + "\\|" + "If\\(Not\\)?Exist[^,\n]*,[^,\n]*," + "\\|" + "Else[ \t]+\\([^I\n][^f\n][^ \n]\\)" + "\\)")) + +;; TODO write a unit test for indetion +(defun ahk-indent-line () + "Indent the current line." + (interactive) + + (let ((indent 0) + (opening-brace nil) (else nil) (closing-brace) (block-skip nil) + (case-fold-search t)) + ;; do a backward search to determin the indention level + (save-excursion + (beginning-of-line) + (if (looking-at "^;") + (setq indent 0) + ;; save type of current line + (setq opening-brace (looking-at "^\\([ \t]*\\)[{(]")) + (setq else (looking-at "^\\([ \t]*\\)Else[ \r\n]")) + (setq closing-brace (looking-at "^\\([ \t]*\\)[)}]")) + ;; check previous non-empty line + (skip-chars-backward " \r\t\n") + (beginning-of-line) + (when (looking-at "^\\([ \t]*\\)[)}]") + (goto-char (match-end 0)) + (backward-list) + (skip-chars-backward " \r\t\n") + (beginning-of-line) + (setq block-skip t)) + ;; skip commented lines backward + (while (and (looking-at "^;") (not (bobp))) + (forward-line -1)) + ;; is it a label + (if (looking-at "^[^: \n]+:") + (if (and (not opening-brace) + (not block-skip) + (looking-at "^[^: ]+:\\([^:\n]*:\\)?[ \t]*$")) + (setq indent ahk-indetion) + (setq indent 0)) + ;; is it an opening { or ( + (if (looking-at "^\\([ \t]*\\)[{(]") + (setq indent (ahk-calc-indention (match-string 1) 1)) + ;; is it a Return at the first level? + (if (and (looking-at "^\\([ \t]*\\)Return") + (= (ahk-calc-indention (match-string 1)) ahk-indetion)) + (setq indent (ahk-calc-indention (match-string 1) -1)) + ;; If/Else with body on next line, but not opening { or ( + (if (and (not opening-brace) + (not block-skip) + (looking-at "^\\([ \t]*\\)\\(If\\|Else\\)") + (not (looking-at ahk-one-line-if-regexp))) + (setq indent (ahk-calc-indention (match-string 1) 1)) + ;; two lines back was a If/Else thus indent like it + (if (and (not opening-brace) +; (not else) + (save-excursion + (beginning-of-line) + (skip-chars-backward " \r\t\n") + (beginning-of-line) + (setq indent nil) + ;; backtrace nested Ifs + (while (and (looking-at "^\\([ \t]*\\)\\(If\\|Else\\)") + (not (looking-at ahk-one-line-if-regexp))) + (setq indent (ahk-calc-indention (match-string 1))) + (beginning-of-line) + (skip-chars-backward " \r\t\n") + (beginning-of-line)) + indent)) + (setq indent indent) + ;; the last resort, indent as the last line + (if (looking-at "^\\([ \t]*\\)") + (setq indent (ahk-calc-indention (match-string 1))))))))))) + ;; check for special tokens + (save-excursion + (beginning-of-line) + (if (looking-at "^\\([ \t]*\\)[})]") + (setq indent (- indent ahk-indetion)) + (if (or (looking-at "^[ \t]*[^,: \t\n]*:") + (looking-at "^;;;")) + (setq indent 0)))) + + ;; set negative indention to 0 + (if (< indent 0) + (setq indent 0)) + + (let ((point (point-marker))) + (beginning-of-line) + (if (looking-at "^[ \t]+") + (replace-match "")) + (indent-to indent) + (if (not (marker-position point)) + (if (re-search-forward "[^ \t]" (point-max) t) + (goto-char (1- (point)))) + (goto-char point) + (set-marker point nil))) + (if (bolp) + (goto-char (+ (point) indent))))) + +(defun ahk-indent-region (start end) + "Indent lines in region START to END." + (interactive "r") + (save-excursion + (goto-char end) + (setq end (point-marker)) + (goto-char start) + (while (< (point) end) + (end-of-line) + (ahk-indent-line) + (forward-line 1)) + (ahk-indent-line) + (set-marker end nil))) + +(defun ahk-complete () + "Indent current line when at the beginning or complete current command." + (interactive) + + (if (looking-at "\\w+") + (goto-char (match-end 0))) + + (let ((end (point))) + (if (and (or (save-excursion (re-search-backward "\\<\\w+")) + (looking-at "\\<\\w+")) + (= (match-end 0) end)) + (let ((start (match-beginning 0)) + (prefix (match-string 0)) + (completion-ignore-case t) + completions) + (setq completions (all-completions prefix ahk-completion-list)) + (if (eq completions nil) + nil;(error "Unknown command prefix <%s>!" prefix) + (if (> (length completions) 1) + (setq completions + (completing-read "Complete command: " + (mapcar (lambda (c) (list c)) + completions) + nil t prefix))) + (if (stringp completions) + ;; this is a trick to upcase "If" and other prefixes + (let ((c (try-completion completions ahk-completion-list))) + (if (stringp c) + (setq completions c)))) + + (delete-region start end) + (if (listp completions) (setq completions (car completions))) + (insert completions) + (let ((help (assoc completions ahk-Commands-list))) + (if help (message "%s" (mapconcat 'identity help "")))) + ))))) + +(defun ahk-indent-line-and-complete () + "Combines indetion and completion." + (interactive) + (ahk-indent-line) + (ahk-complete)) + +(defun ahk-electric-brace (arg) + "Insert character ARG and correct line's indentation." + (interactive "p") + (if (save-excursion + (skip-chars-backward " \t") + (bolp)) + nil + (ahk-indent-line) + (newline)) + (self-insert-command arg) + (ahk-indent-line) + (newline) + (ahk-indent-line) + + (let ((event last-input-event)) + (setq event (if (featurep 'xemacs) + (event-to-character event) + (setq event (if (stringp event) (aref event 0) event)))) + + (when (equal event ?{) + (newline) + (ahk-indent-line) + (insert ?}) + (ahk-indent-line) + (forward-line -1) + (ahk-indent-line)))) + +(defun ahk-electric-return () + "Insert newline and indent." + (interactive) + (ahk-indent-line) + (newline) + (ahk-indent-line)) + +(defun ahk-insert-command-template () + "Insert a command template." + (interactive) + (let ((completions (mapcar (lambda (c) (list (mapconcat 'identity c ""))) + ahk-Commands-list)) + (completion-ignore-case t) + (start (point)) + end + command) + (setq command (completing-read "AHK command template: " completions)) + (insert command) + (ahk-indent-line) + (setq end (point-marker)) + (goto-char start) + (while (re-search-forward "[`][nt]" end t) + (if (string= (match-string 0) "`n") + (replace-match "\n") + (replace-match ""))) + (ahk-indent-region start end) + (goto-char (1+ start)) + ;; jump to first parameter + (re-search-forward "\\<" end nil) + (set-marker end nil))) + +(defun ahk-comment-region (start end &optional arg) + "Comment or uncomment each line in the region from START to END. +If no region is active use the current line." + (interactive (if (region-active-p) + (list (region-beginning) + (region-end) + current-prefix-arg) + (let (start end) + (beginning-of-line) + (setq start (point)) + (forward-line) + (setq end (point)) + (list start end current-prefix-arg)))) + (save-excursion + (comment-region start end arg))) + +(defun ahk-www-help-at-point () + (interactive) + (save-excursion + (re-search-backward "\\<\\w+") + (if (looking-at "\\<\\w+") + (ahk-www-help (match-string 0))))) + +(defvar ahk-www-help-alist '() + "Mapping of command to regexp for commands which are not unique.") + +(defun ahk-www-help (command) + "Display online help for the given command" + (interactive (list + (completing-read "AHK command: " + ahk-completion-list nil t))) + (require 'w3) + (w3-fetch "http://www.autohotkey.com/docs/commands.htm") + (goto-char (point-min)) + (when (re-search-forward (concat "^|" (regexp-quote command))) + (goto-char (+ (match-beginning 0) 1)) + (save-excursion + (if (re-search-forward (concat "^|" (regexp-quote command)) + (point-max) t) + (message "There is more than one occurrence of %s. Stopping at first match" command) + (widget-button-press (point)))))) + +(provide 'ahk-mode) + +;;; ahk-mode.el ends here -- cgit v1.2.3 From 0834b7f37532fb32a3e7d559e8bcc090d3c52278 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 17 Oct 2014 16:58:39 +0900 Subject: disable asyncronous dired on Windows --- .emacs.d/init.el | 1 + 1 file changed, 1 insertion(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 6e415bf6..1a8cfd80 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -874,6 +874,7 @@ ;;; make dired copy and move asynchronously (use-package async + :disabled t :ensure :init (when (require 'dired-aux) (require 'dired-async))) -- cgit v1.2.3 From 3b9b50e8bd01f5b6b0e87d170731db23c774fd9e Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 28 Oct 2014 09:10:22 +0900 Subject: disable magit git wip on Windows --- .emacs.d/init.el | 1 + 1 file changed, 1 insertion(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 1a8cfd80..0ab11029 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -408,6 +408,7 @@ (use-package magit-annex :ensure) (use-package magit-wip + :disabled t :diminish magit-wip-save-mode :config (global-magit-wip-save-mode 1))) -- cgit v1.2.3 From 11b8983c27caf3065a5c4ff6c05eee7d4b480744 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 31 Oct 2014 09:44:22 +0900 Subject: for now, open images in Windows image viewer since don't have the right libraries working to view in Emacs --- .emacs.d/init-custom.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.emacs.d/init-custom.el b/.emacs.d/init-custom.el index a3f9a664..97e6736a 100644 --- a/.emacs.d/init-custom.el +++ b/.emacs.d/init-custom.el @@ -67,7 +67,7 @@ '(jabber-alert-presence-hooks nil) '(mairix-file-path "~/local") '(mairix-search-file "mairixresults") - '(openwith-associations (quote (("\\.pdf\\'" "evince" (file)) ("\\.\\(ogg\\|mp3\\|flac\\)\\'" "vlc" (file)) ("\\.\\(doc\\|docx\\|xls\\|xlsx\\)\\'" "soffice" (file)) ("\\.\\(mkv\\|webm\\)\\'" "vlc" (file)) ("\\.avi\\'" "vlc" (file)) ("\\.mp4\\'" "vlc" (file)) ("\\.ppt\\'" "soffice" (file)) ("\\.\\(ppt\\|pptx\\|potx\\)\\'" "soffice" (file)) ("\\.wmv\\'" "vlc" (file)) ("\\.flv\\'" "vlc" (file)) ("\\.hwp\\'" "hanword" (file))))) + '(openwith-associations (quote (("\\.pdf\\'" "evince" (file)) ("\\.\\(ogg\\|mp3\\|flac\\)\\'" "vlc" (file)) ("\\.\\(doc\\|docx\\|xls\\|xlsx\\)\\'" "soffice" (file)) ("\\.\\(mkv\\|webm\\)\\'" "vlc" (file)) ("\\.avi\\'" "vlc" (file)) ("\\.mp4\\'" "vlc" (file)) ("\\.ppt\\'" "soffice" (file)) ("\\.\\(ppt\\|pptx\\|potx\\)\\'" "soffice" (file)) ("\\.wmv\\'" "vlc" (file)) ("\\.flv\\'" "vlc" (file)) ("\\.hwp\\'" "hanword" (file)) ("\\.\\(png\\|jpg\\|gif\\|JPG\\|PNG\\|GIF\\|bmp\\|BMP\\)\\'" "open" nil)))) '(org-agenda-sticky t) '(org-agenda-time-grid (quote -- cgit v1.2.3 From 046f0d47ee1b1968d99ed71a4398ff005baeb6b3 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 17 Nov 2014 16:19:56 +0900 Subject: local dotfiles repo branch git eshell aliases replaced for school --- .emacs.d/eshell/alias | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.emacs.d/eshell/alias b/.emacs.d/eshell/alias index 48e911c2..526cd18a 100644 --- a/.emacs.d/eshell/alias +++ b/.emacs.d/eshell/alias @@ -8,9 +8,9 @@ alias fmr MR_FAST=true mr alias blank sleep 1;xset dpms force off alias docs cd ~/doc && mr sync alias annex-to-ma cd ~/lib/annex;ga copy -t metaarray --auto --fast -alias git-rebase-host-branch git rebase master;git checkout ${hostname};git rebase master -alias git-push-host-branch git push origin master +${hostname} -alias git-dotfiles git-rebase-host-branch && git-push-host-branch +alias git-rebase-win32-on-master git checkout win32;git rebase master +alias git-push-win32-master git push origin master;git push -f origin win32 +alias git-dotfiles git-rebase-win32-on-master && git-push-win32-master alias workgit cd ~/doc;git add org/*.org;git commit -a -e -m "work commit";git push alias sonatarc cd ~/src/dotfiles;git checkout .config/sonata/sonatarc;cd - alias newtorrents mv ~/tmp/*.torrent ~/local/rt/watch -- cgit v1.2.3 From 1945713e7235fe1f533fa0464ab3a88f19b2533f Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 17 Nov 2014 16:22:18 +0900 Subject: don't have right now reliable, solid focus follows mouse for Windows. Let Emacs know --- .emacs.d/init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 0ab11029..a8d7b5ea 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -69,7 +69,7 @@ ;; focus follow mouse (setq mouse-autoselect-window nil - focus-follows-mouse t) + focus-follows-mouse nil) ;; y/n rather than yes/no (fset 'yes-or-no-p 'y-or-n-p) -- cgit v1.2.3 From 98d3c9b71ac0de21b4f6c0568870f86cb1bc4db8 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 21 Nov 2014 09:28:45 +0900 Subject: plink for tramp on Windows --- .emacs.d/init.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index a8d7b5ea..c79d80d7 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -615,6 +615,11 @@ (use-package tramp :config + + ;; plink on Windows + (setq tramp-default-method "plink") + (setq tramp-auto-save-directory "C:/Users/swhitton/AppData/Local/Temp") + (add-to-list 'tramp-default-user-alist '(nil "sdf" "spw")) (add-to-list 'tramp-default-user-alist '("sudo" "localhost" "root")) (add-to-list 'tramp-default-user-alist '(nil nil "swhitton") t) -- cgit v1.2.3 From 9b781f1e5a982cb822c8a3b0950c2c42819b0903 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 8 Dec 2014 11:51:40 +0900 Subject: variable pitch mode for Windows --- .emacs.d/init-custom.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.emacs.d/init-custom.el b/.emacs.d/init-custom.el index 97e6736a..bdca8451 100644 --- a/.emacs.d/init-custom.el +++ b/.emacs.d/init-custom.el @@ -12,7 +12,7 @@ '(org-hide ((t (:foreground "#3f3f3f" :slant normal :weight normal :height 110 :width normal :foundry "xos4" :family "Terminus")))) '(sr-directory-face ((t (:foreground "#94bff3" :weight bold))) t) '(sr-symlink-directory-face ((t (:foreground "#94bff3" :slant italic))) t) - '(variable-pitch ((t (:height 1.4 :family "Bitstream Charter")))) + '(variable-pitch ((t (:height 140 :family "DejaVu Serif")))) '(visible-mark-face ((t (:background "#607080"))) t)) (custom-set-variables -- cgit v1.2.3 From 9f2ea88a58b1d69b7a86be6025ece1a43e722121 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Thu, 11 Dec 2014 09:48:26 +0900 Subject: command to stash changes and apply to master branch since Windows git version isn't very good at switching branches --- .emacs.d/eshell/alias | 1 + 1 file changed, 1 insertion(+) diff --git a/.emacs.d/eshell/alias b/.emacs.d/eshell/alias index 526cd18a..b6069edb 100644 --- a/.emacs.d/eshell/alias +++ b/.emacs.d/eshell/alias @@ -11,6 +11,7 @@ alias annex-to-ma cd ~/lib/annex;ga copy -t metaarray --auto --fast alias git-rebase-win32-on-master git checkout win32;git rebase master alias git-push-win32-master git push origin master;git push -f origin win32 alias git-dotfiles git-rebase-win32-on-master && git-push-win32-master +alias git-stash-to-master git stash && git checkout master && git stash pop alias workgit cd ~/doc;git add org/*.org;git commit -a -e -m "work commit";git push alias sonatarc cd ~/src/dotfiles;git checkout .config/sonata/sonatarc;cd - alias newtorrents mv ~/tmp/*.torrent ~/local/rt/watch -- cgit v1.2.3 From f3f065ef9c460375347bb050c4f6146ca6f99f82 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 15 Dec 2014 14:04:58 +0900 Subject: use the start menu via helm --- .emacs.d/init.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index c79d80d7..d427bb6c 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -788,6 +788,13 @@ :config (helm-descbinds-mode))) +;;; I don't want to have to use the start menu + +(use-package helm-w32-launcher + :ensure + :init (progn + (evil-leader/set-key "z" 'helm-w32-launcher))) + ;;; snippets (use-package yasnippet -- cgit v1.2.3 From bbc8e79c009f340f6bcda0c67421052885f0ca44 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Wed, 17 Dec 2014 13:46:44 +0900 Subject: prefer Unicode in Emacs at school --- .emacs.d/init.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index d427bb6c..7b189117 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -43,6 +43,10 @@ (load-file (concat user-emacs-directory "init-term.el")) +;;; preferred charset at work + +(prefer-coding-system 'utf-8) + ;;; put backups and autosaves in /tmp (defconst emacs-tmp-dir (format "%s/%s%s/" temporary-file-directory "emacs" (user-uid))) -- cgit v1.2.3 From a7c28deed05237b302e371d576732b73eb6e0e13 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 2 Jan 2015 09:42:29 +0900 Subject: non-evil binding for helm-w32-launcher --- .emacs.d/init.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 7b189117..619f9f11 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -796,8 +796,7 @@ (use-package helm-w32-launcher :ensure - :init (progn - (evil-leader/set-key "z" 'helm-w32-launcher))) + :bind ("C-c z" . helm-w32-launcher)) ;;; snippets -- cgit v1.2.3 From a6fc21bd360dd0cbcb39ba175a694877b2c39476 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 23 Jan 2015 10:42:34 +0900 Subject: on Windows, open Org links to images with system command --- .emacs.d/init-custom.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.emacs.d/init-custom.el b/.emacs.d/init-custom.el index bdca8451..d7d38f72 100644 --- a/.emacs.d/init-custom.el +++ b/.emacs.d/init-custom.el @@ -105,6 +105,15 @@ ("uk" "Автор" "Дата" "Зміст" "Примітки") ("zh-CN" "作者" "日期" "目录" "脚注") ("zh-TW" "作者" "日期" "目錄" "腳註")))) + '(org-file-apps + (quote + ((auto-mode . emacs) + ("\\.mm\\'" . system) + ("\\.x?html?\\'" . system) + ("\\.pdf\\'" . system) + ("\\.jpg\\'" . system) + ("\\.png\\'" . system) + ("\\.gif\\'" . system)))) '(org-odt-preferred-output-format "pdf") '(popwin:special-display-config (quote -- cgit v1.2.3 From de81e66f22576d37a12da090ff5fd7dfc1219fa2 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 26 Jan 2015 10:30:14 +0900 Subject: bind my usual key to switch to Korean input on Windows keyboards --- .emacs.d/init.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 619f9f11..5e027579 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1309,6 +1309,11 @@ automatically." (bind-key "S-" 'spw/toggle-language-environment) (bind-key "" 'hangul-to-hanja-conversion) +;; and for Windows (shift modifier has no effect) + +(bind-key "" 'spw/toggle-language-environment) +(bind-key "" 'hangul-to-hanja-conversion) + ;; kill the binding korea-utils.el seems to be setting (global-unset-key (kbd "S-SPC")) -- cgit v1.2.3 From 56bea3c589bb8ae0e8b34a9e40464dbcb43b216f Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Wed, 28 Jan 2015 16:29:05 +0900 Subject: path to ghci on Windows --- .emacs.d/init-haskell.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.emacs.d/init-haskell.el b/.emacs.d/init-haskell.el index abc2aa40..8e4d696c 100644 --- a/.emacs.d/init-haskell.el +++ b/.emacs.d/init-haskell.el @@ -38,6 +38,9 @@ (add-hook 'haskell-mode-hook 'spw/haskell-mode-hook) (add-hook 'after-save-hook 'spw/haskell-cabal-mode-save-hook) + ;; Set path to ghci on Windows + (setq haskell-process-path-ghci "C:\\Program Files\\Haskell Platform\\2014.2.0.0\\bin\\ghci") + (setq haskell-tags-on-save t haskell-process-suggest-remove-import-lines t)) -- cgit v1.2.3 From 723d4cbe6957d3ada5605efec2e5cbff4c2ff48a Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 6 Feb 2015 09:13:42 +0900 Subject: slimmed down bashrc for use on Windows with Git Bash --- .bashrc | 58 +--------------------------------------------------------- 1 file changed, 1 insertion(+), 57 deletions(-) diff --git a/.bashrc b/.bashrc index 445cc5d5..38b390bc 100644 --- a/.bashrc +++ b/.bashrc @@ -1,62 +1,6 @@ # --- preferences -# load standard environment variables -. $HOME/.shenv - -# don't put duplicate lines in the history. See bash(1) for more options -export HISTCONTROL=ignoredups -# ... and ignore same sucessive entries. -export HISTCONTROL=ignoreboth - -# make less more friendly for non-text input files, see lesspipe(1) -[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)" - -# if this is an xterm set the title to user@host:dir -case "$TERM" in - xterm*|rxvt*) - PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"' - ;; - *) - ;; -esac - -# enable power-completion (shouldn't be necessary) -if [ -f /etc/bash_completion ]; then - . /etc/bash_completion -fi - -shopt -s globstar - -# --- colours originally from gentoo's default bashrc - -use_color=false -safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM -match_lhs="" -[[ -f ~/.dir_colors ]] && match_lhs="${match_lhs}$(<~/.dir_colors)" -[[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(/dev/null \ - && match_lhs=$(dircolors --print-database) -[[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true - -if ${use_color} ; then - # Enable colors for ls, etc. Prefer ~/.dir_colors #64489 - if type -P dircolors >/dev/null ; then - if [[ -f ~/.dir_colors ]] ; then - eval $(dircolors -b ~/.dir_colors) - elif [[ -f /etc/DIR_COLORS ]] ; then - eval $(dircolors -b /etc/DIR_COLORS) - fi - fi - - PS1='\[\033[00;33m\]\h \[\033[00;32m\]\w \[\033[00;34m\]\$\[\033[00m\] ' - - alias ls='ls --color=auto' - alias grep='grep --colour=auto' -else - PS1='\h \w \$ ' -fi -unset use_color safe_term match_lhs +PS1='\[\033[00;33m\]\h \[\033[00;32m\]\w \[\033[00;34m\]\$\[\033[00m\] ' # --- aliases -- cgit v1.2.3 From 5ae151118651bbd1250436f7a541f7057705497f Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 16 Feb 2015 15:43:58 +0900 Subject: disable system bell on Windows --- .emacs.d/init.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 5e027579..1245ab74 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -29,6 +29,10 @@ ;;;; ---- basic settings ---- +;; no bell on Windows please + +(setq ring-bell-function 'ignore) + ;;; customisation -- must be loaded early so that zenburn theme is ;;; considered safe -- cgit v1.2.3 From 503018cd94b090d443dd09a81301a8855a5361b3 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 17 Feb 2015 11:10:29 +0900 Subject: combine two git push commands in pushing alias --- .emacs.d/eshell/alias | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.emacs.d/eshell/alias b/.emacs.d/eshell/alias index b6069edb..aad7330e 100644 --- a/.emacs.d/eshell/alias +++ b/.emacs.d/eshell/alias @@ -9,7 +9,7 @@ alias blank sleep 1;xset dpms force off alias docs cd ~/doc && mr sync alias annex-to-ma cd ~/lib/annex;ga copy -t metaarray --auto --fast alias git-rebase-win32-on-master git checkout win32;git rebase master -alias git-push-win32-master git push origin master;git push -f origin win32 +alias git-push-win32-master git push origin master +win32 alias git-dotfiles git-rebase-win32-on-master && git-push-win32-master alias git-stash-to-master git stash && git checkout master && git stash pop alias workgit cd ~/doc;git add org/*.org;git commit -a -e -m "work commit";git push -- cgit v1.2.3 From 8d6c3503ff50ac91647d6e9bdc95fff00cdeed21 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 23 Feb 2015 12:40:11 +0900 Subject: alias to run win32setup.bat in the way it must be run --- .bashrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.bashrc b/.bashrc index 38b390bc..8713f19b 100644 --- a/.bashrc +++ b/.bashrc @@ -9,3 +9,5 @@ alias ga='git annex' alias workgit='cd ~/doc && git add . && git commit -a -m "work commit" --edit && git push origin master && cd ~/src/dotfiles && git push origin master' alias mg=$EDITOR alias fmr='MR_FAST=true mr' + +alias win32setup='cd ~/bin && cmd "/c win32setup.bat"; cd -' -- cgit v1.2.3 From a1ebe76d7f097d7d0522ab522de7ef80feba5484 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 23 Feb 2015 12:40:51 +0900 Subject: add cabal bin to path on windows --- .bashrc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.bashrc b/.bashrc index 8713f19b..e356b731 100644 --- a/.bashrc +++ b/.bashrc @@ -2,6 +2,12 @@ PS1='\[\033[00;33m\]\h \[\033[00;32m\]\w \[\033[00;34m\]\$\[\033[00m\] ' +# --- additions to $PATH + +if [ -d "$APPDATA/cabal/bin" ]; then + export PATH="$APPDATA/cabal/bin:$PATH" +fi + # --- aliases alias g='git' -- cgit v1.2.3 From 81cc12227f0109afec16a2b4ac4471508d23e1dc Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Wed, 25 Feb 2015 08:49:03 +0900 Subject: fix cabal --user bin path on Windows --- .bashrc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.bashrc b/.bashrc index e356b731..501709c9 100644 --- a/.bashrc +++ b/.bashrc @@ -4,8 +4,14 @@ PS1='\[\033[00;33m\]\h \[\033[00;32m\]\w \[\033[00;34m\]\$\[\033[00m\] ' # --- additions to $PATH -if [ -d "$APPDATA/cabal/bin" ]; then - export PATH="$APPDATA/cabal/bin:$PATH" +# First make $APPDATA use the pathing conventions that the rest of +# $PATH appears to use: C: should be /c and forward- not +# backward-slashes. +CYG_APPDATA=$(echo $APPDATA | sed -e "s|C:|/c|;s/\\\\/\//g") + +# Now see if we should add the cabal --user binaries directory. +if [ -d "$CYG_APPDATA/cabal/bin" ]; then + export PATH="$CYG_APPDATA/cabal/bin:$PATH" fi # --- aliases -- cgit v1.2.3 From 46589bbd1211b30c3c1813ef158755e8414db879 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Wed, 4 Mar 2015 08:33:19 +0900 Subject: try to speed git up on Windows --- .gitconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitconfig b/.gitconfig index 8d6054fa..c5abbd7e 100644 --- a/.gitconfig +++ b/.gitconfig @@ -23,6 +23,10 @@ pager = excludesfile = ~/.globgitignore + # try to speed things up on Windows + preloadindex = true + fscache = true + # my personal repositories cloned via HTTP must be pushed via SSH [url "ssh://ma/~/local/git/"] pushInsteadOf = http://spw.sdf.org/git/ @@ -46,3 +50,6 @@ # push strategy [push] default = current +[gc] + # try to speed things up on Windows + auto = 256 -- cgit v1.2.3 From 65d9d23df7f7153c4c8214d72a38d9cb346b1efa Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Thu, 5 Mar 2015 09:18:36 +0900 Subject: fire up BassDrive at school from Emacs --- .emacs.d/init.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 1245ab74..dff8e16e 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1737,6 +1737,17 @@ Lightweight alternative to pandoc-mode." (buffer-file-name) "-o" output-file) (find-file output-file)))) +(defun spw/play-internet-radio (stream) + "Open an Internet radio stream STREAM in VLC." + (call-process "C:\\Program Files\\VideoLAN\\VLC\\vlc.exe" + nil 0 nil + "--qt-start-minimized" stream)) + +(defun spw/bassdrive () + "Start playing the Bassdrive.com Internet radio stream." + (interactive) + (spw/play-internet-radio "C:\\Users\\swhitton\\Music\\Streams\\BassDrive.asx")) + ;;;; ---- personal settings ---- @@ -1834,6 +1845,7 @@ BINDEE may be a command or another keymap, but whatever it is, it should not be (projectile-persp-switch-project "~/src/dotfiles") (find-file "~/src/dotfiles/.emacs.d/init.el") (eval-buffer))) + ("g R" . spw/bassdrive) ("g t l" . world-time-list) ("g t h" . helm-world-time) -- cgit v1.2.3 From 129568cce02dd4c96dc7e1b685819f6cf79d1bcc Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Thu, 19 Mar 2015 10:29:26 +0900 Subject: additional binding to helm start menu --- .emacs.d/init.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index dff8e16e..fc458a96 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -800,7 +800,8 @@ (use-package helm-w32-launcher :ensure - :bind ("C-c z" . helm-w32-launcher)) + :bind (("C-c z" . helm-w32-launcher) + ("M-" . helm-w32-launcher))) ;;; snippets -- cgit v1.2.3 From 35360437700d2406f766f463bd9c5c7f8aaf5dd1 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 6 Apr 2015 08:58:47 +0900 Subject: srem into $PATH on Windows Not such an elegant way of making it available. I hope to improve on my srem installation on both Windows and GNU/Linux. --- .bashrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.bashrc b/.bashrc index 501709c9..9729e2d2 100644 --- a/.bashrc +++ b/.bashrc @@ -14,6 +14,11 @@ if [ -d "$CYG_APPDATA/cabal/bin" ]; then export PATH="$CYG_APPDATA/cabal/bin:$PATH" fi +# And srem. +if [ -d "$HOME/src/srem/.cabal-sandbox/bin" ]; then + export PATH="$HOME/src/srem/.cabal-sandbox/bin:$PATH" +fi + # --- aliases alias g='git' -- cgit v1.2.3