Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot use flymd on mac #1

Closed
shelper opened this issue May 21, 2016 · 11 comments
Closed

cannot use flymd on mac #1

shelper opened this issue May 21, 2016 · 11 comments

Comments

@shelper
Copy link

shelper commented May 21, 2016

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
Copy link
Author

shelper commented May 21, 2016

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
Copy link
Owner

mola-T commented May 21, 2016

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
Copy link
Author

shelper commented May 21, 2016

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
Copy link
Owner

mola-T commented May 22, 2016

  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
Copy link
Author

shelper commented May 22, 2016

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
Copy link
Owner

mola-T commented May 23, 2016

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

@shelper
Copy link
Author

shelper commented May 23, 2016

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
Copy link
Author

shelper commented May 23, 2016

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 [email protected] 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
#1 (comment)

@mola-T
Copy link
Owner

mola-T commented May 24, 2016

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
Copy link
Author

shelper commented May 24, 2016

new issue opened for that , thanks

@shelper shelper closed this as completed May 24, 2016
@mshmyw
Copy link

mshmyw commented Mar 28, 2018

ok its work @mola-T

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants