[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/easy-mmode.el [lexbind]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/easy-mmode.el [lexbind] |
Date: |
Tue, 14 Oct 2003 19:32:24 -0400 |
Index: emacs/lisp/emacs-lisp/easy-mmode.el
diff -c emacs/lisp/emacs-lisp/easy-mmode.el:1.38.2.1
emacs/lisp/emacs-lisp/easy-mmode.el:1.38.2.2
*** emacs/lisp/emacs-lisp/easy-mmode.el:1.38.2.1 Fri Apr 4 01:20:16 2003
--- emacs/lisp/emacs-lisp/easy-mmode.el Tue Oct 14 19:32:21 2003
***************
*** 1,6 ****
;;; easy-mmode.el --- easy definition for major and minor modes
! ;; Copyright (C) 1997, 2000, 2001 Free Software Foundation, Inc.
;; Author: Georges Brun-Cottan <address@hidden>
;; Maintainer: Stefan Monnier <address@hidden>
--- 1,6 ----
;;; easy-mmode.el --- easy definition for major and minor modes
! ;; Copyright (C) 1997, 2000, 2001, 2003 Free Software Foundation, Inc.
;; Author: Georges Brun-Cottan <address@hidden>
;; Maintainer: Stefan Monnier <address@hidden>
***************
*** 98,109 ****
--- 98,116 ----
By default, the mode is buffer-local.
:init-value VAL Same as the INIT-VALUE argument.
:lighter SPEC Same as the LIGHTER argument.
+ :keymap MAP Same as the KEYMAP argument.
:require SYM Same as in `defcustom'.
For example, you could write
(define-minor-mode foo-mode \"If enabled, foo on you!\"
:lighter \" Foo\" :require 'foo :global t :group 'hassle :version \"27.5\"
...BODY CODE...)"
+ (declare (debug (&define name stringp
+ [&optional [¬ keywordp] sexp
+ &optional [¬ keywordp] sexp
+ &optional [¬ keywordp] sexp]
+ [&rest [keywordp sexp]]
+ def-body)))
;; Allow skipping the first three args.
(cond
***************
*** 121,132 ****
(extra-args nil)
(extra-keywords nil)
(require t)
- (keymap-sym (if (and keymap (symbolp keymap)) keymap
- (intern (concat mode-name "-map"))))
(hook (intern (concat mode-name "-hook")))
(hook-on (intern (concat mode-name "-on-hook")))
(hook-off (intern (concat mode-name "-off-hook")))
! keyw)
;; Check keys.
(while (keywordp (setq keyw (car body)))
--- 128,137 ----
(extra-args nil)
(extra-keywords nil)
(require t)
(hook (intern (concat mode-name "-hook")))
(hook-on (intern (concat mode-name "-on-hook")))
(hook-off (intern (concat mode-name "-off-hook")))
! keyw keymap-sym)
;; Check keys.
(while (keywordp (setq keyw (car body)))
***************
*** 138,145 ****
--- 143,154 ----
(:extra-args (setq extra-args (pop body)))
(:group (setq group (nconc group (list :group (pop body)))))
(:require (setq require (pop body)))
+ (:keymap (setq keymap (pop body)))
(t (push keyw extra-keywords) (push (pop body) extra-keywords))))
+ (setq keymap-sym (if (and keymap (symbolp keymap)) keymap
+ (intern (concat mode-name "-map"))))
+
(unless group
;; We might as well provide a best-guess default group.
(setq group
***************
*** 203,210 ****
(if (interactive-p)
(progn
,(if globalp `(customize-mark-as-set ',mode))
! (message ,(format "%s %%sabled" pretty-name)
! (if ,mode "en" "dis"))))
(force-mode-line-update)
;; Return the new setting.
,mode)
--- 212,220 ----
(if (interactive-p)
(progn
,(if globalp `(customize-mark-as-set ',mode))
! (unless (current-message)
! (message ,(format "%s %%sabled" pretty-name)
! (if ,mode "en" "dis")))))
(force-mode-line-update)
;; Return the new setting.
,mode)
***************
*** 341,347 ****
Optional NAME is passed to `make-sparse-keymap'.
Optional map M can be used to modify an existing map.
ARGS is a list of additional keyword arguments."
! (let (inherit dense suppress)
(while args
(let ((key (pop args))
(val (pop args)))
--- 351,357 ----
Optional NAME is passed to `make-sparse-keymap'.
Optional map M can be used to modify an existing map.
ARGS is a list of additional keyword arguments."
! (let (inherit dense)
(while args
(let ((key (pop args))
(val (pop args)))
***************
*** 350,356 ****
(:dense (setq dense val))
(:inherit (setq inherit val))
(:group)
- ;;((eq key :suppress) (setq suppress val))
(t (message "Unknown argument %s in defmap" key)))))
(unless (keymapp m)
(setq bs (append m bs))
--- 360,365 ----
***************
*** 422,428 ****
(let* ((base-name (symbol-name base))
(prev-sym (intern (concat base-name "-prev")))
(next-sym (intern (concat base-name "-next"))))
! (unless name (setq name (symbol-name base-name)))
`(progn
(add-to-list 'debug-ignored-errors
,(concat "^No \\(previous\\|next\\) " (regexp-quote name)))
--- 431,437 ----
(let* ((base-name (symbol-name base))
(prev-sym (intern (concat base-name "-prev")))
(next-sym (intern (concat base-name "-next"))))
! (unless name (setq name base-name))
`(progn
(add-to-list 'debug-ignored-errors
,(concat "^No \\(previous\\|next\\) " (regexp-quote name)))
***************
*** 435,441 ****
(if (not (re-search-forward ,re nil t count))
(if (looking-at ,re)
(goto-char (or ,(if endfun `(,endfun)) (point-max)))
! (error ,(format "No next %s" name)))
(goto-char (match-beginning 0))
(when (and (eq (current-buffer) (window-buffer (selected-window)))
(interactive-p))
--- 444,450 ----
(if (not (re-search-forward ,re nil t count))
(if (looking-at ,re)
(goto-char (or ,(if endfun `(,endfun)) (point-max)))
! (error "No next %s" ,name))
(goto-char (match-beginning 0))
(when (and (eq (current-buffer) (window-buffer (selected-window)))
(interactive-p))
***************
*** 451,458 ****
(unless count (setq count 1))
(if (< count 0) (,next-sym (- count))
(unless (re-search-backward ,re nil t count)
! (error ,(format "No previous %s" name))))))))
(provide 'easy-mmode)
;;; easy-mmode.el ends here
--- 460,468 ----
(unless count (setq count 1))
(if (< count 0) (,next-sym (- count))
(unless (re-search-backward ,re nil t count)
! (error "No previous %s" ,name)))))))
(provide 'easy-mmode)
+ ;;; arch-tag: d48a5250-6961-4528-9cb0-3c9ea042a66a
;;; easy-mmode.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/emacs-lisp/easy-mmode.el [lexbind],
Miles Bader <=