-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathrun-command-util.el
40 lines (27 loc) · 1.26 KB
/
run-command-util.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
;;; run-command-util.el --- run-command utils -*- lexical-binding: t -*-
;; Copyright (C) 2020-2023 Massimiliano Mirra
;; Author: Massimiliano Mirra <hyperstruct@gmail.com>
;; URL: https://github.com/bard/emacs-run-command
;; This file is not part of GNU Emacs
;; This file 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 program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; For a full copy of the GNU General Public License
;; see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; Utilities for `run-command'.
;;; Code:
(defun run-command-util-shorter-recipe-name-maybe (command-recipe)
"Shorten COMMAND-RECIPE name when it begins with conventional prefix."
(let ((recipe-name (symbol-name command-recipe)))
(if (string-match "^run-command-recipe-\\(.+\\)$" recipe-name)
(match-string 1 recipe-name)
recipe-name)))
;;;; Meta
(provide 'run-command-util)
;;; run-command-util.el ends here