mola-T / flymd

flymd - Emacs on the fly markdown preview
GNU General Public License v3.0
134 stars 18 forks source link

cannot use flymd on mac #1

Closed shelper closed 8 years ago

shelper commented 8 years ago

i installed firefox, and got this error: Debugger entered--Lisp error: (file-error "Searching for program" "no such file or directory" "firefox") start-process("firefox /Users/zyuan/develop/shelper_ghpages/posts/flymd.html" nil "firefox" "/Users/zyuan/develop/shelper_ghpages/posts/flymd.html") apply(start-process "firefox /Users/zyuan/develop/shelper_ghpages/posts/flymd.html" nil "firefox" "/Users/zyuan/develop/shelper_ghpages/posts/flymd.html") browse-url-firefox("/Users/zyuan/develop/shelper_ghpages/posts/flymd.html" nil) apply(browse-url-firefox "/Users/zyuan/develop/shelper_ghpages/posts/flymd.html" nil) browse-url("/Users/zyuan/develop/shelper_ghpages/posts/flymd.html") (let ((browse-url-browser-function (quote browse-url-firefox))) (browse-url url)) my-flymd-browser-function("/Users/zyuan/develop/shelper_ghpages/posts/flymd.html") flymd-open-browser(#) flymd-flyit() call-interactively(flymd-flyit record nil) command-execute(flymd-flyit record) helm-M-x(nil "flymd-flyit") call-interactively(helm-M-x nil nil) command-execute(helm-M-x)

i am not an elisp programmer,... so sorry that i cannot help to identify exact cause ...

shelper commented 8 years ago

if it were not so difficult, i would also suggest to enable chrome support, 'cus it is just so popular... another thing would be adding a customization of where to keep the temporal file flymd.md and flymd.html

thanks

mola-T commented 8 years ago

This should work on OSX to open firefox.

(defun my-flymd-browser-function (url)
  (let ((process-environment (browse-url-process-environment)))
    (apply 'start-process
           (concat "firefox " url)
           nil
           "/usr/bin/open"
           (list "-a" "firefox" url))))
(setq flymd-browser-open-function 'my-flymd-browser-function)

This use Safari:

(defun my-flymd-browser-function (url)
  (let ((process-environment (browse-url-process-environment)))
    (apply 'start-process
           (concat "Safari " url)
           nil
           "/usr/bin/open"
           (list "-a" "Safari" url))))
(setq flymd-browser-open-function 'my-flymd-browser-function)

Please report if they work. Thanks.

I would also suggest to enable chrome support.

It is technically impossible. Chrome forbids reading local file.

keep the temporal file flymd.md and flymd.html elsewhere.

If they kept elsewhere, images and links in markdown cannot render properly because they usually use relative path like [this_is_a_img](folder/img/this_is_a_img.jpg).

However, I can make a customization in next update so that these two files can be deleted upon buffer closed. Dose it help?

shelper commented 8 years ago

the firefox works, but the safari does not get real time update.

it would be nice if the two files can be deleted upon buffer closed it would be even nicer if the package provide something like a saving hook, so people can customize if they want to enable the deletion or not.

two more thoughts, 1st: why not you enable the syntax highlighting as default? 2nd: is it possible to enable the mathjax to render the equations in markdown?

great tool btw,

thanks

mola-T commented 8 years ago
  1. Em..... It is quite a long story to explain.
  2. You are not the first one asking for this feature. I tested mathjax. It is POSSIBLE to enable the mathjax to render the equations in markdown. But it is IMPOSSIBLE to be real time due to rendering speed and other issues. It means to be providing a click button to render the maths thing on click. Do you think it is still useful?
shelper commented 8 years ago

if that is the case, it is still useful to provide an option to enble mathjax rendering with a click button. just like the syntax higlight.

mola-T commented 8 years ago

Add flymd-close-buffer-delete-temp-files - Done. Add MathJaxize button - Done.

shelper commented 8 years ago

just want to report a bug. on windows you might need to the line below to change the url, at least for me using firefox 46 on windows 7, i need url to start with "file:/" using firefox 46 on windows 7,

  (defun my-flymd-browser-function (url)
    (if (string-equal system-type "windows-nt")
        (setq url (concat "file:/" url)))
    ...

meanwhile, i tested on my PC, mathjax (and syntax highlighting) is not that slow...

I don't know what is the tech issue behind that, but why not give user the option to enable the mathjax and syntax highlighting at their own risk of being slow?

shelper commented 8 years ago

I am using the flymd for two days now, another suggestion i would like to make is that most cases, i take a preview and i need to go back to emacs to continue to edit the md file. so after i run flymd-flyit, i would prefer to keep the focus/cursor in emacs rather than the firefox,

On Mon, May 23, 2016 at 4:28 AM, Mola-T notifications@github.com wrote:

Add flymd-close-buffer-delete-temp-files - Done. Add MathJaxize button - Done.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/mola-T/flymd/issues/1#issuecomment-220917580

mola-T commented 8 years ago

If you are really curious about mathjax and gfmize, please open separate issues for them. So I can just direct people who have the same question to the issue in the future.

Focus is control in OS level, you need external program to change focus.

shelper commented 8 years ago

new issue opened for that , thanks

mshmyw commented 6 years ago

ok its work @mola-T