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

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

[elpa] externals/hyperbole b21c5fabe4 2/3: Fix org-id logic; inhibit org


From: ELPA Syncer
Subject: [elpa] externals/hyperbole b21c5fabe4 2/3: Fix org-id logic; inhibit org-id-find msgs; fix py traceback matches
Date: Wed, 8 Mar 2023 12:57:59 -0500 (EST)

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

    Fix org-id logic; inhibit org-id-find msgs; fix py traceback matches
---
 ChangeLog   |  6 ++++++
 hibtypes.el | 30 +++++++++++++++++-------------
 hyrolo.el   | 40 ++++++++++++++++++++--------------------
 3 files changed, 43 insertions(+), 33 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0d394dae33..778119d220 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2023-03-07  Bob Weiner  <rsw@gnu.org>
 
+* hibtypes.el (org-id, org-id:help): Fix logic and inhibit-messages from
+    org-id-find calls.
+
+* hibtypes.el (hib-python-traceback): Tighten matches by requiring final
+    file char to not be a whitespace char.
+
 * hpath.el (hpath:find, hpath:call): If 'path' exists, don't treat
     its # hash marks as section markers, notably for #autosave# files.
            (hpath:delimited-possible-path): Allow for unquoted filenames
diff --git a/hibtypes.el b/hibtypes.el
index 7bdcdc59ff..82cc205242 100644
--- a/hibtypes.el
+++ b/hibtypes.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    19-Sep-91 at 20:45:31
-;; Last-Mod:      6-Mar-23 at 00:30:09 by Bob Weiner
+;; Last-Mod:      7-Mar-23 at 23:13:44 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -143,14 +143,16 @@ If the id location is found, return non-nil."
     (let ((id (thing-at-point 'symbol t)) ;; Could be a uuid or some other 
form of id
          m)
       ;; Ignore ID definitions or when not on a possible ID
-      (when (and id (setq m (or (and (featurep 'org-roam) (org-roam-id-find id 
'marker))
-                               (org-id-find id 'marker))))
-       (cond ((save-excursion (beginning-of-line)
+      (if (and (not assist-flag)
+              (save-excursion (beginning-of-line)
                               (re-search-forward ":\\(CUSTOM_\\)?ID:[ \t]+"
-                                                 (line-end-position) t))
-              (message "On ID definition; use {C-u M-RET} to copy a link to 
ID."))
-             (m
-              (hact 'org-id-marker-display m)))))))
+                                                 (line-end-position) t)))
+         (hact #'message "On ID definition; use {C-u M-RET} to copy a link to 
an ID.")
+       (when (and id
+                  (let ((inhibit-message)) ;; Inhibit org-id-find status msgs
+                    (setq m (or (and (featurep 'org-roam) (org-roam-id-find id 
'marker))
+                                (org-id-find id 'marker)))))
+         (hact #'org-id-marker-display m))))))
 
 (defun org-id:help (hbut)
   "Copy link to kill ring of an Org roam or Org node referenced by id at point.
@@ -161,15 +163,17 @@ If the id location is found, return non-nil."
          m
          mpos)
       ;; Ignore ID definitions or when not on a possible ID
-      (when (and id (setq m (or (and (featurep 'org-roam) (org-roam-id-find id 
'marker))
-                               (org-id-find id 'marker))))
+      (when (and id
+                (let ((inhibit-message)) ;; Inhibit org-id-find status msgs
+                  (setq m (or (and (featurep 'org-roam) (org-roam-id-find id 
'marker))
+                              (org-id-find id 'marker)))))
        (save-excursion
          (setq mpos (marker-position m))
          (set-buffer (marker-buffer m))
          (save-restriction
            (widen)
            (goto-char mpos)
-           (kill-new (org-id-store-link))))))))
+           (kill-new (message (org-id-store-link)))))))))
 
 ;;; ========================================================================
 ;;; Displays files and directories when a valid pathname is activated.
@@ -1031,8 +1035,8 @@ in grep and shell buffers."
 
 (defun hib-python-traceback ()
 "Test for and jump to line referenced in Python pdb, traceback, or pytype 
error."
-  (when (or (looking-at "\\(^\\|.+ \\)File \"\\([^\"\n\r]+\\)\", line 
\\([0-9]+\\)")
-            (looking-at ">?\\(\\s-+\\)\\([^\"()\n\r]+\\)(\\([0-9]+\\))\\S-"))
+  (when (or (looking-at "\\(^\\|.+ \\)File \"\\([^\"\t\f\n\r]+\\S-\\)\", line 
\\([0-9]+\\)")
+            (looking-at 
">?\\(\\s-+\\)\\([^\"()\t\f\n\r]+\\S-\\)(\\([0-9]+\\))\\S-"))
     (let* ((file (match-string-no-properties 2))
            (line-num (match-string-no-properties 3))
            (but-label (concat file ":" line-num)))
diff --git a/hyrolo.el b/hyrolo.el
index 75b8621113..58d07e039c 100644
--- a/hyrolo.el
+++ b/hyrolo.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:     7-Jun-89 at 22:08:29
-;; Last-Mod:     27-Feb-23 at 00:11:31 by Bob Weiner
+;; Last-Mod:      8-Mar-23 at 01:15:53 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -1448,25 +1448,25 @@ Return number of matching entries found."
                  (setq curr-entry-level-len (length 
(buffer-substring-no-properties start (point))))
                  (hyrolo-to-entry-end t curr-entry-level-len)
                  (or count-only
-                     (if (and (zerop num-found) incl-hdr)
-                         (let* ((src (or (buffer-file-name actual-buf)
-                                         actual-buf))
-                                (src-line
-                                 (format
-                                  (concat (if (boundp 'hbut:source-prefix)
-                                              hbut:source-prefix
-                                            "@loc> ")
-                                          "%s")
-                                  (prin1-to-string src))))
-                           (set-buffer hyrolo-display-buffer)
-                           (goto-char (point-max))
-                           (if hdr-pos
-                               (progn
-                                 (insert-buffer-substring-no-properties
-                                  actual-buf (car hdr-pos) (cdr hdr-pos))
-                                 (insert src-line "\n\n"))
-                             (insert (format hyrolo-hdr-format src-line)))
-                           (set-buffer actual-buf))))
+                     (when (and (zerop num-found) incl-hdr)
+                       (let* ((src (or (buffer-file-name actual-buf)
+                                       actual-buf))
+                              (src-line
+                               (format
+                                (concat (if (boundp 'hbut:source-prefix)
+                                            hbut:source-prefix
+                                          "@loc> ")
+                                        "%s")
+                                (prin1-to-string src))))
+                         (set-buffer hyrolo-display-buffer)
+                         (goto-char (point-max))
+                         (if hdr-pos
+                             (progn
+                               (insert-buffer-substring-no-properties
+                                actual-buf (car hdr-pos) (cdr hdr-pos))
+                               (insert src-line "\n\n"))
+                           (insert (format hyrolo-hdr-format src-line)))
+                         (set-buffer actual-buf))))
                  (setq num-found (1+ num-found))
                  (or count-only
                      (hyrolo-add-match hyrolo-display-buffer pattern start 
(point)))))))



reply via email to

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