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

Re: unnecessary/unused hook?



I took a look at the new branch 'modernize201906' and see that the
variable is now only used onced in all of the project's source code, so
I propose it either be defined and explained or be deleted:

  w3m.el11172: (run-mode-hooks 'w3m-select-buffer-mode-hook))


On 2019-06-16 14:01, Boruch Baum wrote:
> Variable w3m-select-buffer-mode-hook is never explictly defined (compare
> to defcustom w3m-select-buffer-hook) but is referenced. The only time a
> value is assigned to it seems to be for xemacs.
>
> Should it be explicitly defined? Should it be removed as cruft from when
> the project was supporting xemacs?
>
> 8< ------------------------------------------------------------------ >8
> w3m.el:11386:  (w3m-run-mode-hooks 'w3m-select-buffer-mode-hook))
> w3m-xmas.el:768:  (add-hook 'w3m-select-buffer-mode-hook 'w3m-setup-tab-in-gutter)
> 8< ------------------------------------------------------------------ >8
>
> This was all coded very long (12-14 years) ago:
>
> 8< ------------------------------------------------------------------ >8
> $ git blame  -L 11386,+1 -- w3m.el
>
>   8933820da (Katsumi Yamaoka 2005-05-30 06:47:23 +0000 11386)
>
> $ git blame  -L 768,+1 -- w3m-xmas.el
>
>   11faaaaa1 (Katsumi Yamaoka 2007-01-30 11:00:52 +0000 768)
> 8< ------------------------------------------------------------------ >8
>
> Also, the hook is being run using function w3m-run-mode-hooks instead of
> just run-mode-hooks, but is that ever necessary in any recent version of
> emac-sen?
>
> 8< ------------------------------------------------------------------ >8
> w3m.el
>

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0