changeset 109418:6e96aca307a4

Merge from mainline.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Sun, 27 Jun 2010 22:48:36 +0000
parents 338717febe80 (current diff) c05c5a981dd9 (diff)
children 4caffbf18f4c
files
diffstat 24 files changed, 211 insertions(+), 138 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Jun 25 03:34:29 2010 +0000
+++ b/ChangeLog	Sun Jun 27 22:48:36 2010 +0000
@@ -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	Fri Jun 25 03:34:29 2010 +0000
+++ b/config.bat	Sun Jun 27 22:48:36 2010 +0000
@@ -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	Fri Jun 25 03:34:29 2010 +0000
+++ b/etc/NEWS	Sun Jun 27 22:48:36 2010 +0000
@@ -275,6 +275,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/lisp/ChangeLog	Fri Jun 25 03:34:29 2010 +0000
+++ b/lisp/ChangeLog	Sun Jun 27 22:48:36 2010 +0000
@@ -1,3 +1,37 @@
+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
--- a/lisp/frame.el	Fri Jun 25 03:34:29 2010 +0000
+++ b/lisp/frame.el	Sun Jun 27 22:48:36 2010 +0000
@@ -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/menu-bar.el	Fri Jun 25 03:34:29 2010 +0000
+++ b/lisp/menu-bar.el	Sun Jun 27 22:48:36 2010 +0000
@@ -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/org/ChangeLog	Fri Jun 25 03:34:29 2010 +0000
+++ b/lisp/org/ChangeLog	Sun Jun 27 22:48:36 2010 +0000
@@ -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	Fri Jun 25 03:34:29 2010 +0000
+++ b/lisp/org/org-agenda.el	Sun Jun 27 22:48:36 2010 +0000
@@ -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	Fri Jun 25 03:34:29 2010 +0000
+++ b/lisp/org/org.el	Sun Jun 27 22:48:36 2010 +0000
@@ -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	Fri Jun 25 03:34:29 2010 +0000
+++ b/lisp/progmodes/ruby-mode.el	Sun Jun 27 22:48:36 2010 +0000
@@ -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/startup.el	Fri Jun 25 03:34:29 2010 +0000
+++ b/lisp/startup.el	Sun Jun 27 22:48:36 2010 +0000
@@ -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	Fri Jun 25 03:34:29 2010 +0000
+++ b/lisp/textmodes/flyspell.el	Sun Jun 27 22:48:36 2010 +0000
@@ -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	Fri Jun 25 03:34:29 2010 +0000
+++ b/lisp/textmodes/ispell.el	Sun Jun 27 22:48:36 2010 +0000
@@ -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	Fri Jun 25 03:34:29 2010 +0000
+++ b/lisp/tool-bar.el	Sun Jun 27 22:48:36 2010 +0000
@@ -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/w32-fns.el	Fri Jun 25 03:34:29 2010 +0000
+++ b/lisp/w32-fns.el	Sun Jun 27 22:48:36 2010 +0000
@@ -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	Fri Jun 25 03:34:29 2010 +0000
+++ b/msdos/ChangeLog	Sun Jun 27 22:48:36 2010 +0000
@@ -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	Fri Jun 25 03:34:29 2010 +0000
+++ b/msdos/mainmake.v2	Sun Jun 27 22:48:36 2010 +0000
@@ -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	Fri Jun 25 03:34:29 2010 +0000
+++ b/msdos/sed1v2.inp	Sun Jun 27 22:48:36 2010 +0000
@@ -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	Fri Jun 25 03:34:29 2010 +0000
+++ b/src/ChangeLog	Sun Jun 27 22:48:36 2010 +0000
@@ -1,3 +1,20 @@
+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):
--- a/src/frame.c	Fri Jun 25 03:34:29 2010 +0000
+++ b/src/frame.c	Sun Jun 27 22:48:36 2010 +0000
@@ -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/nsfns.m	Fri Jun 25 03:34:29 2010 +0000
+++ b/src/nsfns.m	Sun Jun 27 22:48:36 2010 +0000
@@ -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	Fri Jun 25 03:34:29 2010 +0000
+++ b/src/s/freebsd.h	Sun Jun 27 22:48:36 2010 +0000
@@ -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	Fri Jun 25 03:34:29 2010 +0000
+++ b/src/w32fns.c	Sun Jun 27 22:48:36 2010 +0000
@@ -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	Fri Jun 25 03:34:29 2010 +0000
+++ b/src/xfns.c	Sun Jun 27 22:48:36 2010 +0000
@@ -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);