[Top][All Lists]

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

RE: [External] : Re: Any word in mail-mode is recognized as (thing-at-po

From: Drew Adams
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

> > 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.

reply via email to

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