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

Re: lexical-binding question

I'm sorry for the noise, anyway.

In [emacs-w3m:13519]
On Wed, 07 Aug 2019 09:57:05 +0900, Katsumi Yamaoka wrote:
> ・Eval: (setq w3m-input-coding-system 'binary)
> ・Perform `edebug-defun' on the function `w3m-w3m-expand-arguments'.
> ・Run M-x w3m for visiting some web page.

> Then, you will see '`,charset and `,charset, that the constant
> `w3m-halfdump-command-arguments' defines, are substituted with
> a certain charset value successfully, even though the value of
> `charset' is not passed to `w3m-w3m-expand-arguments' explicitly.

> While edebugging `w3m-w3m-expand-arguments', it is notable that
> the form (boundp 'charset) returns t and (symbol-value 'charset)
> returns a certain charset value.

I found the cause of the mystery.  I recalled I added an advice
to the `w3m-rendering-half-dump' function in the ~/.emacs-w3m.el
file for some purpose using `defadvice', so the function is re-
compiled in the condition `lexical-binding' is nil.  That is why
the `charset' symbol is dynamically bound.

It also means that substituting the `charset' symbols that are
specified in the `w3m-halfdump-command-arguments' constant should
not work in a normal case.  Though it might not be so many as it
will cause only when `w3m-input-coding-system' is set to `binary'.
Anyway I'm going to fix it in an adequate way.