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

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

[elpa] externals/hyperbole d1c349912b 37/47: Merge pull request #348 fro


From: ELPA Syncer
Subject: [elpa] externals/hyperbole d1c349912b 37/47: Merge pull request #348 from rswgnu/rsw_stefan-scratch-hyperbole-20230621-without-questions-no-fixme
Date: Sun, 25 Jun 2023 15:58:38 -0400 (EDT)

branch: externals/hyperbole
commit d1c349912b56b07fad849a3403e2efed70a57759
Merge: a06d9a4a8c 0872ab55c0
Author: Robert Weiner <rsw@gnu.org>
Commit: GitHub <noreply@github.com>

    Merge pull request #348 from 
rswgnu/rsw_stefan-scratch-hyperbole-20230621-without-questions-no-fixme
    
    RSW updates to stefan scratch hyperbole 20230621 without questions no fixme
---
 hactypes.el   |  4 ++--
 hload-path.el |  6 ++----
 hversion.el   | 35 ++++++++++++++++++++++++++++++++++-
 hyperbole.el  |  8 ++++----
 4 files changed, 42 insertions(+), 11 deletions(-)

diff --git a/hactypes.el b/hactypes.el
index 811f84d5d7..bd69cb4890 100644
--- a/hactypes.el
+++ b/hactypes.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    23-Sep-91 at 20:34:36
-;; Last-Mod:     24-Jun-23 at 09:44:22 by Mats Lidell
+;; Last-Mod:     25-Jun-23 at 09:52:16 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -717,7 +717,7 @@ Optional SECTIONS-START limits toc entries to those after 
that point."
       (insert "Sections of " rfc-buf-name ":\n")
       (set-buffer-modified-p nil))
     (when opoint
-      (set-buffer buf-name)
+      (select-buffer buf-name)
       (goto-char opoint))))
 
 (defact text-toc (section)
diff --git a/hload-path.el b/hload-path.el
index 7265215016..34ad0f8115 100644
--- a/hload-path.el
+++ b/hload-path.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    29-Jun-16 at 14:39:33
-;; Last-Mod:     25-Jun-23 at 10:09:17 by Mats Lidell
+;; Last-Mod:     25-Jun-23 at 09:58:19 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -42,9 +42,7 @@ Use `hyperb:wsl-os-p' to test if running under WSL.")
 ;;; ************************************************************************
 
 (defvar hyperb:dir (or (file-name-directory
-                       (or (if (fboundp 'macroexp-file-name) ;Emacsā‰„28
-                               (macroexp-file-name)
-                             (and (stringp load-file-name) load-file-name))
+                       (or (and (stringp load-file-name) load-file-name)
                            (locate-file "hmouse-tag.el" load-path)
                            ""))
                       (error
diff --git a/hversion.el b/hversion.el
index cc0c53f304..60d3f73a06 100644
--- a/hversion.el
+++ b/hversion.el
@@ -4,7 +4,7 @@
 ;; Maintainer:   Bob Weiner, Mats Lidell
 ;;
 ;; Orig-Date:     1-Jan-94
-;; Last-Mod:     25-Jun-23 at 10:11:43 by Mats Lidell
+;; Last-Mod:     25-Jun-23 at 11:59:46 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -37,6 +37,12 @@
 Override this if the system-computed default is incorrect for
 your specific mouse.")
 
+(defvar hyperb:automount-prefixes
+  (if (and (boundp 'automount-dir-prefix) (stringp automount-dir-prefix))
+      automount-dir-prefix
+    "^/tmp_mnt/"
+    "Regexp to match any automounter prefix in a pathname."))
+
 ;;; ************************************************************************
 ;;; Public declarations
 ;;; ************************************************************************
@@ -46,6 +52,33 @@ your specific mouse.")
 ;;; Support functions
 ;;; ************************************************************************
 
+(defun hyperb:path-being-loaded ()
+  "Return the full pathname used by the innermost `load' or `require' call.
+Removes any matches for `hyperb:automount-prefixes' before returning
+the pathname."
+  (let* ((frame (hyperb:stack-frame '(load require)))
+        (function (nth 1 frame))
+        file nosuffix)
+    (cond ((eq function 'load)
+          (setq file (nth 2 frame)
+                nosuffix (nth 5 frame)))
+         ((eq function 'require)
+          (setq file (or (nth 3 frame) (symbol-name (nth 2 frame))))))
+    (when (stringp file)
+      (setq nosuffix (or nosuffix
+                        (string-match
+                         "\\.\\(elc?\\|elc?\\.gz\\|elc?\\.Z\\)$"
+                         file))
+           file (substitute-in-file-name file)
+           file (locate-file file load-path
+                             (when (null nosuffix) '(".elc" ".el" ".el.gz" 
".el.Z"))
+                             ;; accept any existing file
+                             nil)
+           file (if (and (stringp file)
+                         (string-match hyperb:automount-prefixes file))
+                    (substring file (1- (match-end 0)))
+                  file)))))
+
 ;; Called in hyperbole.el.
 (defun hyperb:stack-frame (function-list &optional debug-flag)
   "Return the nearest Elisp stack frame that called a function from 
FUNCTION-LIST.
diff --git a/hyperbole.el b/hyperbole.el
index 47f03754de..fb1afed7b7 100644
--- a/hyperbole.el
+++ b/hyperbole.el
@@ -7,7 +7,7 @@
 ;; Author:           Bob Weiner
 ;; Maintainer:       Bob Weiner <rsw@gnu.org>, Mats Lidell <matsl@gnu.org>
 ;; Created:          06-Oct-92 at 11:52:51
-;; Last-mod:     25-Jun-23 at 10:12:04 by Mats Lidell
+;; Last-mod:     25-Jun-23 at 12:01:04 by Bob Weiner
 ;; Released:         03-Dec-22
 ;; Version:          8.0.1pre
 ;; Keywords:         comm, convenience, files, frames, hypermedia, languages, 
mail, matching, mouse, multimedia, outlines, tools, wp
@@ -113,9 +113,9 @@
     (setq features (delq 'hload-path features)
          features (delq 'hversion features)))
 
-  ;; Defines hyperb:stack-frame, (hyperb:window-system), and hyperb:dir,
-  ;; which are used later in this file.
-  ;; Also adds Hyperbole to the load-path if need be.
+  ;; Defines hyperb:path-being-loaded, hyperb:stack-frame,
+  ;; (hyperb:window-system) and hyperb:dir, which are used later in
+  ;; this file.  Also adds Hyperbole to the load-path if need be.
   ;;
   ;; This handles the case when the Hyperbole package directory is not yet in 
load-path.
   (unless (or (require 'hversion nil t)



reply via email to

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