emacs-devel
[Top][All Lists]
Advanced

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

Re: [ELPA] New package: hcel


From: Yuchen Pei
Subject: Re: [ELPA] New package: hcel
Date: Wed, 21 Sep 2022 15:58:50 +1000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

On Tue 2022-09-20 17:42:43 -0400, Stefan Monnier wrote:

> BTW, here's a patch with various cosmetic changes.

Thanks for the patch - it is very educational.  I have applied it and
made many other changes in a similar fashion.

A few remaining questions:

>  (defun hcel-results-next-page ()
>    (interactive)
> +  ;; FIXME: Using `major-mode' is a code smell.
>    (unless (memq major-mode '(hcel-refs-mode hcel-ids-mode))
>      (error "Not in hcel-refs or hcel-ids mode: %S" major-mode))

What do you mean, should I avoid using the variable `major-mode'? Why?

> In end of data:
> packages/hcel/hcel-client.el:142:8: Warning: the function
> ‘delete-http-header’ is not known to be defined.
> packages/hcel/hcel-client.el:59:19: Warning: the function
> ‘hcel-location-tag’ is not known to be defined.
> packages/hcel/hcel-client.el:47:43: Warning: the function
> ‘hcel-format-package-id’ is not known to be defined.
> Byte compiling packages/hcel/hcel-results.el

How do I get these "end of data" warnings?  When I do M-x byte-compile
or byte-recompile-directory I don't get them.

>
> In hcel-module-selector:
> packages/hcel/hcel.el:55:43: Warning: reference to free variable
> ‘package-id’

I thought this was OK because of lexical-binding?  For reference, here's
the defun:

(defun hcel-module-selector (package-id)
  (lambda (module-path)
    (interactive
     (list
      (completing-read "Select module: "
                       (hcel-list-modules package-id))))
    (switch-to-buffer
     (hcel-load-module-source package-id module-path))))

It seems to me to be similar to the problem described in
<https://lists.gnu.org/archive/html/help-gnu-emacs/2012-08/msg00296.html>.

Best,
Yuchen

-- 
PGP Key: 47F9 D050 1E11 8879 9040  4941 2126 7E93 EF86 DFD0
          <https://ypei.org/assets/ypei-pubkey.txt>



reply via email to

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