unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: npostavs@users.sourceforge.net
To: Eli Zaretskii <eliz@gnu.org>
Cc: 10494@debbugs.gnu.org, aaronecay@gmail.com
Subject: bug#10494: 24.0.92; Syntax table and non-ASCII character interaction
Date: Sat, 13 Aug 2016 14:14:49 -0400	[thread overview]
Message-ID: <87fuq8wn6u.fsf@users.sourceforge.net> (raw)
In-Reply-To: <83shu8d9kb.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 13 Aug 2016 17:31:48 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: npostavs@users.sourceforge.net
>> Cc: 10494@debbugs.gnu.org,  aaronecay@gmail.com
>> Date: Sat, 13 Aug 2016 10:19:34 -0400
>> 
>> >>     (modify-syntax-entry ?’ "w" text-mode-syntax-table)
>> >>     (defconst my-text-char-script-table
>> >>       (let ((table (copy-sequence char-script-table)))
>> >>         (aset table ?’ 'latin)
>> >>         table))
>> >> 
>> >>     (defun my-text-mode-hook ()
>> >>       (set (make-local-variable 'char-script-table)
>> >>            my-text-char-script-table))
>> >>     (add-hook 'text-mode-hook 'my-text-mode-hook)
>> >
>> > Are you sure nothing in text-mode will ever want to use \s_ in any
>> > regexp?
>> 
>> Did you mean \> (word boundary) or \s. (punctation)?  \s_ doesn't match
>> ’ regardless because its syntax class is punctuation, not symbol.
>
> Sorry, I guess I was thinking of \cl.  It will not match ’, although
> it might be expected.

Which could be fixed by (modify-category-entry ?’ ?l).

I would suggest this additional docstring patch, because I was confused
at first as to what CATEGORY was supposed to be (I looked around a bit
for how to create some kind of "category object"):

diff --git i/src/category.c w/src/category.c
index 4397f66..31ac2ec 100644
--- i/src/category.c
+++ w/src/category.c
@@ -336,6 +336,7 @@ DEFUN ("modify-category-entry", Fmodify_category_entry,
 the current buffer's category table.
 CHARACTER can be either a single character or a cons representing the
 lower and upper ends of an inclusive character range to modify.
+CATEGORY must be a category name (a character between ` ' and `~').
 If optional fourth argument RESET is non-nil,
 then delete CATEGORY from the category set instead of adding it.  */)
   (Lisp_Object character, Lisp_Object category, Lisp_Object table, Lisp_Object reset)

>
> Anyway, my point is that these char-tables should really be treated as
> read-only by Lisp applications.

Right, but I think this bug is about the user modifying stuff.





  parent reply	other threads:[~2016-08-13 18:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-13  8:40 bug#10494: 24.0.92; Syntax table and non-ASCII character interaction Aaron Ecay
2012-01-13 10:45 ` Andreas Schwab
2012-01-13 17:04   ` Aaron Ecay
2016-08-11  0:29 ` npostavs
2016-08-11 15:24   ` Eli Zaretskii
2016-08-12 22:37     ` npostavs
2016-08-13  6:56       ` Eli Zaretskii
2016-08-13 13:21         ` npostavs
2016-08-13 13:33           ` Eli Zaretskii
2016-08-13 14:19             ` npostavs
2016-08-13 14:31               ` Eli Zaretskii
2016-08-13 14:55                 ` Eli Zaretskii
2016-08-13 18:14                 ` npostavs [this message]
2016-08-13 18:35                   ` Eli Zaretskii
2016-08-13 21:42                     ` npostavs
2016-08-14  2:32                       ` Eli Zaretskii
2016-08-14  2:58                         ` npostavs

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.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87fuq8wn6u.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=10494@debbugs.gnu.org \
    --cc=aaronecay@gmail.com \
    --cc=eliz@gnu.org \
    /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.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).