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

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

closure within closure, incorrect (?) byte-compiler warnings


From: Emanuel Berg
Subject: closure within closure, incorrect (?) byte-compiler warnings
Date: Mon, 01 Nov 2021 08:06:44 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

See the code, it is a closure (actually two) with the
intention of keeping inside a closure with the intention
of sharing ...

Keep and share! Good intensions that also seem to work, only
the byte-compiler reports incorrect/unhelpful warnings what
I can see.

Also note the inconsistent byte-compiler formating, both
`next' and ‘next’ ...

;;; -*- lexical-binding: t -*-
;;;
;;; this file:
;;;   https://dataswamp.org/~incal/emacs-init/w3m/w3m-survivor.el

(require 'w3m-search)
(require 'cl-lib)

(declare-function australian-survivor nil)
(declare-function us-survivor         nil)

(let ((opts   "torrent 1080p")
      (show   "Survivor")
      (prompt "episode ") )
  (let ((next 1))
    (defun australian-survivor (ep)
      (interactive (list (read-number prompt next)))
      (w3m-search
       w3m-search-default-engine
       (format "s08e%02d Australian %s %s" ep show opts) )
      (setq next (1+ ep)) ))
  (defalias 'aus #'australian-survivor)

  (let ((next 1))
    (defun us-survivor (ep)
      (interactive (list (read-number prompt next)))
      (w3m-search
       w3m-search-default-engine
       (format "s41%02d %s %s" ep show opts) )
      (setq next (1+ ep)) ))
  (defalias 'us #'us-survivor) )

;; In toplevel form:
;; w3m/w3m-survivor.el:12:1: Warning: Unused lexical variable `prompt'
;; w3m/w3m-survivor.el:12:1: Warning: Unused lexical variable `next'
;; w3m/w3m-survivor.el:26:39: Warning: reference to free variable ‘prompt’
;; w3m/w3m-survivor.el:26:46: Warning: reference to free variable ‘next’
;; w3m/w3m-survivor.el:22:14: Warning: Unused lexical variable `next'

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




reply via email to

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