unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / 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

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