Skip to content

Instantly share code, notes, and snippets.

View jordonbiondo's full-sized avatar
🤖
bzzzzzt

Jordon Biondo jordonbiondo

🤖
bzzzzzt
View GitHub Profile
(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)))
@jordonbiondo
jordonbiondo / my-prompt.el
Last active December 23, 2022 15:01
Custom eshell prompt
(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))
@jordonbiondo
jordonbiondo / show-me-used-faces.el
Last active November 24, 2021 21:37
show-me-all-used-faces
;; 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.
;;
;; 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))
;; 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)))))))
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 || "");
/**
* 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)) {
;;; 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
@jordonbiondo
jordonbiondo / *scratch*.el
Created April 28, 2014 20:12
auto refresh git-gutter when staging and unstaging in magit
(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)
(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))