[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/shell-command+ ce7c9868ef 3/3: Do not expand % if a buf
From: |
ELPA Syncer |
Subject: |
[elpa] externals/shell-command+ ce7c9868ef 3/3: Do not expand % if a buffer has no file |
Date: |
Wed, 24 Aug 2022 17:57:56 -0400 (EDT) |
branch: externals/shell-command+
commit ce7c9868ef2d823dc4c5e5979545849b259e7660
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Do not expand % if a buffer has no file
---
shell-command+.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/shell-command+.el b/shell-command+.el
index 5a649b9eb0..fc84677d6b 100644
--- a/shell-command+.el
+++ b/shell-command+.el
@@ -177,10 +177,11 @@ For PARSE, FORM and CONTEXT see
`shell-command+-features'."
(defun shell-command+-expand-% (parse form context)
"Replace occurrences of \"%\" in the command.
For PARSE, FORM and CONTEXT see `shell-command+-features'."
- (setf (nth 3 parse)
- (replace-regexp-in-string
- (rx (* ?\\ ?\\) (or ?\\ (group "%")))
- buffer-file-name (nth 3 parse)))
+ (when buffer-file-name
+ (setf (nth 3 parse)
+ (replace-regexp-in-string
+ (rx (* ?\\ ?\\) (or ?\\ (group "%")))
+ buffer-file-name (nth 3 parse))))
(list parse form context))