branch: externals/hyperbole commit 19aced9b01e0f3e110d10a17de4a54b9bfc1192e Author: Bob Weiner <r...@gnu.org> Commit: Bob Weiner <r...@gnu.org>
Fix hyrolo-org-mode hide/show commands; hypb:display-file-with-logo now auto sets and uses Org mode and allows global headline cycling via {TAB} when at blank line at the beginning of the buffer. This eliminates the need for local variables which have been removed from the doc files. Also expands any folded headings in the file. Improve use in tests by doing the following when in batch mode, i.el noninteractive execution: Kill off any non-modified buffer showing the file to display before freshly reading it. New variable `hsys-org-cycle-bob-file-list' specifies the list of files that get automatic beginning of buffer heading exposure cycling from a call to `hypb:display-file-with-logo'. hyrolo.el (hyrolo-org-mode): Add newer Org 9.7-pre hide/show support. hyrolo-tests.el (hyrolo-tests--outline-hide-show-heading, hyrolo-tests--outline-show-when-moving-out-of-hidden-line): The above change fixes these tests, so they have been re-enabled. hmouse-tag.el (smart-lisp-identifier-chars): Add @ char as advised functions use the orig-function@advice-wrapper-name to refer to the advice. hpath.el (hpath:variables): Move 'load-path' and 'exec-path' before 'Info-directory-list' as they should be higher priority matches. Remove old 'Info-directory'. --- ChangeLog | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++- DEMO | 2 -- FAST-DEMO | 1 - HY-COPY | 2 +- HY-NEWS | 2 -- hmouse-tag.el | 4 ++-- hpath.el | 4 ++-- hsys-flymake.el | 28 +++++++++++++-------------- hsys-org.el | 19 ++++++++++++------ hui-mouse.el | 32 +++++++++++++++++++++++-------- hypb.el | 38 ++++++++++++++++++++++++++++++------ hyrolo.el | 44 ++++++++++++++++++++++++++++-------------- test/hui-tests.el | 21 ++++++++++++++++++++ test/hyrolo-tests.el | 4 +--- 14 files changed, 193 insertions(+), 62 deletions(-) diff --git a/ChangeLog b/ChangeLog index 555c460bef..84c4bfd58d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,56 @@ -2024-01-09 Bob Weiner <r...@gnu.org> +2024-01-13 Bob Weiner <r...@gnu.org> + +* hyrolo.el (hyrolo-org-mode): Add newer Org 9.7-pre hide/show support. + test/hyrolo-tests.el (hyrolo-tests--outline-hide-show-heading, + hyrolo-tests--outline-show-when-moving-out-of-hidden-line): + The above change fixes these tests, so they have been re-enabled. + +* hmouse-tag.el (smart-lisp-identifier-chars): Add @ char as advised functions + use the orig-function@advice-wrapper-name to refer to the advice. + +* hpath.el (hpath:variables): Move 'load-path' and 'exec-path' before + 'Info-directory-list' as they should be higher priority matches. + Remove old 'Info-directory'. + +2024-01-12 Bob Weiner <r...@gnu.org> + +* hypb.el (hypb:display-file-with-logo): Expand any folded headings + in the file. + + Improve use in tests by doing the following when in batch mode + (noninteractive): Kill off any non-modified buffer showing the file + to display before freshly reading it. + +2024-01-10 Bob Weiner <r...@gnu.org> + +* hui-mouse.el (hkey-alist): Move 'smart-eolp' to immediately before + 'smart-org' clause. + hsys-org.el (hsys-org-cycle-bob-file-list): Add to list files auto + set to 'org-mode' with minor 'view-mode' that allow org global + cycling of headings with {TAB} when at the beginning of buffer and + not on a heading. + hyrolo.el (hyrolo-verify): Allow buffers associated with files from + 'hsys-org-cycle-bob-file-list' as well. + hui-mouse.el (smart-org-bob-and-non-heading-p): Check whether {TAB} or + {M-RET} should org-global-cycle at point." + (smart-eolp): Allow for org global cycling at start of + buffer on a non-heading line in Hyperbole doc files when displayed from + Hyperbole menu items. + hypb.el (hypb:insert-hyperbole-banner): Update so Hyperbole logo link + does not include the first blank line, allowing for a different + action on {RET} there. + +* hyrolo.el (hyrolo-verify): Remove mentions of HyNote (not in this release). + +* hypb.el (hypb:display-file-with-logo): Remove call (skip-syntax-forward "-") + so point stays at the beginning of buffer for Org global display cycling. + Replace 'id-browse-file' and 'view-mode' with 'hyrolo-mode'. + +* hsys-flymake.el (repeat-mode): Add missing (require 'repeat) since + 'repeat-mode' function used herein is not autoloaded. + (flymake-mode-hook): Check whether `repeat-mode' is + fboundp or not before trying to enable it (should be autoloaded when + it exists, probably in Emacs 28 or greater). * hsys-xref.el: Add forgotten file. diff --git a/DEMO b/DEMO index dea93b59ec..48df6e4b27 100644 --- a/DEMO +++ b/DEMO @@ -1,5 +1,3 @@ --*- Mode: org; org-cycle-global-at-bob: t; hsys-org-enable-smart-keys: t -*- - * GNU Hyperbole Full Demo/Tutorial by Bob Weiner Send an email or a testimonial if you like Hyperbole to <r...@gnu.org>. diff --git a/FAST-DEMO b/FAST-DEMO index 8c0c6982ac..1e032c4fff 100644 --- a/FAST-DEMO +++ b/FAST-DEMO @@ -1,4 +1,3 @@ --*- Mode: org; org-cycle-global-at-bob: t; hsys-org-enable-smart-keys: t -*- * GNU Hyperbole Fast Demo by Bob Weiner diff --git a/HY-COPY b/HY-COPY index a9335e0425..abd302f665 100644 --- a/HY-COPY +++ b/HY-COPY @@ -4,7 +4,7 @@ The following copyright applies to the GNU Hyperbole software. -Copyright (C) 1989-2022 Free Software Foundation, Inc. +Copyright (C) 1989-2024 Free Software Foundation, Inc. Originally developed with support from Motorola Inc., who donated all such work to the Free Software Foundation, Inc. in the 1990s. diff --git a/HY-NEWS b/HY-NEWS index 5ea5c7929c..bc544534d9 100644 --- a/HY-NEWS +++ b/HY-NEWS @@ -1,5 +1,3 @@ --*- Mode: org; org-cycle-global-at-bob: t; hsys-org-enable-smart-keys: t -*- - * What's New in GNU Hyperbole by Bob Weiner diff --git a/hmouse-tag.el b/hmouse-tag.el index ae64e23b86..29bf64d525 100644 --- a/hmouse-tag.el +++ b/hmouse-tag.el @@ -3,7 +3,7 @@ ;; Author: Bob Weiner ;; ;; Orig-Date: 24-Aug-91 -;; Last-Mod: 7-Jan-24 at 14:34:32 by Bob Weiner +;; Last-Mod: 13-Jan-24 at 01:29:42 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -598,7 +598,7 @@ in the current directory or any of its ancestor directories." "Regexp matching the first character of a Lisp identifier.") ;;;###autoload -(defconst smart-lisp-identifier-chars "-_:/*+=%$&?!<>a-zA-Z0-9~^" +(defconst smart-lisp-identifier-chars "-_:/*+=%$&?!<>a-zA-Z0-9~^@" "Regexp matching a valid char in a Lisp identifier except the first char. Excludes character matching square brackets, so may be used with skip-characters-forward/backward.") diff --git a/hpath.el b/hpath.el index 0ed3599ea3..4ee5a5793d 100644 --- a/hpath.el +++ b/hpath.el @@ -3,7 +3,7 @@ ;; Author: Bob Weiner ;; ;; Orig-Date: 1-Nov-91 at 00:44:23 -;; Last-Mod: 26-Dec-23 at 22:42:39 by Bob Weiner +;; Last-Mod: 13-Jan-24 at 00:57:41 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -546,7 +546,7 @@ Used only if the function `image-mode' is defined." ;; link is later resolved. ;; (defcustom hpath:variables - '(hyperb:dir Info-directory Info-directory-list sm-directory load-path exec-path) + '(hyperb:dir load-path exec-path Info-directory-list sm-directory) "*List of Emacs Lisp variable symbols to substitute within matching link paths. Each variable value, if bound, must be either a pathname or a list of pathnames. When embedded within a path, the format is ${variable}." diff --git a/hsys-flymake.el b/hsys-flymake.el index 10d167972f..4873af3b7d 100644 --- a/hsys-flymake.el +++ b/hsys-flymake.el @@ -3,16 +3,14 @@ ;; Keywords: tools ;; ;; Author: Bob Weiner -;; Org: RWorks -;; E-mail: r...@gnu.org ;; ;; Orig-Date: 31-Dec-23 at 13:54:08 -;; Last-Mod: 4-Jan-24 at 22:51:11 by Bob Weiner +;; Last-Mod: 9-Jan-24 at 21:29:43 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; ;; Copyright (C) 2023-2024 Free Software Foundation, Inc. -;; Licensed under the GNU General Public License, version 3. +;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. ;; @@ -59,11 +57,11 @@ ;; ;;; Code: -;; Don't require `flymake-mode' or `repeat-mode' here. Instead we -;; leave it to each function to check whether `flymake-mode' is -;; enabled and active in the current buffer. This way, if the user -;; never uses `flymake-mode' that library is never loaded and the -;; Smart Key context from `hkey-alist' in "hui-mouse.el" that invokes +;; Don't require `flymake-mode' or `repeat' here. Instead we leave +;; it to each function to check whether `flymake-mode' is enabled +;; and active in the current buffer. This way, if the user never +;; uses `flymake-mode' that library is never loaded and the Smart +;; Key context from `hkey-alist' in "hui-mouse.el" that invokes ;; functions from herein, never triggers. (require 'hbut) @@ -141,7 +139,7 @@ Issue is inserted into the buffer after the current visible line." ;; flymake-mode does not bind any keys; it has only menu bindings. ;; Add key bindings for use in the source buffer on the C-c C-l prefix. -;; Each time these keys are changed, need to disable repeat-mode and +;; Each time these keys are changed, need to disable `repeat-mode' and ;; then re-enable it to read the updated key bindings. (defvar hsys-flymake-mode-control-l-prefix-map (let ((map (make-sparse-keymap))) @@ -155,9 +153,9 @@ Issue is inserted into the buffer after the current visible line." (define-key map "w" 'hsys-flymake-toggle-wraparound) map)) -;; Use repeat-mode for appropriate flymake commands so can repeat them -;; with their last keystroke, e.g. repeat {C-c C-l n} by pressing {n} -;; repeatedly. +;; Use `repeat-map' property for appropriate flymake commands so can +;; repeat them with their last keystroke, e.g. repeat {C-c C-l n} by +;; pressing {n} repeatedly. (defvar hsys-flymake-repeat-map (let ((map (make-sparse-keymap))) (mapc (lambda (cmd) @@ -181,7 +179,9 @@ Issue is inserted into the buffer after the current visible line." (lambda () (when flymake-mode (define-key flymake-mode-map "\C-c" hsys-flymake-mode-control-c-prefix-map) - (repeat-mode 1)))) + ;; probably Emacs 28 or greater + (when (fboundp 'repeat-mode) + (repeat-mode 1))))) ;; If flymake-mode is already enabled, re-enable it to ensure ;; repeat-mode gets enabled. (when (and (featurep 'flymake) flymake-mode) diff --git a/hsys-org.el b/hsys-org.el index 2d7bf681bb..2b3e0c1fba 100644 --- a/hsys-org.el +++ b/hsys-org.el @@ -3,7 +3,7 @@ ;; Author: Bob Weiner ;; ;; Orig-Date: 2-Jul-16 at 14:54:14 -;; Last-Mod: 26-Dec-23 at 12:05:46 by Bob Weiner +;; Last-Mod: 13-Jan-24 at 02:28:50 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -68,12 +68,12 @@ ;;;###autoload (defcustom hsys-org-enable-smart-keys 'unset "This applies in Org major/minor modes only when `hyperbole-mode' is active. -If set to \\='unset prior to loading Hyperbole, then Hyperbole -initialization will set its value. +If set to \\='unset prior to loading Hyperbole, then Hyperbole initialization +will set its value. -The following table shows what the Smart Keys do in various contexts -with different settings of this option. For example, a nil value makes -{M-RET} operate as it normally does within Org mode contexts. +The following table shows what the Smart Keys do in various contexts with +different settings of this option. For example, a nil value makes {M-RET} +operate as it normally does within Org mode contexts. |---------+-------------------+------------------+----------+------------------| | Setting | Smart Key Context | Hyperbole Button | Org Link | Fallback Command | @@ -100,6 +100,13 @@ with different settings of this option. For example, a nil value makes ;;; Public Action Types ;;; ************************************************************************ +(defcustom hsys-org-cycle-bob-file-list + '("${hyperb:dir}/DEMO" "${hyperb:dir}/FAST-DEMO" "${hyperb:dir}/MANIFEST" + "${hyperb:dir}/HY-ABOUT" "${hyperb:dir}/HY-NEWS") + "List of files to globally `org-cycle' when at the beginning of the buffer." + :type '(repeat file) + :group 'hyperbole) + (defact org-link (&optional link) "Follow an optional Org mode LINK to its target. If LINK is nil, follow any link at point. Otherwise, trigger an error." diff --git a/hui-mouse.el b/hui-mouse.el index 3c9affdb67..b1ffa16509 100644 --- a/hui-mouse.el +++ b/hui-mouse.el @@ -3,7 +3,7 @@ ;; Author: Bob Weiner ;; ;; Orig-Date: 04-Feb-89 -;; Last-Mod: 4-Jan-24 at 22:51:41 by Bob Weiner +;; Last-Mod: 10-Jan-24 at 21:26:33 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -40,7 +40,10 @@ ;;; ************************************************************************ (require 'ert-results nil t) ;; Action Key support in ERT result buffers -(require 'hsys-flymake) +;; Library in next line (for code optionally used in `smart-eol') uses +;; `repeat-map' which was not added to the "repeat.el" library in Emacs 27.1, +;; so don't use if it fails to load properly. +(ignore-errors (require 'hsys-flymake)) (require 'hload-path) (require 'hsys-org) (require 'hbut) @@ -292,6 +295,10 @@ Its default value is `smart-scroll-down'. To disable it, set it to (smart-helm-alive-p))) . ((funcall (key-binding (kbd "RET"))) . (funcall (key-binding (kbd "RET"))))) ;; + ;; If at the end of a line (eol), invoke the associated Smart Key handler EOL handler. + ((smart-eolp) + . ((funcall action-key-eol-function) . (funcall assist-key-eol-function))) + ;; ;; Handle any Org mode-specific contexts but give priority to Hyperbole ;; buttons prior to cycling Org headlines ((and (not (hyperb:stack-frame '(smart-org))) @@ -312,10 +319,6 @@ Its default value is `smart-scroll-down'. To disable it, set it to ((and (fboundp 'xref--item-at-point) (xref--item-at-point)) . ((xref-goto-xref) . (xref-show-location-at-point))) ;; - ;; If at the end of a line (eol), invoke the associated Smart Key handler EOL handler. - ((smart-eolp) - . ((funcall action-key-eol-function) . (funcall assist-key-eol-function))) - ;; ;; The Smart Menu system is an attractive in-buffer menu system ;; that works on any display system that supports Emacs. It ;; predates Emacs' menu systems; it is a part of InfoDock. @@ -1918,6 +1921,15 @@ handled by the separate implicit button type, `org-link-outside-org-mode'." ;; contexts nil))))) +(defun smart-org-bob-and-non-heading-p () + "Check whether {TAB} should globally `org-cycle' at point." + (and (bobp) + buffer-file-name + (derived-mode-p 'org-mode) + (not (org-at-heading-p)) + (member buffer-file-name + (hpath:expand-list hsys-org-cycle-bob-file-list)))) + ;;; ************************************************************************ ;;; smart-outline functions ;;; ************************************************************************ @@ -2090,12 +2102,16 @@ If key is pressed: "Return t if point is at the end of a visible line but not the end of the buffer." ;; smart-helm handles eol for helm buffers (unless (or (and (smart-helm-alive-p) (equal (helm-buffer-get) (buffer-name))) + ;; Allow for org global cycling at start of buffer on a + ;; non-heading line in Hyperbole doc files when + ;; displayed from Hyperbole menu items. + (smart-org-bob-and-non-heading-p) + ;; If there is a flymake diagnostic issue at eol, + ;; drop through this clause to handle it later. (and (featurep 'hsys-flymake) (boundp 'flymake-mode) flymake-mode (eolp) - ;; If there is a flymake diagnostic issue at eol, - ;; drop through this clause to handle it later. (hsys-flymake-get-issue-at-position))) (if (eq major-mode 'kotl-mode) (and (not (kotl-mode:eobp)) (kotl-mode:eolp t)) diff --git a/hypb.el b/hypb.el index 538107e289..4cd751a9ad 100644 --- a/hypb.el +++ b/hypb.el @@ -3,7 +3,7 @@ ;; Author: Bob Weiner ;; ;; Orig-Date: 6-Oct-91 at 03:42:38 -;; Last-Mod: 3-Jan-24 at 23:44:37 by Mats Lidell +;; Last-Mod: 12-Jan-24 at 08:20:56 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -1091,17 +1091,43 @@ If FILE is not an absolute path, expand it relative to `hyperb:dir'." (error "(hypb:display-file-with-logo): 'file' must be a string, not '%s'" file)) (unless (file-name-absolute-p file) (setq file (expand-file-name file hyperb:dir))) - (let ((existing-buf (when (stringp file) (get-file-buffer file)))) - ;; A stub for this function is defined in hversion.el when not running in InfoDock. - (id-browse-file file) + (let ((existing-buf (when (stringp file) (get-file-buffer file))) + (hsys-org-enable-smart-keys hsys-org-enable-smart-keys)) + + ;; Ensure Smart Keys do not defer to Org mode when running tests noninteractively + (when noninteractive + (setq sys-org-enable-smart-keys t)) + + (when (and existing-buf noninteractive) + ;; Likely are running tests when running non-interactively, so + ;; kill existing buffer, so each test run starts from scratch + ;; and is consistent. Trigger an error if buffer has been + ;; modified. + (when (buffer-modified-p existing-buf) + (error "(hypb:display-file-with-logo): Attempt to kill modified buffer: %s" existing-buf)) + (when (kill-buffer existing-buf) + (setq existing-buf nil))) + + ;; A stub for the `id-browse-file' function is defined in + ;; "hversion.el" when not running in InfoDock. + (if (eq (symbol-function #'id-browse-file) #'view-file) + (find-file file) + ;; Running under InfoDock + (id-browse-file file)) + (unless existing-buf (let ((buffer-read-only)) (hypb:insert-hyperbole-banner)) (goto-char (point-min)) - (skip-syntax-forward "-") (set-window-start (selected-window) 1) (set-buffer-modified-p nil) + (org-mode) + (setq-local org-cycle-global-at-bob t) (view-mode) + ;; Ensure no initial folding of the buffer, possibly from a hook + (if (fboundp 'org-fold-show-all) + (org-fold-show-all) + (org-show-all)) ;; On some versions of Emacs like Emacs28, need a slight delay ;; for file loading before searches will work properly. ;; Otherwise, "test/demo-tests.el" may fail. @@ -1146,7 +1172,7 @@ Without file, the banner is prepended to the current buffer." (insert "\n") (insert-image hyperbole-banner) (insert "\n") - (setq button (make-button (- (point) 3) (- (point) 2) :type 'hyperbole-banner)) + (setq button (make-button (- (point) 2) (- (point) 1) :type 'hyperbole-banner)) (button-put button 'help-echo (concat "Click to visit " hypb:home-page)) (button-put button 'action #'hypb:browse-home-page) (button-put button 'face 'default) diff --git a/hyrolo.el b/hyrolo.el index b400dc575b..849325033c 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: 6-Jan-24 at 10:02:10 by Mats Lidell +;; Last-Mod: 13-Jan-24 at 02:25:54 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -28,10 +28,11 @@ ;;; Other required Elisp libraries ;;; ************************************************************************ -(require 'custom) ;; For 'defface'. +(require 'custom) ;; For `defface' (require 'hversion) (require 'hmail) -(require 'hypb) ;; For 'hypb:mail-address-regexp'. +(require 'hsys-org) ;; For `hsys-org-cycle-bob-file-list' +(require 'hypb) ;; For `hypb:mail-address-regexp' (require 'outline) (require 'package) (require 'reveal) @@ -1136,16 +1137,19 @@ matched entries." (hyrolo-show-levels 1)) (defun hyrolo-verify () - "Verify point is in a HyRolo or HyNote match buffer." - (when (not (member (buffer-name) (list hyrolo-display-buffer - (and (car (hyrolo-get-file-list)) - (file-name-nondirectory (car (hyrolo-get-file-list)))) - (when (boundp 'hynote-display-buffer) - hynote-display-buffer) - (when (boundp 'hynote-file-list) - (and (car hynote-file-list) - (file-name-nondirectory (car hynote-file-list))))))) - (error "(HyRolo): Use this command in HyRolo/HyNote match buffers or primary file buffers"))) + "Verify point is in a HyRolo match buffer." + (when (not (member (buffer-name) (nconc (list hyrolo-display-buffer + (and (car (hyrolo-get-file-list)) + (file-name-nondirectory (car (hyrolo-get-file-list))))) + (mapcar #'file-name-nondirectory + (hpath:expand-list hsys-org-cycle-bob-file-list)) + ;; (when (boundp 'hynote-display-buffer) + ;; hynote-display-buffer) + ;; (when (boundp 'hynote-file-list) + ;; (and (car hynote-file-list) + ;; (file-name-nondirectory (car hynote-file-list)))) + ))) + (error "(HyRolo): Use this command in HyRolo match buffers or primary file buffers"))) (defun hyrolo-widen () "Widen non-special HyRolo buffers mainly for adding entries or editing them." @@ -2015,7 +2019,7 @@ of the current heading, or to 1 if the current line is not a heading." "Move back to the start of current subtree and hide everything after the heading. If within a file header, hide the whole file after the end of the current line. -Necessary, since with reveal-mode active, outline-hide-subtree works +Necessary, since with reveal-mode active, `outline-hide-subtree' works only if on the heading line of the subtree." (interactive) (if (and (hyrolo-hdr-in-p) @@ -2600,6 +2604,18 @@ Any non-nil value returned is a cons of (<entry-name> . <entry-source>)." ;; set its parent mode property to org-mode so can `derived-mode-p' ;; checks will pass. (put 'hyrolo-org-mode 'derived-mode-parent 'org-mode) + + (when (and org-link-descriptive + (eq org-fold-core-style 'overlays)) + (add-to-invisibility-spec '(org-link))) + (org-fold-initialize (or (and (stringp org-ellipsis) (not (equal "" org-ellipsis)) org-ellipsis) + "...")) + (make-local-variable 'org-link-descriptive) + (when (eq org-fold-core-style 'overlays) (add-to-invisibility-spec '(org-hide-block . t))) + (if org-link-descriptive + (org-fold-core-set-folding-spec-property (car org-link--link-folding-spec) :visible nil) + (org-fold-core-set-folding-spec-property (car org-link--link-folding-spec) :visible t)) + (setq-local hyrolo-entry-regexp "^\\(\\*+\\)\\([ ]+\\)" hyrolo-hdr-and-entry-regexp (concat hyrolo-hdr-prefix-regexp hyrolo-entry-regexp) hyrolo-entry-group-number 1 diff --git a/test/hui-tests.el b/test/hui-tests.el index c059fc5fda..a6dbac09bd 100644 --- a/test/hui-tests.el +++ b/test/hui-tests.el @@ -935,11 +935,32 @@ With point on label suggest that ibut for rename." (ert-deftest hui--link-possible-types () "Verify right type is selected from referent buffer." + ;; Ensure using any local available packaged version of Org mode rather than built-in + ;; which may have been activated before load-path was set correctly. + ;; Avoids mixed version load of Org. + (mapc (lambda (lib-sym) (when (featurep lib-sym) (unload-feature lib-sym t))) + '(org org-version org-keys org-compat ol org-table org-macs org-id org-element org-list)) + (package-initialize) + (let ((pkg-desc (car (cdr (assq 'org package-archive-contents))))) + (package-activate pkg-desc t)) + ;; Not all versions of org include this variable, so set it + (setq org--inhibit-version-check nil + org-list-allow-alphabetical nil) + (load "org-keys") ;; Otherwise, {M-RET} may not be bound to a key + (load "org-compat") ;; Otherwise, `org-file-name-concat' may be undefined + (load "org-macs") ;; Otherwise, `org--inhibit-version-check' may be undefined + (load "org-list") ;; Otherwise, `org-list-allow-alphabetical' may be undefined + (load "ol") ;; Otherwise, `org-link--description-folding-spec' may be undefined + (cl-flet ((require (lambda (lib-sym &optional _filename _noerror) + (load (symbol-name lib-sym))))) + (require 'org)) + ;; Org Roam or Org Id link-to-org-id (let ((file (make-temp-file "hypb" nil ".org"))) (unwind-protect (progn (find-file file) + (erase-buffer) (org-id-get-create nil) (re-search-forward ":ID:") (hy-test-helpers:ensure-link-possible-type 'link-to-org-id)) diff --git a/test/hyrolo-tests.el b/test/hyrolo-tests.el index e033a471da..0b3a956164 100644 --- a/test/hyrolo-tests.el +++ b/test/hyrolo-tests.el @@ -3,7 +3,7 @@ ;; Author: Mats Lidell <ma...@gnu.org> ;; ;; Orig-Date: 19-Jun-21 at 22:42:00 -;; Last-Mod: 7-Jan-24 at 01:00:43 by Mats Lidell +;; Last-Mod: 13-Jan-24 at 02:32:45 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -773,7 +773,6 @@ Make cell start with HEADING and follow by next line BODY." (ert-deftest hyrolo-tests--outline-hide-show-heading () "Verify hiding and showing headings." - (skip-unless (version< org-version "9.6")) (let* ((org-file (make-temp-file "hypb" nil ".org" (hyrolo-tests--gen-outline ?* "heading" 1 "body" 2))) (hyrolo-file-list (list org-file))) @@ -815,7 +814,6 @@ Make cell start with HEADING and follow by next line BODY." (ert-deftest hyrolo-tests--outline-show-when-moving-out-of-hidden-line () "Verify region is shown after moving out of hidden area." - (skip-unless (version< org-version "9.6")) (let* ((org-file (make-temp-file "hypb" nil ".org" (hyrolo-tests--gen-outline ?* "heading" 1 "body" 2))) (hyrolo-file-list (list org-file)))