GNU bug report logs -
#58774
29.0.50; [WISH]: Let us make EWW browse WWW Org files correctly
Previous Next
Reported by: Jean Louis <bugs <at> gnu.support>
Date: Tue, 25 Oct 2022 12:13:02 UTC
Severity: wishlist
Tags: wontfix
Found in version 29.0.50
Done: Stefan Kangas <stefankangas <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #69 received at 58774 <at> debbugs.gnu.org (full text, mbox):
* Rudolf Adamkovič via "Bug reports for GNU Emacs, the Swiss army knife of text editors <bug-gnu-emacs <at> gnu.org> [2022-10-26 16:10]:
> So, I evaluated
>
> (add-to-list 'mailcap-mime-data
> (list "org"
> (cons 'viewer 'org-mode)
> (cons 'type "text/x-org")))
>
> but it did not work. What the hack!
>
> To satisfy my curiosity, I decided to look at the source code.
Thank you for understanding!
> TL;DR EWW hard-codes a couple of MIME types.
>
> You could improve the situation in various ways.
>
> For example, you could
>
> (1) patch EWW to expose the eww-content-type for the user to use, or
> (2) patch EWW to look up MIME for not just the PDF.
Thank you for understanding. You have given me pointers what to do, my
personal case is closed, though I am not the one who knows how to
properly patch it, and I do not see yet that there is consensus, as
few people did not understand about user preferences and rather speak
how EWW should even take care of security issues for user instead of
giving user freedom.
I have done following to make it work personally:
(defvar eww-content-type nil)
(put 'eww-content-type 'permanent-local t)
;;; in eww-render I put:
;;; (setq eww-content-type content-type)
(defun rcd-eww-content-type ()
(cond ((string-match-p "text/x-org" (car eww-content-type)) (org-mode))
(t (eww-mode))))
It is not working best, help me if you know how. I wish normal
eww-mode when it is not org-mode.
(add-hook 'eww-after-render-hook 'rcd-eww-content-type)
And now I can browse Org files from within Emacs.
Video is here:
https://gnu.support/images/gnu-emacs/2022/10/2022-10-26/2022-10-26-16:35:20.ogv
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
This bug report was last modified 1 year and 259 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.