Menu

#4692 maxima-index.lisp provides wrong lengths

None
open
nobody
5
1 day ago
2026-03-28
No

On Debian Sid, it appears that 'maxim-index.lisp' encodes wrong lengths.

We can check it in a maxima session:
entering '? ?' gives a paragraph that ends in the middle of a sentence.

This can be observed for other description requests.
I found this issue by entering '? build_info' in wxMaxima:
I got an endless loop instead of a description (it appeared
that the cut was around a special character).

Actually, for these two examples at least, the lengths in the 'maxim-index.lisp'
distributed in Debian and the ones distributed in the upstream source are the same.
So I am afraid that is not a Debian specific issue.

This issue is reported in Debian bugreport #1131495.

Related

Bugs: #4692

Discussion

  • Robert Dodier

    Robert Dodier - 2026-03-30
    • labels: --> installation, documentation
     
  • Robert Dodier

    Robert Dodier - 2026-03-30

    What does build_info() report?

    If I am not mistaken, the Debian package for Maxima is compiled with GCL. If so, the bug is that GCL is not Unicode-aware. The Maxima documentation contains multi-byte Unicode characters and GCL cannot handle the documentation index correctly, because it cannot count multi-byte characters.

    If the Lisp implementation is something other than GCL, then I would look first at whether Unicode support is enabled and go from there. It is also possible, although I doubt it, given that the stuff that gets bundled into package is presumably a clean build, that the index is out of date with respect to the .info files.

     
    • Raymond Toy

      Raymond Toy - 2026-03-30

      I'm not using this particular version, but using a local git HEAD version with gcl works for me. "? sin" returns the expected text.

      I thought you, Robert, made sure byte offsets instead of character offsets were used so that gcl would still work correctly.

       
      • Robert Dodier

        Robert Dodier - 2026-03-30

        @rtoy can you try it with the items mentioned by OP? Specifically ? ? and ? build_info.

         
        • Raymond Toy

          Raymond Toy - 2026-03-30

          Both of them work and return the expected text. No extraneous stuff. The only time I recall this ever happening is if for some reason maxima-index.lisp wasn't created or is out-of-date wrt to the info files.

          Just to be extra clear, this is my local build, not the Debian sid version.

           
          • Jerome Benoit

            Jerome Benoit - 2 days ago

            Here is the out put of the shell command echo '? build_info' | maxima:

            Maxima 5.49.0 https://maxima.sourceforge.io
            using Lisp GNU Common Lisp (GCL) GCL 2.7.1 git tag Version_2_7_2pre13
            Distributed under the GNU Public License. See the file COPYING.
            Dedicated to the memory of William Schelter.
            The function bug_report() provides bug reporting information.
            (%i1)

            -- Function: build_info ()

             Returns a summary of the parameters of the Maxima build, as a
             Maxima structure (defined by ‘defstruct’).  The fields of the
             structure are: ‘version’, ‘timestamp’, ‘host’, ‘lisp_name’, and
             ‘lisp_version’.  When the pretty-printer is enabled (via
             ‘display2d’), the structure is displayed as a short table.
            
             See also ‘bug_report’.
            
             Examples:
            
                  (%i1) build_info ();
                  (%o1)
                  Maxima version: "5.36.1"
                  Maxima build date: "2015-06-02 11:26:48"
                  Host type: "x86_64-unknown-linux-gnu"
                  Lisp implementation type: "GNU Common Lisp (GCL)"
                  Lisp implementation version: "GCL 2.6.12"
                  (%i2) x : build_info ()$
                  (%i3) x@version;
                  (%o3)                               5.36.1
                  (%i4) x@timestamp;
                  (%o4)                         2015-06-02 11:26:48
                  (%i5) x@host;
                  (%o5)                      x86_64-unknown-linux-gnu
                  (%i6) x@lisp_name;
                  (%o6)                        GNU Common Lisp (GCL)
                  (%i7) x@lisp_version;
                  (%o7)                             GCL 2.6.12
                  (%i8) x;
                  (%o8)
                  Maxima version: "5.36.1"
                  Maxima build date: "2015-06-02 11:26:48"
                  Host type: "x86_64-unknown-linux-gnu"
                  Lisp implementation type: "GNU Common Lisp (GCL)"
                  Lisp implementation version: "GCL 2.6.12"
            
             The Maxima version string (here 5.36.1) can look very different:
            
                  (%i1) build_info();
                  (%o1)
                  Maxima version: "branch_5_37_base_331_g8322940_dirty"
                  Maxima build date: "2016-01-01 15:37:35"
                  Host type: "x86_64-unknown-linux-gnu"
                  Lisp implementation type: "CLISP"
                  Lisp implementation version: "2.49 (2010-07-07) (built 3605577779) (memory 3660647857)"
            
             In that case, Maxima was not build from a released sourcecode, but
             directly from the GIT-checkout of the sourcecode.  In the example,
             the checkout is 331 commits after the latest GIT tag (usually a
             Maxima (major) release (5.37 in our example)) and the abbreviated
             commit hash of the last commit was "8322940".
            
             Front-ends for maxima can add information about currently being
             used by setting the variables ‘maxima_frontend’ and
             â€
            

            (%o1) true
            (%i2)

            So the end of the description is truncated and the final char is a french (\^a)_tex.
            Do you get the full description or something as above ?

             
  • Jerome Benoit

    Jerome Benoit - 2 days ago

    I could fix the issue in Sid by reversing commit 20cfb9d8084 ("In build_index.pl, assume info file encoding is always UTF-8."). I guess that this move is currently too drastic. It might be still permitted to pass the char-encoding as argument with UTF-8 as default.

     
    • Jaime E. Villate

      Why don't you first check with Raymond what GCL version he is using. Apparently it's a different version from the one you use in Debian sid, because he doesn't see that problem.

       
  • Jerome Benoit

    Jerome Benoit - 2 days ago

    I could not reproduce the claim of Raymond by building from the vanilla source balls of gcl27 and maxima. Furthermore I have seen no evidence that GCL has move to UTF-8. I am also looking for a quick fix.

     
    • Raymond Toy

      Raymond Toy - 2 days ago

      Maxima startup says I'm using GCL 2.7.1 git tag Version_2_7_0. I built this myself from a git repo using the Version_2_7_1 tag. I have not yet updated to a newer version. The version that comes with my OS is GCL 2.6.14 git tag Version_2_6_15pre17. I don't think I've tried building Maxima with this version, but I think I used to use 2_6_14 previously, which is, I think, the oldest version that Maxima supports.

      I'm almost 100% sure that Gcl does not support unicode. Pretty sure Camm would like to have it, though.

       
      • Gunter Königsmann

        The last time I tried it didn't actively support unicode. Bit since it seems to treat text just as a stream of octets it didn't hinder you from using unicode. As long as you don't need to know how many characters the octets wou use count as in unicode and as long as you don't cut a unicode multi-byte sequence into two halves you won't notice any difference.

        On 5 April 2026 16:26:03 CEST, Raymond Toy rtoy@users.sourceforge.net wrote:

        Maxima startup says I'm using GCL 2.7.1 git tag Version_2_7_0. I built this myself from a git repo using the Version_2_7_1 tag. I have not yet updated to a newer version. The version that comes with my OS is GCL 2.6.14 git tag Version_2_6_15pre17. I don't think I've tried building Maxima with this version, but I think I used to use 2_6_14 previously, which is, I think, the oldest version that Maxima supports.

        I'm almost 100% sure that Gcl does not support unicode. Pretty sure Camm would like to have it, though.


        [bugs:#4692] maxima-index.lisp provides wrong lengths

        Status: open
        Group: None
        Labels: installation documentation
        Created: Sat Mar 28, 2026 05:39 PM UTC by Jerome Benoit
        Last Updated: Sun Apr 05, 2026 01:02 PM UTC
        Owner: nobody

        On Debian Sid, it appears that 'maxim-index.lisp' encodes wrong lengths.

        We can check it in a maxima session:
        entering '? ?' gives a paragraph that ends in the middle of a sentence.

        This can be observed for other description requests.
        I found this issue by entering '? build_info' in wxMaxima:
        I got an endless loop instead of a description (it appeared
        that the cut was around a special character).

        Actually, for these two examples at least, the lengths in the 'maxim-index.lisp'
        distributed in Debian and the ones distributed in the upstream source are the same.
        So I am afraid that is not a Debian specific issue.

        This issue is reported in Debian bugreport #1131495.


        Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/maxima/bugs/4692/

        To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

         

        Related

        Bugs: #4692

      • Raymond Toy

        Raymond Toy - 2 days ago

        For the record I just built gcl Version_2_7_2pre12. I compiled maxima with it (from scratch). ? build_info has the expected result. No extraneous text or missing text.

        My build only set --prefix. I didn't use any other options for configure.

         
  • Jerome Benoit

    Jerome Benoit - 2 days ago

    Can you give the output of echo '? build_info' | maxima ?

     
    • Raymond Toy

      Raymond Toy - 2 days ago
      $ echo "? build_info" | ./maxima-local -g -l gcl
      Loading /home/toy/.maxima/maxima-init.lisp
      Loading /home/toy/.maxima/maxima-init.mac
      Maxima branch_5_49_base_256_g15f37747e https://maxima.sourceforge.io
      using Lisp GNU Common Lisp (GCL) GCL 2.7.1 git tag Version_2_7_2pre12
      Distributed under the GNU Public License. See the file COPYING.
      Dedicated to the memory of William Schelter.
      The function bug_report() provides bug reporting information.
      (%i1) 
      
       -- Function: build_info ()
      
           Returns a summary of the parameters of the Maxima build, as a
           Maxima structure (defined by defstruct).  When the pretty-printer
           is enabled (via display2d), the structure is displayed as a short
           table.
      
           The fields of the structure are:
      
               version Maxima version
               timestamp Time at which Maxima was compiled
               host Type of system Maxima is running on
               lisp_name Name of the Lisp implementation
               lisp_version Version of the Lisp implementation
               maxima_userdir User directory (value of maxima_userdir)
               maxima_tempdir Directory for temporary files (value of
                maxima_tempdir)
               maxima_objdir Directory for compiled files of share packages
                (value of maxima_objdir)
               maxima_frontend Name of user interface, if any (value of
                maxima_frontend)
               maxima_frontend_version User interface version when
                maxima_frontend is present (value of
                maxima_frontend_version)
      
           See also *note bug_report::.
      
           Examples:
      
                (%i1) build_info ();
                (%o1)
                Maxima-version: "5.48.1"
                Maxima build date: "2025-08-23 10:39:15"
                Host type: "x86_64-pc-linux-gnu"
                Lisp implementation type: "CLISP"
                Lisp implementation version: "2.49.93+ (2024-07-04) (built 3935171094) (memory 3964959574)"
                User dir: "/home/dodier/.maxima"
                Temp dir: "/tmp"
                Object dir: "/home/dodier/.maxima/binary/5_48_1/clisp/2_49_93___2024_07_04___built_3935171094___memory_3964959574_"
                Frontend: false
                (%i2) x : build_info ()$
                (%i3) x@version;
                (%o3)                               5.48.1
                (%i4) x@timestamp;
                (%o4)                         2025-08-23 10:39:15
                (%i5) x@host;
                (%o5)                         x86_64-pc-linux-gnu
                (%i6) x@lisp_name;
                (%o6)                                CLISP
                (%i7) x@lisp_version;
                (%o7)        2.49.93+ (2024-07-04) (built 3935171094) (memory 3964959574)
                (%i8) x;
                (%o8)
                Maxima-version: "5.48.1"
                Maxima build date: "2025-08-23 10:39:15"
                Host type: "x86_64-pc-linux-gnu"
                Lisp implementation type: "CLISP"
                Lisp implementation version: "2.49.93+ (2024-07-04) (built 3935171094) (memory 3964959574)"
                User dir: "/home/dodier/.maxima"
                Temp dir: "/tmp"
                Object dir: "/home/dodier/.maxima/binary/5_48_1/clisp/2_49_93___2024_07_04___built_3935171094___memory_3964959574_"
                Frontend: false
      
           The Maxima version string (here 5.48.1) can look very different:
      
                (%i1) build_info();
                (%o1)
                Maxima version: "branch_5_37_base_331_g8322940_dirty"
                Maxima build date: "2016-01-01 15:37:35"
                Host type: "x86_64-unknown-linux-gnu"
                Lisp implementation type: "CLISP"
                Lisp implementation version: "2.49 (2010-07-07) (built 3605577779) (memory 3660647857)"
      
           In that case, Maxima was not build from a released sourcecode, but
           directly from the Git checkout of the source code.  In the example,
           the checkout is 331 commits after the latest Git tag (usually a
           Maxima release, 5.37 in our example) and the abbreviated commit
           hash of the last commit was "8322940".
      
           User interfaces for maxima can add information about currently
           being used by setting the variables maxima_fro
      
      Evaluation took 0.3500 seconds (0.8400 elapsed)
      (%o1)                                true
      
       
    • Jaime E. Villate

      Hello,

      I can also build Maxima with GCL 2_7_2pre6 and It has no problem with
      UTF8. The following is a session in Xmaxima:

      Maxima branch_5_49_base_190_gdc4d613d6_dirty https://maxima.sourceforge.io
      using Lisp GNU Common Lisp (GCL) GCL 2.7.1 git tag Version_2_7_2pre6
      Distributed under the GNU Public License. See the file COPYING.
      Dedicated to the memory of William Schelter.
      The function bug_report() provides bug reporting information.
      (%i1) ? build_info

      -- Function: build_info ()

      Returns a summary of the parameters of the Maxima build, as a
           Maxima structure (defined by 'defstruct').  When the pretty-printer
           is enabled (via 'display2d'), the structure is displayed as a short
           table.

      The fields of the structure are:

      * version Maxima version
              * timestamp Time at which Maxima was compiled
              * host Type of system Maxima is running on
              * lisp_name Name of the Lisp implementation
              * lisp_version Version of the Lisp implementation
              * maxima_userdir User directory (value of 'maxima_userdir')
              * maxima_tempdir Directory for temporary files (value of
                'maxima_tempdir')
              * maxima_objdir Directory for compiled files of share packages
                (value of 'maxima_objdir')
              * maxima_frontend Name of user interface, if any (value of
                'maxima_frontend')
              * maxima_frontend_version User interface version when
                'maxima_frontend' is present (value of
                'maxima_frontend_version')

      See also *note bug_report::.

      Examples:

      (%i1) build_info ();
                (%o1)
                Maxima-version: "5.48.1"
                Maxima build date: "2025-08-23 10:39:15"
                Host type: "x86_64-pc-linux-gnu"
                Lisp implementation type: "CLISP"
                Lisp implementation version: "2.49.93+ (2024-07-04) (built
      3935171094) (memory 3964959574)"
                User dir: "/home/dodier/.maxima"
                Temp dir: "/tmp"
                Object dir:
      "/home/dodier/.maxima/binary/5_48_1/clisp/2_49_93202407_04built_3935171094___memory_3964959574"
                Frontend: false
                (%i2) x : build_info ()$
                (%i3) x@version;
                (%o3)                               5.48.1
                (%i4) x@timestamp;
                (%o4)                         2025-08-23 10:39:15
                (%i5) x@host;
                (%o5)                         x86_64-pc-linux-gnu
                (%i6) x@lisp_name;
                (%o6)                                CLISP
                (%i7) x@lisp_version;
                (%o7)        2.49.93+ (2024-07-04) (built 3935171094) (memory
      3964959574)
                (%i8) x;
                (%o8)
                Maxima-version: "5.48.1"
                Maxima build date: "2025-08-23 10:39:15"
                Host type: "x86_64-pc-linux-gnu"
                Lisp implementation type: "CLISP"
                Lisp implementation version: "2.49.93+ (2024-07-04) (built
      3935171094) (memory 3964959574)"
                User dir: "/home/dodier/.maxima"
                Temp dir: "/tmp"
                Object dir:
      "/home/dodier/.maxima/binary/5_48_1/clisp/2_49_93202407_04built_3935171094___memory_3964959574"
                Frontend: false

      The Maxima version string (here 5.48.1) can look very different:

      (%i1) build_info();
                (%o1)
                Maxima version: "branch_5_37_base_331_g8322940_dirty"
                Maxima build date: "2016-01-01 15:37:35"
                Host type: "x86_64-unknown-linux-gnu"
                Lisp implementation type: "CLISP"
                Lisp implementation version: "2.49 (2010-07-07) (built
      3605577779) (memory 3660647857)"

      In that case, Maxima was not build from a released sourcecode, but
           directly from the Git checkout of the source code.  In the example,
           the checkout is 331 commits after the latest Git tag (usually a
           Maxima release, 5.37 in our example) and the abbreviated commit
           hash of the last commit was "8322940".

      User interfaces for maxima can add information about currently
           being used by setting the variables 'maxima_frontend' and
           'maxima_frontend_version' accordingly.

      (%o1)                                  true
      (%i2) João: 5;
      (%o2)                                   5
      (%i3) João;
      (%o3)                                   5

      As far as I can tell, it its the same output I get with SBCL.

      Regards,

      Jaime

      On 4/5/26 18:56, Jerome Benoit wrote:

      Can you give the output of echo '? build_info' | maxima ?


      [bugs:#4692] maxima-index.lisp provides wrong lengths

      Status: open
      Group: None
      Labels: installation documentation
      Created: Sat Mar 28, 2026 05:39 PM UTC by Jerome Benoit
      Last Updated: Sun Apr 05, 2026 05:50 PM UTC
      Owner: nobody

      On Debian Sid, it appears that 'maxim-index.lisp' encodes wrong lengths.

      We can check it in a maxima session:
      entering '? ?' gives a paragraph that ends in the middle of a sentence.

      This can be observed for other description requests.
      I found this issue by entering '? build_info' in wxMaxima:
      I got an endless loop instead of a description (it appeared
      that the cut was around a special character).

      Actually, for these two examples at least, the lengths in the 'maxim-index.lisp'
      distributed in Debian and the ones distributed in the upstream source are the same.
      So I am afraid that is not a Debian specific issue.

      This issue is reported in Debian bugreport #1131495.


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/maxima/bugs/4692/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #4692

  • Jaime E. Villate

    Jerome: What version of texinfo are you using? In Ubuntu, with texinfo 6.8-4build1 and GCL git Version_2_7_2pre6 I don't see any problem:

    Maxima 5.49.0 https://maxima.sourceforge.io
    using Lisp GNU Common Lisp (GCL) GCL 2.7.1 git tag Version_2_7_2pre6
    Distributed under the GNU Public License. See the file COPYING.
    Dedicated to the memory of William Schelter.
    The function bug_report() provides bug reporting information.
    (%i1) ? build_info
    
     -- Function: build_info ()
    
         Returns a summary of the parameters of the Maxima build, as a
         Maxima structure (defined by 'defstruct').  The fields of the
         structure are: 'version', 'timestamp', 'host', 'lisp_name', and
         'lisp_version'.  When the pretty-printer is enabled (via
         'display2d'), the structure is displayed as a short table.
    
         See also 'bug_report'.
    
         Examples:
    
              (%i1) build_info ();
              (%o1)
              Maxima version: "5.36.1"
              Maxima build date: "2015-06-02 11:26:48"
              Host type: "x86_64-unknown-linux-gnu"
              Lisp implementation type: "GNU Common Lisp (GCL)"
              Lisp implementation version: "GCL 2.6.12"
              (%i2) x : build_info ()$
              (%i3) x@version;
              (%o3)                               5.36.1
              (%i4) x@timestamp;
              (%o4)                         2015-06-02 11:26:48
              (%i5) x@host;
              (%o5)                      x86_64-unknown-linux-gnu
              (%i6) x@lisp_name;
              (%o6)                        GNU Common Lisp (GCL)
              (%i7) x@lisp_version;
              (%o7)                             GCL 2.6.12
              (%i8) x;
              (%o8)
              Maxima version: "5.36.1"
              Maxima build date: "2015-06-02 11:26:48"
              Host type: "x86_64-unknown-linux-gnu"
              Lisp implementation type: "GNU Common Lisp (GCL)"
              Lisp implementation version: "GCL 2.6.12"
    
         The Maxima version string (here 5.36.1) can look very different:
    
              (%i1) build_info();
              (%o1)
              Maxima version: "branch_5_37_base_331_g8322940_dirty"
              Maxima build date: "2016-01-01 15:37:35"
              Host type: "x86_64-unknown-linux-gnu"
              Lisp implementation type: "CLISP"
              Lisp implementation version: "2.49 (2010-07-07) (built 3605577779) (memory 3660647857)"
    
         In that case, Maxima was not build from a released sourcecode, but
         directly from the GIT-checkout of the sourcecode.  In the example,
         the checkout is 331 commits after the latest GIT tag (usually a
         Maxima (major) release (5.37 in our example)) and the abbreviated
         commit hash of the last commit was "8322940".
    
         Front-ends for maxima can add information about currently being
         used by setting the variables 'maxima_frontend' and
         'maxima_frontend_version' accordingly.
    
     
  • Jerome Benoit

    Jerome Benoit - 2 days ago

    So it appears that your (Raymond Toy) description is also truncated.

     

    Last edit: Jerome Benoit 2 days ago
    • Raymond Toy

      Raymond Toy - 2 days ago

      Yeah, I see that it's truncated now. The build was on some random branch. I'm redoing it now, and making sure I run make in doc/info. It will take a little while to rebuild all of maxima with gcl. I'm also using the texinfo 7.3 (self-built from the 7.3 release tag).

       
      • Raymond Toy

        Raymond Toy - 2 days ago

        Still truncated. Not sure why. It will take some time to debug.

         
        • Raymond Toy

          Raymond Toy - 2 days ago

          Did some poking around in cl-info::read-info-text. For "? build_info", the starting point of 52615 in maxima.info-1 is correct. However, the expected length is 3596. If you read 3596 octets starting from 52615, you get a truncated result, ending exactly with "the variables ‘maxima_fro". But if you read 3596 characters, you get the correct end point. The issue is the there are backquote characters, specifically Left_Single_Quotation_Mark, #u2018. That's encoded as 3 octets: 226, 128, 152.

          What's the solution? Not really sure. build_index.pl could be updated to compute lengths in octets, not characters, assuming my analysis is correct above. Or modify read-info-text to read utf-8 characters. This would only be needed by gcl. We would count utf-8 characters but save each octet in a buffer. The buffer needs to be growable. (Easy.)

          Modifying build-index.pl to use byte offsets would work, but would complicate it for all other lisps. Plus I can't read perl. Someone else will probably have to do that.

          NOTE: there's probably also a problem with cmucl which uses UTF-16 characters. The buffer that only has space for 3596 characters. But with utf-16 encoding, things outside the BMP will take 2 16-bit words instead of 1. Cmucl handles this fine, but the buffer is too short. With the unicode display characters the maxima now supports, this could be a problem. Currently, though, it seems we only use characters from the BMP.

          Finally, maybe the texi file could be updated not to use a Left_Single_Quotation_Mark and use a Grave_Accent (#u60). It seems the mark comes from @code{maxima_frontend}. That won't be so easy to fix.

          Overall, I think a utf-8 decoder for gcl is the best way forward.

           
          • Raymond Toy

            Raymond Toy - 2 days ago

            Here is a replacement for read-info-text in cl-info.lisp that appears to work for me with gcl. "? build_info" isn't truncated.

            (defun read-info-text (dir-name parameters)
              (let*
                ((value (cdr parameters))
                 (filename (car value))
                 (byte-offset (cadr value))
                 (char-count (caddr value))
                 (octet-buffer (make-array char-count
                                           :fill-pointer 0
                                           :element-type '(unsigned-byte 8)))
                 (path+filename (merge-pathnames (make-pathname :name filename) dir-name)))
                (handler-case
                (with-open-file (in path+filename :direction :input :element-type '(unsigned-byte 8))
                  (unless (plusp byte-offset)
                    ;; If byte-offset isn't positive there must be some error in
                    ;; the index.  Return nil and let the caller deal with it.
                    (return-from read-info-text nil))
                  (file-position in byte-offset)
                      (flet ((read-utf8-sequence (stream)
                               ;; Read one UTF-8 byte sequence from STREAM,
                               ;; pushing each byte onto OCTET-BUFFER (an
                               ;; adjustable vector with a fill pointer). Returns
                               ;; T on success, or NIL at end of stream.
                               (flet ((next-byte ()
                                        (let ((b (read-byte stream nil nil)))
                                          (when b
                                            (vector-push-extend b octet-buffer))
                                          b))
                                      (read-continuation ()
                                        (let ((b (read-byte stream nil nil)))
                                          (when (null b)
                                            (error "UTF-8: unexpected end of stream in multi-byte sequence"))
                                          (unless (= (logand b #xC0) #x80)
                                            (error "UTF-8: invalid continuation byte #x~2,'0X" b))
                                          (vector-push-extend b octet-buffer))))
            
                                 (let ((b0 (next-byte)))
                                   (when (null b0)
                                     (return-from read-utf8-sequence nil))
            
                                   (cond
                                     ((< b0 #x80)) ; 1-byte sequence, nothing more to read
                                     ((< b0 #xC0)
                                      (error "UTF-8: unexpected continuation byte #x~2,'0X" b0))
                                     ((< b0 #xE0) (read-continuation)) ; 2-byte
                                     ((< b0 #xF0) (read-continuation) (read-continuation)) ; 3-byte
                                     ((< b0 #xF8) (read-continuation) (read-continuation) ; 4-byte
                                      (read-continuation))
                                     (t
                                      (error "UTF-8: invalid leading byte #x~2,'0X" b0)))
            
                                   t))))
                        ;; Read the requested number of characters.
                        (handler-case
                            (unless (= char-count
                                       (loop with read-count = 0
                                             for count from 0 below char-count
                                             while (read-utf8-sequence in)
                                             do (incf read-count)
                                             finally (return read-count)))
                              (maxima::merror "End of file reading info file"))
                          (error ()
                            (maxima::merror "Bad utf-8 encoding")))
                        ;; Got all the code points.  Convert the octets into characters.
                    (map 'string #'code-char octet-buffer)))
                  (error () (maxima::merror "Cannot find documentation for `~M': missing info file ~M~%"
                            (car parameters) (namestring path+filename))))))
            

            This needs more work, but seems ok. Of course, this assumes the info files are utf-8 encoded. We need to make sure all the info files are utf-8 encoded.

             
  • Jerome Benoit

    Jerome Benoit - 2 days ago

    I play with the latest unstable packages of gcl27 and maxima. The current texinfo version in unstable is 7.3-2.

     
  • Leo Butler

    Leo Butler - 1 day ago

    build_index.pl (and update_examples) are anachronisms.

    Irregardless of how we fix this bug report, I think the best way forward
    would be to re-write this perl script in lisp and generate the index
    file at run-time, not build-time.

    BTW, it is an embarrassment that we use perl and not lisp to do this
    simple text stuff. There may have been a time when that made sense, but
    that is long gone.

     
    • Raymond Toy

      Raymond Toy - 1 day ago

      I think many years ago Rupert Swarbrik (?) started on a lisp replacement for build_index.pl. Never finished. I'm not sure how that would work if a Lisp doesn't have unicode support, but it would probably be easier today since we have pregexp support.

      I have thought about using m4 to do update_examples, so that everytime the manual is generated, the examples are too. But not sure if that's a good idea because it would probably really slow down generation of the docs. Plus, someone would have to check the manual that all the examples were converted correctly.

      Also, people complained that my changes to generate grad results at startup took too long (a second or two extra?). Generating the index at start-up would probably take even longer.

      But maybe we can get AI to convert build_index.pl and update_examples to Lisp? I would be ok with that.

       

Log in to post a comment.

MongoDB Logo MongoDB