Menu

#3026 missing info files not well-handled

None
closed
nobody
info (1)
5
2022-11-03
2015-09-21
Leo Butler
No

Maxima should handle a missing info file more gracefully:

Maxima 5.36.1 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.12
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) ? riemann

Maxima encountered a Lisp error:

 Condition in MACSYMA-TOP-LEVEL [or a callee]: INTERNAL-SIMPLE-ERROR: Cannot open the file /usr/share/doc/maxima/info/./maxima.info-1.

Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.

Discussion

  • Raymond Toy

    Raymond Toy - 2015-09-30

    Here's a patch for this. Let me know what you think of it.

    diff --git a/src/cl-info.lisp b/src/cl-info.lisp
    index a120dea..c26807e 100644
    --- a/src/cl-info.lisp
    +++ b/src/cl-info.lisp
    @@ -200,8 +200,13 @@
          (byte-offset (cadr value))
          (byte-count (caddr value))
          (text (make-string byte-count))
    -     (path+filename (make-pathname :device (first dir-name) :directory (second dir-name) :name filename)))
    -    (with-open-file (in path+filename :direction :input)
    +     (path+filename
    +      (merge-pathnames filename
    +                      (make-pathname :device (first dir-name) :directory (second dir-name)))))
    +    (with-open-file (in path+filename :direction :input :if-does-not-exist nil)
    +      (unless in
    +       (maxima::merror "Cannot find documentation for `~M': missing info file ~M~%"
    +                       (car parameters) (namestring path+filename)))
           (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.
    
     
  • Robert Dodier

    Robert Dodier - 2022-11-03
    • status: open --> maybe-fixed
     
  • Robert Dodier

    Robert Dodier - 2022-11-03

    I think this might be fixed already (with the patch shown above or one very similar); needs review.

     
  • Leo Butler

    Leo Butler - 2022-11-03

    Oh boy! Thanks Roy. I pushed the fix in commit 7614fd0f0

     
  • Leo Butler

    Leo Butler - 2022-11-03
    • status: maybe-fixed --> closed
     

Log in to post a comment.