emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/hyperbole 777bac2: Empty path bug fixes for debbugs and


From: ELPA Syncer
Subject: [elpa] externals/hyperbole 777bac2: Empty path bug fixes for debbugs and pathnames; git ref improvements
Date: Wed, 21 Apr 2021 21:57:11 -0400 (EDT)

branch: externals/hyperbole
commit 777bac230bda0472fda6d92f942622313994b77a
Author: Bob Weiner <rsw@gnu.org>
Commit: Bob Weiner <rsw@gnu.org>

    Empty path bug fixes for debbugs and pathnames; git ref improvements
---
 Changes        | 13 +++++++++++++
 hbut.el        |  2 +-
 hib-debbugs.el |  7 +++----
 hib-kbd.el     |  2 +-
 hib-social.el  |  8 +++++---
 hpath.el       |  9 ++++++---
 6 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/Changes b/Changes
index 11b9b4c..d30a1a3 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,18 @@
 2021-04-21  Bob Weiner  <rsw@gnu.org>
 
+* hib-social.el (hibtypes-social-hashtag-alist): Fix to use && for executing
+    git references under any OS as required by Windows.
+                (git-reference): Eliminate ~ that Windows shell can't handle
+    in shell paths.
+    (git-reference): Chop commit numbers in help buffer names to a max of 10 
chars
+    for brevity while maintaining uniqueness.
+
+* hib-debbugs.el (debbugs-query:at-p): Fix to allow : immediately after bug 
link.
+
+* hib-kbd.el (kbd-key:help): Allow for an empty string input.
+  hbut.el (hbut:key-to-label): Fix to return an empty label string when given 
an
+    empty string as input.  Can prevent a failure in hpath:call.
+
 * 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
diff --git a/hbut.el b/hbut.el
index 6c8d126..c30d84b 100644
--- a/hbut.el
+++ b/hbut.el
@@ -1046,7 +1046,7 @@ represent the output of particular document formatters."
 (defun    hbut:key-to-label (lbl-key)
   "Unnormalize LBL-KEY and return a label string for display."
   (if lbl-key
-      (let* ((pos 0) (len (length lbl-key)) (lbl) c)
+      (let* ((pos 0) (len (length lbl-key)) (lbl "") c)
        (while (< pos len)
          (setq c (aref lbl-key pos)
                lbl (concat lbl 
diff --git a/hib-debbugs.el b/hib-debbugs.el
index 99ce2b1..063b405 100644
--- a/hib-debbugs.el
+++ b/hib-debbugs.el
@@ -201,15 +201,14 @@ then (match-string 3) = \"?\" and (match-string 4) is the 
query
 attributes." 
   ;; Point must be before one of the bug#222 characters to match.
   (let ((case-fold-search t))
-    (if (string-match "[bugise#0-9]" (char-to-string (following-char)))
+    (when (string-match "[bugise#0-9]" (char-to-string (following-char)))
        (save-excursion
          (skip-chars-backward "#0-9")
          (skip-chars-backward " \t\n\r\f")
          (skip-chars-backward "bugdiseBUGDISE#") ;; bug, debbugs or issue
-         ;; Allow for bug#222?package=hyperbole&severity=high as well as
-         ;; bug222, or bug#222.
+         ;; Allow for bug#222?package=hyperbole&severity=high as well as 
bug222, or bug#222.
          (or (looking-at "[ \t\n\r\f]*\\(bug#?\\|debbugs#?\\|issue#?\\)[ 
\t\n\r\f]*#?\\([1-9][0-9]*\\)?\\(\\?\\)\\([a-z=&0-9%;()]+\\)")
-             (looking-at "[ \t\n\r\f]*\\(bug#?\\|debbugs#?\\|issue#?\\)[ 
\t\n\r\f]*#?\\([1-9][0-9]*\\)[\].,;?!\)\>\}]?\\([ \t\n\r\f]\\|\\'\\)")
+             (looking-at "[ \t\n\r\f]*\\(bug#?\\|debbugs#?\\|issue#?\\)[ 
\t\n\r\f]*#?\\([1-9][0-9]*\\)[\].,;?:!\)\>\}]?\\([ \t\n\r\f]\\|\\'\\)")
              ;; Ignore matches like  #222, so this is not confused with 
"hib-social.el" social references.
              ;; (looking-at "[ \t\n\r\f]*\\(bug\\|debbugs\\|issue\\)?[ 
\t\n\r\f]*#\\([1-9][0-9]*\\)[\].,;?!\)\>\}]?\\([ \t\n\r\f]\\|\\'\\)")
              )))))
diff --git a/hib-kbd.el b/hib-kbd.el
index 42eeda7..4cfba4c 100644
--- a/hib-kbd.el
+++ b/hib-kbd.el
@@ -195,7 +195,7 @@ With optional prefix arg FULL, display full documentation 
for command."
 (defun kbd-key:help (but)
   "Display documentation for binding of keyboard key given by BUT's label."
   (let ((kbd-key (hbut:key-to-label (hattr:get but 'lbl-key))))
-    (when kbd-key
+    (when (and kbd-key (not (string-empty-p kbd-key)))
       (kbd-key:doc kbd-key t))))
 
 (defun kbd-key:is-p (str)
diff --git a/hib-social.el b/hib-social.el
index 5a54ac1..15c8331 100644
--- a/hib-social.el
+++ b/hib-social.el
@@ -231,7 +231,7 @@
   '(("\\`\\(fb\\|facebook\\)\\'"  . "https://www.facebook.com/hashtag/%s";)
     ("\\`\\(gh\\|github\\)\\'"    . "https://github.com/%s/%s/%s%s";)
     ("\\`\\(gl\\|gitlab\\)\\'"    . "https://www.gitlab.com/%s/%s/%s%s";)
-    ("\\`\\(gt\\|git\\)\\'"       . "(cd %s; git %s %s)")
+    ("\\`\\(gt\\|git\\)\\'"       . "(cd %s && git %s %s)")
     ("\\`\\(in\\|instagram\\)\\'" . 
"https://www.instagram.com/explore/tags/%s/";)
     ("\\`\\(tw\\|twitter\\)\\'"   . 
"https://twitter.com/search?q=%%23%s&src=hashtag";)
 )
@@ -685,7 +685,7 @@ Return t if built, nil otherwise."
 ;;  1. If within a git repo directory, use that repo unless specified in path
 ;;  2. If project name is given or is default, see if assocated repo dir is in 
cache and use it.
 ;;  3. Prompt to rebuild locate db and then goto 2 if yes else quit
-;;  4. Run: (cd <dir-found>; git <cmd> <item>)
+;;  4. Run: (cd <dir-found> && git <cmd> <item>)
 ;;  5. Otherwise, do nothing.
 ;;
 ;; Don't make this a defact or its arguments may be improperly expanded as 
pathnames.
@@ -790,6 +790,8 @@ PROJECT value is provided, it defaults to the value of
                       (setq project-dir (and project 
(hibtypes-git-project-directory project)))
                     (error "(git-reference): No git directory found for 
project `%s'" project)))
                 (when (equal project-dir "") (setq project-dir nil))
+                ;; Eliminate ~ that Windows shell can't handle in shell paths
+                (when project-dir (setq project-dir (expand-file-name 
project-dir)))
                 (cond ((and project-dir (file-readable-p project-dir) 
(file-directory-p project-dir))
                        (if reference
                            (if (and (equal ref-type "commits") (fboundp 
'vc-print-root-log))
@@ -809,7 +811,7 @@ PROJECT value is provided, it defaults to the value of
                                                          (if (equal project 
"") "" " ")
                                                          project ref-type
                                                          (if (equal reference 
"") "" " ")
-                                                         reference)
+                                                         (substring reference 
nil (min 9 (length reference))))
                                  (princ (format "Command: %s\n\n" cmd))
                                  (princ (shell-command-to-string cmd)))))
                          ;; Project-only reference, run dired on the project 
home directory
diff --git a/hpath.el b/hpath.el
index 9aa4f82..1e81aaf 100644
--- a/hpath.el
+++ b/hpath.el
@@ -1099,9 +1099,12 @@ buffer but don't display it."
            anchor (match-string 3 path)
            path (if (match-end 1)
                     (substring path 0 (match-end 1))
-                  buffer-file-name)))
-    (setq path (hpath:expand path)
-         filename (hpath:absolute-to path default-directory))
+                  (or buffer-file-name ""))))
+    (if (string-empty-p path)
+       (setq path ""
+             filename "")
+      (setq path (hpath:expand path)
+           filename (hpath:absolute-to path default-directory)))
     (if noselect
        (let ((buf (find-file-noselect filename)))
          (with-current-buffer buf



reply via email to

[Prev in Thread] Current Thread [Next in Thread]