Function: hbut:modify-syntax

hbut:modify-syntax is an autoloaded and byte-compiled function defined in hbut.el.

Signature

(hbut:modify-syntax)

Documentation

Make <> and {} behave as syntactic character pairs in major syntax tables.

Modify hbut:syntax-table and help-mode-syntax-table to include <> and {}. Modify text-mode-syntax-table and fundamental-modes syntax table to include {} only. For use with implicit button activations.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hbut.el
;;;###autoload
(defun    hbut:modify-syntax ()
  "Make <> and {} behave as syntactic character pairs in major syntax tables.
Modify `hbut:syntax-table' and `help-mode-syntax-table' to include <> and {}.
Modify `text-mode-syntax-table' and `fundamental-mode's syntax table
to include {} only.  For use with implicit button activations."
  ;; Treat angle brackets and braces as opening and closing delimiters
  ;; for ease of matching.
  (mapc (lambda (syntax-table)
          ;; Treat # as a symbol constituent to support company-mode completion.
          (modify-syntax-entry ?# "_" syntax-table)
          ;; Treat angle brackets as opening and closing delimiters for ease of matching.
	  (modify-syntax-entry ?\< "(>" syntax-table)
	  (modify-syntax-entry ?\> ")<" syntax-table)
	  ;; Treat braces as opening and closing delimiters for ease of matching.
	  (modify-syntax-entry ?\{ "(}" syntax-table)
	  (modify-syntax-entry ?\} "){" syntax-table))
	(list hbut:syntax-table help-mode-syntax-table))
  (mapc (lambda (syntax-table)
	  ;; Treat braces as opening and closing delimiters for ease of matching.
	  (modify-syntax-entry ?\{ "(}" syntax-table)
	  (modify-syntax-entry ?\} "){" syntax-table))
	(list text-mode-syntax-table
	      ;; fundamental-mode syntax table
	      (standard-syntax-table)))
  nil)