33; ; Author: Bob Weiner
44; ;
55; ; Orig-Date: 6-Oct-91 at 03:42:38
6- ; ; Last-Mod: 22 -Mar-26 at 01:29:41 by Bob Weiner
6+ ; ; Last-Mod: 28 -Mar-26 at 11:58:58 by Bob Weiner
77; ;
88; ; SPDX-License-Identifier: GPL-3.0-or-later
99; ;
@@ -145,6 +145,18 @@ text will become visible."
145145 (setq buffer-invisibility-spec
146146 (cons element buffer-invisibility-spec))))
147147
148+ ;;;### autoload
149+ (defun hypb:advised-p (advised-function advice-function )
150+ " Return t if ADVISED-FUNCTION is advised with ADVICE-FUNCTION.
151+ Uses the newer \" nadvice\" elisp library, not \" advice\" ."
152+ (let (found)
153+ (when (advice--p (symbol-function advised-function))
154+ (advice-mapc (lambda (advs _props )
155+ (when (eq advs advice-function)
156+ (setq found t )))
157+ advised-function))
158+ found))
159+
148160;;;### autoload
149161(defun hypb:activate-interaction-log-mode ()
150162 " Configure and enable the interaction-log package for use with Hyperbole.
@@ -713,6 +725,8 @@ This will this install the Emacs helm package when needed."
713725 (error " (hypb:hkey-help-file): Non-existent file: \" %s \" "
714726 help-file))))))
715727
728+ (defvar hypb:in-string-and-tick (cons nil 0 ))
729+
716730(defun hypb:in-string-p (&optional max-lines range-flag )
717731 " Return non-nil iff point is within a string and not on the closing quote.
718732
@@ -724,7 +738,8 @@ the positions exclude the delimiters.
724738To prevent searching back to the buffer start and producing slow
725739performance, this limits its count of quotes found prior to point
726740to the beginning of the first line prior to point that contains a
727- non-backslashed quote mark.
741+ non-backslashed quote mark and limits string length to a maximum
742+ of 9000 characters.
728743
729744Quoting conventions recognized are:
730745 double-quotes: \" str\" ;
@@ -733,7 +748,10 @@ Quoting conventions recognized are:
733748 Python triple single-quotes: '''str''';
734749 Python triple double-quotes: \"\"\" str\"\"\" ;
735750 Texinfo open and close quotes: ``str'' ."
751+
736752 (let ((list-of-unformatted-open-close-regexps (eval hypb:in-string-mode-regexps))
753+ ; ; search limit length
754+ (limit 9000 )
737755 list-of-open-close-regexps)
738756 (if (and list-of-unformatted-open-close-regexps
739757 (listp list-of-unformatted-open-close-regexps)
@@ -783,12 +801,12 @@ Quoting conventions recognized are:
783801 (looking-at orig-close-regexp)))
784802 (/= (or (char-before ) 0 ) ?\\ )
785803 (setq open-match-string (match-string 2 )))
786- (while (and (setq possible-delim (search-backward open-match-string nil t ))
804+ (while (and (setq possible-delim (search-backward open-match-string ( max ( point-min ) ( - ( point ) limit)) t ))
787805 (if (= (or (char-before ) 0 ) ?\\ )
788806 (goto-char (1- (point )))
789807 (progn (setq str-start (match-end 0 ))
790808 nil ))))
791- (when (setq possible-delim (re-search-backward open-regexp nil t ))
809+ (when (setq possible-delim (re-search-backward open-regexp ( max ( point-min ) ( - ( point ) limit)) t ))
792810 (setq open-match-string (match-string 2 ))
793811 (setq str-start (match-end 2 ))))
794812
@@ -823,7 +841,10 @@ Quoting conventions recognized are:
823841 (regexp-quote texinfo-close-quote))
824842 start (point ))))
825843
826- (progn (while (and (setq possible-delim (search-forward texinfo-close-quote nil t ))
844+ (progn (while (and (setq possible-delim (search-forward
845+ texinfo-close-quote
846+ (min (point-max ) (+ (point ) limit))
847+ t ))
827848 (= (or (char-before (match-beginning 0 )) 0 ) ?\\ )))
828849 possible-delim)
829850 (setq str-end (match-beginning 0 )
@@ -839,7 +860,10 @@ Quoting conventions recognized are:
839860 ; ; closing delimiter char to ensure it is not
840861 ; ; backslash quoted and so the right delimiter is matched.
841862 ; ; Find the matching closing delimiter
842- (progn (while (and (setq possible-delim (search-forward open-match-string nil t ))
863+ (progn (while (and (setq possible-delim
864+ (search-forward open-match-string
865+ (min (point-max ) (+ (point ) limit))
866+ t ))
843867 (= (or (char-before (match-beginning 0 )) 0 ) ?\\ )))
844868 possible-delim)
845869 (setq str-end (match-beginning 0 ))
@@ -1148,6 +1172,13 @@ descriptors."
11481172 (setq seq (seq-drop seq size)))
11491173 (nreverse result)))
11501174
1175+ ;;;### autoload
1176+ (defun hypb:sqlite-p ()
1177+ " Return non-nil if Emacs has available SQLite support."
1178+ (if (fboundp 'sqlite-available-p )
1179+ (sqlite-available-p)
1180+ (fboundp 'sqlite-open )))
1181+
11511182(defun hypb:straight-package-plist (pkg-string )
11521183 " Return package info for a straight.el built package with name PKG-STRING.
11531184The package info is a property list of package-name,
0 commit comments