help-gnu-emacs
[Top][All Lists]
Advanced

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

About the usage of `with-eval-after-load'.


From: Hongyi Zhao
Subject: About the usage of `with-eval-after-load'.
Date: Sat, 18 Sep 2021 17:51:09 +0800

`C-h o with-eval-after-load RET' gives the following description:

with-eval-after-load is a Lisp macro in ‘subr.el’.

(with-eval-after-load FILE &rest BODY)

Execute BODY after FILE is loaded.
FILE is normally a feature name, but it can also be a file name,
in case that file does not provide any feature.  See ‘eval-after-load’
for more details about the different forms of FILE and their semantics.
;;;

Based on the above explanation, it seems that only one FILE can be
used, but according to my tries, the following code snippet also take
effect:

  (add-hook 'python-mode-hook 'hs-minor-mode)
  (with-eval-after-load
    "python"
    (progn
      (define-key python-mode-map (kbd "C-c TAB") 'hs-toggle-hiding)
      (add-to-list
'python-shell-completion-native-disabled-interpreters "jupyter")
      )

    'elpy (pyvenv-activate "~/.pyenv/versions/datasci")
    )

Is there anything wrong with my understanding of this macro? Any hints
will be helpful.

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province



reply via email to

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