[Top][All Lists]

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

Re: Lexical binding

From: Juanma Barranquero
Subject: Re: Lexical binding
Date: Sat, 2 Apr 2011 20:50:49 +0200

On Sat, Apr 2, 2011 at 20:38, Stefan Monnier <address@hidden> wrote:

> Indeed, if a variable is only assigned to, it's both "unused lexical
> var" and "not left unused".

OK, perhaps I simplified too much. The original problem is in this
function from help-fns.el:

(defun help-do-arg-highlight (doc args)
  (with-syntax-table (make-syntax-table emacs-lisp-mode-syntax-table)
    (modify-syntax-entry ?\- "w")
    (dolist (arg args doc)
      (setq doc (replace-regexp-in-string
                 ;; This is heuristic, but covers all common cases
                 ;; except ARG1-ARG2
                 (concat "\\<"                   ; beginning of word
                         "\\(?:[a-z-]*-\\)?"     ; for xxx-ARG
                         (regexp-quote arg)
                         "\\(?:es\\|s\\|th\\)?"  ; for ARGth, ARGs
                         "\\(?:-[a-z0-9-]+\\)?"  ; for ARG-xxx, ARG-n
                         "\\(?:-[{([<`\"].*?\\)?"; for ARG-{x}, (x),
<x>, [x], `x'
                         "\\>")                  ; end of word
                 (help-highlight-arg arg)
                 doc t t 1)))))

=> help-fns.el:213:1:Warning: Unused lexical variable `arg'

though arg is assigned and read. Or am I missing something?


reply via email to

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