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
;; Define a "defun" Emacs Evil text object | |
(defun jpl-line-before-end-of-defun (&optional arg) | |
(interactive) | |
(end-of-defun arg) | |
(previous-line)) | |
(defun jpl-line-after-beginning-of-defun (&optional arg) | |
(interactive) | |
(beginning-of-defun arg) | |
(next-line)) |
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
# Demo http://ascii.io/a/3019 | |
# build | |
gdbb () { | |
# build with debug flags | |
go build -gcflags "-N -l" -o out | |
# make sure the build didn't fail | |
if [ $? != 0 ]; then return; fi |
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
function simulateDragDrop(sourceNode, destinationNode) { | |
var EVENT_TYPES = { | |
DRAG_END: 'dragend', | |
DRAG_START: 'dragstart', | |
DROP: 'drop' | |
} | |
function createCustomEvent(type) { | |
var event = new CustomEvent("CustomEvent") | |
event.initCustomEvent(type, true, true, null) |
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
diff --git a/src/lread.c b/src/lread.c | |
index e1a4b33..4f17e39 100644 | |
--- a/src/lread.c | |
+++ b/src/lread.c | |
@@ -467,7 +467,7 @@ readbyte_from_file (int c, Lisp_Object readcharfun) | |
} | |
block_input (); | |
- c = getc (instream); | |
+ c = getc_unlocked (instream); |
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 giraffe () | |
"Passes a the active region (highlighted text in non-emacs | |
speak) to an external command that produces an SVG graph of the | |
data, which is then placed in a buffer called *giraffe* and | |
viewed as an image." | |
;; Declare that this is an interactive command. Whenever a function | |
;; starts this way emacs will make it available to be called with | |
;; M-x or bound to a key. | |
(interactive) |
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
(defhydra js2-refactor-hydra (:color blue :hint nil) | |
" | |
^Functions^ ^Variables^ ^Buffer^ ^sexp^ ^Debugging^ | |
------------------------------------------------------------------------------------------------------------------------------ | |
[_lp_] Localize Parameter [_ev_] Extract variable [_wi_] Wrap buffer in IIFE [_k_] js2 kill [_lt_] log this | |
[_ef_] Extract function [_iv_] Inline variable [_ig_] Inject global in IIFE [_ss_] split string [_dt_] debug this | |
[_ip_] Introduce parameter [_rv_] Rename variable [_ee_] Expand node at point [_sl_] forward slurp | |
[_em_] Extract method [_vt_] Var to this [_cc_] Contract node at point [_ba_] forward barf | |
[_ao_] Arguments to object [_sv_] Split var decl. [_uw_] unwrap | |
[_tf_] Toggle fun exp and decl [_ag_] Add var to globals |
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
;; Read the inserted word out loud using the macOS speech synthesizer | |
;; when a misspelled word is corrected using the flyspell | |
;; `flyspell-auto-correct-word'-command. | |
;; | |
;; Note this only work on macOS. It should be fairly easy to change to | |
;; work with other command line interface speech synthesize systems. | |
;; | |
;; In a previous version this used to be a defadvice, but I've changed | |
;; it to implementing a custom flyspell insert function. This seems to | |
;; work a bit more reliably. |
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
;; A minimum .emacs to test Emacs plugins | |
(show-paren-mode 1) | |
(eval-when-compile (require 'cl)) | |
;; test elisps download from internet here | |
(setq test-elisp-dir "~/test-elisp/") | |
(unless (file-exists-p (expand-file-name test-elisp-dir)) | |
(make-directory (expand-file-name test-elisp-dir))) | |
(setq load-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 narrow-or-widen-dwim (p) | |
;; fixed to behave correctly in org-src buffers; taken from: | |
;; https://lists.gnu.org/archive/html/emacs-orgmode/2019-09/msg00094.html | |
"Widen if buffer is narrowed, narrow-dwim otherwise. | |
Dwim means: region, org-src-block, org-fixed-width-region, | |
org-table-field, org-subtree, or defun, whichever applies | |
first. Narrowing to: | |
- org-src-block calls `org-edit-src-code' |
OlderNewer