seagle0128 / grip-mode

Instant Github-flavored Markdown/Org preview using grip
GNU General Public License v3.0
269 stars 6 forks source link

work with markdown files edited with tramp? #5

Closed idcrook closed 4 years ago

idcrook commented 4 years ago

Does grip-mode work with files being edited using Tramp mode?

Tramp mode allows emacs user to edit files located on a remote machine "transparently" to user, in the backend using, e.g., ssh or scp

When I try to preview using grip-mode in Emacs, I see the following in `Messages buffer:

Tramp: Encoding local file ‘/var/folders/vf/ll67jl_j0m996xwvpty_ssdm0000gn/T/tramp.zJeD5Z.tmp’ using ‘base64-encode-region’...done
Tramp: Decoding remote file ‘/ssh:rpit8:/home/pi/projects/raspi-receiver-remote-control/README.md.tmp’ using ‘base64 -d -i >%s’...done
Preview /ssh:rpit8:/home/pi/projects/raspi-receiver-remote-control/README.md on http://localhost:18693

The file in this example is /ssh:rpit8:/home/pi/projects/raspi-receiver-remote-control/README.md and there's a README.md.tmp file visible on the remote filesystem next to README.md

But there's no grip server I can find, either remotely or locally, and no browser view. My setup is running Emacs27 on macOS and trying to preview edits for markdown files on a remote Raspberry Pi (Raspian).

Is it possible that this feature might involve optionally having the .tmp file be placed on the "local" machine's operating system temp-dir (where Emacs is running) and sending that locally visible file location to grip?

seagle0128 commented 4 years ago

I committed the codes to use the local temp file to preview. Please test if it works for you.

idcrook commented 4 years ago

Tested on Emacs27 running on macOS editing a file over tramp/ssh, and this latest commit from master worked out of the box to preview. Thank you! 🥇