From: Miles Bader Date: Thu, 7 Dec 2006 04:14:14 +0000 (+0000) Subject: Merge from emacs--devo--0 X-Git-Tag: emacs-pretest-23.0.90~8295^2~634 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a0451a715e4ed018a02b825d0eb823424693d1de;p=emacs.git Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 523-544) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 168-171) - Update from CVS - Merge from emacs--devo--0 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-150 --- a0451a715e4ed018a02b825d0eb823424693d1de diff --cc .gitignore index 6f0a84ff21c,71fbe7e8d36..0f9785cdfe7 --- a/.gitignore +++ b/.gitignore @@@ -31,12 -35,13 +31,13 @@@ bi boot.log boot.log.diff boot.log.old -config.cache +update.log config.log config.status -configure -data +config.cache +Makefile emacs*.tar.gz leim*.tar.gz + lock -site-lisp -update.log +*.xdelta +autom4te.cache diff --cc lib-src/etags.c index 49a18be1df5,c3578a4b1ad..26dac368b4d --- a/lib-src/etags.c +++ b/lib-src/etags.c @@@ -41,7 -41,7 +41,7 @@@ * configuration file containing regexp definitions for etags. */ - char pot_etags_version[] = "@(#) pot revision number is 17.20"; -char pot_etags_version[] = "@(#) pot revision number is $Revision: 17.22 $"; ++char pot_etags_version[] = "@(#) pot revision number is $Revision: 3.61 $"; #define TRUE 1 #define FALSE 0 diff --cc lisp/descr-text.el index ec75610c3d7,361c3b8c15c..2d5734c8170 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el @@@ -183,30 -183,9 +183,30 @@@ otherwise. (insert "There are text properties here:\n") (describe-property-list properties))))) +(defcustom describe-char-unidata-list nil + "List of Unicode-based character property names shown by `describe-char'." + :group 'mule + :version "23.1" + :type '(set + (const :tag "Unicode Name" name) + (const :tag "Unicode general category " general-category) + (const :tag "Unicode canonical combining class" + canonical-combining-class) + (const :tag "Unicode bidi class" bidi-class) + (const :tag "Unicode decomposition mapping" decomposition) + (const :tag "Unicode decimal digit value" decimal-digit-value) + (const :tag "Unicode digit value" digit-value) + (const :tag "Unicode numeric value" numeric-value) + (const :tag "Unicode mirrored" mirrored) + (const :tag "Unicode old name" old-name) + (const :tag "Unicode ISO 10646 comment" iso-10646-comment) + (const :tag "Unicode simple uppercase mapping" uppercase) + (const :tag "Unicode simple lowercase mapping" lowercase) + (const :tag "Unicode simple titlecase mapping" titlecase))) + (defcustom describe-char-unicodedata-file nil "Location of Unicode data file. - This is the UnicodeData.txt file from the Unicode consortium, used for + This is the UnicodeData.txt file from the Unicode Consortium, used for diagnostics. If it is non-nil `describe-char' will print data looked up from it. This facility is mostly of use to people doing multilingual development. diff --cc lisp/disp-table.el index d1b49c0b7f0,d436a33e477..20aae96aa94 --- a/lisp/disp-table.el +++ b/lisp/disp-table.el @@@ -126,7 -126,7 +126,7 @@@ Valid symbols are `truncation', `wrap' (or standard-display-table (setq standard-display-table (make-display-table))) (while (<= l h) - (if (and (>= l ?\ ) (characterp l)) - (if (and (>= l ?\s) (char-valid-p l)) ++ (if (and (>= l ?\s) (characterp l)) (aset standard-display-table l nil)) (setq l (1+ l)))) diff --cc lisp/international/fontset.el index 12288e6cd04,c1193e094d8..9f09c615451 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@@ -577,31 -297,98 +577,32 @@@ )) (defun x-decompose-font-name (pattern) - "Decompose PATTERN into XLFD's fields and return vector of the fields. -The length of the vector is 14. - -If PATTERN doesn't conform to XLFD, try to get a full XLFD name from -X server and use the information of the full name to decompose -PATTERN. If no full XLFD name is gotten, return nil." - (let (xlfd-fields fontname) - (if (string-match xlfd-tight-regexp pattern) - (let ((i 0)) - (setq xlfd-fields (make-vector 14 nil)) - (while (< i 14) - (aset xlfd-fields i (match-string (1+ i) pattern)) - (setq i (1+ i))) - xlfd-fields) - (setq fontname (condition-case nil - (x-resolve-font-name pattern) - (error))) - (if (and fontname - (string-match xlfd-tight-regexp fontname)) - ;; We get a full XLFD name. - (let ((len (length pattern)) - (i 0) - l) - ;; Setup xlfd-fields by the full XLFD name. Each element - ;; should be a cons of matched index and matched string. - (setq xlfd-fields (make-vector 14 nil)) - (while (< i 14) - (aset xlfd-fields i - (cons (match-beginning (1+ i)) - (match-string (1+ i) fontname))) - (setq i (1+ i))) - - ;; Replace wild cards in PATTERN by regexp codes. - (setq i 0) - (while (< i len) - (let ((ch (aref pattern i))) - (if (= ch ??) - (setq pattern (concat (substring pattern 0 i) - "\\(.\\)" - (substring pattern (1+ i))) - len (+ len 4) - i (+ i 4)) - (if (= ch ?*) - (setq pattern (concat (substring pattern 0 i) - "\\(.*\\)" - (substring pattern (1+ i))) - len (+ len 5) - i (+ i 5)) - (setq i (1+ i)))))) - - ;; Set each element of xlfd-fields to proper strings. - (if (string-match pattern fontname) - ;; The regular expression PATTERN matchs the full XLFD - ;; name. Set elements that correspond to a wild card - ;; in PATTERN to "*", set the other elements to the - ;; exact strings in PATTERN. - (let ((l (cdr (cdr (match-data))))) - (setq i 0) - (while (< i 14) - (if (or (null l) (< (car (aref xlfd-fields i)) (car l))) - (progn - (aset xlfd-fields i (cdr (aref xlfd-fields i))) - (setq i (1+ i))) - (if (< (car (aref xlfd-fields i)) (car (cdr l))) - (progn - (aset xlfd-fields i "*") - (setq i (1+ i))) - (setq l (cdr (cdr l))))))) - ;; Set each element of xlfd-fields to the exact string - ;; in the corresonding fields in full XLFD name. - (setq i 0) - (while (< i 14) - (aset xlfd-fields i (cdr (aref xlfd-fields i))) - (setq i (1+ i)))) - xlfd-fields))))) - -;; Replace consecutive wild-cards (`*') in NAME to one. -;; Ex. (x-reduce-font-name "-*-*-*-iso8859-1") => "-*-iso8859-1" -(defsubst x-reduce-font-name (name) - (while (string-match "-\\*-\\(\\*-\\)+" name) - (setq name (replace-match "-*-" t t name))) - name) + "Decompose PATTERN into XLFD fields and return a vector of the fields. +The length of the vector is 12. +The FOUNDRY and FAMILY fields are concatinated and stored in the first +element of the vector. +The REGISTRY and ENCODING fields are concatinated and stored in the last +element of the vector. + +Return nil if PATTERN doesn't conform to XLFD." + (if (string-match xlfd-tight-regexp pattern) + (let ((xlfd-fields (make-vector 12 nil))) + (dotimes (i 12) + (aset xlfd-fields i (match-string (1+ i) pattern))) + (dotimes (i 12) + (if (string-match "^[*-]+$" (aref xlfd-fields i)) + (aset xlfd-fields i nil))) + xlfd-fields))) (defun x-compose-font-name (fields &optional reduce) - "Compose X's fontname from FIELDS. -FIELDS is a vector of XLFD fields, of length 14. + "Compose X fontname from FIELDS. - FIELDS is a vector of XLFD fields, the length 12. ++FIELDS is a vector of XLFD fields, of length 12. If a field is nil, wild-card letter `*' is embedded. - Optional argument REDUCE is always ignored. It exists just for - backward compatibility." + Optional argument REDUCE exists just for backward compatibility, + and is always ignored." (concat "-" (mapconcat (lambda (x) (or x "*")) fields "-"))) + (defun x-must-resolve-font-name (xlfd-fields) "Like `x-resolve-font-name', but always return a font name. XLFD-FIELDS is a vector of XLFD (X Logical Font Description) fields. @@@ -768,50 -518,60 +769,50 @@@ to map charsets to scripts." &optional style-variant noerror) "Create a fontset from fontset specification string FONTSET-SPEC. FONTSET-SPEC is a string of the format: - FONTSET-NAME,SCRIPT-NAME0:FONT-NAME0,SCRIPT-NAME1:FONT-NAME1, ... - FONTSET-NAME,CHARSET0:FONT0,CHARSET1:FONT1, ... ++ FONTSET-NAME,SCRIPT0:FONT0,SCRIPT1:FONT1, ... Any number of SPACE, TAB, and NEWLINE can be put before and after commas. -Optional 2nd arg exists just for backward compatibility, and is ignored. +When a frame uses the fontset as the `font' parameter, the frame's +default font name is derived from FONTSET-NAME by substituting +\"iso8859-1\" for the tail part \"fontset-XXX\". But, if SCRIPT-NAMEn +is \"ascii\", use the corresponding FONT-NAMEn as the default font +name. - Optional 2nd and 3rd arguments are ignored. They exist just for - backward compatibility. -If this function attempts to create already existing fontset, an error is -signaled unless the optional 3rd argument NOERROR is non-nil. ++Optional 2nd and 3rd arguments exist just for backward compatibility, ++and are ignored. -It returns a name of the created fontset." - (if (not (string-match "^[^,]+" fontset-spec)) +It returns a name of the created fontset. + +For backward compatibility, SCRIPT-NAME may be a charset name, in +which case, the corresponding script is decided by the variable +`charset-script-alist' (which see)." + (or (string-match "^[^,]+" fontset-spec) (error "Invalid fontset spec: %s" fontset-spec)) - (setq fontset-spec (downcase fontset-spec)) (let ((idx (match-end 0)) (name (match-string 0 fontset-spec)) - xlfd-fields charset fontlist ascii-font) - (if (query-fontset name) - (or noerror - (error "Fontset \"%s\" already exists" name)) - (setq xlfd-fields (x-decompose-font-name name)) - (or xlfd-fields - (error "Fontset \"%s\" not conforming to XLFD" name)) - - ;; At first, extract pairs of charset and fontname from FONTSET-SPEC. - (while (string-match "[, \t\n]*\\([^:]+\\):[ \t]*\\([^,]+\\)" - fontset-spec idx) - (setq idx (match-end 0)) - (setq charset (intern (match-string 1 fontset-spec))) - (if (charsetp charset) - (setq fontlist (cons (cons charset (match-string 2 fontset-spec)) - fontlist)))) - (setq ascii-font (cdr (assq 'ascii fontlist))) - - ;; Complement FONTLIST. - (setq fontlist (x-complement-fontset-spec xlfd-fields fontlist)) - - (new-fontset name fontlist) - - ;; Define the short name alias. - (if (and (string-match "fontset-.*$" name) - (not (assoc name fontset-alias-alist))) - (let ((alias (match-string 0 name))) - (or (rassoc alias fontset-alias-alist) - (setq fontset-alias-alist - (cons (cons name alias) fontset-alias-alist))))) - - ;; Define the ASCII font name alias. - (or ascii-font - (setq ascii-font (cdr (assq 'ascii fontlist)))) - (or (rassoc ascii-font fontset-alias-alist) - (setq fontset-alias-alist - (cons (cons name ascii-font) - fontset-alias-alist)))) - - name)) + xlfd-fields target script fontlist) + (setq xlfd-fields (x-decompose-font-name name)) + (or xlfd-fields + (error "Fontset name \"%s\" not conforming to XLFD" name)) + + ;; At first, extract pairs of charset and fontname from FONTSET-SPEC. + (while (string-match "[, \t\n]*\\([^:]+\\):[ \t]*\\([^,]+\\)" + fontset-spec idx) + (setq idx (match-end 0)) + (setq target (intern (match-string 1 fontset-spec))) + (cond ((or (eq target 'ascii) + (memq target (char-table-extra-slot char-script-table 0))) + (push (list target (match-string 2 fontset-spec)) fontlist)) + ((setq script (cdr (assq target charset-script-alist))) + (push (list script (match-string 2 fontset-spec)) fontlist)) + ((charsetp target) + (push (list target (match-string 2 fontset-spec)) fontlist)))) + + ;; Complement FONTLIST. + (setq fontlist (x-complement-fontset-spec xlfd-fields fontlist)) + + ;; Create a fontset. + (new-fontset name (nreverse fontlist)))) (defun create-fontset-from-ascii-font (font &optional resolved-font fontset-name) diff --cc lisp/tar-mode.el index 024d7399ea9,b1f0176b0f3..f3aa86b48c3 --- a/lisp/tar-mode.el +++ b/lisp/tar-mode.el @@@ -936,8 -957,8 +936,8 @@@ for this to be permanent. (interactive) (save-excursion (goto-char (point-min)) - (while (< (position-bytes (point)) tar-header-offset) + (while (< (point) tar-header-offset) - (if (not (eq (following-char) ?\ )) + (if (not (eq (following-char) ?\s)) (progn (delete-char 1) (insert " "))) (forward-line 1)))) diff --cc lisp/time-stamp.el index 4a14a0197e8,f29806e3013..770a86834c8 --- a/lisp/time-stamp.el +++ b/lisp/time-stamp.el @@@ -710,23 -710,16 +710,16 @@@ around literals. ;;; Some functions used in time-stamp-format ;;; These functions have been obsolete since 1995 -;;; and will be removed in a future Emacs release. +;;; and will be removed in Emacs 23. ;;; Meanwhile, discourage other packages from using them. - (let ((obsolete-functions '(time-stamp-month-dd-yyyy - time-stamp-dd/mm/yyyy - time-stamp-mon-dd-yyyy - time-stamp-dd-mon-yy - time-stamp-yy/mm/dd - time-stamp-yyyy/mm/dd - time-stamp-yyyy-mm-dd - time-stamp-yymmdd - time-stamp-hh:mm:ss - time-stamp-hhmm))) - (while obsolete-functions - (make-obsolete (car obsolete-functions) - "use time-stamp-string or format-time-string instead." - "20.1") - (setq obsolete-functions (cdr obsolete-functions)))) + (dolist (function '(time-stamp-month-dd-yyyy time-stamp-dd/mm/yyyy + time-stamp-mon-dd-yyyy time-stamp-dd-mon-yy + time-stamp-yy/mm/dd time-stamp-yyyy/mm/dd + time-stamp-yyyy-mm-dd time-stamp-yymmdd + time-stamp-hh:mm:ss time-stamp-hhmm)) + (make-obsolete function + "use `time-stamp-string' or `format-time-string' instead." + "20.1")) ;;; pretty form, suitable for a title page diff --cc src/fns.c index e6b83b8e4e1,f65375438fa..da2c43fd6a9 --- a/src/fns.c +++ b/src/fns.c @@@ -150,7 -150,9 +150,7 @@@ To get the number of bytes, use `string if (STRINGP (sequence)) XSETFASTINT (val, SCHARS (sequence)); else if (VECTORP (sequence)) - XSETFASTINT (val, XVECTOR (sequence)->size); + XSETFASTINT (val, ASIZE (sequence)); - else if (SUB_CHAR_TABLE_P (sequence)) - XSETFASTINT (val, SUB_CHAR_TABLE_ORDINARY_SLOTS); else if (CHAR_TABLE_P (sequence)) XSETFASTINT (val, MAX_CHAR); else if (BOOL_VECTOR_P (sequence)) @@@ -576,11 -617,11 +576,11 @@@ concat (nargs, args, target_type, last_ if (VECTORP (this)) for (i = 0; i < len; i++) { - ch = XVECTOR (this)->contents[i]; + ch = AREF (this, i); - CHECK_NUMBER (ch); + CHECK_CHARACTER (ch); this_len_byte = CHAR_BYTES (XINT (ch)); result_len_byte += this_len_byte; - if (!SINGLE_BYTE_CHAR_P (XINT (ch))) + if (! ASCII_CHAR_P (XINT (ch)) && ! CHAR_BYTE8_P (XINT (ch))) some_multibyte = 1; } else if (BOOL_VECTOR_P (this) && XBOOL_VECTOR (this)->size > 0) diff --cc src/regex.c index 2eca58c23e8,c0dd6e00ffc..b97ee7943fd --- a/src/regex.c +++ b/src/regex.c @@@ -1992,15 -1967,18 +1992,15 @@@ struct range_table_work_are #define BIT_UPPER 0x10 #define BIT_MULTIBYTE 0x20 -/* Set a range START..END to WORK_AREA. - The range is passed through TRANSLATE, so START and END - should be untranslated. */ -#define SET_RANGE_TABLE_WORK_AREA(work_area, start, end) \ +/* Set a range (RANGE_START, RANGE_END) to WORK_AREA. */ +#define SET_RANGE_TABLE_WORK_AREA(work_area, range_start, range_end) \ do { \ - int tem; \ - tem = set_image_of_range (&work_area, start, end, translate); \ - if (tem > 0) \ - FREE_STACK_RETURN (tem); \ + EXTEND_RANGE_TABLE ((work_area), 2); \ + (work_area).table[(work_area).used++] = (range_start); \ + (work_area).table[(work_area).used++] = (range_end); \ } while (0) - /* Free allocated memory for WORK_AREA. */ + /* Free allocated memory for WORK_AREA. */ #define FREE_RANGE_TABLE_WORK_AREA(work_area) \ do { \ if ((work_area).table) \ @@@ -4445,31 -4389,29 +4445,31 @@@ re_search_2 (bufp, str1, size1, str2, s d++; range--; } -#ifdef emacs - if (multibyte && range > lim) + } + else + { + if (multibyte) + while (range > lim) { - /* Check that we are at the beginning of a char. */ - int at_boundary; - AT_CHAR_BOUNDARY_P (at_boundary, d, d_start); - if (at_boundary) + int buf_charlen; + + buf_ch = STRING_CHAR_AND_LENGTH (d, range - lim, + buf_charlen); + if (fastmap[CHAR_LEADING_CODE (buf_ch)]) break; - else - { /* We have matched an internal byte of a char - rather than the leading byte, so it's a false - positive: we should keep scanning. */ - d++; range--; - } + range -= buf_charlen; + d += buf_charlen; } - else -#endif - break; - } while (1); - + else + while (range > lim && !fastmap[*d]) + { + d++; + range--; + } + } startpos += irange - range; } - else /* Searching backwards. */ + else /* Searching backwards. */ { int room = (startpos >= size1 ? size2 + size1 - startpos @@@ -4992,26 -4927,8 +4992,26 @@@ re_match_2 (bufp, string1, size1, strin } WEAK_ALIAS (__re_match_2, re_match_2) +#ifdef emacs +#define TRANSLATE_VIA_MULTIBYTE(c) \ + do { \ + if (multibyte) \ + (c) = TRANSLATE (c); \ + else \ + { \ + MAKE_CHAR_MULTIBYTE (c); \ + (c) = TRANSLATE (c); \ + MAKE_CHAR_UNIBYTE (c); \ + } \ + } while (0) + +#else +#define TRANSLATE_VIA_MULTIBYTE(c) ((c) = TRANSLATE (c)) +#endif + + /* This is a separate function so that we can force an alloca cleanup - afterwards. */ + afterwards. */ static int re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) struct re_pattern_buffer *bufp;