help-gnu-emacs
[Top][All Lists]
Advanced

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

elisp--curent-symbol question


From: Arthur Miller
Subject: elisp--curent-symbol question
Date: Mon, 14 Nov 2022 07:00:44 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

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.



reply via email to

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