all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* elisp--curent-symbol question
@ 2022-11-14  6:00 Arthur Miller
  2022-11-15  2:47 ` Emanuel Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Arthur Miller @ 2022-11-14  6:00 UTC (permalink / raw)
  To: help-gnu-emacs

The function looks like this:

;; returns nil unless current word is an interned symbol.
(defun elisp--current-symbol ()
  (let ((c (char-after (point))))
    (and c
         (memq (char-syntax c) '(?w ?_))
         (intern-soft (current-word)))))

Is there reason why this function is written that way and not like:

(defun elisp--current-symbol ()
  "Returns nil unless current word is an interned symbol."
  (intern-soft (current-word)))

Seems to me that checking for the first letter does not have any effect, but I
am maybe missing some special case? Doesn't 'current-word' obey rules for what
emacs lisp mode says is word anyway?

Also the comment seem to belong to doc-string rather than a comment outside the
function. Same follows for some other internal functions there, but that is a
minor, I am just wondering about syntax table and if I am missing something
there.

Thnks in advance for the answer.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-15  2:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-14  6:00 elisp--curent-symbol question Arthur Miller
2022-11-15  2:47 ` Emanuel Berg

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.