[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/shell-command+ 5e3def9 04/36: Fixed packaging issues an
From: |
Stefan Monnier |
Subject: |
[elpa] externals/shell-command+ 5e3def9 04/36: Fixed packaging issues and mistakes |
Date: |
Fri, 25 Sep 2020 11:01:22 -0400 (EDT) |
branch: externals/shell-command+
commit 5e3def90d56a2418767d052026f042d3220d206e
Author: Philip K <philip@warpmail.net>
Commit: Philip K <philip@warpmail.net>
Fixed packaging issues and mistakes
---
bang.el | 46 +++++++++++++++++++++++++++++++++++++++-------
1 file changed, 39 insertions(+), 7 deletions(-)
diff --git a/bang.el b/bang.el
index 2c29a76..068fed9 100644
--- a/bang.el
+++ b/bang.el
@@ -1,11 +1,37 @@
-;;; -*- lexical-binding: t -*-
-;;; published under CC0 into the public domain
-;;; author: philip k. [https://zge.us.to], 2019
-;;;
-;;; based on bang from http://chneukirchen.org/dotfiles/.emacs
+;;; bang.el --- a more inteligent shell-command -*- lexical-binding: t -*-
+
+;; Author: Philip K. <philip@warpmail.net>
+;; Version: 0.1.0
+;; Keywords: unix, processes, convenience
+;; Package-Requires: ((emacs "24.1") (cl-lib "0.5"))
+;; URL: https://git.sr.ht/~zge/bang
+
+;; This file is NOT part of Emacs.
+;;
+;; This file is in the public domain, to the extent possible under law,
+;; published under the CC0 1.0 Universal license.
+;;
+;; For a full copy of the CC0 license see
+;; https://creativecommons.org/publicdomain/zero/1.0/legalcode
+
+;;; Commentary:
+;;
+;; Bang is a interactive `shell-command' substitute, that extends the
+;; regular Emacs function by considering the first character as special.
+;; Read `bang's docstring for more details.
+;;
+;; This version of Bang has been based on Leah Neukirchen's version, and
+;; has been (messily) extended to handle history commands (!32 for the
+;; 32'nd last command, !xterm for the last command starting with xterm).
+;; Most of the internal code of `bang' has been rewritten for this sake.
+;;
+;; The original version can be found here:
+;; http://leahneukirchen.org/dotfiles/.emacs
(require 'rx)
+;;; Code:
+
(defconst bang--command-regexp
(rx bos (* space)
(or (seq (group "!" )
@@ -26,6 +52,7 @@
"Number of commands to save in `bang--last-commands'.")
(defun bang--remember-command (command)
+ "Helper function to save COMMAND in bang's history."
(push command bang--last-commands)
(let ((overflow (- (length bang--last-commands)
bang-history-size)))
@@ -34,6 +61,7 @@
(nbutlast bang--last-commands overflow)))))
(defun bang--find-last-command (prefix)
+ "Helper function to find last command that started with PREFIX."
(catch 'found
(dolist (cmd bang--last-commands)
(when (string-prefix-p prefix cmd)
@@ -41,6 +69,9 @@
(error "no such command in history")))
(defun bang--get-command-number (arg rest)
+ "Helper function to find ARG'th last command.
+
+Second argument REST will be concatenated to what was found."
(let* ((num (string-to-number arg))
(pos (- (length bang--last-commands)
(1- num)))
@@ -63,8 +94,7 @@
(pop-to-buffer buf)))
(defun bang (command beg end)
- "Intelligently execute string COMMAND in inferior shell, like
-with `shell-command'.
+ "Intelligently execute string COMMAND in inferior shell.
When COMMAND starts with
< the output of COMMAND replaces the current selection
@@ -111,3 +141,5 @@ insert a literal % quote it using a backslash."
(bang--remember-command command)))))
(provide 'bang)
+
+;;; bang.el ends here
- [elpa] externals/shell-command+ 55f3e2a 16/36: emulated insert-into-buffer feature from shell-command, (continued)
- [elpa] externals/shell-command+ 55f3e2a 16/36: emulated insert-into-buffer feature from shell-command, Stefan Monnier, 2020/09/25
- [elpa] externals/shell-command+ f80c7c3 29/36: autoload bang command, Stefan Monnier, 2020/09/25
- [elpa] externals/shell-command+ 8758933 24/36: removed trailing whitespace, Stefan Monnier, 2020/09/25
- [elpa] externals/shell-command+ ab6bb0e 18/36: reworked `.' command, Stefan Monnier, 2020/09/25
- [elpa] externals/shell-command+ 87b5ad3 21/36: version bump, Stefan Monnier, 2020/09/25
- [elpa] externals/shell-command+ 339931d 36/36: rename bang to shell-command+, Stefan Monnier, 2020/09/25
- [elpa] externals/shell-command+ b5398d1 34/36: use eshell handler if available, Stefan Monnier, 2020/09/25
- [elpa] externals/shell-command+ 9b28c60 12/36: added melpa link, Stefan Monnier, 2020/09/25
- [elpa] externals/shell-command+ 49f3686 08/36: fixed package-lint issues, Stefan Monnier, 2020/09/25
- [elpa] externals/shell-command+ 5c01598 09/36: fixed minor checkdoc complaints, Stefan Monnier, 2020/09/25
- [elpa] externals/shell-command+ 5e3def9 04/36: Fixed packaging issues and mistakes,
Stefan Monnier <=
- [elpa] externals/shell-command+ 423c2af 15/36: updated README, Stefan Monnier, 2020/09/25
- [elpa] externals/shell-command+ 3fcab36 20/36: only execute real command, not bang modifiers, Stefan Monnier, 2020/09/25
- [elpa] externals/shell-command+ c395408 05/36: Re-added % substitution, Stefan Monnier, 2020/09/25
- [elpa] externals/shell-command+ 77989cf 26/36: renamed "Bang command" to "Shell command", Stefan Monnier, 2020/09/25
- [elpa] externals/shell-command+ d60c01f 22/36: required rx while compiling, Stefan Monnier, 2020/09/25
- [elpa] externals/shell-command+ 1fb0162 27/36: bumped version, Stefan Monnier, 2020/09/25
- [elpa] externals/shell-command+ 0e0c725 35/36: simplify if-expressions where applicable, Stefan Monnier, 2020/09/25
- [elpa] externals/shell-command+ e023383 33/36: bumped version, Stefan Monnier, 2020/09/25
- [elpa] externals/shell-command+ f9e92f4 31/36: added two spaces after each period, Stefan Monnier, 2020/09/25
- [elpa] externals/shell-command+ 51d6934 28/36: changed tag-line, Stefan Monnier, 2020/09/25