changeset 1495:c3cf7db99b98

[xemacs-hg @ 2003-05-22 07:41:20 by stephent] oldies faq <87iss3tpac.fsf@tleepslib.sk.tsukuba.ac.jp> split-string tweaks n dox <87n0hftpht.fsf@tleepslib.sk.tsukuba.ac.jp> missed commit of broken-sun.h <87r878ihhf.fsf@tleepslib.sk.tsukuba.ac.jp> already loaded message <87el2rtovc.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Thu, 22 May 2003 07:41:27 +0000
parents 210683f31426
children e7b471ce22c1
files lisp/ChangeLog lisp/autoload.el lisp/subr.el man/ChangeLog man/lispref/searching.texi man/lispref/strings.texi man/xemacs-faq.texi src/broken-sun.h
diffstat 8 files changed, 171 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Thu May 22 06:09:04 2003 +0000
+++ b/lisp/ChangeLog	Thu May 22 07:41:27 2003 +0000
@@ -1,3 +1,12 @@
+2003-05-22  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* autoload.el (autoload-featurep-protect-autoloads):
+	Make the error message say which sym was checked.
+
+2003-05-16  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* subr.el (split-string): Update dox, tweak logic, to synch to GNU.
+
 2003-05-15  Steve Youngs  <youngs@xemacs.org>
 
 	* package-get.el (package-get-package-index-file-location): New,
--- a/lisp/autoload.el	Thu May 22 06:09:04 2003 +0000
+++ b/lisp/autoload.el	Thu May 22 07:41:27 2003 +0000
@@ -852,7 +852,7 @@
 	(progn
 	  (insert ";;; DO NOT MODIFY THIS FILE\n")
 	  (insert "(if (featurep '" sym ")")
-	  (insert " (error \"Already loaded\"))\n")
+	  (insert " (error \"Feature " sym " already loaded\"))\n")
 	  (goto-char (point-max))
 	  (insert "\n(provide '" sym ")\n")))))
 
--- a/lisp/subr.el	Thu May 22 06:09:04 2003 +0000
+++ b/lisp/subr.el	Thu May 22 07:41:27 2003 +0000
@@ -619,6 +619,11 @@
 ;; specification for `split-string' agreed with rms 2003-04-23
 ;; xemacs design <87vfx5vor0.fsf@tleepslib.sk.tsukuba.ac.jp>
 
+;; The specification says that if both SEPARATORS and OMIT-NULLS are
+;; defaulted, OMIT-NULLS should be treated as t.  Simplifying the logical
+;; expression leads to the equivalent implementation that if SEPARATORS
+;; is defaulted, OMIT-NULLS is treated as t.
+
 (defun split-string (string &optional separators omit-nulls)
   "Splits STRING into substrings bounded by matches for SEPARATORS.
 
@@ -627,24 +632,24 @@
 the substrings between the splitting points are collected as a list,
 which is returned.
 
-If SEPARATORS is nil, it defaults to the value of
-`split-string-default-separators', normally \"[ \\f\\t\\n\\r\\v]+\".
+If SEPARATORS is non-nil, it should be a regular expression matching text
+which separates, but is not part of, the substrings.  If nil it defaults to
+`split-string-default-separators', normally \"[ \\f\\t\\n\\r\\v]+\", and
+OMIT-NULLS is forced to t.
 
 If OMIT-NULLs is t, zero-length substrings are omitted from the list \(so
 that for the default value of SEPARATORS leading and trailing whitespace
 are effectively trimmed).  If nil, all zero-length substrings are retained,
 which correctly parses CSV format, for example.
 
-As a special case, if both SEPARATORS and OMIT-NULLS are nil, white-space
-will be trimmed (ie, the effect of `(split-string STRING)' is the same as
-`(split-string STRING split-string-default-separators t)').  In the very
-rare case that you need to retain zero-length substrings when splitting on
-the default separators, use
-`(split-string STRING split-string-default-separators)'.
+Note that the effect of `(split-string STRING)' is the same as
+`(split-string STRING split-string-default-separators t)').  In the rare
+case that you wish to retain zero-length substrings when splitting on
+whitespace, use `(split-string STRING split-string-default-separators nil)'.
 
 Modifies the match data; use `save-match-data' if necessary."
 
-  (let ((keep-nulls (if separators (not omit-nulls) nil))
+  (let ((keep-nulls (not (if separators omit-nulls t)))
 	(rexp (or separators split-string-default-separators))
 	(start 0)
 	notfirst
--- a/man/ChangeLog	Thu May 22 06:09:04 2003 +0000
+++ b/man/ChangeLog	Thu May 22 07:41:27 2003 +0000
@@ -1,3 +1,17 @@
+2003-05-17  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* xemacs-faq.texi (detail menu): Reformat "Current Events" caption.
+	(Legacy Versions): New section.
+	(Q8.0.1): New question.
+
+2003-05-16  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* lispref/searching.texi (Regexp Search): Update split-string for
+	new specification.
+
+	* lispref/strings.texi (Creating Strings): Xref split-string
+	(this is where GNU Emacs documents it).
+
 2003-05-10  Steve Youngs  <youngs@xemacs.org>
 
 	* XEmacs 21.5.13 "cauliflower" is released.
--- a/man/lispref/searching.texi	Thu May 22 06:09:04 2003 +0000
+++ b/man/lispref/searching.texi	Thu May 22 07:41:27 2003 +0000
@@ -772,31 +772,75 @@
 @end example
 @end defun
 
-@defun split-string string &optional pattern
-This function splits @var{string} to substrings delimited by
-@var{pattern}, and returns a list of substrings.  If @var{pattern} is
-omitted, it defaults to @samp{[ \f\t\n\r\v]+}, which means that it
-splits @var{string} by white--space.
+The function @code{split-string} can be used to parse a string into
+components delimited by text matching a regular expression.
+
+@defvar split-string-default-separators
+The default value of @var{separators} for @code{split-string}, initially
+@samp{"[ \f\t\n\r\v]+"}.
+@end defvar
+
+@defun split-string string &optional separators omit-nulls
+This function splits @var{string} into substrings delimited by matches
+for the regular expression @var{separators}.  Each match for
+@var{separators} defines a splitting point; the substrings between the
+splitting points are made into a list, which is the value returned by
+@code{split-string}.  If @var{omit-nulls} is @code{t}, null strings will
+be removed from the result list.  Otherwise, null strings are left in
+the result.  If @var{separators} is @code{nil} (or omitted), the default
+is the value of @code{split-string-default-separators}.
+
+As a special case, when @var{separators} is @code{nil} (or omitted),
+null strings are always omitted from the result.  Thus:
+
+@example
+(split-string "  two words ")
+     @result{} ("two" "words")
+@end example
+
+The result is not @samp{("" "two" "words" "")}, which would rarely be
+useful.  If you need such a result, use an explict value for
+@var{separators}:
+
+@example
+(split-string "  two words " split-string-default-separators)
+     @result{} ("" "two" "words" "")
+@end example
+
+A few examples (there are more in the regression tests):
 
 @example
 @group
-(split-string "foo bar")
+(split-string "foo" "")
+     @result{} ("" "f" "o" "o" "")
+@end group
+@group
+(split-string "foo" "^")
+     @result{} ("" "foo")
+@end group
+@group
+(split-string "foo" "$")
+     @result{} ("foo" ""))
+@end group
+@group
+(split-string "foo,bar" ",")
      @result{} ("foo" "bar")
 @end group
-
 @group
-(split-string "something")
-     @result{} ("something")
+(split-string ",foo,bar," ",")
+     @result{} ("" "foo" "bar" "")
 @end group
-
 @group
-(split-string "a:b:c" ":")
-     @result{} ("a" "b" "c")
+(split-string ",foo,bar," "^,")
+     @result{} ("" "foo,bar,")
 @end group
-
 @group
-(split-string ":a::b:c" ":")
-     @result{} ("" "a" "" "b" "c")
+(split-string "foo,bar" "," t)
+     @result{} ("foo" "bar")
+@end group
+@group
+(split-string ",foo,bar," "," t)
+     @result{} ("foo" "bar")
 @end group
 @end example
 @end defun
--- a/man/lispref/strings.texi	Thu May 22 06:09:04 2003 +0000
+++ b/man/lispref/strings.texi	Thu May 22 07:41:27 2003 +0000
@@ -288,6 +288,10 @@
 in @ref{Building Lists}.
 @end defun
 
+The function @code{split-string}, in @ref{Regexp Search}, generates a
+list of strings by splitting a string on occurances of a regular
+expression.
+
 @node Predicates for Characters
 @section The Predicates for Characters
 
--- a/man/xemacs-faq.texi	Thu May 22 06:09:04 2003 +0000
+++ b/man/xemacs-faq.texi	Thu May 22 07:41:27 2003 +0000
@@ -7,7 +7,7 @@
 @finalout
 @titlepage
 @title XEmacs FAQ
-@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2003/05/02 06:00:43 $
+@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2003/05/22 07:41:21 $
 @sp 1
 @author Tony Rossini <rossini@@biostat.washington.edu>
 @author Ben Wing <ben@@xemacs.org>
@@ -84,6 +84,7 @@
 * Miscellaneous::       The Miscellaneous Stuff.
 * MS Windows::          XEmacs on Microsoft Windows.
 * Current Events::      What the Future Holds.
+* Legacy Versions::     New information about old XEmacsen.
 
 @detailmenu
 
@@ -417,14 +418,20 @@
 * Q6.4.2::      Why do I get a blank toolbar on Windows 95?
 * Q6.4.3::      XEmacs complains "No such file or directory, diff"
 
-
-Current Events:
+What the Future Holds
+
 * Q7.0.1::      What new features will be in XEmacs soon?
 * Q7.0.2::      What's new in XEmacs 21.4?
 * Q7.0.3::      What's new in XEmacs 21.1?
 * Q7.0.4::      What's new in XEmacs 20.4?
 * Q7.0.5::      What's new in XEmacs 20.3?
 * Q7.0.6::      What's new in XEmacs 20.2?
+
+New information about old XEmacsen.
+
+XEmacs 21.1:
+* Q8.0.1::      Gnus 5.10 won't display smileys in XEmacs 21.1.
+
 @end detailmenu
 @end menu
 
@@ -6906,7 +6913,7 @@
 
 
 
-@node Current Events,  , MS Windows, Top
+@node Current Events, Legacy Versions, MS Windows, Top
 @unnumbered 7 What the Future Holds
 
 This is part 7 of the XEmacs Frequently Asked Questions list.  This
@@ -7238,4 +7245,60 @@
 For older news, see the file @file{ONEWS} in the @file{etc} directory of
 the XEmacs distribution.
 
+
+
+@node Legacy Versions, , Current Events, Top
+@unnumbered 8 New information about old XEmacsen
+
+This is part 8 of the XEmacs Frequently Asked Questions list.  It will
+occasionally be updated to reflect new information about versions which
+are no longer being revised by the XEmacs Project.  The primary purpose
+is advice on compatibility of older XEmacsen with new packages and
+updated versions of packages, but bug fixes (which will not be applied
+to released XEmacsen, but users can apply themselves) are also accepted.
+
+
+@menu
+* Q8.0.1::      Gnus 5.10 won't display smileys in XEmacs 21.1.
+@end menu
+
+@node Q8.0.1, , , Legacy Versions
+@unnumberedsubsec Q8.0.1: Gnus 5.10 won't display smileys in XEmacs 21.1.
+
+@email{eeide@@cs.utah.edu, Eric Eide} wrote:
+
+@quotation
+Previously I wrote:
+
+    Eric> Summary: with Gnus 5.10.1 in XEmacs 21.1.14, I don't see
+    Eric> any smileys :-(.
+
+After a bit of sleuthing, I discovered the essence of the problem.
+For me, the form:
+
+@lisp
+    	(with-temp-buffer
+    	  (insert-file-contents "foo.xpm")
+    	  (buffer-string))
+@end lisp
+
+returns the empty string.  This is because something somewhere
+replaces the XPM data with a glyph --- I haven't figured out where
+this occurs.
+@end quotation
+
+@email{kyle_jones@@wonderworks.com, Kyle Jones} replies:
+
+@quotation
+Do this:
+
+@lisp
+    (setq format-alist nil)
+@end lisp
+
+The image-mode stuff is gone from format-alist in the 21.4
+branch, praise be.
+@end quotation
+
+
 @bye
--- a/src/broken-sun.h	Thu May 22 06:09:04 2003 +0000
+++ b/src/broken-sun.h	Thu May 22 07:41:27 2003 +0000
@@ -107,6 +107,9 @@
 
 /*********************** file-system functions *********************/
 
+/* Ilya Golubev reports that stat can be a #define on some systems.
+   Presumably none of the systems this file is used for, and I don't
+   know what file to include on a system known to be broken, anyway. */
 struct stat;
 #include </usr/include/sys/types.h>