msg2pdf or view-in-browser cygwin emacs/mu4e

71 views
Skip to first unread message

thirdsh...@gmail.com

unread,
Nov 5, 2017, 2:32:17 PM11/5/17
to mu-discuss
Hi-

I used to invoke emacs from mintty in cygwin. Now I added emacs-w32 package. Is
there a way I can add a symlink so the non minty version can find my
paths in my emacs config file that are posix like?

The reason I am trying is as many know pdf needs javascript turned off
for security.

Then if I want to use msg2pdf  OR view in browser in emacs I thought about running pdf viewer in
windows in a containter.

When I try to do Alt+X mu4e-view-action with lower case v it can't find
the path to msg2pdf if I am not running minty emacs that is more posix
friendly.

I think I can configure that pdf-viewer in windows run in containter by
default. At least that is my hope with comodo.


I doctored the path so you could see the problem in the url after running V for view in browser:

file:///cygdrive/c/cygwin64/tmp/mu4e-4212p70.html

I need cygwin to look there:

The actual path that comes up in the browser is this and windows doesn't
recognize this:

file:///tmp/mu4e-4212p70.html

That temporary html file is nowhere to be found even by using file explorer in windows. I am not 
sure why the temporary file is listed in the browser after running that event but not found on
my C: drive after a windows search and inspection looking for the file.

So, I guess, does anyone have luck running msg2pdf or view in browser in emacs with cygwin?

The emacs-w32 extra package in cygwin knows how to run the basic mu4e but any of these extra
programs tied to lisp events are failing (msg2pdf | text to html )

thx. -
Jim McNamara






thirdsh...@gmail.com

unread,
Nov 5, 2017, 3:18:11 PM11/5/17
to mu-discuss
Hi all-

I have good news to report.

Yes, it will run in comodo containter automatically.

I found what I need:

Alt+X browse-url-of-browser is the command to launch the buffer in html in my browser.

I just need to customize it so that the file path is right in the browser.

Unfortunately that takes lisp and I don't know any.

I will try to hack my way to a solution the extra mile using google.

So this is kind of cool. I can turn of javascript for pdf AND launch my html email in the comodo container with emacs in cygwin.

thx. -
Jim McNamara

thirdsh...@gmail.com

unread,
Nov 5, 2017, 4:15:33 PM11/5/17
to mu-discuss
Hi all-

Here is the website I am getting my hack from:

https://www.emacswiki.org/emacs/BrowseUrl

I am on the cusp of cobbling a solution without knowing lisp. I can't seem to add an
extra slash to the file path so it will render when I run:
Alt+X browse-url-of-buffer

(add-to-list 'mu4e-view-actions
  '("ViewInBrowser" . mu4e-action-view-in-browser) t)
  
    (setq browse-url-filename-alist
          '(("/webmaster@webserver:/home/www/html/" .
             "http://www.acme.co.uk/")
            ("^/\(ftp@\|anonymous@\)?\([^:]+\):/*" . "ftp://\2/")
            ("^/\([^:@]+@\)?\([^:]+\):/*" . "ftp://\1\2/")
            ("^/+" . "file:/"))) 
  
  (add-to-list 'browse-url-filename-alist
                 '("/tmp/" . "/cygdrive/c/cygwin64/tmp/"))  

 (setq gnus-button-url 'browse-url-generic
          browse-url-generic-program "/cygdrive/C/Program Files (x86)/Comodo/Dragon/dragon.exe"
          browse-url-browser-function gnus-button-url)

I have it mapped right with /tmp/ but can't add an extra slash to 
//cygdrive/c/cygwin64/tmp/

So this leads to one more question which is that how does :
Alt+X mu4e-view-action know to do V and render it as html?

I mean .... i'm guessing this other trick will render the file as not formatted because
I have not YET set up an html server to render it. I can do that but then it won't run 
in the container for comodo possibly. Not sure. It is some type of converter that the 
command sequence uses. Maybe browse-url-of-buffer has the same converter to 
view as Alt+X view-action-mu4e without pointing an html server to that location?

Please give me trick to add one more slash.

right now in the url it gives:
file://cygdrive/c/cygwin64/tmp/filename.html


thanks-
Jim McNamara


On Sunday, November 5, 2017 at 2:32:17 PM UTC-5, thirdsh...@gmail.com wrote:

thirdsh...@gmail.com

unread,
Nov 5, 2017, 4:57:45 PM11/5/17
to mu-discuss
Hi again-

I solved it. The order of operations adding it as a list needed to appear first.
So now I can view my html emacs in comdo internet pro 10 secured container
with the browser.

Here is the code:

 (add-to-list 'browse-url-filename-alist
                 '("/tmp/" . "file:///c:\cygwin64\tmp\"))  
  
  
  
    (setq browse-url-filename-alist
          '(("/webmaster@webserver:/home/www/html/" .
             "http://www.acme.co.uk/")
            ("^/\(ftp@\|anonymous@\)?\([^:]+\):/*" . "ftp://\2/")
            ("^/\([^:@]+@\)?\([^:]+\):/*" . "ftp://\1\2/")
            ("^/+" . "file:/"))) 
  
 

 (setq gnus-button-url 'browse-url-generic
          browse-url-generic-program "/cygdrive/C/Program Files (x86)/Comodo/Dragon/dragon.exe"
          browse-url-browser-function gnus-button-url)


Have a very cool rest of the weekend.

thx. -
Jim McNamara

thirdsh...@gmail.com

unread,
Nov 5, 2017, 4:59:40 PM11/5/17
to mu-discuss


On Sunday, November 5, 2017 at 2:32:17 PM UTC-5, thirdsh...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages