Skip to content

Commit 193e1b0

Browse files
committed
Merge branch 'master' into rsw
2 parents 1d2f6cd + 7decf14 commit 193e1b0

File tree

9 files changed

+720
-47
lines changed

9 files changed

+720
-47
lines changed

ChangeLog

+39
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2023-10-30 Mats Lidell <[email protected]>
2+
3+
* hversion.el (hyperb:mouse-buttons):
4+
hpath.el (hpath:get-external-display-alist): Add mac as possible
5+
window-system on Mac OS.
6+
17
2023-10-29 Bob Weiner <[email protected]>
28

39
* hpath.el (hpath:find):
@@ -57,6 +63,30 @@
5763
kotl/kotl-mode.el (kotl-mode:goto-cell-ref): Add for use in kotl anchored
5864
pathname refs and in 'link-to-kcell' actype.
5965

66+
2023-10-25 Mats Lidell <[email protected]>
67+
68+
* test/hui-tests.el (hui--ibut-link-directly-to-file)
69+
(hui--ibut-link-directly-to-dired)
70+
(hui--ibut-link-directly-with-label): Test cases for
71+
ibut-link-directly
72+
73+
2023-10-22 Mats Lidell <[email protected]>
74+
75+
* hui-select.el (hui-java-defun-prompt-regexp): Add prompt regexp as
76+
separate defconst. Update provided by Alan Mackenzie. Thanks.
77+
(hui-select-initialize): Use new java regexp.
78+
79+
* test/hui-tests.el (hui-gbut-number-of-gebuts-from-mail-mode): Remove
80+
expected to fail.
81+
82+
* hbut.el (gbut:ebut-key-list): Use hbdata:to-entry-in-file for global
83+
button file data.
84+
85+
* hbdata.el (hbdata:is-but-data-stored-in-buffer)
86+
(hbdata:to-entry-in-buffer, hbdata:to-entry-in-file): Refactor into
87+
three methods to separate out button data stored in a file.
88+
(hbdata:to-entry-buf): Use new methods.
89+
6090
2023-10-22 Bob Weiner <[email protected]>
6191

6292
* hbut.el (gbut:save-buffer): Add function to use after global button file is
@@ -79,6 +109,15 @@
79109
rather than using its elisp backend. Remove that code.
80110
(tags-fix): Remove optional load of this very old file.
81111

112+
2023-10-11 Mats Lidell <[email protected]>
113+
114+
* test/hui-tests.el (hui-gbut-number-of-gbuts-with-no-buttons)
115+
(hui-gbut-number-of-gibuts-when-one-button)
116+
(hui-gbut-number-of-gebuts-when-one-button)
117+
(hui-gbut-number-of-gibuts-from-mail-mode)
118+
(hui-gbut-number-of-gebuts-from-mail-mode): Verify number of global
119+
ibuts and ebuts.
120+
82121
2023-10-09 Mats Lidell <[email protected]>
83122

84123
* test/kotl-mode-tests.el (kotl-mode-kill-contents)

hbdata.el

+57-38
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;; Author: Bob Weiner
44
;;
55
;; Orig-Date: 2-Apr-91
6-
;; Last-Mod: 3-Oct-23 at 22:48:03 by Mats Lidell
6+
;; Last-Mod: 22-Oct-23 at 14:42:47 by Mats Lidell
77
;;
88
;; SPDX-License-Identifier: GPL-3.0-or-later
99
;;
@@ -443,7 +443,31 @@ Return value of evaluation when a matching entry is found or nil."
443443
(when end-func (funcall end-func)))))
444444
rtn))
445445

446-
(defun hbdata:to-entry-buf (key-src &optional directory create)
446+
(defun hbdata:is-but-data-stored-in-buffer (key-src)
447+
"True if we store but-data in the buffer rather than in a file."
448+
;; Drafts of mail messages now have a buffer-file-name since they
449+
;; are temporarily saved to a file until sent. But but-data still
450+
;; should be stored in the mail buffer itself, so check explicitly
451+
;; whether is a mail composition buffer in such cases.
452+
(or (hmail:mode-is-p)
453+
(and (get-buffer key-src)
454+
(set-buffer key-src)
455+
(not buffer-file-name))))
456+
457+
(defun hbdata:to-entry-in-buffer (create)
458+
"Move point to end of line in but data in current buffer.
459+
Note: Button buffer has no file attached. With optional CREATE,
460+
if no such line exists, insert a new entry at the beginning of
461+
the hbdata (which is created if necessary). Return t."
462+
(if (hmail:hbdata-to-p) ;; Might change the buffer
463+
(setq buffer-read-only nil)
464+
(when create
465+
(setq buffer-read-only nil)
466+
(insert "\n" hmail:hbdata-sep "\n")))
467+
(backward-char 1)
468+
t)
469+
470+
(defun hbdata:to-entry-in-file (key-src &optional directory create)
447471
"Move point to end of line in but data buffer matching KEY-SRC.
448472
Use hbdata file in KEY-SRC's directory, or optional DIRECTORY or if nil, use
449473
`default-directory'.
@@ -452,44 +476,39 @@ beginning of the hbdata file (which is created if necessary).
452476
Return non-nil if KEY-SRC is found or created, else nil."
453477
(let (rtn
454478
ln-dir)
455-
;; Drafts of mail messages now have a buffer-file-name since they
456-
;; are temporarily saved to a file until sent. But but-data still
457-
;; should be stored in the mail buffer itself, so check explicitly
458-
;; whether is a mail composition buffer in such cases.
459-
(if (or (hmail:mode-is-p)
460-
(and (get-buffer key-src)
461-
(set-buffer key-src)
462-
(not buffer-file-name)))
463-
;; Button buffer has no file attached
464-
(progn (if (hmail:hbdata-to-p) ;; Might change the buffer
465-
(setq buffer-read-only nil)
466-
(when create
467-
(setq buffer-read-only nil)
468-
(insert "\n" hmail:hbdata-sep "\n")))
469-
(backward-char 1)
470-
(setq rtn t))
471-
(setq directory (or (file-name-directory key-src) directory))
472-
(let ((ln-file) (link-p key-src))
473-
(while (setq link-p (file-symlink-p link-p))
474-
(setq ln-file link-p))
475-
(if ln-file
476-
(setq ln-dir (file-name-directory ln-file)
477-
key-src (file-name-nondirectory ln-file))
478-
(setq key-src (file-name-nondirectory key-src))))
479-
(when (or (hbdata:to-hbdata-buffer directory create)
480-
(and ln-dir (hbdata:to-hbdata-buffer ln-dir nil)
481-
(setq create nil
482-
directory ln-dir)))
483-
(goto-char 1)
484-
(cond ((search-forward (concat "\^L\n\"" key-src "\"")
485-
nil t)
486-
(setq rtn t))
487-
(create
488-
(setq rtn t)
489-
(insert "\^L\n\"" key-src "\"\n")
490-
(backward-char 1)))))
479+
(setq directory (or (file-name-directory key-src) directory))
480+
(let ((ln-file) (link-p key-src))
481+
(while (setq link-p (file-symlink-p link-p))
482+
(setq ln-file link-p))
483+
(if ln-file
484+
(setq ln-dir (file-name-directory ln-file)
485+
key-src (file-name-nondirectory ln-file))
486+
(setq key-src (file-name-nondirectory key-src))))
487+
(when (or (hbdata:to-hbdata-buffer directory create)
488+
(and ln-dir (hbdata:to-hbdata-buffer ln-dir nil)
489+
(setq create nil
490+
directory ln-dir)))
491+
(goto-char 1)
492+
(cond ((search-forward (concat "\^L\n\"" key-src "\"")
493+
nil t)
494+
(setq rtn t))
495+
(create
496+
(setq rtn t)
497+
(insert "\^L\n\"" key-src "\"\n")
498+
(backward-char 1))))
491499
rtn))
492500

501+
(defun hbdata:to-entry-buf (key-src &optional directory create)
502+
"Move point to end of line in but data buffer matching KEY-SRC.
503+
Use hbdata file in KEY-SRC's directory, or optional DIRECTORY or if nil, use
504+
`default-directory'.
505+
With optional CREATE, if no such line exists, insert a new file entry at the
506+
beginning of the hbdata file (which is created if necessary).
507+
Return non-nil if KEY-SRC is found or created, else nil."
508+
(if (hbdata:is-but-data-stored-in-buffer key-src)
509+
(hbdata:to-entry-in-buffer create)
510+
(hbdata:to-entry-in-file key-src directory create)))
511+
493512
(defun hbdata:to-hbdata-buffer (dir &optional create)
494513
"Read in the file containing DIR's button data, if any, and return buffer.
495514
If it does not exist and optional CREATE is non-nil, create a new

hbut.el

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;; Author: Bob Weiner
44
;;
55
;; Orig-Date: 18-Sep-91 at 02:57:09
6-
;; Last-Mod: 22-Oct-23 at 08:42:11 by Bob Weiner
6+
;; Last-Mod: 30-Oct-23 at 22:13:56 by Bob Weiner
77
;;
88
;; SPDX-License-Identifier: GPL-3.0-or-later
99
;;
@@ -838,7 +838,7 @@ Return the symbol for the button when found, else nil."
838838
"Return a list of explicit button label keys from the global button file."
839839
(save-excursion
840840
(save-restriction
841-
(when (hbdata:to-entry-buf (gbut:file))
841+
(when (hbdata:to-entry-in-file (gbut:file))
842842
(let (gbuts)
843843
(save-restriction
844844
(narrow-to-region (point) (if (search-forward "\f" nil t)

hpath.el

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;; Author: Bob Weiner
44
;;
55
;; Orig-Date: 1-Nov-91 at 00:44:23
6-
;; Last-Mod: 29-Oct-23 at 23:45:02 by Bob Weiner
6+
;; Last-Mod: 30-Oct-23 at 22:13:11 by Bob Weiner
77
;;
88
;; SPDX-License-Identifier: GPL-3.0-or-later
99
;;
@@ -1677,7 +1677,7 @@ programs, such as a pdf reader. The cdr of each element may be:
16771677
or a function of one filename argument.
16781678
See also `hpath:internal-display-alist' for internal,
16791679
`window-system' independent display settings."
1680-
(cond ((memq window-system '(dps ns))
1680+
(cond ((memq window-system '(mac dps ns))
16811681
hpath:external-display-alist-macos)
16821682
(hyperb:microsoft-os-p
16831683
hpath:external-display-alist-mswindows)

hui-select.el

+32-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;; Author: Bob Weiner
44
;;
55
;; Orig-Date: 19-Oct-96 at 02:25:27
6-
;; Last-Mod: 3-Oct-23 at 22:59:57 by Mats Lidell
6+
;; Last-Mod: 22-Oct-23 at 17:26:49 by Mats Lidell
77
;;
88
;; SPDX-License-Identifier: GPL-3.0-or-later
99
;;
@@ -203,6 +203,36 @@ Used to include a final line when marking indented code.")
203203
:type 'boolean
204204
:group 'hyperbole-commands)
205205

206+
(defconst hui-java-defun-prompt-regexp
207+
(let* ((space* "[ \t\n\r\f]*")
208+
(space+ "[ \t\n\r\f]+")
209+
(modifier*
210+
(concat "\\(?:"
211+
(regexp-opt '("abstract" "const" "default" "final" "native"
212+
"private" "protected" "public" "static"
213+
"strictfp" "synchronized" "threadsafe"
214+
"transient" "volatile")
215+
'words) ; Compatible with XEmacs
216+
space+ "\\)*"))
217+
(ids-with-dots "[_$a-zA-Z][_$.a-zA-Z0-9]*")
218+
(ids-with-dot-\[\] "[[_$a-zA-Z][][_$.a-zA-Z0-9]*")
219+
(paren-exp "([^);{}]*)")
220+
(generic-exp "<[^(){};]*>"))
221+
(concat "^[ \t]*"
222+
modifier*
223+
"\\(?:" generic-exp space* "\\)?"
224+
ids-with-dot-\[\] space+ ; first part of type
225+
"\\(?:" ids-with-dot-\[\] space+ "\\)?" ; optional second part of type.
226+
"\\(?:[_a-zA-Z][^][ \t:;.,{}()=<>]*" ; defun name
227+
"\\|" ids-with-dots
228+
"\\)" space*
229+
paren-exp
230+
"\\(?:" space* "]\\)*" ; What's this for?
231+
"\\(?:" space* "\\<throws\\>" space* ids-with-dot-\[\]
232+
"\\(?:," space* ids-with-dot-\[\] "\\)*"
233+
"\\)?"
234+
space*)))
235+
206236
(defvar hui-select-previous nil)
207237
(defvar hui-select-prior-point nil)
208238
(defvar hui-select-prior-buffer nil)
@@ -362,8 +392,7 @@ Also, add language-specific syntax setups to aid in thing selection."
362392
;; opening or closing brace. This is all necessary since some
363393
;; programmers don't put their function braces in the first column.
364394
(var:add-and-run-hook 'java-mode-hook (lambda ()
365-
(setq defun-prompt-regexp
366-
"^[ \t]*\\(\\(\\(public\\|protected\\|private\\|const\\|abstract\\|synchronized\\|final\\|static\\|threadsafe\\|transient\\|native\\|volatile\\)\\s-+\\)*\\(\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*[][_$.a-zA-Z0-9]+\\|[[a-zA-Z]\\)\\s-*\\)\\s-+\\)\\)?\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*\\s-+\\)\\s-*\\)?\\([_a-zA-Z][^][ \t:;.,{}()=]*\\|\\([_$a-zA-Z][_$.a-zA-Z0-9]*\\)\\)\\s-*\\(([^);{}]*)\\)?\\([] \t]*\\)\\(\\s-*\\<throws\\>\\s-*\\(\\([_$a-zA-Z][_$.a-zA-Z0-9]*\\)[, \t\n\r\f]*\\)+\\)?\\s-*")))
395+
(setq defun-prompt-regexp hui-java-defun-prompt-regexp)))
367396
(var:add-and-run-hook 'c++-mode-hook (lambda ()
368397
(setq defun-prompt-regexp
369398
"^[ \t]*\\(template\\s-*<[^>;.{}]+>\\s-*\\)?\\(\\(\\(auto\\|const\\|explicit\\|extern\\s-+\"[^\"]+\"\\|extern\\|friend\\|inline\\|mutable\\|overload\\|register\\|static\\|typedef\\|virtual\\)\\s-+\\)*\\(\\([[<a-zA-Z][]_a-zA-Z0-9]*\\(::[]_a-zA-Z0-9]+\\)?\\s-*<[_<>a-zA-Z0-9 ,]+>\\s-*[*&]*\\|[[<a-zA-Z][]_<>a-zA-Z0-9]*\\(::[[<a-zA-Z][]_<>a-zA-Z0-9]+\\)?\\s-*[*&]*\\)[*& \t\n\r]+\\)\\)?\\(\\(::\\|[[<a-zA-Z][]_a-zA-Z0-9]*\\s-*<[^>;{}]+>\\s-*[*&]*::\\|[[<a-zA-Z][]_~<>a-zA-Z0-9]*\\s-*[*&]*::\\)\\s-*\\)?\\(operator\\s-*[^ \t\n\r:;.,?~{}]+\\(\\s-*\\[\\]\\)?\\|[_~<a-zA-Z][^][ \t:;.,~{}()]*\\|[*&]?\\([_~<a-zA-Z][_a-zA-Z0-9]*\\s-*<[^>;{}]+[ \t\n\r>]*>\\|[_~<a-zA-Z][_~<>a-zA-Z0-9]*\\)\\)\\s-*\\(([^{;]*)\\(\\(\\s-+const\\|\\s-+mutable\\)?\\(\\s-*[=:][^;{]+\\)?\\)?\\)\\s-*")))

hversion.el

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
;; Maintainer: Bob Weiner, Mats Lidell
55
;;
66
;; Orig-Date: 1-Jan-94
7-
;; Last-Mod: 3-Oct-23 at 23:31:30 by Mats Lidell
7+
;; Last-Mod: 30-Oct-23 at 23:49:10 by Mats Lidell
88
;;
99
;; SPDX-License-Identifier: GPL-3.0-or-later
1010
;;
@@ -39,7 +39,7 @@
3939

4040
(defvar hyperb:mouse-buttons
4141
(if (or (and hyperb:microsoft-os-p (not (memq window-system '(w32 w64 x))))
42-
(memq window-system '(ns dps)))
42+
(memq window-system '(mac ns dps)))
4343
2 3)
4444
"Number of live buttons available on the mouse.
4545
Override this if the system-computed default is incorrect for

0 commit comments

Comments
 (0)