;;; ymh-common.el --- Some common functions -*- lexical-binding: t; -*- ;; Author: Yann Herklotz ;; Package-Requires: ((emacs "24.3")) ;;; Commentary: ;; This file contains some common code. ;;; Code: (defun ymh/prev-window () "Go to the previous window using `other-window'." (interactive) (other-window -1)) (defun ymh/reset-coq-windows () "Resets the Goal and Response windows." (interactive) (other-frame 1) (delete-other-windows) (split-window-below) (switch-to-buffer "*goals*") (other-window 1) (switch-to-buffer "*response*") (other-frame 1)) (defun ymh/pass (query) "Return the password as a string from QUERY." (s-trim (shell-command-to-string (concat "pass show " query)))) (defun ymh/apply-theme (appearance) "Load theme, taking current system APPEARANCE into consideration." (mapc #'disable-theme custom-enabled-themes) (pcase appearance ('light (load-theme 'modus-operandi-tinted t)) ('dark (load-theme 'modus-vivendi-tinted t)) ;;('light (load-theme 'ef-spring t)) ;;('dark (load-theme 'ef-dark t)) )) (defadvice load-theme (before theme-dont-propagate activate) (mapc #'disable-theme custom-enabled-themes)) (defun ymh/electric-space () (interactive) (if (looking-back (sentence-end)) (insert "%\n") (self-insert-command 1))) (provide 'ymh-common) ;;; ymh-common.el ends here