emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: "Victor A. Stoichita" <victor@svictor.net>, emacs-orgmode@gnu.org
Subject: Re: strange behavior of @ in tag searches
Date: Thu, 24 Dec 2020 10:56:09 +0800	[thread overview]
Message-ID: <87y2hnzzcm.fsf@localhost> (raw)
In-Reply-To: <87r1ngizs9.fsf@svictor.net>

"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


  reply	other threads:[~2020-12-24  2:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-20 22:52 strange behavior of @ in tag searches Victor A. Stoichita
2020-12-20 23:05 ` Victor A. Stoichita
2020-12-21  3:38   ` Ihor Radchenko
2020-12-22 22:18     ` Kyle Meyer
2020-12-22 23:34       ` Ihor Radchenko
2020-12-23 10:26         ` Victor A. Stoichita
2020-12-24  2:56           ` Ihor Radchenko [this message]
2020-12-24  8:21             ` Victor A. Stoichita

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y2hnzzcm.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=victor@svictor.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).