unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Michael Heerdegen <michael_heerdegen@web.de>,
	"help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: RE: [External] : Re: Any word in mail-mode is recognized as (thing-at-point 'symbol)
Date: Mon, 2 Jan 2023 17:08:17 +0000	[thread overview]
Message-ID: <SJ0PR10MB5488044AB321D1F6233C627AF3F79@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <87lemlf9mp.fsf@web.de>

> > I find that any word I inspect in mail-mode and probably then in other
> > modes is detected as (thing-at-point 'symbol) even if it is not
> > symbol.
> >
> > What I expect is that (thing-at-point 'symbol) detects only Emacs Lisp
> > defined symbols.
> 
> That's not what it does.  Whatever you mean by "defined symbol" you have
> to check yourself (e.g. using `intern-soft').

"Symbol" has two meanings in Emacs: (1) any text
with symbol syntax (_ or w), (2) a Lisp symbol.

Vanilla Emacs `symbol-at-point' returns a Lisp
symbol created from the text at point that has
"symbol" syntax (in any mode).  And yes, in most
modes any "word" has symbol syntax.

`tap-symbol-at-point' (from `thingatpt+.el')
returns an Elisp symbol that's named at point.
That is, the text has symbol syntax according to
`emacs-lisp-mode-syntax-table' (not the syntax of
whatever mode you're in), and the object returned
is a Lisp symbol.

See the Commentary of `thingatpt+.el' for how to
optionally use the `tap-' functions in place of
the vanilla Emacs functions that make use of the
`thing-at-point' and `bounds-of-thing-at-point'
symbol properties for standard thing types (e.g.
`list').  See the Commentary also for how to
use the `tap-' versions everywhere in place of
the vanilla versions.  Both of these are optional.




      parent reply	other threads:[~2023-01-02 17:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-02 10:12 Any word in mail-mode is recognized as (thing-at-point 'symbol) Jean Louis
2023-01-02 11:39 ` Michael Heerdegen
2023-01-02 16:46   ` Jean Louis
2023-01-03 10:39     ` Michael Heerdegen
2023-01-03 13:17       ` Jean Louis
2023-01-02 17:08   ` Drew Adams [this message]

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=SJ0PR10MB5488044AB321D1F6233C627AF3F79@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=michael_heerdegen@web.de \
    /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.
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).