all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jean Louis <bugs@gnu.support>
To: Drew Adams <drew.adams@oracle.com>
Cc: Help GNU Emacs <help-gnu-emacs@gnu.org>
Subject: Re: [External] : ThingAtPointPlus, and extending things at point
Date: Fri, 6 Jan 2023 19:23:49 +0300	[thread overview]
Message-ID: <Y7hLFYT6jkMEiD+C@protected.localdomain> (raw)
In-Reply-To: <SJ0PR10MB5488C85A03D9C437CECAE676F3FA9@SJ0PR10MB5488.namprd10.prod.outlook.com>

* Drew Adams <drew.adams@oracle.com> [2023-01-05 20:00]:
> Typically I SOFT-require a library and so take advantage of it only
> IF you _load_ it.  And in some cases certain commands in a library
> might themselves really require a particular library (in which case
> they're either not defined if that library isn't available or they
> raise an error telling you it's needed).

Yes, I have to adopt that approach, you use this:

(require 'naked nil t) ;; (no error if not found): naked-key-description

and then

(if (fbound 'naked-function)
    (naked-function)
  (otherwise-normal-function))

> > There is 'string and 'string-contents, really good.
> > 
> > Though in various modes 'string should be re-defined to support
> > various quotes in various modes, let us say in Perl.

I see it finds string in Perl, like:

print 'string';

(thing-at-point 'string-contents)

it finds:

#("string" 0 6 (face font-lock-string-face fontified t))

but not that it finds it in Elisp mode, because it is not string, and
also not in mail mode

> > I have examined (thing-at-point 'list):
> > - it works on '(1 "OK" 2) and then I can choose
> >   (thing-at-point 'list-contents) to get the elements
> > - but it does not work on (list 1 2 3), as there I get
> >   the element `list' by using 'list-contents, that is now
> >   what I expected, but OK, it is more generalized "list".
> 
> I guess you mean that you get the string "list 1 2 3".  That's
> correct - that's the text that's the list content.

Yes, I was thinking you made it so, low level.

> You might also be interested in my `find-where.el'.

I use following `cond' statement to find your library `find-where.el'
as people often quote in this way `'. What is the name of that type of
quoting?

The action button moves me to find-where.el

	((thing-at-point 'thing-within-grave-and-apostrophe)
	 (let ((thing (thing-at-point 'thing-within-grave-and-apostrophe)))
	   (cond ((file-exists-p thing) (find-file thing))
		 ((and (string-match "\\.el$" thing)
		       (locate-library (substring thing 0 (- (length thing) 3))))
		  (find-library thing)))))

Thanks, I find the function `fw-to-next-thing' very useful in this
unification of functions. It is reinventing the wheel what GNU
Hyperbole already has, with extensions.

I can imagine that `fw-to-next-thing' must be slower function right?
It is much slower then just using regular expression search. 

> https://www.emacswiki.org/emacs/FindWhere

Thanks.

> For example, you can find a text THING, such as the next vector with
> 13 elements, and have it returned along with its bounds (start and
> end positions).

That is useful. Let us say I wish to collect all the anchors in the
file, I can do it easier.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



  parent reply	other threads:[~2023-01-06 16:23 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
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 [this message]
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=Y7hLFYT6jkMEiD+C@protected.localdomain \
    --to=bugs@gnu.support \
    --cc=drew.adams@oracle.com \
    --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.