bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#32372: [PATCH] Add "uuid" to thing-at-point.el


From: Basil L. Contovounesios
Subject: bug#32372: [PATCH] Add "uuid" to thing-at-point.el
Date: Fri, 10 Aug 2018 01:20:13 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Raimon Grau <raimon@konghq.com> writes:

> Ivan Shmakov <ivan@siamics.net> writes:
>
>>      While either ‘and’ or ‘if’ can be used here, to exactly the same
>>      effect, the indentation above is one for ‘if’; ‘and’ should instead
>>      look like:
>>
>>            (and (thing-at-point-looking-at thing-at-point-uuid-regexp 36)
>>                 (cons (match-beginning 0) (match-end 0)))
>>
>>      I think in this case it’s marginally better to keep indentation
>>      and replace ‘and’ with ‘if’ than the other way around.
>
> What about `when'? Is it ok to use it?
>
> One branch 'if' look funny to me but I don't see many (any?) `when' in the 
> emacs
> codebase.

If you grep the codebase you will see countless occurences of and, or,
if-then, if-then-else, when, unless, etc.

What to use here is a mostly a matter of personal style, and a bit of a
bikeshed at that, so you are likely to get varied opinions.  At the end
of the day it doesn't really matter what you go with.

If you're interested in reading some opinions and common conventions on
this, see https://emacs.stackexchange.com/q/14195/15748.

FWIW, Ivan's argument to use 'if' instead of 'and' just to preserve
indentation doesn't apply here, as your patch is adding new code, not
modifying existing code in-place, where preserving surrounding
indentation would create a cleaner diff.

-- 
Basil





reply via email to

[Prev in Thread] Current Thread [Next in Thread]