unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: npostavs@gmail.com
To: Juri Linkov <juri@linkov.net>
Cc: 35802@debbugs.gnu.org
Subject: bug#35802: Broken data loaded from uni-decomposition
Date: Thu, 06 Jun 2019 13:07:01 -0400	[thread overview]
Message-ID: <85k1dybq2y.fsf@gmail.com> (raw)
In-Reply-To: <878sv2idc0.fsf@mail.linkov.net> (Juri Linkov's message of "Sun,  19 May 2019 22:46:07 +0300")

Juri Linkov <juri@linkov.net> writes:

> But should return `t'.  I customized `search-whitespace-regexp'
> (whose value isearch sets to `search-spaces-regexp') to a legitimate
> value, but `unicode-property-table-internal' used in char-fold.el fails
> to correctly load "uni-decomposition.el", thus breaking the char-fold search.

The problem is that this messes up a search in find-auto-coding:

      (if (re-search-forward
           "[\r\n]\\([^\r\n]*\\)[ \t]*Local Variables:[ \t]*\\([^\r\n]*\\)[\r\n]"
           tail-end t)
          ...
          (let* ((prefix (regexp-quote (match-string 1)))
                 (suffix (regexp-quote (match-string 2)))

The space between "Local Variables" becomes "\\(\\s-\\|\n\\)+" which is
a problem because it adds a new capturing group, which means suffix gets
the wrong value.  Then we fail to find the ";; End:" line, and don't
apply the "coding: utf-8" setting.

So the value you chose isn't entirely legitimate, you should use a shy
group instead: 

(equal (progn (load "international/uni-decomposition.el" t t t t)
              (aref (cdr (assq 'decomposition char-code-property-alist)) 1024))
       (progn (let ((search-spaces-regexp "\\(?:\\s-\\|\n\\)+"))
                (load "international/uni-decomposition.el" t t t t))
              (aref (cdr (assq 'decomposition char-code-property-alist)) 1024)))
;=> t

And possibly let-binding search-spaces-regexp in find-auto-coding would
make sense (although, there's probably more places like this that might
break, not sure if we can ever hope to find them all).





  reply	other threads:[~2019-06-06 17:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-19 19:46 bug#35802: Broken data loaded from uni-decomposition Juri Linkov
2019-06-06 17:07 ` npostavs [this message]
2019-06-06 20:41   ` Juri Linkov
2019-06-11 14:18     ` npostavs
2019-06-11 21:11       ` Juri Linkov
2019-06-16  2:12         ` Noam Postavsky
2019-06-16 19:22           ` Juri Linkov
2019-06-21 11:16             ` Noam Postavsky
2019-06-21 19:16               ` Juri Linkov
2019-06-22 22:35                 ` Noam Postavsky
2019-06-23 21:25                   ` Juri Linkov
2019-06-26  2:08                     ` Noam Postavsky

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=85k1dybq2y.fsf@gmail.com \
    --to=npostavs@gmail.com \
    --cc=35802@debbugs.gnu.org \
    --cc=juri@linkov.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.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).