emacs-devel
[Top][All Lists]
Advanced

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

Re: [ELPA] New package: hcel


From: Emanuel Berg
Subject: Re: [ELPA] New package: hcel
Date: Wed, 21 Sep 2022 09:44:11 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Michael Heerdegen wrote:

> Hmm - no, I think the problem is the reference in the
> interactive form - AFAIK, variables in interactive forms
> can't refer to the lexical environment. See Bug#51695.
> I don't recall a nice solution for this kind of problem
> (anyone?).

Yours was good (get the spec from a function) but it is still
a workaround.

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

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

(let ((opts   "torrent magnet 720p")
      (show   "Survivor")
      (prompt "episode: ") )
  (let ((next 1))
    (defun australian-survivor-interactive ()
      (list (read-number prompt next)) )
    (declare-function australian-survivor-interactive nil)

    (defun australian-survivor (ep)
      (interactive (australian-survivor-interactive))
      (w3m-search w3m-search-default-engine
        (format "\"s10e%02d\" Australian %s %s" ep show opts) )
      (setq next (1+ ep)) )
    (declare-function australian-survivor nil) )
  (defalias 'aus #'australian-survivor)

  (let ((next 1))
    (defun us-survivor-interactive ()
      (list (read-number prompt next)) )
    (declare-function us-survivor-interactive nil)
    (defalias 'us #'us-survivor-interactive)

    (defun us-survivor (ep)
      (interactive (us-survivor-interactive))
      (w3m-search w3m-search-default-engine
        (format "\"s43e%02d\" %s %s" ep show opts) )
      (setq next (1+ ep)) )
    (declare-function us-survivor nil)
    (defalias 'usa #'us-survivor) ))

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




reply via email to

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