Function: embark-target-identifier-at-point

embark-target-identifier-at-point is a byte-compiled function defined in embark.el.

Signature

(embark-target-identifier-at-point)

Documentation

Target identifier at point.

In Emacs Lisp and IELM buffers the identifier is promoted to a symbol, for which more actions are available. Identifiers are also promoted to symbols if they are interned Emacs Lisp symbols and found in a buffer in a major mode that is not derived from prog-mode (this is intended for when you might be reading or writing about Emacs).

As a convenience, in Org Mode an initial ' or surrounding == or
~~ are removed.

Source Code

;; Defined in ~/.emacs.d/elpa/embark-20260610.302/embark.el
(defun embark-target-identifier-at-point ()
  "Target identifier at point.

In Emacs Lisp and IELM buffers the identifier is promoted to a
symbol, for which more actions are available.  Identifiers are
also promoted to symbols if they are interned Emacs Lisp symbols
and found in a buffer in a major mode that is not derived from
`prog-mode' (this is intended for when you might be reading or
writing about Emacs).

As a convenience, in Org Mode an initial ' or surrounding == or
~~ are removed."
  (when-let* ((bounds (bounds-of-thing-at-point 'symbol)))
    (let ((name (buffer-substring (car bounds) (cdr bounds))))
      (when (derived-mode-p 'org-mode)
        (cond ((string-prefix-p "'" name)
               (setq name (substring name 1))
               (incf (car bounds)))
              ((string-match-p "^\\([=~]\\).*\\1$" name)
               (setq name (substring name 1 -1))
               (incf (car bounds))
               (decf (cdr bounds)))))
      (mapcar (lambda (type) `(,type ,name . ,bounds))
              (embark--identifier-types name)))))