Mercurial > emacs
comparison lisp/emacs-lisp/easy-mmode.el @ 38324:ce45998cedf2
(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.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Sun, 08 Jul 2001 22:57:29 +0000 |
parents | 3886350a8826 |
children | b174db545cfd |
comparison
equal
deleted
inserted
replaced
38323:1241890094ae | 38324:ce45998cedf2 |
---|---|
213 ,(if keymap keymap-sym | 213 ,(if keymap keymap-sym |
214 `(if (boundp ',keymap-sym) | 214 `(if (boundp ',keymap-sym) |
215 (symbol-value ',keymap-sym)))) | 215 (symbol-value ',keymap-sym)))) |
216 | 216 |
217 ;; If the mode is global, call the function according to the default. | 217 ;; If the mode is global, call the function according to the default. |
218 ,(if globalp `(if ,mode (,mode 1)))))) | 218 ,(if globalp |
219 `(if (and load-file-name ,mode) | |
220 (eval-after-load load-file-name '(,mode 1))))))) | |
219 | 221 |
220 ;;; | 222 ;;; |
221 ;;; make global minor mode | 223 ;;; make global minor mode |
222 ;;; | 224 ;;; |
223 | 225 |
410 (if (not (re-search-forward ,re nil t count)) | 412 (if (not (re-search-forward ,re nil t count)) |
411 (if (looking-at ,re) | 413 (if (looking-at ,re) |
412 (goto-char (or ,(if endfun `(,endfun)) (point-max))) | 414 (goto-char (or ,(if endfun `(,endfun)) (point-max))) |
413 (error ,(format "No next %s" name))) | 415 (error ,(format "No next %s" name))) |
414 (goto-char (match-beginning 0)) | 416 (goto-char (match-beginning 0)) |
415 (when (eq (current-buffer) (window-buffer (selected-window))) | 417 (when (and (eq (current-buffer) (window-buffer (selected-window))) |
418 (interactive-p)) | |
416 (let ((endpt (or (save-excursion | 419 (let ((endpt (or (save-excursion |
417 ,(if endfun `(,endfun) | 420 ,(if endfun `(,endfun) |
418 `(re-search-forward ,re nil t 2))) | 421 `(re-search-forward ,re nil t 2))) |
419 (point-max)))) | 422 (point-max)))) |
420 (unless (pos-visible-in-window-p endpt nil t) | 423 (unless (pos-visible-in-window-p endpt nil t) |