Loading ...
Sorry, an error occurred while loading the content.

Re: "Range striding over charsets"

Expand Messages
  • cwulfman
    This problem cropped up for me in a recent CVS Emacs update. One of the emacs ... He suggests the following fix: (setq chars (mapcar (lambda (c) (let
    Message 1 of 15 , Jan 25, 2006
    View Source
    • 0 Attachment
      This problem cropped up for me in a recent CVS Emacs update. One of the emacs
      developers sent me this message:

      >I found why this error happens. In the recent CVS Emacs, as
      >utf-translate-cjk-mode is on by default, some Unicode
      >characters will be decoded into one of CJK character set.
      >But, as xsdre-range-list-to-char-alternative (xsd-regexp.el)
      >simply do something like this to generate a character range:
      >(format "%c-%c" (decode-char 'ucs FROM) (decode-char 'ucs TO))
      >the resulting regexp causes the above error.

      He suggests the following fix:

      (setq chars
      (mapcar (lambda (c)
      (let ((utf-translate-cjk-mode nil))
      (decode-char 'ucs c)))
      chars))

      >in xsdre-range-list-to-char-alternative to avoid the current
      >problem. It may be good to tell about this to the
      >developper of nxml-mode.

      I don't know if James Clark (or anyone else) is continuing to maintain nxml-mode, but this
      patch seems to have solved my problem for the moment, anyway.


      --- In emacs-nxml-mode@yahoogroups.com, "drkm" <darkman_spam@y...> wrote:
      >
      > Thomas Haselberger wrote:
      >
      > > "drkm" writes:
      >
      > > > <?xml version="1.0"?>
      > > > <xsl:stylesheet version="1.0"
      > > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      > > > <xsl:strip-space elements="fo:table-cell"/>
      > > > </xsl:stylesheet>
      >
      > > > I don't understand this. Does the problem arise with your
      > > > installation?
      >
      > > no. version 20041004 here.
      >
      > Here too. But I didn't explain the whole thing, sorry. After
      > pasting the text above in a fresh buffer, you have to be in validation
      > mode ('C-c C-v' if you don't see 'Valid' nor 'Invalid' in the mode
      > bar) and associate the buffer with the XSLT schema ('C-c C-s C-t XSLT
      > <RET>' while in validation mode).
      >
      > My Emacs is: GNU Emacs 22.0.50.2 (i386-mingw-nt5.1.2600) of
      > 2005-04-17 on LAPTOP.
      >
      > I didn't find something related in my config. If you can't
      > reproduce the problem, I'll investiguate further (like installing a
      > newer CVS Emacs).
      >
      > Thanks for your help,
      >
      > --drkm
      >
    • Lennart Borgman
      ... Could you please send this as a diff -c patch? Is there anyone who can host these patches? (I can do that temporary, but I have no really good backup on my
      Message 2 of 15 , Jan 25, 2006
      View Source
      • 0 Attachment
        cwulfman wrote:
        > This problem cropped up for me in a recent CVS Emacs update. One of the emacs
        > developers sent me this message:
        >
        >
        >> I found why this error happens. In the recent CVS Emacs, as
        >> utf-translate-cjk-mode is on by default, some Unicode
        >> characters will be decoded into one of CJK character set.
        >> But, as xsdre-range-list-to-char-alternative (xsd-regexp.el)
        >> simply do something like this to generate a character range:
        >> (format "%c-%c" (decode-char 'ucs FROM) (decode-char 'ucs TO))
        >> the resulting regexp causes the above error.
        >>
        >
        > He suggests the following fix:
        >
        > (setq chars
        > (mapcar (lambda (c)
        > (let ((utf-translate-cjk-mode nil))
        > (decode-char 'ucs c)))
        > chars))
        >
        >
        >> in xsdre-range-list-to-char-alternative to avoid the current
        >> problem. It may be good to tell about this to the
        >> developper of nxml-mode.
        >>
        >
        > I don't know if James Clark (or anyone else) is continuing to maintain nxml-mode, but this
        > patch seems to have solved my problem for the moment, anyway.
        >
        >

        Could you please send this as a diff -c patch?

        Is there anyone who can host these patches? (I can do that temporary,
        but I have no really good backup on my site.)
      • Florent Georges
        ... I can host them somewhere in my SF.net site (on the website or in the CVS repository, but I don t think it s necessary). Regards, --drkm
        Message 3 of 15 , Jan 26, 2006
        View Source
        • 0 Attachment
          Lennart Borgman wrote:

          > Is there anyone who can host these patches? (I can
          > do that temporary, but I have no really good backup
          > on my site.)

          I can host them somewhere in my SF.net site (on the website or in the
          CVS repository, but I don't think it's necessary).

          Regards,

          --drkm

























          ___________________________________________________________________________
          Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
          Téléchargez sur http://fr.messenger.yahoo.com
        • Dave Pawson
          ... Possibly easier as a new install of nxml-mode? (perhaps as well as a diff file?) I ll add it to my relax-ng faq site if it helps. regards -- Dave Pawson
          Message 4 of 15 , Jan 26, 2006
          View Source
          • 0 Attachment
            On 25/01/06, Lennart Borgman <lennart.borgman.073@...> wrote:


            > Is there anyone who can host these patches? (I can do that temporary,
            > but I have no really good backup on my site.)

            Possibly easier as a new install of nxml-mode?
            (perhaps as well as a diff file?)
            I'll add it to my relax-ng faq site if it helps.


            regards

            --
            Dave Pawson
            XSLT XSL-FO FAQ.
            http://www.dpawson.co.uk
          • cwulfman
            Here it is: ... *************** *** 401,415 **** (cons last chars) (cons last (cons ?- chars)))))) (setq range-list (cdr range-list))) - ;; Changed below
            Message 5 of 15 , Jan 26, 2006
            View Source
            • 0 Attachment
              Here it is:

              *** xsd-regexp.el Wed Jan 25 09:20:34 2006
              --- xsd-regexp.el.bk Wed Jan 25 08:57:18 2006
              ***************
              *** 401,415 ****
              (cons last chars)
              (cons last (cons ?- chars))))))
              (setq range-list (cdr range-list)))
              - ;; Changed below to handle error "range striding over charsets"
              - ;; (setq chars
              - ;; (mapcar (lambda (c)
              - ;; (decode-char 'ucs c))
              - ;; chars))
              (setq chars
              (mapcar (lambda (c)
              ! (let ((utf-translate-cjk-mode nil))
              ! (decode-char 'ucs c)))
              chars))
              (when caret
              (setq chars (cons ?^ chars)))
              --- 401,409 ----
              (cons last chars)
              (cons last (cons ?- chars))))))
              (setq range-list (cdr range-list)))
              (setq chars
              (mapcar (lambda (c)
              ! (decode-char 'ucs c))
              chars))
              (when caret
              (setq chars (cons ?^ chars)))
              ***************
              *** 423,430 ****
              (setq chars '(?- ?^ ?\])))
              (setq chars (cons ?\[ chars))
              (apply 'string chars)))
              -
              -

              ;;; Parsing

              --- 417,422 ----


              --- In emacs-nxml-mode@yahoogroups.com, Lennart Borgman <lennart.borgman.
              073@s...> wrote:
              >
              > cwulfman wrote:
              > > This problem cropped up for me in a recent CVS Emacs update. One of the emacs
              > > developers sent me this message:
              > >
              > >
              > >> I found why this error happens. In the recent CVS Emacs, as
              > >> utf-translate-cjk-mode is on by default, some Unicode
              > >> characters will be decoded into one of CJK character set.
              > >> But, as xsdre-range-list-to-char-alternative (xsd-regexp.el)
              > >> simply do something like this to generate a character range:
              > >> (format "%c-%c" (decode-char 'ucs FROM) (decode-char 'ucs TO))
              > >> the resulting regexp causes the above error.
              > >>
              > >
              > > He suggests the following fix:
              > >
              > > (setq chars
              > > (mapcar (lambda (c)
              > > (let ((utf-translate-cjk-mode nil))
              > > (decode-char 'ucs c)))
              > > chars))
              > >
              > >
              > >> in xsdre-range-list-to-char-alternative to avoid the current
              > >> problem. It may be good to tell about this to the
              > >> developper of nxml-mode.
              > >>
              > >
              > > I don't know if James Clark (or anyone else) is continuing to maintain nxml-mode, but
              this
              > > patch seems to have solved my problem for the moment, anyway.
              > >
              > >
              >
              > Could you please send this as a diff -c patch?
              >
              > Is there anyone who can host these patches? (I can do that temporary,
              > but I have no really good backup on my site.)
              >
            • Florent Georges
              cwulfman wrote: Hi ... You generated it the wrong side :-p. Here is a correct one IMHO. BTW, I added this binding around a second use of decode-char . I
              Message 6 of 15 , Jan 26, 2006
              View Source
              • 0 Attachment
                cwulfman wrote:

                Hi

                > Here it is:

                > *** xsd-regexp.el Wed Jan 25 09:20:34 2006
                > --- xsd-regexp.el.bk Wed Jan 25 08:57:18 2006

                You generated it the wrong side :-p. Here is a correct one IMHO.
                BTW, I added this binding around a second use of 'decode-char'. I
                guess it is correct, while I have not investigued a lot.

                It's available at:

                http//drkm-lib.sf.net/nxml/xsd-regexp.el.2006-01-26.patch

                --drkm

                *** xsd-regexp.el.orig Fri Jan 27 00:31:24 2006
                --- xsd-regexp.el Fri Jan 27 00:32:20 2006
                ***************
                *** 290,296 ****
                (defun xsdre-compile-single-char (ch)
                (if (memq ch '(?. ?* ?+ ?? ?\[ ?\] ?^ ?$ ?\\))
                (string ?\\ ch)
                ! (string (decode-char 'ucs ch))))

                (defun xsdre-char-class-to-range-list (cc)
                "Return a range-list for a symbolic char-class."
                --- 290,297 ----
                (defun xsdre-compile-single-char (ch)
                (if (memq ch '(?. ?* ?+ ?? ?\[ ?\] ?^ ?$ ?\\))
                (string ?\\ ch)
                ! (let ((utf-translate-cjk-mode nil))
                ! (string (decode-char 'ucs ch)))))

                (defun xsdre-char-class-to-range-list (cc)
                "Return a range-list for a symbolic char-class."
                ***************
                *** 403,409 ****
                (setq range-list (cdr range-list)))
                (setq chars
                (mapcar (lambda (c)
                ! (decode-char 'ucs c))
                chars))
                (when caret
                (setq chars (cons ?^ chars)))
                --- 404,411 ----
                (setq range-list (cdr range-list)))
                (setq chars
                (mapcar (lambda (c)
                ! (let ((utf-translate-cjk-mode nil))
                ! (decode-char 'ucs c)))
                chars))
                (when caret
                (setq chars (cons ?^ chars)))







                ___________________________________________________________________________
                Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
                Téléchargez sur http://fr.messenger.yahoo.com
              • Florent Georges
                ... http://drkm-lib.sf.net/nxml/xsd-regexp.el.2006-01-26.patch Indeed. Regards, --drkm
                Message 7 of 15 , Jan 26, 2006
                View Source
                • 0 Attachment
                  drkm wrote:

                  > It's available at:

                  > http//drkm-lib.sf.net/nxml/xsd-regexp.el.2006-01-26.patch

                  http://drkm-lib.sf.net/nxml/xsd-regexp.el.2006-01-26.patch

                  Indeed.

                  Regards,

                  --drkm























                  ___________________________________________________________________________
                  Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
                  Téléchargez sur http://fr.messenger.yahoo.com
                • Paul Sleigh
                  Thanks for this bugfix. That error message was driving me nuts. I thought for a second that the bugfix hadn t worked, until I noticed that my custom
                  Message 8 of 15 , Apr 30 6:55 PM
                  View Source
                  • 0 Attachment
                    Thanks for this bugfix. That error message was driving me nuts. I
                    thought for a second that the bugfix hadn't worked, until I noticed
                    that my custom "recompile everything" function wasn't recompiling my
                    ~/nxml directory. All good now. Thanks!
                  • Jochen+emacs-nxml-mode@Hayek.name
                    I started using nxml-mode with emacs-22.1 from a suse-10.3 factory release. During installation of the RPMs I read a message, saying that nxml-mode conflicts
                    Message 9 of 15 , Jun 18, 2007
                    View Source
                    • 0 Attachment
                      I started using nxml-mode with emacs-22.1 from a suse-10.3 "factory" release.

                      During installation of the RPMs I read a message,
                      saying that nxml-mode conflicts with Mule-UCS,
                      which was made a "provides" tag of one of the emacs RPM.

                      I overrid this problem, as I am mostly interested in iso-8859-1 files,
                      but I would still prefer to see this problem solved.



                      I wonder whether this problem is related to

                      <62733.90701.qm@...> on this mailing list (emacs-nxml-mode@yahoogroups.com)

                      resp.

                      http://tech.groups.yahoo.com/group/emacs-nxml-mode/message/1170
                    • Jason Rumney
                      ... I guess whoever packaged emacs-22.1 helpfully made it provide mule-ucs since all the functionality that used to be provided by mule-ucs is now part of
                      Message 10 of 15 , Jun 18, 2007
                      View Source
                      • 0 Attachment
                        Jochen+emacs-nxml-mode@... wrote:
                        >
                        > I started using nxml-mode with emacs-22.1 from a suse-10.3 "factory"
                        > release.
                        >
                        > During installation of the RPMs I read a message,
                        > saying that nxml-mode conflicts with Mule-UCS,
                        > which was made a "provides" tag of one of the emacs RPM.
                        >
                        I guess whoever packaged emacs-22.1 helpfully made it "provide"
                        mule-ucs since all the functionality that used to be provided by
                        mule-ucs is now part of emacs. But since it is different code, and built
                        in, it doesn't conflict with nxml-mode and other packages in the same way.
                      • Dave Pawson
                        ... I m using 22.1 with nxml-mode daily. If there is a conflict it doesn t show in daily use. Is this the list to suggest that nxml-mode is stable, high
                        Message 11 of 15 , Jun 19, 2007
                        View Source
                        • 0 Attachment
                          On 18/06/07, Jason Rumney <jasonr@...> wrote:
                          > Jochen+emacs-nxml-mode@... wrote:
                          > >
                          > > I started using nxml-mode with emacs-22.1 from a suse-10.3 "factory"
                          > > release.
                          > >
                          > > During installation of the RPMs I read a message,
                          > > saying that nxml-mode conflicts with Mule-UCS,
                          > > which was made a "provides" tag of one of the emacs RPM.

                          I'm using 22.1 with nxml-mode daily. If there is a conflict it doesn't show
                          in daily use.

                          Is this the list to suggest that nxml-mode is stable, high quality
                          and very useful for any XML, XSLT XSL-FO work?

                          Could it be considered for adoption and delivery with emacs?

                          Then the right people could remove such conflicts. nxml-mode was designed
                          in 2003 and the author has moved on to other (charity) work and no
                          longer supports it.

                          regards



                          --
                          Dave Pawson
                          XSLT XSL-FO FAQ.
                          http://www.dpawson.co.uk
                        • paul killey
                          On Jun 19, 2007, Dave Pawson wrote (re: Re: [emacs-nxml-mode] emacs-22.1,... ... My emacs / lisp development and tweaking skill set is stretched just by
                          Message 12 of 15 , Jun 20, 2007
                          View Source
                          • 0 Attachment
                            On Jun 19, 2007, Dave Pawson wrote (re: Re: [emacs-nxml-mode] emacs-22.1,...

                            > Is this the list to suggest that nxml-mode is stable, high quality and
                            > very useful for any XML, XSLT XSL-FO work?

                            My emacs / lisp development and tweaking skill set is stretched just by
                            maintaining a fairly minimal .emacs file. Even so, nxml-mode has made
                            editing docbook very accessible and productive for me.

                            Speaking maybe on behalf of other low-end but appreciative users of
                            nxml-mode, I hope those of you who have some standing in these communities
                            are able to help maintain the usability of nxml as emacs is developed and
                            changes.

                            The information I have gleaned from 'lurking' on this list has been
                            extremely valuable.

                            --paul
                          Your message has been successfully submitted and would be delivered to recipients shortly.