ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Max Chernoff via ntg-context <ntg-context@ntg.nl>
To: ntg-context@ntg.nl
Cc: Max Chernoff <mseven@telus.net>, oinos@gmx.es
Subject: Re: issue with scite module
Date: Thu, 2 Jun 2022 16:52:38 -0600	[thread overview]
Message-ID: <8147df6a-259d-4909-bf91-924891063dbe@telus.net> (raw)
In-Reply-To: <818c1f30-37d5-cacd-643f-9ba2b38d3cdf@gmx.es>

> For the sake of consistency (with buff-imp-xml.lua), I think the patch
> should read
 > [...]
> +local alsoname         = lpatterns.utf8two + lpatterns.utf8three +
> lpatterns.utf8four

I think that that pattern is a little too broad, since it will match any 
non-ASCII Unicode character. Things like U+202E (xkcd.com/1137), U+00A0 
(no-break space), etc are valid UTF-8 characters, but not valid XML tag 
names. Neither of these two characters are matched by the TeX catcode 
check. This doesn't make any real difference for a syntax highlighter 
though.

> +local name             = (R("az","AZ","09") + S("_-.") + + alsoname)^1

There's a doubled plus in the middle there. The patch works when I 
remove it.

> But I’m afraid I cannot make it work on my computer (Linux64).
> 
> On another Win64 computer, both patches worked perfectly fine.

Hmm, that's really weird. Both patches work for me on my main Win64 
computer (after I fixed the extra plus). I also pulled the 
"contextgarden/context:lmtx" Docker image (Debian sid), and both patches 
worked there too. I get this from inside the container:

     root@e8d29a32595c:~# cat /etc/os-release
     PRETTY_NAME="Debian GNU/Linux bookworm/sid"
     NAME="Debian GNU/Linux"
     ID=debian
     HOME_URL="https://www.debian.org/"
     SUPPORT_URL="https://www.debian.org/support"
     BUG_REPORT_URL="https://bugs.debian.org/"

     root@e8d29a32595c:~# locale
     LANG=
     LANGUAGE=
     LC_CTYPE="POSIX"
     LC_NUMERIC="POSIX"
     LC_TIME="POSIX"
     LC_COLLATE="POSIX"
     LC_MONETARY="POSIX"
     LC_MESSAGES="POSIX"
     LC_PAPER="POSIX"
     LC_NAME="POSIX"
     LC_ADDRESS="POSIX"
     LC_TELEPHONE="POSIX"
     LC_MEASUREMENT="POSIX"
     LC_IDENTIFICATION="POSIX"
     LC_ALL=

     root@e8d29a32595c:~# xxd test.tex
     00000000: 5c75 7365 6d6f 6475 6c65 5b73 6369 7465  \usemodule[scite
     00000010: 5d0a 5c73 7461 7274 7465 7874 0a5c 7374  ].\starttext.\st
     00000020: 6172 7454 4558 7061 6765 5b6f 6666 7365  artTEXpage[offse
     00000030: 743d 3165 785d 0a5c 7479 7065 5b6f 7074  t=1ex].\type[opt
     00000040: 696f 6e3d 786d 6c5d 7b3c 616e 732f 3e7d  ion=xml]{<ans/>}
     00000050: 0a5c 7479 7065 5b6f 7074 696f 6e3d 786d  .\type[option=xm
     00000060: 6c5d 7b3c c3a1 c3b1 c39f 2f3e 7d0a 5c73  l]{<....../>}.\s
     00000070: 746f 7054 4558 7061 6765 0a5c 7374 6f70  topTEXpage.\stop
     00000080: 7465 7874 0a                             text

     root@e8d29a32595c:~# context --version
     mtx-context     | ConTeXt Process Management 1.04
     mtx-context     |
     mtx-context     | main context file: [snip]
     mtx-context     | current version: 2022.05.11 11:36
     mtx-context     | main context file: [snip]
     mtx-context     | current version: 2022.05.11 11:36

     ldd "$(type -p luametatex)"
         linux-vdso.so.1 (0x00007ffdbe9a5000)
         libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4b034d4000)
         libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
(0x00007f4b034b3000)
         libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4b0336f000)
         libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4b03196000)
         /lib64/ld-linux-x86-64.so.2 (0x00007f4b03a55000)

Is this perhaps a weird locale or encoding issue? Maybe try compiling with:

     LC_ALL=C.UTF-8 LANG=C.UTF-8 context test.tex

or

     LC_ALL=POSIX LANG=POSIX context test.tex

I'm surprised Linux is the one not working here, since it's usually 
Windows that has text encoding issues with its weird hybrid of DOS 
codepages and UTF-16+BOM.

The only other thing that I can think of is a weird library issue with 
your distro, but LuaMetaTeX is statically linked. Not sure what else to 
check here.

-- Max
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2022-06-02 22:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-01 16:47 Pablo Rodriguez via ntg-context
2022-06-01 16:58 ` Henning Hraban Ramm via ntg-context
2022-06-01 17:45   ` Pablo Rodriguez via ntg-context
2022-06-01 19:00     ` Henning Hraban Ramm via ntg-context
2022-06-01 21:58       ` Max Chernoff via ntg-context
2022-06-02 15:36         ` Pablo Rodriguez via ntg-context
2022-06-02 17:03           ` Pablo Rodriguez via ntg-context
2022-06-02 22:52             ` Max Chernoff via ntg-context [this message]
2022-06-04  8:42               ` Pablo Rodriguez via ntg-context
2022-06-04  9:59 Pablo Rodriguez via ntg-context
2022-06-04 21:18 ` Max Chernoff via ntg-context

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

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

  git send-email \
    --in-reply-to=8147df6a-259d-4909-bf91-924891063dbe@telus.net \
    --to=ntg-context@ntg.nl \
    --cc=mseven@telus.net \
    --cc=oinos@gmx.es \
    /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.
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 NNTP newsgroup(s).