emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Vincent Belaïche" <vincent.b.1@hotmail.fr>
To: Eli Zaretskii <eliz@gnu.org>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>,
	"brandelune@gmail.com" <brandelune@gmail.com>,
	"emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: RE: info URL « open at point » patch
Date: Wed, 27 Jun 2018 17:39:33 +0000	[thread overview]
Message-ID: <AM6PR10MB19573F76F06D5DCC04FA507E84480@AM6PR10MB1957.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <83muvhr4zp.fsf@gnu.org>

Hello Eli,
Concerning the patch, I understood that you agree with it provided that
it is upgraded to mention the change in the etc/NEWS file. So I did that
& pushed the change.
Concerning your point « Modularity doesn't mean each module must be
standalone and self-contained », I agree, and I did not say that there
would be anything wrong for e.g. browse-url.el to use a utility function
defined elsewhere. Modules are supposed to interact with each other, and
that implies that they cannot be fully standalone. However, modulary
means that one should observe some functional split: any package, to be
called a package, should have in its documentation some terms of
reference saying its purpose and listing what functions it
accomplishes. While the purpose of the info package is not primarily url
manipulation, I had suspected that this sort function was encompassed by
the package providing the browse-url function, and that is why I stated
that it would be a better modularity if info was relying on a function
provided elsewhere --- which indeed is the opposite statement as saying
that info has to be standalone and self-contain, and as such re-invent
the wheel of url manipulation by itself.
Maybe my mistake was however to assume that 'elsewhere' would be best in
the same package as that providing 'browse-url', but anyhow, I stand on
my point that keeping some URL format specific
"\\(?:f\\(?:ile\\|tp\\)\\|https?\\)://" regexp within the the
Info-follow-nearest-node is not very good from a modularity point of
view.

BTW, the 'browse-url-url-at-point' is not documented by a docstring, so
can we assume that it is usable outside browse-url ?
Anyway, looking at the code I realized that the real work of grabbing
the URL is delegated to the thingatpt package, so my suggestion would be
that info should also use thingatpt. Probably it would be even better
with something like the following construct to remove info URI from
those allowed, as they would better be handled from the info browser
itself:
(let* ((uri-schemes (copy-sequence thing-at-point-uri-schemes))
       (info-uri (car-safe (member "info:" uri-schemes)))
       (thing-at-point-uri-schemes (delq info-uri uri-schemes)))
       (thing-at-point 'url t))
OK, the info browser does not directly knows about info URL, so some
additional work is needed to catch them too. To me this is a real corner
case scenario to refer to a document inside a Texinfo docuemnt via an
info URL: that would mean the document is available only in info format,
ie has not be published in Texinfo. I am not even sure that such
document exists. Aren't info URL meant only to refer to info document
from document written with something else than Texinfo ?
  V.

De : Eli Zaretskii <eliz@gnu.org>
Envoyé : mardi 26 juin 2018 16:34
À : Vincent Belaïche
Cc : emacs-orgmode@gnu.org; brandelune@gmail.com; emacs-devel@gnu.org
Objet : Re: info URL « open at point » patch 
 
> From: Vincent Belaïche <vincent.b.1@hotmail.fr>
> CC: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
> Date: Tue, 26 Jun 2018 05:47:04 +0000
> 
> My point is that for a modular design, the same package that provides
> the browse-url function, should also provide some match-url-at-point-p
> predicate, e.g.
There is such a function: browse-url-url-at-point.
But in general, I don't agree with your assertion: there's nothing
wrong for, e.g., browse-url.el to use a utility function declared
somewhere else.  Modularity doesn't mean each module must be
standalone and self-contained.

  reply	other threads:[~2018-06-27 17:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-24  6:57 info URL « open at point » patch Vincent Belaïche
2018-06-24 14:31 ` Eli Zaretskii
2018-06-24 16:48   ` Vincent Belaïche
2018-06-24 16:49     ` Vincent Belaïche
2018-06-24 17:03     ` Eli Zaretskii
2018-06-24 18:21       ` Vincent Belaïche
2018-06-24 18:45         ` Eli Zaretskii
2018-06-24 20:34           ` Vincent Belaïche
2018-06-25  2:30             ` Eli Zaretskii
2018-06-26  5:19               ` Vincent Belaïche
2018-06-26  5:47                 ` Vincent Belaïche
2018-06-26 14:34                   ` Eli Zaretskii
2018-06-27 17:39                     ` Vincent Belaïche [this message]
2018-06-27 18:11                       ` Eli Zaretskii
2018-06-26 14:30                 ` Eli Zaretskii
2018-06-24 14:46 ` Jean-Christophe Helary
2018-06-24 20:30   ` Vincent Belaïche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM6PR10MB19573F76F06D5DCC04FA507E84480@AM6PR10MB1957.EURPRD10.PROD.OUTLOOK.COM \
    --to=vincent.b.1@hotmail.fr \
    --cc=brandelune@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).