unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Bob Rogers <rogers-emacs@rgrjr.dyndns.org>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: Another issue with thingatpt
Date: Sun, 31 Dec 2006 12:24:22 -0500	[thread overview]
Message-ID: <17815.62022.147181.758643@rgrjr.dyndns.org> (raw)
In-Reply-To: <4597820F.9080906@easy-emacs.de>

   From: Andreas Roehler <andreas.roehler@easy-emacs.de>
   Date: Sun, 31 Dec 2006 10:25:35 +0100

   > Both interfaces (ffap and thing-at-point) are already customizable,
   > though in different ways. 

   There is no `defcustom'-form in thingatpt.el,
   it's done mostly with `defvar'. Wouldn't conceive that
   as customizable.

Not in the sense of defcustom, no.  But someone who can't "customize" it
themselves via setq is probably not going to be able to change these
hairy regexps and/or char-classes without shooting themselves in the
foot.  It's not just a matter of understanding Emacs regexps, but
understanding how thing-at-point uses them.

   In any case, it seems to me that users shouldn't need to change the
regexp proper, since that is defined by RFC3986, just the set of
punctuation characters to drop at the end.  The only thing that needs to
be customized is just the "lose the punctuation" heuristic, IMHO.  And
the definition of "punctuation" should be enlarged so that it addresses
Slawomir's issue with parens, which are not even allowed internally.

   The problem mentioned originally however shouldn't occur, as

   ,----
   | (defvar thing-at-point-url-path-regexp
   |   "[^]\t\n \"'()<>[^`{}]*[^]\t\n \"'()<>[^`{}.,;]+"
   |   "A regular expression probably matching the host and filename or 
   e-mail part of a URL.")
   `----

   includes that char. The error must reside elsewhere.

   Regards,

   Andreas Roehler

It does include a ";" in the second character class, but both are
inverted.  The second set is the same as the first set with the addition
of ".,;", which is why it refuses to match any of these characters at
the end of the URL.  This would be easier to see if the regexp were
written this way:

	(defvar thing-at-point-url-path-regexp
		(concat "[^]\t\n \"'()<>[^`{}]*"
			"[^]\t\n \"'()<>[^`{}.,;]+")
	  "A regular expression probably matching the host and filename or e-mail part of a URL.")

					-- Bob

  reply	other threads:[~2006-12-31 17:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <003001c727be$349c5a80$0203a8c0@HomeNetbbb0>
     [not found] ` <20061225.094150.13771816.wl@gnu.org>
     [not found]   ` <htx7iwdn717.fsf@urania.kanji.zinbun.kyoto-u.ac.jp>
2006-12-27 10:50     ` Another issue with thingatpt Werner LEMBERG
2006-12-27 20:29       ` Bob Rogers
2006-12-28  6:39         ` Werner LEMBERG
2006-12-29 21:23         ` Piet van Oostrum
2006-12-31  3:08           ` Bob Rogers
2006-12-31  9:25             ` Andreas Roehler
2006-12-31 17:24               ` Bob Rogers [this message]
2007-01-02 13:34                 ` Andreas Roehler
2007-01-03 14:50                 ` Andreas Roehler
2006-12-31 20:07             ` Piet van Oostrum

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.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=17815.62022.147181.758643@rgrjr.dyndns.org \
    --to=rogers-emacs@rgrjr.dyndns.org \
    --cc=emacs-devel@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.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).