changeset:   4403:c49a1266d28ae3933996fc1f6ad46701c06d085e
tag:         tip
parent:      4393:f83978c51585687c9ae6472d43ee06f8c290a440
parent:      4402:4c5cd87620e4cf6f8f3101f5ed972f774d2df4c6
user:        Aidan Kehoe <kehoea(a)parhasard.net>
date:        Wed Jan 09 11:37:16 2008 +0100
files:       src/config.h.in src/doc.c
description:
Automated merge with ssh://aidan-guest@hg.debian.org//hg/xemacs/xemacs
diff -r f83978c51585687c9ae6472d43ee06f8c290a440 -r
c49a1266d28ae3933996fc1f6ad46701c06d085e lisp/ChangeLog
--- a/lisp/ChangeLog	Wed Jan 02 22:29:36 2008 +0100
+++ b/lisp/ChangeLog	Wed Jan 09 11:37:16 2008 +0100
@@ -1,3 +1,19 @@ 2008-01-02  Aidan Kehoe  <kehoea@parhasa
+2008-01-04  Michael Sperber  <mike(a)xemacs.org>
+
+        * code-files.el (insert-file-contents):
+        (load): Don't call `substitute-in-file-name' on the file name.
+
+2008-01-03  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* cus-edit.el (custom-save-all): 
+	If the directory containing the custom file doesn't exist, try to
+	create it. Fixes Nick's Crabtree's bug of 
+	5fb265820712140145w512fa3bbh355cf76f7e2cf792(a)mail.gmail.com ;
+	thank you Nick.
+	* menubar-items.el (default-menubar):
+	In the code to edit the user's init file, try to create the
+	containing directory if it doesn't exist. 
+
 2008-01-02  Aidan Kehoe  <kehoea(a)parhasard.net>
 
 	* gtk-init.el (init-post-gtk-win): 
@@ -9,6 +25,13 @@ 2008-01-02  Aidan Kehoe  <kehoea@parhasa
 	* gtk-iso8859-1.el: Removed.
 	These haven't been used in a year and a half. No need to keep them
 	around. 
+
+2008-01-02  Mike Sperber  <mike(a)xemacs.org>
+
+	* minibuf.el (mouse-read-file-name-1): Use `window-height' instead
+	of `frame-height' to be consistent with `split-window''s
+	calculations.  Bind `window-min-height' for the whole thing to
+	avoid geometry problems with the buttons window.
 
 2008-01-02  Mike Sperber  <mike(a)xemacs.org>
 
diff -r f83978c51585687c9ae6472d43ee06f8c290a440 -r
c49a1266d28ae3933996fc1f6ad46701c06d085e lisp/code-files.el
--- a/lisp/code-files.el	Wed Jan 02 22:29:36 2008 +0100
+++ b/lisp/code-files.el	Wed Jan 09 11:37:16 2008 +0100
@@ -235,10 +235,10 @@ object (the entry specified a coding sys
 
 ;(defun convert-mbox-coding-system (filename visit start end) ...)
 
-(defun load (file &optional noerror nomessage nosuffix)
-  "Execute a file of Lisp code named FILE, or load a binary module.
-First tries to find a Lisp FILE with .elc appended, then with .el, then with
- FILE unmodified.  If unsuccessful, tries to find a binary module FILE with
+(defun load (filename &optional noerror nomessage nosuffix)
+  "Execute a file of Lisp code named FILENAME, or load a binary module.
+First tries to find a Lisp file FILENAME with .elc appended, then with .el, then with
+ FILENAME unmodified.  If unsuccessful, tries to find a binary module FILE with
  the elements of `module-extensions' appended, one at a time.
 Searches directories in load-path for Lisp files, and in `module-load-path'
  for binary modules.
@@ -250,9 +250,8 @@ If optional fourth arg NOSUFFIX is non-n
  .elc, .el, or elements of `module-extensions' to the specified name FILE.
 Return t if file exists."
   (declare (special load-modules-quietly))
-  (let* ((filename (substitute-in-file-name file))
-	 (handler (find-file-name-handler filename 'load))
-	 (path nil))
+  (let ((handler (find-file-name-handler filename 'load))
+	(path nil))
     (if handler
 	(funcall handler 'load filename noerror nomessage nosuffix)
       ;; First try to load a Lisp file
@@ -262,10 +261,10 @@ Return t if file exists."
 					    '(".elc" ".el" "")))))
 	  ;; now use the internal load to actually load the file.
 	  (load-internal
-	   file noerror nomessage nosuffix
+	   filename noerror nomessage nosuffix
 	   (let ((elc ; use string= instead of string-match to keep match-data.
-		(equalp ".elc" (substring path -4))))
-	     (or (and (not elc) coding-system-for-read) ;prefer for source file
+		  (equalp ".elc" (substring path -4))))
+	     (or (and (not elc) coding-system-for-read)	;prefer for source file
 		 ;; find magic-cookie
 		 (let ((codesys
 			(find-coding-system-magic-cookie-in-file path)))
@@ -401,8 +400,7 @@ See also `insert-file-contents-access-ho
 See also `insert-file-contents-access-hook',
 `insert-file-contents-pre-hook', `insert-file-contents-error-hook',
 and `insert-file-contents-post-hook'."
-  (let* ((expanded (substitute-in-file-name filename))
-	 (handler (find-file-name-handler expanded 'insert-file-contents)))
+  (let ((handler (find-file-name-handler filename 'insert-file-contents)))
     (if handler
 	(funcall handler 'insert-file-contents filename visit start end replace)
       (let (return-val coding-system used-codesys)
diff -r f83978c51585687c9ae6472d43ee06f8c290a440 -r
c49a1266d28ae3933996fc1f6ad46701c06d085e lisp/cus-edit.el
--- a/lisp/cus-edit.el	Wed Jan 02 22:29:36 2008 +0100
+++ b/lisp/cus-edit.el	Wed Jan 09 11:37:16 2008 +0100
@@ -3766,7 +3766,13 @@ Hashes several heavily used functions fo
     (custom-save-variables)
     (custom-save-faces)
     (let ((find-file-hooks nil)
-	  (auto-mode-alist))
+	  (auto-mode-alist)
+          custom-file-directory)
+      (unless (file-directory-p (setq custom-file-directory 
+                                      (file-name-directory custom-file)))
+        (message "Creating %s... " custom-file-directory)
+        (make-directory custom-file-directory t)
+        (message "Creating %s... done." custom-file-directory))
       (with-current-buffer (find-file-noselect custom-file)
 	(save-buffer)))))
 
diff -r f83978c51585687c9ae6472d43ee06f8c290a440 -r
c49a1266d28ae3933996fc1f6ad46701c06d085e lisp/menubar-items.el
--- a/lisp/menubar-items.el	Wed Jan 02 22:29:36 2008 +0100
+++ b/lisp/menubar-items.el	Wed Jan 09 11:37:16 2008 +0100
@@ -1441,10 +1441,16 @@ Write your filter like this:
      ["Edit I%_nit File"
       ;; #### there should be something that holds the name that the init
       ;; file should be created as, when it's not present.
-      (let ((el-file (or user-init-file "~/.xemacs/init.el")))
+      (let ((el-file (or user-init-file "~/.xemacs/init.el"))
+            el-file-directory)
 	(if (string-match "\\.elc$" el-file)
 	    (setq el-file
 		  (substring user-init-file 0 (1- (length el-file)))))
+        (unless (file-directory-p
+                 (setq el-file-directory (file-name-directory el-file)))
+          (message "Creating %s... " el-file-directory)
+          (make-directory el-file-directory t)
+          (message "Creating %s... done." el-file-directory))
 	(find-file el-file)
 	(or (eq major-mode 'emacs-lisp-mode)
 	    (emacs-lisp-mode)))]
diff -r f83978c51585687c9ae6472d43ee06f8c290a440 -r
c49a1266d28ae3933996fc1f6ad46701c06d085e lisp/minibuf.el
--- a/lisp/minibuf.el	Wed Jan 02 22:29:36 2008 +0100
+++ b/lisp/minibuf.el	Wed Jan 09 11:37:16 2008 +0100
@@ -2060,18 +2060,15 @@ whether it is a file(/result) or a direc
 	 (butbuf (generate-new-buffer " *mouse-read-file-buttons*"))
 	 (frame (make-dialog-frame))
 	 filewin dirwin
-	 user-data)
+	 user-data
+	 (window-min-height 1)) ; allow button window to be height 2
     (unwind-protect
 	(progn
 	  (reset-buffer filebuf)
 
 	  ;; set up the frame.
 	  (focus-frame frame)
-	  ;; We really need `window-min-height' lines for the button
-	  ;; buffer, as otherwise the button buffer might get
-	  ;; inadvertently deleted when other window-size changes
-	  ;; happen (such as through resize-minibuffer-mode).
-	  (split-window nil (- (frame-height frame) window-min-height))
+	  (split-window nil (- (window-height) 2))
 	  (if file-p
 	      (progn
 		(split-window-horizontally 16)
diff -r f83978c51585687c9ae6472d43ee06f8c290a440 -r
c49a1266d28ae3933996fc1f6ad46701c06d085e src/ChangeLog
--- a/src/ChangeLog	Wed Jan 02 22:29:36 2008 +0100
+++ b/src/ChangeLog	Wed Jan 09 11:37:16 2008 +0100
@@ -1,3 +1,35 @@ 2008-01-02  Aidan Kehoe  <kehoea@parhasa
+2008-01-09  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* config.h.in: 
+	Check that __STDC_VERSION__ is defined before examining its
+	value. Eliminates a Cygwin warning. 
+
+2008-01-08  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* text.h (MAX_XETCHAR_SIZE): Remove, eliminating a redefinition
+	warning on Win32.
+	* dumper.c (pdump_load): 
+	Don't use PATH_MAX_EXTERNAL, instead allocate enough for the path
+	+ DUMP_SLACK (space for .dmp and version information), already
+	used on Win32 and #defined to be 100.
+
+2008-01-08  Jerry James  <james(a)xemacs.org>
+
+	* config.h.in (INLINE_HEADER): adapt to C99 inline semantics.
+
+2008-01-07  Jerry James  <james(a)xemacs.org>
+
+	* xemacs.def.in.in: Clarify the copyright and license.
+
+2008-01-03  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* fileio.c (Fmake_temp_name): Correct the comment to cross
+	reference to make-temp-file, and not to this function. 
+
+2008-01-03  Stephen J. Turnbull  <stephen(a)xemacs.org>
+
+	* doc.c (Fbuilt_in_symbol_file): Improve style.
+
 2008-01-02  Aidan Kehoe  <kehoea(a)parhasard.net>
 
 	* emacs.c (main_1): 
@@ -6,7 +38,6 @@ 2008-01-02  Aidan Kehoe  <kehoea@parhasa
 	* console-gtk.c (gtk_perhaps_init_unseen_key_defaults):
 	Correct the initialisation of the hash table, on the model of the
 	MSW and TTY builds.
-	
 
 2008-01-02  Aidan Kehoe  <kehoea(a)parhasard.net>
 
diff -r f83978c51585687c9ae6472d43ee06f8c290a440 -r
c49a1266d28ae3933996fc1f6ad46701c06d085e src/config.h.in
--- a/src/config.h.in	Wed Jan 02 22:29:36 2008 +0100
+++ b/src/config.h.in	Wed Jan 09 11:37:16 2008 +0100
@@ -1089,7 +1089,8 @@ extern "C" {
    Use `inline static' to define inline functions in .c files.
    See the Internals manual for examples and more information. */
 
-#if defined (__cplusplus) || ! defined (__GNUC__) || ! defined(emacs)
+#if (defined ( __STDC_VERSION__) &&  __STDC_VERSION__ >= 199901L) \
+  || defined (__cplusplus) || ! defined (__GNUC__) || ! defined(emacs)
 # define INLINE_HEADER inline static
 #elif defined (DONT_EXTERN_INLINE_HEADER_FUNCTIONS)
 # define INLINE_HEADER inline
diff -r f83978c51585687c9ae6472d43ee06f8c290a440 -r
c49a1266d28ae3933996fc1f6ad46701c06d085e src/doc.c
--- a/src/doc.c	Wed Jan 02 22:29:36 2008 +0100
+++ b/src/doc.c	Wed Jan 09 11:37:16 2008 +0100
@@ -519,8 +519,7 @@ If TYPE is `defvar', then variable defin
       fun = Findirect_function (symbol);
 
       if (SUBRP (fun) || (CONSP(fun) && (EQ (Qmacro, Fcar_safe (fun)))
-                          && !NILP(fun = Fcdr_safe (fun))
-                          && (SUBRP (fun))))
+                          && (fun = Fcdr_safe (fun), SUBRP (fun))))
 	{
 	  if (XSUBR (fun)->doc == 0)
 	    return Qnil;
diff -r f83978c51585687c9ae6472d43ee06f8c290a440 -r
c49a1266d28ae3933996fc1f6ad46701c06d085e src/dumper.c
--- a/src/dumper.c	Wed Jan 02 22:29:36 2008 +0100
+++ b/src/dumper.c	Wed Jan 09 11:37:16 2008 +0100
@@ -2630,6 +2630,8 @@ pdump_file_try (Wexttext *exe_path)
   return 0;
 }
 
+#define DUMP_SLACK 100 /* Enough to include dump ID, version name, .DMP */
+
 int
 pdump_load (const Wexttext *argv0)
 {
@@ -2637,7 +2639,6 @@ pdump_load (const Wexttext *argv0)
   Wexttext *exe_path = NULL;
   int bufsize = 4096;
   int cchpathsize;
-#define DUMP_SLACK 100 /* Enough to include dump ID, version name, .DMP */
 
   /* Copied from mswindows_get_module_file_name ().  Not clear if it's
      kosher to malloc() yet. */
@@ -2659,7 +2660,7 @@ pdump_load (const Wexttext *argv0)
       wext_strcpy (exe_path, wexe);
     }
 #else /* !WIN32_NATIVE */
-  Wexttext exe_path[PATH_MAX_EXTERNAL];
+  Wexttext *exe_path;
   Wexttext *w;
   const Wexttext *dir, *p;
 
@@ -2694,13 +2695,17 @@ pdump_load (const Wexttext *argv0)
     {
       /* invocation-name includes a directory component -- presumably it
 	 is relative to cwd, not $PATH. */
+      exe_path = alloca_array (Wexttext, 1 + wext_strlen (dir) + DUMP_SLACK);
       wext_strcpy (exe_path, dir);
     }
   else
     {
       const Wexttext *path = wext_getenv ("PATH"); /* not egetenv --
-						     not yet init. */
+                                                      not yet init. */
       const Wexttext *name = p;
+      exe_path = alloca_array (Wexttext,
+			       1 + DUMP_SLACK + max (wext_strlen (name),
+                                                     wext_strlen (path)));
       for (;;)
 	{
 	  p = path;
diff -r f83978c51585687c9ae6472d43ee06f8c290a440 -r
c49a1266d28ae3933996fc1f6ad46701c06d085e src/fileio.c
--- a/src/fileio.c	Wed Jan 02 22:29:36 2008 +0100
+++ b/src/fileio.c	Wed Jan 09 11:37:16 2008 +0100
@@ -628,7 +628,7 @@ be an absolute file name.
 
 This function is analagous to mktemp(3) under POSIX, and as with it, there
 exists a race condition between the test for the existence of the new file
-and its creation.  See `make-temp-name' for a function which avoids this
+and its creation.  See `make-temp-file' for a function which avoids this
 race condition by specifying the appropriate flags to `write-region'. 
 */
        (prefix))
diff -r f83978c51585687c9ae6472d43ee06f8c290a440 -r
c49a1266d28ae3933996fc1f6ad46701c06d085e src/text.h
--- a/src/text.h	Wed Jan 02 22:29:36 2008 +0100
+++ b/src/text.h	Wed Jan 09 11:37:16 2008 +0100
@@ -2988,7 +2988,6 @@ int wcsncmp_ascii (const wchar_t *s1, co
 /* Extra indirection needed in case of manifest constant as arg */
 #define WEXTSTRING_1(arg) L##arg
 #define WEXTSTRING(arg) WEXTSTRING_1(arg)
-#define MAX_XETCHAR_SIZE sizeof (WCHAR)
 #define wext_strlen wcslen
 #define wext_strcmp wcscmp
 #define wext_strncmp wcsncmp
@@ -3014,7 +3013,6 @@ int XCDECL wext_retry_open (const Wextte
 #else
 #define WEXTTEXT_ZTERM_SIZE sizeof (char)
 #define WEXTSTRING(arg) arg
-#define MAX_XETCHAR_SIZE sizeof (char)
 #define wext_strlen strlen
 #define wext_strcmp strcmp
 #define wext_strncmp strncmp
diff -r f83978c51585687c9ae6472d43ee06f8c290a440 -r
c49a1266d28ae3933996fc1f6ad46701c06d085e src/xemacs.def.in.in
--- a/src/xemacs.def.in.in	Wed Jan 02 22:29:36 2008 +0100
+++ b/src/xemacs.def.in.in	Wed Jan 09 11:37:16 2008 +0100
@@ -1,4 +1,23 @@
-/* Put the usual header here */
+/* The module API: core symbols that are visible to modules.
+   Copyright (C) 2008 Jerry James
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+XEmacs is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
 /* The symbol to import/export is on the left.  If the symbol is not
    meant to be used directly, but a macro or inline function in the
    API expands to a form containing the symbol, then the macro or
diff -r f83978c51585687c9ae6472d43ee06f8c290a440 -r
c49a1266d28ae3933996fc1f6ad46701c06d085e tests/ChangeLog
--- a/tests/ChangeLog	Wed Jan 02 22:29:36 2008 +0100
+++ b/tests/ChangeLog	Wed Jan 09 11:37:16 2008 +0100
@@ -1,3 +1,8 @@ 2007-12-29  Stephen J. Turnbull  <stephe
+2008-01-03  Stephen J. Turnbull  <stephen(a)xemacs.org>
+
+	* automated/symbol-tests.el (Symbol documentation): Add tests to
+	check documentation extraction.
+
 2007-12-29  Stephen J. Turnbull  <stephen(a)xemacs.org>
 
 	* automated/test-harness.el (test-harness-test-compiled):
diff -r f83978c51585687c9ae6472d43ee06f8c290a440 -r
c49a1266d28ae3933996fc1f6ad46701c06d085e tests/automated/symbol-tests.el
--- a/tests/automated/symbol-tests.el	Wed Jan 02 22:29:36 2008 +0100
+++ b/tests/automated/symbol-tests.el	Wed Jan 09 11:37:16 2008 +0100
@@ -332,3 +332,23 @@
 ;  (Assert (equal (catch 'test-tag
 ;		   (set mysym 'foo))
 ;		 `(,mysym (foo) make-local nil nil))))
+
+;; ----------------------------------------------------------------
+;; Symbol documentation
+;; ----------------------------------------------------------------
+
+;; built-in variable documentation
+(Assert (string= (built-in-symbol-file 'internal-doc-file-name)
+		 "doc.c"))
+
+;; built-in function documentation
+(Assert (string= (built-in-symbol-file 'built-in-symbol-file)
+		 "doc.c"))
+
+;; built-in macro documentation
+(Assert (string= (built-in-symbol-file 'when)
+		 "eval.c"))
+
+;; #### we should handle symbols defined in Lisp, dumped, autoloaded,
+;; and required, too.
+
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches