33; ; Author: Bob Weiner
44; ;
55; ; Orig-Date: 19-Sep-91 at 20:45:31
6- ; ; Last-Mod: 17 -Mar-26 at 19:48:06 by Bob Weiner
6+ ; ; Last-Mod: 22 -Mar-26 at 14:08:04 by Bob Weiner
77; ;
88; ; SPDX-License-Identifier: GPL-3.0-or-later
99; ;
@@ -1013,14 +1013,20 @@ See `hpath:find' function documentation for special file display options."
10131013 " Expand FILE and jump to its LINE-NUM in Hyperbole specified window.
10141014The variable `hpath:display-where' determines where to display the file.
10151015LINE-NUM may be an integer or string."
1016- ; ; RSW 12-05-2021 - Added hpath:expand in next line to
1017- ; ; resolve any variables in the path before checking if absolute.
1018- (let ((source-loc (unless (file-name-absolute-p (hpath:expand file))
1019- (hbut:to-key-src t )))
1020- ext)
1021- (if (stringp source-loc)
1022- (setq file (expand-file-name file (file-name-directory source-loc)))
1023- (setq file (or (hpath:prepend-shell-directory file)
1016+ ; ; RSW 12-05-2021 - Add hpath:expand in next line to resolve any variables
1017+ ; ; in the path before checking if absolute.
1018+ ; ; RSW 03-22-2026 - Save expanded-file and use if absolute in order to
1019+ ; ; prefer files found in current directory over those in a `load-path' dir.
1020+ (let ((expanded-file (hpath:expand file))
1021+ source-loc)
1022+ (unless (and (stringp expanded-file) (file-name-absolute-p expanded-file))
1023+ (setq expanded-file nil ))
1024+ (setq source-loc (unless expanded-file (hbut:to-key-src t )))
1025+ (cond (expanded-file
1026+ (setq file expanded-file))
1027+ ((stringp source-loc)
1028+ (setq file (expand-file-name file (file-name-directory source-loc))))
1029+ (t (setq file (or (hpath:prepend-shell-directory file)
10241030 ; ; find-library-name will strip file
10251031 ; ; suffixes, so use it only when the file
10261032 ; ; either doesn't have a suffix or has a
@@ -1029,7 +1035,7 @@ LINE-NUM may be an integer or string."
10291035 (member (concat " ." ext) (get-load-suffixes )))
10301036 (ignore-errors (find-library-name file)))
10311037 (hpath:is-p (expand-file-name file))
1032- (hywiki-get-existing-page-file file))))
1038+ (hywiki-get-existing-page-file file)))))
10331039 (when (file-exists-p (hpath:normalize file))
10341040 (actypes::link-to-file-line file line-num))))
10351041
0 commit comments