unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Cc: Robert Weiner <rsw@gnu.org>
Subject: Re: [elpa] externals/hyperbole 9faa8b69ae 1/3: Doc new Assist Mouse Key window drag ibut creation
Date: Wed, 24 May 2023 10:08:04 -0400	[thread overview]
Message-ID: <jwv4jo17rnb.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20230523155837.BAAE6C21A64@vcs2.savannah.gnu.org> (ELPA Syncer's message of "Tue, 23 May 2023 11:58:37 -0400 (EDT)")

> @@ -105,20 +105,20 @@ the pathname."
>  		 nosuffix (nth 5 frame)))
>  	  ((eq function 'require)
>  	   (setq file (or (nth 3 frame) (symbol-name (nth 2 frame))))))
> -    (if (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
> -				(if (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)))))
> +    (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) '(".eln" ".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)))))

Really?  When did you ever bump into a `.eln` file along `load-path`?

BTW, among my `scratch/hyperbole` patches, there's the one below, which
removes this function, so I wonder in which circumstance you
found the need for the above change.


        Stefan


commit e126a76e8fdca5193b2ecd6b6143b573d28c1866
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Mon Apr 3 13:43:57 2023 -0400

    * hversion.el (hyperb:path-being-loaded): Delete function
    
    * hload-path.el (hyperb:dir): Don't use it as fallback because it's too
    hackish and too rarely useful.

diff --git a/hload-path.el b/hload-path.el
index b71239b7a9..1b5e9dce58 100644
--- a/hload-path.el
+++ b/hload-path.el
@@ -46,7 +46,6 @@ Use `hyperb:wsl-os-p' to test if running under WSL.")
                                (macroexp-file-name)
                              (and (stringp load-file-name) load-file-name))
                            (locate-file "hmouse-tag.el" load-path)
-                       (hyperb:path-being-loaded)
                            ""))
                       (error
                        "(Hyperbole): Failed to set hyperb:dir.  Try setting it manually"))
diff --git a/hversion.el b/hversion.el
index 5ae7979204..9803c9cdbe 100644
--- a/hversion.el
+++ b/hversion.el
@@ -93,33 +93,6 @@ of stack frames (from innermost to outermost)."
          nil)
        (when debug-flag (nreverse frame-list)))))
 
-(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) '(".eln" ".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)))))
-
 (defun hyperb:window-sys-term (&optional frame)
   "Return first part of the term-type if running under a window system, else nil.
 Where a part in the term-type is delimited by a `-' or  an `_'."
diff --git a/hyperbole.el b/hyperbole.el
index f270cfc165..7286fa7dce 100644
--- a/hyperbole.el
+++ b/hyperbole.el
@@ -113,9 +113,9 @@
     (setq features (delq 'hload-path features)
          features (delq 'hversion features)))
 
-  ;; 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.
+  ;; 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.
   ;;
   ;; This handles the case when the Hyperbole package directory is not yet in load-path.
   (unless (or (require 'hversion nil t)




           reply	other threads:[~2023-05-24 14:08 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20230523155837.BAAE6C21A64@vcs2.savannah.gnu.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv4jo17rnb.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=rsw@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).