I have the following function:
(defun filter-repl-show-after (line-num)
"Show lines after LINE-NUM."
(filter-repl--foreach-line
(lexical-let ((line-num line-num))
(lambda ()
(when (> (line-number-at-pos) line-num)
(filter-repl--show-line))))))
(defun filter-repl--foreach-line (f)
"Apply F to each line in the buffer."
(save-excursion
(goto-char (point-min))
(while (not (eobp))
(funcall f)
(forward-line))))
The elisp linter is warning me that ‘(line-num line-num)’ is a malformed function
. The problem seems to be due to the lexical letter, because I don't get the warning with
(defun filter-repl-show-after-tweaked (line-num)
"Show lines after LINE-NUM."
(filter-repl--foreach-line
(lambda ()
(when (> (line-number-at-pos) line-num)
(filter-repl--show-line)))))
Is this warning a false positive and I avoid it if so?
Regarding checkdoc demanding uppercase names in docstring
Repro M-x checkdoc on
(defun hello (f)
"Say hello to 'f'."
)
Results in the followign message:
Argument ‘f’ should appear (as F) in the doc string (C-h,f,e,n,p,q)
lexical-let
. See nullprogram.com/blog/2016/12/22