Lint zle.el
- Prefer dash instead of forward-slash - Remove stale TODOs - Add Version, Package-Requires
This commit is contained in:
		
							parent
							
								
									fd804c7b6f
								
							
						
					
					
						commit
						7a2ca2b5c0
					
				
					 1 changed files with 15 additions and 14 deletions
				
			
		| 
						 | 
					@ -1,5 +1,8 @@
 | 
				
			||||||
;;; zle.el --- Functions to mimmick my ZLE KBDs -*- lexical-binding: t -*-
 | 
					;;; zle.el --- Functions to mimmick my ZLE KBDs -*- lexical-binding: t -*-
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;; Author: William Carroll <wpcarro@gmail.com>
 | 
					;; Author: William Carroll <wpcarro@gmail.com>
 | 
				
			||||||
 | 
					;; Version: 0.0.1
 | 
				
			||||||
 | 
					;; Package-Requires: ((emacs "24"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;;; Commentary:
 | 
					;;; Commentary:
 | 
				
			||||||
;; This is primarily for personal use.  The keybindings that I choose are those
 | 
					;; This is primarily for personal use.  The keybindings that I choose are those
 | 
				
			||||||
| 
						 | 
					@ -20,13 +23,11 @@
 | 
				
			||||||
;; Consider running `(zle-minor-mode)' to run this globally.  Depending on your
 | 
					;; Consider running `(zle-minor-mode)' to run this globally.  Depending on your
 | 
				
			||||||
;; configuration, it could be non-disruptive, disruptive, or extremely
 | 
					;; configuration, it could be non-disruptive, disruptive, or extremely
 | 
				
			||||||
;; disruptive.
 | 
					;; disruptive.
 | 
				
			||||||
;;
 | 
					 | 
				
			||||||
;; TODO: Consider adding (general-unbind 'insert "C-v") herein.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
;;; Code:
 | 
					;;; Code:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;; subshell (C-j)
 | 
					;; subshell (C-j)
 | 
				
			||||||
(defun zle/subshell ()
 | 
					(defun zle-subshell ()
 | 
				
			||||||
  "Insert the characters necessary to create a subshell."
 | 
					  "Insert the characters necessary to create a subshell."
 | 
				
			||||||
  (interactive)
 | 
					  (interactive)
 | 
				
			||||||
  (insert-char ?$)
 | 
					  (insert-char ?$)
 | 
				
			||||||
| 
						 | 
					@ -35,7 +36,7 @@
 | 
				
			||||||
    (insert-char ?\))))
 | 
					    (insert-char ?\))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;; variable (C-v)
 | 
					;; variable (C-v)
 | 
				
			||||||
(defun zle/variable ()
 | 
					(defun zle-variable ()
 | 
				
			||||||
  "Insert the characters to reference a variable."
 | 
					  "Insert the characters to reference a variable."
 | 
				
			||||||
  (interactive)
 | 
					  (interactive)
 | 
				
			||||||
  (insert-char ?$)
 | 
					  (insert-char ?$)
 | 
				
			||||||
| 
						 | 
					@ -44,7 +45,7 @@
 | 
				
			||||||
    (insert-char ?})))
 | 
					    (insert-char ?})))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;; 2x dash (C-M--)
 | 
					;; 2x dash (C-M--)
 | 
				
			||||||
(defun zle/dash-dash ()
 | 
					(defun zle-dash-dash ()
 | 
				
			||||||
  "Insert the characters for flags with 2x dashes."
 | 
					  "Insert the characters for flags with 2x dashes."
 | 
				
			||||||
  (interactive)
 | 
					  (interactive)
 | 
				
			||||||
  (insert-char ? )
 | 
					  (insert-char ? )
 | 
				
			||||||
| 
						 | 
					@ -52,7 +53,7 @@
 | 
				
			||||||
  (insert-char ?-))
 | 
					  (insert-char ?-))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;; 1x quotes (M-')
 | 
					;; 1x quotes (M-')
 | 
				
			||||||
(defun zle/single-quote ()
 | 
					(defun zle-single-quote ()
 | 
				
			||||||
  "Insert the characters to quickly create single quotes."
 | 
					  "Insert the characters to quickly create single quotes."
 | 
				
			||||||
  (interactive)
 | 
					  (interactive)
 | 
				
			||||||
  (insert-char ? )
 | 
					  (insert-char ? )
 | 
				
			||||||
| 
						 | 
					@ -61,7 +62,7 @@
 | 
				
			||||||
    (insert-char ?')))
 | 
					    (insert-char ?')))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;; 2x quotes (M-")
 | 
					;; 2x quotes (M-")
 | 
				
			||||||
(defun zle/double-quote ()
 | 
					(defun zle-double-quote ()
 | 
				
			||||||
  "Insert the characters to quickly create double quotes."
 | 
					  "Insert the characters to quickly create double quotes."
 | 
				
			||||||
  (interactive)
 | 
					  (interactive)
 | 
				
			||||||
  (insert-char ? )
 | 
					  (insert-char ? )
 | 
				
			||||||
| 
						 | 
					@ -69,14 +70,14 @@
 | 
				
			||||||
  (save-excursion
 | 
					  (save-excursion
 | 
				
			||||||
    (insert-char ?\")))
 | 
					    (insert-char ?\")))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(defvar zle/kbds
 | 
					(defvar zle-kbds
 | 
				
			||||||
  (let ((map (make-sparse-keymap)))
 | 
					  (let ((map (make-sparse-keymap)))
 | 
				
			||||||
    (bind-keys :map map
 | 
					    (bind-keys :map map
 | 
				
			||||||
               ("C-j"   . zle/subshell)
 | 
					               ("C-j"   . zle-subshell)
 | 
				
			||||||
               ("C-v"   . zle/variable)
 | 
					               ("C-v"   . zle-variable)
 | 
				
			||||||
               ("C-M--" . zle/dash-dash)
 | 
					               ("C-M--" . zle-dash-dash)
 | 
				
			||||||
               ("M-'"   . zle/single-quote)
 | 
					               ("M-'"   . zle-single-quote)
 | 
				
			||||||
               ("M-\""  . zle/double-quote))
 | 
					               ("M-\""  . zle-double-quote))
 | 
				
			||||||
    map)
 | 
					    map)
 | 
				
			||||||
  "Keybindings shaving milliseconds off of typing.")
 | 
					  "Keybindings shaving milliseconds off of typing.")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -84,7 +85,7 @@
 | 
				
			||||||
  "A minor mode mirroring my ZLE keybindings."
 | 
					  "A minor mode mirroring my ZLE keybindings."
 | 
				
			||||||
  :init-value nil
 | 
					  :init-value nil
 | 
				
			||||||
  :lighter " zle"
 | 
					  :lighter " zle"
 | 
				
			||||||
  :keymap zle/kbds)
 | 
					  :keymap zle-kbds)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(provide 'zle)
 | 
					(provide 'zle)
 | 
				
			||||||
;;; zle.el ends here
 | 
					;;; zle.el ends here
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue