radian-software / apheleia

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

After formatting a file in web-mode, mode is switched to mhtml-mode #29

Closed jsmestad closed 2 years ago

jsmestad commented 3 years ago

I am running adamzapasnik/prettier-plugin-eex on an index.html.eex file which is opened with a major mode of web-mode. When I edit a file and hit save, the formatter runs great but I am switched into mhtml-mode (HTML+) after the formatter is run.

Is there some configuration I am missing? Happy to help debug if you can guide me on where/how to look.

Thanks for this great project btw 🍻 This is a great step forward in formatters for the emacs ecosystem

raxod502 commented 3 years ago

So I notice that by default auto-mode-alist has an entry ("\\.[sx]?html?\\(\\.[a-zA-Z_]+\\)?\\'" . mhtml-mode) which is intended to open all *.html.* files in mhtml-mode. How are you configuring .html.eex files to open in web-mode? Is it another entry in auto-mode-alist? Inspecting the full contents of auto-mode-alist and their ordering (precedence is from top to bottom) could help determine what is going on.

I can't think off the top of my head why the reformatting operation could possibly cause the major mode to be switched. That seems like a probable bug.

jsmestad commented 3 years ago

I'll dig into that and see what I can come up with. Would it be a bug with web-mode or this library?

raxod502 commented 3 years ago

It is hard to say without understanding what is going on---it could be either.

jsmestad commented 3 years ago

Sorry this took so long. I am using doom-emacs if that helps track things down. Here is my current config and the value for auto-mode-alist

```elisp (("Brewfile\\'" . fundamental-mode) ("\\.envrc\\.private\\'" . sh-mode) ("\\.env\\(?:\\.\\(?:development\\|local\\|production\\|test\\)\\)\\'" . sh-mode) ("\\.ex\\'" . poly-elixir-web-mode) ("\\.feature\\'" . feature-mode) ("Procfile\\'" . yaml-mode) ("templates/.+\\.php\\'" . web-mode) ("wp-content/themes/.+/.+\\.php\\'" . web-mode) ("\\.eco\\'" . web-mode) ("\\.jinja2?\\'" . web-mode) ("\\.twig\\'" . web-mode) ("\\.svelte\\'" . web-mode) ("\\.mustache\\'" . web-mode) ("\\.hbs\\'" . web-mode) ("\\.as[cp]x\\'" . web-mode) ("\\.jsp\\'" . web-mode) ("\\.l?eex\\'" . web-mode) ("\\.erb\\'" . web-mode) ("\\.\\(?:tpl\\|blade\\)\\(?:\\.php\\)?\\'" . web-mode) ("\\.[px]?html?\\'" . web-mode) ("/bspwmrc\\'" . sh-mode) ("\\.\\(?:zunit\\|env\\)\\'" . sh-mode) ("\\.rs$" . rustic-mode) ("/\\.rspec\\'" . text-mode) ("/\\(?:Brew\\|Fast\\)file\\'" . ruby-mode) ("\\.\\(?:a?rb\\|aslsx\\)\\'" . ruby-mode) ("/README\\(?:\\.md\\)?\\'" . gfm-mode) ("\\.tex\\'" . LaTeX-mode) ("\\.tsx\\'" . typescript-tsx-mode) ("components/.+\\.js$" . rjsx-mode) ("\\.es6\\'" . js2-mode) ("\\.m?js\\'" . js2-mode) ("\\.js\\(?:on\\|[hl]int\\(?:rc\\)?\\)\\'" . json-mode) ("/\\(?:app\\|sys\\)\\.config\\'" . erlang-mode) ("/rebar\\.config\\(?:\\.script\\)?\\'" . erlang-mode) ("\\.erlang\\'" . erlang-mode) ("\\.Cask\\'" . emacs-lisp-mode) ("\\.h\\'" . +cc-c-c++-objc-mode) ("\\.mm\\'" . objc-mode) ("\\.pdf\\'" . pdf-view-mode) ("\\.[pP][dD][fF]\\'" . pdf-view-mode) ("\\.j2$" . jinja2-mode) ("\\.rs\\'" . rust-mode) ("\\.nomad\\'" . hcl-mode) ("\\.hcl\\'" . hcl-mode) ("\\.styl\\'" . stylus-mode) ("\\.sass\\'" . sass-mode) ("\\.slim\\'" . slim-mode) ("\\.\\(?:jade\\|pug\\)\\'" . pug-mode) ("\\.haml\\'" . haml-mode) ("\\.rs\\'" . rustic-mode) ("\\.\\(plantuml\\|pum\\|plu\\)\\'" . plantuml-mode) ("\\.\\(?:md\\|markdown\\|mkd\\|mdown\\|mkdn\\|mdwn\\)\\'" . markdown-mode) ("\\.lua\\'" . lua-mode) ("\\.hva\\'" . latex-mode) ("\\.drv\\'" . latex-mode) ("\\.ts\\'" . typescript-mode) ("\\.jsx\\'" . rjsx-mode) ("\\.cson\\'" . coffee-mode) ("Cakefile\\'" . coffee-mode) ("\\.iced\\'" . coffee-mode) ("\\.coffee\\'" . coffee-mode) ("\\(?:\\(?:\\.\\(?:b\\(?:\\(?:abel\\|ower\\)rc\\)\\|json\\(?:ld\\)?\\)\\|composer\\.lock\\)\\'\\)" . json-mode) ("go\\.mod\\'" . go-dot-mod-mode) ("\\.go\\'" . go-mode) ("\\.hrl\\'" . erlang-mode) ("\\.erl\\'" . erlang-mode) ("/ebin/.+\\.app" . erlang-mode) ("\\.yrl" . erlang-mode) ("\\.xrl$" . erlang-mode) ("\\.hrl$" . erlang-mode) ("\\.escript" . erlang-mode) ("\\.app\\.src$" . erlang-mode) ("\\.erl$" . erlang-mode) ("\\.exs\\'" . elixir-mode) ("\\.ex\\'" . elixir-mode) ("\\.elixir\\'" . elixir-mode) ("\\.glsl\\'" . glsl-mode) ("\\.geom\\'" . glsl-mode) ("\\.frag\\'" . glsl-mode) ("\\.vert\\'" . glsl-mode) ("\\.cuh\\'" . cuda-mode) ("\\.cu\\'" . cuda-mode) ("\\.cmake\\'" . cmake-mode) ("CMakeLists\\.txt\\'" . cmake-mode) ("\\.tf\\(vars\\)?\\'" . terraform-mode) ("/git-rebase-todo\\'" . git-rebase-mode) ("\\.editorconfig\\'" . editorconfig-conf-mode) ("\\.dockerfile\\'" . dockerfile-mode) ("/Dockerfile\\(?:\\.[^/\\]*\\)?\\'" . dockerfile-mode) ("\\.envrc\\'" . envrc-file-mode) ("\\.\\(e?ya?\\|ra\\)ml\\'" . yaml-mode) ("\\.j2\\'" . jinja2-mode) ("\\.jinja2\\'" . jinja2-mode) ("/git/ignore\\'" . gitignore-mode) ("/info/exclude\\'" . gitignore-mode) ("/\\.gitignore\\'" . gitignore-mode) ("/etc/gitconfig\\'" . gitconfig-mode) ("/\\.gitmodules\\'" . gitconfig-mode) ("/git/config\\'" . gitconfig-mode) ("/modules/.*/config\\'" . gitconfig-mode) ("/\\.git/config\\'" . gitconfig-mode) ("/\\.gitconfig\\'" . gitconfig-mode) ("\\.gpg\\(~\\|\\.~[0-9]+~\\)?\\'" nil epa-file) ("\\.elc\\'" . elisp-byte-code-mode) ("\\.zst\\'" nil jka-compr) ("\\.dz\\'" nil jka-compr) ("\\.xz\\'" nil jka-compr) ("\\.lzma\\'" nil jka-compr) ("\\.lz\\'" nil jka-compr) ("\\.g?z\\'" nil jka-compr) ("\\.bz2\\'" nil jka-compr) ("\\.Z\\'" nil jka-compr) ("\\.vr[hi]?\\'" . vera-mode) ("\\(?:\\.\\(?:rbw?\\|ru\\|rake\\|thor\\|jbuilder\\|rabl\\|gemspec\\|podspec\\)\\|/\\(?:Gem\\|Rake\\|Cap\\|Thor\\|Puppet\\|Berks\\|Brew\\|Vagrant\\|Guard\\|Pod\\)file\\)\\'" . ruby-mode) ("\\.re?st\\'" . rst-mode) ("\\.py[iw]?\\'" . python-mode) ("\\.m\\'" . octave-maybe-mode) ("\\.less\\'" . less-css-mode) ("\\.scss\\'" . scss-mode) ("\\.awk\\'" . awk-mode) ("\\.\\(u?lpc\\|pike\\|pmod\\(\\.in\\)?\\)\\'" . pike-mode) ("\\.idl\\'" . idl-mode) ("\\.java\\'" . java-mode) ("\\.m\\'" . objc-mode) ("\\.ii\\'" . c++-mode) ("\\.i\\'" . c-mode) ("\\.lex\\'" . c-mode) ("\\.y\\(acc\\)?\\'" . c-mode) ("\\.h\\'" . c-or-c++-mode) ("\\.c\\'" . c-mode) ("\\.\\(CC?\\|HH?\\)\\'" . c++-mode) ("\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\'" . c++-mode) ("\\.\\(cc\\|hh\\)\\'" . c++-mode) ("\\.\\(bat\\|cmd\\)\\'" . bat-mode) ("\\.[sx]?html?\\(\\.[a-zA-Z_]+\\)?\\'" . mhtml-mode) ("\\.svgz?\\'" . image-mode) ("\\.svgz?\\'" . xml-mode) ("\\.x[bp]m\\'" . image-mode) ("\\.x[bp]m\\'" . c-mode) ("\\.p[bpgn]m\\'" . image-mode) ("\\.tiff?\\'" . image-mode) ("\\.gif\\'" . image-mode) ("\\.png\\'" . image-mode) ("\\.jpe?g\\'" . image-mode) ("\\.te?xt\\'" . text-mode) ("\\.[tT]e[xX]\\'" . tex-mode) ("\\.ins\\'" . tex-mode) ("\\.ltx\\'" . latex-mode) ("\\.dtx\\'" . doctex-mode) ("\\.org\\'" . org-mode) ("\\.dir-locals\\(?:-2\\)?\\.el\\'" . lisp-data-mode) ("eww-bookmarks\\'" . lisp-data-mode) ("tramp\\'" . lisp-data-mode) ("/archive-contents\\'" . lisp-data-mode) ("places\\'" . lisp-data-mode) ("\\.emacs-places\\'" . lisp-data-mode) ("\\.el\\'" . emacs-lisp-mode) ("Project\\.ede\\'" . emacs-lisp-mode) ("\\.\\(scm\\|stk\\|ss\\|sch\\)\\'" . scheme-mode) ("\\.l\\'" . lisp-mode) ("\\.li?sp\\'" . lisp-mode) ("\\.[fF]\\'" . fortran-mode) ("\\.for\\'" . fortran-mode) ("\\.p\\'" . pascal-mode) ("\\.pas\\'" . pascal-mode) ("\\.\\(dpr\\|DPR\\)\\'" . delphi-mode) ("\\.\\([pP]\\([Llm]\\|erl\\|od\\)\\|al\\)\\'" . perl-mode) ("Imakefile\\'" . makefile-imake-mode) ("Makeppfile\\(?:\\.mk\\)?\\'" . makefile-makepp-mode) ("\\.makepp\\'" . makefile-makepp-mode) ("\\.mk\\'" . makefile-bsdmake-mode) ("\\.make\\'" . makefile-bsdmake-mode) ("GNUmakefile\\'" . makefile-gmake-mode) ("[Mm]akefile\\'" . makefile-bsdmake-mode) ("\\.am\\'" . makefile-automake-mode) ("\\.texinfo\\'" . texinfo-mode) ("\\.te?xi\\'" . texinfo-mode) ("\\.[sS]\\'" . asm-mode) ("\\.asm\\'" . asm-mode) ("\\.css\\'" . css-mode) ("\\.mixal\\'" . mixal-mode) ("\\.gcov\\'" . compilation-mode) ("/\\.[a-z0-9-]*gdbinit" . gdb-script-mode) ("-gdb\\.gdb" . gdb-script-mode) ("[cC]hange\\.?[lL]og?\\'" . change-log-mode) ("[cC]hange[lL]og[-.][0-9]+\\'" . change-log-mode) ("\\$CHANGE_LOG\\$\\.TXT" . change-log-mode) ("\\.scm\\.[0-9]*\\'" . scheme-mode) ("\\.[ckz]?sh\\'\\|\\.shar\\'\\|/\\.z?profile\\'" . sh-mode) ("\\.bash\\'" . sh-mode) ("/PKGBUILD\\'" . sh-mode) ("\\(/\\|\\`\\)\\.\\(bash_\\(profile\\|history\\|log\\(in\\|out\\)\\)\\|z?log\\(in\\|out\\)\\)\\'" . sh-mode) ("\\(/\\|\\`\\)\\.\\(shrc\\|zshrc\\|m?kshrc\\|bashrc\\|t?cshrc\\|esrc\\)\\'" . sh-mode) ("\\(/\\|\\`\\)\\.\\([kz]shenv\\|xinitrc\\|startxrc\\|xsession\\)\\'" . sh-mode) ("\\.m?spec\\'" . sh-mode) ("\\.m[mes]\\'" . nroff-mode) ("\\.man\\'" . nroff-mode) ("\\.sty\\'" . latex-mode) ("\\.cl[so]\\'" . latex-mode) ("\\.bbl\\'" . latex-mode) ("\\.bib\\'" . bibtex-mode) ("\\.bst\\'" . bibtex-style-mode) ("\\.sql\\'" . sql-mode) ("\\(acinclude\\|aclocal\\|acsite\\)\\.m4\\'" . autoconf-mode) ("\\.m[4c]\\'" . m4-mode) ("\\.mf\\'" . metafont-mode) ("\\.mp\\'" . metapost-mode) ("\\.vhdl?\\'" . vhdl-mode) ("\\.article\\'" . text-mode) ("\\.letter\\'" . text-mode) ("\\.i?tcl\\'" . tcl-mode) ("\\.exp\\'" . tcl-mode) ("\\.itk\\'" . tcl-mode) ("\\.icn\\'" . icon-mode) ("\\.sim\\'" . simula-mode) ("\\.mss\\'" . scribe-mode) ("\\.f9[05]\\'" . f90-mode) ("\\.f0[38]\\'" . f90-mode) ("\\.indent\\.pro\\'" . fundamental-mode) ("\\.\\(pro\\|PRO\\)\\'" . idlwave-mode) ("\\.srt\\'" . srecode-template-mode) ("\\.prolog\\'" . prolog-mode) ("\\.tar\\'" . tar-mode) ("\\.\\(arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|cbr\\|7z\\|squashfs\\|ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|CBR\\|7Z\\|SQUASHFS\\)\\'" . archive-mode) ("\\.oxt\\'" . archive-mode) ("\\.\\(deb\\|[oi]pk\\)\\'" . archive-mode) ("\\`/tmp/Re" . text-mode) ("/Message[0-9]*\\'" . text-mode) ("\\`/tmp/fol/" . text-mode) ("\\.oak\\'" . scheme-mode) ("\\.sgml?\\'" . sgml-mode) ("\\.x[ms]l\\'" . xml-mode) ("\\.dbk\\'" . xml-mode) ("\\.dtd\\'" . sgml-mode) ("\\.ds\\(ss\\)?l\\'" . dsssl-mode) ("\\.js[mx]?\\'" . javascript-mode) ("\\.har\\'" . javascript-mode) ("\\.json\\'" . javascript-mode) ("\\.[ds]?va?h?\\'" . verilog-mode) ("\\.by\\'" . bovine-grammar-mode) ("\\.wy\\'" . wisent-grammar-mode) ("[:/\\]\\..*\\(emacs\\|gnus\\|viper\\)\\'" . emacs-lisp-mode) ("\\`\\..*emacs\\'" . emacs-lisp-mode) ("[:/]_emacs\\'" . emacs-lisp-mode) ("/crontab\\.X*[0-9]+\\'" . shell-script-mode) ("\\.ml\\'" . lisp-mode) ("\\.ld[si]?\\'" . ld-script-mode) ("ld\\.?script\\'" . ld-script-mode) ("\\.xs\\'" . c-mode) ("\\.x[abdsru]?[cnw]?\\'" . ld-script-mode) ("\\.zone\\'" . dns-mode) ("\\.soa\\'" . dns-mode) ("\\.asd\\'" . lisp-mode) ("\\.\\(asn\\|mib\\|smi\\)\\'" . snmp-mode) ("\\.\\(as\\|mi\\|sm\\)2\\'" . snmpv2-mode) ("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode) ("\\.\\(dif\\|pat\\)\\'" . diff-mode) ("\\.[eE]?[pP][sS]\\'" . ps-mode) ("\\.\\(?:PDF\\|DVI\\|OD[FGPST]\\|DOCX\\|XLSX?\\|PPTX?\\|pdf\\|djvu\\|dvi\\|od[fgpst]\\|docx\\|xlsx?\\|pptx?\\)\\'" . doc-view-mode-maybe) ("configure\\.\\(ac\\|in\\)\\'" . autoconf-mode) ("\\.s\\(v\\|iv\\|ieve\\)\\'" . sieve-mode) ("BROWSE\\'" . ebrowse-tree-mode) ("\\.ebrowse\\'" . ebrowse-tree-mode) ("#\\*mail\\*" . mail-mode) ("\\.g\\'" . antlr-mode) ("\\.mod\\'" . m2-mode) ("\\.ses\\'" . ses-mode) ("\\.docbook\\'" . sgml-mode) ("\\.com\\'" . dcl-mode) ("/config\\.\\(?:bat\\|log\\)\\'" . fundamental-mode) ("/\\.\\(authinfo\\|netrc\\)\\'" . authinfo-mode) ("\\.\\(?:[iI][nN][iI]\\|[lL][sS][tT]\\|[rR][eE][gG]\\|[sS][yY][sS]\\)\\'" . conf-mode) ("\\.la\\'" . conf-unix-mode) ("\\.ppd\\'" . conf-ppd-mode) ("java.+\\.conf\\'" . conf-javaprop-mode) ("\\.properties\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" . conf-javaprop-mode) ("\\.toml\\'" . conf-toml-mode) ("\\.desktop\\'" . conf-desktop-mode) ("/\\.redshift\\.conf\\'" . conf-windows-mode) ("\\`/etc/\\(?:DIR_COLORS\\|ethers\\|.?fstab\\|.*hosts\\|lesskey\\|login\\.?de\\(?:fs\\|vperm\\)\\|magic\\|mtab\\|pam\\.d/.*\\|permissions\\(?:\\.d/.+\\)?\\|protocols\\|rpc\\|services\\)\\'" . conf-space-mode) ("\\`/etc/\\(?:acpid?/.+\\|aliases\\(?:\\.d/.+\\)?\\|default/.+\\|group-?\\|hosts\\..+\\|inittab\\|ksysguarddrc\\|opera6rc\\|passwd-?\\|shadow-?\\|sysconfig/.+\\)\\'" . conf-mode) ("[cC]hange[lL]og[-.][-0-9a-z]+\\'" . change-log-mode) ("/\\.?\\(?:gitconfig\\|gnokiirc\\|hgrc\\|kde.*rc\\|mime\\.types\\|wgetrc\\)\\'" . conf-mode) ("/\\.\\(?:asound\\|enigma\\|fetchmail\\|gltron\\|gtk\\|hxplayer\\|mairix\\|mbsync\\|msmtp\\|net\\|neverball\\|nvidia-settings-\\|offlineimap\\|qt/.+\\|realplayer\\|reportbug\\|rtorrent\\.\\|screen\\|scummvm\\|sversion\\|sylpheed/.+\\|xmp\\)rc\\'" . conf-mode) ("/\\.\\(?:gdbtkinit\\|grip\\|mpdconf\\|notmuch-config\\|orbital/.+txt\\|rhosts\\|tuxracer/options\\)\\'" . conf-mode) ("/\\.?X\\(?:default\\|resource\\|re\\)s\\>" . conf-xdefaults-mode) ("/X11.+app-defaults/\\|\\.ad\\'" . conf-xdefaults-mode) ("/X11.+locale/.+/Compose\\'" . conf-colon-mode) ("/X11.+locale/compose\\.dir\\'" . conf-javaprop-mode) ("\\.~?[0-9]+\\.[0-9][-.0-9]*~?\\'" nil t) ("\\.\\(?:orig\\|in\\|[bB][aA][kK]\\)\\'" nil t) ("[/.]c\\(?:on\\)?f\\(?:i?g\\)?\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" . conf-mode-maybe) ("\\.[1-9]\\'" . nroff-mode) ("\\.art\\'" . image-mode) ("\\.avs\\'" . image-mode) ("\\.bmp\\'" . image-mode) ("\\.cmyk\\'" . image-mode) ("\\.cmyka\\'" . image-mode) ("\\.crw\\'" . image-mode) ("\\.dcr\\'" . image-mode) ("\\.dcx\\'" . image-mode) ("\\.dng\\'" . image-mode) ("\\.dpx\\'" . image-mode) ("\\.fax\\'" . image-mode) ("\\.hrz\\'" . image-mode) ("\\.icb\\'" . image-mode) ("\\.icc\\'" . image-mode) ("\\.icm\\'" . image-mode) ("\\.ico\\'" . image-mode) ("\\.icon\\'" . image-mode) ("\\.jbg\\'" . image-mode) ("\\.jbig\\'" . image-mode) ("\\.jng\\'" . image-mode) ("\\.jnx\\'" . image-mode) ("\\.miff\\'" . image-mode) ("\\.mng\\'" . image-mode) ("\\.mvg\\'" . image-mode) ("\\.otb\\'" . image-mode) ("\\.p7\\'" . image-mode) ("\\.pcx\\'" . image-mode) ("\\.pdb\\'" . image-mode) ("\\.pfa\\'" . image-mode) ("\\.pfb\\'" . image-mode) ("\\.picon\\'" . image-mode) ("\\.pict\\'" . image-mode) ("\\.rgb\\'" . image-mode) ("\\.rgba\\'" . image-mode) ("\\.tga\\'" . image-mode) ("\\.wbmp\\'" . image-mode) ("\\.webp\\'" . image-mode) ("\\.wmf\\'" . image-mode) ("\\.wpg\\'" . image-mode) ("\\.xcf\\'" . image-mode) ("\\.xmp\\'" . image-mode) ("\\.xwd\\'" . image-mode) ("\\.yuv\\'" . image-mode) ("\\.tgz\\'" . tar-mode) ("\\.tbz2?\\'" . tar-mode) ("\\.txz\\'" . tar-mode) ("\\.tzst\\'" . tar-mode) ("\\.vue\\'" . web-mode)) ```
jsmestad commented 3 years ago

Looking through the ordering, the .l?eex check is before the mhtml-mode check so I would guess that is not it 🤷

raxod502 commented 3 years ago

Okay... so I installed Prettier and prettier-plugin-eex locally, added your auto-mode-alist entry for .l?eex files, created a file hello.html.eex and pasted some sample code into it. When I open the file originally, it's web-mode, and remains as such after being reformatted. So maybe some other Emacs configuration interfering?

You could try this:

(advice-add #'mhtml-mode :override #'error)  ; (advice-remove #'mhtml-mode #'error)
(setq debug-on-error t)

and then you might be able to get a stack trace when mhtml-mode is activated. I'm not totally sure if this would work, but it could be a starting point.

raxod502 commented 3 years ago

Does https://github.com/raxod502/apheleia/commit/f865c165dac606187a66b2b25a57d5099b452120 fix this issue for you?

hermann-p commented 3 years ago

Although related, I'm not sure if my issue is exactly the same, so when it isn't I'll gladly re-open it as a new one. My apheleia was freshly built from source yesterday (commit is f865c16), and like OP I'm also using doom emacs.

Sometimes I have to switch major modes when editing a buffer (in my case I sometimes need to switch a .tsx file which gets automatically opened as typescript-tsx to typescript for some specific editings). While apheleia smoothly prettifies while staying on point, it also always switches back to the mode defined in the autoload alist after saving. Is this intentional behaviour, or is there some way to respect what major mode was active before saving?

raxod502 commented 3 years ago

If that happens, it's a bug. No extra code should be getting run when Apheleia formats.

hermann-p commented 3 years ago

Anything I can do to help debugging?

raxod502 commented 3 years ago

Hey @hermann-p, sorry for the delay! Just got back from vacation and catching up on email. Unfortunately there's not a lot of specific advice I can give on getting to the root of this problem. What I'd do is do into Apheleia and start inserting debugging statements, e.g. (message "stuff") at various places in the code, which can help to establish what functions are being run and when. You also might have luck with M-x toggle-debug-on-error and then inserting an (error "oh noes") somewhere, which could trigger a stack trace that would tell you "how did we get to running this function?".

jsmestad commented 3 years ago

Going to give this another try shortly. I have not forgotten 👍

raxod502 commented 2 years ago

This thread is being closed automatically by Tidier because it is labeled with "waiting on response" and has not seen any activity for 90 days. But don't worry—if you have any information that might advance the discussion, leave a comment and I will be happy to reopen the thread :)