Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 100789. ------------------------------------------------------------ revno: 100789 [merge] committer: Kenichi Handa branch nick: trunk timestamp: Mon 2010-07-12 14:26:57 +0900 message: Improve Hebrew rendering. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-07-11 22:14:53 +0000 +++ lisp/ChangeLog 2010-07-12 05:25:46 +0000 @@ -1,3 +1,11 @@ +2010-07-12 Kenichi Handa + + * language/hebrew.el: Remove no-byte-compile declaration. Change + coding: tag to utf-8. Register hebrew-shape-gstring in + composition-function-table for 3-character looking back. + (hebrew-font-get-precomposed): New function. + (hebrew-shape-gstring): Utilize precomposed glyphs if available. + 2010-07-11 Chong Yidong * mouse.el (mouse-drag-track): Handle select-active-regions === modified file 'lisp/language/hebrew.el' --- lisp/language/hebrew.el 2010-05-27 04:24:30 +0000 +++ lisp/language/hebrew.el 2010-07-12 05:25:46 +0000 @@ -1,4 +1,4 @@ -;;; hebrew.el --- support for Hebrew -*- coding: iso-2022-7bit; no-byte-compile: t -*- +;;; hebrew.el --- support for Hebrew -*- coding: utf-8 -*- ;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 ;; Free Software Foundation, Inc. @@ -59,7 +59,7 @@ (nonascii-translation . iso-8859-8) (input-method . "hebrew") (unibyte-display . hebrew-iso-8bit) - (sample-text . "Hebrew ,Hylem(B") + (sample-text . "Hebrew שלום") (documentation . "Bidirectional editing is supported."))) (set-language-info-alist @@ -85,33 +85,167 @@ :mime-charset 'cp862) (define-coding-system-alias 'ibm862 'cp862) -;; Composition function for hebrew. +;; Return a nested alist of Hebrew character sequences vs the +;; corresponding glyph of FONT-OBJECT. +(defun hebrew-font-get-precomposed (font-object) + (let ((precomposed (font-get font-object 'hebrew-precomposed)) + ;; Vector of Hebrew precomposed charaters. + (chars [#xFB2A #xFB2B #xFB2C #xFB2D #xFB2E #xFB2F #xFB30 #xFB31 + #xFB32 #xFB33 #xFB34 #xFB35 #xFB36 #xFB38 #xFB39 #xFB3A + #xFB3B #xFB3C #xFB3E #xFB40 #xFB41 #xFB43 #xFB44 #xFB46 + #xFB47 #xFB48 #xFB49 #xFB4A #xFB4B #xFB4C #xFB4D #xFB4E]) + ;; Vector of decomposition character sequences corresponding + ;; to the above vector. + (decomposed + [[#x05E9 #x05C1] + [#x05E9 #x05C2] + [#x05E9 #x05BC #x05C1] + [#x05E9 #x05BC #x05C2] + [#x05D0 #x05B7] + [#x05D0 #x05B8] + [#x05D0 #x05BC] + [#x05D1 #x05BC] + [#x05D2 #x05BC] + [#x05D3 #x05BC] + [#x05D4 #x05BC] + [#x05D5 #x05BC] + [#x05D6 #x05BC] + [#x05D8 #x05BC] + [#x05D9 #x05BC] + [#x05DA #x05BC] + [#x05DB #x05BC] + [#x05DC #x05BC] + [#x05DE #x05BC] + [#x05E0 #x05BC] + [#x05E1 #x05BC] + [#x05E3 #x05BC] + [#x05E4 #x05BC] + [#x05E6 #x05BC] + [#x05E7 #x05BC] + [#x05E8 #x05BC] + [#x05E9 #x05BC] + [#x05EA #x05BC] + [#x05D5 #x05B9] + [#x05D1 #x05BF] + [#x05DB #x05BF] + [#x05E4 #x05BF]])) + (unless precomposed + (setq precomposed (list t)) + (let ((gvec (font-get-glyphs font-object 0 (length chars) chars))) + (dotimes (i (length chars)) + (if (aref gvec i) + (set-nested-alist (aref decomposed i) (aref gvec i) + precomposed)))) + ;; Cache the result in FONT-OBJECT's property. + (font-put font-object 'hebrew-precomposed precomposed)) + precomposed)) + +;; Composition function for hebrew. GSTRING is made of a Hebrew base +;; character followed by Hebrew diacritical marks, or is made of +;; single Hebrew diacritical mark. Adjust GSTRING to display that +;; sequence properly. The basic strategy is: +;; +;; (1) If there's single diacritical, add padding space to the left +;; and right of the glyph. +;; +;; (2) If the font has OpenType features for Hebrew, ask the OTF +;; driver the whole work. +;; +;; (3) If the font has precomposed glyphs, use them as far as +;; possible. Adjust the remaining glyphs artificially. + (defun hebrew-shape-gstring (gstring) - (setq gstring (font-shape-gstring gstring)) - (let ((header (lgstring-header gstring)) - (nchars (lgstring-char-len gstring)) - (nglyphs (lgstring-glyph-len gstring)) - (base-width (lglyph-width (lgstring-glyph gstring 0)))) - (while (and (> nglyphs 1) - (not (lgstring-glyph gstring (1- nglyphs)))) - (setq nglyphs (1- nglyphs))) - (while (> nglyphs 1) - (setq nglyphs (1- nglyphs)) - (let* ((glyph (lgstring-glyph gstring nglyphs)) - (adjust (and glyph (lglyph-adjustment glyph)))) - (if adjust - (setq nglyphs 0) - (if (>= (lglyph-lbearing glyph) 0) - (lglyph-set-adjustment glyph (- base-width) 0 0)))))) - gstring) + (let* ((font (lgstring-font gstring)) + (otf (font-get font :otf)) + (nchars (lgstring-char-len gstring)) + header nglyphs base-width glyph precomposed val idx) + (cond + ((= nchars 1) + ;; Independent diacritical mark. Add padding space to left or + ;; right so that the glyph doesn't overlap with the surrounding + ;; chars. + (setq glyph (lgstring-glyph gstring 0)) + (let ((width (lglyph-width glyph)) + bearing) + (if (< (setq bearing (lglyph-lbearing glyph)) 0) + (lglyph-set-adjustment glyph bearing 0 (- width bearing))) + (if (> (setq bearing (lglyph-rbearing glyph)) width) + (lglyph-set-adjustment glyph 0 0 bearing)))) + + ((or (assq 'hebr (car otf)) (assq 'hebr (cdr otf))) + ;; FONT has OpenType features for Hebrew. + (font-shape-gstring gstring)) + + (t + ;; FONT doesn't have OpenType features for Hebrew. + ;; Try a precomposed glyph. + ;; Now GSTRING is in this form: + ;; [[FONT CHAR1 CHAR2 ... CHARn] nil GLYPH1 GLYPH2 ... GLYPHn nil ...] + (setq precomposed (hebrew-font-get-precomposed font) + header (lgstring-header gstring) + val (lookup-nested-alist header precomposed nil 1)) + (if (and (consp val) (vectorp (car val))) + ;; All characters can be displayed by a single precomposed glyph. + ;; Reform GSTRING to [HEADER nil PRECOMPOSED-GLYPH nil ...] + (let ((glyph (copy-sequence (car val)))) + (lglyph-set-from-to glyph 0 (1- nchars)) + (lgstring-set-glyph gstring 0 glyph) + (lgstring-set-glyph gstring 1 nil)) + (if (and (integerp val) (> val 2) + (setq glyph (lookup-nested-alist header precomposed val 1)) + (consp glyph) (vectorp (car glyph))) + ;; The first (1- VAL) characters can be displayed by a + ;; precomposed glyph. Provided that VAL is 3, the first + ;; two glyphs should be replaced by the precomposed glyph. + ;; In that case, reform GSTRING to: + ;; [HEADER nil PRECOMPOSED-GLYPH GLYPH3 ... GLYPHn nil ...] + (let* ((ncmp (1- val)) ; number of composed glyphs + (diff (1- ncmp))) ; number of reduced glyphs + (setq glyph (copy-sequence (car glyph))) + (lglyph-set-from-to glyph 0 (1- nchars)) + (lgstring-set-glyph gstring 0 glyph) + (setq idx ncmp) + (while (< idx nchars) + (setq glyph (lgstring-glyph gstring idx)) + (lglyph-set-from-to glyph 0 (1- nchars)) + (lgstring-set-glyph gstring (- idx diff) glyph) + (setq idx (1+ idx))) + (lgstring-set-glyph gstring (- idx diff) nil) + (setq idx (- ncmp diff) + nglyphs (- nchars diff))) + (setq glyph (lgstring-glyph gstring 0)) + (lglyph-set-from-to glyph 0 (1- nchars)) + (setq idx 1 nglyphs nchars)) + ;; Now IDX is an index to the first non-precomposed glyph. + ;; Adjust positions of the remaining glyphs artificially. + (setq base-width (lglyph-width (lgstring-glyph gstring 0))) + (while (< idx nglyphs) + (setq glyph (lgstring-glyph gstring idx)) + (lglyph-set-from-to glyph 0 (1- nchars)) + (if (>= (lglyph-lbearing glyph) (lglyph-width glyph)) + ;; It seems that this glyph is designed to be rendered + ;; before the base glyph. + (lglyph-set-adjustment glyph (- base-width) 0 0) + (if (>= (lglyph-lbearing glyph) 0) + ;; Align the horizontal center of this glyph to the + ;; horizontal center of the base glyph. + (let ((width (- (lglyph-rbearing glyph) + (lglyph-lbearing glyph)))) + (lglyph-set-adjustment glyph + (- (/ (- base-width width) 2) + (lglyph-lbearing glyph) + base-width) 0 0)))) + (setq idx (1+ idx)))))) + gstring)) (let ((pattern1 "[\u05D0-\u05F2][\u0591-\u05BF\u05C1-\u05C5\u05C7]+") (pattern2 "[\u05D0-\u05F2]\u200D[\u0591-\u05BF\u05C1-\u05C5\u05C7]+")) (set-char-table-range composition-function-table '(#x591 . #x5C7) - (list (vector pattern2 2 'hebrew-shape-gstring) + (list (vector pattern2 3 'hebrew-shape-gstring) + (vector pattern2 2 'hebrew-shape-gstring) (vector pattern1 1 'hebrew-shape-gstring) - ["[\u0591-\u05C7]" 0 font-shape-gstring])) + [nil 0 hebrew-shape-gstring])) (set-char-table-range composition-function-table #x5C0 nil) (set-char-table-range === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-12 02:28:50 +0000 +++ src/ChangeLog 2010-07-12 05:25:46 +0000 @@ -1,5 +1,8 @@ 2010-07-12 Kenichi Handa + * Makefile.in (lisp): Change hebrew.el to hebrew.elc. + (shortlisp): Likewise. + * font.h (enum font_property_index): New member FONT_ENTITY_INDEX. * font.c (font_open_entity): Record ENTITY in FONT_OBJECT's slot === modified file 'src/Makefile.in' --- src/Makefile.in 2010-07-08 03:31:04 +0000 +++ src/Makefile.in 2010-07-12 05:25:46 +0000 @@ -426,7 +426,7 @@ ${lispsource}language/slovak.el \ ${lispsource}language/romanian.el \ ${lispsource}language/greek.el \ - ${lispsource}language/hebrew.el \ + ${lispsource}language/hebrew.elc \ ${lispsource}language/japanese.el \ ${lispsource}language/korean.el \ ${lispsource}language/lao.el \ @@ -517,7 +517,7 @@ ../lisp/language/slovak.el \ ../lisp/language/romanian.el \ ../lisp/language/greek.el \ - ../lisp/language/hebrew.el \ + ../lisp/language/hebrew.elc \ ../lisp/language/japanese.el \ ../lisp/language/korean.el \ ../lisp/language/lao.el \ ------------------------------------------------------------ revno: 100788 [merge] committer: Kenichi Handa branch nick: trunk timestamp: Mon 2010-07-12 11:31:36 +0900 message: Make font-get to get :otf value dynamically from a font-object. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-11 19:51:46 +0000 +++ src/ChangeLog 2010-07-12 02:28:50 +0000 @@ -1,3 +1,16 @@ +2010-07-12 Kenichi Handa + + * font.h (enum font_property_index): New member FONT_ENTITY_INDEX. + + * font.c (font_open_entity): Record ENTITY in FONT_OBJECT's slot + of FONT_ENTITY_INDEX. + (Ffont_get): If KEY is :otf and the font-object doesn't have the + property, get the property value dynamically. + (Ffont_put): Accept font-entity and font-object too. + (Ffont_get_glyhphs): Renamed from Fget_font_glyphs. Arguments and + return value changed. + (syms_of_font): Adjusted for the above change. + 2010-07-11 Andreas Schwab * blockinput.h: Remove obsolete comment. === modified file 'src/font.c' --- src/font.c 2010-07-11 10:31:10 +0000 +++ src/font.c 2010-07-12 02:28:50 +0000 @@ -3005,7 +3005,7 @@ return Qnil; ASET (entity, FONT_OBJLIST_INDEX, Fcons (font_object, AREF (entity, FONT_OBJLIST_INDEX))); - ASET (font_object, FONT_OBJLIST_INDEX, Qnil); + ASET (font_object, FONT_ENTITY_INDEX, entity); num_fonts++; font = XFONT_OBJECT (font_object); @@ -4100,15 +4100,24 @@ DEFUN ("font-get", Ffont_get, Sfont_get, 2, 2, 0, doc: /* Return the value of FONT's property KEY. FONT is a font-spec, a font-entity, or a font-object. -KEY must be one of these symbols: +KEY is any symbol, but these are reserved for specific meanings: :family, :weight, :slant, :width, :foundry, :adstyle, :registry, - :size, :name, :script + :size, :name, :script, :otf See the documentation of `font-spec' for their meanings. -If FONT is a font-entity or font-object, the value of :script may be -a list of scripts that are supported by the font. */) +In addition, if FONT is a font-entity or a font-object, values of +:script and :otf are different from those of a font-spec as below: + +The value of :script may be a list of scripts that are supported by the font. + +The value of :otf is a cons (GSUB . GPOS) where GSUB and GPOS are lists +representing the OpenType features supported by the font by this form: + ((SCRIPT (LANGSYS FEATURE ...) ...) ...) +SCRIPT, LANGSYS, and FEATURE are all symbols representing OpenType +Layout tags. */) (Lisp_Object font, Lisp_Object key) { int idx; + Lisp_Object val; CHECK_FONT (font); CHECK_SYMBOL (key); @@ -4118,7 +4127,28 @@ return font_style_symbolic (font, idx, 0); if (idx >= 0 && idx < FONT_EXTRA_INDEX) return AREF (font, idx); - return Fcdr (Fassq (key, AREF (font, FONT_EXTRA_INDEX))); + val = Fassq (key, AREF (font, FONT_EXTRA_INDEX)); + if (NILP (val) && EQ (key, QCotf) && FONT_OBJECT_P (font)) + { + struct font *fontp = XFONT_OBJECT (font); + Lisp_Object entity = AREF (font, FONT_ENTITY_INDEX); + + val = Fassq (key, AREF (entity, FONT_EXTRA_INDEX)); + if (NILP (val)) + { + if (fontp->driver->otf_capability) + val = fontp->driver->otf_capability (fontp); + else + val = Fcons (Qnil, Qnil); + font_put_extra (font, QCotf, val); + font_put_extra (entity, QCotf, val); + } + else + val = Fcdr (val); + } + else + val = Fcdr (val); + return val; } #ifdef HAVE_WINDOW_SYSTEM @@ -4209,17 +4239,36 @@ #endif DEFUN ("font-put", Ffont_put, Sfont_put, 3, 3, 0, - doc: /* Set one property of FONT-SPEC: give property PROP value VAL. */) - (Lisp_Object font_spec, Lisp_Object prop, Lisp_Object val) + doc: /* Set one property of FONT: give property KEY value VAL. +FONT is a font-spec, a font-entity, or a font-object. + +If FONT is a font-spec, KEY can be any symbol. But if KEY is the one +accepted by the function `font-spec' (which see), VAL must be what +allowed in `font-spec'. + +If FONT is a font-entity or a font-object, KEY must not be the one +accepted by `font-spec'. */) + (Lisp_Object font, Lisp_Object prop, Lisp_Object val) { int idx; - CHECK_FONT_SPEC (font_spec); idx = get_font_prop_index (prop); if (idx >= 0 && idx < FONT_EXTRA_INDEX) - ASET (font_spec, idx, font_prop_validate (idx, Qnil, val)); + { + CHECK_FONT_SPEC (font); + ASET (font, idx, font_prop_validate (idx, Qnil, val)); + } else - font_put_extra (font_spec, prop, font_prop_validate (0, prop, val)); + { + if (EQ (prop, QCname) + || EQ (prop, QCscript) + || EQ (prop, QClang) + || EQ (prop, QCotf)) + CHECK_FONT_SPEC (font); + else + CHECK_FONT (font); + font_put_extra (font, prop, font_prop_validate (0, prop, val)); + } return val; } @@ -4758,24 +4807,99 @@ return val; } -DEFUN ("get-font-glyphs", Fget_font_glyphs, Sget_font_glyphs, 2, 2, 0, - doc: /* Return a vector of glyphs of FONT-OBJECT for drawing STRING. -Each element is a vector [GLYPH-CODE LBEARING RBEARING WIDTH ASCENT DESCENT]. */) - (Lisp_Object font_object, Lisp_Object string) +DEFUN ("font-get-glyphs", Ffont_get_glyphs, Sfont_get_glyphs, 3, 4, 0, + doc: + /* Return a vector of FONT-OBJECT's glyphs for the specified characters. +FROM and TO are positions (integers or markers) specifying a region +of the current buffer. +If the optional fourth arg OBJECT is not nil, it is a string or a +vector containing the target characters. + +Each element is a vector containing information of a glyph in this format: + [FROM-IDX TO-IDX C CODE WIDTH LBEARING RBEARING ASCENT DESCENT ADJUSTMENT] +where + FROM is an index numbers of a character the glyph corresponds to. + TO is the same as FROM. + C is the character of the glyph. + CODE is the glyph-code of C in FONT-OBJECT. + WIDTH thru DESCENT are the metrics (in pixels) of the glyph. + ADJUSTMENT is always nil. +If FONT-OBJECT doesn't have a glyph for a character, +the corresponding element is nil. */) + (Lisp_Object font_object, Lisp_Object from, Lisp_Object to, + Lisp_Object object) { struct font *font; - int i, len; - Lisp_Object vec; + int i, len, c; + Lisp_Object *chars, vec; + USE_SAFE_ALLOCA; CHECK_FONT_GET_OBJECT (font_object, font); - CHECK_STRING (string); - len = SCHARS (string); + if (NILP (object)) + { + EMACS_INT charpos, bytepos; + + validate_region (&from, &to); + if (EQ (from, to)) + return Qnil; + len = XFASTINT (to) - XFASTINT (from); + SAFE_ALLOCA_LISP (chars, len); + charpos = XFASTINT (from); + bytepos = CHAR_TO_BYTE (charpos); + for (i = 0; charpos < XFASTINT (to); i++) + { + FETCH_CHAR_ADVANCE (c, charpos, bytepos); + chars[i] = make_number (c); + } + } + else if (STRINGP (object)) + { + const unsigned char *p; + + CHECK_NUMBER (from); + CHECK_NUMBER (to); + if (XINT (from) < 0 || XINT (from) > XINT (to) + || XINT (to) > SCHARS (object)) + args_out_of_range_3 (object, from, to); + if (EQ (from, to)) + return Qnil; + len = XFASTINT (to) - XFASTINT (from); + SAFE_ALLOCA_LISP (chars, len); + p = SDATA (object); + if (STRING_MULTIBYTE (object)) + for (i = 0; i < len; i++) + { + c = STRING_CHAR_ADVANCE (p); + chars[i] = make_number (c); + } + else + for (i = 0; i < len; i++) + chars[i] = make_number (p[i]); + } + else + { + CHECK_VECTOR (object); + CHECK_NUMBER (from); + CHECK_NUMBER (to); + if (XINT (from) < 0 || XINT (from) > XINT (to) + || XINT (to) > ASIZE (object)) + args_out_of_range_3 (object, from, to); + if (EQ (from, to)) + return Qnil; + len = XFASTINT (to) - XFASTINT (from); + for (i = 0; i < len; i++) + { + Lisp_Object elt = AREF (object, XFASTINT (from) + i); + CHECK_CHARACTER (elt); + } + chars = &(AREF (object, XFASTINT (from))); + } + vec = Fmake_vector (make_number (len), Qnil); for (i = 0; i < len; i++) { - Lisp_Object ch = Faref (string, make_number (i)); - Lisp_Object val; - int c = XINT (ch); + Lisp_Object g; + int c = XFASTINT (chars[i]); unsigned code; EMACS_INT cod; struct font_metrics metrics; @@ -4783,20 +4907,21 @@ cod = code = font->driver->encode_char (font, c); if (code == FONT_INVALID_CODE) continue; - val = Fmake_vector (make_number (6), Qnil); - if (cod <= MOST_POSITIVE_FIXNUM) - ASET (val, 0, make_number (code)); - else - ASET (val, 0, Fcons (make_number (code >> 16), - make_number (code & 0xFFFF))); + g = Fmake_vector (make_number (LGLYPH_SIZE), Qnil); + LGLYPH_SET_FROM (g, i); + LGLYPH_SET_TO (g, i); + LGLYPH_SET_CHAR (g, c); + LGLYPH_SET_CODE (g, code); font->driver->text_extents (font, &code, 1, &metrics); - ASET (val, 1, make_number (metrics.lbearing)); - ASET (val, 2, make_number (metrics.rbearing)); - ASET (val, 3, make_number (metrics.width)); - ASET (val, 4, make_number (metrics.ascent)); - ASET (val, 5, make_number (metrics.descent)); - ASET (vec, i, val); + LGLYPH_SET_WIDTH (g, metrics.width); + LGLYPH_SET_LBEARING (g, metrics.lbearing); + LGLYPH_SET_RBEARING (g, metrics.rbearing); + LGLYPH_SET_ASCENT (g, metrics.ascent); + LGLYPH_SET_DESCENT (g, metrics.descent); + ASET (vec, i, g); } + if (! VECTORP (object)) + SAFE_FREE (); return vec; } @@ -5188,7 +5313,7 @@ defsubr (&Sopen_font); defsubr (&Sclose_font); defsubr (&Squery_font); - defsubr (&Sget_font_glyphs); + defsubr (&Sfont_get_glyphs); defsubr (&Sfont_match_p); defsubr (&Sfont_at); #if 0 === modified file 'src/font.h' --- src/font.h 2010-07-02 09:26:33 +0000 +++ src/font.h 2010-07-08 08:09:35 +0000 @@ -159,14 +159,19 @@ /* This value is the length of font-spec vector. */ FONT_SPEC_MAX, - /* The followings are used only for a font-entity. */ + /* The followings are used only for a font-entity and a font-object. */ /* List of font-objects opened from the font-entity. */ FONT_OBJLIST_INDEX = FONT_SPEC_MAX, + /* Font-entity from which the font-object is opened. */ + FONT_ENTITY_INDEX = FONT_SPEC_MAX, + /* This value is the length of font-entity vector. */ FONT_ENTITY_MAX, + /* The followings are used only for a font-object. */ + /* XLFD name of the font (string). */ FONT_NAME_INDEX = FONT_ENTITY_MAX, ------------------------------------------------------------ revno: 100787 committer: Chong Yidong branch nick: trunk timestamp: Sun 2010-07-11 18:14:53 -0400 message: * mouse.el (mouse-drag-track): Handle select-active-regions (Bug#6612). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-07-11 08:28:04 +0000 +++ lisp/ChangeLog 2010-07-11 22:14:53 +0000 @@ -1,3 +1,8 @@ +2010-07-11 Chong Yidong + + * mouse.el (mouse-drag-track): Handle select-active-regions + (Bug#6612). + 2010-07-11 Magnus Henoch * net/tramp-gvfs.el (tramp-gvfs-handle-copy-file): Do not pass === modified file 'lisp/mouse.el' --- lisp/mouse.el 2010-07-10 18:52:53 +0000 +++ lisp/mouse.el 2010-07-11 22:14:53 +0000 @@ -956,9 +956,12 @@ (if (eq transient-mark-mode 'lambda) '(only) (cons 'only transient-mark-mode))) - (let ((range (mouse-start-end start-point start-point click-count))) + (let ((range (mouse-start-end start-point start-point click-count)) + ;; Prevent `push-mark' from clobbering the primary selection + ;; if the user clicks without dragging. + (select-active-regions nil)) (goto-char (nth 0 range)) - (push-mark nil nil t) + (push-mark nil t t) (goto-char (nth 1 range))) ;; Track the mouse until we get a non-movement event. @@ -1012,6 +1015,7 @@ mouse-set-region)))))) (if (and (/= (mark) (point)) (not do-multi-click)) + ;; If point has moved, finish the drag. (let* (last-command this-command) ;; Copy the region so that `select-active-regions' can @@ -1019,12 +1023,20 @@ (and mouse-drag-copy-region do-mouse-drag-region-post-process (let (deactivate-mark) - (copy-region-as-kill (mark) (point))))) + (copy-region-as-kill (mark) (point)))) + ;; For `select-active-regions' non-nil, ensure that + ;; further alterations of the region (e.g. via + ;; shift-selection) continue to update PRIMARY. + (and select-active-regions + (display-selections-p) + (x-set-selection 'PRIMARY (current-buffer)))) + ;; If point hasn't moved, run the binding of the ;; terminating up-event. (if do-multi-click (goto-char start-point) - (deactivate-mark)) + (let (select-active-regions) + (deactivate-mark))) (when (and (functionp fun) (= start-hscroll (window-hscroll start-window)) ;; Don't run the up-event handler if the window ------------------------------------------------------------ revno: 100786 committer: Andreas Schwab branch nick: trunk timestamp: Sun 2010-07-11 21:51:46 +0200 message: * blockinput.h: Remove obsolete comment. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-11 18:34:43 +0000 +++ src/ChangeLog 2010-07-11 19:51:46 +0000 @@ -1,5 +1,7 @@ 2010-07-11 Andreas Schwab + * blockinput.h: Remove obsolete comment. + * lisp.h: Include . (OFFSETOF): Don't define. (VECSIZE): Use offsetof instead of OFFSETOF. === modified file 'src/blockinput.h' --- src/blockinput.h 2010-07-02 22:18:28 +0000 +++ src/blockinput.h 2010-07-11 19:51:46 +0000 @@ -122,7 +122,6 @@ #define INPUT_BLOCKED_P (interrupt_input_blocked > 0) /* Defined in keyboard.c */ -/* Don't use a prototype here; it causes trouble in some files. */ extern void reinvoke_input_signal (void); #endif /* EMACS_BLOCKINPUT_H */ ------------------------------------------------------------ revno: 100785 committer: Andreas Schwab branch nick: emacs timestamp: Sun 2010-07-11 20:34:43 +0200 message: Use offsetof instead of own definition * lisp.h: Include . (OFFSETOF): Don't define. (VECSIZE): Use offsetof instead of OFFSETOF. (PSEUDOVECSIZE): Likewise. * process.c (conv_sockaddr_to_lisp): Likewise. * alloc.c: Don't include . * buffer.h (PER_BUFFER_VAR_OFFSET): Use offsetof. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-11 18:19:16 +0000 +++ src/ChangeLog 2010-07-11 18:34:43 +0000 @@ -1,5 +1,13 @@ 2010-07-11 Andreas Schwab + * lisp.h: Include . + (OFFSETOF): Don't define. + (VECSIZE): Use offsetof instead of OFFSETOF. + (PSEUDOVECSIZE): Likewise. + * process.c (conv_sockaddr_to_lisp): Likewise. + * alloc.c: Don't include . + * buffer.h (PER_BUFFER_VAR_OFFSET): Use offsetof. + * process.c: Remove obsolete comment. 2010-07-11 Chong Yidong === modified file 'src/alloc.c' --- src/alloc.c 2010-07-11 09:27:13 +0000 +++ src/alloc.c 2010-07-11 18:34:43 +0000 @@ -23,10 +23,6 @@ #include /* For CHAR_BIT. */ #include -#ifdef STDC_HEADERS -#include /* For offsetof, used by PSEUDOVECSIZE. */ -#endif - #ifdef ALLOC_DEBUG #undef INLINE #endif === modified file 'src/buffer.h' --- src/buffer.h 2010-07-02 09:26:33 +0000 +++ src/buffer.h 2010-07-11 18:34:43 +0000 @@ -954,7 +954,7 @@ from the start of a buffer structure. */ #define PER_BUFFER_VAR_OFFSET(VAR) \ - ((char *) &((struct buffer *)0)->VAR - (char *) ((struct buffer *)0)) + offsetof (struct buffer, VAR) /* Return the index of buffer-local variable VAR. Each per-buffer variable has an index > 0 associated with it, except when it always === modified file 'src/lisp.h' --- src/lisp.h 2010-07-11 09:27:13 +0000 +++ src/lisp.h 2010-07-11 18:34:43 +0000 @@ -22,6 +22,7 @@ #define EMACS_LISP_H #include +#include /* Use the configure flag --enable-checking[=LIST] to enable various types of run time checks for Lisp objects. */ @@ -784,13 +785,6 @@ unsigned char *data; }; -#ifdef offsetof -#define OFFSETOF(type,field) offsetof(type,field) -#else -#define OFFSETOF(type,field) \ - ((int)((char*)&((type*)0)->field - (char*)0)) -#endif - struct Lisp_Vector { EMACS_UINT size; @@ -801,7 +795,7 @@ /* If a struct is made to look like a vector, this macro returns the length of the shortest vector that would hold that struct. */ #define VECSIZE(type) ((sizeof (type) \ - - OFFSETOF (struct Lisp_Vector, contents[0]) \ + - offsetof (struct Lisp_Vector, contents[0]) \ + sizeof(Lisp_Object) - 1) /* round up */ \ / sizeof (Lisp_Object)) @@ -809,7 +803,7 @@ at the end and we need to compute the number of Lisp_Object fields (the ones that the GC needs to trace). */ #define PSEUDOVECSIZE(type, nonlispfield) \ - ((OFFSETOF(type, nonlispfield) - OFFSETOF(struct Lisp_Vector, contents[0])) \ + ((offsetof(type, nonlispfield) - offsetof(struct Lisp_Vector, contents[0])) \ / sizeof (Lisp_Object)) /* A char-table is a kind of vectorlike, with contents are like a === modified file 'src/process.c' --- src/process.c 2010-07-11 18:19:16 +0000 +++ src/process.c 2010-07-11 18:34:43 +0000 @@ -2263,7 +2263,7 @@ /* Workaround for a bug in getsockname on BSD: Names bound to sockets in the UNIX domain are inaccessible; getsockname returns a zero length name. */ - if (len < OFFSETOF (struct sockaddr, sa_family) + sizeof (sa->sa_family)) + if (len < offsetof (struct sockaddr, sa_family) + sizeof (sa->sa_family)) return empty_unibyte_string; switch (sa->sa_family) @@ -2303,7 +2303,7 @@ } #endif default: - len -= OFFSETOF (struct sockaddr, sa_family) + sizeof (sa->sa_family); + len -= offsetof (struct sockaddr, sa_family) + sizeof (sa->sa_family); address = Fcons (make_number (sa->sa_family), Fmake_vector (make_number (len), Qnil)); p = XVECTOR (XCDR (address)); ------------------------------------------------------------ revno: 100784 committer: Andreas Schwab branch nick: emacs timestamp: Sun 2010-07-11 20:19:16 +0200 message: * process.c: Remove obsolete comment. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-11 16:07:38 +0000 +++ src/ChangeLog 2010-07-11 18:19:16 +0000 @@ -1,3 +1,7 @@ +2010-07-11 Andreas Schwab + + * process.c: Remove obsolete comment. + 2010-07-11 Chong Yidong * xfaces.c (Vface_remapping_alist): Doc fix (Bug#6091). === modified file 'src/process.c' --- src/process.c 2010-07-11 05:55:06 +0000 +++ src/process.c 2010-07-11 18:19:16 +0000 @@ -21,15 +21,6 @@ #include #include - -/* This file is split into two parts by the following preprocessor - conditional. The 'then' clause contains all of the support for - asynchronous subprocesses. The 'else' clause contains stub - versions of some of the asynchronous subprocess routines that are - often called elsewhere in Emacs, so we don't have to #ifdef the - sections that call them. */ - - #include #include #include ------------------------------------------------------------ revno: 100783 committer: Chong Yidong branch nick: trunk timestamp: Sun 2010-07-11 12:07:38 -0400 message: * src/xfaces.c (Vface_remapping_alist): Doc fix (Bug#6091). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-11 10:31:10 +0000 +++ src/ChangeLog 2010-07-11 16:07:38 +0000 @@ -1,3 +1,7 @@ +2010-07-11 Chong Yidong + + * xfaces.c (Vface_remapping_alist): Doc fix (Bug#6091). + 2010-07-11 Andreas Schwab * callint.c (Fcall_interactively): Use strchr, strrchr instead of === modified file 'src/xfaces.c' --- src/xfaces.c 2010-07-10 18:52:53 +0000 +++ src/xfaces.c 2010-07-11 16:07:38 +0000 @@ -6791,10 +6791,10 @@ (FACE REPLACEMENT...), which causes display of the face FACE to use REPLACEMENT... instead. -REPLACEMENT... is interpreted the same way the value of a `face' text -property is: it may be (1) A face name, (2) A list of face names, (3) A -property-list of face attribute/value pairs, or (4) A list of face names -intermixed with lists containing face attribute/value pairs. +REPLACEMENT... is interpreted the same way as the value of a `face' +text property: it may be (1) A face name, (2) A list of face names, +(3) A property-list of face attribute/value pairs, or (4) A list of +face names or lists containing face attribute/value pairs. Multiple entries in REPLACEMENT... are merged together to form the final result, with faces or attributes earlier in the list taking precedence @@ -6818,7 +6818,11 @@ `my-mode-default', and then in the mode setup function, do: (set (make-local-variable 'face-remapping-alist) - '((default my-mode-default)))). */); + '((default my-mode-default)))). + +Because Emacs normally only redraws screen areas when the underlying +buffer contents change, you may need to call `redraw-display' after +changing this variable for it to take effect. */); Vface_remapping_alist = Qnil; DEFVAR_LISP ("face-font-rescale-alist", &Vface_font_rescale_alist, ------------------------------------------------------------ revno: 100782 [merge] committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2010-07-11 16:45:42 +0300 message: Remove redundant definitions of HAVE_STRCHR and HAVE_STRRCHR for MS-DOS. sed2v2.inp (HAVE_STRCHR, HAVE_STRRCHR): Don't edit, already defined on . diff: === modified file 'msdos/ChangeLog' --- msdos/ChangeLog 2010-07-11 10:31:10 +0000 +++ msdos/ChangeLog 2010-07-11 13:43:10 +0000 @@ -1,3 +1,8 @@ +2010-07-11 Eli Zaretskii + + * sed2v2.inp (HAVE_STRCHR, HAVE_STRRCHR): Don't edit, already + defined on . + 2010-07-11 Andreas Schwab * sed2v2.inp (HAVE_INDEX, HAVE_RINDEX): Don't edit. === modified file 'msdos/sed2v2.inp' --- msdos/sed2v2.inp 2010-07-11 10:31:10 +0000 +++ msdos/sed2v2.inp 2010-07-11 13:43:10 +0000 @@ -46,9 +46,7 @@ /^#undef HAVE_TM_GMTOFF *$/s/^.*$/#define HAVE_TM_GMTOFF 1/ /^#undef HAVE_MBLEN *$/s/^.*$/#define HAVE_MBLEN 1/ /^#undef HAVE_STRUCT_TIMEZONE *$/s/^.*$/#define HAVE_STRUCT_TIMEZONE 1/ -/^#undef HAVE_STRCHR *$/s/^.*$/#define HAVE_STRCHR 1/ /^#undef HAVE_SIZE_T *$/s/^.*$/#define HAVE_SIZE_T 1/ -/^#undef HAVE_STRRCHR *$/s/^.*$/#define HAVE_STRRCHR 1/ /^#undef HAVE_MKSTEMP *$/s/^.*$/#define HAVE_MKSTEMP 1/ /^#undef HAVE_STRUCT_TM_TM_ZONE *$/s/^.*$/#define HAVE_STRUCT_TM_TM_ZONE 1/ /^#undef HAVE_SYNC *$/s/^.*$/#define HAVE_SYNC 1/ ------------------------------------------------------------ revno: 100781 committer: Andreas Schwab branch nick: emacs timestamp: Sun 2010-07-11 12:31:10 +0200 message: Use strchr, strrchr instead of index, rindex * callint.c (Fcall_interactively): Use strchr, strrchr instead of index, rindex. * doc.c (get_doc_string, Fsnarf_documentation): Likewise. * editfns.c (Fuser_full_name, Fformat): Likewise. * emacs.c (argmatch, sort_args, decode_env_path): Likewise. * fileio.c (Ffile_symlink_p): Likewise. * filelock.c (current_lock_owner): Likewise. * font.c (font_parse_name, font_parse_family_registry): Likewise. * fontset.c (fontset_pattern_regexp): Likewise. * lread.c (read1): Likewise. * sysdep.c (init_system_name): Likewise. * xfns.c (select_visual): Likewise. * s/hpux10-20.h (index, rindex): Don't define. * s/ms-w32.h (index): Likewise. * s/usg5-4.h: Likewise. * sed2v2.inp (HAVE_INDEX, HAVE_RINDEX): Don't edit. (HAVE_STRCHR, HAVE_STRRCHR): Edit to 1. * emacsclient.c (set_local_socket): Use strchr, strrchr instead of index, rindex. * movemail.c (mail_spool_name, popmail): Likewise. * pop.c (pop_list): Likewise. * CPP-DEFINES (HAVE_INDEX, HAVE_RINDEX): Remove. * configure.in: Don't check for index and rindex, check for strchr and strrchr. Define strchr and strrchr as index and rindex, resp., in src/config.h if not available. diff: === modified file 'ChangeLog' --- ChangeLog 2010-07-10 18:52:53 +0000 +++ ChangeLog 2010-07-11 10:31:10 +0000 @@ -1,3 +1,9 @@ +2010-07-11 Andreas Schwab + + * configure.in: Don't check for index and rindex, check for strchr + and strrchr. Define strchr and strrchr as index and rindex, + resp., in src/config.h if not available. + 2010-07-08 Dan Nicolaescu * configure.in: Use -Wold-style-definition if available. === modified file 'admin/CPP-DEFINES' --- admin/CPP-DEFINES 2010-07-08 03:03:52 +0000 +++ admin/CPP-DEFINES 2010-07-11 10:31:10 +0000 @@ -143,7 +143,6 @@ HAVE_GETTIMEOFDAY HAVE_GETWD HAVE_H_ERRNO -HAVE_INDEX HAVE_INET_SOCKETS HAVE_INVERSE_HYPERBOLIC HAVE_LIBKSTAT @@ -162,7 +161,6 @@ HAVE_RANDOM HAVE_RENAME HAVE_RES_INIT -HAVE_RINDEX HAVE_RINT HAVE_RMDIR HAVE_SELECT === modified file 'admin/ChangeLog' --- admin/ChangeLog 2010-07-08 18:04:31 +0000 +++ admin/ChangeLog 2010-07-11 10:31:10 +0000 @@ -1,3 +1,7 @@ +2010-07-11 Andreas Schwab + + * CPP-DEFINES (HAVE_INDEX, HAVE_RINDEX): Remove. + 2010-07-08 Eli Zaretskii * MAINTAINERS: Update my responsibilities. === modified file 'configure' --- configure 2010-07-08 23:34:47 +0000 +++ configure 2010-07-11 10:31:10 +0000 @@ -1,11 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for emacs 24.0.50. +# Generated by GNU Autoconf 2.66 for emacs 24.0.50. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -316,7 +316,7 @@ test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -356,19 +356,19 @@ fi # as_fn_arith -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -530,7 +530,7 @@ exec 6>&1 # Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` @@ -947,7 +947,7 @@ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -973,7 +973,7 @@ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1177,7 +1177,7 @@ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1193,7 +1193,7 @@ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1223,8 +1223,8 @@ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information." + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) @@ -1232,7 +1232,7 @@ # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1250,13 +1250,13 @@ if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error "missing argument to $ac_option" + as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; - fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1279,7 +1279,7 @@ [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -1293,8 +1293,8 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1309,9 +1309,9 @@ ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error "working directory cannot be determined" + as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error "pwd does not report name of working directory" + as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. @@ -1350,11 +1350,11 @@ fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then @@ -1394,7 +1394,7 @@ --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages + -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files @@ -1610,9 +1610,9 @@ if $ac_init_version; then cat <<\_ACEOF emacs configure 24.0.50 -generated by GNU Autoconf 2.65 +generated by GNU Autoconf 2.66 -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1752,10 +1752,10 @@ ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + if eval "test \"\${$3+set}\"" = set; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -1818,7 +1818,7 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -1882,7 +1882,7 @@ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1904,15 +1904,18 @@ } # ac_fn_c_check_header_compile -# ac_fn_c_check_decl LINENO SYMBOL VAR -# ------------------------------------ -# Tests whether SYMBOL is declared, setting cache variable VAR accordingly. +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5 -$as_echo_n "checking whether $2 is declared... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1921,8 +1924,12 @@ int main () { -#ifndef $2 - (void) $2; +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif #endif ; @@ -1951,7 +1958,7 @@ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1981,7 +1988,7 @@ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } -if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$4+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2037,7 +2044,7 @@ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2105,7 +2112,7 @@ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=no" @@ -2154,7 +2161,7 @@ running configure, to aid debugging if configure makes a mistake. It was created by emacs $as_me 24.0.50, which was -generated by GNU Autoconf 2.65. Invocation command line was +generated by GNU Autoconf 2.66. Invocation command line was $ $0 $@ @@ -2264,11 +2271,9 @@ { echo - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( @@ -2302,11 +2307,9 @@ ) echo - cat <<\_ASBOX -## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## -## ----------------- ## -_ASBOX +## ----------------- ##" echo for ac_var in $ac_subst_vars do @@ -2319,11 +2322,9 @@ echo if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## + $as_echo "## ------------------- ## ## File substitutions. ## -## ------------------- ## -_ASBOX +## ------------------- ##" echo for ac_var in $ac_subst_files do @@ -2337,11 +2338,9 @@ fi if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## -## ----------- ## -_ASBOX +## ----------- ##" echo cat confdefs.h echo @@ -2396,7 +2395,12 @@ ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site @@ -2411,7 +2415,11 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } fi done @@ -2492,7 +2500,7 @@ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -2666,7 +2674,7 @@ g | gt | gtk ) val=gtk ;; gtk3 ) val=gtk3 ;; * ) -as_fn_error "\`--with-x-toolkit=$withval' is invalid; +as_fn_error $? "\`--with-x-toolkit=$withval' is invalid; this option's value should be \`yes', \`no', \`lucid', \`athena', \`motif', \`gtk' or \`gtk3'. \`yes' and \`gtk' are synonyms. \`athena' and \`lucid' are synonyms." "$LINENO" 5 ;; @@ -2945,7 +2953,7 @@ stringfreelist) ac_gc_check_string_free_list=1 ;; xmallocoverrun) ac_xmalloc_overrun=1 ;; conslist) ac_gc_check_cons_list=1 ;; - *) as_fn_error "unknown check category $check" "$LINENO" 5 ;; + *) as_fn_error $? "unknown check category $check" "$LINENO" 5 ;; esac done IFS="$ac_save_IFS" @@ -3061,16 +3069,22 @@ ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - for ac_t in install-sh install.sh shtool; do - if test -f "$ac_dir/$ac_t"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/$ac_t -c" - break 2 - fi - done + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi done if test -z "$ac_aux_dir"; then - as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, @@ -3084,7 +3098,7 @@ # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } @@ -3095,16 +3109,16 @@ test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && - as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -3129,7 +3143,7 @@ ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi @@ -3137,7 +3151,7 @@ $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -3431,7 +3445,7 @@ if test $unported = yes; then - as_fn_error "Emacs hasn't been ported to \`${canonical}' systems. + as_fn_error $? "Emacs hasn't been ported to \`${canonical}' systems. Check \`etc/MACHINES' for recognized configuration names." "$LINENO" 5 fi @@ -3745,8 +3759,8 @@ test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "no acceptable C compiler found in \$PATH -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -3860,9 +3874,8 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "C compiler cannot create executables -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -3904,8 +3917,8 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -3962,9 +3975,9 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run C compiled programs. +as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details." "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5; } fi fi fi @@ -4015,8 +4028,8 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of object files: cannot compile -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi @@ -4435,8 +4448,8 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c @@ -4497,7 +4510,7 @@ done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then - as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP @@ -4563,7 +4576,7 @@ done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then - as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP @@ -4695,8 +4708,7 @@ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -4992,8 +5004,8 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c @@ -5430,7 +5442,7 @@ if test "x${with_makeinfo}" = "xno"; then MAKEINFO=off elif test ! -e $srcdir/info/emacs; then - as_fn_error "You do not seem to have makeinfo >= 4.6, and your + as_fn_error $? "You do not seem to have makeinfo >= 4.6, and your source tree does not seem to have pre-built manuals in the \`info' directory. Either install a suitable version of makeinfo, or re-run configure with the \`--without-makeinfo' option to build without the manuals. " "$LINENO" 5 @@ -5606,7 +5618,7 @@ if test "x$GCC" = "xyes"; then C_SWITCH_MACHINE="-fno-common" else - as_fn_error "What gives? Fix me if DEC Unix supports ELF now." "$LINENO" 5 + as_fn_error $? "What gives? Fix me if DEC Unix supports ELF now." "$LINENO" 5 fi else UNEXEC_OBJ=unexalpha.o @@ -5884,7 +5896,7 @@ ## Some platforms don't use any of these files, so it is not ## appropriate to put this test outside the if block. test -e $CRT_DIR/crtn.o || test -e $CRT_DIR/crt0.o || \ - as_fn_error "crt*.o not found in specified location." "$LINENO" 5 + as_fn_error $? "crt*.o not found in specified location." "$LINENO" 5 fi @@ -5939,8 +5951,7 @@ do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -6131,7 +6142,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$emacs_alsa_subdir" != yes; then - as_fn_error "pkg-config found alsa, but it does not compile. See config.log for error messages." "$LINENO" 5 + as_fn_error $? "pkg-config found alsa, but it does not compile. See config.log for error messages." "$LINENO" 5 fi ALSA_CFLAGS="$ALSA_CFLAGS -DALSA_SUBDIR_INCLUDE" fi @@ -6166,8 +6177,7 @@ do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -7009,7 +7019,7 @@ $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -7017,7 +7027,7 @@ all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; @@ -7153,7 +7163,7 @@ have_x=disabled else case $x_includes,$x_libraries in #( - *\'*) as_fn_error "cannot use X directory names containing '" "$LINENO" 5;; #( + *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -7171,7 +7181,7 @@ @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then - # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done @@ -7441,7 +7451,7 @@ if test "x$ac_cv_header_AppKit_AppKit_h" = x""yes; then : HAVE_NS=yes else - as_fn_error "\`--with-ns' was specified, but the include + as_fn_error $? "\`--with-ns' was specified, but the include files are missing or cannot be compiled." "$LINENO" 5 fi @@ -7557,7 +7567,7 @@ if test "$HAVE_XSERVER" = true || test -n "$DISPLAY" || test "`echo /usr/lib/libX11.*`" != "/usr/lib/libX11.*"; then - as_fn_error "You seem to be running X, but no X development libraries + as_fn_error $? "You seem to be running X, but no X development libraries were found. You should install the relevant development files for X and for the toolkit you want, such as Gtk+, Lesstif or Motif. Also make sure you have development files for image handling, i.e. @@ -7680,8 +7690,7 @@ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -7787,6 +7796,7 @@ main () { char *data, *data2, *data3; + const char *cdata2; int i, pagesize; int fd, fd2; @@ -7811,10 +7821,10 @@ fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600); if (fd2 < 0) return 4; - data2 = ""; - if (write (fd2, data2, 1) != 1) + cdata2 = ""; + if (write (fd2, cdata2, 1) != 1) return 5; - data2 = mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); + data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); if (data2 == MAP_FAILED) return 6; for (i = 0; i < pagesize; ++i) @@ -8186,8 +8196,7 @@ do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -8468,7 +8477,7 @@ fi if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then - as_fn_error "$GTK_PKG_ERRORS" "$LINENO" 5 + as_fn_error $? "$GTK_PKG_ERRORS" "$LINENO" 5 fi fi @@ -8574,7 +8583,7 @@ fi if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then - as_fn_error "$GTK_PKG_ERRORS" "$LINENO" 5 + as_fn_error $? "$GTK_PKG_ERRORS" "$LINENO" 5 fi fi fi @@ -8601,7 +8610,7 @@ if test "${GTK_COMPILES}" != "yes"; then if test "$USE_X_TOOLKIT" != "maybe"; then - as_fn_error "Gtk+ wanted, but it does not compile, see config.log. Maybe some x11-devel files missing?" "$LINENO" 5; + as_fn_error $? "Gtk+ wanted, but it does not compile, see config.log. Maybe some x11-devel files missing?" "$LINENO" 5; fi else HAVE_GTK=yes @@ -8731,8 +8740,7 @@ do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9097,7 +9105,7 @@ USE_X_TOOLKIT=LUCID LUCID_LIBW=-lXaw elif test x"${USE_X_TOOLKIT}" = xLUCID; then - as_fn_error "Lucid toolkit requires X11/Xaw include files" "$LINENO" 5 + as_fn_error $? "Lucid toolkit requires X11/Xaw include files" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no; do not use toolkit by default" >&5 $as_echo "no; do not use toolkit by default" >&6; } @@ -10274,8 +10282,7 @@ do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -10527,7 +10534,7 @@ MISSING="$MISSING libtiff" && WITH_NO="$WITH_NO --with-tiff=no" if test "X${MISSING}" != X; then - as_fn_error "The following required libraries were not found: + as_fn_error $? "The following required libraries were not found: $MISSING Maybe some development libraries/packages are missing? If you don't want to link with them give @@ -10862,8 +10869,7 @@ for ac_func in _getb67 GETB67 getb67; do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func @@ -10927,7 +10933,7 @@ if test x"$ac_cv_func_alloca_works" != xyes; then - as_fn_error "a system implementation of alloca is required " "$LINENO" 5 + as_fn_error $? "a system implementation of alloca is required " "$LINENO" 5 fi # fmod, logb, and frexp are found in -lm on most systems. @@ -11123,7 +11129,7 @@ if test $ac_cv_prog_liblockfile = yes; then - as_fn_error "Shared liblockfile found but can't link against it. + as_fn_error $? "Shared liblockfile found but can't link against it. This probably means that movemail could lose mail. There may be a \`development' package to install containing liblockfile." "$LINENO" 5 fi @@ -11204,7 +11210,7 @@ random lrand48 logb frexp fmod rint cbrt ftime setsid \ strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \ utimes getrlimit setrlimit setpgid getcwd getwd shutdown getaddrinfo \ -__fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \ +__fpending mblen mbrlen mbsinit strsignal setitimer ualarm strchr strrchr \ sendto recvfrom getsockopt setsockopt getsockname getpeername \ gai_strerror mkstemp getline getdelim mremap memmove fsync sync \ memset memcmp difftime memcpy mempcpy mblen mbrlen posix_memalign \ @@ -11212,8 +11218,7 @@ do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -11244,8 +11249,7 @@ do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -11297,8 +11301,8 @@ static time_t time_t_min; /* Values we'll use to set the TZ environment variable. */ -static char *tz_strings[] = { - (char *) 0, "TZ=GMT0", "TZ=JST-9", +static const char *tz_strings[] = { + (const char *) 0, "TZ=GMT0", "TZ=JST-9", "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" }; #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) @@ -11315,7 +11319,7 @@ instead of "TZ=America/Vancouver" in order to detect the bug even on systems that don't support the Olson extension, or don't have the full zoneinfo tables installed. */ - putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0"); tm.tm_year = 98; tm.tm_mon = 3; @@ -11328,16 +11332,14 @@ } static int -mktime_test1 (now) - time_t now; +mktime_test1 (time_t now) { struct tm *lt; return ! (lt = localtime (&now)) || mktime (lt) == now; } static int -mktime_test (now) - time_t now; +mktime_test (time_t now) { return (mktime_test1 (now) && mktime_test1 ((time_t) (time_t_max - now)) @@ -11361,8 +11363,7 @@ } static int -bigtime_test (j) - int j; +bigtime_test (int j) { struct tm tm; time_t now; @@ -11406,7 +11407,7 @@ instead of "TZ=America/Vancouver" in order to detect the bug even on systems that don't support the Olson extension, or don't have the full zoneinfo tables installed. */ - putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0"); t = mktime (&tm); @@ -11441,7 +11442,7 @@ for (i = 0; i < N_STRINGS; i++) { if (tz_strings[i]) - putenv (tz_strings[i]); + putenv ((char*) tz_strings[i]); for (t = 0; t <= time_t_max - delta; t += delta) if (! mktime_test (t)) @@ -11493,7 +11494,7 @@ # Make sure getloadavg.c is where it belongs, at configure-time. test -f "$srcdir/$ac_config_libobj_dir/getloadavg.c" || - as_fn_error "$srcdir/$ac_config_libobj_dir/getloadavg.c is missing" "$LINENO" 5 + as_fn_error $? "$srcdir/$ac_config_libobj_dir/getloadavg.c is missing" "$LINENO" 5 ac_save_LIBS=$LIBS @@ -12362,7 +12363,7 @@ fi if test "$have_tputs_et_al" != true; then - as_fn_error "I couldn't find termcap functions (tputs and friends). + as_fn_error $? "I couldn't find termcap functions (tputs and friends). Maybe some development libraries/packages are missing? Try installing libncurses-dev(el), libterminfo-dev(el) or similar." "$LINENO" 5 fi @@ -13509,8 +13510,7 @@ do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -13884,14 +13884,14 @@ && test x"`$CC --version 2> /dev/null | grep 'gcc.* 4.5.0'`" != x \ && test x"`echo $CFLAGS | grep '\-O[23]'`" != x \ && test x"`echo $CFLAGS | grep '\-fno-optimize-sibling-calls'`" = x; then - as_fn_error "GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." "$LINENO" 5 + as_fn_error $? "GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." "$LINENO" 5 fi #### Find out which version of Emacs this is. version=`grep 'const char emacs_version' ${srcdir}/src/emacs.c \ | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'` if test x"${version}" = x; then - as_fn_error "can't find current emacs version in \`${srcdir}/src/emacs.c'." "$LINENO" 5 + as_fn_error $? "can't find current emacs version in \`${srcdir}/src/emacs.c'." "$LINENO" 5 fi if test x"${version}" != x"$PACKAGE_VERSION"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: version mismatch between \`${srcdir}/configure.in' and \`${srcdir}/src/emacs.c'." >&5 @@ -14452,6 +14452,7 @@ ac_libobjs= ac_ltlibobjs= +U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' @@ -14613,19 +14614,19 @@ (unset CDPATH) >/dev/null 2>&1 && unset CDPATH -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -14821,7 +14822,7 @@ test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -14875,7 +14876,7 @@ # values after options handling. ac_log=" This file was extended by emacs $as_me 24.0.50, which was -generated by GNU Autoconf 2.65. Invocation command line was +generated by GNU Autoconf 2.66. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -14941,10 +14942,10 @@ ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ emacs config.status 24.0.50 -configured by $0, generated by GNU Autoconf 2.65, +configured by $0, generated by GNU Autoconf 2.66, with options \\"\$ac_cs_config\\" -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -14998,7 +14999,7 @@ ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error "ambiguous option: \`$1' + as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; @@ -15007,7 +15008,7 @@ ac_cs_silent=: ;; # This is an error. - -*) as_fn_error "unrecognized option: \`$1' + -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" @@ -15075,7 +15076,7 @@ "leim/Makefile") CONFIG_FILES="$CONFIG_FILES leim/Makefile" ;; "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; - *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -15113,7 +15114,7 @@ { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -15147,7 +15148,7 @@ fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\r' + ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi @@ -15164,7 +15165,7 @@ echo "_ACEOF" } >conf$$files.sh && . ./conf$$files.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 rm -f conf$$files.sh { @@ -15172,18 +15173,18 @@ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -15278,20 +15279,28 @@ else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || as_fn_error "could not setup config files machinery" "$LINENO" 5 + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// s/^[^=]*=[ ]*$// }' fi @@ -15319,7 +15328,7 @@ if test -z "$ac_t"; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -15404,7 +15413,7 @@ _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error "could not setup config headers machinery" "$LINENO" 5 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" @@ -15417,7 +15426,7 @@ esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -15445,7 +15454,7 @@ [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -15472,7 +15481,7 @@ case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -15608,22 +15617,22 @@ else $AWK -f "$tmp/subs.awk" | $SHELL fi >$tmp/out \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 +which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} +which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # @@ -15634,19 +15643,19 @@ $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error "could not create -" "$LINENO" 5 + || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; @@ -15683,7 +15692,7 @@ ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. @@ -15704,7 +15713,7 @@ exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit $? + $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 === modified file 'configure.in' --- configure.in 2010-07-08 23:34:47 +0000 +++ configure.in 2010-07-11 10:31:10 +0000 @@ -2635,7 +2635,7 @@ random lrand48 logb frexp fmod rint cbrt ftime setsid \ strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \ utimes getrlimit setrlimit setpgid getcwd getwd shutdown getaddrinfo \ -__fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \ +__fpending mblen mbrlen mbsinit strsignal setitimer ualarm strchr strrchr \ sendto recvfrom getsockopt setsockopt getsockname getpeername \ gai_strerror mkstemp getline getdelim mremap memmove fsync sync \ memset memcmp difftime memcpy mempcpy mblen mbrlen posix_memalign \ @@ -3601,6 +3601,14 @@ typedef unsigned size_t; #endif +#ifndef HAVE_STRCHR +#define strchr(a, b) index (a, b) +#endif + +#ifndef HAVE_STRRCHR +#define strrchr(a, b) rindex (a, b) +#endif + #if defined __GNUC__ && (__GNUC__ > 2 \ || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)) #define NO_RETURN __attribute__ ((__noreturn__)) === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2010-07-11 06:39:00 +0000 +++ lib-src/ChangeLog 2010-07-11 10:31:10 +0000 @@ -1,3 +1,10 @@ +2010-07-11 Andreas Schwab + + * emacsclient.c (set_local_socket): Use strchr, strrchr instead of + index, rindex. + * movemail.c (mail_spool_name, popmail): Likewise. + * pop.c (pop_list): Likewise. + 2010-07-11 Eli Zaretskii * makefile.w32-in (obj): Add menu.o, bidi.o, w32uniscrobe.o, === modified file 'lib-src/emacsclient.c' --- lib-src/emacsclient.c 2010-07-03 07:44:17 +0000 +++ lib-src/emacsclient.c 2010-07-11 10:31:10 +0000 @@ -1234,8 +1234,10 @@ char *server_name = "server"; char *tmpdir; - if (socket_name && !index (socket_name, '/') && !index (socket_name, '\\')) - { /* socket_name is a file name component. */ + if (socket_name && !strchr (socket_name, '/') + && !strchr (socket_name, '\\')) + { + /* socket_name is a file name component. */ server_name = socket_name; socket_name = NULL; default_sock = 1; /* Try both UIDs. */ === modified file 'lib-src/movemail.c' --- lib-src/movemail.c 2010-07-06 11:50:35 +0000 +++ lib-src/movemail.c 2010-07-11 10:31:10 +0000 @@ -146,12 +146,6 @@ #ifndef HAVE_STRERROR char *strerror (int); #endif -#ifdef HAVE_INDEX -extern char *index (const char *, int); -#endif -#ifdef HAVE_RINDEX -extern char *rindex (const char *, int); -#endif static void fatal (char *s1, char *s2, char *s3); static void error (char *s1, char *s2, char *s3); @@ -564,7 +558,7 @@ char *indir, *fname; int status; - if (! (fname = rindex (inname, '/'))) + if (! (fname = strrchr (inname, '/'))) return NULL; fname++; @@ -714,7 +708,7 @@ char *user, *hostname; user = mailbox; - if ((hostname = index(mailbox, ':'))) + if ((hostname = strchr (mailbox, ':'))) *hostname++ = '\0'; server = pop_open (hostname, user, password, POP_NO_GETPASS); === modified file 'lib-src/pop.c' --- lib-src/pop.c 2010-07-07 22:18:28 +0000 +++ lib-src/pop.c 2010-07-11 10:31:10 +0000 @@ -465,7 +465,7 @@ return (-1); } (*IDs)[0] = atoi (&fromserver[4]); - fromserver = index (&fromserver[4], ' '); + fromserver = strchr (&fromserver[4], ' '); if (! fromserver) { strcpy (pop_error, @@ -496,7 +496,7 @@ return (-1); } (*IDs)[i] = atoi (fromserver); - fromserver = index (fromserver, ' '); + fromserver = strchr (fromserver, ' '); if (! fromserver) { strcpy (pop_error, === modified file 'msdos/ChangeLog' --- msdos/ChangeLog 2010-07-08 17:41:04 +0000 +++ msdos/ChangeLog 2010-07-11 10:31:10 +0000 @@ -1,3 +1,8 @@ +2010-07-11 Andreas Schwab + + * sed2v2.inp (HAVE_INDEX, HAVE_RINDEX): Don't edit. + (HAVE_STRCHR, HAVE_STRRCHR): Edit to 1. + 2010-07-08 Eli Zaretskii * sed1v2.inp (stamp-oldxmenu): Don't edit out in `temacs:' target, === modified file 'msdos/sed2v2.inp' --- msdos/sed2v2.inp 2010-07-08 17:41:04 +0000 +++ msdos/sed2v2.inp 2010-07-11 10:31:10 +0000 @@ -46,9 +46,9 @@ /^#undef HAVE_TM_GMTOFF *$/s/^.*$/#define HAVE_TM_GMTOFF 1/ /^#undef HAVE_MBLEN *$/s/^.*$/#define HAVE_MBLEN 1/ /^#undef HAVE_STRUCT_TIMEZONE *$/s/^.*$/#define HAVE_STRUCT_TIMEZONE 1/ -/^#undef HAVE_INDEX *$/s/^.*$/#define HAVE_INDEX 1/ +/^#undef HAVE_STRCHR *$/s/^.*$/#define HAVE_STRCHR 1/ /^#undef HAVE_SIZE_T *$/s/^.*$/#define HAVE_SIZE_T 1/ -/^#undef HAVE_RINDEX *$/s/^.*$/#define HAVE_RINDEX 1/ +/^#undef HAVE_STRRCHR *$/s/^.*$/#define HAVE_STRRCHR 1/ /^#undef HAVE_MKSTEMP *$/s/^.*$/#define HAVE_MKSTEMP 1/ /^#undef HAVE_STRUCT_TM_TM_ZONE *$/s/^.*$/#define HAVE_STRUCT_TM_TM_ZONE 1/ /^#undef HAVE_SYNC *$/s/^.*$/#define HAVE_SYNC 1/ === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-11 09:49:44 +0000 +++ src/ChangeLog 2010-07-11 10:31:10 +0000 @@ -1,5 +1,21 @@ 2010-07-11 Andreas Schwab + * callint.c (Fcall_interactively): Use strchr, strrchr instead of + index, rindex. + * doc.c (get_doc_string, Fsnarf_documentation): Likewise. + * editfns.c (Fuser_full_name, Fformat): Likewise. + * emacs.c (argmatch, sort_args, decode_env_path): Likewise. + * fileio.c (Ffile_symlink_p): Likewise. + * filelock.c (current_lock_owner): Likewise. + * font.c (font_parse_name, font_parse_family_registry): Likewise. + * fontset.c (fontset_pattern_regexp): Likewise. + * lread.c (read1): Likewise. + * sysdep.c (init_system_name): Likewise. + * xfns.c (select_visual): Likewise. + * s/hpux10-20.h (index, rindex): Don't define. + * s/ms-w32.h (index): Likewise. + * s/usg5-4.h: Likewise. + * callproc.c (relocate_fd): Use F_DUPFD if defined. * alloc.c (pending_malloc_warning, malloc_warning): Add const. === modified file 'src/callint.c' --- src/callint.c 2010-07-08 21:25:08 +0000 +++ src/callint.c 2010-07-11 10:31:10 +0000 @@ -29,10 +29,6 @@ #include "window.h" #include "keymap.h" -#ifdef HAVE_INDEX -extern char *index (const char *, int); -#endif - extern Lisp_Object Qcursor_in_echo_area; extern Lisp_Object Qfile_directory_p; extern Lisp_Object Qonly; @@ -469,7 +465,7 @@ j += 2; else j++; - tem = (unsigned char *) index (tem, '\n'); + tem = (unsigned char *) strchr (tem, '\n'); if (tem) ++tem; else @@ -500,11 +496,11 @@ { strncpy (prompt1, tem + 1, sizeof prompt1 - 1); prompt1[sizeof prompt1 - 1] = 0; - tem1 = (char *) index (prompt1, '\n'); + tem1 = strchr (prompt1, '\n'); if (tem1) *tem1 = 0; visargs[0] = build_string (prompt1); - if (index (prompt1, '%')) + if (strchr (prompt1, '%')) callint_message = Fformat (i, visargs); else callint_message = visargs[0]; @@ -809,7 +805,7 @@ if (NILP (visargs[i]) && STRINGP (args[i])) visargs[i] = args[i]; - tem = (unsigned char *) index (tem, '\n'); + tem = (unsigned char *) strchr (tem, '\n'); if (tem) tem++; else tem = (unsigned char *) ""; } === modified file 'src/config.in' --- src/config.in 2010-07-07 22:18:28 +0000 +++ src/config.in 2010-07-11 10:31:10 +0000 @@ -288,9 +288,6 @@ /* Define to 1 if netdb.h declares h_errno. */ #undef HAVE_H_ERRNO -/* Define to 1 if you have the `index' function. */ -#undef HAVE_INDEX - /* Define to 1 if you have inet sockets. */ #undef HAVE_INET_SOCKETS @@ -537,9 +534,6 @@ /* Define to 1 if res_init is available. */ #undef HAVE_RES_INIT -/* Define to 1 if you have the `rindex' function. */ -#undef HAVE_RINDEX - /* Define to 1 if you have the `rint' function. */ #undef HAVE_RINT @@ -597,6 +591,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR @@ -609,6 +606,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H +/* Define to 1 if you have the `strrchr' function. */ +#undef HAVE_STRRCHR + /* Define to 1 if you have the `strsignal' function. */ #undef HAVE_STRSIGNAL @@ -1154,6 +1154,14 @@ typedef unsigned size_t; #endif +#ifndef HAVE_STRCHR +#define strchr(a, b) index (a, b) +#endif + +#ifndef HAVE_STRRCHR +#define strrchr(a, b) rindex (a, b) +#endif + #if defined __GNUC__ && (__GNUC__ > 2 \ || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)) #define NO_RETURN __attribute__ ((__noreturn__)) === modified file 'src/doc.c' --- src/doc.c 2010-07-08 21:25:08 +0000 +++ src/doc.c 2010-07-11 10:31:10 +0000 @@ -45,10 +45,6 @@ #include "keymap.h" #include "buildobj.h" -#ifdef HAVE_INDEX -extern char *index (const char *, int); -#endif - Lisp_Object Vdoc_file_name; Lisp_Object Qfunction_documentation; @@ -218,9 +214,9 @@ if (!nread) break; if (p == get_doc_string_buffer) - p1 = (char *) index (p + offset, '\037'); + p1 = strchr (p + offset, '\037'); else - p1 = (char *) index (p, '\037'); + p1 = strchr (p, '\037'); if (p1) { *p1 = 0; @@ -633,7 +629,7 @@ /* p points to ^_Ffunctionname\n or ^_Vvarname\n. */ if (p != end) { - end = (char *) index (p, '\n'); + end = strchr (p, '\n'); /* See if this is a file name, and if it is a file in build-files. */ if (p[1] == 'S' && end - p > 4 && end[-2] == '.' === modified file 'src/editfns.c' --- src/editfns.c 2010-07-11 09:27:13 +0000 +++ src/editfns.c 2010-07-11 10:31:10 +0000 @@ -109,10 +109,6 @@ static Lisp_Object subst_char_in_region_unwind_1 (Lisp_Object); static void transpose_markers (int, int, int, int, int, int, int, int); -#ifdef HAVE_INDEX -extern char *index (const char *, int); -#endif - Lisp_Object Vbuffer_access_fontify_functions; Lisp_Object Qbuffer_access_fontify_functions; Lisp_Object Vbuffer_access_fontified_property; @@ -1369,12 +1365,12 @@ p = (unsigned char *) USER_FULL_NAME; /* Chop off everything after the first comma. */ - q = (unsigned char *) index (p, ','); + q = (unsigned char *) strchr (p, ','); full = make_string (p, q ? q - p : strlen (p)); #ifdef AMPERSAND_FULL_NAME p = SDATA (full); - q = (unsigned char *) index (p, '&'); + q = (unsigned char *) strchr (p, '&'); /* Substitute the login name for the &, upcasing the first character. */ if (q) { @@ -3813,7 +3809,7 @@ discarded[format - format_start] = 1; format++; - while (index ("-+0# ", *format)) + while (strchr ("-+0# ", *format)) { if (*format == '-') { === modified file 'src/emacs.c' --- src/emacs.c 2010-07-11 09:27:13 +0000 +++ src/emacs.c 2010-07-11 10:31:10 +0000 @@ -90,10 +90,6 @@ const char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc."; const char emacs_version[] = "24.0.50"; -#ifdef HAVE_INDEX -extern char *index (const char *, int); -#endif - /* Make these values available in GDB, which doesn't see macros. */ #ifdef USE_LSB_TAG @@ -662,7 +658,7 @@ *skipptr += 1; return 1; } - arglen = (valptr != NULL && (p = index (arg, '=')) != NULL + arglen = (valptr != NULL && (p = strchr (arg, '=')) != NULL ? p - arg : strlen (arg)); if (lstr == 0 || arglen < minlen || strncmp (arg, lstr, arglen) != 0) return 0; @@ -1974,7 +1970,7 @@ { match = -1; thislen = strlen (argv[from]); - equals = index (argv[from], '='); + equals = strchr (argv[from], '='); if (equals != 0) thislen = equals - argv[from]; @@ -2369,7 +2365,7 @@ lpath = Qnil; while (1) { - p = index (path, SEPCHAR); + p = strchr (path, SEPCHAR); if (!p) p = path + strlen (path); element = (p - path ? make_string (path, p - path) === modified file 'src/fileio.c' --- src/fileio.c 2010-07-08 21:25:08 +0000 +++ src/fileio.c 2010-07-11 10:31:10 +0000 @@ -1455,7 +1455,7 @@ /* Get past ~ to user */ unsigned char *user = nm + 1; /* Find end of name. */ - unsigned char *ptr = (unsigned char *) index (user, '/'); + unsigned char *ptr = (unsigned char *) strchr (user, '/'); int len = ptr ? ptr - user : strlen (user); /* Copy the user name into temp storage. */ o = (unsigned char *) alloca (len + 1); @@ -2729,7 +2729,7 @@ while (valsize >= bufsize); val = make_string (buf, valsize); - if (buf[0] == '/' && index (buf, ':')) + if (buf[0] == '/' && strchr (buf, ':')) val = concat2 (build_string ("/:"), val); xfree (buf); val = DECODE_FILE (val); === modified file 'src/filelock.c' --- src/filelock.c 2010-07-08 21:25:08 +0000 +++ src/filelock.c 2010-07-11 10:31:10 +0000 @@ -413,9 +413,6 @@ static int current_lock_owner (lock_info_type *owner, char *lfname) { -#ifndef index - extern char *rindex (const char *, int), *index (const char *, int); -#endif int len, ret; int local_owner = 0; char *at, *dot, *colon; @@ -457,8 +454,8 @@ /* Parse USER@HOST.PID:BOOT_TIME. If can't parse, return -1. */ /* The USER is everything before the last @. */ - at = rindex (lfinfo, '@'); - dot = rindex (lfinfo, '.'); + at = strrchr (lfinfo, '@'); + dot = strrchr (lfinfo, '.'); if (!at || !dot) { xfree (lfinfo); === modified file 'src/font.c' --- src/font.c 2010-07-08 21:25:08 +0000 +++ src/font.c 2010-07-11 10:31:10 +0000 @@ -1815,7 +1815,7 @@ static int font_parse_name (char *name, Lisp_Object font) { - if (name[0] == '-' || index (name, '*') || index (name, '?')) + if (name[0] == '-' || strchr (name, '*') || strchr (name, '?')) return font_parse_xlfd (name, font); return font_parse_fcname (name, font); } @@ -1837,7 +1837,7 @@ CHECK_STRING (family); len = SBYTES (family); p0 = (char *) SDATA (family); - p1 = index (p0, '-'); + p1 = strchr (p0, '-'); if (p1) { if ((*p0 != '*' && p1 - p0 > 0) @@ -1856,7 +1856,7 @@ CHECK_STRING (registry); len = SBYTES (registry); p0 = (char *) SDATA (registry); - p1 = index (p0, '-'); + p1 = strchr (p0, '-'); if (! p1) { if (SDATA (registry)[len - 1] == '*') === modified file 'src/fontset.c' --- src/fontset.c 2010-07-08 21:25:08 +0000 +++ src/fontset.c 2010-07-11 10:31:10 +0000 @@ -1065,8 +1065,8 @@ static Lisp_Object fontset_pattern_regexp (Lisp_Object pattern) { - if (!index ((char *) SDATA (pattern), '*') - && !index ((char *) SDATA (pattern), '?')) + if (!strchr ((char *) SDATA (pattern), '*') + && !strchr ((char *) SDATA (pattern), '?')) /* PATTERN does not contain any wild cards. */ return Qnil; === modified file 'src/lread.c' --- src/lread.c 2010-07-11 09:27:13 +0000 +++ src/lread.c 2010-07-11 10:31:10 +0000 @@ -2725,7 +2725,7 @@ ok = (next_next_char <= 040 || (next_next_char < 0200 - && (index ("\"';([#?", next_next_char) + && (strchr ("\"';([#?", next_next_char) || (!first_in_list && next_next_char == '`') || (new_backquote_flag && next_next_char == ',')))); } @@ -2733,7 +2733,7 @@ { ok = (next_char <= 040 || (next_char < 0200 - && (index ("\"';()[]#?", next_char) + && (strchr ("\"';()[]#?", next_char) || (!first_in_list && next_char == '`') || (new_backquote_flag && next_char == ',')))); } @@ -2878,7 +2878,7 @@ if (next_char <= 040 || (next_char < 0200 - && (index ("\"';([#?", next_char) + && (strchr ("\"';([#?", next_char) || (!first_in_list && next_char == '`') || (new_backquote_flag && next_char == ',')))) { @@ -2905,7 +2905,7 @@ while (c > 040 && c != 0x8a0 /* NBSP */ && (c >= 0200 - || (!index ("\"';()[]#", c) + || (!strchr ("\"';()[]#", c) && !(!first_in_list && c == '`') && !(new_backquote_flag && c == ',')))) { === modified file 'src/s/hpux10-20.h' --- src/s/hpux10-20.h 2010-07-08 03:03:52 +0000 +++ src/s/hpux10-20.h 2010-07-11 10:31:10 +0000 @@ -146,9 +146,5 @@ /* No underscore please. */ #define LDAV_SYMBOL "avenrun" -/* On USG systems these have different names. */ -#define index strchr -#define rindex strrchr - /* arch-tag: 8d8dcbf1-ca9b-48a1-94be-b750de18a5c6 (do not change this comment) */ === modified file 'src/s/ms-w32.h' --- src/s/ms-w32.h 2010-07-07 22:18:28 +0000 +++ src/s/ms-w32.h 2010-07-11 10:31:10 +0000 @@ -274,8 +274,6 @@ #define pclose _pclose #define umask _umask #define utimbuf _utimbuf -#define index strchr -#define rindex strrchr #define strdup _strdup #define strupr _strupr #define strnicmp _strnicmp === modified file 'src/s/usg5-4.h' --- src/s/usg5-4.h 2010-06-09 18:36:58 +0000 +++ src/s/usg5-4.h 2010-07-11 10:31:10 +0000 @@ -50,14 +50,6 @@ #define _setjmp setjmp #define _longjmp longjmp -/* On USG systems these have different names. */ -#ifndef HAVE_INDEX -#define index strchr -#endif /* ! defined (HAVE_INDEX) */ -#ifndef HAVE_RINDEX -#define rindex strrchr -#endif /* ! defined (HAVE_RINDEX) */ - /* The docs for system V/386 suggest v.3 has sigpause, so let's try it. */ #define HAVE_SYSV_SIGPAUSE === modified file 'src/sysdep.c' --- src/sysdep.c 2010-07-08 04:55:07 +0000 +++ src/sysdep.c 2010-07-11 10:31:10 +0000 @@ -1555,7 +1555,7 @@ #ifndef CANNOT_DUMP if (initialized) #endif /* not CANNOT_DUMP */ - if (! index (hostname, '.')) + if (! strchr (hostname, '.')) { int count; #ifdef HAVE_GETADDRINFO @@ -1584,7 +1584,7 @@ while (it) { char *fqdn = it->ai_canonname; - if (fqdn && index (fqdn, '.') + if (fqdn && strchr (fqdn, '.') && strcmp (fqdn, "localhost.localdomain") != 0) break; it = it->ai_next; @@ -1620,13 +1620,13 @@ { char *fqdn = (char *) hp->h_name; - if (!index (fqdn, '.')) + if (!strchr (fqdn, '.')) { /* We still don't have a fully qualified domain name. Try to find one in the list of alternate names */ char **alias = hp->h_aliases; while (*alias - && (!index (*alias, '.') + && (!strchr (*alias, '.') || !strcmp (*alias, "localhost.localdomain"))) alias++; if (*alias) === modified file 'src/xfns.c' --- src/xfns.c 2010-07-10 18:52:53 +0000 +++ src/xfns.c 2010-07-11 10:31:10 +0000 @@ -4005,7 +4005,7 @@ XVisualInfo vinfo; strcpy (s, SDATA (value)); - dash = index (s, '-'); + dash = strchr (s, '-'); if (dash) { dpyinfo->n_planes = atoi (dash + 1); ------------------------------------------------------------ revno: 100780 committer: Andreas Schwab branch nick: emacs timestamp: Sun 2010-07-11 11:49:44 +0200 message: * callproc.c (relocate_fd): Use F_DUPFD if defined. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-11 09:27:13 +0000 +++ src/ChangeLog 2010-07-11 09:49:44 +0000 @@ -1,5 +1,7 @@ 2010-07-11 Andreas Schwab + * callproc.c (relocate_fd): Use F_DUPFD if defined. + * alloc.c (pending_malloc_warning, malloc_warning): Add const. * callproc.c (relocate_fd, getenv_internal_1, getenv_internal) (egetenv): Likewise. === modified file 'src/callproc.c' --- src/callproc.c 2010-07-11 09:27:13 +0000 +++ src/callproc.c 2010-07-11 09:49:44 +0000 @@ -1288,7 +1288,16 @@ return fd; else { - int new = dup (fd); + int new; +#ifdef F_DUPFD + new = fcntl (fd, F_DUPFD, minfd); +#else + new = dup (fd); + if (new != -1) + /* Note that we hold the original FD open while we recurse, + to guarantee we'll get a new FD if we need it. */ + new = relocate_fd (new, minfd); +#endif if (new == -1) { const char *message1 = "Error while setting up child: "; @@ -1299,9 +1308,6 @@ emacs_write (2, message2, strlen (message2)); _exit (1); } - /* Note that we hold the original FD open while we recurse, - to guarantee we'll get a new FD if we need it. */ - new = relocate_fd (new, minfd); emacs_close (fd); return new; } ------------------------------------------------------------ revno: 100779 committer: Andreas Schwab branch nick: emacs timestamp: Sun 2010-07-11 11:27:13 +0200 message: Constify functions taking char * * alloc.c (pending_malloc_warning, malloc_warning): Add const. * callproc.c (relocate_fd, getenv_internal_1, getenv_internal) (egetenv): Likewise. * doprnt.c (doprnt): Likewise. * editfns.c (set_time_zone_rule, format2): Likewise. * emacs.c (decode_env_path): Likewise. * eval.c (signal_error, error): Likewise. * insdel.c (replace_range_2): Likewise. * keyboard.c (cmd_error_internal): Likewise. * lread.c (isfloat_string, make_symbol, dir_warning): Likewise. * print.c (write_string, write_string_1, print_error_message): Likewise. * vm-limit.c (warn_function, memory_warnings): Likewise. * xdisp.c (message1, message1_nolog, message_with_string) (vmessage, message, message_nolog): Likewise. * emacs.c: Remove duplicate declaration. * keyboard.h: Likewise. * lisp.h: Update prototypes. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-11 08:44:34 +0000 +++ src/ChangeLog 2010-07-11 09:27:13 +0000 @@ -1,5 +1,24 @@ 2010-07-11 Andreas Schwab + * alloc.c (pending_malloc_warning, malloc_warning): Add const. + * callproc.c (relocate_fd, getenv_internal_1, getenv_internal) + (egetenv): Likewise. + * doprnt.c (doprnt): Likewise. + * editfns.c (set_time_zone_rule, format2): Likewise. + * emacs.c (decode_env_path): Likewise. + * eval.c (signal_error, error): Likewise. + * insdel.c (replace_range_2): Likewise. + * keyboard.c (cmd_error_internal): Likewise. + * lread.c (isfloat_string, make_symbol, dir_warning): Likewise. + * print.c (write_string, write_string_1, print_error_message): + Likewise. + * vm-limit.c (warn_function, memory_warnings): Likewise. + * xdisp.c (message1, message1_nolog, message_with_string) + (vmessage, message, message_nolog): Likewise. + * emacs.c: Remove duplicate declaration. + * keyboard.h: Likewise. + * lisp.h: Update prototypes. + * eval.c: Fix indentation problem. * keyboard.c: Include "process.h" === modified file 'src/alloc.c' --- src/alloc.c 2010-07-10 18:52:53 +0000 +++ src/alloc.c 2010-07-11 09:27:13 +0000 @@ -298,7 +298,7 @@ /* If nonzero, this is a warning delivered by malloc and not yet displayed. */ -char *pending_malloc_warning; +const char *pending_malloc_warning; /* Pre-computed signal argument for use when memory is exhausted. */ @@ -514,7 +514,7 @@ /* Function malloc calls this if it finds we are near exhausting storage. */ void -malloc_warning (char *str) +malloc_warning (const char *str) { pending_malloc_warning = str; } === modified file 'src/callproc.c' --- src/callproc.c 2010-07-08 21:25:08 +0000 +++ src/callproc.c 2010-07-11 09:27:13 +0000 @@ -1291,9 +1291,9 @@ int new = dup (fd); if (new == -1) { - char *message1 = "Error while setting up child: "; - char *errmessage = strerror (errno); - char *message2 = "\n"; + const char *message1 = "Error while setting up child: "; + const char *errmessage = strerror (errno); + const char *message2 = "\n"; emacs_write (2, message1, strlen (message1)); emacs_write (2, errmessage, strlen (errmessage)); emacs_write (2, message2, strlen (message2)); @@ -1308,7 +1308,8 @@ } static int -getenv_internal_1 (char *var, int varlen, char **value, int *valuelen, Lisp_Object env) +getenv_internal_1 (const char *var, int varlen, char **value, int *valuelen, + Lisp_Object env) { for (; CONSP (env); env = XCDR (env)) { @@ -1342,7 +1343,8 @@ } static int -getenv_internal (char *var, int varlen, char **value, int *valuelen, Lisp_Object frame) +getenv_internal (const char *var, int varlen, char **value, int *valuelen, + Lisp_Object frame) { /* Try to find VAR in Vprocess_environment first. */ if (getenv_internal_1 (var, varlen, value, valuelen, @@ -1403,7 +1405,7 @@ /* A version of getenv that consults the Lisp environment lists, easily callable from C. */ char * -egetenv (char *var) +egetenv (const char *var) { char *value; int valuelen; === modified file 'src/doprnt.c' --- src/doprnt.c 2010-07-11 06:59:55 +0000 +++ src/doprnt.c 2010-07-11 09:27:13 +0000 @@ -59,9 +59,10 @@ Integers are passed as C integers. */ int -doprnt (char *buffer, register int bufsize, char *format, char *format_end, va_list ap) +doprnt (char *buffer, register int bufsize, const char *format, + const char *format_end, va_list ap) { - register char *fmt = format; /* Pointer into format string */ + const char *fmt = format; /* Pointer into format string */ register char *bufptr = buffer; /* Pointer into output buffer.. */ /* Use this for sprintf unless we need something really big. */ === modified file 'src/editfns.c' --- src/editfns.c 2010-07-08 21:25:08 +0000 +++ src/editfns.c 2010-07-11 09:27:13 +0000 @@ -2045,7 +2045,7 @@ responsibility to free. */ void -set_time_zone_rule (char *tzstring) +set_time_zone_rule (const char *tzstring) { int envptrs; char **from, **to, **newenv; @@ -4111,7 +4111,7 @@ } Lisp_Object -format2 (char *string1, Lisp_Object arg0, Lisp_Object arg1) +format2 (const char *string1, Lisp_Object arg0, Lisp_Object arg1) { Lisp_Object args[3]; args[0] = build_string (string1); === modified file 'src/emacs.c' --- src/emacs.c 2010-07-08 21:25:08 +0000 +++ src/emacs.c 2010-07-11 09:27:13 +0000 @@ -90,8 +90,6 @@ const char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc."; const char emacs_version[] = "24.0.50"; -extern void malloc_warning (char *); -extern void set_time_zone_rule (char *); #ifdef HAVE_INDEX extern char *index (const char *, int); #endif @@ -2344,17 +2342,16 @@ #endif Lisp_Object -decode_env_path (evarname, defalt) - char *evarname, *defalt; +decode_env_path (const char *evarname, const char *defalt) { - register char *path, *p; + const char *path, *p; Lisp_Object lpath, element, tem; /* It's okay to use getenv here, because this function is only used to initialize variables when Emacs starts up, and isn't called after that. */ if (evarname != 0) - path = (char *) getenv (evarname); + path = getenv (evarname); else path = 0; if (!path) @@ -2363,18 +2360,18 @@ /* Ensure values from the environment use the proper directory separator. */ if (path) { - p = alloca (strlen (path) + 1); - strcpy (p, path); - path = p; - - dostounix_filename (path); + char *path_copy = alloca (strlen (path) + 1); + strcpy (path_copy, path); + dostounix_filename (path_copy); + path = path_copy; } #endif lpath = Qnil; while (1) { p = index (path, SEPCHAR); - if (!p) p = path + strlen (path); + if (!p) + p = path + strlen (path); element = (p - path ? make_string (path, p - path) : build_string (".")); === modified file 'src/eval.c' --- src/eval.c 2010-07-11 08:44:34 +0000 +++ src/eval.c 2010-07-11 09:27:13 +0000 @@ -1775,7 +1775,7 @@ If ARG is not a genuine list, make it a one-element list. */ void -signal_error (char *s, Lisp_Object arg) +signal_error (const char *s, Lisp_Object arg) { Lisp_Object tortoise, hare; @@ -1995,7 +1995,7 @@ /* VARARGS 1 */ void -error (char *m, ...) +error (const char *m, ...) { char buf[200]; int size = 200; === modified file 'src/insdel.c' --- src/insdel.c 2010-07-08 21:25:08 +0000 +++ src/insdel.c 2010-07-11 09:27:13 +0000 @@ -1628,7 +1628,7 @@ void replace_range_2 (EMACS_INT from, EMACS_INT from_byte, EMACS_INT to, EMACS_INT to_byte, - char *ins, EMACS_INT inschars, EMACS_INT insbytes, + const char *ins, EMACS_INT inschars, EMACS_INT insbytes, int markers) { EMACS_INT nbytes_del, nchars_del; === modified file 'src/keyboard.c' --- src/keyboard.c 2010-07-11 08:38:40 +0000 +++ src/keyboard.c 2010-07-11 09:27:13 +0000 @@ -1238,7 +1238,7 @@ string. */ void -cmd_error_internal (Lisp_Object data, char *context) +cmd_error_internal (Lisp_Object data, const char *context) { struct frame *sf = SELECTED_FRAME (); === modified file 'src/keyboard.h' --- src/keyboard.h 2010-07-02 09:26:33 +0000 +++ src/keyboard.h 2010-07-11 09:27:13 +0000 @@ -468,7 +468,6 @@ extern void swallow_events (int); extern int help_char_p (Lisp_Object); extern void quit_throw_to_read_char (void) NO_RETURN; -extern void cmd_error_internal (Lisp_Object, char *); extern int lucid_event_type_list_p (Lisp_Object); extern void kbd_buffer_store_event (struct input_event *); extern void kbd_buffer_store_event_hold (struct input_event *, === modified file 'src/lisp.h' --- src/lisp.h 2010-07-11 06:59:55 +0000 +++ src/lisp.h 2010-07-11 09:27:13 +0000 @@ -2616,7 +2616,7 @@ EMACS_INT, EMACS_INT); extern void replace_range (EMACS_INT, EMACS_INT, Lisp_Object, int, int, int); extern void replace_range_2 (EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT, - char *, EMACS_INT, EMACS_INT, int); + const char *, EMACS_INT, EMACS_INT, int); extern void syms_of_insdel (void); /* Defined in dispnew.c */ @@ -2650,16 +2650,16 @@ extern Lisp_Object current_message (void); extern void set_message (const char *s, Lisp_Object, int, int); extern void clear_message (int, int); -extern void message (char *, ...); -extern void message_nolog (char *, ...); -extern void message1 (char *); -extern void message1_nolog (char *); +extern void message (const char *, ...); +extern void message_nolog (const char *, ...); +extern void message1 (const char *); +extern void message1_nolog (const char *); extern void message2 (const char *, int, int); extern void message2_nolog (const char *, int, int); extern void message3 (Lisp_Object, int, int); extern void message3_nolog (Lisp_Object, int, int); extern void message_dolog (const char *, int, int, int); -extern void message_with_string (char *, Lisp_Object, int); +extern void message_with_string (const char *, Lisp_Object, int); extern void message_log_maybe_newline (void); extern void update_echo_area (void); extern void truncate_echo_area (int); @@ -2680,14 +2680,14 @@ extern void syms_of_xsettings (void); /* Defined in vm-limit.c. */ -extern void memory_warnings (POINTER_TYPE *, void (*warnfun) (char*)); +extern void memory_warnings (POINTER_TYPE *, void (*warnfun) (const char *)); /* Defined in alloc.c */ extern void check_pure_size (void); extern void allocate_string_data (struct Lisp_String *, int, int); extern void reset_malloc_hooks (void); extern void uninterrupt_malloc (void); -extern void malloc_warning (char *); +extern void malloc_warning (const char *); extern void memory_full (void) NO_RETURN; extern void buffer_memory_full (void) NO_RETURN; extern int survives_gc_p (Lisp_Object); @@ -2791,16 +2791,17 @@ extern void temp_output_buffer_setup (const char *); extern int print_level, print_escape_newlines; extern Lisp_Object Qprint_escape_newlines; -extern void write_string (char *, int); -extern void write_string_1 (char *, int, Lisp_Object); -extern void print_error_message (Lisp_Object, Lisp_Object, char *, Lisp_Object); +extern void write_string (const char *, int); +extern void write_string_1 (const char *, int, Lisp_Object); +extern void print_error_message (Lisp_Object, Lisp_Object, const char *, + Lisp_Object); extern Lisp_Object internal_with_output_to_temp_buffer (const char *, Lisp_Object (*) (Lisp_Object), Lisp_Object); extern void float_to_string (unsigned char *, double); extern void syms_of_print (void); /* Defined in doprnt.c */ -extern int doprnt (char *, int, char *, char *, va_list); +extern int doprnt (char *, int, const char *, const char *, va_list); /* Defined in lread.c */ extern Lisp_Object Qvariable_documentation, Qstandard_input; @@ -2819,7 +2820,7 @@ extern Lisp_Object check_obarray (Lisp_Object); extern Lisp_Object intern (const char *); extern Lisp_Object intern_c_string (const char *); -extern Lisp_Object make_symbol (char *); +extern Lisp_Object make_symbol (const char *); extern Lisp_Object oblookup (Lisp_Object, const char *, int, int); #define LOADHIST_ATTACH(x) \ do { \ @@ -2829,10 +2830,10 @@ extern Lisp_Object Vload_history, Vload_suffixes, Vload_file_rep_suffixes; extern int openp (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object *, Lisp_Object); -extern int isfloat_string (char *, int); +extern int isfloat_string (const char *, int); extern void map_obarray (Lisp_Object, void (*) (Lisp_Object, Lisp_Object), Lisp_Object); -extern void dir_warning (char *, Lisp_Object); +extern void dir_warning (const char *, Lisp_Object); extern void close_load_descs (void); extern void init_obarray (void); extern void init_lread (void); @@ -2885,7 +2886,7 @@ extern void xsignal1 (Lisp_Object, Lisp_Object) NO_RETURN; extern void xsignal2 (Lisp_Object, Lisp_Object, Lisp_Object) NO_RETURN; extern void xsignal3 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object) NO_RETURN; -extern void signal_error (char *, Lisp_Object) NO_RETURN; +extern void signal_error (const char *, Lisp_Object) NO_RETURN; EXFUN (Fautoload, 5); EXFUN (Fcommandp, 2); EXFUN (Feval, 1); @@ -2912,7 +2913,7 @@ extern void specbind (Lisp_Object, Lisp_Object); extern void record_unwind_protect (Lisp_Object (*) (Lisp_Object), Lisp_Object); extern Lisp_Object unbind_to (int, Lisp_Object); -extern void error (char *, ...) NO_RETURN; +extern void error (const char *, ...) NO_RETURN; extern void do_autoload (Lisp_Object, Lisp_Object); extern Lisp_Object un_autoload (Lisp_Object); EXFUN (Ffetch_bytecode, 1); @@ -2951,7 +2952,7 @@ EXFUN (Fbobp, 0); EXFUN (Fformat, MANY); EXFUN (Fmessage, MANY); -extern Lisp_Object format2 (char *, Lisp_Object, Lisp_Object); +extern Lisp_Object format2 (const char *, Lisp_Object, Lisp_Object); EXFUN (Fbuffer_substring, 2); EXFUN (Fbuffer_string, 0); extern Lisp_Object save_excursion_save (void); @@ -2977,7 +2978,7 @@ EXFUN (Ffield_beginning, 3); EXFUN (Ffield_end, 3); EXFUN (Ffield_string_no_properties, 1); -extern void set_time_zone_rule (char *); +extern void set_time_zone_rule (const char *); /* Defined in buffer.c */ extern int mouse_face_overlay_overlaps (Lisp_Object); @@ -3177,7 +3178,7 @@ extern int detect_input_pending_ignore_squeezables (void); extern int detect_input_pending_run_timers (int); extern void safe_run_hooks (Lisp_Object); -extern void cmd_error_internal (Lisp_Object, char *); +extern void cmd_error_internal (Lisp_Object, const char *); extern Lisp_Object command_loop_1 (void); extern Lisp_Object recursive_edit_1 (void); extern void record_auto_save (void); @@ -3241,7 +3242,7 @@ extern void syms_of_frame (void); /* Defined in emacs.c */ -extern Lisp_Object decode_env_path (char *, char *); +extern Lisp_Object decode_env_path (const char *, const char *); extern Lisp_Object Vinvocation_name, Vinvocation_directory; extern Lisp_Object Vbefore_init_time, Vafter_init_time; extern Lisp_Object Vinstallation_directory; @@ -3527,7 +3528,7 @@ extern char *xstrdup (const char *); -extern char *egetenv (char *); +extern char *egetenv (const char *); /* Set up the name of the machine we're running on. */ extern void init_system_name (void); === modified file 'src/lread.c' --- src/lread.c 2010-07-10 18:52:53 +0000 +++ src/lread.c 2010-07-11 09:27:13 +0000 @@ -3190,11 +3190,10 @@ #define EXP_INT 16 int -isfloat_string (register char *cp, int ignore_trailing) +isfloat_string (const char *cp, int ignore_trailing) { - register int state; - - char *start = cp; + int state; + const char *start = cp; state = 0; if (*cp == '+' || *cp == '-') @@ -3245,7 +3244,8 @@ } return ((ignore_trailing - || (*cp == 0) || (*cp == ' ') || (*cp == '\t') || (*cp == '\n') || (*cp == '\r') || (*cp == '\f')) + || *cp == 0 || *cp == ' ' || *cp == '\t' || *cp == '\n' + || *cp == '\r' || *cp == '\f') && (state == (LEAD_INT|DOT_CHAR|TRAIL_INT) || state == (DOT_CHAR|TRAIL_INT) || state == (LEAD_INT|E_CHAR|EXP_INT) @@ -3588,13 +3588,13 @@ /* Create an uninterned symbol with name STR. */ Lisp_Object -make_symbol (char *str) +make_symbol (const char *str) { int len = strlen (str); - return Fmake_symbol ((!NILP (Vpurify_flag) - ? make_pure_string (str, len, len, 0) - : make_string (str, len))); + return Fmake_symbol (!NILP (Vpurify_flag) + ? make_pure_string (str, len, len, 0) + : make_string (str, len)); } DEFUN ("intern", Fintern, Sintern, 1, 2, 0, @@ -4170,7 +4170,7 @@ does not exist. Print it on stderr and put it in *Messages*. */ void -dir_warning (char *format, Lisp_Object dirname) +dir_warning (const char *format, Lisp_Object dirname) { char *buffer = (char *) alloca (SCHARS (dirname) + strlen (format) + 5); === modified file 'src/print.c' --- src/print.c 2010-07-08 21:25:08 +0000 +++ src/print.c 2010-07-11 09:27:13 +0000 @@ -540,7 +540,7 @@ Do not use this on the contents of a Lisp string. */ void -write_string (char *data, int size) +write_string (const char *data, int size) { PRINTDECLARE; Lisp_Object printcharfun; @@ -557,7 +557,7 @@ Do not use this on the contents of a Lisp string. */ void -write_string_1 (char *data, int size, Lisp_Object printcharfun) +write_string_1 (const char *data, int size, Lisp_Object printcharfun) { PRINTDECLARE; @@ -1007,7 +1007,8 @@ CALLER is the Lisp function inside which the error was signaled. */ void -print_error_message (Lisp_Object data, Lisp_Object stream, char *context, Lisp_Object caller) +print_error_message (Lisp_Object data, Lisp_Object stream, const char *context, + Lisp_Object caller) { Lisp_Object errname, errmsg, file_error, tail; struct gcpro gcpro1; === modified file 'src/vm-limit.c' --- src/vm-limit.c 2010-07-08 03:03:52 +0000 +++ src/vm-limit.c 2010-07-11 09:27:13 +0000 @@ -42,7 +42,7 @@ /* Function to call to issue a warning; 0 means don't issue them. */ -static void (*warn_function) (char *); +static void (*warn_function) (const char *); /* Start of data space; can be changed by calling malloc_init. */ static POINTER data_space_start; @@ -289,7 +289,7 @@ WARNFUN specifies the function to call to issue a warning. */ void -memory_warnings (POINTER start, void (*warnfun) (char *)) +memory_warnings (POINTER start, void (*warnfun) (const char *)) { extern void (* __after_morecore_hook) (void); /* From gmalloc.c */ === modified file 'src/xdisp.c' --- src/xdisp.c 2010-07-11 06:59:55 +0000 +++ src/xdisp.c 2010-07-11 09:27:13 +0000 @@ -8413,7 +8413,7 @@ that was alloca'd. */ void -message1 (char *m) +message1 (const char *m) { message2 (m, (m ? strlen (m) : 0), 0); } @@ -8422,7 +8422,7 @@ /* The non-logging counterpart of message1. */ void -message1_nolog (char *m) +message1_nolog (const char *m) { message2_nolog (m, (m ? strlen (m) : 0), 0); } @@ -8431,7 +8431,7 @@ which gets replaced with STRING. */ void -message_with_string (char *m, Lisp_Object string, int log) +message_with_string (const char *m, Lisp_Object string, int log) { CHECK_STRING (string); @@ -8495,7 +8495,7 @@ any existing message, and let the mini-buffer text show through. */ static void -vmessage (char *m, va_list ap) +vmessage (const char *m, va_list ap) { if (noninteractive) { @@ -8549,7 +8549,7 @@ } void -message (char *m, ...) +message (const char *m, ...) { va_list ap; va_start (ap, m); @@ -8561,7 +8561,7 @@ /* The non-logging version of message. */ void -message_nolog (char *m, ...) +message_nolog (const char *m, ...) { Lisp_Object old_log_max; va_list ap; ------------------------------------------------------------ revno: 100778 committer: Andreas Schwab branch nick: emacs timestamp: Sun 2010-07-11 10:44:34 +0200 message: Fix indentation problem diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-11 08:38:40 +0000 +++ src/ChangeLog 2010-07-11 08:44:34 +0000 @@ -1,5 +1,7 @@ 2010-07-11 Andreas Schwab + * eval.c: Fix indentation problem. + * keyboard.c: Include "process.h" * eval.c: Remove obsolete noinline declaration. === modified file 'src/eval.c' --- src/eval.c 2010-07-11 08:38:22 +0000 +++ src/eval.c 2010-07-11 08:44:34 +0000 @@ -1,7 +1,7 @@ /* Evaluator for GNU Emacs Lisp interpreter. Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 - Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -427,7 +427,7 @@ do { if (!(argnum++)) - val = Feval (Fcar (args_left)); + val = Feval (Fcar (args_left)); else Feval (Fcar (args_left)); args_left = Fcdr (args_left); @@ -462,7 +462,7 @@ do { if (!(argnum++)) - val = Feval (Fcar (args_left)); + val = Feval (Fcar (args_left)); else Feval (Fcar (args_left)); args_left = Fcdr (args_left); @@ -936,30 +936,30 @@ /* If indirect and there's an alias loop, don't check anything else. */ if (XSYMBOL (variable)->redirect == SYMBOL_VARALIAS && NILP (internal_condition_case_1 (lisp_indirect_variable, variable, - Qt, user_variable_p_eh))) + Qt, user_variable_p_eh))) return Qnil; while (1) { documentation = Fget (variable, Qvariable_documentation); if (INTEGERP (documentation) && XINT (documentation) < 0) - return Qt; + return Qt; if (STRINGP (documentation) - && ((unsigned char) SREF (documentation, 0) == '*')) - return Qt; + && ((unsigned char) SREF (documentation, 0) == '*')) + return Qt; /* If it is (STRING . INTEGER), a negative integer means a user variable. */ if (CONSP (documentation) - && STRINGP (XCAR (documentation)) - && INTEGERP (XCDR (documentation)) - && XINT (XCDR (documentation)) < 0) - return Qt; + && STRINGP (XCAR (documentation)) + && INTEGERP (XCDR (documentation)) + && XINT (XCDR (documentation)) < 0) + return Qt; /* Customizable? See `custom-variable-p'. */ if ((!NILP (Fget (variable, intern ("standard-value")))) - || (!NILP (Fget (variable, intern ("custom-autoload"))))) - return Qt; + || (!NILP (Fget (variable, intern ("custom-autoload"))))) + return Qt; if (!(XSYMBOL (variable)->redirect == SYMBOL_VARALIAS)) - return Qnil; + return Qnil; /* An indirect variable? Let's follow the chain. */ XSETSYMBOL (variable, SYMBOL_ALIAS (XSYMBOL (variable))); @@ -1246,7 +1246,7 @@ last_time = catchlist == catch; /* Unwind the specpdl stack, and then restore the proper set of - handlers. */ + handlers. */ unbind_to (catchlist->pdlcount, Qnil); handlerlist = catchlist->handlerlist; catchlist = catchlist->next; @@ -1257,8 +1257,8 @@ /* If x_catch_errors was done, turn it off now. (First we give unbind_to a chance to do that.) */ #if 0 /* This would disable x_catch_errors after x_connection_closed. - * The catch must remain in effect during that delicate - * state. --lorentey */ + The catch must remain in effect during that delicate + state. --lorentey */ x_fully_uncatch_errors (); #endif #endif @@ -1334,13 +1334,13 @@ When a handler handles an error, control returns to the `condition-case' and it executes the handler's BODY... with VAR bound to (ERROR-SYMBOL . SIGNAL-DATA) from the error. -(If VAR is nil, the handler can't access that information.) +\(If VAR is nil, the handler can't access that information.) Then the value of the last BODY form is returned from the `condition-case' expression. See also the function `signal' for more info. usage: (condition-case VAR BODYFORM &rest HANDLERS) */) -(Lisp_Object args) + (Lisp_Object args) { register Lisp_Object bodyform, handlers; volatile Lisp_Object var; @@ -1389,7 +1389,7 @@ if (_setjmp (c.jmp)) { if (!NILP (h.var)) - specbind (h.var, c.val); + specbind (h.var, c.val); val = Fprogn (Fcdr (h.chosen_clause)); /* Note that this just undoes the binding of h.var; whoever @@ -1611,7 +1611,7 @@ static Lisp_Object find_handler_clause (Lisp_Object, Lisp_Object, - Lisp_Object, Lisp_Object); + Lisp_Object, Lisp_Object); DEFUN ("signal", Fsignal, Ssignal, 2, 2, 0, doc: /* Signal an error. Args are ERROR-SYMBOL and associated DATA. @@ -2508,7 +2508,7 @@ enum run_hooks_condition {to_completion, until_success, until_failure}; static Lisp_Object run_hook_with_args (int, Lisp_Object *, - enum run_hooks_condition); + enum run_hooks_condition); DEFUN ("run-hooks", Frun_hooks, Srun_hooks, 0, MANY, 0, doc: /* Run each hook in HOOKS. @@ -3246,18 +3246,17 @@ case SYMBOL_VARALIAS: sym = indirect_variable (sym); XSETSYMBOL (symbol, sym); goto start; case SYMBOL_PLAINVAL: - { /* The most common case is that of a non-constant symbol with a - trivial value. Make that as fast as we can. */ - specpdl_ptr->symbol = symbol; - specpdl_ptr->old_value = SYMBOL_VAL (sym); - specpdl_ptr->func = NULL; - ++specpdl_ptr; - if (!sym->constant) - SET_SYMBOL_VAL (sym, value); - else - set_internal (symbol, value, Qnil, 1); - break; - } + /* The most common case is that of a non-constant symbol with a + trivial value. Make that as fast as we can. */ + specpdl_ptr->symbol = symbol; + specpdl_ptr->old_value = SYMBOL_VAL (sym); + specpdl_ptr->func = NULL; + ++specpdl_ptr; + if (!sym->constant) + SET_SYMBOL_VAL (sym, value); + else + set_internal (symbol, value, Qnil, 1); + break; case SYMBOL_LOCALIZED: if (SYMBOL_BLV (sym)->frame_local) error ("Frame-local vars cannot be let-bound"); @@ -3367,7 +3366,7 @@ bound a variable that had a buffer-local or frame-local binding. WHERE nil means that the variable had the default value when it was bound. CURRENT-BUFFER is the buffer that - was current when the variable was bound. */ + was current when the variable was bound. */ else if (CONSP (this_binding.symbol)) { Lisp_Object symbol, where; ------------------------------------------------------------ revno: 100777 committer: Andreas Schwab branch nick: emacs timestamp: Sun 2010-07-11 10:38:40 +0200 message: Fix implicit declaration of kbd_on_hold_p * keyboard.c: Include "process.h" diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-11 08:38:22 +0000 +++ src/ChangeLog 2010-07-11 08:38:40 +0000 @@ -1,5 +1,7 @@ 2010-07-11 Andreas Schwab + * keyboard.c: Include "process.h" + * eval.c: Remove obsolete noinline declaration. * fns.c: Likewise. === modified file 'src/keyboard.c' --- src/keyboard.c 2010-07-10 18:52:53 +0000 +++ src/keyboard.c 2010-07-11 08:38:40 +0000 @@ -42,6 +42,7 @@ #include "puresize.h" #include "systime.h" #include "atimer.h" +#include "process.h" #include #ifdef HAVE_GTK_AND_PTHREAD ------------------------------------------------------------ revno: 100776 committer: Andreas Schwab branch nick: emacs timestamp: Sun 2010-07-11 10:38:22 +0200 message: Remove obsolete noinline declaration * eval.c (apply1, call2): Don't declare noinline. * fns.c (concat): Likewise. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-11 06:59:55 +0000 +++ src/ChangeLog 2010-07-11 08:38:22 +0000 @@ -1,3 +1,8 @@ +2010-07-11 Andreas Schwab + + * eval.c: Remove obsolete noinline declaration. + * fns.c: Likewise. + 2010-07-11 Ken Raeburn * doprnt.c (doprnt): Take a va_list argument instead of count and === modified file 'src/eval.c' --- src/eval.c 2010-07-11 06:59:55 +0000 +++ src/eval.c 2010-07-11 08:38:22 +0000 @@ -172,14 +172,6 @@ static Lisp_Object funcall_lambda (Lisp_Object, int, Lisp_Object*); static void unwind_to_catch (struct catchtag *, Lisp_Object) NO_RETURN; - -#if __GNUC__ -/* "gcc -O3" enables automatic function inlining, which optimizes out - the arguments for the invocations of these functions, whereas they - expect these values on the stack. */ -Lisp_Object apply1 (Lisp_Object fn, Lisp_Object arg) __attribute__((noinline)); -Lisp_Object call2 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2) __attribute__((noinline)); -#endif void init_eval_once (void) === modified file 'src/fns.c' --- src/fns.c 2010-07-08 21:25:08 +0000 +++ src/fns.c 2010-07-11 08:38:22 +0000 @@ -371,14 +371,8 @@ return i1 < SCHARS (s2) ? Qt : Qnil; } -#if __GNUC__ -/* "gcc -O3" enables automatic function inlining, which optimizes out - the arguments for the invocations of this function, whereas it - expects these values on the stack. */ -static Lisp_Object concat (int nargs, Lisp_Object *args, enum Lisp_Type target_type, int last_special) __attribute__((noinline)); -#else /* !__GNUC__ */ -static Lisp_Object concat (int nargs, Lisp_Object *args, enum Lisp_Type target_type, int last_special); -#endif +static Lisp_Object concat (int nargs, Lisp_Object *args, + enum Lisp_Type target_type, int last_special); /* ARGSUSED */ Lisp_Object ------------------------------------------------------------ revno: 100775 committer: Michael Albinus branch nick: trunk timestamp: Sun 2010-07-11 10:28:04 +0200 message: * net/tramp-gvfs.el (tramp-gvfs-handle-copy-file): Do not pass empty argument to gvfs-copy. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-07-10 19:47:59 +0000 +++ lisp/ChangeLog 2010-07-11 08:28:04 +0000 @@ -1,3 +1,8 @@ +2010-07-11 Magnus Henoch + + * net/tramp-gvfs.el (tramp-gvfs-handle-copy-file): Do not pass + empty argument to gvfs-copy. + 2010-07-10 Aleksei Gusev (tiny change) * progmodes/compile.el (compilation-error-regexp-alist-alist): Add === modified file 'lisp/net/tramp-gvfs.el' --- lisp/net/tramp-gvfs.el 2010-06-04 11:26:54 +0000 +++ lisp/net/tramp-gvfs.el 2010-07-11 08:28:04 +0000 @@ -551,11 +551,14 @@ (tramp-message v 4 "`copy-file' failed, trying `gvfs-copy'") (unless (zerop - (tramp-gvfs-send-command - v "gvfs-copy" - (if (or keep-date preserve-uid-gid) "--preserve" "") - (tramp-gvfs-url-file-name filename) - (tramp-gvfs-url-file-name newname))) + (let ((args + (append (if (or keep-date preserve-uid-gid) + (list "--preserve") + nil) + (list + (tramp-gvfs-url-file-name filename) + (tramp-gvfs-url-file-name newname))))) + (apply 'tramp-gvfs-send-command v "gvfs-copy" args))) ;; Propagate the error. (tramp-error v (car err) "%s" (cdr err))))))) ------------------------------------------------------------ revno: 100774 committer: Ken Raeburn branch nick: trunk timestamp: Sun 2010-07-11 02:59:55 -0400 message: Make doprnt and related functions ANSI C compliant, with prototypes. * doprnt.c (doprnt): Take a va_list argument instead of count and pointer. * eval.c (error): Change to a standard-C variadic function. * xdisp.c (vmessage): Renamed from message, made static, and changed to take a va_list argument. (message): New variadic wrapper. (message_nolog): Now a variadic function, calling vmessage. * lisp.h: Include stdarg.h for va_list. (doprnt, error, message, message_nolog): Decls updated. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-11 05:55:06 +0000 +++ src/ChangeLog 2010-07-11 06:59:55 +0000 @@ -1,3 +1,15 @@ +2010-07-11 Ken Raeburn + + * doprnt.c (doprnt): Take a va_list argument instead of count and + pointer. + * eval.c (error): Change to a standard-C variadic function. + * xdisp.c (vmessage): Renamed from message, made static, and + changed to take a va_list argument. + (message): New variadic wrapper. + (message_nolog): Now a variadic function, calling vmessage. + * lisp.h: Include stdarg.h for va_list. + (doprnt, error, message, message_nolog): Decls updated. + 2010-07-11 Eli Zaretskii * process.c (syms_of_process) : Define === modified file 'src/doprnt.c' --- src/doprnt.c 2010-07-07 22:18:28 +0000 +++ src/doprnt.c 2010-07-11 06:59:55 +0000 @@ -59,9 +59,8 @@ Integers are passed as C integers. */ int -doprnt (char *buffer, register int bufsize, char *format, char *format_end, int nargs, char **args) +doprnt (char *buffer, register int bufsize, char *format, char *format_end, va_list ap) { - int cnt = 0; /* Number of arg to gobble next */ register char *fmt = format; /* Pointer into format string */ register char *bufptr = buffer; /* Pointer into output buffer.. */ @@ -161,8 +160,6 @@ case 'd': case 'o': case 'x': - if (cnt == nargs) - error ("Not enough arguments for format string"); if (sizeof (int) == sizeof (EMACS_INT)) ; else if (sizeof (long) == sizeof (EMACS_INT)) @@ -173,7 +170,7 @@ string++; else abort (); - sprintf (sprintf_buffer, fmtcpy, args[cnt++]); + sprintf (sprintf_buffer, fmtcpy, va_arg(ap, char *)); /* Now copy into final output, truncating as nec. */ string = (unsigned char *) sprintf_buffer; goto doit; @@ -182,12 +179,8 @@ case 'e': case 'g': { - union { double d; char *half[2]; } u; - if (cnt + 1 == nargs) - error ("Not enough arguments for format string"); - u.half[0] = args[cnt++]; - u.half[1] = args[cnt++]; - sprintf (sprintf_buffer, fmtcpy, u.d); + double d = va_arg(ap, double); + sprintf (sprintf_buffer, fmtcpy, d); /* Now copy into final output, truncating as nec. */ string = (unsigned char *) sprintf_buffer; goto doit; @@ -196,11 +189,9 @@ case 'S': string[-1] = 's'; case 's': - if (cnt == nargs) - error ("Not enough arguments for format string"); if (fmtcpy[1] != 's') minlen = atoi (&fmtcpy[1]); - string = (unsigned char *) args[cnt++]; + string = va_arg(ap, unsigned char *); tem = strlen (string); width = strwidth (string, tem); goto doit1; @@ -250,16 +241,21 @@ continue; case 'c': - if (cnt == nargs) - error ("Not enough arguments for format string"); - tem = CHAR_STRING ((int) (EMACS_INT) args[cnt], charbuf); - string = charbuf; - cnt++; - string[tem] = 0; - width = strwidth (string, tem); - if (fmtcpy[1] != 'c') - minlen = atoi (&fmtcpy[1]); - goto doit1; + { + /* Sometimes for %c we pass a char, which would widen + to int. Sometimes we pass XFASTINT() or XINT() + values, which would be EMACS_INT. Let's hope that + both are passed the same way, otherwise we'll need + to rewrite callers. */ + EMACS_INT chr = va_arg(ap, EMACS_INT); + tem = CHAR_STRING ((int) chr, charbuf); + string = charbuf; + string[tem] = 0; + width = strwidth (string, tem); + if (fmtcpy[1] != 'c') + minlen = atoi (&fmtcpy[1]); + goto doit1; + } case '%': fmt--; /* Drop thru and this % will be treated as normal */ === modified file 'src/eval.c' --- src/eval.c 2010-07-08 21:25:08 +0000 +++ src/eval.c 2010-07-11 06:59:55 +0000 @@ -2003,9 +2003,7 @@ /* VARARGS 1 */ void -error (m, a1, a2, a3) - char *m; - char *a1, *a2, *a3; +error (char *m, ...) { char buf[200]; int size = 200; @@ -2015,15 +2013,18 @@ int allocated = 0; Lisp_Object string; - args[0] = a1; - args[1] = a2; - args[2] = a3; - mlen = strlen (m); while (1) { - int used = doprnt (buffer, size, m, m + mlen, 3, args); + va_list ap; + int used; + + /* A va_list can't be reused if we have to go around the loop + again; we need to "reinitialize" it each time. */ + va_start(ap, m); + used = doprnt (buffer, size, m, m + mlen, ap); + va_end(ap); if (used < size) break; size *= 2; === modified file 'src/lisp.h' --- src/lisp.h 2010-07-07 22:18:28 +0000 +++ src/lisp.h 2010-07-11 06:59:55 +0000 @@ -21,6 +21,8 @@ #ifndef EMACS_LISP_H #define EMACS_LISP_H +#include + /* Use the configure flag --enable-checking[=LIST] to enable various types of run time checks for Lisp objects. */ @@ -2648,8 +2650,8 @@ extern Lisp_Object current_message (void); extern void set_message (const char *s, Lisp_Object, int, int); extern void clear_message (int, int); -extern void message (/* char *, ... */); -extern void message_nolog (/* char *, ... */); +extern void message (char *, ...); +extern void message_nolog (char *, ...); extern void message1 (char *); extern void message1_nolog (char *); extern void message2 (const char *, int, int); @@ -2798,7 +2800,7 @@ extern void syms_of_print (void); /* Defined in doprnt.c */ -extern int doprnt (char *, int, char *, char *, int, char **); +extern int doprnt (char *, int, char *, char *, va_list); /* Defined in lread.c */ extern Lisp_Object Qvariable_documentation, Qstandard_input; @@ -2910,7 +2912,7 @@ extern void specbind (Lisp_Object, Lisp_Object); extern void record_unwind_protect (Lisp_Object (*) (Lisp_Object), Lisp_Object); extern Lisp_Object unbind_to (int, Lisp_Object); -extern void error (/* char *, ... */) NO_RETURN; +extern void error (char *, ...) NO_RETURN; extern void do_autoload (Lisp_Object, Lisp_Object); extern Lisp_Object un_autoload (Lisp_Object); EXFUN (Ffetch_bytecode, 1); === modified file 'src/xdisp.c' --- src/xdisp.c 2010-07-10 18:52:53 +0000 +++ src/xdisp.c 2010-07-11 06:59:55 +0000 @@ -8494,9 +8494,8 @@ /* Dump an informative message to the minibuf. If M is 0, clear out any existing message, and let the mini-buffer text show through. */ -/* VARARGS 1 */ -void -message (char *m, EMACS_INT a1, EMACS_INT a2, EMACS_INT a3) +static void +vmessage (char *m, va_list ap) { if (noninteractive) { @@ -8505,7 +8504,7 @@ if (noninteractive_need_newline) putc ('\n', stderr); noninteractive_need_newline = 0; - fprintf (stderr, m, a1, a2, a3); + vfprintf (stderr, m, ap); if (cursor_in_echo_area == 0) fprintf (stderr, "\n"); fflush (stderr); @@ -8533,13 +8532,9 @@ if (m) { int len; - char *a[3]; - a[0] = (char *) a1; - a[1] = (char *) a2; - a[2] = (char *) a3; len = doprnt (FRAME_MESSAGE_BUF (f), - FRAME_MESSAGE_BUF_SIZE (f), m, (char *)0, 3, a); + FRAME_MESSAGE_BUF_SIZE (f), m, (char *)0, ap); message2 (FRAME_MESSAGE_BUF (f), len, 0); } @@ -8553,17 +8548,29 @@ } } +void +message (char *m, ...) +{ + va_list ap; + va_start (ap, m); + vmessage (m, ap); + va_end (ap); +} + /* The non-logging version of message. */ void -message_nolog (char *m, EMACS_INT a1, EMACS_INT a2, EMACS_INT a3) +message_nolog (char *m, ...) { Lisp_Object old_log_max; + va_list ap; + va_start (ap, m); old_log_max = Vmessage_log_max; Vmessage_log_max = Qnil; - message (m, a1, a2, a3); + vmessage (m, ap); Vmessage_log_max = old_log_max; + va_end (ap); } ------------------------------------------------------------ revno: 100773 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2010-07-11 09:39:00 +0300 message: Fix bug #6603. makefile.w32-in (obj): Add menu.o, bidi.o, w32uniscrobe.o, and unexw32.o. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2010-07-10 14:29:46 +0000 +++ lib-src/ChangeLog 2010-07-11 06:39:00 +0000 @@ -1,3 +1,8 @@ +2010-07-11 Eli Zaretskii + + * makefile.w32-in (obj): Add menu.o, bidi.o, w32uniscrobe.o, + and unexw32.o. (Bug#6603) + 2010-07-10 Eli Zaretskii * Makefile.in ($(DESTDIR)${archlibdir}): Convert spaces to TABs. === modified file 'lib-src/makefile.w32-in' --- lib-src/makefile.w32-in 2010-06-11 21:26:13 +0000 +++ lib-src/makefile.w32-in 2010-07-11 06:39:00 +0000 @@ -143,11 +143,11 @@ # obj = dosfns.o msdos.o \ xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \ - fontset.o \ + fontset.o menu.o \ w32.o w32console.o w32fns.o w32heap.o w32inevt.o \ w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \ - font.o w32font.o \ - dispnew.o frame.o scroll.o xdisp.o window.o \ + font.o w32font.o w32uniscribe.o \ + dispnew.o frame.o scroll.o xdisp.o window.o bidi.o \ charset.o coding.o category.o ccl.o character.o chartab.o \ cm.o term.o terminal.o xfaces.o \ emacs.o keyboard.o macros.o keymap.o sysdep.o \ @@ -157,7 +157,7 @@ alloc.o data.o doc.o editfns.o callint.o \ eval.o floatfns.o fns.o print.o lread.o \ syntax.o bytecode.o \ - process.o callproc.o \ + process.o callproc.o unexw32.o \ region-cache.o sound.o atimer.o \ doprnt.o strftime.o intervals.o textprop.o composite.o md5.o ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.