The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [syntax-table]

is an Emacs Lisp data structure in which each character's syntactic role is defined. Other Emacs facilities, such as font lock, navigation, parsing, etc., scan these syntax tables to determine where words, symbols, and other syntactic constructs begin and end. Syntax tables are unique to every major mode. They are customizable and even overridable with text properties.

Filter by
Sorted by
Tagged with
6
votes
2answers
2k views

How to change comment character from # (hash) to % (percent sign) for Octave major mode

By default, comment-region inserts # for comments in Octave major mode: # foo I want to modify the behavior so that it inserts the percent sign % foo I used the following (setq octave-mode-hook ...
0
votes
1answer
382 views

Word delimiters in standard syntax table

I'm trying to configure other programs to emulate Emacs. I know Emacs' word delimiters are: User configurable Mode dependent But I'd still like to know what the default word boundary characters ...
33
votes
5answers
7k views

How to treat underscore as part of the word?

I use Emacs + evil mode. When I position the cursor on e (in normal state) in a chunk of text such as abc_def_ghi, ciw (change inner word) changes only the def part of the string, while Vim would ...
1
vote
0answers
90 views

How does forward-list work for “<>” in c++-mode?

I am trying to understand how forward-list matches template delimiters <> in c++-mode. forward-list in lisp.el calls scan-lists with the appropriate arguments. The documentation for scan-lists ...
3
votes
4answers
415 views

Sorting words with hyphens (e.g. in a Lisp mode)

SortWords in the EmacsWiki suggests this function as a way to sort words: (defun sort-words (reverse beg end) "Sort words in region alphabetically, in REVERSE if negative. When prefixed with ...
12
votes
3answers
787 views

How can I detect if the current character is a comment character for that major mode?

I am working on this little function that pulls up the next line to the current line. I want to add a functionality so that if the current line is a line comment and the next line is also a line ...
6
votes
1answer
327 views

Parsing parentheses: smie vs syntax table

I am maintaining a mode for a programming language with... let's say "annoying" syntax constructs. For example, the angle brackets (no idea if it is the correct word) < and > are parentheses. ...