In some of my query-replecements I need to have only alphabetic characters as word constituents in a local defined syntax-table
. My approach is this:
(with-syntax-table
(let ((my-syntax-table (make-syntax-table latex-mode-syntax-table)))
(modify-syntax-entry '(48 . 57) "_" my-syntax-table)
;; "_" = symbol constituent
;; '(48 . 57) = 0, 1, 2 ... 9
(set-syntax-table my-syntax-table)
(perform-replace "\\w+" "word" t t nil 1 nil (point-min) (point-max))
))
How can find which other characters are word-constituents
in latex-mode-syntax-table
?
EDIT. I wrote this loop:
(setq CHAR 0)
(while (<= CHAR 255)
(when (string-match-p "119" (prin1-to-string (char-syntax CHAR)))
(insert (char-to-string CHAR) "\s"))
(setq CHAR (1+ CHAR))
That returns (after setting latex-mode
):
0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z ¥ · À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ø ù ú û ü ý þ ÿ
So I was wondering if there is another way to set only the alphabetic characters instead of unset
the other ones.
(aref latex-mode-syntax-table ?a)
gives(2)
for the lettera
which meansword
constituent. See the doc about syntax table internals.