unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* About the usage of `with-eval-after-load'.
@ 2021-09-18  9:51 Hongyi Zhao
  2021-09-18 10:28 ` Omar Polo
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Hongyi Zhao @ 2021-09-18  9:51 UTC (permalink / raw)
  To: help-gnu-emacs

`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



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-09-19  4:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-18  9:51 About the usage of `with-eval-after-load' Hongyi Zhao
2021-09-18 10:28 ` Omar Polo
2021-09-18 10:40 ` Joost Kremers
2021-09-18 14:56   ` [External] : " Drew Adams
2021-09-19  3:41     ` Hongyi Zhao
2021-09-19  4:25       ` Drew Adams
2021-09-19  0:16 ` Michael Heerdegen
2021-09-19  1:16   ` Hongyi Zhao
2021-09-19  1:50     ` Michael Heerdegen
2021-09-19  1:55       ` Hongyi Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).