all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Jean Louis <bugs@gnu.support>
Cc: Help GNU Emacs <help-gnu-emacs@gnu.org>
Subject: RE: [External] : Any packages using ThingAtPointPlus for activation?
Date: Wed, 4 Jan 2023 15:42:20 +0000	[thread overview]
Message-ID: <SJ0PR10MB548858E5D0AACCEADDF9409AF3F59@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <Y7U89H7WBXIR3LuW@protected.localdomain>

> > > You referred to let
> > > inside of `cond' but me, I would let using `let' to
> > > get the preferred thing-at-point before the `cond'.
> >
> > No, I didn't.  I meant what you said: use `let' to
> > bind a var to the THING you want.  Then use `cond' or
> > `cl-case' or whatever to test that value using the var.
> 
> `cond' is the one to recognize which type of
> thing at point is there, as I need to recognize
> among many various conditions, and they
> may not be only thing at point.

Sorry, I forgot your original code.  Yes, you're
checking for a given THING in each `cond' clause.
And then you use the same `thing-at-point' call
again, after knowing that you've found a THING
of the given type, in order to do something with it.

My original reply was OK; my reply quoted above was
mistaken, as I'd forgotten what you were doing.

You could nevertheless avoid repeating the same
`thing-at-point' call in each clause, if you
wanted.  I agree that in most cases the time
spent, and the added noise (repetition) in the
code, are both negligible.

But if you did want to avoid the repetition you
could do this:

(let (thg) ; Just bind it.
  (cond ((setq thg (thing-at-point 'uuid))
         (rcd-db-uuid-action thg))
        ((setq thg (thing-at-point 'url))
         (browse-url thg))
        ...))

  reply	other threads:[~2023-01-04 15:42 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-02 10:12 Any packages using ThingAtPointPlus for activation? Jean Louis
2023-01-02 17:08 ` [External] : " Drew Adams
2023-01-03 12:41   ` Jean Louis
2023-01-03 19:54     ` Drew Adams
2023-01-03 20:23       ` Jean Louis
2023-01-03 22:47         ` Drew Adams
2023-01-04  8:46           ` Jean Louis
2023-01-04 15:42             ` Drew Adams [this message]
2023-01-04 16:03             ` Eduardo Ochs
2023-01-05  5:42               ` Jean Louis
2023-01-05  8:37   ` ThingAtPointPlus, and extending things at point Jean Louis
2023-01-05 17:00     ` [External] : " Drew Adams
2023-01-06 15:49       ` Jean Louis
2023-01-06 16:23       ` Jean Louis
2023-01-06 17:30         ` Drew Adams
2023-01-06 17:43           ` Jean Louis
2023-01-06 18:21             ` Drew Adams
2023-01-03  6:16 ` Any packages using ThingAtPointPlus for activation? Eduardo Ochs
2023-01-03 13:10   ` Jean Louis

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=SJ0PR10MB548858E5D0AACCEADDF9409AF3F59@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=bugs@gnu.support \
    --cc=help-gnu-emacs@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 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.