Commits

Anonymous committed 6ecc20a

[xemacs-21-4-hg @ 2008-12-26 03:45:09 by vins]
Fix problem with building autoloads that was breaking the package build.
Miscellaneous other fixes.

Comments (0)

Files changed (9)

+2008-05-13  Aidan Kehoe  <kehoea@parhasard.net>
+
+ 	* printer.el (generic-print-region): 
+ 	(generic-print-buffer): 
+ 	Use #'valid-device-type-p instead of #'valid-specifier-tag-p to
+ 	check if the msprinter device is available, now that msprinter is
+ 	always available as a specifier tag. 
+
+2008-12-24  Vin Shelton  <acs@xemacs.org>
+
+	* about.el: Add Francisco to my bio!
+
+2008-12-23  Vin Shelton  <acs@xemacs.org>
+
+	* autoload.el: Move operator definitions to autoload-operators.el
+	in the xemacs-base package.
+
 2007-11-22  Vin Shelton  <acs@xemacs.org>
 
 	* about.el (about-hacker-contribution): Updated my bio.
 where he is a professor of economics at the University of Tsukuba.\n"))
     (vin
      (widget-insert "\
-I'm a software engineer and manager for Adaptive Optics Associates in
-Cambridge, Massachusetts.  I used to play a lot of Ultimate (see\n")
+I'm a software engineer and manager for Adaptive Optics Associates
+in Cambridge, Massachusetts.  I used to play a lot of Ultimate (see\n")
      (about-url-link 'vin nil "Visit the Ultimate Players Association homepage")
-     (widget-insert " for more details), but nowadays I'm a family man,
-so I spend a lot of time with my wife, Becky, and my son, Noah.\n"))
+     (widget-insert " for more details), but I don't have time to
+play much any more.  Nowadays I'm a family man, so I spend most of
+my time with my wife, Becky, and our sons, Noah and Francisco.\n"))
     (vladimir
      (widget-insert "\
 Former technical lead for XEmacs at Sun.  He is now writing a book on
 
 ;;; Code:
 
+;; Need to load easy-mmode because we expand macro calls to easy-mmode
+;; macros in make-autoloads below.
+(require 'easy-mmode)
+
+; Add operator definitions to autoload-operators.el in the xemacs-base
+; package.
+(eval-when-compile (load "cl-macs"))
+(ignore-errors (require 'autoload-operators))
+
+; As autoload-operators is new, provide stopgap measure for a while.
+(if (not (boundp 'autoload-make-autoload-operators))
+    (progn
+      (defvar autoload-make-autoload-operators
+	'(defun define-skeleton defmacro define-derived-mode define-generic-mode
+	  easy-mmode-define-minor-mode easy-mmode-define-global-mode
+	  define-minor-mode defun* defmacro*)
+	"`defun'-like operators that use `autoload' to load the library.")
+      
+      (defvar autoload-make-autoload-complex-operators
+	'(easy-mmode-define-minor-mode easy-mmode-define-global-mode
+	  define-minor-mode)
+	"`defun'-like operators to macroexpand before using `autoload'.")
+      
+      (put 'autoload 'doc-string-elt 3)
+      (put 'defun    'doc-string-elt 3)
+      (put 'defun*   'doc-string-elt 3)
+      (put 'defvar   'doc-string-elt 3)
+      (put 'defcustom 'doc-string-elt 3)
+      (put 'defconst 'doc-string-elt 3)
+      (put 'defmacro 'doc-string-elt 3)
+      (put 'defmacro* 'doc-string-elt 3)
+      (put 'defsubst 'doc-string-elt 3)
+      (put 'define-skeleton 'doc-string-elt 2)
+      (put 'define-derived-mode 'doc-string-elt 4)
+      (put 'easy-mmode-define-minor-mode 'doc-string-elt 2)
+      (put 'define-minor-mode 'doc-string-elt 2)
+      (put 'define-generic-mode 'doc-string-elt 7)
+      ;; defin-global-mode has no explicit docstring.
+      (put 'easy-mmode-define-global-mode 'doc-string-elt 1000)))
+
 (defun make-autoload (form file)
-  "Turn a definition generator FORM into an autoload for source file FILE.
-Returns nil if FORM is not a defun, define-skeleton, define-derived-mode,
-or defmacro."
-  (let ((car (car-safe form)))
-    (if (memq car '(defun define-skeleton defmacro define-derived-mode))
-	(let ((macrop (eq car 'defmacro))
-	      name doc)
-	  (setq form (cdr form)
-		name (car form)
-		;; Ignore the arguments.
-		form (cdr (cond ((eq car 'define-skeleton)
-				 form)
-				((eq car 'define-derived-mode)
-				 (cddr form))
-				(t
-				 (cdr form))))
-		doc (car form))
-	  (if (stringp doc)
-	      (setq form (cdr form))
-	    (setq doc nil))
-	  (list 'autoload (list 'quote name) file doc
-		(or (eq car 'define-skeleton)
-		    (eq car 'define-derived-mode)
-		    (eq (car-safe (car form)) 'interactive))
-		(if macrop (list 'quote 'macro) nil)))
-      nil)))
+  "Turn FORM into an autoload or defvar for source file FILE.
+Returns nil if FORM is not a special autoload form (i.e. a function definition
+or macro definition or a defcustom)."
+  (let ((car (car-safe form)) expand)
+    (cond
+     ;; For complex cases, try again on the macro-expansion.
+     ((and (memq car autoload-make-autoload-complex-operators)
+	   (setq expand (let ((load-file-name file)) (macroexpand form)))
+	   (eq (car expand) 'progn)
+	   (memq :autoload-end expand))
+      (let ((end (memq :autoload-end expand)))
+	;; Cut-off anything after the :autoload-end marker.
+	(setcdr end nil)
+	(cons 'progn
+	      (mapcar (lambda (form) (make-autoload form file))
+		      (cdr expand)))))
+
+     ;; For special function-like operators, use the `autoload' function.
+     ((memq car autoload-make-autoload-operators)
+      (let* ((macrop (memq car '(defmacro defmacro*)))
+	     (name (nth 1 form))
+	     (body (nthcdr (get car 'doc-string-elt) form))
+	     (doc (if (stringp (car body)) (pop body))))
+	;; `define-generic-mode' quotes the name, so take care of that
+	(list 'autoload (if (listp name) name (list 'quote name)) file doc
+	      (or (and (memq car '(define-skeleton define-derived-mode
+				    define-generic-mode
+				    easy-mmode-define-global-mode
+				    easy-mmode-define-minor-mode
+				    define-minor-mode)) t)
+		  (eq (car-safe (car body)) 'interactive))
+	      (if macrop (list 'quote 'macro) nil))))
+
+     ;; Convert defcustom to a simpler (and less space-consuming) defvar,
+     ;; but add some extra stuff if it uses :require.
+     ((eq car 'defcustom)
+      (let ((varname (car-safe (cdr-safe form)))
+	    (init (car-safe (cdr-safe (cdr-safe form))))
+	    (doc (car-safe (cdr-safe (cdr-safe (cdr-safe form)))))
+	    (rest (cdr-safe (cdr-safe (cdr-safe (cdr-safe form))))))
+	(if (not (plist-get rest :require))
+	    `(defvar ,varname ,init ,doc)
+	  `(progn
+	     (defvar ,varname ,init ,doc)
+	     (custom-add-to-group ,(plist-get rest :group)
+				  ',varname 'custom-variable)
+	     (custom-add-load ',varname
+			      ,(plist-get rest :require))))))
+     ;; Coding systems. #### Would be nice to handle the docstring here too.
+     ((memq car '(make-coding-system make-8-bit-coding-system))
+      `(autoload-coding-system ,(nth 1 form) '(load ,file)))
+     ;; nil here indicates that this is not a special autoload form.
+     (t nil))))
 
 (defvar generate-autoload-cookie ";;;###autoload"
   "Magic comment indicating the following form should be autoloaded.
 
 (defvar autoload-package-name nil)
 
-;;; Forms which have doc-strings which should be printed specially.
-;;; A doc-string-elt property of ELT says that (nth ELT FORM) is
-;;; the doc-string in FORM.
-;;;
-;;; There used to be the following note here:
-;;; ;;; Note: defconst and defvar should NOT be marked in this way.
-;;; ;;; We don't want to produce defconsts and defvars that
-;;; ;;; make-docfile can grok, because then it would grok them twice,
-;;; ;;; once in foo.el (where they are given with ;;;###autoload) and
-;;; ;;; once in loaddefs.el.
-;;;
-;;; Counter-note: Yes, they should be marked in this way.
-;;; make-docfile only processes those files that are loaded into the
-;;; dumped Emacs, and those files should never have anything
-;;; autoloaded here.  The above-feared problem only occurs with files
-;;; which have autoloaded entries *and* are processed by make-docfile;
-;;; there should be no such files.
-
-(put 'autoload 'doc-string-elt 3)
-(put 'defun    'doc-string-elt 3)
-(put 'defvar   'doc-string-elt 3)
-(put 'defconst 'doc-string-elt 3)
-(put 'defmacro 'doc-string-elt 3)
-(put 'define-skeleton 'doc-string-elt 3)
-(put 'define-derived-mode 'doc-string-elt 4)
-
 (defun autoload-trim-file-name (file)
   "Returns a relative pathname of FILE including the last directory."
   (setq file (expand-file-name file))
       (let* ((print-region (and (interactive-p) (region-active-p)))
 	     (start (if print-region (region-beginning) (point-min buffer)))
 	     (end (if print-region (region-end) (point-max buffer))))
-	(if (or (not (valid-specifier-tag-p 'msprinter))
+	(if (or (not (valid-device-type-p 'msprinter))
 		(not display-print-dialog))
 	    (generic-print-region start end buffer)
 	  (let* ((d (Printer-get-device))
   to-page    Last page to print, inclusive, If omitted, printing ends at
              the end.
   copies     Number of copies to print.  If omitted, one copy is printed."
-  (cond ((valid-specifier-tag-p 'msprinter)
+  (cond ((valid-device-type-p 'msprinter)
 	 ;; loop, printing one copy of document per loop.  kill and
 	 ;; re-create the frame each time so that we eject the piece
 	 ;; of paper at the end even if we're printing more than one
+2008-03-05  Dominique Quatravaux  <domq@cpan.org>
+
+	* glyphs-gtk.c: Fixed compilation under gcc 4.x.
+
+2008-11-01  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* regex.c (re_search_2): Fix at_dot by changing charpos to bytepos.
+	From Julian Bradfield <18654.1143.304851.782755@krk.inf.ed.ac.uk>.
+
+2008-12-25  Vin Shelton  <acs@xemacs.org>
+
+	* mule-ccl.c (ccl_driver): Fix off-by-one error.
+	By Julian Bradfield in
+	<18691.16568.526264.972026@krk.inf.ed.ac.uk>.
+
+	* mule-ccl.c (ccl_driver): 
+
 2007-10-07  Vin Shelton  <acs@xemacs.org>
 
 	* XEmacs 21.4.21 is released
     find_keyword_in_vector (instantiator, Q_file);
 
   IMAGE_INSTANCE_GTK_PIXMAP (ii) = pixmap;
-  IMAGE_INSTANCE_GTK_MASK (ii) = 0;
+  IMAGE_INSTANCE_PIXMAP_MASK (ii) = 0;
   IMAGE_INSTANCE_PIXMAP_WIDTH (ii) = gdk_image->width;
   IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) = gdk_image->height;
   IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = gdk_image->depth;
       IMAGE_INSTANCE_TYPE (p) = IMAGE_COLOR_PIXMAP;
       /* Make sure there aren't two pointers to the same mask, causing
 	 it to get freed twice. */
-      IMAGE_INSTANCE_GTK_MASK (p) = 0;
+      IMAGE_INSTANCE_PIXMAP_MASK (p) = 0;
       break;
 
     default:
 		  if (XCHARSET_DIMENSION (CHARSET_BY_LEADING_BYTE (i)) == 1)
 		    i = (((i - FIELD2_TO_OFFICIAL_LEADING_BYTE) << 7)
 			 | (reg[rrr] & 0x7F));
-		  else if (i < MAX_LEADING_BYTE_OFFICIAL_2)
+		  else if (i <= MAX_LEADING_BYTE_OFFICIAL_2)
 		    i = ((i - FIELD1_TO_OFFICIAL_LEADING_BYTE) << 14) 
 		      | reg[rrr];
 		  else
+2008-09-27  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* automated/regexp-tests.el: Add test for at_dot regexp.
+
 2007-10-07  Vin Shelton  <acs@xemacs.org>
 
 	* XEmacs 21.4.21 is released

tests/automated/regexp-tests.el

 		 (not (match-beginning 1))))
 )
 
+
+;; empty string at point
+;; Thanks Julian Bradford on XEmacs Beta
+;; <18652.54975.894512.880956@krk.inf.ed.ac.uk>
+(with-string-as-buffer-contents "a�a"
+  (goto-char (point-min))
+  (Assert (looking-at "\\="))
+  (Assert (= (re-search-forward "\\=") 1))
+  (forward-char 1)
+  (Assert (looking-at "\\="))
+  (Assert (= (re-search-forward "\\=") 2))
+  (forward-char 1)
+  (Assert (looking-at "\\="))
+  (Assert (= (re-search-forward "\\=") 3))
+  (forward-char 1)
+  (Assert (looking-at "\\="))
+  (Assert (= (re-search-forward "\\=") 4)))