From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.bugs Subject: bug#58774: 29.0.50; [WISH]: Let us make EWW browse WWW Org files correctly Date: Wed, 26 Oct 2022 16:42:06 +0300 Message-ID: References: <86bkq0qf8p.fsf@protected.rcdrun.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4022"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.2.7+37 (a90f69b) (2022-09-02) Cc: 58774@debbugs.gnu.org, emacs-orgmode@gnu.org, Ag Ibragimov To: Rudolf =?UTF-8?Q?Adamkovi=C4=8D?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 26 15:44:31 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1onghq-0000sz-R3 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 26 Oct 2022 15:44:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1onggS-0007UW-8e; Wed, 26 Oct 2022 09:43:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onggQ-0006xP-UK for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2022 09:43:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1onggQ-0001Mw-3A for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2022 09:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1onggP-00017A-TK for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2022 09:43:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jean Louis Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Oct 2022 13:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58774 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix Original-Received: via spool by 58774-submit@debbugs.gnu.org id=B58774.16667917544251 (code B ref 58774); Wed, 26 Oct 2022 13:43:01 +0000 Original-Received: (at 58774) by debbugs.gnu.org; 26 Oct 2022 13:42:34 +0000 Original-Received: from localhost ([127.0.0.1]:53747 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ongfy-00016V-Ah for submit@debbugs.gnu.org; Wed, 26 Oct 2022 09:42:34 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:55021) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ongfw-00016M-EB for 58774@debbugs.gnu.org; Wed, 26 Oct 2022 09:42:32 -0400 Original-Received: from localhost ([::ffff:197.239.4.142]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 0000000000081D92.0000000063593947.00007E23; Wed, 26 Oct 2022 06:42:30 -0700 Mail-Followup-To: Rudolf =?UTF-8?Q?Adamkovi=C4=8D?= , Ag Ibragimov , 58774@debbugs.gnu.org, emacs-orgmode@gnu.org Content-Disposition: inline In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246232 Archived-At: * Rudolf Adamkovič via "Bug reports for GNU Emacs, the Swiss army knife of text editors [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/