Skip to content

Commit 96a1bf2

Browse files
committed
hsys-consult.el - Fix to properly extract version number
1 parent 39053a3 commit 96a1bf2

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
expected failed since there is a problem with moving over hidden
66
sections.
77

8+
2026-04-07 Bob Weiner <rsw@gnu.org>
9+
10+
* hsys-consult.el: Rewrite to properly extract version number from the
11+
consult.el file.
12+
813
2026-04-05 Bob Weiner <rsw@gnu.org>
914

1015
* hyrolo.el (hyrolo-hdr-to-first-line-p): Handle black lines and @loc> after

hsys-consult.el

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
;; Author: Bob Weiner
33
;;
44
;; Orig-Date: 4-Jul-24 at 09:57:18
5-
;; Last-Mod: 28-Feb-26 at 10:15:27 by Bob Weiner
5+
;; Last-Mod: 7-Apr-26 at 23:47:23 by Bob Weiner
66
;;
77
;; SPDX-License-Identifier: GPL-3.0-or-later
88
;;
@@ -120,7 +120,7 @@ Install `consult' package if not yet installed."
120120
(let ((consult-version (hsys-consult-get-version)))
121121
;; Multi-file support added after consult version "0.32"
122122
(when (not (and consult-version (string-greaterp consult-version "0.32")))
123-
(error "(hsys-consult-grep): consult package version is %s; update required"
123+
(error "(hsys-consult-grep): consult package version is %s; update required to 0.35 minimum"
124124
consult-version))))
125125

126126
;;;###autoload
@@ -131,7 +131,12 @@ Install `consult' package if not yet installed."
131131
(buffer-modified (when buffer-existed (buffer-modified-p buffer-existed)))
132132
(buf (or buffer-existed (find-file-noselect consult-file))))
133133
(with-current-buffer buf
134-
(prog1 (package-get-version)
134+
(prog1 (save-excursion
135+
(widen)
136+
(goto-char (point-min))
137+
(if (re-search-forward "Version:[ \t]+\\([.0-9]+\\)" nil t)
138+
(match-string-no-properties 1)
139+
""))
135140
(unless buffer-modified
136141
(kill-buffer buf))))))
137142

0 commit comments

Comments
 (0)