From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id sKH9APIwWWOyPQAAbAwnHQ (envelope-from ) for ; Wed, 26 Oct 2022 15:06:58 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id qKgDAfIwWWPQGQAA9RJhRA (envelope-from ) for ; Wed, 26 Oct 2022 15:06:58 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9A8F61A2FE for ; Wed, 26 Oct 2022 15:06:57 +0200 (CEST) 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 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 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== 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) From: Rudolf =?utf-8?Q?Adamkovi=C4=8D?= To: Jean Louis , Ag Ibragimov Cc: bug-gnu-emacs@gnu.org, emacs-orgmode@gnu.org Subject: Re: 29.0.50; [WISH]: Let us make EWW browse WWW Org files correctly In-Reply-To: References: <86bkq0qf8p.fsf@protected.rcdrun.com> Date: Wed, 26 Oct 2022 15:00:02 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: , Sender: "Emacs-orgmode" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1666789617; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=A8VSVCXQk6Ptxabhct77mqmFGoEyM90y/qb39Nzt7OU=; b=OK83AWZiapCdilfEFY8eE3gjZdYV5KyLLYMveV+bKMB4DXAjgyUibilQl8oW5RifwcZxlf ZkHGe9ZOGwziMjtXNeiYIfjHyCxXHyeCd4fDRMPJEbv97pIqPvwbM1sssqqyqgM6ugmBVm ITIYmrSgyNlcGPxbdVJleqYoQJk2Yn54k9JuOg/cjNWpojOx8SxhB5VcHXCGbfUL8VvSOx iG5f+1cg9cHPIhQ65MKCJUAyYdOPxkL11HJIsnW9B6TropJZbJDdfRU+wwwBO31Hzva1ta qsb3Z+XFdE4ijE9FdWtxMQNkDyCFs7DPLY+xEGvRwb/finlW+KqJv5143FIl8Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1666789617; a=rsa-sha256; cv=none; b=J97RnT1KphEmE08ALAgo5PdG1jKBlu7N4T29w4hk5nWjfLfv/AU5TObMwI2CYhLdygqXeu lyEJUpkIEweWvKmWVYFO8to00WB3+LYY+Wc7/9dxgjXfSmArFzVpLHHUXXQxEnwtp1tUHg GV8fioLQ8E9u21wF4rQuYL5mPjgDnL2HP3Mk3rL9BcRdCp2PoAOkrFtAZmv7nGaFqYpHQX vQgrEXF2xGk2ZTtcUbHJDXwSnM5rzu52+ufZ+jxrOoS+HVROP5f/BfsjD7X9H+RW8ezV5/ PKoLLFh7mlfz85rhOC2L66xVtdsDiVzUKkG/LKddTzfa70RQQwyg3VTzP1fOeg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=me.com header.s=1a1hai header.b=n09rLbOh; dmarc=pass (policy=quarantine) header.from=me.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.52 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=me.com header.s=1a1hai header.b=n09rLbOh; dmarc=pass (policy=quarantine) header.from=me.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 9A8F61A2FE X-Spam-Score: -2.52 X-Migadu-Scanner: scn1.migadu.com X-TUID: TDUYEkPr7FKR 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