Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 103078. ------------------------------------------------------------ revno: 103078 committer: Chong Yidong branch nick: trunk timestamp: Tue 2011-02-01 22:36:29 -0500 message: etc/themes/wheatgrass-theme.el: Apply min-colors setting to face definitions. diff: === modified file 'etc/themes/wheatgrass-theme.el' --- etc/themes/wheatgrass-theme.el 2011-01-25 04:08:28 +0000 +++ etc/themes/wheatgrass-theme.el 2011-02-02 03:36:29 +0000 @@ -20,42 +20,50 @@ ;;; Code: (deftheme wheatgrass - "Theme for basic, Font Lock, Isearch, Gnus, and Message faces. -The default face is wheat on a black background. Other faces -are in shades of green, brown, and blue.") + "A high-contrast theme with a black background. +Basic, Font Lock, Isearch, Gnus, and Message faces are included. +The default face foreground is wheat, with other faces in shades +of green, brown, and blue.") -(custom-theme-set-faces - 'wheatgrass - '(default ((t (:foreground "wheat" :background "black")))) - '(cursor ((t (:foreground "black" :background "thistle")))) - '(highlight ((t (:foreground "white" :background "dark green")))) - '(region ((t (:foreground "white" :background "dark green")))) - '(font-lock-builtin-face ((t (:foreground "LightSteelBlue")))) - '(font-lock-comment-face ((t (:foreground "SpringGreen3")))) - '(font-lock-constant-face ((t (:foreground "turquoise")))) - '(font-lock-function-name-face ((t (:foreground "pale green")))) - '(font-lock-keyword-face ((t (:foreground "white")))) - '(font-lock-string-face ((t (:foreground "dark khaki")))) - '(font-lock-type-face ((t (:foreground "aquamarine")))) - '(font-lock-variable-name-face ((t (:foreground "yellow green")))) - '(font-lock-warning-face ((t (:foreground "salmon1")))) - '(button ((t (:underline t :foreground "cyan")))) - '(link ((t (:underline t :foreground "cyan")))) - '(link-visited ((t (:underline t :foreground "dark cyan")))) - '(isearch ((t (:foreground "white" :background "dark goldenrod")))) - '(lazy-highlight ((t (:background "gray25")))) - '(gnus-header-content ((t (:weight normal :foreground "yellow green")))) - '(gnus-header-from ((t (:foreground "pale green")))) - '(gnus-header-subject ((t (:foreground "pale turquoise")))) - '(gnus-header-name ((t (:foreground "dark sea green")))) - '(gnus-header-newsgroups ((t (:foreground "dark khaki")))) - '(message-header-name ((t (:foreground "dark turquoise")))) - '(message-header-cc ((t (:foreground "yellow green")))) - '(message-header-other ((t (:foreground "dark khaki")))) - '(message-header-subject ((t (:foreground "pale turquoise")))) - '(message-header-to ((t (:foreground "pale green")))) - '(message-cited-text ((t (:foreground "SpringGreen3")))) - '(message-separator ((t (:foreground "deep sky blue"))))) +(let ((class '((class color) (min-colors 89)))) + (custom-theme-set-faces + 'wheatgrass + `(default ((,class (:foreground "wheat" :background "black")))) + `(cursor ((,class (:foreground "black" :background "thistle")))) + ;; Highlighting faces + `(highlight ((,class (:foreground "white" :background "dark green")))) + `(region ((,class (:foreground "white" :background "dark green")))) + `(secondary-selection ((,class (:background "dark slate gray")))) + `(isearch ((,class (:foreground "white" :background "dark goldenrod")))) + `(lazy-highlight ((,class (:background "gray25")))) + ;; Font lock faces + `(font-lock-builtin-face ((,class (:foreground "LightSteelBlue")))) + `(font-lock-comment-face ((,class (:foreground "SpringGreen3")))) + `(font-lock-constant-face ((,class (:foreground "turquoise")))) + `(font-lock-function-name-face ((,class (:foreground "pale green")))) + `(font-lock-keyword-face ((,class (:foreground "white")))) + `(font-lock-string-face ((,class (:foreground "dark khaki")))) + `(font-lock-type-face ((,class (:foreground "aquamarine")))) + `(font-lock-variable-name-face ((,class (:foreground "yellow green")))) + `(font-lock-warning-face ((,class (:foreground "salmon1")))) + ;; Button and link faces + `(button ((,class (:underline t :foreground "cyan")))) + `(link ((,class (:underline t :foreground "cyan")))) + `(link-visited ((,class (:underline t :foreground "dark cyan")))) + ;; Gnus faces + `(gnus-header-content ((,class (:weight normal :foreground "yellow green")))) + `(gnus-header-from ((,class (:foreground "pale green")))) + `(gnus-header-subject ((,class (:foreground "pale turquoise")))) + `(gnus-header-name ((,class (:foreground "dark sea green")))) + `(gnus-header-newsgroups ((,class (:foreground "dark khaki")))) + ;; Message faces + `(message-header-name ((,class (:foreground "dark turquoise")))) + `(message-header-cc ((,class (:foreground "yellow green")))) + `(message-header-other ((,class (:foreground "dark khaki")))) + `(message-header-subject ((,class (:foreground "pale turquoise")))) + `(message-header-to ((,class (:foreground "pale green")))) + `(message-cited-text ((,class (:foreground "SpringGreen3")))) + `(message-separator ((,class (:foreground "deep sky blue")))))) (provide-theme 'wheatgrass) ------------------------------------------------------------ revno: 103077 author: Julien Danjou committer: Katsumi Yamaoka branch nick: trunk timestamp: Tue 2011-02-01 23:46:27 +0000 message: mm-uu.el (mm-uu-type-alist): Add support for git format-patch diff format. mm-decode.el (mm-inline-media-tests): Do not check for diff-mode it's standard in Emacs nowadays. color.el (color-gradient): Add a color-gradient function. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-02-01 21:37:12 +0000 +++ lisp/ChangeLog 2011-02-01 23:46:27 +0000 @@ -1,3 +1,7 @@ +2011-02-01 Julien Danjou + + * color.el (color-gradient): Add a color-gradient function. + 2011-02-01 Sam Steingold * simple.el (special-mode-map): Bind "h" to `describe-mode'; === modified file 'lisp/color.el' --- lisp/color.el 2011-01-25 04:08:28 +0000 +++ lisp/color.el 2011-02-01 23:46:27 +0000 @@ -47,6 +47,20 @@ (- 1.0 (cadr color)) (- 1.0 (caddr color))))) +(defun color-gradient (start stop step-number) + "Return a list with STEP-NUMBER colors from START to STOP. +The color list builds a color gradient starting at color START to +color STOP. It does not include the START and STOP color in the +resulting list." + (loop for i from 1 to step-number + with red-step = (/ (- (car stop) (car start)) (1+ step-number)) + with green-step = (/ (- (cadr stop) (cadr start)) (1+ step-number)) + with blue-step = (/ (- (caddr stop) (caddr start)) (1+ step-number)) + collect (list + (+ (car start) (* i red-step)) + (+ (cadr start) (* i green-step)) + (+ (caddr start) (* i blue-step))))) + (defun color-complement-hex (color) "Return the color that is the complement of COLOR, in hexadecimal format." (apply 'color-rgb->hex (color-complement color))) === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-02-01 14:09:20 +0000 +++ lisp/gnus/ChangeLog 2011-02-01 23:46:27 +0000 @@ -1,3 +1,11 @@ +2011-02-01 Julien Danjou + + * mm-uu.el (mm-uu-type-alist): Add support for git format-patch diff + format. + + * mm-decode.el (mm-inline-media-tests): Do not check for diff-mode it's + standard in Emacs nowadays. + 2011-02-01 Stefan Monnier * message.el (message-expand-name): Don't trust the return value of === modified file 'lisp/gnus/mm-decode.el' --- lisp/gnus/mm-decode.el 2011-01-25 23:51:40 +0000 +++ lisp/gnus/mm-decode.el 2011-02-01 23:46:27 +0000 @@ -223,17 +223,9 @@ ("text/plain" mm-inline-text identity) ("text/enriched" mm-inline-text identity) ("text/richtext" mm-inline-text identity) - ("text/x-patch" mm-display-patch-inline - (lambda (handle) - ;; If the diff-mode.el package is installed, the function is - ;; autoloaded. Checking (locate-library "diff-mode") would be trying - ;; to cater to broken installations. OTOH checking the function - ;; makes it possible to install another package which provides an - ;; alternative implementation of diff-mode. --Stef - (fboundp 'diff-mode))) + ("text/x-patch" mm-display-patch-inline identity) ;; In case mime.types uses x-diff (as does Debian's mime-support-3.40). - ("text/x-diff" mm-display-patch-inline - (lambda (handle) (fboundp 'diff-mode))) + ("text/x-diff" mm-display-patch-inline identity) ("application/emacs-lisp" mm-display-elisp-inline identity) ("application/x-emacs-lisp" mm-display-elisp-inline identity) ("application/x-shellscript" mm-display-shell-script-inline identity) === modified file 'lisp/gnus/mm-uu.el' --- lisp/gnus/mm-uu.el 2011-01-25 04:08:28 +0000 +++ lisp/gnus/mm-uu.el 2011-02-01 23:46:27 +0000 @@ -158,6 +158,12 @@ mm-uu-diff-extract nil mm-uu-diff-test) + (git-format-patch + "^diff --git " + "^-- " + mm-uu-diff-extract + nil + mm-uu-diff-test) (message-marks ;; Text enclosed with tags similar to `message-mark-insert-begin' and ;; `message-mark-insert-end'. Don't use those variables to avoid ------------------------------------------------------------ revno: 103076 committer: Sam Steingold branch nick: trunk timestamp: Tue 2011-02-01 16:37:12 -0500 message: undo 103071 (purecopy-cons, purecopy-car) at Stefan Monnier's request diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-02-01 21:22:21 +0000 +++ lisp/ChangeLog 2011-02-01 21:37:12 +0000 @@ -31,19 +31,6 @@ Inherit from `special-mode-map'. * vc/log-view.el (log-view-mode-map): Add a comment. -2011-02-01 Sam Steingold - - * subr.el (purecopy-cons, purecopy-car): Add shortcuts. - * faces.el (face-x-resources): Use `purecopy-cons'. - * files.el (auto-mode-alist, interpreter-mode-alist): Use - `purecopy-car'. - * international/fontset.el (font-encoding-alist): Ditto. - * international/mule-conf.el (file-coding-system-alist): Ditto. - * international/mule.el (auto-coding-alist) - (auto-coding-regexp-alist): Ditto. - * mouse.el (mouse-buffer-menu-mode-groups): Use `purecopy-cons'. - * term/x-win.el (x-gtk-stock-map): Ditto. - 2011-02-01 Chong Yidong * custom.el (load-theme): Define return value. Drop use of === modified file 'lisp/faces.el' --- lisp/faces.el 2011-02-01 18:15:18 +0000 +++ lisp/faces.el 2011-02-01 21:37:12 +0000 @@ -261,7 +261,8 @@ (mapcar (lambda (arg) ;; FIXME; can we purecopy some of the conses too? - (cons (car arg) (purecopy-cons (cdr arg)))) + (cons (car arg) + (cons (purecopy (car (cdr arg))) (purecopy (cdr (cdr arg)))))) '((:family (".attributeFamily" . "Face.AttributeFamily")) (:foundry (".attributeFoundry" . "Face.AttributeFoundry")) (:width (".attributeWidth" . "Face.AttributeWidth")) === modified file 'lisp/files.el' --- lisp/files.el 2011-02-01 18:15:18 +0000 +++ lisp/files.el 2011-02-01 21:37:12 +0000 @@ -2229,7 +2229,8 @@ ;; directives in that file. That way is discouraged since it ;; spreads out the definition of the initial value. (mapcar - 'purecopy-car + (lambda (elt) + (cons (purecopy (car elt)) (cdr elt))) `(;; do this first, so that .html.pl is Polish html, not Perl ("\\.[sx]?html?\\(\\.[a-zA-Z_]+\\)?\\'" . html-mode) ("\\.svgz?\\'" . image-mode) @@ -2453,7 +2454,8 @@ ;; file. That way is discouraged since it spreads out the ;; definition of the initial value. (mapcar - 'purecopy-car + (lambda (l) + (cons (purecopy (car l)) (cdr l))) '(("perl" . perl-mode) ("perl5" . perl-mode) ("miniperl" . perl-mode) === modified file 'lisp/international/fontset.el' --- lisp/international/fontset.el 2011-02-01 18:15:18 +0000 +++ lisp/international/fontset.el 2011-02-01 21:37:12 +0000 @@ -33,7 +33,8 @@ ;; Setup font-encoding-alist for all known encodings. (setq font-encoding-alist - (mapcar 'purecopy-car + (mapcar (lambda (arg) + (cons (purecopy (car arg)) (cdr arg))) '(("iso8859-1$" . iso-8859-1) ("iso8859-2$" . iso-8859-2) ("iso8859-3$" . iso-8859-3) === modified file 'lisp/international/mule-conf.el' --- lisp/international/mule-conf.el 2011-02-01 18:15:18 +0000 +++ lisp/international/mule-conf.el 2011-02-01 21:37:12 +0000 @@ -1505,7 +1505,7 @@ ;; Tar files are not decoded at all, but we treat them as raw bytes. (setq file-coding-system-alist - (mapcar 'purecopy-car + (mapcar (lambda (arg) (cons (purecopy (car arg)) (cdr arg))) '(("\\.elc\\'" . utf-8-emacs) ("\\.utf\\(-8\\)?\\'" . utf-8) ("\\.xml\\'" . xml-find-file-coding-system) === modified file 'lisp/international/mule.el' --- lisp/international/mule.el 2011-02-01 18:15:18 +0000 +++ lisp/international/mule.el 2011-02-01 21:37:12 +0000 @@ -1671,11 +1671,11 @@ (defcustom auto-coding-alist ;; .exe and .EXE are added to support archive-mode looking at DOS ;; self-extracting exe archives. - (mapcar 'purecopy-car - '(("\\.\\(\ + (mapcar (lambda (arg) (cons (purecopy (car arg)) (cdr arg))) + '(("\\.\\(\ arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|7z\\|\ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\)\\'" - . no-conversion-multibyte) + . no-conversion-multibyte) ("\\.\\(exe\\|EXE\\)\\'" . no-conversion) ("\\.\\(sx[dmicw]\\|odt\\|tar\\|tgz\\)\\'" . no-conversion) ("\\.\\(gz\\|Z\\|bz\\|bz2\\|xz\\|gpg\\)\\'" . no-conversion) @@ -1696,7 +1696,7 @@ (symbol :tag "Coding system")))) (defcustom auto-coding-regexp-alist - (mapcar 'purecopy-car + (mapcar (lambda (arg) (cons (purecopy (car arg)) (cdr arg))) '(("\\`BABYL OPTIONS:[ \t]*-\\*-[ \t]*rmail[ \t]*-\\*-" . no-conversion) ("\\`\xFE\xFF" . utf-16be-with-signature) ("\\`\xFF\xFE" . utf-16le-with-signature) === modified file 'lisp/mouse.el' --- lisp/mouse.el 2011-02-01 18:15:18 +0000 +++ lisp/mouse.el 2011-02-01 21:37:12 +0000 @@ -1719,7 +1719,7 @@ :version "20.3") (defvar mouse-buffer-menu-mode-groups - (mapcar 'purecopy-cons + (mapcar (lambda (arg) (cons (purecopy (car arg)) (purecopy (cdr arg)))) '(("Info\\|Help\\|Apropos\\|Man" . "Help") ("\\bVM\\b\\|\\bMH\\b\\|Message\\|Mail\\|Group\\|Score\\|Summary\\|Article" . "Mail/News") === modified file 'lisp/subr.el' --- lisp/subr.el 2011-02-01 19:17:10 +0000 +++ lisp/subr.el 2011-02-01 21:37:12 +0000 @@ -2320,13 +2320,6 @@ ;;;; Miscellanea. -(defun purecopy-cons (arg) - "Return a copy of ARG from a `purecopy' of the car and cdr of ARG." - (cons (purecopy (car arg)) (purecopy (cdr arg)))) -(defun purecopy-car (arg) - "Return a copy of ARG whose car is a `purecopy' of the car of ARG." - (cons (purecopy (car arg)) (cdr arg))) - (defvar suspend-hook nil "Normal hook run by `suspend-emacs', before suspending.") === modified file 'lisp/term/x-win.el' --- lisp/term/x-win.el 2011-02-01 18:15:18 +0000 +++ lisp/term/x-win.el 2011-02-01 21:37:12 +0000 @@ -1447,7 +1447,8 @@ (define-key special-event-map [drag-n-drop] 'x-dnd-handle-drag-n-drop-event) (defcustom x-gtk-stock-map - (mapcar 'purecopy-cons + (mapcar (lambda (arg) + (cons (purecopy (car arg)) (purecopy (cdr arg)))) '( ("etc/images/new" . "gtk-new") ("etc/images/open" . "gtk-open") ------------------------------------------------------------ revno: 103075 committer: Sam Steingold branch nick: trunk timestamp: Tue 2011-02-01 16:22:21 -0500 message: * lisp/simple.el (special-mode-map): Bind "h" to `describe-mode'; bind "z" to `kill-this-buffer'. (completion-list-mode-map): Bind "z" to `kill-this-buffer'. * lisp/apropos.el (apropos-mode-map): Inherit from `special-mode-map'. (apropos-mode): Inherit from `special-mode'. * lisp/arc-mode.el (archive-mode-map): Inherit from `special-mode-map'. * lisp/bookmark.el (bookmark-bmenu-mode): Define using `define-derived-mode' inheriting from `special-mode'. * lisp/dired.el (dired-mode-map): Inherit from `special-mode-map'. * lisp/image-mode.el (image-mode-map): Ditto. * lisp/replace.el (occur-mode): Define using `define-derived-mode' inheriting from `special-mode'. * lisp/tar-mode.el (tar-mode): Inherit from `special-mode'. * lisp/calendar/diary-lib.el (diary-fancy-display-mode): Inherit from `special-mode-map'. * lisp/emacs-lisp/ert.el (ert-simple-view-mode, ert-results-mode): Inherit from `special-mode'. * lisp/emacs-lisp/package.el (package-menu-mode-map): Copy from `special-mode-map'. (package-menu-mode): Define using `define-derived-mode' inheriting from `special-mode'. * erc/erc-list.el (erc-list-menu-mode): Inherit from `special-mode'. * lisp/net/xesam.el (xesam-mode): Inherit from `special-mode'. (xesam-mode-map): Define separately. * lisp/play/solitaire.el (solitaire-mode): Inherit from `special-mode'. * lisp/progmodes/compile.el (compilation-minor-mode-map) (compilation-mode-map): Inherit from `special-mode-map'. * lisp/vc/diff-mode.el (diff-mode-shared-map): Inherit from `special-mode-map'. * lisp/vc/log-view.el (log-view-mode-map): Add a comment. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-02-01 18:15:18 +0000 +++ lisp/ChangeLog 2011-02-01 21:22:21 +0000 @@ -1,5 +1,38 @@ 2011-02-01 Sam Steingold + * simple.el (special-mode-map): Bind "h" to `describe-mode'; + bind "z" to `kill-this-buffer'. + (completion-list-mode-map): Bind "z" to `kill-this-buffer'. + * apropos.el (apropos-mode-map): Inherit from `special-mode-map'. + (apropos-mode): Inherit from `special-mode'. + * arc-mode.el (archive-mode-map): Inherit from `special-mode-map'. + * bookmark.el (bookmark-bmenu-mode): Define using + `define-derived-mode' inheriting from `special-mode'. + * dired.el (dired-mode-map): Inherit from `special-mode-map'. + * image-mode.el (image-mode-map): Ditto. + * replace.el (occur-mode): Define using + `define-derived-mode' inheriting from `special-mode'. + * tar-mode.el (tar-mode): Inherit from `special-mode'. + * calendar/diary-lib.el (diary-fancy-display-mode): + Inherit from `special-mode-map'. + * emacs-lisp/ert.el (ert-simple-view-mode, ert-results-mode): + Inherit from `special-mode'. + * emacs-lisp/package.el (package-menu-mode-map): Copy from + `special-mode-map'. + (package-menu-mode): Define using `define-derived-mode' + inheriting from `special-mode'. + * erc/erc-list.el (erc-list-menu-mode): Inherit from `special-mode'. + * net/xesam.el (xesam-mode): Inherit from `special-mode'. + (xesam-mode-map): Define separately. + * play/solitaire.el (solitaire-mode): Inherit from `special-mode'. + * progmodes/compile.el (compilation-minor-mode-map) + (compilation-mode-map): Inherit from `special-mode-map'. + * vc/diff-mode.el (diff-mode-shared-map): + Inherit from `special-mode-map'. + * vc/log-view.el (log-view-mode-map): Add a comment. + +2011-02-01 Sam Steingold + * subr.el (purecopy-cons, purecopy-car): Add shortcuts. * faces.el (face-x-resources): Use `purecopy-cons'. * files.el (auto-mode-alist, interpreter-mode-alist): Use === modified file 'lisp/apropos.el' --- lisp/apropos.el 2011-01-25 04:08:28 +0000 +++ lisp/apropos.el 2011-02-01 21:22:21 +0000 @@ -121,15 +121,12 @@ (const :tag "show scores" verbose))) (defvar apropos-mode-map - (let ((map (make-sparse-keymap))) - (set-keymap-parent map button-buffer-map) + (let ((map (copy-keymap button-buffer-map))) + (set-keymap-parent map special-mode-map) ;; Use `apropos-follow' instead of just using the button ;; definition of RET, so that users can use it anywhere in an ;; apropos item, not just on top of a button. (define-key map "\C-m" 'apropos-follow) - (define-key map " " 'scroll-up) - (define-key map "\177" 'scroll-down) - (define-key map "q" 'quit-window) map) "Keymap used in Apropos mode.") @@ -410,7 +407,7 @@ "Return t if DOC is really matched by the current keywords." (apropos-true-hit doc apropos-all-words)) -(define-derived-mode apropos-mode fundamental-mode "Apropos" +(define-derived-mode apropos-mode special-mode "Apropos" "Major mode for following hyperlinks in output of apropos commands. \\{apropos-mode-map}") === modified file 'lisp/arc-mode.el' --- lisp/arc-mode.el 2011-01-25 04:08:28 +0000 +++ lisp/arc-mode.el 2011-02-01 21:22:21 +0000 @@ -339,7 +339,7 @@ (defvar archive-local-name nil "Name of local copy of remote archive.") (defvar archive-mode-map (let ((map (make-keymap))) - (suppress-keymap map) + (set-keymap-parent map 'special-mode-map) (define-key map " " 'archive-next-line) (define-key map "a" 'archive-alternate-display) ;;(define-key map "c" 'archive-copy) @@ -348,15 +348,12 @@ (define-key map "e" 'archive-extract) (define-key map "f" 'archive-extract) (define-key map "\C-m" 'archive-extract) - (define-key map "g" 'revert-buffer) - (define-key map "h" 'describe-mode) (define-key map "m" 'archive-mark) (define-key map "n" 'archive-next-line) (define-key map "\C-n" 'archive-next-line) (define-key map [down] 'archive-next-line) (define-key map "o" 'archive-extract-other-window) (define-key map "p" 'archive-previous-line) - (define-key map "q" 'quit-window) (define-key map "\C-p" 'archive-previous-line) (define-key map [up] 'archive-previous-line) (define-key map "r" 'archive-rename-entry) === modified file 'lisp/bookmark.el' --- lisp/bookmark.el 2011-01-26 08:36:39 +0000 +++ lisp/bookmark.el 2011-02-01 21:22:21 +0000 @@ -1058,7 +1058,7 @@ (defun bookmark-handle-bookmark (bookmark-name-or-record) "Call BOOKMARK-NAME-OR-RECORD's handler or `bookmark-default-handler' if it has none. This changes current buffer and point and returns nil, -or signals a `file-error'. +or signals a `file-error'. If BOOKMARK-NAME-OR-RECORD has no file, this is a no-op. If BOOKMARK-NAME-OR-RECORD has a file, but that file no longer exists, @@ -1473,45 +1473,6 @@ (defvar bookmark-bmenu-hidden-bookmarks ()) -(defvar bookmark-bmenu-mode-map - (let ((map (make-keymap))) - (suppress-keymap map t) - (define-key map "q" 'quit-window) - (define-key map "v" 'bookmark-bmenu-select) - (define-key map "w" 'bookmark-bmenu-locate) - (define-key map "2" 'bookmark-bmenu-2-window) - (define-key map "1" 'bookmark-bmenu-1-window) - (define-key map "j" 'bookmark-bmenu-this-window) - (define-key map "\C-c\C-c" 'bookmark-bmenu-this-window) - (define-key map "f" 'bookmark-bmenu-this-window) - (define-key map "\C-m" 'bookmark-bmenu-this-window) - (define-key map "o" 'bookmark-bmenu-other-window) - (define-key map "\C-o" 'bookmark-bmenu-switch-other-window) - (define-key map "s" 'bookmark-bmenu-save) - (define-key map "k" 'bookmark-bmenu-delete) - (define-key map "\C-d" 'bookmark-bmenu-delete-backwards) - (define-key map "x" 'bookmark-bmenu-execute-deletions) - (define-key map "d" 'bookmark-bmenu-delete) - (define-key map " " 'next-line) - (define-key map "n" 'next-line) - (define-key map "p" 'previous-line) - (define-key map "\177" 'bookmark-bmenu-backup-unmark) - (define-key map "?" 'describe-mode) - (define-key map "u" 'bookmark-bmenu-unmark) - (define-key map "m" 'bookmark-bmenu-mark) - (define-key map "l" 'bookmark-bmenu-load) - (define-key map "r" 'bookmark-bmenu-rename) - (define-key map "R" 'bookmark-bmenu-relocate) - (define-key map "t" 'bookmark-bmenu-toggle-filenames) - (define-key map "a" 'bookmark-bmenu-show-annotation) - (define-key map "A" 'bookmark-bmenu-show-all-annotations) - (define-key map "e" 'bookmark-bmenu-edit-annotation) - ;; The original binding of M-g hides the M-g prefix map. - ;; If someone has a better idea than M-g s, I'm open to suggestions. - (define-key map [?\M-g ?s] 'bookmark-bmenu-search) - (define-key map [mouse-2] 'bookmark-bmenu-other-window-with-mouse) - map)) - ;; Bookmark Buffer Menu mode is suitable only for specially formatted ;; data. (put 'bookmark-bmenu-mode 'mode-class 'special) @@ -1586,7 +1547,7 @@ -(defun bookmark-bmenu-mode () +(define-derived-mode bookmark-bmenu-mode special-mode "Bookmark Menu" "Major mode for editing a list of bookmarks. Each line describes one of the bookmarks in Emacs. Letters do not insert themselves; instead, they are commands. @@ -1619,14 +1580,42 @@ in another buffer. \\[bookmark-bmenu-show-all-annotations] -- show the annotations of all bookmarks in another buffer. \\[bookmark-bmenu-edit-annotation] -- edit the annotation for the current bookmark." - (kill-all-local-variables) - (use-local-map bookmark-bmenu-mode-map) (setq truncate-lines t) - (setq buffer-read-only t) - (setq major-mode 'bookmark-bmenu-mode) - (setq mode-name "Bookmark Menu") - (run-mode-hooks 'bookmark-bmenu-mode-hook)) + (setq buffer-read-only t)) +(define-key bookmark-bmenu-mode-map "q" 'quit-window) +(define-key bookmark-bmenu-mode-map "v" 'bookmark-bmenu-select) +(define-key bookmark-bmenu-mode-map "w" 'bookmark-bmenu-locate) +(define-key bookmark-bmenu-mode-map "2" 'bookmark-bmenu-2-window) +(define-key bookmark-bmenu-mode-map "1" 'bookmark-bmenu-1-window) +(define-key bookmark-bmenu-mode-map "j" 'bookmark-bmenu-this-window) +(define-key bookmark-bmenu-mode-map "\C-c\C-c" 'bookmark-bmenu-this-window) +(define-key bookmark-bmenu-mode-map "f" 'bookmark-bmenu-this-window) +(define-key bookmark-bmenu-mode-map "\C-m" 'bookmark-bmenu-this-window) +(define-key bookmark-bmenu-mode-map "o" 'bookmark-bmenu-other-window) +(define-key bookmark-bmenu-mode-map "\C-o" 'bookmark-bmenu-switch-other-window) +(define-key bookmark-bmenu-mode-map "s" 'bookmark-bmenu-save) +(define-key bookmark-bmenu-mode-map "k" 'bookmark-bmenu-delete) +(define-key bookmark-bmenu-mode-map "\C-d" 'bookmark-bmenu-delete-backwards) +(define-key bookmark-bmenu-mode-map "x" 'bookmark-bmenu-execute-deletions) +(define-key bookmark-bmenu-mode-map "d" 'bookmark-bmenu-delete) +(define-key bookmark-bmenu-mode-map " " 'next-line) +(define-key bookmark-bmenu-mode-map "n" 'next-line) +(define-key bookmark-bmenu-mode-map "p" 'previous-line) +(define-key bookmark-bmenu-mode-map "\177" 'bookmark-bmenu-backup-unmark) +(define-key bookmark-bmenu-mode-map "?" 'describe-mode) +(define-key bookmark-bmenu-mode-map "u" 'bookmark-bmenu-unmark) +(define-key bookmark-bmenu-mode-map "m" 'bookmark-bmenu-mark) +(define-key bookmark-bmenu-mode-map "l" 'bookmark-bmenu-load) +(define-key bookmark-bmenu-mode-map "r" 'bookmark-bmenu-rename) +(define-key bookmark-bmenu-mode-map "R" 'bookmark-bmenu-relocate) +(define-key bookmark-bmenu-mode-map "t" 'bookmark-bmenu-toggle-filenames) +(define-key bookmark-bmenu-mode-map "a" 'bookmark-bmenu-show-annotation) +(define-key bookmark-bmenu-mode-map "A" 'bookmark-bmenu-show-all-annotations) +(define-key bookmark-bmenu-mode-map "e" 'bookmark-bmenu-edit-annotation) +;; The original binding of M-g hides the M-g prefix map. +;; If someone has a better idea than M-g s, I'm open to suggestions. +(define-key bookmark-bmenu-mode-map [?\M-g ?s] 'bookmark-bmenu-search)(define-key bookmark-bmenu-mode-map [mouse-2] 'bookmark-bmenu-other-window-with-mouse) (defun bookmark-bmenu-toggle-filenames (&optional show) "Toggle whether filenames are shown in the bookmark list. === modified file 'lisp/calendar/diary-lib.el' --- lisp/calendar/diary-lib.el 2011-01-25 04:08:28 +0000 +++ lisp/calendar/diary-lib.el 2011-02-01 21:22:21 +0000 @@ -2409,12 +2409,10 @@ (setq end (line-beginning-position 2))) (font-lock-default-fontify-region beg end verbose)) -(defvar diary-fancy-overriding-map (let ((map (make-sparse-keymap))) - (define-key map "q" 'quit-window) - map) +(defvar diary-fancy-overriding-map (make-sparse-keymap) "Keymap overriding minor-mode maps in `diary-fancy-display-mode'.") -(define-derived-mode diary-fancy-display-mode fundamental-mode +(define-derived-mode diary-fancy-display-mode special-mode "Diary" "Major mode used while displaying diary entries using Fancy Display." (set (make-local-variable 'font-lock-defaults) @@ -2422,7 +2420,6 @@ t nil nil nil (font-lock-fontify-region-function . diary-fancy-font-lock-fontify-region-function))) - (local-set-key "q" 'quit-window) (set (make-local-variable 'minor-mode-overriding-map-alist) (list (cons t diary-fancy-overriding-map))) (view-mode 1)) === modified file 'lisp/dired.el' --- lisp/dired.el 2011-01-28 16:58:04 +0000 +++ lisp/dired.el 2011-02-01 21:22:21 +0000 @@ -1294,7 +1294,7 @@ ;; This looks ugly when substitute-command-keys uses C-d instead d: ;; (define-key dired-mode-map "\C-d" 'dired-flag-file-deletion) (let ((map (make-keymap))) - (suppress-keymap map) + (set-keymap-parent map special-mode-map) (define-key map [mouse-2] 'dired-mouse-find-file-other-window) (define-key map [follow-link] 'mouse-face) ;; Commands to mark or flag certain categories of files @@ -1373,7 +1373,6 @@ (define-key map "\C-m" 'dired-find-file) (put 'dired-find-file :advertised-binding "\C-m") (define-key map "g" 'revert-buffer) - (define-key map "h" 'describe-mode) (define-key map "i" 'dired-maybe-insert-subdir) (define-key map "j" 'dired-goto-file) (define-key map "k" 'dired-do-kill-lines) @@ -1383,7 +1382,6 @@ (define-key map "o" 'dired-find-file-other-window) (define-key map "\C-o" 'dired-display-file) (define-key map "p" 'dired-previous-line) - (define-key map "q" 'quit-window) (define-key map "s" 'dired-sort-toggle-or-edit) (define-key map "t" 'dired-toggle-marks) (define-key map "u" 'dired-unmark) @@ -2027,7 +2025,7 @@ ;; with quotation marks in their names. (while (string-match "\\(?:[^\\]\\|\\`\\)\\(\"\\)" file) (setq file (replace-match "\\\"" nil t file 1))) - + (when (eq system-type 'windows-nt) (save-match-data (let ((start 0)) === modified file 'lisp/emacs-lisp/ert.el' --- lisp/emacs-lisp/ert.el 2011-01-25 04:08:28 +0000 +++ lisp/emacs-lisp/ert.el 2011-02-01 21:22:21 +0000 @@ -1997,19 +1997,12 @@ ;;; Simple view mode for auxiliary information like stack traces or ;;; messages. Mainly binds "q" for quit. -(define-derived-mode ert-simple-view-mode fundamental-mode "ERT-View" +(define-derived-mode ert-simple-view-mode special-mode "ERT-View" "Major mode for viewing auxiliary information in ERT.") -(loop for (key binding) in - '(("q" quit-window) - ) - do - (define-key ert-simple-view-mode-map key binding)) - - ;;; Commands and button actions for the results buffer. -(define-derived-mode ert-results-mode fundamental-mode "ERT-Results" +(define-derived-mode ert-results-mode special-mode "ERT-Results" "Major mode for viewing results of ERT test runs.") (loop for (key binding) in @@ -2017,7 +2010,6 @@ ("\t" forward-button) ([backtab] backward-button) ("j" ert-results-jump-between-summary-and-result) - ("q" quit-window) ("L" ert-results-toggle-printer-limits-for-test-at-point) ("n" ert-results-next-test) ("p" ert-results-previous-test) === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2011-01-25 04:08:28 +0000 +++ lisp/emacs-lisp/package.el 2011-02-01 21:22:21 +0000 @@ -1213,18 +1213,16 @@ ;;;; Package menu mode. (defvar package-menu-mode-map - (let ((map (make-keymap)) + (let ((map (copy-keymap special-mode-map)) (menu-map (make-sparse-keymap "Package"))) (set-keymap-parent map button-buffer-map) (define-key map "\C-m" 'package-menu-describe-package) - (define-key map "q" 'quit-window) (define-key map "n" 'next-line) (define-key map "p" 'previous-line) (define-key map "u" 'package-menu-mark-unmark) (define-key map "\177" 'package-menu-backup-unmark) (define-key map "d" 'package-menu-mark-delete) (define-key map "i" 'package-menu-mark-install) - (define-key map "g" 'revert-buffer) (define-key map "r" 'package-menu-refresh) (define-key map "~" 'package-menu-mark-obsolete-for-deletion) (define-key map "x" 'package-menu-execute) @@ -1290,15 +1288,11 @@ (put 'package-menu-mode 'mode-class 'special) -(defun package-menu-mode () +(define-derived-mode package-menu-mode special-mode "Package Menu" "Major mode for browsing a list of packages. Letters do not insert themselves; instead, they are commands. \\ \\{package-menu-mode-map}" - (kill-all-local-variables) - (use-local-map package-menu-mode-map) - (setq major-mode 'package-menu-mode) - (setq mode-name "Package Menu") (setq truncate-lines t) (setq buffer-read-only t) (set (make-local-variable 'revert-buffer-function) 'package-menu-revert) @@ -1326,8 +1320,7 @@ (20 . "Version") (32 . "Status") (43 . "Description")) - "")) - (run-mode-hooks 'package-menu-mode-hook)) + ""))) (defun package-menu-refresh () "Download the Emacs Lisp package archive. === modified file 'lisp/erc/erc-list.el' --- lisp/erc/erc-list.el 2011-01-25 04:08:28 +0000 +++ lisp/erc/erc-list.el 2011-02-01 21:22:21 +0000 @@ -117,26 +117,12 @@ (sort-fields col (point-min) (point-max)) (sort-numeric-fields col (point-min) (point-max)))))) -(defvar erc-list-menu-mode-map - (let ((map (make-keymap))) - (suppress-keymap map) - (define-key map "k" 'erc-list-kill) - (define-key map "j" 'erc-list-join) - (define-key map "g" 'erc-list-revert) - (define-key map "n" 'next-line) - (define-key map "p" 'previous-line) - (define-key map "q" 'quit-window) - map) - "Local keymap for `erc-list-mode' buffers.") - -(defvar erc-list-menu-sort-button-map nil - "Local keymap for ERC list menu mode sorting buttons.") - -(unless erc-list-menu-sort-button-map +(defvar erc-list-menu-sort-button-map (let ((map (make-sparse-keymap))) (define-key map [header-line mouse-1] 'erc-list-menu-sort-by-column) (define-key map [follow-link] 'mouse-face) - (setq erc-list-menu-sort-button-map map))) + map) + "Local keymap for ERC list menu mode sorting buttons.") ;; Helper function that makes a buttonized column header. (defun erc-list-button (title column) @@ -146,7 +132,7 @@ 'mouse-face 'highlight 'keymap erc-list-menu-sort-button-map)) -(define-derived-mode erc-list-menu-mode nil "ERC-List" +(define-derived-mode erc-list-menu-mode special-mode "ERC-List" "Major mode for editing a list of irc channels." (setq header-line-format (concat @@ -160,6 +146,12 @@ (put 'erc-list-menu-mode 'mode-class 'special) +(define-key erc-list-menu-mode-map "k" 'erc-list-kill) +(define-key erc-list-menu-mode-map "j" 'erc-list-join) +(define-key erc-list-menu-mode-map "g" 'erc-list-revert) +(define-key erc-list-menu-mode-map "n" 'next-line) +(define-key erc-list-menu-mode-map "p" 'previous-line) + ;; Handle a "322" response. This response tells us about a single ;; channel. (defun erc-list-handle-322 (proc parsed) === modified file 'lisp/image-mode.el' --- lisp/image-mode.el 2011-01-28 19:13:01 +0000 +++ lisp/image-mode.el 2011-02-01 21:22:21 +0000 @@ -305,8 +305,7 @@ (defvar image-mode-map (let ((map (make-sparse-keymap))) - (suppress-keymap map) - (define-key map "q" 'quit-window) + (set-keymap-parent map special-mode-map) (define-key map "\C-c\C-c" 'image-toggle-display) (define-key map (kbd "SPC") 'image-scroll-up) (define-key map (kbd "DEL") 'image-scroll-down) @@ -385,7 +384,6 @@ (funcall (if (called-interactively-p 'any) 'error 'message) "Cannot display image: %s" (cdr err))))) - ;;;###autoload (define-minor-mode image-minor-mode "Toggle Image minor mode. === modified file 'lisp/net/xesam.el' --- lisp/net/xesam.el 2011-01-25 04:08:28 +0000 +++ lisp/net/xesam.el 2011-02-01 21:22:21 +0000 @@ -446,7 +446,12 @@ ;;; Search buffers. -(define-derived-mode xesam-mode nil "Xesam" +(defvar xesam-mode-map + (let ((map (copy-keymap special-mode-map))) + (set-keymap-parent xesam-mode-map widget-keymap) + map)) + +(define-derived-mode xesam-mode special-mode "Xesam" "Major mode for presenting search results of a Xesam search. In this mode, widgets represent the search results. @@ -455,12 +460,6 @@ can be used to set `xesam-notify-function', which must a search engine specific, widget :notify function to visualize xesam:url." (set (make-local-variable 'xesam-notify-function) nil) - - ;; Keymap. - (setq xesam-mode-map (copy-keymap special-mode-map)) - (set-keymap-parent xesam-mode-map widget-keymap) - (define-key xesam-mode-map "z" 'kill-this-buffer) - ;; Maybe we implement something useful, later on. (set (make-local-variable 'revert-buffer-function) 'ignore) ;; `xesam-engine', `xesam-search', `xesam-type', `xesam-query', and === modified file 'lisp/play/solitaire.el' --- lisp/play/solitaire.el 2011-01-25 04:08:28 +0000 +++ lisp/play/solitaire.el 2011-02-01 21:22:21 +0000 @@ -41,54 +41,10 @@ :type 'hook :group 'solitaire) -(defvar solitaire-mode-map - (let ((map (make-sparse-keymap))) - (suppress-keymap map t) - - (define-key map "\C-f" 'solitaire-right) - (define-key map "\C-b" 'solitaire-left) - (define-key map "\C-p" 'solitaire-up) - (define-key map "\C-n" 'solitaire-down) - (define-key map "\r" 'solitaire-move) - (define-key map [remap undo] 'solitaire-undo) - (define-key map " " 'solitaire-do-check) - (define-key map "q" 'quit-window) - - (define-key map [right] 'solitaire-right) - (define-key map [left] 'solitaire-left) - (define-key map [up] 'solitaire-up) - (define-key map [down] 'solitaire-down) - - (define-key map [S-right] 'solitaire-move-right) - (define-key map [S-left] 'solitaire-move-left) - (define-key map [S-up] 'solitaire-move-up) - (define-key map [S-down] 'solitaire-move-down) - - (define-key map [kp-6] 'solitaire-right) - (define-key map [kp-4] 'solitaire-left) - (define-key map [kp-8] 'solitaire-up) - (define-key map [kp-2] 'solitaire-down) - (define-key map [kp-5] 'solitaire-center-point) - - (define-key map [S-kp-6] 'solitaire-move-right) - (define-key map [S-kp-4] 'solitaire-move-left) - (define-key map [S-kp-8] 'solitaire-move-up) - (define-key map [S-kp-2] 'solitaire-move-down) - - (define-key map [kp-enter] 'solitaire-move) - (define-key map [kp-0] 'solitaire-undo) - - ;; spoil it with s ;) - (define-key map [?s] 'solitaire-solve) - - ;; (define-key map [kp-0] 'solitaire-hint) - Not yet provided ;) - map) - "Keymap for playing Solitaire.") - ;; Solitaire mode is suitable only for specially formatted data. (put 'solitaire-mode 'mode-class 'special) -(define-derived-mode solitaire-mode nil "Solitaire" +(define-derived-mode solitaire-mode special-mode "Solitaire" "Major mode for playing Solitaire. To learn how to play Solitaire, see the documentation for function `solitaire'. @@ -98,6 +54,41 @@ (setq truncate-lines t) (setq show-trailing-whitespace nil)) +(define-key solitaire-mode-map "\C-f" 'solitaire-right) +(define-key solitaire-mode-map "\C-b" 'solitaire-left) +(define-key solitaire-mode-map "\C-p" 'solitaire-up) +(define-key solitaire-mode-map "\C-n" 'solitaire-down) +(define-key solitaire-mode-map "\r" 'solitaire-move) +(define-key solitaire-mode-map [remap undo] 'solitaire-undo) +(define-key solitaire-mode-map " " 'solitaire-do-check) + +(define-key solitaire-mode-map [right] 'solitaire-right) +(define-key solitaire-mode-map [left] 'solitaire-left) +(define-key solitaire-mode-map [up] 'solitaire-up) +(define-key solitaire-mode-map [down] 'solitaire-down) + +(define-key solitaire-mode-map [S-right] 'solitaire-move-right) +(define-key solitaire-mode-map [S-left] 'solitaire-move-left) +(define-key solitaire-mode-map [S-up] 'solitaire-move-up) +(define-key solitaire-mode-map [S-down] 'solitaire-move-down) + +(define-key solitaire-mode-map [kp-6] 'solitaire-right) +(define-key solitaire-mode-map [kp-4] 'solitaire-left) +(define-key solitaire-mode-map [kp-8] 'solitaire-up) +(define-key solitaire-mode-map [kp-2] 'solitaire-down) +(define-key solitaire-mode-map [kp-5] 'solitaire-center-point) + +(define-key solitaire-mode-map [S-kp-6] 'solitaire-move-right) +(define-key solitaire-mode-map [S-kp-4] 'solitaire-move-left) +(define-key solitaire-mode-map [S-kp-8] 'solitaire-move-up) +(define-key solitaire-mode-map [S-kp-2] 'solitaire-move-down) + +(define-key solitaire-mode-map [kp-enter] 'solitaire-move) +(define-key solitaire-mode-map [kp-0] 'solitaire-undo) + +;; spoil it with s ;) +(define-key solitaire-mode-map [?s] 'solitaire-solve) +;; (define-key map [kp-0] 'solitaire-hint) - Not yet provided ;) (defvar solitaire-stones 0 "Counter for the stones that are still there.") === modified file 'lisp/progmodes/compile.el' --- lisp/progmodes/compile.el 2011-02-01 16:33:17 +0000 +++ lisp/progmodes/compile.el 2011-02-01 21:22:21 +0000 @@ -862,7 +862,7 @@ (< (cdr compilation--previous-directory-cache) pos))) ;; No need to call previous-single-property-change. (cdr compilation--previous-directory-cache) - + (let* ((cache (and compilation--previous-directory-cache (<= (car compilation--previous-directory-cache) pos) (car compilation--previous-directory-cache))) @@ -1711,6 +1711,7 @@ (defvar compilation-minor-mode-map (let ((map (make-sparse-keymap))) + (set-keymap-parent map special-mode-map) (define-key map [mouse-2] 'compile-goto-error) (define-key map [follow-link] 'mouse-face) (define-key map "\C-c\C-c" 'compile-goto-error) @@ -1721,7 +1722,6 @@ (define-key map "\M-{" 'compilation-previous-file) (define-key map "\M-}" 'compilation-next-file) (define-key map "g" 'recompile) ; revert - (define-key map "q" 'quit-window) ;; Set up the menu-bar (define-key map [menu-bar compilation] (cons "Errors" compilation-menu-map)) @@ -1755,6 +1755,7 @@ ;; Don't inherit from compilation-minor-mode-map, ;; because that introduces a menu bar item we don't want. ;; That confuses C-down-mouse-3. + (set-keymap-parent map special-mode-map) (define-key map [mouse-2] 'compile-goto-error) (define-key map [follow-link] 'mouse-face) (define-key map "\C-c\C-c" 'compile-goto-error) @@ -1767,10 +1768,7 @@ (define-key map "\t" 'compilation-next-error) (define-key map [backtab] 'compilation-previous-error) (define-key map "g" 'recompile) ; revert - (define-key map "q" 'quit-window) - (define-key map " " 'scroll-up) - (define-key map "\^?" 'scroll-down) (define-key map "\C-c\C-f" 'next-error-follow-minor-mode) ;; Set up the menu-bar === modified file 'lisp/replace.el' --- lisp/replace.el 2011-01-25 04:08:28 +0000 +++ lisp/replace.el 2011-02-01 21:22:21 +0000 @@ -757,63 +757,6 @@ count))) -(defvar occur-mode-map - (let ((map (make-sparse-keymap))) - ;; We use this alternative name, so we can use \\[occur-mode-mouse-goto]. - (define-key map [mouse-2] 'occur-mode-mouse-goto) - (define-key map "\C-c\C-c" 'occur-mode-goto-occurrence) - (define-key map "\C-m" 'occur-mode-goto-occurrence) - (define-key map "o" 'occur-mode-goto-occurrence-other-window) - (define-key map "\C-o" 'occur-mode-display-occurrence) - (define-key map "\M-n" 'occur-next) - (define-key map "\M-p" 'occur-prev) - (define-key map "r" 'occur-rename-buffer) - (define-key map "c" 'clone-buffer) - (define-key map "g" 'revert-buffer) - (define-key map "q" 'quit-window) - (define-key map "z" 'kill-this-buffer) - (define-key map "\C-c\C-f" 'next-error-follow-minor-mode) - (define-key map [menu-bar] (make-sparse-keymap)) - (define-key map [menu-bar occur] - `(cons ,(purecopy "Occur") map)) - (define-key map [next-error-follow-minor-mode] - (menu-bar-make-mm-toggle next-error-follow-minor-mode - "Auto Occurrence Display" - "Display another occurrence when moving the cursor")) - (define-key map [separator-1] menu-bar-separator) - (define-key map [kill-this-buffer] - `(menu-item ,(purecopy "Kill occur buffer") kill-this-buffer - :help ,(purecopy "Kill the current *Occur* buffer"))) - (define-key map [quit-window] - `(menu-item ,(purecopy "Quit occur window") quit-window - :help ,(purecopy "Quit the current *Occur* buffer. Bury it, and maybe delete the selected frame"))) - (define-key map [revert-buffer] - `(menu-item ,(purecopy "Revert occur buffer") revert-buffer - :help ,(purecopy "Replace the text in the *Occur* buffer with the results of rerunning occur"))) - (define-key map [clone-buffer] - `(menu-item ,(purecopy "Clone occur buffer") clone-buffer - :help ,(purecopy "Create and return a twin copy of the current *Occur* buffer"))) - (define-key map [occur-rename-buffer] - `(menu-item ,(purecopy "Rename occur buffer") occur-rename-buffer - :help ,(purecopy "Rename the current *Occur* buffer to *Occur: original-buffer-name*."))) - (define-key map [separator-2] menu-bar-separator) - (define-key map [occur-mode-goto-occurrence-other-window] - `(menu-item ,(purecopy "Go To Occurrence Other Window") occur-mode-goto-occurrence-other-window - :help ,(purecopy "Go to the occurrence the current line describes, in another window"))) - (define-key map [occur-mode-goto-occurrence] - `(menu-item ,(purecopy "Go To Occurrence") occur-mode-goto-occurrence - :help ,(purecopy "Go to the occurrence the current line describes"))) - (define-key map [occur-mode-display-occurrence] - `(menu-item ,(purecopy "Display Occurrence") occur-mode-display-occurrence - :help ,(purecopy "Display in another window the occurrence the current line describes"))) - (define-key map [occur-next] - `(menu-item ,(purecopy "Move to next match") occur-next - :help ,(purecopy "Move to the Nth (default 1) next match in an Occur mode buffer"))) - (define-key map [occur-prev] - `(menu-item ,(purecopy "Move to previous match") occur-prev - :help ,(purecopy "Move to the Nth (default 1) previous match in an Occur mode buffer"))) - map) - "Keymap for `occur-mode'.") (defvar occur-revert-arguments nil "Arguments to pass to `occur-1' to revert an Occur mode buffer. @@ -837,24 +780,66 @@ :group 'matching) (put 'occur-mode 'mode-class 'special) -(defun occur-mode () +(define-derived-mode occur-mode special-mode "Occur" "Major mode for output from \\[occur]. \\Move point to one of the items in this buffer, then use \\[occur-mode-goto-occurrence] to go to the occurrence that the item refers to. Alternatively, click \\[occur-mode-mouse-goto] on an item to go to it. \\{occur-mode-map}" - (interactive) - (kill-all-local-variables) - (use-local-map occur-mode-map) - (setq major-mode 'occur-mode) - (setq mode-name "Occur") (set (make-local-variable 'revert-buffer-function) 'occur-revert-function) (make-local-variable 'occur-revert-arguments) (add-hook 'change-major-mode-hook 'font-lock-defontify nil t) - (setq next-error-function 'occur-next-error) - (run-mode-hooks 'occur-mode-hook)) + (setq next-error-function 'occur-next-error)) +(define-key occur-mode-map [mouse-2] 'occur-mode-mouse-goto) +(define-key occur-mode-map "\C-c\C-c" 'occur-mode-goto-occurrence) +(define-key occur-mode-map "\C-m" 'occur-mode-goto-occurrence) +(define-key occur-mode-map "o" 'occur-mode-goto-occurrence-other-window) +(define-key occur-mode-map "\C-o" 'occur-mode-display-occurrence) +(define-key occur-mode-map "\M-n" 'occur-next) +(define-key occur-mode-map "\M-p" 'occur-prev) +(define-key occur-mode-map "r" 'occur-rename-buffer) +(define-key occur-mode-map "c" 'clone-buffer) +(define-key occur-mode-map "\C-c\C-f" 'next-error-follow-minor-mode) +(define-key occur-mode-map [menu-bar] (make-sparse-keymap)) +(define-key occur-mode-map [menu-bar occur] `(cons ,(purecopy "Occur") map)) +(define-key occur-mode-map [next-error-follow-minor-mode] + (menu-bar-make-mm-toggle next-error-follow-minor-mode + "Auto Occurrence Display" + "Display another occurrence when moving the cursor")) +(define-key occur-mode-map [separator-1] menu-bar-separator) +(define-key occur-mode-map [kill-this-buffer] + `(menu-item ,(purecopy "Kill occur buffer") kill-this-buffer + :help ,(purecopy "Kill the current *Occur* buffer"))) +(define-key occur-mode-map [quit-window] + `(menu-item ,(purecopy "Quit occur window") quit-window + :help ,(purecopy "Quit the current *Occur* buffer. Bury it, and maybe delete the selected frame"))) +(define-key occur-mode-map [revert-buffer] + `(menu-item ,(purecopy "Revert occur buffer") revert-buffer + :help ,(purecopy "Replace the text in the *Occur* buffer with the results of rerunning occur"))) +(define-key occur-mode-map [clone-buffer] + `(menu-item ,(purecopy "Clone occur buffer") clone-buffer + :help ,(purecopy "Create and return a twin copy of the current *Occur* buffer"))) +(define-key occur-mode-map [occur-rename-buffer] + `(menu-item ,(purecopy "Rename occur buffer") occur-rename-buffer + :help ,(purecopy "Rename the current *Occur* buffer to *Occur: original-buffer-name*."))) +(define-key occur-mode-map [separator-2] menu-bar-separator) +(define-key occur-mode-map [occur-mode-goto-occurrence-other-window] + `(menu-item ,(purecopy "Go To Occurrence Other Window") occur-mode-goto-occurrence-other-window + :help ,(purecopy "Go to the occurrence the current line describes, in another window"))) +(define-key occur-mode-map [occur-mode-goto-occurrence] + `(menu-item ,(purecopy "Go To Occurrence") occur-mode-goto-occurrence + :help ,(purecopy "Go to the occurrence the current line describes"))) +(define-key occur-mode-map [occur-mode-display-occurrence] + `(menu-item ,(purecopy "Display Occurrence") occur-mode-display-occurrence + :help ,(purecopy "Display in another window the occurrence the current line describes"))) +(define-key occur-mode-map [occur-next] + `(menu-item ,(purecopy "Move to next match") occur-next + :help ,(purecopy "Move to the Nth (default 1) next match in an Occur mode buffer"))) +(define-key occur-mode-map [occur-prev] + `(menu-item ,(purecopy "Move to previous match") occur-prev + :help ,(purecopy "Move to the Nth (default 1) previous match in an Occur mode buffer"))) (defun occur-revert-function (ignore1 ignore2) "Handle `revert-buffer' for Occur mode buffers." (apply 'occur-1 (append occur-revert-arguments (list (buffer-name))))) === modified file 'lisp/simple.el' --- lisp/simple.el 2011-01-25 04:08:28 +0000 +++ lisp/simple.el 2011-02-01 21:22:21 +0000 @@ -411,9 +411,11 @@ (define-key map " " 'scroll-up) (define-key map "\C-?" 'scroll-down) (define-key map "?" 'describe-mode) + (define-key map "h" 'describe-mode) (define-key map ">" 'end-of-buffer) (define-key map "<" 'beginning-of-buffer) (define-key map "g" 'revert-buffer) + (define-key map "z" 'kill-this-buffer) map)) (put 'special-mode 'mode-class 'special) @@ -5890,6 +5892,7 @@ (define-key map [left] 'previous-completion) (define-key map [right] 'next-completion) (define-key map "q" 'quit-window) + (define-key map "z" 'kill-this-buffer) map) "Local map for completion list buffers.") === modified file 'lisp/tar-mode.el' --- lisp/tar-mode.el 2011-01-26 08:36:39 +0000 +++ lisp/tar-mode.el 2011-02-01 21:22:21 +0000 @@ -220,7 +220,7 @@ (defun tar-roundup-512 (s) "Round S up to the next multiple of 512." (ash (ash (+ s 511) -9) 9)) - + (defun tar-header-block-tokenize (pos coding) "Return a `tar-header' structure. This is a list of name, mode, uid, gid, size, @@ -283,7 +283,7 @@ (let* ((size (tar-parse-octal-integer string tar-size-offset tar-time-offset)) ;; -1 so as to strip the terminating 0 byte. - (name (decode-coding-string + (name (decode-coding-string (buffer-substring pos (+ pos size -1)) coding)) (descriptor (tar-header-block-tokenize (+ pos (tar-roundup-512 size)) @@ -298,7 +298,7 @@ (setf (tar-header-header-start descriptor) (copy-marker (- pos 512) t)) descriptor) - + (make-tar-header (copy-marker pos nil) name @@ -501,7 +501,7 @@ ;;(tar-header-block-check-checksum ;; hblock (tar-header-block-checksum hblock) ;; (tar-header-name descriptor)) - + (push descriptor result) (setq pos (tar-header-data-end descriptor)) (progress-reporter-update progress-reporter pos))) @@ -520,86 +520,7 @@ (goto-char (point-min)) (restore-buffer-modified-p modified))) -(defvar tar-mode-map - (let ((map (make-keymap))) - (suppress-keymap map) - (define-key map " " 'tar-next-line) - (define-key map "C" 'tar-copy) - (define-key map "d" 'tar-flag-deleted) - (define-key map "\^D" 'tar-flag-deleted) - (define-key map "e" 'tar-extract) - (define-key map "f" 'tar-extract) - (define-key map "\C-m" 'tar-extract) - (define-key map [mouse-2] 'tar-mouse-extract) - (define-key map "g" 'revert-buffer) - (define-key map "h" 'describe-mode) - (define-key map "n" 'tar-next-line) - (define-key map "\^N" 'tar-next-line) - (define-key map [down] 'tar-next-line) - (define-key map "o" 'tar-extract-other-window) - (define-key map "p" 'tar-previous-line) - (define-key map "q" 'quit-window) - (define-key map "\^P" 'tar-previous-line) - (define-key map [up] 'tar-previous-line) - (define-key map "R" 'tar-rename-entry) - (define-key map "u" 'tar-unflag) - (define-key map "v" 'tar-view) - (define-key map "x" 'tar-expunge) - (define-key map "\177" 'tar-unflag-backwards) - (define-key map "E" 'tar-extract-other-window) - (define-key map "M" 'tar-chmod-entry) - (define-key map "G" 'tar-chgrp-entry) - (define-key map "O" 'tar-chown-entry) - ;; Let mouse-1 follow the link. - (define-key map [follow-link] 'mouse-face) - - ;; Make menu bar items. - - ;; Get rid of the Edit menu bar item to save space. - (define-key map [menu-bar edit] 'undefined) - - (define-key map [menu-bar immediate] - (cons "Immediate" (make-sparse-keymap "Immediate"))) - - (define-key map [menu-bar immediate view] - '("View This File" . tar-view)) - (define-key map [menu-bar immediate display] - '("Display in Other Window" . tar-display-other-window)) - (define-key map [menu-bar immediate find-file-other-window] - '("Find in Other Window" . tar-extract-other-window)) - (define-key map [menu-bar immediate find-file] - '("Find This File" . tar-extract)) - - (define-key map [menu-bar mark] - (cons "Mark" (make-sparse-keymap "Mark"))) - - (define-key map [menu-bar mark unmark-all] - '("Unmark All" . tar-clear-modification-flags)) - (define-key map [menu-bar mark deletion] - '("Flag" . tar-flag-deleted)) - (define-key map [menu-bar mark unmark] - '("Unflag" . tar-unflag)) - - (define-key map [menu-bar operate] - (cons "Operate" (make-sparse-keymap "Operate"))) - - (define-key map [menu-bar operate chown] - '("Change Owner..." . tar-chown-entry)) - (define-key map [menu-bar operate chgrp] - '("Change Group..." . tar-chgrp-entry)) - (define-key map [menu-bar operate chmod] - '("Change Mode..." . tar-chmod-entry)) - (define-key map [menu-bar operate rename] - '("Rename to..." . tar-rename-entry)) - (define-key map [menu-bar operate copy] - '("Copy to..." . tar-copy)) - (define-key map [menu-bar operate expunge] - '("Expunge Marked Files" . tar-expunge)) - - map) - "Local keymap for Tar mode listings.") - - + ;; tar mode is suitable only for specially formatted data. (put 'tar-mode 'mode-class 'special) (put 'tar-subfile-mode 'mode-class 'special) @@ -614,7 +535,7 @@ (if (buffer-live-p tar-data-buffer) (kill-buffer tar-data-buffer))) ;;;###autoload -(define-derived-mode tar-mode nil "Tar" +(define-derived-mode tar-mode special-mode "Tar" "Major mode for viewing a tar file as a dired-like listing of its contents. You can move around using the usual cursor motion commands. Letters no longer insert themselves. @@ -669,6 +590,77 @@ (fundamental-mode) (signal (car err) (cdr err))))) +(define-key tar-mode-map " " 'tar-next-line) +(define-key tar-mode-map "C" 'tar-copy) +(define-key tar-mode-map "d" 'tar-flag-deleted) +(define-key tar-mode-map "\^D" 'tar-flag-deleted) +(define-key tar-mode-map "e" 'tar-extract) +(define-key tar-mode-map "f" 'tar-extract) +(define-key tar-mode-map "\C-m" 'tar-extract) +(define-key tar-mode-map [mouse-2] 'tar-mouse-extract) +(define-key tar-mode-map "g" 'revert-buffer) +(define-key tar-mode-map "h" 'describe-mode) +(define-key tar-mode-map "n" 'tar-next-line) +(define-key tar-mode-map "\^N" 'tar-next-line) +(define-key tar-mode-map [down] 'tar-next-line) +(define-key tar-mode-map "o" 'tar-extract-other-window) +(define-key tar-mode-map "p" 'tar-previous-line) +(define-key tar-mode-map "\^P" 'tar-previous-line) +(define-key tar-mode-map [up] 'tar-previous-line) +(define-key tar-mode-map "R" 'tar-rename-entry) +(define-key tar-mode-map "u" 'tar-unflag) +(define-key tar-mode-map "v" 'tar-view) +(define-key tar-mode-map "x" 'tar-expunge) +(define-key tar-mode-map "\177" 'tar-unflag-backwards) +(define-key tar-mode-map "E" 'tar-extract-other-window) +(define-key tar-mode-map "M" 'tar-chmod-entry) +(define-key tar-mode-map "G" 'tar-chgrp-entry) +(define-key tar-mode-map "O" 'tar-chown-entry) +;; Let mouse-1 follow the link. +(define-key tar-mode-map [follow-link] 'mouse-face) + +;; Make menu bar items. + +;; Get rid of the Edit menu bar item to save space. +(define-key tar-mode-map [menu-bar edit] 'undefined) + +(define-key tar-mode-map [menu-bar immediate] + (cons "Immediate" (make-sparse-keymap "Immediate"))) + +(define-key tar-mode-map [menu-bar immediate view] + '("View This File" . tar-view)) +(define-key tar-mode-map [menu-bar immediate display] + '("Display in Other Window" . tar-display-other-window)) +(define-key tar-mode-map [menu-bar immediate find-file-other-window] + '("Find in Other Window" . tar-extract-other-window)) +(define-key tar-mode-map [menu-bar immediate find-file] + '("Find This File" . tar-extract)) + +(define-key tar-mode-map [menu-bar mark] + (cons "Mark" (make-sparse-keymap "Mark"))) + +(define-key tar-mode-map [menu-bar mark unmark-all] + '("Unmark All" . tar-clear-modification-flags)) +(define-key tar-mode-map [menu-bar mark deletion] + '("Flag" . tar-flag-deleted)) +(define-key tar-mode-map [menu-bar mark unmark] + '("Unflag" . tar-unflag)) + +(define-key tar-mode-map [menu-bar operate] + (cons "Operate" (make-sparse-keymap "Operate"))) + +(define-key tar-mode-map [menu-bar operate chown] + '("Change Owner..." . tar-chown-entry)) +(define-key tar-mode-map [menu-bar operate chgrp] + '("Change Group..." . tar-chgrp-entry)) +(define-key tar-mode-map [menu-bar operate chmod] + '("Change Mode..." . tar-chmod-entry)) +(define-key tar-mode-map [menu-bar operate rename] + '("Rename to..." . tar-rename-entry)) +(define-key tar-mode-map [menu-bar operate copy] + '("Copy to..." . tar-copy)) +(define-key tar-mode-map [menu-bar operate expunge] + '("Expunge Marked Files" . tar-expunge)) (define-minor-mode tar-subfile-mode "Minor mode for editing an element of a tar-file. === modified file 'lisp/vc/diff-mode.el' --- lisp/vc/diff-mode.el 2011-01-25 04:08:28 +0000 +++ lisp/vc/diff-mode.el 2011-02-01 21:22:21 +0000 @@ -140,9 +140,9 @@ ;; Standard M-r is useful, so don't change M-r or M-R. ;;("r" . diff-restrict-view) ;;("R" . diff-reverse-direction) - ("g" . revert-buffer) - ("q" . quit-window)) - "Basic keymap for `diff-mode', bound to various prefix keys.") + ) + "Basic keymap for `diff-mode', bound to various prefix keys." + :inherit special-mode-map) (easy-mmode-defmap diff-mode-map `(("\e" . ,diff-mode-shared-map) === modified file 'lisp/vc/log-view.el' --- lisp/vc/log-view.el 2011-01-25 04:08:28 +0000 +++ lisp/vc/log-view.el 2011-02-01 21:22:21 +0000 @@ -125,9 +125,12 @@ (require 'wid-edit) (easy-mmode-defmap log-view-mode-map - '(("z" . kill-this-buffer) + '( + ;; FIXME: (copy-keymap special-mode-map) instead + ("z" . kill-this-buffer) ("q" . quit-window) ("g" . revert-buffer) + ("m" . log-view-toggle-mark-entry) ("e" . log-view-modify-change-comment) ("d" . log-view-diff) ------------------------------------------------------------ revno: 103074 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2011-02-01 21:46:21 +0200 message: Fix a compiler warning in image.c. image.c (tiff_load): Avoid compiler warning in 2nd arg to TIFFClientOpen. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-01 08:53:03 +0000 +++ src/ChangeLog 2011-02-01 19:46:21 +0000 @@ -1,3 +1,8 @@ +2011-02-01 Eli Zaretskii + + * image.c (tiff_load): Avoid compiler warning in 2nd arg to + TIFFClientOpen. + 2011-02-01 Jan Djärv * xsmfns.c (ice_connection_closed): Call delete_read_fd. === modified file 'src/image.c' --- src/image.c 2011-01-31 23:54:50 +0000 +++ src/image.c 2011-02-01 19:46:21 +0000 @@ -6798,7 +6798,7 @@ memsrc.len = SBYTES (specified_data); memsrc.index = 0; - tiff = fn_TIFFClientOpen ("memory_source", "r", &memsrc, + tiff = fn_TIFFClientOpen ("memory_source", "r", (thandle_t)&memsrc, (TIFFReadWriteProc) tiff_read_from_memory, (TIFFReadWriteProc) tiff_write_from_memory, tiff_seek_in_memory, ------------------------------------------------------------ revno: 103073 committer: Sam Steingold branch nick: trunk timestamp: Tue 2011-02-01 14:17:10 -0500 message: fix docstrings of `purecopy-cons' & `purecopy-car' per Chong Yidong's request diff: === modified file 'lisp/subr.el' --- lisp/subr.el 2011-02-01 18:15:18 +0000 +++ lisp/subr.el 2011-02-01 19:17:10 +0000 @@ -2321,10 +2321,10 @@ ;;;; Miscellanea. (defun purecopy-cons (arg) - "Purecopy both car and cdr of the pair argument." + "Return a copy of ARG from a `purecopy' of the car and cdr of ARG." (cons (purecopy (car arg)) (purecopy (cdr arg)))) (defun purecopy-car (arg) - "Purecopy the car of the pair argument." + "Return a copy of ARG whose car is a `purecopy' of the car of ARG." (cons (purecopy (car arg)) (cdr arg))) (defvar suspend-hook nil ------------------------------------------------------------ revno: 103072 committer: Sam Steingold branch nick: trunk timestamp: Tue 2011-02-01 13:18:46 -0500 message: typo diff: === modified file 'etc/NEWS' --- etc/NEWS 2011-02-01 07:23:48 +0000 +++ etc/NEWS 2011-02-01 18:18:46 +0000 @@ -597,7 +597,7 @@ This updates the current branch from upstream. A prefix argument means to prompt the user for specifics, e.g. a pull location. -**** vc-update is now an alias for vc-update. +**** `vc-update' is now an alias for `vc-pull'. **** Currently supported by Bzr, Git, and Mercurial. ------------------------------------------------------------ revno: 103071 committer: Sam Steingold branch nick: trunk timestamp: Tue 2011-02-01 13:15:18 -0500 message: * lisp/subr.el (purecopy-cons, purecopy-car): Add shortcuts. * lisp/faces.el (face-x-resources): Use `purecopy-cons'. * lisp/files.el (auto-mode-alist, interpreter-mode-alist): Use `purecopy-car'. * lisp/international/fontset.el (font-encoding-alist): Ditto. * lisp/international/mule-conf.el (file-coding-system-alist): Ditto. * lisp/international/mule.el (auto-coding-alist) (auto-coding-regexp-alist): Ditto. * lisp/mouse.el (mouse-buffer-menu-mode-groups): Use `purecopy-cons'. * lisp/term/x-win.el (x-gtk-stock-map): Ditto. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-02-01 17:34:07 +0000 +++ lisp/ChangeLog 2011-02-01 18:15:18 +0000 @@ -1,3 +1,16 @@ +2011-02-01 Sam Steingold + + * subr.el (purecopy-cons, purecopy-car): Add shortcuts. + * faces.el (face-x-resources): Use `purecopy-cons'. + * files.el (auto-mode-alist, interpreter-mode-alist): Use + `purecopy-car'. + * international/fontset.el (font-encoding-alist): Ditto. + * international/mule-conf.el (file-coding-system-alist): Ditto. + * international/mule.el (auto-coding-alist) + (auto-coding-regexp-alist): Ditto. + * mouse.el (mouse-buffer-menu-mode-groups): Use `purecopy-cons'. + * term/x-win.el (x-gtk-stock-map): Ditto. + 2011-02-01 Chong Yidong * custom.el (load-theme): Define return value. Drop use of === modified file 'lisp/faces.el' --- lisp/faces.el 2011-01-26 08:36:39 +0000 +++ lisp/faces.el 2011-02-01 18:15:18 +0000 @@ -261,8 +261,7 @@ (mapcar (lambda (arg) ;; FIXME; can we purecopy some of the conses too? - (cons (car arg) - (cons (purecopy (car (cdr arg))) (purecopy (cdr (cdr arg)))))) + (cons (car arg) (purecopy-cons (cdr arg)))) '((:family (".attributeFamily" . "Face.AttributeFamily")) (:foundry (".attributeFoundry" . "Face.AttributeFoundry")) (:width (".attributeWidth" . "Face.AttributeWidth")) === modified file 'lisp/files.el' --- lisp/files.el 2011-01-31 23:54:50 +0000 +++ lisp/files.el 2011-02-01 18:15:18 +0000 @@ -2229,8 +2229,7 @@ ;; directives in that file. That way is discouraged since it ;; spreads out the definition of the initial value. (mapcar - (lambda (elt) - (cons (purecopy (car elt)) (cdr elt))) + 'purecopy-car `(;; do this first, so that .html.pl is Polish html, not Perl ("\\.[sx]?html?\\(\\.[a-zA-Z_]+\\)?\\'" . html-mode) ("\\.svgz?\\'" . image-mode) @@ -2454,8 +2453,7 @@ ;; file. That way is discouraged since it spreads out the ;; definition of the initial value. (mapcar - (lambda (l) - (cons (purecopy (car l)) (cdr l))) + 'purecopy-car '(("perl" . perl-mode) ("perl5" . perl-mode) ("miniperl" . perl-mode) === modified file 'lisp/international/fontset.el' --- lisp/international/fontset.el 2011-01-25 04:08:28 +0000 +++ lisp/international/fontset.el 2011-02-01 18:15:18 +0000 @@ -33,8 +33,7 @@ ;; Setup font-encoding-alist for all known encodings. (setq font-encoding-alist - (mapcar (lambda (arg) - (cons (purecopy (car arg)) (cdr arg))) + (mapcar 'purecopy-car '(("iso8859-1$" . iso-8859-1) ("iso8859-2$" . iso-8859-2) ("iso8859-3$" . iso-8859-3) === modified file 'lisp/international/mule-conf.el' --- lisp/international/mule-conf.el 2011-01-25 04:08:28 +0000 +++ lisp/international/mule-conf.el 2011-02-01 18:15:18 +0000 @@ -1505,7 +1505,7 @@ ;; Tar files are not decoded at all, but we treat them as raw bytes. (setq file-coding-system-alist - (mapcar (lambda (arg) (cons (purecopy (car arg)) (cdr arg))) + (mapcar 'purecopy-car '(("\\.elc\\'" . utf-8-emacs) ("\\.utf\\(-8\\)?\\'" . utf-8) ("\\.xml\\'" . xml-find-file-coding-system) === modified file 'lisp/international/mule.el' --- lisp/international/mule.el 2011-01-26 08:36:39 +0000 +++ lisp/international/mule.el 2011-02-01 18:15:18 +0000 @@ -1671,11 +1671,11 @@ (defcustom auto-coding-alist ;; .exe and .EXE are added to support archive-mode looking at DOS ;; self-extracting exe archives. - (mapcar (lambda (arg) (cons (purecopy (car arg)) (cdr arg))) - '(("\\.\\(\ + (mapcar 'purecopy-car + '(("\\.\\(\ arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|7z\\|\ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\)\\'" - . no-conversion-multibyte) + . no-conversion-multibyte) ("\\.\\(exe\\|EXE\\)\\'" . no-conversion) ("\\.\\(sx[dmicw]\\|odt\\|tar\\|tgz\\)\\'" . no-conversion) ("\\.\\(gz\\|Z\\|bz\\|bz2\\|xz\\|gpg\\)\\'" . no-conversion) @@ -1696,7 +1696,7 @@ (symbol :tag "Coding system")))) (defcustom auto-coding-regexp-alist - (mapcar (lambda (arg) (cons (purecopy (car arg)) (cdr arg))) + (mapcar 'purecopy-car '(("\\`BABYL OPTIONS:[ \t]*-\\*-[ \t]*rmail[ \t]*-\\*-" . no-conversion) ("\\`\xFE\xFF" . utf-16be-with-signature) ("\\`\xFF\xFE" . utf-16le-with-signature) === modified file 'lisp/mouse.el' --- lisp/mouse.el 2011-01-31 23:54:50 +0000 +++ lisp/mouse.el 2011-02-01 18:15:18 +0000 @@ -1719,7 +1719,7 @@ :version "20.3") (defvar mouse-buffer-menu-mode-groups - (mapcar (lambda (arg) (cons (purecopy (car arg)) (purecopy (cdr arg)))) + (mapcar 'purecopy-cons '(("Info\\|Help\\|Apropos\\|Man" . "Help") ("\\bVM\\b\\|\\bMH\\b\\|Message\\|Mail\\|Group\\|Score\\|Summary\\|Article" . "Mail/News") === modified file 'lisp/subr.el' --- lisp/subr.el 2011-01-25 04:08:28 +0000 +++ lisp/subr.el 2011-02-01 18:15:18 +0000 @@ -2320,6 +2320,13 @@ ;;;; Miscellanea. +(defun purecopy-cons (arg) + "Purecopy both car and cdr of the pair argument." + (cons (purecopy (car arg)) (purecopy (cdr arg)))) +(defun purecopy-car (arg) + "Purecopy the car of the pair argument." + (cons (purecopy (car arg)) (cdr arg))) + (defvar suspend-hook nil "Normal hook run by `suspend-emacs', before suspending.") === modified file 'lisp/term/x-win.el' --- lisp/term/x-win.el 2011-01-25 04:08:28 +0000 +++ lisp/term/x-win.el 2011-02-01 18:15:18 +0000 @@ -1447,8 +1447,7 @@ (define-key special-event-map [drag-n-drop] 'x-dnd-handle-drag-n-drop-event) (defcustom x-gtk-stock-map - (mapcar (lambda (arg) - (cons (purecopy (car arg)) (purecopy (cdr arg)))) + (mapcar 'purecopy-cons '( ("etc/images/new" . "gtk-new") ("etc/images/open" . "gtk-open") ------------------------------------------------------------ revno: 103070 committer: Chong Yidong branch nick: trunk timestamp: Tue 2011-02-01 12:34:07 -0500 message: Drop use of unsafep for checking Custom themes; bugfixes. * lisp/custom.el (load-theme): Define return value. Drop use of unsafep; call custom-theme-load-confirm for non-known-safe themes. (custom-theme-load-confirm): Scroll in the correct window. (custom-enabled-themes): Add custom-safe-themes to :set-after. * lisp/cus-theme.el (custom-theme-checkbox-toggle): Don't activate the checkbox if load-theme fails. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-02-01 16:33:17 +0000 +++ lisp/ChangeLog 2011-02-01 17:34:07 +0000 @@ -1,3 +1,13 @@ +2011-02-01 Chong Yidong + + * custom.el (load-theme): Define return value. Drop use of + unsafep; call custom-theme-load-confirm for non-known-safe themes. + (custom-theme-load-confirm): Scroll in the correct window. + (custom-enabled-themes): Add custom-safe-themes to :set-after. + + * cus-theme.el (custom-theme-checkbox-toggle): Don't activate the + checkbox if load-theme fails. + 2011-02-01 Stefan Monnier * progmodes/compile.el (compilation-next-error): Check there's === modified file 'lisp/cus-theme.el' --- lisp/cus-theme.el 2011-01-25 04:08:28 +0000 +++ lisp/cus-theme.el 2011-02-01 17:34:07 +0000 @@ -621,7 +621,9 @@ (let ((this-theme (widget-get widget :theme-name))) (if (widget-value widget) ;; Disable the theme. - (disable-theme this-theme) + (progn + (disable-theme this-theme) + (widget-toggle-action widget event)) ;; Enable the theme. (unless custom-theme-allow-multiple-selections ;; If only one theme is allowed, disable all other themes and @@ -634,12 +636,11 @@ (unless (eq (car theme) this-theme) (widget-value-set (cdr theme) nil) (widget-apply (cdr theme) :notify (cdr theme) event)))) - (load-theme this-theme))) - ;; Mark `custom-enabled-themes' as "set for current session". - (put 'custom-enabled-themes 'customized-value - (list (custom-quote custom-enabled-themes))) - ;; Check/uncheck the widget. - (widget-toggle-action widget event)) + (when (load-theme this-theme) + (widget-toggle-action widget event))) + ;; Mark `custom-enabled-themes' as "set for current session". + (put 'custom-enabled-themes 'customized-value + (list (custom-quote custom-enabled-themes))))) (defun custom-describe-theme () "Describe the Custom theme on the current line." === modified file 'lisp/custom.el' --- lisp/custom.el 2011-01-25 04:08:28 +0000 +++ lisp/custom.el 2011-02-01 17:34:07 +0000 @@ -1116,16 +1116,15 @@ :risky t :version "24.1") -(defvar safe-functions) ; From unsafep.el - (defun load-theme (theme &optional no-enable) - "Load a theme's settings from its file. -Normally, this also enables the theme; use `disable-theme' to -disable it. If optional arg NO-ENABLE is non-nil, don't enable -the theme. - -A theme file is named THEME-theme.el, where THEME is the theme name, -in one of the directories specified by `custom-theme-load-path'." + "Load Custom theme named THEME from its file. +Normally, this also enables THEME. If optional arg NO-ENABLE is +non-nil, load THEME but don't enable it. + +The theme file is named THEME-theme.el, in one of the directories +specified by `custom-theme-load-path'. + +Return t if THEME was successfully loaded, nil otherwise." (interactive (list (intern (completing-read "Load custom theme: " @@ -1148,30 +1147,16 @@ (with-temp-buffer (insert-file-contents fn) (setq hash (sha1 (current-buffer))) - ;; Check file safety. + ;; Check file safety with `custom-safe-themes', prompting the + ;; user if necessary. (when (or (and (memq 'default custom-safe-themes) (equal (file-name-directory fn) (expand-file-name "themes/" data-directory))) (member hash custom-safe-themes) - ;; If the theme is not in `custom-safe-themes', check - ;; it with unsafep. - (progn - (require 'unsafep) - (let ((safe-functions - (append '(provide-theme deftheme - custom-theme-set-variables - custom-theme-set-faces) - safe-functions)) - unsafep form) - (while (and (setq form (condition-case nil - (let ((read-circle nil)) - (read (current-buffer))) - (end-of-file nil))) - (null (setq unsafep (unsafep form))))) - (or (null unsafep) - (custom-theme-load-confirm hash))))) + (custom-theme-load-confirm hash)) (let ((custom--inhibit-theme-enable no-enable)) - (eval-buffer)))))) + (eval-buffer) + t))))) (defun custom-theme-load-confirm (hash) "Query the user about loading a Custom theme that may not be safe. @@ -1180,32 +1165,35 @@ (if noninteractive nil (let ((exit-chars '(?y ?n ?\s)) - prompt char) + window prompt char) (save-window-excursion (rename-buffer "*Custom Theme*" t) (emacs-lisp-mode) - (display-buffer (current-buffer)) + (setq window (display-buffer (current-buffer))) (setq prompt - (format "This theme is not guaranteed to be safe. Really load? %s" - (if (< (line-number-at-pos (point-max)) - (window-body-height)) - "(y or n) " + (format "Loading a theme can run Lisp code. Really load?%s" + (if (and window + (< (line-number-at-pos (point-max)) + (window-body-height))) + " (y or n) " (push ?\C-v exit-chars) - "Type y or n, or C-v to scroll: "))) + "\nType y or n, or C-v to scroll: "))) (goto-char (point-min)) (while (null char) (setq char (read-char-choice prompt exit-chars)) (when (eq char ?\C-v) - (condition-case nil - (scroll-up) - (error (goto-char (point-min)))) + (if window + (with-selected-window window + (condition-case nil + (scroll-up) + (error (goto-char (point-min)))))) (setq char nil))) (when (memq char '(?\s ?y)) - (push hash custom-safe-themes) ;; Offer to save to `custom-safe-themes'. (and (or custom-file user-init-file) - (y-or-n-p "Treat this theme as safe for future loads? ") + (y-or-n-p "Treat this theme as safe in future sessions? ") (let ((coding-system-for-read nil)) + (push hash custom-safe-themes) (customize-save-variable 'custom-safe-themes custom-safe-themes))) t))))) @@ -1285,7 +1273,8 @@ and always takes precedence over other Custom Themes." :group 'customize :type '(repeat symbol) - :set-after '(custom-theme-directory custom-theme-load-path) + :set-after '(custom-theme-directory custom-theme-load-path + custom-safe-themes) :risky t :set (lambda (symbol themes) ;; Avoid an infinite loop when custom-enabled-themes is ------------------------------------------------------------ revno: 103069 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2011-02-01 11:33:17 -0500 message: * lisp/progmodes/compile.el (compilation-next-error): Check there's a message before using it. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-02-01 10:12:25 +0000 +++ lisp/ChangeLog 2011-02-01 16:33:17 +0000 @@ -1,3 +1,8 @@ +2011-02-01 Stefan Monnier + + * progmodes/compile.el (compilation-next-error): Check there's + a message before using it (bug#7941). + 2011-02-01 Jay Belanger * calc/calc-mtx.el (math-lud-pivot-check): New function. @@ -6,8 +11,8 @@ 2011-01-31 Alan Mackenzie - * progmodes/cc-cmds.el (c-forward-over-illiterals): Continue - parsing if we encounter a naked # (Bug#7595). + * progmodes/cc-cmds.el (c-forward-over-illiterals): + Continue parsing if we encounter a naked # (Bug#7595). (c-beginning-of-statement): Avoid loop in locating the beginning of a macro. @@ -34,8 +39,8 @@ 2011-01-31 Kenichi Handa - * international/quail.el (quail-keyboard-layout-alist): Remove - superfluous SPC for "pc105-uk" (bug#7927). + * international/quail.el (quail-keyboard-layout-alist): + Remove superfluous SPC for "pc105-uk" (bug#7927). 2011-01-31 Glenn Morris === modified file 'lisp/progmodes/compile.el' --- lisp/progmodes/compile.el 2011-01-31 17:11:11 +0000 +++ lisp/progmodes/compile.el 2011-02-01 16:33:17 +0000 @@ -2140,7 +2140,7 @@ (or pt (setq pt (point))) (let* ((msg (get-text-property pt 'compilation-message)) ;; `loc', `msg', and `last' are used by the compilation-loop macro. - (loc (compilation--message->loc msg)) + (loc (and msg (compilation--message->loc msg))) last) (if (zerop n) (unless (or msg ; find message near here @@ -2154,8 +2154,7 @@ (line-end-position))) (or (setq msg (get-text-property pt 'compilation-message)) (setq pt (point))))) - (setq last (compilation--loc->file-struct - (compilation--message->loc msg))) + (setq last (compilation--loc->file-struct loc)) (if (>= n 0) (compilation-loop > compilation-next-single-property-change 1- (if (get-buffer-process (current-buffer)) ------------------------------------------------------------ revno: 103068 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2011-02-01 09:09:20 -0500 message: * lisp/gnus/message.el (message-expand-name): Don't trust the return value of bbdb-complete-name. (message-check-news-header-syntax): Remove unused var `start'. (message-idna-to-ascii-rhs-1): Remove unused vars `rhs' and `address'. (message-inhibit-body-encoding): Move to before first use. (mail-abbrev-mode-regexp, Expires, User-Agent, Lines, Distribution) (To, References, In-Reply-To, Newsgroups, Subject, Path, From) (Organization, Message-ID, Date, mh-previous-window-config): Defvar the vars using dynamic scoping. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-02-01 03:54:46 +0000 +++ lisp/gnus/ChangeLog 2011-02-01 14:09:20 +0000 @@ -1,3 +1,15 @@ +2011-02-01 Stefan Monnier + + * message.el (message-expand-name): Don't trust the return value of + bbdb-complete-name. + (message-check-news-header-syntax): Remove unused var `start'. + (message-idna-to-ascii-rhs-1): Remove unused vars `rhs' and `address'. + (message-inhibit-body-encoding): Move to before first use. + (mail-abbrev-mode-regexp, Expires, User-Agent, Lines, Distribution) + (To, References, In-Reply-To, Newsgroups, Subject, Path, From) + (Organization, Message-ID, Date, mh-previous-window-config): + Defvar the vars using dynamic scoping. + 2011-02-01 Lars Ingebrigtsen * shr.el (shr-render-td): Only do colours at the final rendering. === modified file 'lisp/gnus/message.el' --- lisp/gnus/message.el 2011-01-25 04:08:28 +0000 +++ lisp/gnus/message.el 2011-02-01 14:09:20 +0000 @@ -4345,7 +4345,8 @@ (tembuf (message-generate-new-buffer-clone-locals " message temp")) (curbuf (current-buffer)) (id (message-make-message-id)) (n 1) - plist total header required-mail-headers) + required-mail-headers ;FIXME: Unused, right? --Stef + plist total header) (while (not (eobp)) (if (< (point-max) (+ p message-send-mail-partially-limit)) (goto-char (point-max)) @@ -4677,6 +4678,8 @@ ;; should never happen (t (error "qmail-inject reported unknown failure")))) +(defvar mh-previous-window-config) + (defun message-send-mail-with-mh () "Send the prepared message buffer with mh." (let ((mh-previous-window-config nil) @@ -4897,8 +4900,7 @@ t)) ;; Check long header lines. (message-check 'long-header-lines - (let ((start (point)) - (header nil) + (let ((header nil) (length 0) found) (while (and (not found) @@ -4907,7 +4909,6 @@ (setq found t length (- (point) (match-beginning 0))) (setq header (match-string-no-properties 1))) - (setq start (match-beginning 0)) (forward-line 1)) (if found (y-or-n-p (format "Your %s header is too long (%d). Really post? " @@ -5750,7 +5751,7 @@ (defun message-idna-to-ascii-rhs-1 (header) "Interactively potentially IDNA encode domain names in HEADER." (let ((field (message-fetch-field header)) - rhs ace address) + ace) (when field (dolist (rhs (mm-delete-duplicates @@ -5799,6 +5800,21 @@ (message-idna-to-ascii-rhs-1 "Mail-Followup-To") (message-idna-to-ascii-rhs-1 "Cc"))))) +(defvar Date) +(defvar Message-ID) +(defvar Organization) +(defvar From) +(defvar Path) +(defvar Subject) +(defvar Newsgroups) +(defvar In-Reply-To) +(defvar References) +(defvar To) +(defvar Distribution) +(defvar Lines) +(defvar User-Agent) +(defvar Expires) + (defun message-generate-headers (headers) "Prepare article HEADERS. Headers already prepared in the buffer are not modified." @@ -6759,7 +6775,8 @@ (interactive) (require 'gnus-sum) ; for gnus-list-identifiers (let ((cur (current-buffer)) - from subject date reply-to to cc + from subject date + reply-to to cc ;FIXME: These 3 seem to be unused? --Stef references message-id follow-to (inhibit-point-motion-hooks t) (message-this-is-mail t) @@ -7280,7 +7297,7 @@ (defun message-forward-make-body-digest-plain (forward-buffer) (insert "\n-------------------- Start of forwarded message --------------------\n") - (let ((b (point)) e) + (let ((b (point)) e) ;FIXME: Not used, right? --Stef (mml-insert-buffer forward-buffer) (setq e (point)) (insert @@ -7404,6 +7421,8 @@ (setq rmail-insert-mime-forwarded-message-function 'message-forward-rmail-make-body)) +(defvar message-inhibit-body-encoding nil) + ;;;###autoload (defun message-resend (address) "Resend the current article to ADDRESS." @@ -7790,6 +7809,8 @@ (lookup-key global-map "\t") 'indent-relative))))) +(defvar mail-abbrev-mode-regexp) + (defun message-completion-function () (let ((alist message-completion-alist)) (while (and alist @@ -7867,7 +7888,12 @@ (eudc-expand-inline)) ((and (memq 'bbdb message-expand-name-databases) (fboundp 'bbdb-complete-name)) - (bbdb-complete-name)) + (let ((starttick (buffer-modified-tick))) + (or (bbdb-complete-name) + ;; Apparently, bbdb-complete-name can return nil even when + ;; completion took place. So let's double check the buffer was + ;; not modified. + (/= starttick (buffer-modified-tick))))) (t (expand-abbrev)))) @@ -7928,8 +7954,6 @@ ;;; MIME functions ;;; -(defvar message-inhibit-body-encoding nil) - (defun message-encode-message-body () (unless message-inhibit-body-encoding (let ((mail-parse-charset (or mail-parse-charset ------------------------------------------------------------ revno: 103067 author: Lars Ingebrigtsen committer: Katsumi Yamaoka branch nick: trunk timestamp: Tue 2011-02-01 11:02:10 +0000 message: gnus.texi (Customizing Articles): Fix typo. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2011-01-31 02:01:24 +0000 +++ doc/misc/ChangeLog 2011-02-01 11:02:10 +0000 @@ -1,3 +1,7 @@ +2011-02-01 Lars Ingebrigtsen + + * gnus.texi (Customizing Articles): Fix typo. + 2011-01-31 Lars Ingebrigtsen * gnus.texi (Customizing Articles): Document the new way of customizing === modified file 'doc/misc/gnus.texi' --- doc/misc/gnus.texi 2011-01-31 02:01:24 +0000 +++ doc/misc/gnus.texi 2011-02-01 11:02:10 +0000 @@ -11944,7 +11944,7 @@ @item lapsed The time elapsed since the message was posted. -@item combined-elapsed +@item combined-lapsed Both the original date header and a (shortened) elapsed time. @item original ------------------------------------------------------------ revno: 103066 committer: Deniz Dogan branch nick: emacs-trunk timestamp: Tue 2011-02-01 11:12:25 +0100 message: Adding missing bug reference to ChangeLog. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-02-01 02:15:52 +0000 +++ lisp/ChangeLog 2011-02-01 10:12:25 +0000 @@ -71,7 +71,7 @@ 2011-01-31 Deniz Dogan - * net/rcirc.el: New customizable nick completion format. + * net/rcirc.el: New customizable nick completion format. (Bug#6314) (rcirc-nick-completion-format): New defcustom. (rcirc-complete): Use it. ------------------------------------------------------------ revno: 103065 committer: Jan D. branch nick: trunk timestamp: Tue 2011-02-01 09:53:03 +0100 message: Use add/delete_read_fd in xsmfns to simplify. Also restart with initial_argv. * xsmfns.c (ice_connection_closed): Call delete_read_fd. (x_session_check_input): Change args and return type so it can be used as argument to add_read_fd. Make static. Remove call to select. Call kbd_buffer_store_event for emacs_event. (smc_save_yourself_CB): Also store initial argv to SmRestartCommand. (ice_conn_watch_CB): Call add_read_fd. * xterm.c (XTread_socket): Remove HAVE_X_SM block with call to x_session_check_input. (x_session_initialized): Remove definition. (x_initialize): Remove setting of x_session_initialized. * xterm.h (x_session_check_input): Remove declaration. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-01 07:23:48 +0000 +++ src/ChangeLog 2011-02-01 08:53:03 +0000 @@ -1,3 +1,19 @@ +2011-02-01 Jan Djärv + + * xsmfns.c (ice_connection_closed): Call delete_read_fd. + (x_session_check_input): Change args and return type so it can be used + as argument to add_read_fd. Make static. Remove call to select. + Call kbd_buffer_store_event for emacs_event. + (smc_save_yourself_CB): Also store initial argv to SmRestartCommand. + (ice_conn_watch_CB): Call add_read_fd. + + * xterm.c (XTread_socket): Remove HAVE_X_SM block with call to + x_session_check_input. + (x_session_initialized): Remove definition. + (x_initialize): Remove setting of x_session_initialized. + + * xterm.h (x_session_check_input): Remove declaration. + 2011-02-01 Paul Eggert format-time-string now supports subsecond time stamp resolution === modified file 'src/xsmfns.c' --- src/xsmfns.c 2011-01-26 08:36:39 +0000 +++ src/xsmfns.c 2011-02-01 08:53:03 +0000 @@ -38,6 +38,8 @@ #include "termhooks.h" #include "termopts.h" #include "xterm.h" +#include "process.h" +#include "keyboard.h" /* This is the event used when SAVE_SESSION_EVENT occurs. */ @@ -82,28 +84,20 @@ ice_connection_closed (void) { if (ice_fd >= 0) - delete_keyboard_wait_descriptor (ice_fd); + delete_read_fd (ice_fd); ice_fd = -1; } /* Handle any messages from the session manager. If no connection is - open to a session manager, just return 0. - Otherwise returns 1 if SAVE_SESSION_EVENT is stored in buffer BUFP. */ + open to a session manager, just return. */ -int -x_session_check_input (struct input_event *bufp) +static void +x_session_check_input (int fd, void *data, int for_read) { - SELECT_TYPE read_fds; - EMACS_TIME tmout; int ret; - if (ice_fd == -1) return 0; - FD_ZERO (&read_fds); - FD_SET (ice_fd, &read_fds); - - tmout.tv_sec = 0; - tmout.tv_usec = 0; + if (ice_fd == -1) return; /* Reset this so wo can check kind after callbacks have been called by IceProcessMessages. The smc_interact_CB sets the kind to @@ -111,33 +105,21 @@ will be called. */ emacs_event.kind = NO_EVENT; - ret = select (ice_fd+1, &read_fds, - (SELECT_TYPE *)0, (SELECT_TYPE *)0, &tmout); - - if (ret < 0) + ret = IceProcessMessages (SmcGetIceConnection (smc_conn), + (IceReplyWaitInfo *)0, (Bool *)0); + if (ret != IceProcessMessagesSuccess) { + /* Either IO error or Connection closed. */ + if (ret == IceProcessMessagesIOError) + IceCloseConnection (SmcGetIceConnection (smc_conn)); + ice_connection_closed (); } - else if (ret > 0 && FD_ISSET (ice_fd, &read_fds)) - { - ret = IceProcessMessages (SmcGetIceConnection (smc_conn), - (IceReplyWaitInfo *)0, (Bool *)0); - if (ret != IceProcessMessagesSuccess) - { - /* Either IO error or Connection closed. */ - if (ret == IceProcessMessagesIOError) - IceCloseConnection (SmcGetIceConnection (smc_conn)); - - ice_connection_closed (); - } - } /* Check if smc_interact_CB was called and we shall generate a SAVE_SESSION_EVENT. */ if (emacs_event.kind != NO_EVENT) - memcpy (bufp, &emacs_event, sizeof (struct input_event)); - - return emacs_event.kind != NO_EVENT ? 1 : 0; + kbd_buffer_store_event (&emacs_event); } /* Return non-zero if we have a connection to a session manager. */ @@ -181,11 +163,11 @@ SmProp *props[NR_PROPS]; SmProp prop_ptr[NR_PROPS]; - SmPropValue values[20]; - int val_idx = 0; + SmPropValue values[20], *vp; + int val_idx = 0, vp_idx = 0; int props_idx = 0; int i; - char *cwd = NULL; + char *cwd = get_current_dir_name (); char *smid_opt, *chdir_opt = NULL; /* How to start a new instance of Emacs. */ @@ -208,40 +190,6 @@ props[props_idx]->vals[0].value = SDATA (Vinvocation_name); ++props_idx; - /* How to restart Emacs. */ - props[props_idx] = &prop_ptr[props_idx]; - props[props_idx]->name = xstrdup (SmRestartCommand); - props[props_idx]->type = xstrdup (SmLISTofARRAY8); - /* /path/to/emacs, --smid=xxx --no-splash --chdir=dir */ - props[props_idx]->num_vals = 4; - props[props_idx]->vals = &values[val_idx]; - props[props_idx]->vals[0].length = strlen (emacs_program); - props[props_idx]->vals[0].value = emacs_program; - - smid_opt = xmalloc (strlen (SMID_OPT) + strlen (client_id) + 1); - strcpy (smid_opt, SMID_OPT); - strcat (smid_opt, client_id); - - props[props_idx]->vals[1].length = strlen (smid_opt); - props[props_idx]->vals[1].value = smid_opt; - - props[props_idx]->vals[2].length = strlen (NOSPLASH_OPT); - props[props_idx]->vals[2].value = NOSPLASH_OPT; - - cwd = get_current_dir_name (); - if (cwd) - { - chdir_opt = xmalloc (strlen (CHDIR_OPT) + strlen (cwd) + 1); - strcpy (chdir_opt, CHDIR_OPT); - strcat (chdir_opt, cwd); - - props[props_idx]->vals[3].length = strlen (chdir_opt); - props[props_idx]->vals[3].value = chdir_opt; - } - - val_idx += cwd ? 4 : 3; - ++props_idx; - /* User id. */ props[props_idx] = &prop_ptr[props_idx]; props[props_idx]->name = xstrdup (SmUserID); @@ -266,12 +214,53 @@ } + /* How to restart Emacs. */ + props[props_idx] = &prop_ptr[props_idx]; + props[props_idx]->name = xstrdup (SmRestartCommand); + props[props_idx]->type = xstrdup (SmLISTofARRAY8); + /* /path/to/emacs, --smid=xxx --no-splash --chdir=dir ... */ + i = 3 + initial_argc; + props[props_idx]->num_vals = i; + vp = (SmPropValue *) xmalloc (i * sizeof(*vp)); + props[props_idx]->vals = vp; + props[props_idx]->vals[vp_idx].length = strlen (emacs_program); + props[props_idx]->vals[vp_idx++].value = emacs_program; + + smid_opt = xmalloc (strlen (SMID_OPT) + strlen (client_id) + 1); + strcpy (smid_opt, SMID_OPT); + strcat (smid_opt, client_id); + + props[props_idx]->vals[vp_idx].length = strlen (smid_opt); + props[props_idx]->vals[vp_idx++].value = smid_opt; + + props[props_idx]->vals[vp_idx].length = strlen (NOSPLASH_OPT); + props[props_idx]->vals[vp_idx++].value = NOSPLASH_OPT; + + if (cwd) + { + chdir_opt = xmalloc (strlen (CHDIR_OPT) + strlen (cwd) + 1); + strcpy (chdir_opt, CHDIR_OPT); + strcat (chdir_opt, cwd); + + props[props_idx]->vals[vp_idx].length = strlen (chdir_opt); + props[props_idx]->vals[vp_idx++].value = chdir_opt; + } + + for (i = 1; i < initial_argc; ++i) + { + props[props_idx]->vals[vp_idx].length = strlen (initial_argv[i]); + props[props_idx]->vals[vp_idx++].value = initial_argv[i]; + } + + ++props_idx; + SmcSetProperties (smcConn, props_idx, props); xfree (smid_opt); xfree (chdir_opt); + xfree (cwd); + xfree (vp); - free (cwd); for (i = 0; i < props_idx; ++i) { xfree (props[i]->type); @@ -355,7 +344,8 @@ uses ICE as it transport protocol. */ static void -ice_conn_watch_CB (IceConn iceConn, IcePointer clientData, int opening, IcePointer *watchData) +ice_conn_watch_CB (IceConn iceConn, IcePointer clientData, + int opening, IcePointer *watchData) { if (! opening) { @@ -364,16 +354,7 @@ } ice_fd = IceConnectionNumber (iceConn); -#ifdef F_SETOWN - fcntl (ice_fd, F_SETOWN, getpid ()); -#endif /* ! defined (F_SETOWN) */ - -#ifdef SIGIO - if (interrupt_input) - init_sigio (ice_fd); -#endif /* ! defined (SIGIO) */ - - add_keyboard_wait_descriptor (ice_fd); + add_read_fd (ice_fd, x_session_check_input, NULL); } /* Create the client leader window. */ === modified file 'src/xterm.c' --- src/xterm.c 2011-01-30 22:17:44 +0000 +++ src/xterm.c 2011-02-01 08:53:03 +0000 @@ -7036,23 +7036,6 @@ ++handling_signal; -#ifdef HAVE_X_SM - /* Only check session manager input for the primary display. */ - if (terminal->id == 1 && x_session_have_connection ()) - { - struct input_event inev; - BLOCK_INPUT; - /* We don't need to EVENT_INIT (inev) here, as - x_session_check_input copies an entire input_event. */ - if (x_session_check_input (&inev)) - { - kbd_buffer_store_event_hold (&inev, hold_quit); - count++; - } - UNBLOCK_INPUT; - } -#endif - /* For debugging, this gives a way to fake an I/O error. */ if (terminal->display_info.x == XTread_socket_fake_io_error) { @@ -9750,10 +9733,6 @@ static int x_initialized; -#ifdef HAVE_X_SM -static int x_session_initialized; -#endif - /* Test whether two display-name strings agree up to the dot that separates the screen number from the server number. */ static int @@ -10672,9 +10651,6 @@ last_tool_bar_item = -1; any_help_event_p = 0; ignore_next_mouse_click_timeout = 0; -#ifdef HAVE_X_SM - x_session_initialized = 0; -#endif #ifdef USE_GTK current_count = -1; === modified file 'src/xterm.h' --- src/xterm.h 2011-01-25 04:08:28 +0000 +++ src/xterm.h 2011-02-01 08:53:03 +0000 @@ -1076,7 +1076,6 @@ /* Defined in xsmfns.c */ #ifdef HAVE_X_SM extern void x_session_initialize (struct x_display_info *dpyinfo); -extern int x_session_check_input (struct input_event *bufp); extern int x_session_have_connection (void); extern void x_session_close (void); #endif ------------------------------------------------------------ revno: 103064 [merge] committer: Paul Eggert branch nick: trunk timestamp: Mon 2011-01-31 23:24:37 -0800 message: Merge: format-time-string now supports subsecond time stamp resolution diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2011-01-31 23:54:50 +0000 +++ doc/lispref/ChangeLog 2011-02-01 07:23:48 +0000 @@ -1,3 +1,8 @@ +2011-02-01 Paul Eggert + + format-time-string now supports subsecond time stamp resolution + * os.texi (Time Parsing): Document %N. + 2011-01-28 Chong Yidong * vol1.texi (Top): === modified file 'doc/lispref/os.texi' --- doc/lispref/os.texi 2011-01-25 04:08:28 +0000 +++ doc/lispref/os.texi 2011-02-01 07:23:48 +0000 @@ -21,7 +21,7 @@ * System Environment:: Distinguish the name and kind of system. * User Identification:: Finding the name and user id of the user. * Time of Day:: Getting the current time. -* Time Conversion:: Converting a time from numeric form to +* Time Conversion:: Converting a time from numeric form to calendrical data and vice versa. * Time Parsing:: Converting a time from numeric form to text and vice versa. @@ -1336,6 +1336,12 @@ This stands for the minute (00-59). @item %n This stands for a newline. +@item %N +This stands for the nanoseconds (000000000-999999999). To ask for +fewer digits, use @samp{%3N} for milliseconds, @samp{%6N} for +microseconds, etc. Any excess digits are discarded, without rounding. +Currently Emacs time stamps are at best microsecond resolution so the +last three digits generated by plain @samp{%N} are always zero. @item %p This stands for @samp{AM} or @samp{PM}, as appropriate. @item %r === modified file 'etc/ChangeLog' --- etc/ChangeLog 2011-01-28 01:51:41 +0000 +++ etc/ChangeLog 2011-02-01 07:23:48 +0000 @@ -1,3 +1,8 @@ +2011-02-01 Paul Eggert + + format-time-string now supports subsecond time stamp resolution + * NEWS: Document this. + 2011-01-28 Paul Eggert Redo spelling of Makefile variables to conform to POSIX. === modified file 'etc/NEWS' --- etc/NEWS 2011-01-29 03:12:32 +0000 +++ etc/NEWS 2011-02-01 07:23:48 +0000 @@ -169,6 +169,10 @@ *** Tramp offers handlers for file-selinux-context and set-file-selinux-context for remote machines which support SELinux. ++++ +** The function format-time-string now supports the %N directive, for +higher-resolution time stamps. + ** The function kill-emacs is now run upon receipt of the signals SIGTERM and SIGHUP, and upon SIGINT in batch mode. === modified file 'src/ChangeLog' --- src/ChangeLog 2011-01-31 23:54:50 +0000 +++ src/ChangeLog 2011-02-01 07:23:48 +0000 @@ -1,3 +1,13 @@ +2011-02-01 Paul Eggert + + format-time-string now supports subsecond time stamp resolution + * editfns.c (emacs_nmemftime): Renamed from emacs_memftimeu, + for consistency with its new argument and with gnulib nstrftime. + All callers changed. New argument NS. + (Fformat_time_string): Check that the time argument's microseconds + component, if any, is in range; this avoids integer overflow and + also nstrftime needs this. Document %N. + 2011-01-31 Andreas Schwab * image.c (DEF_IMGLIB_FN): Add parameter rettype, use it instead === modified file 'src/editfns.c' --- src/editfns.c 2011-01-30 23:34:18 +0000 +++ src/editfns.c 2011-02-01 07:23:48 +0000 @@ -92,8 +92,8 @@ EMACS_INT *, Lisp_Object, EMACS_INT *); static void update_buffer_properties (EMACS_INT, EMACS_INT); static Lisp_Object region_limit (int); -static size_t emacs_memftimeu (char *, size_t, const char *, - size_t, const struct tm *, int); +static size_t emacs_nmemftime (char *, size_t, const char *, + size_t, const struct tm *, int, int); static void general_insert_function (void (*) (const unsigned char *, EMACS_INT), void (*) (Lisp_Object, EMACS_INT, EMACS_INT, EMACS_INT, @@ -1549,6 +1549,7 @@ /* Write information into buffer S of size MAXSIZE, according to the FORMAT of length FORMAT_LEN, using time information taken from *TP. Default to Universal Time if UT is nonzero, local time otherwise. + Use NS as the number of nanoseconds in the %N directive. Return the number of bytes written, not including the terminating '\0'. If S is NULL, nothing will be written anywhere; so to determine how many bytes would be written, use NULL for S and @@ -1557,7 +1558,8 @@ This function behaves like nstrftime, except it allows null bytes in FORMAT and it does not support nanoseconds. */ static size_t -emacs_memftimeu (char *s, size_t maxsize, const char *format, size_t format_len, const struct tm *tp, int ut) +emacs_nmemftime (char *s, size_t maxsize, const char *format, + size_t format_len, const struct tm *tp, int ut, int ns) { size_t total = 0; @@ -1574,7 +1576,7 @@ if (s) s[0] = '\1'; - result = nstrftime (s, maxsize, format, tp, ut, 0); + result = nstrftime (s, maxsize, format, tp, ut, ns); if (s) { @@ -1620,6 +1622,7 @@ %p is the locale's equivalent of either AM or PM. %M is the minute. %S is the second. +%N is the nanosecond, %6N the microsecond, %3N the millisecond, etc. %Z is the time zone name, %z is the numeric form. %s is the number of seconds since 1970-01-01 00:00:00 +0000. @@ -1649,13 +1652,17 @@ { time_t value; int size; + int usec; + int ns; struct tm *tm; int ut = ! NILP (universal); CHECK_STRING (format_string); - if (! lisp_time_argument (time, &value, NULL)) + if (! (lisp_time_argument (time, &value, &usec) + && 0 <= usec && usec < 1000000)) error ("Invalid time specification"); + ns = usec * 1000; format_string = code_convert_string_norecord (format_string, Vlocale_coding_system, 1); @@ -1678,9 +1685,9 @@ buf[0] = '\1'; BLOCK_INPUT; - result = emacs_memftimeu (buf, size, SSDATA (format_string), + result = emacs_nmemftime (buf, size, SSDATA (format_string), SBYTES (format_string), - tm, ut); + tm, ut, ns); UNBLOCK_INPUT; if ((result > 0 && result < size) || (result == 0 && buf[0] == '\0')) return code_convert_string_norecord (make_unibyte_string (buf, result), @@ -1688,10 +1695,10 @@ /* If buffer was too small, make it bigger and try again. */ BLOCK_INPUT; - result = emacs_memftimeu (NULL, (size_t) -1, + result = emacs_nmemftime (NULL, (size_t) -1, SSDATA (format_string), SBYTES (format_string), - tm, ut); + tm, ut, ns); UNBLOCK_INPUT; size = result + 1; } ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.