changeset 2071:0f60caa73962

[xemacs-hg @ 2004-05-11 11:33:08 by stephent] gensym docstring <87r7tryzla.fsf@tleepslib.sk.tsukuba.ac.jp> set-eol-detection fix <87vfj3yzs8.fsf@tleepslib.sk.tsukuba.ac.jp> etags.el tests <87zn8fz03v.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Tue, 11 May 2004 11:33:22 +0000
parents 3399b2ba4302
children 508d36502f33
files lisp/ChangeLog lisp/cl.el lisp/code-init.el tests/ChangeLog tests/automated/tag-tests.el
diffstat 5 files changed, 112 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon May 10 21:50:25 2004 +0000
+++ b/lisp/ChangeLog	Tue May 11 11:33:22 2004 +0000
@@ -1,3 +1,11 @@
+2004-04-30  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* cl.el (gensym, gentemp): Improve docstrings.
+
+2004-05-11  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* code-init.el (set-eol-detection): Special-case 'no-conversion.
+
 2004-05-10  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* isearch-mode.el (isearch-forward, isearch-abort): Document that our
--- a/lisp/cl.el	Mon May 10 21:50:25 2004 +0000
+++ b/lisp/cl.el	Tue May 11 11:33:22 2004 +0000
@@ -319,7 +319,10 @@
 
 (defun gensym (&optional arg)
   "Generate a new uninterned symbol.
-The name is made by appending a number to PREFIX, default \"G\"."
+The name is made by appending a number to a prefix.  If ARG is a string, it
+is the prefix, otherwise the prefix defaults to \"G\".  If ARG is an integer,
+the internal counter is reset to that number before creating the name.
+There is no way to specify both using this function."
   (let ((prefix (if (stringp arg) arg "G"))
 	(num (if (integerp arg) arg
 	       (prog1 *gensym-counter*
@@ -328,7 +331,8 @@
 
 (defun gentemp (&optional arg)
   "Generate a new interned symbol with a unique name.
-The name is made by appending a number to PREFIX, default \"G\"."
+The name is made by appending a number to ARG, default \"G\".
+If ARG is not a string, it is ignored."
   (let ((prefix (if (stringp arg) arg "G"))
 	name)
     (while (intern-soft (setq name (format "%s%d" prefix *gensym-counter*)))
--- a/lisp/code-init.el	Mon May 10 21:50:25 2004 +0000
+++ b/lisp/code-init.el	Tue May 11 11:33:22 2004 +0000
@@ -56,11 +56,14 @@
 if you do this."
   (dolist (x '(buffer-file-coding-system-for-read
 	       keyboard
-	       default-process-coding-system-read
-	       no-conversion-coding-system-mapping))
+	       default-process-coding-system-read))
     (set-coding-system-variable
      x (coding-system-change-eol-conversion (get-coding-system-variable x)
-					    (if flag nil 'lf)))))
+					    (if flag nil 'lf))))
+  (set-coding-category-system
+   'no-conversion
+   (coding-system-change-eol-conversion (coding-category-system 'no-conversion)
+					(if flag nil 'lf))))
 
 (defun coding-system-current-system-configuration ()
   (cond ((memq system-type '(windows-nt cygwin32))
--- a/tests/ChangeLog	Mon May 10 21:50:25 2004 +0000
+++ b/tests/ChangeLog	Tue May 11 11:33:22 2004 +0000
@@ -1,3 +1,7 @@
+2004-05-08  Vin Shelton  <acs@xemacs.org>
+
+	* automated/tag-test.el: Created.
+
 2004-04-21  Jerry James  <james@xemacs.org>
 
 	* automated/test-harness.el (Assert): Add an optional failing-case
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/automated/tag-tests.el	Tue May 11 11:33:22 2004 +0000
@@ -0,0 +1,88 @@
+;; Copyright (C) 2004 Vin Shelton
+
+;; Author: Vin Shelton <acs@xemacs.org>
+;; Maintainer: Vin Shelton <acs@xemacs.org>
+;; Created: 2004
+;; Keywords: tests
+
+;; 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., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF.
+
+;;; Commentary:
+
+;; Test tag completion.
+;; See test-harness.el for instructions on how to run these tests.
+
+(let ((testfile "tag-test.c")
+      (tagfile "TAGS"))
+
+  ;; Create a TAGS file
+  (with-temp-file tagfile
+    (insert
+"
+tag-test.c,99
+struct mystruct mystruct2,1
+struct mystruct *foo\(4,23
+DEFUN \(\"require\", Frequire,require,7,51
+"))
+
+  ;; Create the test file
+  (with-temp-file testfile
+    (insert
+"
+struct mystruct { };
+
+struct mystruct *foo\(\) {
+}
+
+DEFUN \(\"require\", Frequire, 1, 2, 0, /*
+If feature FEATURE is not loaded, load it from FILENAME.
+If FEATURE is not a member of the list `features', then the feature
+is not loaded; so load the file FILENAME.
+If FILENAME is omitted, the printname of FEATURE is used as the file name.
+*/
+       \(feature, filename\)\)
+{
+}
+"))
+
+  (let ((tags-always-exact t))
+
+    ;; Search for the tag "mystruct"; this should succeed
+    (find-tag "mystruct")
+    (Assert (eq (point) 2))
+
+    ;; Search again.  The search should fail, based on the patch that
+    ;; Sven Grundmann submitted for 21.4.16.
+    (Check-Error-Message error "No more entries matching mystruct"
+			 (tags-loop-continue)))
+
+  (let ((tags-always-exact nil))
+
+    ;; Search for the definition of "require". Until the etags.el upgrade
+    ;; from 21.5 in 21.4.16, this test would fail.
+    (condition-case nil
+	(find-tag "require")
+      (t t))
+    (Assert (eq (point) 52)))
+
+  (kill-buffer testfile)
+  (delete-file testfile)
+  (kill-buffer tagfile)
+  (delete-file tagfile))