[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole b53bfbe 6/6: hactypes.el - Fix Windows-compat
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hyperbole b53bfbe 6/6: hactypes.el - Fix Windows-compatibility when executing shell actions |
Date: |
Wed, 21 Apr 2021 00:57:09 -0400 (EDT) |
branch: externals/hyperbole
commit b53bfbe7be5b9699979281cc2e34faf38251c4ca
Author: Bob Weiner <rsw@gnu.org>
Commit: Bob Weiner <rsw@gnu.org>
hactypes.el - Fix Windows-compatibility when executing shell actions
---
Changes | 7 +++++++
hactypes.el | 29 +++++++++++++++--------------
2 files changed, 22 insertions(+), 14 deletions(-)
diff --git a/Changes b/Changes
index e09f292..11b9b4c 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,10 @@
+2021-04-21 Bob Weiner <rsw@gnu.org>
+
+* hactypes.el (exec-shell-cmd, exec-window-cmd): Couple 'cd' and command
+ with '&&' rather than semicolon. Also, expand default-directory to
+ eliminate '~' home dir refs. Both of these for better Windows
+ compatibility.
+
2021-04-20 Bob Weiner <rsw@gnu.org>
* Makefile (tests, all-tests): Add these target aliases.
diff --git a/hactypes.el b/hactypes.el
index 7fa53c3..1851b1c 100644
--- a/hactypes.el
+++ b/hactypes.el
@@ -102,8 +102,7 @@ error."
(and (integerp repeat) (>= repeat 0))))
1))
(list macro repeat)))
- (if (called-interactively-p 'interactive)
- nil
+ (unless (called-interactively-p 'interactive)
(or (and kbd-macro (or (stringp kbd-macro)
(and (symbolp kbd-macro) (fboundp kbd-macro))))
(hypb:error "(exec-kbd-macro): Bad macro: %s" kbd-macro))
@@ -130,18 +129,19 @@ kill the last output to the shell buffer before executing
SHELL-CMD."
default2)))))
(require 'comint)
(let ((buf-name "*Hyperbole Shell*")
- (obuf (current-buffer)))
+ (obuf (current-buffer))
+ (default-dir (expand-file-name default-directory)))
(unwind-protect
(progn
- (if (not (hpath:remote-p default-directory))
- (setq shell-cmd
- (concat "cd " default-directory "; " shell-cmd)))
+ (unless (hpath:remote-p default-dir)
+ (setq shell-cmd
+ (concat "cd " default-dir " && " shell-cmd)))
(if (and (get-buffer buf-name)
(get-buffer-process (get-buffer buf-name)))
(hpath:display-buffer buf-name)
;; (hpath:display-buffer (current-buffer))
- (if (eq (minibuffer-window) (selected-window))
- (other-window 1))
+ (when (eq (minibuffer-window) (selected-window))
+ (other-window 1))
;; 'shell' calls pop-to-buffer which normally displays in
;; another window
(setq buf-name (buffer-name (shell buf-name))))
@@ -169,12 +169,13 @@ kill the last output to the shell buffer before executing
SHELL-CMD."
(lambda (cmd) (not (string-equal cmd "")))
default "Enter a shell command." 'string))))
(require 'comint)
- (let ((buf-name "*Hyperbole Shell*")
- (cmd (if (hpath:remote-p default-directory)
- (concat "(" shell-cmd ") &")
- (concat "(cd " default-directory "; " shell-cmd ") &")))
- (msg (format "Executing: %s" shell-cmd))
- (shell-buf))
+ (let* ((buf-name "*Hyperbole Shell*")
+ (default-dir (expand-file-name default-directory))
+ (cmd (if (hpath:remote-p default-dir)
+ (concat "(" shell-cmd ") &")
+ (concat "(cd " default-dir " && " shell-cmd ") &")))
+ (msg (format "Executing: %s" shell-cmd))
+ (shell-buf))
(message msg)
(save-excursion
(save-window-excursion
- [elpa] externals/hyperbole updated (f55679b -> b53bfbe), ELPA Syncer, 2021/04/21
- [elpa] externals/hyperbole 6e40862 2/6: +* kotl-autoloads.el: Remove reference to unreleased kexport-menu.el, ELPA Syncer, 2021/04/21
- [elpa] externals/hyperbole 6d08d5e 3/6: Add tests and all-tests testing target aliases, ELPA Syncer, 2021/04/21
- [elpa] externals/hyperbole 798d0e8 1/6: Add path prefix tests (#71), ELPA Syncer, 2021/04/21
- [elpa] externals/hyperbole e0eaa85 4/6: Make smart-magit-mode trigger ahead of hbuts for consistency, ELPA Syncer, 2021/04/21
- [elpa] externals/hyperbole ce82b18 5/6: Fix bug#47909: Update regexes and hyrolo-grep calls so doc-ids work, ELPA Syncer, 2021/04/21
- [elpa] externals/hyperbole b53bfbe 6/6: hactypes.el - Fix Windows-compatibility when executing shell actions,
ELPA Syncer <=