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

* Re: elisp--curent-symbol question
  2022-11-14  6:00 elisp--curent-symbol question Arthur Miller
@ 2022-11-15  2:47 ` Emanuel Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Emanuel Berg @ 2022-11-15  2:47 UTC (permalink / raw)
  To: help-gnu-emacs

Arthur Miller wrote:

> 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

Yeah, but why do it incorrectly when it's so easy to do
it right?

Also, in elisp-mode.el in particular XD

No, but practice on these:

elisp-mode.el:283: Argument ‘interactive’ should appear (as INTERACTIVE) in the doc string
elisp-mode.el:348: You should convert this comment to documentation
elisp-mode.el:363: Argument ‘vars’ should appear (as VARS) in the doc string
elisp-mode.el:466: Argument ‘pos’ should appear (as POS) in the doc string
elisp-mode.el:1031: You should convert this comment to documentation
elisp-mode.el:1281: Argument ‘end’ should appear (as END) in the doc string
elisp-mode.el:1332: Argument ‘eval-last-sexp-arg-internal’ should appear (as EVAL-LAST-SEXP-ARG-INTERNAL) in the doc string
elisp-mode.el:1559: Argument ‘eval-last-sexp-arg-internal’ should appear (as EVAL-LAST-SEXP-ARG-INTERNAL) in the doc string
elisp-mode.el:1591: Argument ‘form’ should appear (as FORM) in the doc string
elisp-mode.el:1691: Argument ‘edebug-it’ should appear (as EDEBUG-IT) in the doc string
elisp-mode.el:1737: Second line should not have indentation
elisp-mode.el:1769: Argument ‘callback’ should appear (as CALLBACK) in the doc string
elisp-mode.el:1781: Argument ‘callback’ should appear (as CALLBACK) in the doc string
elisp-mode.el:1792: Argument ‘callback’ should appear (as CALLBACK) in the doc string
elisp-mode.el:1819: Argument ‘index’ should appear (as INDEX) in the doc string
elisp-mode.el:1850: Arguments occur in the doc string out of order

-- 
underground experts united
https://dataswamp.org/~incal




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