Skip to content
Merged
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
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2022-09-19 Mats Lidell <matsl@gnu.org>

* hypb.el (hypb:replace-match-string): Remove unused function.

* hact.el: Use byte-code-function-p.

2022-09-14 Mats Lidell <matsl@gnu.org>

* hywconfig.el:
Expand Down
6 changes: 3 additions & 3 deletions hact.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 18-Sep-91 at 02:57:09
;; Last-Mod: 29-Aug-22 at 00:21:24 by Bob Weiner
;; Last-Mod: 18-Sep-22 at 22:23:21 by Mats Lidell
;;
;; Copyright (C) 1991-2021 Free Software Foundation, Inc.
;; Copyright (C) 1991-2022 Free Software Foundation, Inc.
;; See the "HY-COPY" file for license information.
;;
;; This file is part of GNU Hyperbole.
Expand Down Expand Up @@ -383,7 +383,7 @@ performing ACTION."
(let ((hist-elt (hhist:element)))
(run-hooks 'action-act-hook)
(prog1 (or (if (or (symbolp action) (listp action)
(hypb:emacs-byte-code-p action)
(byte-code-function-p action)
(subrp action)
(and (stringp action) (not (integerp action))
(setq action (key-binding action))))
Expand Down
32 changes: 1 addition & 31 deletions hypb.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 6-Oct-91 at 03:42:38
;; Last-Mod: 29-Aug-22 at 00:30:34 by Bob Weiner
;; Last-Mod: 18-Sep-22 at 22:39:36 by Mats Lidell
;;
;; Copyright (C) 1991-2022 Free Software Foundation, Inc.
;; See the "HY-COPY" file for license information.
Expand Down Expand Up @@ -573,8 +573,6 @@ WINDOW pixelwise."
((symbolp object)
(get object 'hyperbole))))

(make-obsolete 'hypb:replace-match-string 'replace-regexp-in-string "8.0.1")

(defun hypb:readable-directories (&rest dirs)
"Flatten rest of DIRS and return or error if any of DIRS are unreadable."
(setq dirs (flatten-list dirs))
Expand All @@ -584,34 +582,6 @@ WINDOW pixelwise."
(string-join unreadable-dirs "\n"))))
dirs)

(defun hypb:replace-match-string (regexp str new &optional literal fixedcase)
"Replace all matches for REGEXP in STR with NEW string and return the result.
If NEW is nil, return STR unchanged.

Optional LITERAL non-nil means do a literal replacement.
Otherwise treat \\ in NEW string as special:
\\& means substitute original matched text,
\\N means substitute match for \(...\) number N,
\\\\ means insert one \\.

If optional fifth arg FIXEDCASE is non-nil, do not alter the case of
the replacement text. Otherwise, maybe capitalize the whole text, or
maybe just word initials, based on the replaced text. If the replaced
text has only capital letters and has at least one multiletter word,
convert NEW to all caps. Otherwise if all words are capitalized
in the replaced text, capitalize each word in NEW.

NEW may instead be a function of one argument (the string to replace in)
that returns a replacement string."
(if (null new)
str
(unless (stringp str)
(error "(hypb:replace-match-string): 2nd arg must be a string: %s" str))
(unless (or (stringp new) (functionp new))
(error "(hypb:replace-match-string): 3rd arg must be a string or function: %s"
new))
(replace-regexp-in-string regexp new str fixedcase literal)))

;;;###autoload
(defun hypb:require-package (package-name)
"Prompt user to install, if necessary, and require the Emacs PACKAGE-NAME.
Expand Down