summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2001-07-08 22:58:10 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2001-07-08 22:58:10 +0000
commit851040a566e53b9bce4400eda47b90647b96bb19 (patch)
treef5d28467b4d6bf9e48228157cba73d2e47622781 /lisp/emacs-lisp
parent24c7c69c7b571f25bda50a66ca7347a74b50611b (diff)
downloademacs-851040a566e53b9bce4400eda47b90647b96bb19.tar.gz
emacs-851040a566e53b9bce4400eda47b90647b96bb19.tar.bz2
emacs-851040a566e53b9bce4400eda47b90647b96bb19.zip
(define-minor-mode): Use eval-after-load
to delay the call to <mode> for global minor modes. (easy-mmode-define-navigation): Only recenter if interactive.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/easy-mmode.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index e1cda3bbf73..9d99e5fe097 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -215,7 +215,9 @@ With zero or negative ARG turn mode off.
(symbol-value ',keymap-sym))))
;; If the mode is global, call the function according to the default.
- ,(if globalp `(if ,mode (,mode 1))))))
+ ,(if globalp
+ `(if (and load-file-name ,mode)
+ (eval-after-load load-file-name '(,mode 1)))))))
;;;
;;; make global minor mode
@@ -412,7 +414,8 @@ ENDFUN should return the end position (with or without moving point)."
(goto-char (or ,(if endfun `(,endfun)) (point-max)))
(error ,(format "No next %s" name)))
(goto-char (match-beginning 0))
- (when (eq (current-buffer) (window-buffer (selected-window)))
+ (when (and (eq (current-buffer) (window-buffer (selected-window)))
+ (interactive-p))
(let ((endpt (or (save-excursion
,(if endfun `(,endfun)
`(re-search-forward ,re nil t 2)))