This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; -*- lexical-binding: t -*- | |
(require 'cl-lib) | |
(require 'dbus) | |
(cl-flet (( udisks-register-signal (&rest args) | |
(apply 'dbus-register-signal | |
:system "org.freedesktop.UDisks" | |
"/org/freedesktop/UDisks" | |
"org.freedesktop.UDisks" | |
args)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(set-language-environment "UTF-8") | |
(when (eq system-type 'windows-nt) | |
(setq default-file-name-coding-system 'cp1251)) | |
(defun es-emacs-path (&optional path) | |
(concat (expand-file-name user-emacs-directory) | |
path)) | |
(defun es-org-path (&optional path) | |
(concat (expand-file-name "~/org/") path)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun es-make-minibuffer-frame () | |
(interactive) | |
(let* (( last-recursion-depth ) | |
( frame (make-frame '((width . 60) | |
(height . 4) | |
(minibuffer . only) | |
(title . "Emacs-Minibuffer")))) | |
( enable-recursive-minibuffers t) | |
;; Runs when going down a level, or when entering a prompt. Not ideal | |
( minibuffer-exit-hook (list (lambda () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun es-xml-process-keywords (keywords) | |
(mapcar | |
(lambda (pair) | |
(let ( (keyword-name (car pair))) | |
(cons | |
(cond ( (stringp keyword-name) | |
(intern keyword-name)) | |
( (consp keyword-name) | |
(intern (cdr keyword-name))) | |
( t keyword-name)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defadvice flymake-post-syntax-check (before coffee-no-spaces activate) | |
"Warn about space indentation when in coffee-mode." | |
(when (eq major-mode 'coffee-mode) | |
(let (bad-spaces) | |
(save-excursion | |
(goto-char (point-min)) | |
(while (re-search-forward | |
"^[[:blank:]]*\\(?1: \\)[[:blank:]]*[^[:blank:]\n]" | |
nil t) | |
(let (( ppss (syntax-ppss (match-beginning 1)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; -*- lexical-binding: t -*- | |
(require 'cl-lib) | |
(defun es-scrape-web-listing | |
(start-url collect-function next-url-function done-function | |
&optional pages-limit silent) | |
"Retrieve a list of things from a multi-page web document. | |
START-URL is the location from which to start scraping. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun wc/narrow-window () | |
(let (( new-right | |
(max 0 (+ (or (cdr (window-margins)) 0) | |
(- (window-body-width) fill-column))))) | |
(set-window-margins nil (car (window-margins)) new-right) | |
(set-window-fringes nil (car (window-fringes)) 2))) | |
(define-minor-mode wrap-column-mode | |
"Wrap the text at `fill-column'. | |
Works by adjusting the right margin." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun es-patch (&optional patch-string custom-args) | |
(interactive | |
(list nil | |
current-prefix-arg | |
)) | |
(let (( patch-temp-file | |
(make-temp-file "patch")) | |
default-command | |
( \default-args | |
(concat "--no-backup-if-mismatch" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'emms-setup) | |
(require 'emms-queue) | |
(require 'emms-playlist-mode) | |
(require 'emms-playlist-sort) | |
(require 'server) | |
(require 'emms-cover) | |
(require 'emms-history) | |
(require 'emms-mark) | |
(require 'emms-mobile-remote) | |
(ignore-errors ; Causes a stupid error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'cl) | |
(defun es-kill-buffer-this-window () | |
(interactive) | |
(let* (( was-dedicated (window-dedicated-p)) | |
( buf (current-buffer)) | |
( kill-result | |
(if (or (get-buffer-process buf) (buffer-modified-p buf)) | |
(when (kill-buffer) | |
(when (and was-dedicated |
NewerOlder