[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole f6014a52c5 3/3: Merge branch 'rsw'
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hyperbole f6014a52c5 3/3: Merge branch 'rsw' |
Date: |
Tue, 8 Aug 2023 12:58:25 -0400 (EDT) |
branch: externals/hyperbole
commit f6014a52c5ffe315999b600ac4c16b0e70cee04b
Merge: 3f9df2acd3 b1e8a2a75e
Author: Robert Weiner <rsw@gnu.org>
Commit: Robert Weiner <rsw@gnu.org>
Merge branch 'rsw'
---
ChangeLog | 44 +++++++++-
hactypes.el | 14 ++--
hargs.el | 207 +++++++++++++++++++++++-------------------------
hbut.el | 13 ++-
hmouse-key.el | 3 +-
hui-mini.el | 3 +-
hui-mouse.el | 16 ++--
hyperbole.el | 9 +--
kotl/kfill.el | 59 +++++++-------
kotl/klink.el | 20 ++---
test/hargs-tests.el | 4 +-
test/smart-org-tests.el | 2 +-
12 files changed, 213 insertions(+), 181 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 022a032b7c..6559c598f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,43 @@
+2023-08-06 Bob Weiner <rsw@gnu.org>
+
+* hbut.el (ibut:create): Fix to move point inside the delimited text of an
ibut rather than just
+ outside.
+ (ibut:set-name-and-label-key-p): Make interactive so can call and
have 'hbut:current
+ attributes displayed.
+
+* hargs.el (hargs:iform-extensions-vector): Fix kcell read to not use a
completion collection
+ but just a type.
+
+* hargs.el (hargs:reading-symbol): Remove, not needed, use
'hargs:reading-type'.
+
+* hyperbole.el: Remove '(hyperbole-mode 1)' call upon loading this file; was
for compatibility
+ with prior Hyperbole versions but since V8, instructions have been to add
that to personal
+ init. Remove it as loading an Elisp file should not enable a minor mode.
+
+* hargs.el (hargs:make-iform-vector): Move saving of prev `hargs:reading-type'
to here so does
+ not have to be done in multiple places elsewhere.
+ (hargs:iform-extensions-vector, hargs:iform-extensions-vector,
hargs:iform-read):
+ Remove saving of prev `hargs:reading-type' here.
+
+* hargs.el (hargs:iform-extensions-vector): Remove setting of 'prev-reading-p'
used to
+ restore 'hargs:reading-symbol' value after 'unwind-protect' code block
runs for Info-node
+ and Info-index-item. Should be 'hargs:reading-type' instead and this is
handled
+ automatically by 'hargs:iform-read'.
+
+* hui-mouse.el (hkey-alist): Deprioritize `smart-org' to after hargs argument
or minibuffer
+ menu reading.
+
+* hactypes.el (link-to-kcell, link-to-mail): Fix interactive call with
Hyperbole extension
+ format to use `hargs:iform-read'.
+
+* hargs.el (hargs:at-p):
+ kotl/klink.el (klink:create): Fix storage of button source buffer
default-directory since
+ dynamically bound let was not working due to shift to lexically-bound
code. Instead
+ store this value in the 'hbut:current 'dir property.
+
+* kotl/kfill.el (kfill:fallback-fill-paragraph): Add '(not (eq
fill-paragraph-function t))'
+ to fix no function, basic fill case.
+
2023-08-02 Mats Lidell <matsl@gnu.org>
* .github/workflows/main.yml (jobs): Add version 29.1 to CI workflow.
@@ -32,12 +72,12 @@
* hsys-org.el (hsys-org-global-cycle, hsys-org-cycle): FIX: Temp move point to
beginning
of heading so TAB invocations cycle through all states properly.
-
+
2023-07-24 Mats Lidell <matsl@gnu.org>
* Makefile (install-elpaca):
install-test/MANIFEST:
- install-test/elpaca/.emacs: Add elpaca install test.
+ install-test/elpaca/.emacs: Add elpaca install test.
2023-07-22 Bob Weiner <rsw@gnu.org>
diff --git a/hactypes.el b/hactypes.el
index 9c81066e7f..975c2fb96b 100644
--- a/hactypes.el
+++ b/hactypes.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 23-Sep-91 at 20:34:36
-;; Last-Mod: 10-Jul-23 at 17:39:13 by Mats Lidell
+;; Last-Mod: 6-Aug-23 at 16:22:54 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -558,7 +558,7 @@ See documentation for `kcell:ref-to-id' for valid cell-ref
formats.
If FILE is nil, use the current buffer.
If CELL-REF is nil, show the first cell in the view."
- (interactive "fKotl file to link to: \n+KKcell to link to: ")
+ (interactive (hargs:iform-read '(interactive "fKotl file to link to:
\n+KKcell to link to: ")))
(require 'kfile)
(cond ((if file
(hpath:find file)
@@ -576,7 +576,7 @@ If CELL-REF is nil, show the first cell in the view."
"Display mail msg with MAIL-MSG-ID from optional MAIL-FILE.
See documentation for the variable `hmail:init-function' for
information on how to specify a mail reader to use."
- (interactive "+MMail Msg: ")
+ (interactive (hargs:iform-read '(interactive "+MMail Msg: ")))
(if (not (fboundp 'rmail:msg-to-p))
(hypb:error "(link-to-mail): Invoke mail reader before trying to follow
a mail link")
(if (and (listp mail-msg-id) (null mail-file))
@@ -599,10 +599,10 @@ information on how to specify a mail reader to use."
(defact link-to-org-id (id)
"Display the Org entry, if any, for ID."
(when (stringp id)
- (let (m
- (inhibit-message t)) ;; Inhibit org-id-find status msgs
- (when (setq m (or (and (featurep 'org-roam) (org-roam-id-find id
'marker))
- (org-id-find id 'marker)))
+ (let* ((inhibit-message t) ;; Inhibit org-id-find status msgs
+ (m (or (and (featurep 'org-roam) (org-roam-id-find id 'marker))
+ (org-id-find id 'marker))))
+ (when m
(hact 'link-to-org-id-marker m)))))
(defact link-to-org-id-marker (marker)
diff --git a/hargs.el b/hargs.el
index 20a04215d6..4e5ae1d8f7 100644
--- a/hargs.el
+++ b/hargs.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 31-Oct-91 at 23:17:35
-;; Last-Mod: 30-Jul-23 at 13:15:34 by Bob Weiner
+;; Last-Mod: 6-Aug-23 at 22:14:05 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -263,10 +263,16 @@ two variables `prompt' and `default'."
,@(mapcar (lambda (elt)
`(aset ,vecsym ',(car elt)
(lambda (prompt default)
- (ignore prompt default) ;Don't warn if not used.
- ;; FIXME: Why `setq' instead of let-binding?
- (setq hargs:reading-symbol ',(cadr elt))
- ,(cddr elt))))
+ (ignore prompt default) ;; Don't warn if not used.
+ (let ((prev-reading-p hargs:reading-type))
+ (unwind-protect
+ (progn
+ ;; Use setq here to ensure change is
+ ;; visible in lexical subcontexts that are
+ ;; part of 'elt' body.
+ (setq hargs:reading-type ',(cadr elt))
+ ,(cddr elt))
+ (setq hargs:reading-type prev-reading-p))))))
iform-alist)
,vecsym)))
@@ -418,14 +424,15 @@ Handles all of the interactive argument types that
`hargs:iform-read' does."
mini-to-point)
nil)))
((and (eq hargs:reading-type 'kcell)
- (eq major-mode 'kotl-mode)
+ (derived-mode-p 'kotl-mode)
(not (looking-at "^$")))
(kcell-view:label))
((and (eq hargs:reading-type 'klink)
(not (looking-at "^$")))
- (if (eq major-mode 'kotl-mode)
- (kcell-view:reference
- nil (and (boundp 'default-dir) default-dir))
+ (if (derived-mode-p 'kotl-mode)
+ ;; Here we get the button src default-directory, not the
+ ;; default-directory of the linked to kcell.
+ (list (kcell-view:reference nil (hattr:get 'hbut:current 'dir)))
(let ((hargs:reading-type 'file))
(list (hargs:at-p)))))
((eq hargs:reading-type 'kvspec)
@@ -615,70 +622,69 @@ See also documentation for `interactive'."
;;
;; Save the prefix arg now, since use of minibuffer will clobber it
(setq prefix-arg current-prefix-arg)
- (if (not (and (listp iform) (eq (car iform) 'interactive)))
- (error "(hargs:iform-read): arg must be a list whose car = 'interactive")
- (setq iform (car (cdr iform)))
- (unless (or (null iform) (and (stringp iform) (equal iform "")))
- (let ((prev-reading-p hargs:reading-type))
- (unwind-protect
- (progn
- (when (eq default-args t)
- (setq default-args (hattr:get 'hbut:current 'args)
- ;; Set hargs:defaults global used by "hactypes.el"
- hargs:defaults default-args))
- (setq hargs:reading-type t)
- (if (not (stringp iform))
- (eval iform)
- (let ((i 0) (start 0) (end (length iform))
- (ientry) (results) (val) (default))
- ;;
- ;; Handle special initial interactive string chars.
- ;;
- ;; `*' means error if buffer is read-only.
- ;; Notion of when action cannot be performed due to
- ;; read-only buffer is view-specific, so here, we just
- ;; ignore a read-only specification since it is checked for
- ;; earlier by any ebut edit code.
- ;;
- ;; `@' means select window of last mouse event.
- ;;
- ;; `^' means activate/deactivate mark depending on
invocation thru shift translation
- ;; See `this-command-keys-shift-translated' for an
explanation.
- ;;
- ;; `_' means keep region in same state (active or inactive)
- ;; after this command.
- ;;
- (while (cond
- ((eq (aref iform i) ?*))
- ((eq (aref iform i) ?@)
- (hargs:select-event-window)
- t)
- ((eq (aref iform i) ?^)
- (handle-shift-selection))
- ((eq (aref iform i) ?_)
- (push 'only transient-mark-mode)))
- (setq i (1+ i) start i))
- ;;
- (while (and (< start end)
- (string-match "\n\\|\\'" iform start))
- (setq start (match-end 0)
- ientry (substring iform i (match-beginning 0))
- i start
- default (car default-args)
- default (if (or (null default) (stringp default))
- default
- (prin1-to-string default))
- val (hargs:get ientry default (car results))
- default-args (cdr default-args)
- results (cond ((or (null val) (not (listp val)))
- (cons val results))
- ;; Is a list of args?
- ((eq (car val) 'args)
- (append (nreverse (cdr val)) results))
- (t ;; regular list value
- (cons val results)))))
- (nreverse results))))
- (setq hargs:reading-type prev-reading-p))))))
+ (when (and (listp iform) (eq (car iform) 'interactive))
+ (setq iform (cadr iform)))
+ (unless (or (null iform) (and (stringp iform) (equal iform "")))
+ (unless (or (stringp iform) (listp iform))
+ (error "(hargs:iform-read): `iform' must be either a non-empty
interactive string or a list whose car = 'interactive, not:\n%S"
+ iform))
+ (when (eq default-args t)
+ (setq default-args (hattr:get 'hbut:current 'args)
+ ;; Set hargs:defaults global used by "hactypes.el"
+ hargs:defaults default-args))
+ (setq hargs:reading-type t)
+ (if (not (stringp iform))
+ (eval iform)
+ (let ((i 0) (start 0) (end (length iform))
+ (ientry) (results) (val) (default))
+ ;;
+ ;; Handle special initial interactive string chars.
+ ;;
+ ;; `*' means error if buffer is read-only.
+ ;; Notion of when action cannot be performed due to
+ ;; read-only buffer is view-specific, so here, we just
+ ;; ignore a read-only specification since it is checked for
+ ;; earlier by any ebut edit code.
+ ;;
+ ;; `@' means select window of last mouse event.
+ ;;
+ ;; `^' means activate/deactivate mark depending on invocation thru
shift translation
+ ;; See `this-command-keys-shift-translated' for an explanation.
+ ;;
+ ;; `_' means keep region in same state (active or inactive)
+ ;; after this command.
+ ;;
+ (while (cond
+ ((eq (aref iform i) ?*))
+ ((eq (aref iform i) ?@)
+ (hargs:select-event-window)
+ t)
+ ((eq (aref iform i) ?^)
+ (handle-shift-selection))
+ ((eq (aref iform i) ?_)
+ (push 'only transient-mark-mode)))
+ (setq i (1+ i) start i))
+ ;;
+ (while (and (< start end)
+ (string-match "\n\\|\\'" iform start))
+ (setq start (match-end 0)
+ ientry (substring iform i (match-beginning 0))
+ i start
+ default (car default-args)
+ default (if (or (null default) (stringp default))
+ default
+ (prin1-to-string default))
+ val (hargs:get ientry default (car results))
+ default-args (cdr default-args)
+ results (cond ((or (null val) (not (listp val)))
+ (cons val results))
+ ;; Is a list of args?
+ ((eq (car val) 'args)
+ (append (nreverse (cdr val)) results))
+ (t ;; regular list value
+ (cons val results)))))
+ (nreverse results)))))
+
(defun hargs:read (prompt &optional predicate default err val-type)
"PROMPT without completion for a value matching PREDICATE and return it.
@@ -689,7 +695,8 @@ Optional VAL-TYPE is a symbol indicating the type of value
to be read. If
VAL-TYPE equals `sexpression', then return that type; otherwise return the
string read or nil."
(let ((bad-val) (val) (stringify)
- (prev-reading-p hargs:reading-type) (read-func)
+ (prev-reading-p hargs:reading-type)
+ (read-func)
(owind (selected-window))
(obuf (current-buffer)))
(unwind-protect
@@ -965,26 +972,17 @@ Hyperbole menu item help when appropriate."
(defconst hargs:iform-extensions-vector
(hargs:make-iform-vector
;; Get existing Info node name, possibly prefixed with its (filename).
- (?I . (Info-node .
- (let ((prev-reading-p hargs:reading-symbol))
- (unwind-protect
- (progn (require 'info)
- (setq hargs:reading-symbol 'Info-node)
- ;; Prevent empty completions list from
- ;; triggering an error in Info-read-node-name.
- (unless Info-current-file-completions
- (condition-case nil
- (Info-build-node-completions)
- (error (setq Info-current-file-completions
'(("None"))))))
- (Info-read-node-name prompt))
- (setq hargs:reading-symbol prev-reading-p)))))
- ;; Get kcell from koutline.
- (?K . (kcell . (hargs:read-match
- prompt
- ;; Match to "0" and visible cell labels only
- (cons "0"
- (kview:map-tree (lambda (_kview) (kcell-view:label))
kview t t))
- nil t (kcell-view:visible-label) 'kcell)))
+ (?I . (Info-node . (progn (require 'info)
+ ;; Prevent empty completions list from
+ ;; triggering an error in Info-read-node-name.
+ (unless Info-current-file-completions
+ (condition-case nil
+ (Info-build-node-completions)
+ (error (setq Info-current-file-completions
'(("None"))))))
+ (Info-read-node-name prompt))))
+
+ ;; Get kcell from some koutline.
+ (?K . (kcell . (hargs:read prompt nil default nil 'kcell)))
;; Get kcell or path reference for use in a link.
(?L . (klink . (hargs:read prompt nil default nil 'klink)))
;; Get existing mail msg date and file.
@@ -1006,19 +1004,14 @@ Hyperbole menu item help when appropriate."
;; Get a Koutline viewspec.
(?V . (kvspec . (hargs:read prompt nil nil nil 'kvspec)))
;; Get existing Info index item name, possibly prefixed with its (filename).
- (?X . (Info-index-item .
- (let ((prev-reading-p hargs:reading-symbol))
- (unwind-protect
- (let (file item)
- (require 'info)
- (setq hargs:reading-symbol 'Info-index-item
- item (Info-read-index-item-name prompt))
- (if (string-match "^(\\([^\)]+\\))\\(.*\\)"
item)
- item
- (if (setq file
(Info-current-filename-sans-extension))
- (format "(%s)%s" file item)
- item)))
- (setq hargs:reading-symbol prev-reading-p))))))
+ (?X . (Info-index-item . (let (file item)
+ (require 'info)
+ (setq item (Info-read-index-item-name prompt))
+ (if (string-match "^(\\([^\)]+\\))\\(.*\\)" item)
+ item
+ (if (setq file
(Info-current-filename-sans-extension))
+ (format "(%s)%s" file item)
+ item))))))
"Vector of forms for each interactive command character code.")
(defvar hargs:string-to-complete nil
diff --git a/hbut.el b/hbut.el
index 2f26608232..20311e50d9 100644
--- a/hbut.el
+++ b/hbut.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 18-Sep-91 at 02:57:09
-;; Last-Mod: 15-Jul-23 at 23:22:28 by Bob Weiner
+;; Last-Mod: 7-Aug-23 at 22:31:45 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -1648,7 +1648,8 @@ attribute unless the button text is delimited.
Any implicit button name must contain at least two characters,
excluding delimiters, not just one."
- (let* ((opoint (point))
+ (interactive)
+ (let* ((opoint (point-marker))
(name-start-end (ibut:label-p t nil nil t t))
(name (nth 0 name-start-end))
(name-end (nth 2 name-start-end))
@@ -1705,8 +1706,12 @@ excluding delimiters, not just one."
(hattr:set 'hbut:current 'name name))
(when lbl-start
+ (when (called-interactively-p 'any)
+ (let (help-window-select)
+ (hbut:report)))
t))
- (goto-char opoint))))
+ (goto-char opoint)
+ (setq opoint nil))))
(cl-defun ibut:create (&optional &key but-sym name lbl-key lbl-start lbl-end
loc dir categ actype args action)
@@ -1764,7 +1769,7 @@ Store new button attributes in the symbol,
\\='hbut:current."
(>= text-end (point)))
;; Move to text of ibut before trying to activate it
;; (may be on name)
- (goto-char text-start))
+ (goto-char (+ text-start 2)))
(setq ibtype-point (point))
(while (and (not is-type) types)
(setq itype (car types))
diff --git a/hmouse-key.el b/hmouse-key.el
index 470afbb78d..d090b6d9e0 100644
--- a/hmouse-key.el
+++ b/hmouse-key.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 30-May-94 at 00:11:57
-;; Last-Mod: 21-May-23 at 10:17:38 by Bob Weiner
+;; Last-Mod: 6-Aug-23 at 12:31:42 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -127,6 +127,7 @@ mouse key the Paste Key instead of the Action Key."
"Reload the contexts and actions associated with the Smart Keys.
Use after any programmatic change is made."
(interactive)
+ (load "hui-mini")
(hkey-initialize)
(makunbound 'hkey-alist)
(makunbound 'hmouse-alist)
diff --git a/hui-mini.el b/hui-mini.el
index 2b06bbba25..5a26485b95 100644
--- a/hui-mini.el
+++ b/hui-mini.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 15-Oct-91 at 20:13:17
-;; Last-Mod: 1-Jul-23 at 10:57:39 by Bob Weiner
+;; Last-Mod: 6-Aug-23 at 14:13:50 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -435,7 +435,6 @@ documentation, not the full text."
(string-match "^Hy[.0-9]*[a-zA-Z0-9]*>$" (caar menu-alist)))
;; RET pressed on Hyperbole top-level menu prefix, reload
;; Smart Key handlers and minibuffer menus to reflect any updates.
- (load "hui-mini")
(hmouse-update-smart-keys)
(hyperbole-minibuffer-menu)
(sit-for 2)
diff --git a/hui-mouse.el b/hui-mouse.el
index c9448be23d..d2237ebe4d 100644
--- a/hui-mouse.el
+++ b/hui-mouse.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 04-Feb-89
-;; Last-Mod: 23-Jul-23 at 10:03:27 by Bob Weiner
+;; Last-Mod: 6-Aug-23 at 16:34:18 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -203,13 +203,6 @@ Its default value is `smart-scroll-down'. To disable it,
set it to
(memq company-active-map (current-minor-mode-maps)))
. ((smart-company-to-definition) . (smart-company-help)))
;;
- ;; Handle any Org mode-specific contexts but give priority to Hyperbole
- ;; buttons prior to cycling Org headlines
- ((and (not (hyperb:stack-frame '(smart-org)))
- (let ((hrule:action #'actype:identity))
- (smart-org)))
- . ((smart-org) . (smart-org)))
- ;;
;; Treemacs hierarchical file manager
((eq major-mode 'treemacs-mode)
. ((smart-treemacs) . (smart-treemacs)))
@@ -250,6 +243,13 @@ 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")))))
;;
+ ;; Handle any Org mode-specific contexts but give priority to Hyperbole
+ ;; buttons prior to cycling Org headlines
+ ((and (not (hyperb:stack-frame '(smart-org)))
+ (let ((hrule:action #'actype:identity))
+ (smart-org)))
+ . ((smart-org) . (smart-org)))
+ ;;
;; The ID-edit package supports rapid killing, copying, yanking and
;; display management. It is available only as a part of InfoDock.
;; It is not included with Hyperbole.
diff --git a/hyperbole.el b/hyperbole.el
index 6746bcfc13..fa2fd679cc 100644
--- a/hyperbole.el
+++ b/hyperbole.el
@@ -7,7 +7,7 @@
;; Author: Bob Weiner
;; Maintainer: Bob Weiner <rsw@gnu.org>, Mats Lidell <matsl@gnu.org>
;; Created: 06-Oct-92 at 11:52:51
-;; Last-Mod: 31-Jul-23 at 23:47:17 by Bob Weiner
+;; Last-Mod: 6-Aug-23 at 20:10:00 by Bob Weiner
;; Released: 03-Dec-22
;; Version: 8.0.1pre
;; Keywords: comm, convenience, files, frames, hypermedia, languages,
mail, matching, mouse, multimedia, outlines, tools, wp
@@ -563,13 +563,6 @@ frame, those functions by default still return the prior
frame."
;; Initialize after other key bindings are loaded at startup.
(add-hook 'after-init-hook #'hyperb:init t))
-;; !! FIXME: This next expression activates Hyperbole for compatibility
-;; with prior releases where (require 'hyperbole) was enough to
-;; activate its key bindings. However, loading a file should not
-;; change Emacs's behavior, so after educating users to add this
-;; next line to their Emacs initializations, it should be removed.
-(hyperbole-mode 1)
-
(makunbound 'hyperbole-loading)
;; Autoload this form so that when `package.el' activates Hyperbole's autoloads
diff --git a/kotl/kfill.el b/kotl/kfill.el
index 76f5290c8c..e84f0be71a 100644
--- a/kotl/kfill.el
+++ b/kotl/kfill.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 23-Jan-94
-;; Last-Mod: 30-Jul-23 at 20:32:16 by Bob Weiner
+;; Last-Mod: 6-Aug-23 at 09:51:20 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -202,33 +202,36 @@ then adds the fill prefix at the beginning of each line."
(save-excursion
(end-of-line)
;; Backward to para begin
- (re-search-backward (concat "\\`\\|" paragraph-separate))
- (kfill:forward-line 1)
- (let* ((region-start (point))
- (filladapt-mode
- (if prior-fill-prefix
- ;; filladapt-mode must be disabled for this command or it
- ;; will override the removal of prior-fill-prefix.
- nil
- (or (if (boundp 'filladapt-mode) filladapt-mode)
- adaptive-fill-mode)))
- (adaptive-fill-mode filladapt-mode)
- from)
- (kfill:forward-line -1)
- (setq from (point))
- (forward-paragraph)
- ;; Forward to real paragraph end
- (re-search-forward (concat "\\'\\|" paragraph-separate))
- (or (= (point) (point-max)) (beginning-of-line))
- (or leave-prefix
- ;; Remove any leading occurrences of `prior-fill-prefix'.
- (kfill:replace-string prior-fill-prefix "" nil region-start (point)))
- (or (and fill-paragraph-function
- (let ((function fill-paragraph-function)
- fill-paragraph-function)
- (goto-char region-start)
- (funcall function justify-flag)))
- (fill-region-as-paragraph from (point) justify-flag)))))
+ (when (re-search-backward (concat "\\`\\|" paragraph-separate) nil t)
+ (kfill:forward-line 1)
+ (let* ((region-start (point))
+ (filladapt-mode
+ (if prior-fill-prefix
+ ;; filladapt-mode must be disabled for this command or it
+ ;; will override the removal of prior-fill-prefix.
+ nil
+ (or (when (boundp 'filladapt-mode)
+ filladapt-mode)
+ adaptive-fill-mode)))
+ (adaptive-fill-mode filladapt-mode)
+ from)
+ (kfill:forward-line -1)
+ (setq from (point))
+ (forward-paragraph)
+ ;; Forward to real paragraph end
+ (when (re-search-forward (concat "\\'\\|" paragraph-separate) nil t)
+ (unless (= (point) (point-max))
+ (beginning-of-line))
+ (unless leave-prefix
+ ;; Remove any leading occurrences of `prior-fill-prefix'.
+ (kfill:replace-string prior-fill-prefix "" nil region-start
(point)))
+ (or (and fill-paragraph-function
+ (not (eq fill-paragraph-function t))
+ (let ((func fill-paragraph-function)
+ fill-paragraph-function)
+ (goto-char region-start)
+ (funcall func justify-flag)))
+ (fill-region-as-paragraph from (point) justify-flag)))))))
(defun kfill:hanging-list (paragraph)
(let (prefix match beg end)
diff --git a/kotl/klink.el b/kotl/klink.el
index a4371afd97..6f9826c69f 100644
--- a/kotl/klink.el
+++ b/kotl/klink.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 15-Nov-93 at 12:15:16
-;; Last-Mod: 17-Jun-23 at 16:50:34 by Bob Weiner
+;; Last-Mod: 7-Aug-23 at 22:29:59 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -107,13 +107,12 @@ return an absolute klink string. Klink returned is of
the form:
REFERENCE should be a cell-ref or a string containing \"filename, cell-ref\".
See documentation for `kcell:ref-to-id' for valid cell-ref formats."
(interactive
- ;; Don't change the name or delete default-dir used here. It is referenced
- ;; in "hargs.el" for argument getting.
- (let ((default-dir default-directory))
- (barf-if-buffer-read-only)
- (save-excursion
- (hargs:iform-read
- (list 'interactive "*+LInsert link to <[file,] cell-id [|vspecs]>:
")))))
+ (barf-if-buffer-read-only)
+ ;; This `default-directory' setting is referenced in "hargs.el" for
argument getting.
+ (hattr:set 'hbut:current 'dir default-directory)
+ (save-excursion
+ (hargs:iform-read
+ '(interactive "*+LInsert link to <[file,] cell-id [|vspecs]>: "))))
(barf-if-buffer-read-only)
;; Reference generally is a string. It may be a list as a string, e.g.
;; "(\"file\" \"cell\")", in which case, we remove the unneeded internal
@@ -121,8 +120,9 @@ See documentation for `kcell:ref-to-id' for valid cell-ref
formats."
(and (stringp reference) (> (length reference) 0)
(eq (aref reference 0) ?\()
(setq reference (replace-regexp-in-string "\\\"" "" reference nil t)))
- (let ((default-dir default-directory)
- file-ref cell-ref)
+ ;; This `default-directory' setting is referenced in "hargs.el" for getting
arguments.
+ (hattr:set 'hbut:current 'dir default-directory)
+ (let (file-ref cell-ref)
(setq reference (klink:parse reference)
file-ref (car reference)
cell-ref (nth 1 reference))
diff --git a/test/hargs-tests.el b/test/hargs-tests.el
index 8f86165ed9..8f74d689cb 100644
--- a/test/hargs-tests.el
+++ b/test/hargs-tests.el
@@ -44,9 +44,7 @@
(ert-deftest hargs-get-verify-extension-characters-+K ()
"Verify hyperbole extension character +K is indentified."
- (cl-letf (((symbol-function 'hargs:read-match) (lambda (prompt a &optional b
c d e) "xyz"))
- ((symbol-function 'kview:map-tree) (lambda (a b c d) nil))
- ((symbol-function 'kcell-view:visible-label) (lambda () nil)))
+ (cl-letf (((symbol-function 'hargs:read) (lambda (prompt &optional a b c d)
"xyz")))
(should (string= (hargs:get "+K: ") "xyz"))))
;; This file can't be byte-compiled without `with-simulated-input' which
diff --git a/test/smart-org-tests.el b/test/smart-org-tests.el
index 9f1c6c2601..7b3e8ed0d7 100644
--- a/test/smart-org-tests.el
+++ b/test/smart-org-tests.el
@@ -71,7 +71,7 @@
(let ((hsys-org-enable-smart-keys 'buttons))
(org-mode)
(insert "/tmp")
- (goto-char 1)
+ (goto-char 2)
(hy-test-helpers:hypb-function-should-call-hpath:find 'action-key
"/tmp"))))
;; Org Link