From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rudolf =?utf-8?Q?Adamkovi=C4=8D?= Newsgroups: gmane.emacs.orgmode,gmane.emacs.bugs Subject: Re: 29.0.50; [WISH]: Let us make EWW browse WWW Org files correctly Date: Wed, 26 Oct 2022 15:00:02 +0200 Message-ID: References: <86bkq0qf8p.fsf@protected.rcdrun.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31071"; mail-complaints-to="usenet@ciao.gmane.io" Cc: bug-gnu-emacs@gnu.org, emacs-orgmode@gnu.org To: Jean Louis , Ag Ibragimov Original-X-From: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Wed Oct 26 15:06:58 2022 Return-path: Envelope-to: geo-emacs-orgmode@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 1ong7W-0007qN-Df for geo-emacs-orgmode@m.gmane-mx.org; Wed, 26 Oct 2022 15:06:58 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ong6v-0000dY-RQ; Wed, 26 Oct 2022 09:06:22 -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 1ong6t-00007z-9Q for emacs-orgmode@gnu.org; Wed, 26 Oct 2022 09:06:19 -0400 Original-Received: from qs51p00im-qukt01071702.me.com ([17.57.155.7]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ong6r-0002fU-IA for emacs-orgmode@gnu.org; Wed, 26 Oct 2022 09:06:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1666789206; bh=A8VSVCXQk6Ptxabhct77mqmFGoEyM90y/qb39Nzt7OU=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=n09rLbOhdpz7vzpAgu9ohMZW2bKZZvHmUGBILeiCOWu7To+oHJxhIfxu8XrgiIiZP sacn7Q1bOAHbsUadgETuPJ68vx//7z5kngYxEqe4/OWHw2RD9Ea5V+TIQ+K8pB6bXm RWvlNR0CE4/09JgSjoSfiWXP+uG6EV7GKCAzIDcXnCffAtygME5foLdp7P5Atzi/C8 xxo441jvJgABwHINCA2cb9ydkNKOX5LsEUUhcZfvbRX/AXpsAwjA4qnGS97pNDZhHv S8ahnJ/CPIamPbobv0XLCNDA6G0V+QdS7utNo8P+He4+x4sCF1Lamb/gp8Tqsexdkx xNd0PxYo43HZQ== Original-Received: from Rudolfs-MacBook-Air.local (qs51p00im-dlb-asmtp-mailmevip.me.com [17.57.155.28]) by qs51p00im-qukt01071702.me.com (Postfix) with ESMTPSA id C7BE93500699; Wed, 26 Oct 2022 13:00:05 +0000 (UTC) In-Reply-To: X-Proofpoint-ORIG-GUID: -wOhb8PLesKNFbNb2ry_OpuoO5r5iWpf X-Proofpoint-GUID: -wOhb8PLesKNFbNb2ry_OpuoO5r5iWpf X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.425,18.0.572,17.0.605.474.0000000_definitions?= =?UTF-8?Q?=3D2022-01-11=5F01:2022-01-11=5F01,2020-02-14=5F11,2020-01-23?= =?UTF-8?Q?=5F02_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 bulkscore=0 mlxlogscore=318 adultscore=0 clxscore=1011 mlxscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210260073 Received-SPF: pass client-ip=17.57.155.7; envelope-from=salutis@me.com; helo=qs51p00im-qukt01071702.me.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "Emacs-orgmode" Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.orgmode:149935 gmane.emacs.bugs:246222 Archived-At: Jean Louis writes: >> This should be trivial to do, I think. +1 and I say: consider contributing to EWW! I noticed that the EWW manual says PDFs are viewed inline, by default, with doc-view-mode, but this can be customized by using the mailcap (see mailcap in Emacs MIME Manual) mechanism, in particular mailcap-mime-data. For some reason, it made me think that EWW uses MIME correctly. 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. In eww.el, the eww-render procedure parses the content-type header and stores its value in a local let binding. After that, it dispatches to the various "display" procedures EWW comes with, such as ((equal (car content-type) "application/pdf") (eww-display-pdf)) The eww-display-pdf procedure then looks up the MIME viewer for the application/pdf MIME type specifically. If no dispatch fits, EWW ends up calling eww-display-raw. 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. You could hack something local to you as well, but a patch would make EWW better for all of us. So, win-win! Rudy --=20 "Programming reliably -- must be an activity of an undeniably mathematical nature [=E2=80=A6] You see, mathematics is about thinking, and doing mathematics is always trying to think as well as possible." -- Edsger W. Dijkstra, 1981 Rudolf Adamkovi=C4=8D [he/him] Studenohorsk=C3=A1 25 84103 Bratislava Slovakia