From: Stefan Monnier Date: Sun, 30 Sep 2012 03:21:50 +0000 (-0400) Subject: * lisp/tutorial.el (help-with-tutorial): Use minibuffer-with-setup-hook. X-Git-Tag: emacs-24.2.90~244^2~20 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=38a30d64628c84690467008888984d14683f9c9d;p=emacs.git * lisp/tutorial.el (help-with-tutorial): Use minibuffer-with-setup-hook. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4d4312b03be..a0697cdc546 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-09-30 Stefan Monnier + * tutorial.el (help-with-tutorial): Use minibuffer-with-setup-hook. + * textmodes/text-mode.el (paragraph-indent-minor-mode): Make it a proper minor-mode. diff --git a/lisp/tutorial.el b/lisp/tutorial.el index 64879e5cfd5..6f76068ea9d 100644 --- a/lisp/tutorial.el +++ b/lisp/tutorial.el @@ -765,14 +765,13 @@ Run the Viper tutorial? ")) (funcall 'viper-tutorial 0)) (message "Tutorial aborted by user")) (message prompt1))) - (let* ((lang (if arg - (let ((minibuffer-setup-hook minibuffer-setup-hook)) - (add-hook 'minibuffer-setup-hook - 'minibuffer-completion-help) - (read-language-name 'tutorial "Language: " "English")) - (if (get-language-info current-language-environment 'tutorial) - current-language-environment - "English"))) + (let* ((lang (cond + (arg + (minibuffer-with-setup-hook #'minibuffer-completion-help + (read-language-name 'tutorial "Language: " "English"))) + ((get-language-info current-language-environment 'tutorial) + current-language-environment) + (t "English"))) (filename (get-language-info lang 'tutorial)) (tut-buf-name filename) (old-tut-buf (get-buffer tut-buf-name))