changeset 109064:b44ac3c3bafd

merge trunk
author Kenichi Handa <handa@etlken>
date Mon, 28 Jun 2010 12:32:18 +0900
parents c77749185234 (current diff) d8144fe7f3f8 (diff)
children c96dfcadf1a5
files lisp/vc/vc.el
diffstat 36 files changed, 437 insertions(+), 236 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jun 24 15:10:43 2010 +0900
+++ b/ChangeLog	Mon Jun 28 12:32:18 2010 +0900
@@ -1,3 +1,7 @@
+2010-06-26  Eli Zaretskii  <eliz@gnu.org>
+
+	* config.bat: Remove white space around "+" in COPY commands.
+
 2010-06-16  Chong Yidong  <cyd@stupidchicken.com>
 
 	* INSTALL: Update font information (Bug#6389).
--- a/config.bat	Thu Jun 24 15:10:43 2010 +0900
+++ b/config.bat	Mon Jun 28 12:32:18 2010 +0900
@@ -191,7 +191,7 @@
 
 rem   Create "makefile" from "makefile.in".
 rm -f Makefile makefile.tmp
-copy Makefile.in + deps.mk makefile.tmp
+copy Makefile.in+deps.mk makefile.tmp
 sed -f ../msdos/sed1v2.inp <makefile.tmp >Makefile
 rm -f makefile.tmp
 
--- a/etc/NEWS	Thu Jun 24 15:10:43 2010 +0900
+++ b/etc/NEWS	Mon Jun 28 12:32:18 2010 +0900
@@ -144,6 +144,25 @@
 ** completion-at-point is now an alias for complete-symbol.
 
 ** mouse-region-delete-keys has been deleted.
+
+** Deletion changes
+
+*** New option `delete-active-region'.
+If non-nil, C-d, [delete], and DEL delete the region if it is active
+and no prefix argument is given.  If set to `kill', these commands
+kill instead.
+
+*** New command `delete-forward-char', bound to C-d and [delete].
+This is meant for interactive use, and obeys `delete-active-region';
+delete-char, meant for Lisp, does not obey `delete-active-region'.
+
+*** `delete-backward-char' is now a Lisp function.
+Apart from obeying `delete-active-region', its behavior is unchanged.
+However, the byte compiler now warns if it is called from Lisp; you
+should use delete-char with a negative argument instead.
+
+*** The option `mouse-region-delete-keys' has been deleted.
+
 
 * Changes in Specialized Modes and Packages in Emacs 24.1
 
@@ -275,6 +294,15 @@
 
 ** Passing a nil argument to a minor mode function now turns the mode
    ON unconditionally.
+
+** During startup, Emacs no longer adds entries for `menu-bar-lines'
+and `tool-bar-lines' to `default-frame-alist' and
+`initial-frame-alist'.  With these alist entries omitted, `make-frame'
+checks the value of the variable `menu-bar-mode'/`tool-bar-mode' to
+determine whether to create a menu-bar or tool-bar, respectively.
+If the alist entries are added, they override the value of
+`menu-bar-mode'/`tool-bar-mode'.
+
 
 * Lisp changes in Emacs 24.1
 
--- a/lib-src/ChangeLog	Thu Jun 24 15:10:43 2010 +0900
+++ b/lib-src/ChangeLog	Mon Jun 28 12:32:18 2010 +0900
@@ -1,3 +1,7 @@
+2010-06-24  Juanma Barranquero  <lekktu@gmail.com>
+
+	* movemail.c (error): Avoid warning when there are no args.
+
 2010-06-11  Juanma Barranquero  <lekktu@gmail.com>
 
 	* makefile.w32-in (lisp2): Fix references to vc/vc-hooks.elc
--- a/lib-src/movemail.c	Thu Jun 24 15:10:43 2010 +0900
+++ b/lib-src/movemail.c	Mon Jun 28 12:32:18 2010 +0900
@@ -612,7 +612,7 @@
   else if (s2)
     fprintf (stderr, s1, s2);
   else
-    fprintf (stderr, s1);
+    fprintf (stderr, "%s", s1);
   fprintf (stderr, "\n");
 }
 
--- a/lisp/ChangeLog	Thu Jun 24 15:10:43 2010 +0900
+++ b/lisp/ChangeLog	Mon Jun 28 12:32:18 2010 +0900
@@ -1,3 +1,65 @@
+2010-06-28  Chong Yidong  <cyd@stupidchicken.com>
+
+	* simple.el (delete-active-region): New option.
+	(delete-backward-char): Implement in Lisp.
+	(delete-forward-char): New command.
+
+	* mouse.el (mouse-region-delete-keys): Deleted.
+	(mouse-show-mark): Simplify.
+
+	* bindings.el (global-map): Bind delete and DEL, the former to
+	delete-forward-char.
+
+2010-01-16  Lennart Borgman  <lennart.borgman@gmail.com>
+
+	* progmodes/ruby-mode.el (ruby-mode-map): Don't bind TAB.
+	(ruby-mode): Bind indent-line-function (Bug#5119).
+
+2010-06-27  Chong Yidong  <cyd@stupidchicken.com>
+
+	* startup.el (command-line): Recognize "0" X resource value.
+
+2010-06-27  Chong Yidong  <cyd@stupidchicken.com>
+
+	* startup.el (command-line): Use X resources to set the value of
+	menu-bar-mode and tool-bar-mode, before calling frame-initialize.
+
+	* menu-bar.el (menu-bar-mode):
+	* tool-bar.el (tool-bar-mode): Don't change default-frame-alist.
+	Set init-value to t.
+
+	* frame.el (frame-notice-user-settings): Don't change
+	default-frame-alist based on menu-bar-mode and tool-bar-mode, or
+	vice versa (Bug#2249).
+
+2010-06-26  Eli Zaretskii  <eliz@gnu.org>
+
+	* w32-fns.el (w32-convert-standard-filename): Doc fix.
+
+2010-06-25  Agustín Martín  <agustin.martin@hispalinux.es>
+
+	* flyspell.el (flyspell-check-previous-highlighted-word): Make
+	sure `flyspell-word' re-checks word after function run (Bug#6504).
+
+	* ispell.el (ispell-init-process): Make sure ispell and default
+	directories are expanded. (Bug#6143).
+
+2010-06-24  Juri Linkov  <juri@jurta.org>
+
+	* minibuffer.el (completions-format): Change default from nil to
+	`horizontal'.  Remove `nil' value from :type.  Doc fix.  (Bug#6459)
+
+2010-06-24  Juri Linkov  <juri@jurta.org>
+
+	* vc/vc.el (vc-diff-internal): Set `revert-buffer-function'
+	buffer-locally to lambda that re-runs the vc diff command.
+	(Bug#6447)
+
+2010-06-24  Chong Yidong  <cyd@stupidchicken.com>
+
+	* kmacro.el (kmacro-call-macro): Don't issue hint message if the
+	echo area is in use (Bug#3412).
+
 2010-06-22  Glenn Morris  <rgm@gnu.org>
 
 	* textmodes/texinfmt.el (texinfo-format-region)
--- a/lisp/bindings.el	Thu Jun 24 15:10:43 2010 +0900
+++ b/lisp/bindings.el	Mon Jun 28 12:32:18 2010 +0900
@@ -822,6 +822,9 @@
     (setq i (1+ i))))
 (define-key global-map [?\C-\M--] 'negative-argument)
 
+(define-key global-map "\177" 'delete-backward-char)
+(define-key global-map "\C-d" 'delete-forward-char)
+
 (define-key global-map "\C-k" 'kill-line)
 (define-key global-map "\C-w" 'kill-region)
 (define-key esc-map "w" 'kill-ring-save)
--- a/lisp/frame.el	Thu Jun 24 15:10:43 2010 +0900
+++ b/lisp/frame.el	Mon Jun 28 12:32:18 2010 +0900
@@ -39,13 +39,6 @@
 
 (defvar window-system-default-frame-alist nil
   "Alist of window-system dependent default frame parameters.
-You can set this in your init file; for example,
-
- ;; Disable menubar and toolbar on the console, but enable them under X.
- (setq window-system-default-frame-alist
-       '((x (menu-bar-lines . 1) (tool-bar-lines . 1))
-         (nil (menu-bar-lines . 0) (tool-bar-lines . 0))))
-
 Parameters specified here supersede the values given in
 `default-frame-alist'.")
 
@@ -287,36 +280,6 @@
 React to settings of `initial-frame-alist',
 `window-system-default-frame-alist' and `default-frame-alist'
 there (in decreasing order of priority)."
-  ;; Make menu-bar-mode and default-frame-alist consistent.
-  (when (boundp 'menu-bar-mode)
-    (let ((default (assq 'menu-bar-lines default-frame-alist)))
-      (if default
-	  (setq menu-bar-mode (not (eq (cdr default) 0)))
-	(setq default-frame-alist
-	      (cons (cons 'menu-bar-lines (if menu-bar-mode 1 0))
-		    default-frame-alist)))))
-
-  ;; Make tool-bar-mode and default-frame-alist consistent.  Don't do
-  ;; it in batch mode since that would leave a tool-bar-lines
-  ;; parameter in default-frame-alist in a dumped Emacs, which is not
-  ;; what we want.
-  (when (and (boundp 'tool-bar-mode)
- 	     (not noninteractive))
-    (let ((default (assq 'tool-bar-lines default-frame-alist)))
-      (if default
- 	  (setq tool-bar-mode (not (eq (cdr default) 0)))
-	;; If Emacs was started on a tty, changing default-frame-alist
-	;; would disable the toolbar on X frames created later.  We
-	;; want to keep the default of showing a toolbar under X even
-	;; in this case.
-	;;
-	;; If the user explicitly called `tool-bar-mode' in .emacs,
-	;; then default-frame-alist is already changed anyway.
-	(when initial-window-system
-	  (setq default-frame-alist
-		(cons (cons 'tool-bar-lines (if tool-bar-mode 1 0))
-		      default-frame-alist))))))
-
   ;; Creating and deleting frames may shift the selected frame around,
   ;; and thus the current buffer.  Protect against that.  We don't
   ;; want to use save-excursion here, because that may also try to set
--- a/lisp/kmacro.el	Thu Jun 24 15:10:43 2010 +0900
+++ b/lisp/kmacro.el	Mon Jun 28 12:32:18 2010 +0900
@@ -642,11 +642,13 @@
 		       kmacro-call-repeat-key)))
       (setq repeat-key-str (format-kbd-macro (vector repeat-key) nil))
       (while repeat-key
-	(message "(Type %s to repeat macro%s)"
-		 repeat-key-str
-		 (if (and kmacro-call-repeat-with-arg
-			  arg (> arg 1))
-		     (format " %d times" arg) ""))
+	;; Issue a hint to the user, if the echo area isn't in use.
+	(unless (current-message)
+	  (message "(Type %s to repeat macro%s)"
+		   repeat-key-str
+		   (if (and kmacro-call-repeat-with-arg
+			    arg (> arg 1))
+		       (format " %d times" arg) "")))
 	(if (equal repeat-key (read-event))
 	    (progn
 	      (clear-this-command-keys t)
--- a/lisp/menu-bar.el	Thu Jun 24 15:10:43 2010 +0900
+++ b/lisp/menu-bar.el	Mon Jun 28 12:32:18 2010 +0900
@@ -1924,28 +1924,20 @@
     `(menu-item ,(purecopy "Previous History Item") previous-history-element
 		:help ,(purecopy "Put previous minibuffer history element in the minibuffer"))))
 
-;;;###autoload
-;; This comment is taken from tool-bar.el near
-;; (put 'tool-bar-mode ...)
-;; We want to pretend the menu bar by standard is on, as this will make
-;; customize consider disabling the menu bar a customization, and save
-;; that.  We could do this for real by setting :init-value below, but
-;; that would overwrite disabling the tool bar from X resources.
-(put 'menu-bar-mode 'standard-value '(t))
-
 (define-minor-mode menu-bar-mode
   "Toggle display of a menu bar on each frame.
 This command applies to all frames that exist and frames to be
 created in the future.
 With a numeric argument, if the argument is positive,
 turn on menu bars; otherwise, turn off menu bars."
-  :init-value nil
+  :init-value t
   :global t
   :group 'frames
 
-  ;; Make menu-bar-mode and default-frame-alist consistent.
-  (modify-all-frames-parameters (list (cons 'menu-bar-lines
-					    (if menu-bar-mode 1 0))))
+  ;; Turn the menu-bars on all frames on or off.
+  (let ((val (if menu-bar-mode 1 0)))
+    (dolist (frame (frame-list))
+      (set-frame-parameter frame 'menu-bar-lines val)))
 
   ;; Make the message appear when Emacs is idle.  We can not call message
   ;; directly.  The minor-mode message "Menu-bar mode disabled" comes
--- a/lisp/minibuffer.el	Thu Jun 24 15:10:43 2010 +0900
+++ b/lisp/minibuffer.el	Mon Jun 28 12:32:18 2010 +0900
@@ -891,13 +891,13 @@
 (defface completions-annotations '((t :inherit italic))
   "Face to use for annotations in the *Completions* buffer.")
 
-(defcustom completions-format nil
+(defcustom completions-format 'horizontal
   "Define the appearance and sorting of completions.
 If the value is `vertical', display completions sorted vertically
 in columns in the *Completions* buffer.
-If the value is `horizontal' or nil, display completions sorted
+If the value is `horizontal', display completions sorted
 horizontally in alphabetical order, rather than down the screen."
-  :type '(choice (const nil) (const horizontal) (const vertical))
+  :type '(choice (const horizontal) (const vertical))
   :group 'minibuffer
   :version "23.2")
 
--- a/lisp/mouse.el	Thu Jun 24 15:10:43 2010 +0900
+++ b/lisp/mouse.el	Mon Jun 28 12:32:18 2010 +0900
@@ -929,7 +929,7 @@
   (mouse-minibuffer-check start-event)
   (setq mouse-selection-click-count-buffer (current-buffer))
   ;; We must call deactivate-mark before repositioning point.
-  ;; Otherwise, for select-active-regions non-nil, we get the wrong
+  ;; Otherwise, for `select-active-regions' non-nil, we get the wrong
   ;; selection if the user drags a region, clicks elsewhere to
   ;; reposition point, then middle-clicks to paste the selection.
   (deactivate-mark)
@@ -1263,11 +1263,6 @@
 
 ;; Momentarily show where the mark is, if highlighting doesn't show it.
 
-(defcustom mouse-region-delete-keys '([delete] [deletechar] [backspace])
-  "List of keys that should cause the mouse region to be deleted."
-  :group 'mouse
-  :type '(repeat key-sequence))
-
 (defun mouse-show-mark ()
   (let ((inhibit-quit t)
 	(echo-keystrokes 0)
@@ -1297,8 +1292,7 @@
 				 'vertical-scroll-bar))
 			(and (memq 'down (event-modifiers event))
 			     (not (key-binding key))
-			     (not (mouse-undouble-last-event events))
-			     (not (member key mouse-region-delete-keys)))))
+			     (not (mouse-undouble-last-event events)))))
 	(and (consp event)
 	     (or (eq (car event) 'switch-frame)
 		 (eq (posn-point (event-end event))
@@ -1311,22 +1305,9 @@
 		      (setq events nil)))))))
     ;; If we lost the selection, just turn off the highlighting.
     (unless ignore
-      ;; For certain special keys, delete the region.
-      (if (member key mouse-region-delete-keys)
-	  (progn
-	    ;; Since notionally this is a separate command,
-	    ;; run all the hooks that would be run if it were
-	    ;; executed separately.
-	    (run-hooks 'post-command-hook)
-	    (setq last-command this-command)
-	    (setq this-original-command 'delete-region)
-	    (setq this-command (or (command-remapping this-original-command)
-				   this-original-command))
-	    (run-hooks 'pre-command-hook)
-	    (call-interactively this-command))
-	;; Otherwise, unread the key so it gets executed normally.
-	(setq unread-command-events
-	      (nconc events unread-command-events))))
+      ;; Unread the key so it gets executed normally.
+      (setq unread-command-events
+	    (nconc events unread-command-events)))
     (setq quit-flag nil)
     (unless transient-mark-mode
       (delete-overlay mouse-drag-overlay))))
--- a/lisp/org/ChangeLog	Thu Jun 24 15:10:43 2010 +0900
+++ b/lisp/org/ChangeLog	Mon Jun 28 12:32:18 2010 +0900
@@ -1,3 +1,13 @@
+2010-06-26  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-agenda.el (org-agenda-goto-calendar): Do not bind obsolete
+	variables.
+
+	* org.el (calendar): Require calendar now on top level in org.el
+	and define aliases to new variables when needed.
+	(org-read-date, org-goto-calendar): Do not bind obsolete
+	variables.
+
 2010-06-22  Glenn Morris  <rgm@gnu.org>
 
 	* org-entities.el: Add explicit utf-8 coding cookie to file with
--- a/lisp/org/org-agenda.el	Thu Jun 24 15:10:43 2010 +0900
+++ b/lisp/org/org-agenda.el	Mon Jun 28 12:32:18 2010 +0900
@@ -3981,7 +3981,6 @@
   "Get the (Emacs Calendar) diary entries for DATE."
   (require 'diary-lib)
   (let* ((diary-fancy-buffer "*temporary-fancy-diary-buffer*")
-	 (fancy-diary-buffer diary-fancy-buffer)
 	 (diary-display-hook '(fancy-diary-display))
 	 (diary-display-function 'fancy-diary-display)
 	 (pop-up-frames nil)
@@ -7312,9 +7311,7 @@
 	 (date (calendar-gregorian-from-absolute day))
 	 (calendar-move-hook nil)
 	 (calendar-view-holidays-initially-flag nil)
-	 (calendar-view-diary-initially-flag nil)
-	 (view-calendar-holidays-initially nil)
-	 (view-diary-entries-initially nil))
+	 (calendar-view-diary-initially-flag nil))
     (calendar)
     (calendar-goto-date date)))
 
--- a/lisp/org/org.el	Thu Jun 24 15:10:43 2010 +0900
+++ b/lisp/org/org.el	Mon Jun 28 12:32:18 2010 +0900
@@ -72,8 +72,19 @@
 
 (eval-when-compile
   (require 'cl)
-  (require 'gnus-sum)
-  (require 'calendar))
+  (require 'gnus-sum))
+
+(require 'calendar)
+;; Emacs 22 calendar compatibility:  Make sure the new variables are available
+(unless (boundp 'calendar-view-holidays-initially-flag)
+  (defvaralias 'calendar-view-holidays-initially-flag
+    'view-calendar-holidays-initially))
+(unless (boundp 'calendar-view-diary-initially-flag)
+  (defvaralias 'calendar-view-diary-initially-flag
+    'view-diary-entries-initially))
+(unless (boundp 'diary-fancy-buffer)
+  (defvaralias 'diary-fancy-buffer 'fancy-diary-buffer))
+
 ;; For XEmacs, noutline is not yet provided by outline.el, so arrange for
 ;; the file noutline.el being loaded.
 (if (featurep 'xemacs) (condition-case nil (require 'noutline)))
@@ -13516,9 +13527,7 @@
 	 (calendar-frame-setup nil)
 	 (calendar-move-hook nil)
 	 (calendar-view-diary-initially-flag nil)
-	 (view-diary-entries-initially nil)
 	 (calendar-view-holidays-initially-flag nil)
-	 (view-calendar-holidays-initially nil)
 	 (timestr (format-time-string
 		   (if with-time "%Y-%m-%d %H:%M" "%Y-%m-%d") def))
 	 (prompt (concat (if prompt (concat prompt " ") "")
@@ -14578,9 +14587,7 @@
   (let ((tsr org-ts-regexp) diff
 	(calendar-move-hook nil)
 	(calendar-view-holidays-initially-flag nil)
-	(view-calendar-holidays-initially nil)
-	(calendar-view-diary-initially-flag nil)
-	(view-diary-entries-initially nil))
+	(calendar-view-diary-initially-flag nil))
     (if (or (org-at-timestamp-p)
 	    (save-excursion
 	      (beginning-of-line 1)
--- a/lisp/progmodes/ruby-mode.el	Thu Jun 24 15:10:43 2010 +0900
+++ b/lisp/progmodes/ruby-mode.el	Mon Jun 28 12:32:18 2010 +0900
@@ -166,7 +166,6 @@
     (define-key map (kbd "M-C-n") 'ruby-end-of-block)
     (define-key map (kbd "M-C-h") 'ruby-mark-defun)
     (define-key map (kbd "M-C-q") 'ruby-indent-exp)
-    (define-key map (kbd "TAB")   'ruby-indent-line)
     (define-key map (kbd "C-M-h") 'backward-kill-word)
     (define-key map (kbd "C-j")   'reindent-then-newline-and-indent)
     (define-key map (kbd "C-m")   'newline)
@@ -1390,6 +1389,8 @@
   (setq major-mode 'ruby-mode)
   (ruby-mode-variables)
 
+  (set (make-local-variable 'indent-line-function)
+       'ruby-indent-line)
   (set (make-local-variable 'imenu-create-index-function)
        'ruby-imenu-create-index)
   (set (make-local-variable 'add-log-current-defun-function)
--- a/lisp/simple.el	Thu Jun 24 15:10:43 2010 +0900
+++ b/lisp/simple.el	Mon Jun 28 12:32:18 2010 +0900
@@ -844,6 +844,78 @@
 	 (overlay-recenter (point))
 	 (recenter -3))))
 
+(defcustom delete-active-region t
+  "Whether single-char deletion commands delete an active region.
+This has an effect only if Transient Mark mode is enabled, and
+affects `delete-forward-char' and `delete-backward-char', though
+not `delete-char'.
+
+If the value is the symbol `kill', the active region is killed
+instead of deleted."
+  :type '(choice (const :tag "Delete active region" t)
+                 (const :tag "Kill active region" kill)
+                 (const :tag "Do ordinary deletion" nil))
+  :group 'editing
+  :version "24.1")
+
+(defun delete-backward-char (n &optional killflag)
+  "Delete the previous N characters (following if N is negative).
+If Transient Mark mode is enabled, the mark is active, and N is 1,
+delete the text in the region and deactivate the mark instead.
+To disable this, set `delete-active-region' to nil.
+
+Optional second arg KILLFLAG, if non-nil, means to kill (save in
+kill ring) instead of delete.  Interactively, N is the prefix
+arg, and KILLFLAG is set if N is explicitly specified.
+
+In Overwrite mode, single character backward deletion may replace
+tabs with spaces so as to back over columns, unless point is at
+the end of the line."
+  (interactive "p\nP")
+  (unless (integerp n)
+    (signal 'wrong-type-argument (list 'integerp n)))
+  (cond ((and (use-region-p)
+	      delete-active-region
+	      (= n 1))
+	 ;; If a region is active, kill or delete it.
+	 (if (eq delete-active-region 'kill)
+	     (kill-region (region-beginning) (region-end))
+	   (delete-region (region-beginning) (region-end))))
+	;; In Overwrite mode, maybe untabify while deleting
+	((null (or (null overwrite-mode)
+		   (<= n 0)
+		   (memq (char-before) '(?\t ?\n))
+		   (eobp)
+		   (eq (char-after) ?\n)))
+	 (let* ((ocol (current-column))
+		(val (delete-char (- n) killflag)))
+	   (save-excursion
+	     (insert-char ?\s (- ocol (current-column)) nil))))
+	;; Otherwise, do simple deletion.
+	(t (delete-char (- n) killflag))))
+
+(defun delete-forward-char (n &optional killflag)
+  "Delete the previous N characters (following if N is negative).
+If Transient Mark mode is enabled, the mark is active, and N is 1,
+delete the text in the region and deactivate the mark instead.
+To disable this, set `delete-active-region' to nil.
+
+Optional second arg KILLFLAG non-nil means to kill (save in kill
+ring) instead of delete.  Interactively, N is the prefix arg, and
+KILLFLAG is set if N was explicitly specified."
+  (interactive "p\nP")
+  (unless (integerp n)
+    (signal 'wrong-type-argument (list 'integerp n)))
+  (cond ((and (use-region-p)
+	      delete-active-region
+	      (= n 1))
+	 ;; If a region is active, kill or delete it.
+	 (if (eq delete-active-region 'kill)
+	     (kill-region (region-beginning) (region-end))
+	   (delete-region (region-beginning) (region-end))))
+	;; Otherwise, do simple deletion.
+	(t (delete-char n killflag))))
+
 (defun mark-whole-buffer ()
   "Put point at beginning and mark at end of buffer.
 You probably should not use this function in Lisp programs;
--- a/lisp/startup.el	Thu Jun 24 15:10:43 2010 +0900
+++ b/lisp/startup.el	Mon Jun 28 12:32:18 2010 +0900
@@ -878,10 +878,32 @@
 
   (run-hooks 'before-init-hook)
 
-  ;; Under X Window, this creates the X frame and deletes the terminal frame.
+  ;; Under X, this creates the X frame and deletes the terminal frame.
   (unless (daemonp)
+    ;; Enable or disable the tool-bar and menu-bar.
+    ;; While we're at it, set `no-blinking-cursor' too.
+    (cond
+     ((or noninteractive emacs-basic-display)
+      (setq menu-bar-mode nil
+	    tool-bar-mode nil
+	    no-blinking-cursor t))
+     ;; Check X resources if available.
+     ((memq initial-window-system '(x w32 ns))
+      (let ((no-vals  '("no" "off" "false" "0")))
+	(if (member (x-get-resource "menuBar" "MenuBar") no-vals)
+	    (setq menu-bar-mode nil))
+	(if (member (x-get-resource "toolBar" "ToolBar") no-vals)
+	    (setq tool-bar-mode nil))
+	(if (member (x-get-resource "cursorBlink" "CursorBlink")
+		    no-vals)
+	    (setq no-blinking-cursor t)))))
     (frame-initialize))
 
+  ;; Set up the tool-bar (even in tty frames, since Emacs might open a
+  ;; graphical frame later).
+  (unless noninteractive
+    (tool-bar-setup))
+
   ;; Turn off blinking cursor if so specified in X resources.  This is here
   ;; only because all other settings of no-blinking-cursor are here.
   (unless (or noninteractive
@@ -891,25 +913,6 @@
 				'("off" "false")))))
     (setq no-blinking-cursor t))
 
-  ;; If frame was created with a menu bar, set menu-bar-mode on.
-  (unless (or noninteractive
-	      emacs-basic-display
-              (and (memq initial-window-system '(x w32))
-                   (<= (frame-parameter nil 'menu-bar-lines) 0)))
-    (menu-bar-mode 1))
-
-  (unless (or noninteractive (not (fboundp 'tool-bar-mode)))
-    ;; Set up the tool-bar.  Do this even in tty frames, so that there
-    ;; is a tool-bar if Emacs later opens a graphical frame.
-    (if (or emacs-basic-display
-	    (and (numberp (frame-parameter nil 'tool-bar-lines))
-		 (<= (frame-parameter nil 'tool-bar-lines) 0)))
-	;; On a graphical display with the toolbar disabled via X
-	;; resources, set up the toolbar without enabling it.
-	(tool-bar-setup)
-      ;; Otherwise, enable tool-bar-mode.
-      (tool-bar-mode 1)))
-
   ;; Re-evaluate predefined variables whose initial value depends on
   ;; the runtime context.
   (mapc 'custom-reevaluate-setting
--- a/lisp/textmodes/flyspell.el	Thu Jun 24 15:10:43 2010 +0900
+++ b/lisp/textmodes/flyspell.el	Mon Jun 28 12:32:18 2010 +0900
@@ -1817,7 +1817,9 @@
 			(throw 'exit t)))))))
 	(save-excursion
 	  (goto-char pos)
-	  (ispell-word))
+	  (ispell-word)
+	  (setq flyspell-word-cache-word nil) ;; Force flyspell-word re-check
+	  (flyspell-word))
       (error "No word to correct before point"))))
 
 ;;*---------------------------------------------------------------------*/
--- a/lisp/textmodes/ispell.el	Thu Jun 24 15:10:43 2010 +0900
+++ b/lisp/textmodes/ispell.el	Mon Jun 28 12:32:18 2010 +0900
@@ -2622,7 +2622,7 @@
 	   ;; Restart check for personal dictionary is done in
 	   ;; `ispell-internal-change-dictionary', called from `ispell-buffer-local-dict'
 	   (or (or ispell-local-pdict ispell-personal-dictionary)
-	       (equal ispell-process-directory default-directory)))
+	       (equal ispell-process-directory (expand-file-name default-directory))))
       (setq ispell-filter nil ispell-filter-continue nil)
     ;; may need to restart to select new personal dictionary.
     (ispell-kill-ispell t)
@@ -2638,13 +2638,13 @@
     (if (window-minibuffer-p)
 	(if (fboundp 'minibuffer-selected-window)
 	    ;; Assign ispell process to parent buffer
-	    (setq ispell-process-directory default-directory
+	    (setq ispell-process-directory (expand-file-name default-directory)
 		  ispell-process-buffer-name (window-buffer (minibuffer-selected-window)))
 	  ;; Force `ispell-process-directory' to $HOME and use a dummy name
 	  (setq ispell-process-directory (expand-file-name "~/")
 		ispell-process-buffer-name " * Minibuffer-has-spellcheck-enabled"))
       ;; Not in a minibuffer
-      (setq ispell-process-directory default-directory
+      (setq ispell-process-directory (expand-file-name default-directory)
 	    ispell-process-buffer-name (buffer-name)))
     (if ispell-async-processp
 	(set-process-filter ispell-process 'ispell-filter))
--- a/lisp/tool-bar.el	Thu Jun 24 15:10:43 2010 +0900
+++ b/lisp/tool-bar.el	Mon Jun 28 12:32:18 2010 +0900
@@ -48,21 +48,17 @@
 
 See `tool-bar-add-item' and `tool-bar-add-item-from-menu' for
 conveniently adding tool bar items."
-  :init-value nil
+  :init-value t
   :global t
   :group 'mouse
   :group 'frames
-  (if tool-bar-mode
-      (progn
-	;; Make one tool-bar-line for any - including non-graphical -
-	;; terminal, see Bug#1754.  If this causes problems, we should
-	;; handle the problem in `modify-frame-parameters' or do not
-	;; call `modify-all-frames-parameters' when toggling the tool
-	;; bar off either.
-	(modify-all-frames-parameters (list (cons 'tool-bar-lines 1)))
-	(if (= 1 (length (default-value 'tool-bar-map))) ; not yet setup
-	    (tool-bar-setup)))
-    (modify-all-frames-parameters (list (cons 'tool-bar-lines 0)))))
+  ;; Make tool-bar even if terminal is non-graphical (Bug#1754).
+  (let ((val (if tool-bar-mode 1 0)))
+    (dolist (frame (frame-list))
+      (set-frame-parameter frame 'tool-bar-lines val)))
+  (when tool-bar-mode
+    (if (= 1 (length (default-value 'tool-bar-map))) ; not yet setup
+	(tool-bar-setup))))
 
 ;;;###autoload
 ;; Used in the Show/Hide menu, to have the toggle reflect the current frame.
@@ -74,17 +70,6 @@
       (tool-bar-mode (if (> (frame-parameter nil 'tool-bar-lines) 0) 0 1))
     (tool-bar-mode arg)))
 
-;;;###autoload
-;; We want to pretend the toolbar by standard is on, as this will make
-;; customize consider disabling the toolbar a customization, and save
-;; that.  We could do this for real by setting :init-value above, but
-;; that would turn on the toolbar in MS Windows where it is currently
-;; useless, and it would overwrite disabling the tool bar from X
-;; resources.  If anyone want to implement this in a cleaner way,
-;; please do so.
-;; -- Per Abrahamsen <abraham@dina.kvl.dk> 2002-02-21.
-(put 'tool-bar-mode 'standard-value '(t))
-
 (defvar tool-bar-map (make-sparse-keymap)
   "Keymap for the tool bar.
 Define this locally to override the global tool bar.")
--- a/lisp/vc/vc.el	Thu Jun 24 15:10:43 2010 +0900
+++ b/lisp/vc/vc.el	Mon Jun 28 12:32:18 2010 +0900
@@ -1547,6 +1547,9 @@
           (message "%s" (cdr messages))
           nil)
       (diff-mode)
+      (set (make-local-variable 'revert-buffer-function)
+	   `(lambda (ignore-auto noconfirm)
+	      (vc-diff-internal ,async ',vc-fileset ,rev1 ,rev2 ,verbose)))
       ;; Make the *vc-diff* buffer read only, the diff-mode key
       ;; bindings are nicer for read only buffers. pcl-cvs does the
       ;; same thing.
--- a/lisp/w32-fns.el	Thu Jun 24 15:10:43 2010 +0900
+++ b/lisp/w32-fns.el	Mon Jun 28 12:32:18 2010 +0900
@@ -254,7 +254,7 @@
 ;;				     (expand-file-name ".." exec-directory)))))
 
 (defun w32-convert-standard-filename (filename)
-  "Convert a standard file's name to something suitable for the MS-Windows.
+  "Convert a standard file's name to something suitable for MS-Windows.
 This means to guarantee valid names and perhaps to canonicalize
 certain patterns.
 
--- a/msdos/ChangeLog	Thu Jun 24 15:10:43 2010 +0900
+++ b/msdos/ChangeLog	Mon Jun 28 12:32:18 2010 +0900
@@ -1,3 +1,14 @@
+2010-06-26  Eli Zaretskii  <eliz@gnu.org>
+
+	* mainmake.v2 (version): Use emacs_version[] in src/emacs.c
+	instead of lisp/version.el (see revno 100306).
+
+	* sed1v2.inp (MKDEPDIR): Edit to empty.
+	Delete lines in rules that invoke $(MKDEPDIR).
+	Fix editing rules that begin with "cd ../lisp".
+	Edit out sh if-then-else-fi constructs that test ${CANNOT_DUMP}.
+	Edit out "|| exit ;\" constructs in emacs${EXEEXT} rule.
+
 2010-06-03  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* sed1v2.inp (UNEXEC_OBJ): Use UNEXEC_OBJ instead of unexec.
--- a/msdos/mainmake.v2	Thu Jun 24 15:10:43 2010 +0900
+++ b/msdos/mainmake.v2	Mon Jun 28 12:32:18 2010 +0900
@@ -65,7 +65,7 @@
 top_srcdir := $(subst \,/,$(shell cd))
 
 # Find out which version of Emacs this is.
-version := ${shell sed -n -e '/(defconst emacs-version/s/^[^"]*\("[^"]*"\).*/\1/p' lisp/version.el}
+version := ${shell sed -n -e '/^const char emacs_version/s/^[^"]*\("[^"]*"\).*/\1/p' src/emacs.c}
 
 # Q: Do we need to bootstrap?
 # A: Only if we find admin/admin.el, i.e. we are building out of 
--- a/msdos/sed1v2.inp	Thu Jun 24 15:10:43 2010 +0900
+++ b/msdos/sed1v2.inp	Mon Jun 28 12:32:18 2010 +0900
@@ -20,12 +20,6 @@
 s/^[ \f\t][ \f\t]*$//
 s/^ /	/
 s/\.h\.in/.h-in/
-/^	LC_ALL=C \$(RUN_TEMACS)/i\
-	stubedit temacs.exe minstack=1024k
-/^	LC_ALL=C.*\$(RUN_TEMACS)/s/LC_ALL=C/set &;/
-/-batch -l loadup/a\
-	stubify emacs\
-	stubedit emacs.exe minstack=2048k
 /^MAKE *=/s/^/# /
 /^SHELL *=/s/^/# /
 /^srcdir *=/s/@[^@\n]*@/./
@@ -124,7 +118,7 @@
 /^UNEXEC_OBJ *=/s/@UNEXEC_OBJ@/unexec.o/
 /^CANNOT_DUMP *=/s/@cannot_dump@/no/
 /^DEPFLAGS *=/s/@DEPFLAGS@//
-/^MKDEPDIR *=/s/@MKDEPDIR@/:/
+/^MKDEPDIR *=/s/@MKDEPDIR@//
 /^version *=/s/@[^@\n]*@//
 /^M_FILE *=/s!@[^@\n]*@!m/intel386.h!
 /^S_FILE *=/s!@[^@\n]*@!s/msdos.h!
@@ -132,17 +126,29 @@
 /^.\${libsrc}make-docfile.*>/s!make-docfile!make-docfile -o ../etc/DOC!
 /^.\${libsrc}make-doc/s!>.*$!!
 /^[ 	]*$/d
+/^	if test -f/,/^	fi$/c\
+	command.com /c if exist .gdbinit rm -f _gdbinit
 /^temacs:/s/prefix-args//
 /^temacs:/s/stamp-oldxmenu//
+/^	if test "\${CANNOT_DUMP}" =/,/^	else /d
+/^	fi/d
+/^	LC_ALL=C \$(RUN_TEMACS)/i\
+	stubedit temacs.exe minstack=1024k
+/^	 *LC_ALL=C.*\$(RUN_TEMACS)/s/LC_ALL=C/set &;/
+/-batch -l loadup/a\
+	stubify emacs\
+	stubedit emacs.exe minstack=2048k
+s/ || exit 1\; \\$//
+s/ || true\; \\$//
 /^RUN_TEMACS *=/s|`/bin/pwd`|.|
+/^	 *@\$(MKDEPDIR) *$/d
 /^	mv \.\/\.gdbinit/d
-/^	if test -f/c\
+/^	if test -f/,/^	fi$/c\
 	command.com /c if exist .gdbinit rm -f _gdbinit
-/^	else mv \.\/\.gdbinit/d
 /^	#/d
 /^	cd.*make-docfile/s!$!; cd ${dot}${dot}/src!
 /^	@: /d
-/^	-\{0,1\}ln -/s/ln -f/cp -pf/
+/^	-\{0,1\} *ln -/s/ln -f/cp -pf/
 /^[ 	]touch /s/touch/djecho $@ >/
 s/@YMF_PASS_LDFLAGS@/flags/
 s/@deps_frag@//
@@ -162,7 +168,7 @@
 	stubedit b-emacs.exe minstack=3072k\
 	djecho bootlisp > bootlisp
 /^	-\{0,1\}rm -f/s/\\#/#/
-/^	@\{0,1\}cd ..\/lisp; /s|$|\; cd ../src|
+/^	@\{0,1\}cd ..\/lisp;.*[^\]$/s|$|\; cd ../src|
 /^	echo.* buildobj.h/s|echo |djecho |
 
 # arch-tag: c7e3aacb-4162-460e-99f9-4252bca68d2c
--- a/src/ChangeLog	Thu Jun 24 15:10:43 2010 +0900
+++ b/src/ChangeLog	Mon Jun 28 12:32:18 2010 +0900
@@ -1,3 +1,29 @@
+2010-06-28  Chong Yidong  <cyd@stupidchicken.com>
+
+	* cmds.c (Fdelete_backward_char): Move into Lisp.
+
+2010-06-27  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* s/freebsd.h (BSD4_2): Remove redundant definition.
+	bsd-common.h defines it already.
+
+2010-06-27  Chong Yidong  <cyd@stupidchicken.com>
+
+	* xfns.c (Fx_create_frame): Don't consult X resouces when setting
+	menu-bar-lines and tool-bar-lines.  Use menu-bar-mode and
+	tool-bar-mode, which are now set using these X resources at
+	startup, to determine the defaults (Bug#2249).
+
+	* w32fns.c (Fx_create_frame):
+	* nsfns.m (Fx_create_frame): Likewise.
+
+	* frame.c (Vmenu_bar_mode, Vtool_bar_mode): New vars.
+
+2010-06-24  Juanma Barranquero  <lekktu@gmail.com>
+
+	* gtkutil.c (xg_update_scrollbar_pos):
+	Avoid C99 mid-block variable declaration.
+
 2010-06-22  Jan Djärv  <jan.h.d@swipnet.se>
 
 	* xterm.c (x_scroll_bar_create): Remove call to xg_show_scroll_bar.
--- a/src/cmds.c	Thu Jun 24 15:10:43 2010 +0900
+++ b/src/cmds.c	Mon Jun 28 12:32:18 2010 +0900
@@ -240,7 +240,9 @@
        doc: /* Delete the following N characters (previous if N is negative).
 Optional second arg KILLFLAG non-nil means kill instead (save in kill ring).
 Interactively, N is the prefix arg, and KILLFLAG is set if
-N was explicitly specified.  */)
+N was explicitly specified.
+
+The command `delete-forward' is preferable for interactive use.  */)
      (n, killflag)
      Lisp_Object n, killflag;
 {
@@ -273,60 +275,6 @@
   return Qnil;
 }
 
-DEFUN ("delete-backward-char", Fdelete_backward_char, Sdelete_backward_char,
-       1, 2, "p\nP",
-       doc: /* Delete the previous N characters (following if N is negative).
-Optional second arg KILLFLAG non-nil means kill instead (save in kill ring).
-Interactively, N is the prefix arg, and KILLFLAG is set if
-N was explicitly specified.
-This is meant for interactive use only; from Lisp, better use `delete-char'
-with a negated argument.  */)
-     (n, killflag)
-     Lisp_Object n, killflag;
-{
-  Lisp_Object value;
-  int deleted_special = 0;
-  int pos, pos_byte, i;
-
-  CHECK_NUMBER (n);
-
-  /* See if we are about to delete a tab or newline backwards.  */
-  pos = PT;
-  pos_byte = PT_BYTE;
-  for (i = 0; i < XINT (n) && pos_byte > BEGV_BYTE; i++)
-    {
-      int c;
-
-      DEC_BOTH (pos, pos_byte);
-      c = FETCH_BYTE (pos_byte);
-      if (c == '\t' || c == '\n')
-	{
-	  deleted_special = 1;
-	  break;
-	}
-    }
-
-  /* In overwrite mode, back over columns while clearing them out,
-     unless at end of line.  */
-  if (XINT (n) > 0
-      && ! NILP (current_buffer->overwrite_mode)
-      && ! deleted_special
-      && ! (PT == ZV || FETCH_BYTE (PT_BYTE) == '\n'))
-    {
-      int column = (int) current_column (); /* iftc */
-
-      value = Fdelete_char (make_number (-XINT (n)), killflag);
-      i = column - (int) current_column (); /* iftc */
-      Finsert_char (make_number (' '), make_number (i), Qnil);
-      /* Whitespace chars are ASCII chars, so we can simply subtract.  */
-      SET_PT_BOTH (PT - i, PT_BYTE - i);
-    }
-  else
-    value = Fdelete_char (make_number (-XINT (n)), killflag);
-
-  return value;
-}
-
 static int nonundocount;
 
 /* Note that there's code in command_loop_1 which typically avoids
@@ -635,8 +583,6 @@
   defsubr (&Send_of_line);
 
   defsubr (&Sdelete_char);
-  defsubr (&Sdelete_backward_char);
-
   defsubr (&Sself_insert_command);
 }
 
@@ -658,10 +604,8 @@
 
   initial_define_key (global_map, Ctl ('A'), "beginning-of-line");
   initial_define_key (global_map, Ctl ('B'), "backward-char");
-  initial_define_key (global_map, Ctl ('D'), "delete-char");
   initial_define_key (global_map, Ctl ('E'), "end-of-line");
   initial_define_key (global_map, Ctl ('F'), "forward-char");
-  initial_define_key (global_map, 0177, "delete-backward-char");
 }
 
 /* arch-tag: 022ba3cd-67f9-4978-9c5d-7d2b18d8644e
--- a/src/frame.c	Thu Jun 24 15:10:43 2010 +0900
+++ b/src/frame.c	Mon Jun 28 12:32:18 2010 +0900
@@ -119,6 +119,7 @@
 Lisp_Object Qexplicit_name;
 Lisp_Object Qunsplittable;
 Lisp_Object Qmenu_bar_lines, Qtool_bar_lines;
+Lisp_Object Vmenu_bar_mode, Vtool_bar_mode;
 Lisp_Object Qleft_fringe, Qright_fringe;
 Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list;
 Lisp_Object Qtty_color_mode;
@@ -4648,6 +4649,14 @@
   Qdelete_frame_functions = intern_c_string ("delete-frame-functions");
   staticpro (&Qdelete_frame_functions);
 
+  DEFVAR_LISP ("menu-bar-mode", &Vmenu_bar_mode,
+               doc: /* Non-nil if Menu-Bar mode is enabled.  */);
+  Vmenu_bar_mode = Qt;
+
+  DEFVAR_LISP ("tool-bar-mode", &Vtool_bar_mode,
+               doc: /* Non-nil if Tool-Bar mode is enabled.  */);
+  Vtool_bar_mode = Qt;
+
   DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame,
 		 doc: /* Minibufferless frames use this frame's minibuffer.
 
--- a/src/gtkutil.c	Thu Jun 24 15:10:43 2010 +0900
+++ b/src/gtkutil.c	Mon Jun 28 12:32:18 2010 +0900
@@ -3213,6 +3213,7 @@
       GtkWidget *wfixed = f->output_data.x->edit_widget;
       GtkWidget *wparent = gtk_widget_get_parent (wscroll);
       GtkFixed *wf = GTK_FIXED (wfixed);
+      gint msl;
 
       /* Clear out old position.  */
       GList *iter;
@@ -3232,7 +3233,6 @@
 
       /* Move and resize to new values.  */
       gtk_fixed_move (GTK_FIXED (wfixed), wparent, left, top);
-      gint msl;
       gtk_widget_style_get (wscroll, "min-slider-length", &msl, NULL);
       if (msl > height)
         {
--- a/src/nsfns.m	Thu Jun 24 15:10:43 2010 +0900
+++ b/src/nsfns.m	Mon Jun 28 12:32:18 2010 +0900
@@ -1234,10 +1234,18 @@
 
   init_frame_faces (f);
 
-  x_default_parameter (f, parms, Qmenu_bar_lines, make_number (0), "menuBar",
-                      "menuBar", RES_TYPE_NUMBER);
-  x_default_parameter (f, parms, Qtool_bar_lines, make_number (0), "toolBar",
-                      "toolBar", RES_TYPE_NUMBER);
+  /* The X resources controlling the menu-bar and tool-bar are
+     processed specially at startup, and reflected in the mode
+     variables; ignore them here.  */
+  x_default_parameter (f, parms, Qmenu_bar_lines,
+		       NILP (Vmenu_bar_mode)
+		       ? make_number (0) : make_number (1),
+		       NULL, NULL, RES_TYPE_NUMBER);
+  x_default_parameter (f, parms, Qtool_bar_lines,
+		       NILP (Vtool_bar_mode)
+		       ? make_number (0) : make_number (1),
+		       NULL, NULL, RES_TYPE_NUMBER);
+
   x_default_parameter (f, parms, Qbuffer_predicate, Qnil, "bufferPredicate",
                        "BufferPredicate", RES_TYPE_SYMBOL);
   x_default_parameter (f, parms, Qtitle, Qnil, "title", "Title",
--- a/src/s/freebsd.h	Thu Jun 24 15:10:43 2010 +0900
+++ b/src/s/freebsd.h	Mon Jun 28 12:32:18 2010 +0900
@@ -25,9 +25,6 @@
 /* Get most of the stuff from bsd-common */
 #include "bsd-common.h"
 
-/* For mem-limits.h. */
-#define BSD4_2
-
 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
 
 #define HAVE_GETLOADAVG 1
--- a/src/w32fns.c	Thu Jun 24 15:10:43 2010 +0900
+++ b/src/w32fns.c	Mon Jun 28 12:32:18 2010 +0900
@@ -290,6 +290,7 @@
 
 /* The below are defined in frame.c.  */
 
+extern Lisp_Object Vmenu_bar_mode, Vtool_bar_mode;
 extern Lisp_Object Vwindow_system_version;
 
 #ifdef GLYPH_DEBUG
@@ -4462,10 +4463,17 @@
      happen.  */
   init_frame_faces (f);
 
-  x_default_parameter (f, parameters, Qmenu_bar_lines, make_number (1),
-		       "menuBar", "MenuBar", RES_TYPE_NUMBER);
-  x_default_parameter (f, parameters, Qtool_bar_lines, make_number (1),
-                       "toolBar", "ToolBar", RES_TYPE_NUMBER);
+  /* The X resources controlling the menu-bar and tool-bar are
+     processed specially at startup, and reflected in the mode
+     variables; ignore them here.  */
+  x_default_parameter (f, parameters, Qmenu_bar_lines,
+		       NILP (Vmenu_bar_mode)
+		       ? make_number (0) : make_number (1),
+		       NULL, NULL, RES_TYPE_NUMBER);
+  x_default_parameter (f, parameters, Qtool_bar_lines,
+		       NILP (Vtool_bar_mode)
+		       ? make_number (0) : make_number (1),
+		       NULL, NULL, RES_TYPE_NUMBER);
 
   x_default_parameter (f, parameters, Qbuffer_predicate, Qnil,
 		       "bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL);
--- a/src/xfns.c	Thu Jun 24 15:10:43 2010 +0900
+++ b/src/xfns.c	Mon Jun 28 12:32:18 2010 +0900
@@ -204,6 +204,8 @@
 
 /* The below are defined in frame.c.  */
 
+extern Lisp_Object Vmenu_bar_mode, Vtool_bar_mode;
+
 #if GLYPH_DEBUG
 int image_cache_refcount, dpyinfo_refcount;
 #endif
@@ -3450,10 +3452,18 @@
      happen.  */
   init_frame_faces (f);
 
-  x_default_parameter (f, parms, Qmenu_bar_lines, make_number (1),
-		       "menuBar", "MenuBar", RES_TYPE_BOOLEAN_NUMBER);
-  x_default_parameter (f, parms, Qtool_bar_lines, make_number (1),
-		       "toolBar", "ToolBar", RES_TYPE_NUMBER);
+  /* The X resources controlling the menu-bar and tool-bar are
+     processed specially at startup, and reflected in the mode
+     variables; ignore them here.  */
+  x_default_parameter (f, parms, Qmenu_bar_lines,
+		       NILP (Vmenu_bar_mode)
+		       ? make_number (0) : make_number (1),
+		       NULL, NULL, RES_TYPE_NUMBER);
+  x_default_parameter (f, parms, Qtool_bar_lines,
+		       NILP (Vtool_bar_mode)
+		       ? make_number (0) : make_number (1),
+		       NULL, NULL, RES_TYPE_NUMBER);
+
   x_default_parameter (f, parms, Qbuffer_predicate, Qnil,
 		       "bufferPredicate", "BufferPredicate",
 		       RES_TYPE_SYMBOL);
--- a/test/ChangeLog	Thu Jun 24 15:10:43 2010 +0900
+++ b/test/ChangeLog	Mon Jun 28 12:32:18 2010 +0900
@@ -1,3 +1,7 @@
+2010-06-25  Chong Yidong  <cyd@stupidchicken.com>
+
+	* redisplay-testsuite.el (test-redisplay-3): New test.
+
 2010-06-11  Chong Yidong  <cyd@stupidchicken.com>
 
 	* comint-testsuite.el: New file.
--- a/test/redisplay-testsuite.el	Thu Jun 24 15:10:43 2010 +0900
+++ b/test/redisplay-testsuite.el	Mon Jun 28 12:32:18 2010 +0900
@@ -110,13 +110,72 @@
 	  (propertize "XXX\n" 'face 'highlight)
 	  "\n  Test:     ")
   (test-insert-overlay "XXX\n" 'mouse-face 'highlight)
-  (insert "\n"))
+  (insert "\n\n"))
+
+(defun test-redisplay-3 ()
+  (insert "Test 3: Overlay with before/after strings and images:\n\n")
+  (let ((img-data "#define x_width 8
+#define x_height 8
+static unsigned char x_bits[] = {0xff, 0x81, 0xbd, 0xa5, 0xa5, 0xbd, 0x81, 0xff };"))
+    ;; Control
+    (insert "  Expected: AB"
+	    (propertize "X" 'display `(image :data ,img-data :type xbm))
+	    "CD\n")
+
+    ;; Overlay with before, after, and image display string.
+    (insert "  Result 1: ")
+    (let ((opoint (point)))
+      (insert "AXD\n")
+      (let ((ov (make-overlay (1+ opoint) (+ 2 opoint))))
+	(overlay-put ov 'before-string "B")
+	(overlay-put ov 'after-string "C")
+	(overlay-put ov 'display
+		     `(image :data ,img-data :type xbm))))
+
+    ;; Overlay with before and after string, and image text prop.
+    (insert "  Result 2: ")
+    (let ((opoint (point)))
+      (insert "AXD\n")
+      (let ((ov (make-overlay (1+ opoint) (+ 2 opoint))))
+	(overlay-put ov 'before-string "B")
+	(overlay-put ov 'after-string "C")
+	(put-text-property (1+ opoint) (+ 2 opoint) 'display
+			   `(image :data ,img-data :type xbm))))
+
+    ;; Overlays with adjacent before and after strings, and image text
+    ;; prop.
+    (insert "  Result 3: ")
+    (let ((opoint (point)))
+      (insert "AXD\n")
+      (let ((ov1 (make-overlay opoint (1+ opoint)))
+	    (ov2 (make-overlay (+ 2 opoint) (+ 3 opoint))))
+	(overlay-put ov1 'after-string "B")
+	(overlay-put ov2 'before-string "C")
+	(put-text-property (1+ opoint) (+ 2 opoint) 'display
+			   `(image :data ,img-data :type xbm))))
+
+    ;; Three overlays.
+    (insert "  Result 4: ")
+    (let ((opoint (point)))
+      (insert "AXD\n\n")
+      (let ((ov1 (make-overlay opoint (1+ opoint)))
+	    (ov2 (make-overlay (+ 2 opoint) (+ 3 opoint)))
+	    (ov3 (make-overlay (1+ opoint) (+ 2 opoint))))
+	(overlay-put ov1 'after-string "B")
+	(overlay-put ov2 'before-string "C")
+	(overlay-put ov3 'display `(image :data ,img-data :type xbm))))))
+
 
 (defun test-redisplay ()
   (interactive)
-  (pop-to-buffer (generate-new-buffer "*Redisplay Test*"))
-  (test-redisplay-1)
-  (test-redisplay-2)
-  (goto-char (point-min)))
+  (let ((buf (get-buffer "*Redisplay Test*")))
+    (if buf
+	(kill-buffer buf))
+    (pop-to-buffer (get-buffer-create "*Redisplay Test*"))
+    (erase-buffer)
+    (test-redisplay-1)
+    (test-redisplay-2)
+    (test-redisplay-3)
+    (goto-char (point-min))))
 
 ;; arch-tag: fcee53c8-024f-403d-9154-61ae3ce0bfb8