Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
2026-01-05 Mats Lidell <matsl@gnu.org>

* test/hywiki-tests.el
(hywiki-tests--action-key-moves-to-word-and-section): Adopt to changed
linked behavior.

* hywiki.el (hywiki-section-to-headline-reference): Remove unused.

* hpath.el (hpath:dashes-to-spaces-markup-anchor): Do not convert in
hywiki pages.

2025-12-31 Mats Lidell <matsl@gnu.org>

* Remove starting asterix from defcustom variable docstrings.
Expand Down
9 changes: 6 additions & 3 deletions hpath.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 1-Nov-91 at 00:44:23
;; Last-Mod: 31-Dec-25 at 16:08:46 by Mats Lidell
;; Last-Mod: 5-Jan-26 at 22:36:32 by Mats Lidell
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
;; Copyright (C) 1991-2025 Free Software Foundation, Inc.
;; Copyright (C) 1991-2026 Free Software Foundation, Inc.
;; See the "HY-COPY" file for license information.
;;
;; This file is part of GNU Hyperbole.
Expand Down Expand Up @@ -148,6 +148,8 @@ The format is ${variable}. Match grouping 1 is the name of the variable.")
(declare-function klink:act "klink")
(declare-function mm-mailcap-command "mm-decode")

(declare-function hywiki-in-page-p "hywiki")

;;; ************************************************************************
;;; MS WINDOWS PATH CONVERSIONS
;;; ************************************************************************
Expand Down Expand Up @@ -1654,7 +1656,8 @@ but locational suffixes within the file are utilized."
(defun hpath:dashes-to-spaces-markup-anchor (anchor)
"Replace dashes with spaces in ANCHOR if not a prog mode and no existing spaces."
(if (or (derived-mode-p 'prog-mode)
(string-match-p "-.* \\| .*-" anchor))
(string-match-p "-.* \\| .*-" anchor)
(hywiki-in-page-p))
anchor
;; In Markdown or outline modes '-' characters in `anchor' are
;; converted to spaces at the point of definition unless anchor
Expand Down
16 changes: 2 additions & 14 deletions hywiki.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 21-Apr-24 at 22:41:13
;; Last-Mod: 30-Nov-25 at 18:06:52 by Bob Weiner
;; Last-Mod: 5-Jan-26 at 20:09:54 by Mats Lidell
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
;; Copyright (C) 2024-2025 Free Software Foundation, Inc.
;; Copyright (C) 2024-2026 Free Software Foundation, Inc.
;; See the "HY-COPY" file for license information.
;;
;; This file is part of GNU Hyperbole.
Expand Down Expand Up @@ -2997,7 +2997,6 @@ variables."
:complete #'hywiki-org-link-complete
:export #'hywiki-org-link-export
:follow #'hywiki-find-referent
:htmlize-link #'hywiki-section-to-headline-reference
:store #'hywiki-org-link-store)
(org-link-set-parameters "hypb-msg"
:follow (lambda (path) (message "Message: %s" path))
Expand Down Expand Up @@ -3065,17 +3064,6 @@ at point must return non-nil or this function will return nil."
(list word start end)
word)))

(defun hywiki-section-to-headline-reference ()
"Replace file#section dashes with spaces to match to an Org headline.
Does replacement only when not in a programming mode and section
contains no spaces."
(let ((link (get-text-property (point) 'org-link)))
(if (and link (string-match "#" link))
(let* ((file (substring link 0 (match-beginning 0)))
(section (substring link (match-beginning 0))))
(concat file (hpath:dashes-to-spaces-markup-anchor section)))
link)))

(defun hywiki-strip-org-link (link-str)
"Return the hy:HyWikiWord#section part of an Org link string.
Strip any square bracket delimiters, description and leading or
Expand Down
12 changes: 7 additions & 5 deletions test/hywiki-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
;; Author: Mats Lidell
;;
;; Orig-Date: 18-May-24 at 23:59:48
;; Last-Mod: 22-Nov-25 at 13:35:42 by Bob Weiner
;; Last-Mod: 5-Jan-26 at 21:38:04 by Mats Lidell
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
;; Copyright (C) 2024-2025 Free Software Foundation, Inc.
;; Copyright (C) 2024-2026 Free Software Foundation, Inc.
;; See the "HY-COPY" file for license information.
;;
;; This file is part of GNU Hyperbole.
Expand Down Expand Up @@ -964,10 +964,10 @@ Both mod-time and checksum must be changed for a test to return true."
("WikiWord#Asection:L1" . "* Asection")
("WikiWord#Asection:L2" . "body A")
("WikiWord#Asection:L2:C2" . "dy A")
("WikiWord#Bsection-subsection" . "** Bsection subsection")
("WikiWord#Bsection-subsection" . "** Bsection-subsection")
("WikiWord#Bsection-subsection:L2" . "body B")
("WikiWord#Bsection-subsection:L2:C2" . "dy B")
("(WikiWord#Bsection subsection)" . "** Bsection subsection")
("(WikiWord#Csection subsection)" . "*** Csection subsection")
("(WikiWord#Asection)" . "* Asection")
)))
(unwind-protect
Expand All @@ -978,8 +978,10 @@ Both mod-time and checksum must be changed for a test to return true."
First line
* Asection
body A
** Bsection subsection
** Bsection-subsection
body B
*** Csection subsection
body C
")
(save-buffer))
;; Create temp buffers with WikiWord links to the target
Expand Down