all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ivan Shmakov <ivan@siamics.net>
To: 32372@debbugs.gnu.org
Cc: Raimon Grau <raimon@konghq.com>, Noam Postavsky <npostavs@gmail.com>
Subject: bug#32372: [PATCH] Add "uuid" to thing-at-point.el
Date: Tue, 07 Aug 2018 13:17:21 +0000	[thread overview]
Message-ID: <87600m48pq.fsf@violet.siamics.net> (raw)
In-Reply-To: <87600m8vn9.fsf@konghq.com> (Raimon Grau's message of "Tue, 07 Aug 2018 08:48:26 +0100")

>>>>> Raimon Grau <raimon@konghq.com> writes:

	A few minor points.

[…]
 
 > +---
 > +** thingatpt.el supports a new "thing" called 'uuid'.
 > +
 > +A symbol 'uuid' can be passed to thing-at-point and it returns the
 > +uuid at point.

	I think the latter UUID should be spelled in all-caps.

[…]

 > +;; UUID
 > +
 > +(defvar thing-at-point-uuid-regexp

	There seem to be no precedent on the use of defconst in
	thingatpt.el, but given that the UUID format is ought to be
	stable, I guess this would be exactly the place for one.  Or?

 > +  (rx bow
 > +      (repeat 8 hex-digit) "-"
 > +      (repeat 4 hex-digit) "-"
 > +      (repeat 4 hex-digit) "-"
 > +      (repeat 4 hex-digit) "-"
 > +      (repeat 12 hex-digit)
 > +      eow)
 > +  "A regular expression matching a UUID.
 > +
 > +  More info on uuid's format in
 > +  https://tools.ietf.org/html/rfc4122." )

	AIUI, the docstrings are not indented like that; also, there
	should be no blank before the closing parenthesis.

	Given that there seem to be no URL references in thingatpt.el
	docstrings, either, I’d rather rewrite this one as:

+  "A regular expression matching a UUID.
+
+See RFC 4122 for the description of the format.")

 > +
 > +(put 'uuid 'bounds-of-thing-at-point
 > +     (lambda ()
 > +       (let ((thing (thing-at-point-looking-at
 > +                     thing-at-point-uuid-regexp 36)))
 > +         (if thing
 > +             (let ((beginning (match-beginning 0))
 > +                   (end (match-end 0)))
 > +               (cons beginning end))))))

	Why not simplify to (cons (match-beginning 0) (match-end 0))?

 > +
 >  ;;  Aliases

 >  (defun word-at-point ()

[…]

-- 
FSF associate member #7257  http://am-1.org/~ivan/





  reply	other threads:[~2018-08-07 13:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-05 23:11 bug#32372: [PATCH] Add "uuid" to thing-at-point.el Raimon Grau
2018-08-05 23:24 ` Raimon Grau
2018-08-06  2:31   ` Noam Postavsky
2018-08-06  9:47     ` Basil L. Contovounesios
2018-08-06  9:48     ` Raimon Grau
2018-08-06 19:16       ` Noam Postavsky
2018-08-07  7:48         ` Raimon Grau
2018-08-07 13:17           ` Ivan Shmakov [this message]
2018-08-07 17:45             ` Basil L. Contovounesios
2018-08-09 16:03             ` Raimon Grau
2018-08-09 18:12               ` Ivan Shmakov
2018-08-09 18:50                 ` Raimon Grau
2018-08-09 22:20                   ` Basil L. Contovounesios
2018-08-10  6:37                     ` Ivan Shmakov
2018-08-11 11:37                       ` Raimon Grau
2018-08-13 11:49                         ` Noam Postavsky

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

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

  git send-email \
    --in-reply-to=87600m48pq.fsf@violet.siamics.net \
    --to=ivan@siamics.net \
    --cc=32372@debbugs.gnu.org \
    --cc=npostavs@gmail.com \
    --cc=raimon@konghq.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.