comparison lisp/syntax.el @ 4468:a78d697ccd2c

Import and extend GNU's descr-text.el, supporting prefix argument for C-x = 2008-05-25 Aidan Kehoe <kehoea@parhasard.net> * descr-text.el: New. Taken from GNU's GPLV2 version of 2007-02-14, with modifications for XEmacs support and extensions for Unihan.txt support and db/dbm caches. * simple.el (what-cursor-position): Support an optional prefix argument, as does GNU, calling #'describe-char to giving more detail on the character at point, notably from UnicodeData and (in our case, optionally) Unihan.txt. * syntax.el (syntax-after): Make this available for the sake of #'describe-char. * mule/mule-cmds.el (iso-2022-control-alist): Make this available, for the sake of #'encoded-string-description and #'describe-char. * mule/mule-cmds.el (encoded-string-description): Make this available, for the sake of #'describe-char. * unicode.el (unicode-error-default-translation-table): Make this a char table of type generic, not of type char. Makes it possible to have the relevant logic in #'describe-char reasonably clear; also, and this is undocumented, makes it much easier to implement #'frob-unicode-errors-region. I should document this, and revise #'frob-unicode-errors-region.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 25 May 2008 21:11:35 +0200
parents 2f31c7aa4e96
children fd36a980d701
comparison
equal deleted inserted replaced
4467:23ef20edf6ba 4468:a78d697ccd2c
36 36
37 (defun make-syntax-table (&optional oldtable) 37 (defun make-syntax-table (&optional oldtable)
38 "Return a new syntax table. 38 "Return a new syntax table.
39 It inherits all characters from the standard syntax table." 39 It inherits all characters from the standard syntax table."
40 (make-char-table 'syntax)) 40 (make-char-table 'syntax))
41
42 (defun syntax-after (pos)
43 "Return the raw syntax of the char after POS.
44 If POS is outside the buffer's accessible portion, return nil."
45 (unless (or (< pos (point-min)) (>= pos (point-max)))
46 (let ((st (if lookup-syntax-properties
47 (get-char-property pos 'syntax-table))))
48 (char-syntax (char-after pos) (or st (syntax-table))))))
41 49
42 (defun simple-set-syntax-entry (char spec table) 50 (defun simple-set-syntax-entry (char spec table)
43 (put-char-table char spec table)) 51 (put-char-table char spec table))
44 52
45 (defun char-syntax-from-code (code) 53 (defun char-syntax-from-code (code)