wxMaxima-developers / wxmaxima

A gui for the computer algebra system Maxima built with wxWidgets
https://wxMaxima-developers.github.io/wxmaxima/
Other
478 stars 99 forks source link

config dialog editor's smart quotes feature corrupts wxmaxima-init.mac #1068

Closed McTrk closed 4 years ago

McTrk commented 5 years ago

Root issue: wxplot2d fails in mac port wXMaxima app since it cannot locate mac port gnuplot executable. Workaround: Add the following line to wxmaxima-init.mac:

gnuplot_command:"/opt/local/bin/gnuplot"$

Verify: Reload worksheet. Root issue worked around, wxplot2d command succeeds. Verify: Open wxMaxima configuration dialog. Do not edit, just close dialog. Verify: Reload worksheet. Observe New Issue:

(%i1)   wxplot2d(sin(x),[x,-%pi,%pi])$
/Users/.../.maxima/wxmaxima-init.mac:11:43:incorrect syntax: ” is not an infix operator
t/local/bin/gnuplot”
                  ^
; 
; compilation unit aborted
;   caught 1 fatal ERROR condition
/bin/sh: gnuplot: command not found
(%t1)    (Graphics) 

wxMaxima version: 18.02.0.unofficial using wxWidgets version: wxWidgets 3.0.4 Maxima version: 5.41.0 Maxima build date: 2018-11-26 11:11:19 Host type: x86_64-apple-darwin15.6.0 System type: Darwin 15.6.0 X86-64 Lisp implementation type: SBCL Lisp implementation version: 1.4.13 wxMaxima's idea of the directory layout is: User configuration dir: /Users/.../.maxima/ Help dir: /Applications/MacPorts/wxMaxima.app/Contents/Resources/help Maxima lisp dir: /opt/local/bin/../share/maxima/5.41.0

Work around New issue:

  1. Disable the "substitutions, smart quotes" feature in the context menu of the configuration editor
  2. Undo what wxMaxima did to init files when closing the dialog previously, as follows: 2.a Revert the file from backup, or 2.b Manually correct the configuration while the "smart quotes" is disabled, or using an external text editor, replacing pairs of UTF characters looking like " with the ASCII double-quote character " (ASCII 34).
  3. Warn user: Add a comment in init file:
    /*
    Caution: Maxima and Lisp parsers understand ASCII only.
    Built-in wxMaxima config editor converts ASCII quotes
    to  utf-8 "smart quotes" by default,
    corrupting string and quoting syntax in config files.
    To modify these settings safely, do one of the following:
    1. Uncheck the "Substitutions, Smart Quotes" from the context menu
    2. Use an external, ASCII-only text editor to make any change
    Double-check that "" and '' are being inserted as
    single-byte characters ASCII 34 and 39,
    and not UTF-8 8220, 8221, 8216, or 8217 
    */
    wxplot_old_gnuplot:false$
    gnuplot_command:"/opt/local/bin/gnuplot"$

    Note1: Disabling of "smart quote" is temporary and must be re-disabled when dialog is re-opened. Note2: Config corruption issue is also observed in non-devel version of wxMaxima mac port.

gunterkoenigsmann commented 5 years ago

wxWidgets 3.1.1 and newer allow wxMaxima to automatically disable OSX's smart substitutions:

#ifdef __WXMAC__
  #if wxCHECK_VERSION(3, 1, 1)
  OSXDisableAllSmartSubstitutions();
  #endif
#endif
McTrk commented 5 years ago

Unfortunately, the latest available mac port requires wxWidgets-3.0, and not 3.1 .

McTrk commented 5 years ago
  wxMaxima-devel      18.02-dev-20180616 Graphical user interface for Maxima based on wxWidgets

... depends_lib: wxWidgets-3.0 ... state: installed: 18.02-dev-20180616 space: 15.72 MiB

snoeyink commented 5 years ago

Still have this problem on the homebrew install of 19.8.0. Causes maxima to fail to start and WxMaxima to silently hang on the first attempted calculation.

KubaO commented 4 years ago

This is a packaging bug within homebrew. There's little we can do about it here, but you could use our dmg instead I think.

KubaO commented 4 years ago

@snoeyink Please reopen if the problem persists for you when wxMaxima is linked with wxWidgets 3.1.3. Otherwise, please use the homebrew bug tracker to report a packaging issue.