[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: strange behavior of @ in tag searches
From: |
Ihor Radchenko |
Subject: |
Re: strange behavior of @ in tag searches |
Date: |
Thu, 24 Dec 2020 10:56:09 +0800 |
"Victor A. Stoichita" <victor@svictor.net> writes:
> I modify the syntax table for text modes to handle the meaning of
> some characters in French. In fact, te actual modification doesn’t
> seem to matter. The following is enough to trigger the described
> behavior:
>
> --8<---------------cut here---------------start------------->8---
> (add-hook 'text-mode-hook (lambda ()
> (set-syntax-table (make-syntax-table))))
> --8<---------------cut here---------------end--------------->8---
That basically clears _all_ syntax settings in org-mode. It would
interfere with pretty much any major mode that modifies syntax tables...
A better way to modify syntax table is using modify-syntax-entry or you
need to make sure that your code inherits org-mode-syntax-table instead
of creating an empty table.
I just searched through org code and the following syntax table elements
are being used by org:
-*- mode: helm-grep -*-
AG Results for `modify-syntax-entry':
org-element.el:380: (modify-syntax-entry ?\( "()" table)
org-element.el:381: (modify-syntax-entry ?\) ")(" table)
org-element.el:383: (modify-syntax-entry char " " table)))
org-element.el:389: (modify-syntax-entry ?\[ "(]" table)
org-element.el:390: (modify-syntax-entry ?\] ")[" table)
org-element.el:392: (modify-syntax-entry char " " table)))
org-element.el:398: (modify-syntax-entry ?\{ "(}" table)
org-element.el:399: (modify-syntax-entry ?\} "){" table)
org-element.el:401: (modify-syntax-entry char " " table)))
ox.el:6870: (modify-syntax-entry ?\[ "w"))
org.el:4719: (modify-syntax-entry ?\" "\"")
org.el:4720: (modify-syntax-entry ?\\ "_")
org.el:4721: (modify-syntax-entry ?~ "_")
org.el:4722: (modify-syntax-entry ?< "(>")
org.el:4723: (modify-syntax-entry ?> ")<")
org.el:4838: (modify-syntax-entry (string-to-char (car c)) "w p" st))))
org.el:10927: (modify-syntax-entry ?@ "w" tag-syntax)
org.el:10928: (modify-syntax-entry ?_ "w" tag-syntax)
The last two refer to tag groups.
> For now, I changed my tags to not use @ any more.
> Are there other aspects that I might miss if I alter the syntax
> table on ’text-mode-hook?
I hope the above helps.
Best,
Ihor