Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace obsolete forms #101

Merged
merged 1 commit into from Aug 5, 2021
Merged

Conversation

Boruch-Baum
Copy link
Contributor

  • There's nothing "bad" about make-variable-buffer-local, but now that
    emacs has had defvar-local for such a long time, there's benefit in
    preferring it for readability and maintainability

@emacs-w3m-notifier
Copy link

emacs-w3m-notifier commented Aug 5, 2021 via email

@yamaoka
Copy link
Contributor

yamaoka commented Aug 5, 2021

I also see usage of function 'inline' whichsee docstring explicitly says "You don't need this."

Yes, you don't need this if running the ELisp code without byte-compiling. But when the code is compiled into elc, a function surrounded in inline will be replaced in the byte-code with its function definition itself, while compiled into the code equivalent to (funcall function-name) if it is not inlined.

(byte-compile
 (lambda (url)
   (inline (w3m-cache-remove-1 url))))
 => #[257 "\211\302^A^H\"\303\211^B\205/^@\304^C@   \"\210^BA@\211\262^C^CAA\211\26\
2^C|\210^A\303\211\223\210\211\303\211\223\210\305^C^H\"\211^P\207" [w3m-cache-\
articles w3m-cache-hashtb assoc nil remhash delq] 8 "                           
                                                                                
(fn URL)"]

(byte-compile
 (lambda (url)
   (w3m-cache-remove-1 url)))
 => #[257 "\300^A!\207" [w3m-cache-remove-1] 3 "                                    
                                                                                
(fn URL)"]

Using inline makes a byte-code faster, so we use inline if the code often or repeatedly runs.

@yamaoka yamaoka merged commit 335c868 into emacs-w3m:master Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants