This file contains hidden or 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
| (save-excursion | |
| (back-to-indentation) | |
| (let* ((syntax (syntax-ppss (point)))) | |
| (unless (io-in-string-p (line-beginning-position)) | |
| (delete-region (point) (line-beginning-position)) | |
| (insert-tab (- (length (remove-duplicates (mapcar 'line-number-at-pos (tenth syntax)))) | |
| (if (save-excursion (> (first syntax) (first (syntax-ppss (1+ (point)))))) 1 0)))))) | |
| (when (> (save-excursion (back-to-indentation) (point)) (point)) | |
| (back-to-indentation))) |
This file contains hidden or 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
| (defvar my-eshell-command-count 0 | |
| "Variable to keep track of command count") | |
| ;; very important if you have multiple eshell buffers open | |
| (make-variable-buffer-local 'my-eshell-command-count) | |
| (defun my-increment-eshell-command-count () | |
| "Increments the eshell command count var." | |
| (incf my-eshell-command-count)) |
This file contains hidden or 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
| ;; Description: Emacs functions to display a list of all faces currently used in open buffers | |
| ;; Author: Jordon Biondo | |
| ;; | |
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
| ;; | |
| ;; This program 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 3, or | |
| ;; (at your option) any later version. | |
| ;; |
This file contains hidden or 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
| ;; emacs-lisp-lisp (ell) demmo | |
| (ell | |
| ;; define a global var mapcar that is the typical mapcar function | |
| (setq mapcar | |
| (lambda (fn data) | |
| (print 'hi) | |
| (if (null data) | |
| nil | |
| (cons (fn (car data)) |
This file contains hidden or 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
| ;; emacs-lisp-lisp (ell) demmo | |
| (ell | |
| (setq mapcar | |
| (lambda (fn data) | |
| (print 'hi) | |
| (if (null data) | |
| nil | |
| (cons (fn (car data)) | |
| (mapcar fn (cdr data))))))) |
This file contains hidden or 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
| interactive("manual_bookmark", | |
| "Create a bookmark.", | |
| function (I) { | |
| var uri_string = yield I.minibuffer.read( | |
| $prompt = "Bookmark URL:", | |
| $initial_value = I.buffer.display_uri_string || ""); | |
| var title = yield I.minibuffer.read( | |
| $prompt = "Bookmark with title:", | |
| $initial_value = I.buffer.title || ""); | |
This file contains hidden or 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
| /** | |
| * Read a command from the minibuffer fuzzily | |
| */ | |
| minibuffer.prototype.read_command_fuzzy = function () { | |
| keywords( | |
| arguments, | |
| $prompt = "Command", $history = "command", | |
| $completer = all_word_completer ( | |
| $completions = function (visitor) { | |
| for (let [k,v] in Iterator(interactive_commands)) { |
This file contains hidden or 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
| ;;; gel.el --- A collection of code golf macros and aliases for emacs lisp | |
| ;; | |
| ;; Filename: gel.el | |
| ;; Description: A collection of code golf macros and aliases for emacs lisp | |
| ;; Author: Jordon Biondo ([email protected]) | |
| ;; Created: Wed Mar 12 10:21:11 2014 (-0400) | |
| ;; Version: 0.0.1 | |
| ;; Package-Requires: () | |
| ;; Last-Updated: Wed Mar 12 10:22:12 2014 (-0400) | |
| ;; By: jordon |
This file contains hidden or 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
| (defvar my-magit-after-stage-hooks nil) | |
| (defvar my-magit-after-unstage-hooks nil) | |
| (defadvice magit-stage-item (after run-my-after-stage-hooks activate) | |
| (when (called-interactively-p 'interactive) | |
| (run-hooks 'my-magit-after-stage-hooks))) | |
| (defadvice magit-unstage-item (after run-my-after-unstage-hooks activate) | |
| (when (called-interactively-p 'interactive) |
This file contains hidden or 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
| (cl-defun my-custom-install (package &key then error) | |
| "Install PACKAGE if not installed and configure it. | |
| key :then specifies a function to run when package installs successfully or is already installed. | |
| key :error specifies a function to run when package installation fails | |
| this function recieves one argument, an error object." | |
| (declare (indent defun)) | |
| (condition-case err | |
| (progn (unless (package-installed-p package) | |
| (package-install package)) |