[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Missing syntax-table functionality

From: Alan Mackenzie
Subject: Missing syntax-table functionality
Date: 2 Jan 2002 00:55:24 +0100
Date: Tue, 1 Jan 2002 23:33:45 +0000
User-agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686))

Status, Emacs 21.1:

It would be nice to have a standard function which would report the
syntax of a character within a buffer.  The existing function char-syntax
is no longer adequate, since it cannot take account of any syntax-table
text property which may have been set at a buffer position.

Such a function would be trivial to write, and has probably already been
done so several times by different people.  Unless anybody has any better
ideas, I would suggest the following definition:

(defun bufpos-syntax (bufpos &optional buffer)
  "Return the syntax of the character at position BUFPOS in BUFFER
\(default: the current buffer \).
This may be due to a setting of the syntax-table property on the
character or be read directly from the current syntax table."

Alan Mackenzie (Munich, Germany)
Email: address@hidden; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").

reply via email to

[Prev in Thread] Current Thread [Next in Thread]