radian-software / apheleia

🌷 Run code formatter on buffer contents without moving point, using RCS patches and dynamic programming.
MIT License
517 stars 73 forks source link

Formatter for `latexindent` not being parsed correctly #296

Open weiyaw opened 2 months ago

weiyaw commented 2 months ago

Currently the command for latexindent formatter is (latexindent . ("latexindent" "--logfile=/dev/null")). Apparently this results in an incorrect parsing of the command, as a backslash is being added before = when running the command.

$ latexindent --logfile\=/dev/null -

Can't open file: No such file or directory at /Users/kenyonn/Library/Application Support/MiKTeX/texmfs/install/scripts/latexindent/LatexIndent/UTF8CmdLineArgsFileOperation.pm line 73, <> line 1763.

Command succeeded with exit code 2.

However, adding two backslash before =, i.e. ("latexindent" "--logfile\\=/dev/null") fix the issue. I'm not sure if this issue only shows up in macOS/zsh though.

Running Emacs 29.3 on macOS 14.4.1.

weiyaw commented 2 months ago

Update: I can't reproduce this issue on my other machine running Emacs 29.2 on the same macOS 14.4.1.

raxod502 commented 2 months ago

That's odd, since Emacs 29.3 is only a bug-fix release with security patches: https://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS?h=emacs-29

Is it possible that there is some other environment difference between those two machines? For example, perhaps a different default shell in the environment that leads Emacs to assume different quoting rules would be correct?

weiyaw commented 2 months ago

That's a possibility, but unfortunately I'm relatively new to Emacs and not sure which button to push to get the right diagnostics. Is there any debugging tools that shows the shell being used?

I'm also using doomemacs: https://github.com/doomemacs/doomemacs and the work branch of this Mac port of Emacs: https://bitbucket.org/mituharu/emacs-mac/src/work/ so this could be an issue specific to this particular port of Emacs.