Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 101640. ------------------------------------------------------------ revno: 101640 [merge] committer: Kenichi Handa branch nick: trunk timestamp: Mon 2010-09-27 14:55:41 +0900 message: Remove restriction on the number of glyphs in one composition. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-26 20:48:13 +0000 +++ src/ChangeLog 2010-09-27 05:42:43 +0000 @@ -1,3 +1,29 @@ +2010-09-27 Kenichi Handa + + These changes are to remove restriction on the number of glyphs in + one composition. + + * dispextern.h (struct glyph): Change the member "slice" to union. + Remove u.cmp.from and u.cmp.to. Give more bits to u.cmp.id. + (GLYPH_SLICE_EQUAL_P): Adjusted for the above change. + + * dispnew.c (buffer_posn_from_coords): Use glyph->slice.img + instead of glyph->slice. + (marginal_area_string): Likewise. + + * term.c (encode_terminal_code): Use glyph->slice.cmp instead of + glyph->u.cmp. + (append_composite_glyph): Likewise. + + * xdisp.c (dump_glyph): Use glyph->slice.cmp instead of + glyph->u.cmp. + (fill_gstring_glyph_string, x_get_glyph_overhangs) + (append_composite_glyph): Likewise. + (fill_image_glyph_string): Use glyph->slice.img instead of + glyph->slice. + (append_glyph, produce_image_glyph, append_stretch_glyph) + (note_mouse_highlight): Likewise. + 2010-09-26 Jan Djärv * process.c (add_keyboard_wait_descriptor) === modified file 'src/dispextern.h' --- src/dispextern.h 2010-09-25 16:39:13 +0000 +++ src/dispextern.h 2010-09-27 05:42:43 +0000 @@ -394,7 +394,15 @@ w32_char_font_type. Otherwise it equals FONT_TYPE_UNKNOWN. */ unsigned font_type : 3; - struct glyph_slice slice; + /* A union of sub-structures for different glyph types. */ + union + { + /* Metrics of a partial glyph of an image (type == IMAGE_GLYPH). */ + struct glyph_slice img; + /* Start and end indices of glyphs of a graphme cluster of a + composition (type == COMPOSITE_GLYPH). */ + struct { int from, to; } cmp; + } slice; /* A union of sub-structures for different glyph types. */ union @@ -402,16 +410,13 @@ /* Character code for character glyphs (type == CHAR_GLYPH). */ unsigned ch; - /* Sub-structures for type == COMPOSITION_GLYPH. */ + /* Sub-structures for type == COMPOSITE_GLYPH. */ struct { /* Flag to tell if the composition is automatic or not. */ unsigned automatic : 1; /* ID of the composition. */ - unsigned id : 23; - /* Start and end indices of glyphs of the composition. */ - unsigned from : 4; - unsigned to : 4; + unsigned id : 31; } cmp; /* Image ID for image glyphs (type == IMAGE_GLYPH). */ @@ -443,13 +448,21 @@ #define CHAR_GLYPH_SPACE_P(GLYPH) \ ((GLYPH).u.ch == SPACEGLYPH && (GLYPH).face_id == DEFAULT_FACE_ID) -/* Are glyph slices of glyphs *X and *Y equal */ - -#define GLYPH_SLICE_EQUAL_P(X, Y) \ - ((X)->slice.x == (Y)->slice.x \ - && (X)->slice.y == (Y)->slice.y \ - && (X)->slice.width == (Y)->slice.width \ - && (X)->slice.height == (Y)->slice.height) +/* Are glyph slices of glyphs *X and *Y equal? It assumes that both + glyphs have the same type. + + Note: for composition glyphs, we don't have to compare slice.cmp.to + because they should be the same if and only if slice.cmp.from are + the same. */ + +#define GLYPH_SLICE_EQUAL_P(X, Y) \ + ((X)->type == IMAGE_GLYPH \ + ? ((X)->slice.img.x == (Y)->slice.img.x \ + && (X)->slice.img.y == (Y)->slice.img.y \ + && (X)->slice.img.width == (Y)->slice.img.width \ + && (X)->slice.img.height == (Y)->slice.img.height) \ + : ((X)->type != COMPOSITE_GLYPH \ + || (X)->slice.cmp.from == (Y)->slice.cmp.from)) /* Are glyphs *X and *Y displayed equal? */ === modified file 'src/dispnew.c' --- src/dispnew.c 2010-09-24 17:48:10 +0000 +++ src/dispnew.c 2010-09-27 05:42:43 +0000 @@ -5460,8 +5460,8 @@ if (img) { *dy -= row->ascent - glyph->ascent; - *dx += glyph->slice.x; - *dy += glyph->slice.y; + *dx += glyph->slice.img.x; + *dy += glyph->slice.img.y; /* Image slices positions are still relative to the entire image */ *width = img->width; *height = img->height; @@ -5627,8 +5627,8 @@ if (img != NULL) *object = img->spec; y0 -= row->ascent - glyph->ascent; - x0 += glyph->slice.x; - y0 += glyph->slice.y; + x0 += glyph->slice.img.x; + y0 += glyph->slice.img.y; } #endif } === modified file 'src/term.c' --- src/term.c 2010-09-26 15:06:21 +0000 +++ src/term.c 2010-09-27 05:42:43 +0000 @@ -594,7 +594,7 @@ if (src->u.cmp.automatic) { gstring = composition_gstring_from_id (src->u.cmp.id); - required = src->u.cmp.to + 1 - src->u.cmp.from; + required = src->slice.cmp.to + 1 - src->slice.cmp.from; } else { @@ -611,7 +611,7 @@ } if (src->u.cmp.automatic) - for (i = src->u.cmp.from; i <= src->u.cmp.to; i++) + for (i = src->slice.cmp.from; i <= src->slice.cmp.to; i++) { Lisp_Object g = LGSTRING_GLYPH (gstring, i); int c = LGLYPH_CHAR (g); @@ -1791,8 +1791,8 @@ { glyph->u.cmp.automatic = 1; glyph->u.cmp.id = it->cmp_it.id; - glyph->u.cmp.from = it->cmp_it.from; - glyph->u.cmp.to = it->cmp_it.to - 1; + glyph->slice.cmp.from = it->cmp_it.from; + glyph->slice.cmp.to = it->cmp_it.to - 1; } glyph->face_id = it->face_id; === modified file 'src/xdisp.c' --- src/xdisp.c 2010-09-25 16:39:13 +0000 +++ src/xdisp.c 2010-09-27 05:42:43 +0000 @@ -16219,7 +16219,7 @@ if (glyph->u.cmp.automatic) fprintf (stderr, "[%d-%d]", - glyph->u.cmp.from, glyph->u.cmp.to); + glyph->slice.cmp.from, glyph->slice.cmp.to); fprintf (stderr, " . %4d %1.1d%1.1d\n", glyph->face_id, glyph->left_box_line_p, @@ -20605,8 +20605,8 @@ glyph = s->row->glyphs[s->area] + start; last = s->row->glyphs[s->area] + end; s->cmp_id = glyph->u.cmp.id; - s->cmp_from = glyph->u.cmp.from; - s->cmp_to = glyph->u.cmp.to + 1; + s->cmp_from = glyph->slice.cmp.from; + s->cmp_to = glyph->slice.cmp.to + 1; s->face = FACE_FROM_ID (s->f, face_id); lgstring = composition_gstring_from_id (s->cmp_id); s->font = XFONT_OBJECT (LGSTRING_FONT (lgstring)); @@ -20614,8 +20614,8 @@ while (glyph < last && glyph->u.cmp.automatic && glyph->u.cmp.id == s->cmp_id - && s->cmp_to == glyph->u.cmp.from) - s->cmp_to = (glyph++)->u.cmp.to + 1; + && s->cmp_to == glyph->slice.cmp.from) + s->cmp_to = (glyph++)->slice.cmp.to + 1; for (i = s->cmp_from; i < s->cmp_to; i++) { @@ -20705,7 +20705,7 @@ xassert (s->first_glyph->type == IMAGE_GLYPH); s->img = IMAGE_FROM_ID (s->f, s->first_glyph->u.img_id); xassert (s->img); - s->slice = s->first_glyph->slice; + s->slice = s->first_glyph->slice.img; s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id); s->font = s->face->font; s->width = s->first_glyph->pixel_width; @@ -20811,8 +20811,8 @@ Lisp_Object gstring = composition_gstring_from_id (glyph->u.cmp.id); struct font_metrics metrics; - composition_gstring_width (gstring, glyph->u.cmp.from, - glyph->u.cmp.to + 1, &metrics); + composition_gstring_width (gstring, glyph->slice.cmp.from, + glyph->slice.cmp.to + 1, &metrics); if (metrics.rbearing > metrics.width) *right = metrics.rbearing - metrics.width; if (metrics.lbearing < 0) @@ -21517,7 +21517,7 @@ glyph->glyph_not_available_p = it->glyph_not_available_p; glyph->face_id = it->face_id; glyph->u.ch = it->char_to_display; - glyph->slice = null_glyph_slice; + glyph->slice.img = null_glyph_slice; glyph->font_type = FONT_TYPE_UNKNOWN; if (it->bidi_p) { @@ -21574,13 +21574,14 @@ { glyph->u.cmp.automatic = 0; glyph->u.cmp.id = it->cmp_it.id; + glyph->slice.cmp.from = glyph->slice.cmp.to = 0; } else { glyph->u.cmp.automatic = 1; glyph->u.cmp.id = it->cmp_it.id; - glyph->u.cmp.from = it->cmp_it.from; - glyph->u.cmp.to = it->cmp_it.to - 1; + glyph->slice.cmp.from = it->cmp_it.from; + glyph->slice.cmp.to = it->cmp_it.to - 1; } glyph->avoid_cursor_p = it->avoid_cursor_p; glyph->multibyte_p = it->multibyte_p; @@ -21591,7 +21592,6 @@ glyph->padding_p = 0; glyph->glyph_not_available_p = 0; glyph->face_id = it->face_id; - glyph->slice = null_glyph_slice; glyph->font_type = FONT_TYPE_UNKNOWN; if (it->bidi_p) { @@ -21770,7 +21770,7 @@ glyph->glyph_not_available_p = 0; glyph->face_id = it->face_id; glyph->u.img_id = img->id; - glyph->slice = slice; + glyph->slice.img = slice; glyph->font_type = FONT_TYPE_UNKNOWN; if (it->bidi_p) { @@ -21831,7 +21831,7 @@ glyph->face_id = it->face_id; glyph->u.stretch.ascent = ascent; glyph->u.stretch.height = height; - glyph->slice = null_glyph_slice; + glyph->slice.img = null_glyph_slice; glyph->font_type = FONT_TYPE_UNKNOWN; if (it->bidi_p) { @@ -24519,8 +24519,8 @@ if ((image_map = Fplist_get (XCDR (img->spec), QCmap), !NILP (image_map)) && (hotspot = find_hot_spot (image_map, - glyph->slice.x + dx, - glyph->slice.y + dy), + glyph->slice.img.x + dx, + glyph->slice.img.y + dy), CONSP (hotspot)) && (hotspot = XCDR (hotspot), CONSP (hotspot))) { ------------------------------------------------------------ revno: 101639 committer: Katsumi Yamaoka branch nick: trunk timestamp: Mon 2010-09-27 03:16:55 +0000 message: gnus-art.el (gnus-mime-delete-part): Fix Lisp type of byte(s). diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-09-26 23:15:50 +0000 +++ lisp/gnus/ChangeLog 2010-09-27 03:16:55 +0000 @@ -1,3 +1,7 @@ +2010-09-27 Katsumi Yamaoka + + * gnus-art.el (gnus-mime-delete-part): Fix Lisp type of byte(s). + 2010-09-26 Lars Magne Ingebrigtsen * nndoc.el (nndoc-request-list): Return success always. === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2010-09-26 23:01:31 +0000 +++ lisp/gnus/gnus-art.el 2010-09-27 03:16:55 +0000 @@ -5072,7 +5072,7 @@ (unless data (error "No MIME part under point")) (with-current-buffer (mm-handle-buffer data) - (let ((bsize (format "%s" (buffer-size)))) + (let ((bsize (buffer-size))) (erase-buffer) (insert (concat @@ -5081,8 +5081,8 @@ "|\n" "| Type: " type "\n" "| Filename: " filename "\n" - "| Size (encoded): " bsize (format " byte%s\n" - (if (= bsize 1) + "| Size (encoded): " (format "%s byte%s\n" + bsize (if (= bsize 1) "" "s")) (when description ------------------------------------------------------------ revno: 101638 committer: Katsumi Yamaoka branch nick: trunk timestamp: Sun 2010-09-26 23:15:50 +0000 message: Update ChangeLogs. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2010-09-25 21:42:48 +0000 +++ doc/misc/ChangeLog 2010-09-26 23:15:50 +0000 @@ -1,7 +1,43 @@ +2010-09-26 Lars Magne Ingebrigtsen + + * gnus-news.texi: Mention nnimap-inbox. + + * gnus.texi (Picons): Document gnus-picon-inhibit-top-level-domains. + +2010-09-26 Julien Danjou + + * gnus.texi (Oort Gnus): Remove mention of ssl.el + +2010-09-26 Lars Magne Ingebrigtsen + + * gnus.texi (Security): Remove gpg.el mention. + +2010-09-26 Andreas Seltenreich + + * gnus.texi (Browse Foreign Server): New variable + gnus-browse-subscribe-newsgroup-method. + + * gnus-news.texi: Mention it. + +2010-09-26 Lars Magne Ingebrigtsen + + * gnus.texi (NoCeM): Removed. + (Startup Variables): No jingle. + 2010-09-25 Ulrich Mueller * woman.texi (Interface Options): xz compression is now supported. +2010-09-25 Lars Magne Ingebrigtsen + + * gnus.texi (Article Commands): Document gnus-fetch-partial-articles. + (Unavailable Servers): Document gnus-server-copy-server. + (Using IMAP): Document the new nnimap. + +2010-09-25 Julien Danjou + + * gnus.texi (Customizing Articles): Remove gnus-treat-translate + 2010-09-24 Glenn Morris * url.texi (Disk Caching): Tweak previous change. @@ -11,6 +47,14 @@ * url.texi (Disk Caching): Mention url-cache-expire-time, url-cache-expired, and url-fetch-from-cache. +2010-09-24 Julien Danjou + + * gnus.texi: Add Gravatars. + +2010-09-23 Lars Magne Ingebrigtsen + + * gnus.texi (Startup Variables): Mention gnus-use-backend-marks. + 2010-09-21 Lars Magne Ingebrigtsen * gnus.texi (Expunging mailboxes): Update name of the expunging === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-09-26 14:35:50 +0000 +++ lisp/gnus/ChangeLog 2010-09-26 23:15:50 +0000 @@ -1,5 +1,51 @@ 2010-09-26 Lars Magne Ingebrigtsen + * nndoc.el (nndoc-request-list): Return success always. + + * gnus-agent.el (gnus-agent-retrieve-headers): Don't propagate + `fetch-old' -- we only want to fetch the articles we've requested. The + rest are in the agent, probably. + (gnus-agent-read-servers-validate): Change the level for the "Ignoring + disappeared server" to something low. It's not important. + + * nnimap.el (nnimap-get-whole-article): Remove the data that may have + arrived before the FETCH data. + + * nnmh.el (nnmh-request-expire-articles): Don't try to fetch the expiry + target here, because we don't know the Gnus name of the group. + + * nndraft.el (nndraft-request-expire-articles): Fetch the expiry target + for the correct group. + + * gnus-ems.el (gnus-create-image): Ignore all image-creation errors. + + * gnus.el (gnus): Give a final warning after startup. + + * gnus-util.el (gnus-action-message-log): New variable. + (gnus-message): Use it. + (gnus-final-warning): New function. + + * nnimap.el (nnimap-open-connection): Record the greeting. + (nnimap): Add greeting. + +2010-09-26 Julien Danjou + + * gnus-html.el (gnus-html-show-images): Fix gnus-html-display-image + arguments. + (gnus-html-wash-images): Fix spec computing to include start/end. + + * gnus-art.el (gnus-article-treat-body-boundary): Fix length computing. + +2010-09-26 Lars Magne Ingebrigtsen + + * nnimap.el (nnimap-request-expire-articles): Compress ranges before + deletion. + (nnimap-retrieve-headers): Don't select the group, because that's + already done by nnimap-possibly-change-group. + + * gnus-picon.el (gnus-picon-inhibit-top-level-domains): New variable. + (gnus-picon-transform-address): Use it. + * mail-source.el (mail-source-value): Revert previous patch. * nnimap.el (nnimap-credentials): Allow inhibiting the password query ------------------------------------------------------------ revno: 101637 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Sun 2010-09-26 23:01:31 +0000 message: mail-source.el (mail-source-value): Revert previous patch. gnus-picon.el: Inhibit showing picons for top level domains. gnus-art.el (gnus-article-treat-body-boundary): Fix length computing. gnus-news.texi: Mention nnimap-inbox. nnimap.el (nnimap-request-expire-articles): Compress ranges before deletion. nnimap.el (nnimap-retrieve-headers): Don't select the group, because that's already done by nnimap-possibly-change-group. gnus-html.el (gnus-html-show-images): Fix gnus-html-display-image arguments. gnus-html.el (gnus-html-wash-images): Fix spec computing to include start/end. nnimap.el: Store the IMAP greeting, so that we can tell what kind of server we're talking to. gnus.el (gnus): Give a final warning after startup. gnus-ems.el (gnus-create-image): Ignore all image-creation errors. nndraft.el (nndraft-request-expire-articles): Fetch the expiry target for the correct group. nnmh.el (nnmh-request-expire-articles): Don't try to fetch the expiry target here, because we don't know the Gnus name of the group. nnimap.el (nnimap-get-whole-article): Remove the data that may have arrived before the FETCH data. gnus-agent.el (gnus-agent-retrieve-headers): Don't propagate `fetch-old'. gnus-agent.el (gnus-agent-read-servers-validate): Change the level for the "Ignoring disappeared server" to something low. nndoc.el (nndoc-request-list): Return success always. diff: === modified file 'doc/misc/gnus-news.texi' --- doc/misc/gnus-news.texi 2010-09-26 12:47:09 +0000 +++ doc/misc/gnus-news.texi 2010-09-26 23:01:31 +0000 @@ -68,8 +68,10 @@ @item New version of @code{nnimap} -@code{nnimap} has been reimplemented in a mostly-compatible way. -@c Mention any incompatibilities. +@code{nnimap} has been reimplemented in a mostly-compatible way. See +the Gnus manual for a description of the new interface. In +particular, @code{nnimap-inbox} and the client side split method has +changed. @item Gnus includes the Emacs Lisp @acronym{SASL} library. === modified file 'doc/misc/gnus.texi' --- doc/misc/gnus.texi 2010-09-26 14:35:50 +0000 +++ doc/misc/gnus.texi 2010-09-26 23:01:31 +0000 @@ -23233,6 +23233,12 @@ Ordered list of suffixes on picon file names to try. Defaults to @code{("xpm" "gif" "xbm")} minus those not built-in your Emacs. +@item gnus-picon-inhibit-top-level-domains +@vindex gnus-picon-inhibit-top-level-domains +If non-@code{nil} (which is the default), don't display picons for +things like @samp{.net} and @samp{.de}, which aren't usually very +interesting. + @end table @node Gravatars === modified file 'lisp/gnus/gnus-agent.el' --- lisp/gnus/gnus-agent.el 2010-09-24 07:25:37 +0000 +++ lisp/gnus/gnus-agent.el 2010-09-26 23:01:31 +0000 @@ -1026,7 +1026,7 @@ (unless (member server gnus-agent-covered-methods) (push server gnus-agent-covered-methods) (setq gnus-agent-method-p-cache nil)) - (gnus-message 1 "Ignoring disappeared server `%s'" server)))) + (gnus-message 8 "Ignoring disappeared server `%s'" server)))) (prog1 gnus-agent-covered-methods (setq gnus-agent-covered-methods nil)))) @@ -3752,7 +3752,7 @@ (erase-buffer) (cond ((not (eq 'nov (let (gnus-agent) ; Turn off agent (gnus-retrieve-headers - uncached-articles group fetch-old)))) + uncached-articles group)))) (nnvirtual-convert-headers)) ((eq 'nntp (car gnus-current-select-method)) ;; The author of gnus-get-newsgroup-headers-xover === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2010-09-26 14:35:50 +0000 +++ lisp/gnus/gnus-art.el 2010-09-26 23:01:31 +0000 @@ -2301,9 +2301,9 @@ (insert "X-Boundary: ") (gnus-add-text-properties start (point) '(invisible t intangible t)) (insert (let (str) - (while (>= (1- (window-width)) (length str)) + (while (>= (window-width) (length str)) (setq str (concat str gnus-body-boundary-delimiter))) - (substring str 0 (1- (window-width)))) + (substring str 0 (window-width))) "\n") (gnus-put-text-property start (point) 'gnus-decoration 'header))))) === modified file 'lisp/gnus/gnus-ems.el' --- lisp/gnus/gnus-ems.el 2010-09-25 13:43:27 +0000 +++ lisp/gnus/gnus-ems.el 2010-09-26 23:01:31 +0000 @@ -272,7 +272,8 @@ (when face (setq props (plist-put props :foreground (face-foreground face))) (setq props (plist-put props :background (face-background face)))) - (apply 'create-image file type data-p props))) + (ignore-errors + (apply 'create-image file type data-p props)))) (defun gnus-put-image (glyph &optional string category) (let ((point (point))) === modified file 'lisp/gnus/gnus-html.el' --- lisp/gnus/gnus-html.el 2010-09-26 04:03:19 +0000 +++ lisp/gnus/gnus-html.el 2010-09-26 23:01:31 +0000 @@ -226,7 +226,7 @@ :keymap gnus-html-image-map :button-keymap gnus-html-image-map) (let ((overlay (gnus-make-overlay start end)) - (spec (list url alt-text))) + (spec (list url start end alt-text))) (gnus-overlay-put overlay 'local-map gnus-html-image-map) (gnus-overlay-put overlay 'gnus-image spec) (gnus-put-text-property === modified file 'lisp/gnus/gnus-picon.el' --- lisp/gnus/gnus-picon.el 2010-09-26 14:35:50 +0000 +++ lisp/gnus/gnus-picon.el 2010-09-26 23:01:31 +0000 @@ -85,6 +85,12 @@ (const right)) :group 'gnus-picon) +(defcustom gnus-picon-inhibit-top-level-domains t + "If non-nil, don't piconify top-level domains. +These are often not very interesting." + :type 'boolean + :group 'gnus-picon) + ;;; Internal variables: (defvar gnus-picon-glyph-alist nil @@ -188,7 +194,9 @@ (setcar spec (cons (gnus-picon-create-glyph file) (car spec)))) - (dotimes (i (1- (length spec))) + (dotimes (i (- (length spec) + (if gnus-picon-inhibit-top-level-domains + 2 1))) (when (setq file (gnus-picon-find-face (concat "unknown@" (mapconcat === modified file 'lisp/gnus/gnus-util.el' --- lisp/gnus/gnus-util.el 2010-09-24 07:25:37 +0000 +++ lisp/gnus/gnus-util.el 2010-09-26 23:01:31 +0000 @@ -601,6 +601,8 @@ (t (apply 'message ,format-string ,args)))))))) +(defvar gnus-action-message-log nil) + (defun gnus-message-with-timestamp (format-string &rest args) "Display message with timestamp. Arguments are the same as `message'. The `gnus-add-timestamp-to-message' variable controls how to add @@ -615,14 +617,26 @@ that take a long time, 7 - not very important messages on stuff, 9 - messages inside loops." (if (<= level gnus-verbose) - (if gnus-add-timestamp-to-message - (apply 'gnus-message-with-timestamp args) - (apply 'message args)) + (let ((message + (if gnus-add-timestamp-to-message + (apply 'gnus-message-with-timestamp args) + (apply 'message args)))) + (when (and (consp gnus-action-message-log) + (<= level 3)) + (push message gnus-action-message-log)) + message) ;; We have to do this format thingy here even if the result isn't ;; shown - the return value has to be the same as the return value ;; from `message'. (apply 'format args))) +(defun gnus-final-warning () + (when (and (consp gnus-action-message-log) + (setq gnus-action-message-log + (delete nil gnus-action-message-log))) + (message "Warning: %s" + (mapconcat #'identity gnus-action-message-log "; ")))) + (defun gnus-error (level &rest args) "Beep an error if LEVEL is equal to or less than `gnus-verbose'. ARGS are passed to `message'." === modified file 'lisp/gnus/gnus.el' --- lisp/gnus/gnus.el 2010-09-26 12:47:09 +0000 +++ lisp/gnus/gnus.el 2010-09-26 23:01:31 +0000 @@ -4366,7 +4366,9 @@ (unless (byte-code-function-p (symbol-function 'gnus)) (message "You should byte-compile Gnus") (sit-for 2)) - (gnus-1 arg dont-connect slave)) + (let ((gnus-action-message-log (list nil))) + (gnus-1 arg dont-connect slave) + (gnus-final-warning))) ;; Allow redefinition of Gnus functions. === modified file 'lisp/gnus/nndoc.el' --- lisp/gnus/nndoc.el 2010-09-26 04:03:19 +0000 +++ lisp/gnus/nndoc.el 2010-09-26 23:01:31 +0000 @@ -298,7 +298,7 @@ t) (deffoo nndoc-request-list (&optional server) - nil) + t) (deffoo nndoc-request-newgroups (date &optional server) nil) === modified file 'lisp/gnus/nndraft.el' --- lisp/gnus/nndraft.el 2010-09-25 15:07:55 +0000 +++ lisp/gnus/nndraft.el 2010-09-26 23:01:31 +0000 @@ -222,6 +222,11 @@ (deffoo nndraft-request-expire-articles (articles group &optional server force) (nndraft-possibly-change-group group) (let* ((nnmh-allow-delete-final t) + (nnmail-expiry-target + (or (gnus-group-find-parameter + (gnus-group-prefixed-name "nndraft" (list 'nndraft server)) + 'expiry-target t) + nnmail-expiry-target)) (res (nnoo-parent-function 'nndraft 'nnmh-request-expire-articles (list articles group server force))) === modified file 'lisp/gnus/nnimap.el' --- lisp/gnus/nnimap.el 2010-09-26 14:35:50 +0000 +++ lisp/gnus/nnimap.el 2010-09-26 23:01:31 +0000 @@ -96,7 +96,7 @@ (defstruct nnimap group process commands capabilities select-result newlinep server - last-command-time) + last-command-time greeting) (defvar nnimap-object nil) @@ -119,7 +119,6 @@ (erase-buffer) (when (nnimap-possibly-change-group group server) (with-current-buffer (nnimap-buffer) - (nnimap-send-command "SELECT %S" (utf7-encode group t)) (erase-buffer) (nnimap-wait-for-response (nnimap-send-command @@ -318,6 +317,9 @@ (nnheader-report 'nnimap "%s" (buffer-substring (point) (line-end-position))) + (setf (nnimap-greeting nnimap-object) + (buffer-substring (line-beginning-position) + (line-end-position))) (when (eq nnimap-stream 'starttls) (nnimap-command "STARTTLS") (starttls-negotiate (nnimap-process nnimap-object))) @@ -419,10 +421,13 @@ article))) ;; Check that we really got an article. (goto-char (point-min)) - (unless (looking-at "\\* [0-9]+ FETCH") + (unless (re-search-forward "\\* [0-9]+ FETCH" nil t) (setq result nil)) (when result - (goto-char (point-min)) + ;; Remove any data that may have arrived before the FETCH data. + (beginning-of-line) + (unless (bobp) + (delete-region (point-min) (point))) (let ((bytes (nnimap-get-length))) (delete-region (line-beginning-position) (progn (forward-line 1) (point))) @@ -626,7 +631,7 @@ articles) ((and force (eq nnmail-expiry-target 'delete)) - (unless (nnimap-delete-article articles) + (unless (nnimap-delete-article (gnus-compress-sequence articles)) (message "Article marked for deletion, but not expunged.")) nil) (t @@ -640,7 +645,7 @@ (if (null deletable-articles) articles (if (eq nnmail-expiry-target 'delete) - (nnimap-delete-article deletable-articles) + (nnimap-delete-article (gnus-compress-sequence deletable-articles)) (setq deletable-articles (nnimap-process-expiry-targets deletable-articles group server))) @@ -667,7 +672,7 @@ ;; Change back to the current group again. (nnimap-possibly-change-group group server) (setq deleted-articles (nreverse deleted-articles)) - (nnimap-delete-article deleted-articles) + (nnimap-delete-article (gnus-compress-sequence deleted-articles)) deleted-articles)) (defun nnimap-find-expired-articles (group) === modified file 'lisp/gnus/nnmh.el' --- lisp/gnus/nnmh.el 2010-09-18 23:36:29 +0000 +++ lisp/gnus/nnmh.el 2010-09-26 23:01:31 +0000 @@ -258,9 +258,6 @@ &optional server force) (nnmh-possibly-change-directory newsgroup server) (let ((is-old t) - (nnmail-expiry-target - (or (gnus-group-find-parameter newsgroup 'expiry-target t) - nnmail-expiry-target)) article rest mod-time) (nnheader-init-server-buffer) ------------------------------------------------------------ revno: 101636 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2010-09-27 00:42:53 +0200 message: * lisp/emacs-lisp/pcase.el (pcase-let*, pcase-let): plet -> pcase-let. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-09-26 15:30:44 +0000 +++ lisp/ChangeLog 2010-09-26 22:42:53 +0000 @@ -1,3 +1,7 @@ +2010-09-26 Stefan Monnier + + * emacs-lisp/pcase.el (pcase-let*, pcase-let): plet -> pcase-let. + 2010-09-26 Lars Magne Ingebrigtsen * net/gnutls.el (starttls-negotiate): Avoid the cl.el decf function. === modified file 'lisp/emacs-lisp/pcase.el' --- lisp/emacs-lisp/pcase.el 2010-09-01 10:03:08 +0000 +++ lisp/emacs-lisp/pcase.el 2010-09-26 22:42:53 +0000 @@ -76,8 +76,8 @@ of the form (UPAT EXP)." (if (null bindings) body `(pcase ,(cadr (car bindings)) - (,(caar bindings) (plet* ,(cdr bindings) ,body)) - (t (error "Pattern match failure in `plet'"))))) + (,(caar bindings) (pcase-let* ,(cdr bindings) ,body)) + (t (error "Pattern match failure in `pcase-let'"))))) ;;;###autoload (defmacro pcase-let (bindings body) @@ -85,13 +85,14 @@ BODY should be an expression, and BINDINGS should be a list of bindings of the form (UPAT EXP)." (if (null (cdr bindings)) - `(plet* ,bindings ,body) + `(pcase-let* ,bindings ,body) (setq bindings (mapcar (lambda (x) (cons (make-symbol "x") x)) bindings)) `(let ,(mapcar (lambda (binding) (list (nth 0 binding) (nth 2 binding))) bindings) - (plet* ,(mapcar (lambda (binding) (list (nth 1 binding) (nth 0 binding))) - bindings) - ,body)))) + (pcase-let* + ,(mapcar (lambda (binding) (list (nth 1 binding) (nth 0 binding))) + bindings) + ,body)))) (defun pcase-expand (exp cases) (let* ((defs (if (symbolp exp) '() ------------------------------------------------------------ revno: 101635 committer: Jan D branch nick: trunk timestamp: Sun 2010-09-26 22:48:13 +0200 message: Donät give write_mask to select for W32. process.c (wait_reading_process_output): Don't pass write_mask to select if SELECT_CANT_DO_WRITE_MASK is defined. (SELECT_CANT_DO_WRITE_MASK): Define if SELECT_CANT_DO_WRITE_MASK. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-26 20:21:29 +0000 +++ src/ChangeLog 2010-09-26 20:48:13 +0000 @@ -2,6 +2,9 @@ * process.c (add_keyboard_wait_descriptor) (delete_keyboard_wait_descriptor): Reinstate ifdef subprocesses. + (wait_reading_process_output): Don't pass write_mask to select + if SELECT_CANT_DO_WRITE_MASK is defined. + (SELECT_CANT_DO_WRITE_MASK): Define if SELECT_CANT_DO_WRITE_MASK. * process.h (add_read_fd, delete_read_fd, add_write_fd) (delete_write_fd): Declare. === modified file 'src/process.c' --- src/process.c 2010-09-26 20:21:29 +0000 +++ src/process.c 2010-09-26 20:48:13 +0000 @@ -201,8 +201,10 @@ /* Define NON_BLOCKING_CONNECT if we can support non-blocking connects. */ +/* Only W32 has this, it really means that select can't take write mask. */ #ifdef BROKEN_NON_BLOCKING_CONNECT #undef NON_BLOCKING_CONNECT +#define SELECT_CANT_DO_WRITE_MASK #else #ifndef NON_BLOCKING_CONNECT #ifdef HAVE_SELECT @@ -4726,7 +4728,11 @@ else Available = input_wait_mask; Writeok = write_mask; +#ifdef SELECT_CANT_DO_WRITE_MASK + check_write = 0; +#else check_write = 1; +#endif check_delay = wait_channel >= 0 ? 0 : process_output_delay_count; } ------------------------------------------------------------ revno: 101634 committer: Jan D branch nick: trunk timestamp: Sun 2010-09-26 22:21:29 +0200 message: Reinstate ifdef subprocesses. * process.c (add_keyboard_wait_descriptor) (delete_keyboard_wait_descriptor): Reinstate ifdef subprocesses. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-26 16:20:01 +0000 +++ src/ChangeLog 2010-09-26 20:21:29 +0000 @@ -1,5 +1,8 @@ 2010-09-26 Jan Djärv + * process.c (add_keyboard_wait_descriptor) + (delete_keyboard_wait_descriptor): Reinstate ifdef subprocesses. + * process.h (add_read_fd, delete_read_fd, add_write_fd) (delete_write_fd): Declare. === modified file 'src/process.c' --- src/process.c 2010-09-26 16:20:01 +0000 +++ src/process.c 2010-09-26 20:21:29 +0000 @@ -7086,10 +7086,12 @@ void add_keyboard_wait_descriptor (int desc) { +#ifdef subprocesses /* actually means "not MSDOS" */ FD_SET (desc, &input_wait_mask); FD_SET (desc, &non_process_wait_mask); if (desc > max_input_desc) max_input_desc = desc; +#endif } /* From now on, do not expect DESC to give keyboard input. */ @@ -7097,6 +7099,7 @@ void delete_keyboard_wait_descriptor (int desc) { +#ifdef subprocesses int fd; int lim = max_input_desc; @@ -7107,6 +7110,7 @@ for (fd = 0; fd < lim; fd++) if (FD_ISSET (fd, &input_wait_mask) || FD_ISSET (fd, &write_mask)) max_input_desc = fd; +#endif } /* Setup coding systems of PROCESS. */ ------------------------------------------------------------ revno: 101633 committer: Jan D branch nick: trunk timestamp: Sun 2010-09-26 18:20:01 +0200 message: Add fd handling with callbacks to select, dbus needs it for async operation. * src/dbusbind.c: Include process.h. (dbus_fd_cb, xd_find_watch_fd, xd_toggle_watch) (xd_read_message_1): New functions. (xd_add_watch, xd_remove_watch): Call xd_find_watch_fd. Handle watch for both read and write. (Fdbus_init_bus): Also register xd_toggle_watch. (Fdbus_call_method_asynchronously, Fdbus_method_return_internal) (Fdbus_method_error_internal, Fdbus_send_signal): Remove call to dbus_connection_flush. (xd_read_message): Move most of the code to xd_read_message_1. Call xd_read_message_1 until status is COMPLETE. * src/keyboard.c (readable_events, gobble_input): Remove DBUS code. * src/process.c (gpm_wait_mask, max_gpm_desc): Remove. (write_mask): New variable. (max_input_desc): Renamed from max_keyboard_desc. (fd_callback_info): New variable. (add_read_fd, delete_read_fd, add_write_fd, delete_write_fd): New functions. (Fmake_network_process): FD_SET write_mask. (deactivate_process): FD_CLR write_mask. (wait_reading_process_output): Connecting renamed to Writeok. check_connect removed. check_write is new. Remove references to gpm. Use Writeok/check_write unconditionally (i.e. no #ifdef NON_BLOCKING_CONNECT) instead of Connecting. Loop over file descriptors and call callbacks in fd_callback_info if file descriptor is ready for I/O. (add_gpm_wait_descriptor): Just call add_keyboard_wait_descriptor. (delete_gpm_wait_descriptor): Just call delete_keyboard_wait_descriptor. (keyboard_bit_set): Use max_input_desc. (add_keyboard_wait_descriptor, delete_keyboard_wait_descriptor): Remove #ifdef subprocesses. Use max_input_desc. (init_process): Initialize write_mask and fd_callback_info. * src/process.h (add_read_fd, delete_read_fd, add_write_fd) (delete_write_fd): Declare. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-26 15:06:21 +0000 +++ src/ChangeLog 2010-09-26 16:20:01 +0000 @@ -1,3 +1,43 @@ +2010-09-26 Jan Djärv + + * process.h (add_read_fd, delete_read_fd, add_write_fd) + (delete_write_fd): Declare. + + * process.c (gpm_wait_mask, max_gpm_desc): Remove. + (write_mask): New variable. + (max_input_desc): Renamed from max_keyboard_desc. + (fd_callback_info): New variable. + (add_read_fd, delete_read_fd, add_write_fd, delete_write_fd): New + functions. + (Fmake_network_process): FD_SET write_mask. + (deactivate_process): FD_CLR write_mask. + (wait_reading_process_output): Connecting renamed to Writeok. + check_connect removed. check_write is new. Remove references to + gpm. Use Writeok/check_write unconditionally (i.e. no #ifdef + NON_BLOCKING_CONNECT) instead of Connecting. + Loop over file descriptors and call callbacks in fd_callback_info + if file descriptor is ready for I/O. + (add_gpm_wait_descriptor): Just call add_keyboard_wait_descriptor. + (delete_gpm_wait_descriptor): Just call delete_keyboard_wait_descriptor. + (keyboard_bit_set): Use max_input_desc. + (add_keyboard_wait_descriptor, delete_keyboard_wait_descriptor): Remove + #ifdef subprocesses. Use max_input_desc. + (init_process): Initialize write_mask and fd_callback_info. + + * keyboard.c (readable_events, gobble_input): Remove DBUS code. + + * dbusbind.c: Include process.h. + (dbus_fd_cb, xd_find_watch_fd, xd_toggle_watch) + (xd_read_message_1): New functions. + (xd_add_watch, xd_remove_watch): Call xd_find_watch_fd. Handle + watch for both read and write. + (Fdbus_init_bus): Also register xd_toggle_watch. + (Fdbus_call_method_asynchronously, Fdbus_method_return_internal) + (Fdbus_method_error_internal, Fdbus_send_signal): Remove call + to dbus_connection_flush. + (xd_read_message): Move most of the code to xd_read_message_1. + Call xd_read_message_1 until status is COMPLETE. + 2010-09-26 Dan Nicolaescu * term.c: Do not include sys/ioctl.h, not needed. === modified file 'src/dbusbind.c' --- src/dbusbind.c 2010-08-23 13:02:00 +0000 +++ src/dbusbind.c 2010-09-26 16:20:01 +0000 @@ -27,6 +27,7 @@ #include "frame.h" #include "termhooks.h" #include "keyboard.h" +#include "process.h" /* Subroutines. */ @@ -799,71 +800,93 @@ return connection; } - -/* Add connection file descriptor to input_wait_mask, in order to - let select() detect, whether a new message has been arrived. */ -dbus_bool_t +/* Callback called when something is read to read ow write. */ + +static void +dbus_fd_cb (int fd, void *data, int for_read) +{ + xd_read_queued_messages (); +} + +/* Return the file descriptor for WATCH, -1 if not found. */ + +static int +xd_find_watch_fd (DBusWatch *watch) +{ +#if HAVE_DBUS_WATCH_GET_UNIX_FD + /* TODO: Reverse these on Win32, which prefers the opposite. */ + int fd = dbus_watch_get_unix_fd (watch); + if (fd == -1) + fd = dbus_watch_get_socket (watch); +#else + int fd = dbus_watch_get_fd (watch); +#endif + return fd; +} + + +/* Start monitoring WATCH for possible I/O. */ + +static dbus_bool_t xd_add_watch (DBusWatch *watch, void *data) { - /* We check only for incoming data. */ - if (dbus_watch_get_flags (watch) & DBUS_WATCH_READABLE) + unsigned int flags = dbus_watch_get_flags (watch); + int fd = xd_find_watch_fd (watch); + + XD_DEBUG_MESSAGE ("fd %d, write %d, enabled %d", + fd, flags & DBUS_WATCH_WRITABLE, + dbus_watch_get_enabled (watch)); + + if (fd == -1) + return FALSE; + + if (dbus_watch_get_enabled (watch)) { -#if HAVE_DBUS_WATCH_GET_UNIX_FD - /* TODO: Reverse these on Win32, which prefers the opposite. */ - int fd = dbus_watch_get_unix_fd(watch); - if (fd == -1) - fd = dbus_watch_get_socket(watch); -#else - int fd = dbus_watch_get_fd(watch); -#endif - XD_DEBUG_MESSAGE ("fd %d", fd); - - if (fd == -1) - return FALSE; - - /* Add the file descriptor to input_wait_mask. */ - add_keyboard_wait_descriptor (fd); + if (flags & DBUS_WATCH_WRITABLE) + add_write_fd (fd, dbus_fd_cb, NULL); + if (flags & DBUS_WATCH_READABLE) + add_read_fd (fd, dbus_fd_cb, NULL); } - - /* Return. */ return TRUE; } -/* Remove connection file descriptor from input_wait_mask. DATA is - the used bus, either a string or QCdbus_system_bus or +/* Stop monitoring WATCH for possible I/O. + DATA is the used bus, either a string or QCdbus_system_bus or QCdbus_session_bus. */ -void + +static void xd_remove_watch (DBusWatch *watch, void *data) { - /* We check only for incoming data. */ - if (dbus_watch_get_flags (watch) & DBUS_WATCH_READABLE) + unsigned int flags = dbus_watch_get_flags (watch); + int fd = xd_find_watch_fd (watch); + + XD_DEBUG_MESSAGE ("fd %d", fd); + + if (fd == -1) return; + + + /* Unset session environment. */ + if (data != NULL && data == (void*) XHASH (QCdbus_session_bus)) { -#if HAVE_DBUS_WATCH_GET_UNIX_FD - /* TODO: Reverse these on Win32, which prefers the opposite. */ - int fd = dbus_watch_get_unix_fd(watch); - if (fd == -1) - fd = dbus_watch_get_socket(watch); -#else - int fd = dbus_watch_get_fd(watch); -#endif - XD_DEBUG_MESSAGE ("fd %d", fd); - - if (fd == -1) - return; - - /* Unset session environment. */ - if ((data != NULL) && (data == (void*) XHASH (QCdbus_session_bus))) - { - XD_DEBUG_MESSAGE ("unsetenv DBUS_SESSION_BUS_ADDRESS"); - unsetenv ("DBUS_SESSION_BUS_ADDRESS"); - } - - /* Remove the file descriptor from input_wait_mask. */ - delete_keyboard_wait_descriptor (fd); + XD_DEBUG_MESSAGE ("unsetenv DBUS_SESSION_BUS_ADDRESS"); + unsetenv ("DBUS_SESSION_BUS_ADDRESS"); } - /* Return. */ - return; + if (flags & DBUS_WATCH_WRITABLE) + delete_write_fd (fd); + if (flags & DBUS_WATCH_READABLE) + delete_read_fd (fd); +} + +/* Toggle monitoring WATCH for possible I/O. */ + +static void +xd_toggle_watch (DBusWatch *watch, void *data) +{ + if (dbus_watch_get_enabled (watch)) + xd_add_watch (watch, data); + else + xd_remove_watch (watch, data); } DEFUN ("dbus-init-bus", Fdbus_init_bus, Sdbus_init_bus, 1, 1, 0, @@ -880,7 +903,8 @@ if (!dbus_connection_set_watch_functions (connection, xd_add_watch, xd_remove_watch, - NULL, (void*) XHASH (bus), NULL)) + xd_toggle_watch, + (void*) XHASH (bus), NULL)) XD_SIGNAL1 (build_string ("Cannot add watch functions")); /* Add bus to list of registered buses. */ @@ -1288,9 +1312,6 @@ result = Qnil; } - /* Flush connection to ensure the message is handled. */ - dbus_connection_flush (connection); - XD_DEBUG_MESSAGE ("Message sent"); /* Cleanup. */ @@ -1379,9 +1400,6 @@ if (!dbus_connection_send (connection, dmessage, NULL)) XD_SIGNAL1 (build_string ("Cannot send message")); - /* Flush connection to ensure the message is handled. */ - dbus_connection_flush (connection); - XD_DEBUG_MESSAGE ("Message sent"); /* Cleanup. */ @@ -1471,9 +1489,6 @@ if (!dbus_connection_send (connection, dmessage, NULL)) XD_SIGNAL1 (build_string ("Cannot send message")); - /* Flush connection to ensure the message is handled. */ - dbus_connection_flush (connection); - XD_DEBUG_MESSAGE ("Message sent"); /* Cleanup. */ @@ -1589,9 +1604,6 @@ if (!dbus_connection_send (connection, dmessage, NULL)) XD_SIGNAL1 (build_string ("Cannot send message")); - /* Flush connection to ensure the message is handled. */ - dbus_connection_flush (connection); - XD_DEBUG_MESSAGE ("Signal sent"); /* Cleanup. */ @@ -1645,32 +1657,27 @@ return FALSE; } -/* Read queued incoming message of the D-Bus BUS. BUS is either a - Lisp symbol, :system or :session, or a string denoting the bus - address. */ -static Lisp_Object -xd_read_message (Lisp_Object bus) +/* Read one queued incoming message of the D-Bus BUS. + BUS is either a Lisp symbol, :system or :session, or a string denoting + the bus address. */ + +static void +xd_read_message_1 (DBusConnection *connection, Lisp_Object bus) { Lisp_Object args, key, value; struct gcpro gcpro1; struct input_event event; - DBusConnection *connection; DBusMessage *dmessage; DBusMessageIter iter; unsigned int dtype; int mtype, serial; const char *uname, *path, *interface, *member; - /* Open a connection to the bus. */ - connection = xd_initialize (bus, TRUE); - - /* Non blocking read of the next available message. */ - dbus_connection_read_write (connection, 0); dmessage = dbus_connection_pop_message (connection); /* Return if there is no queued message. */ if (dmessage == NULL) - return Qnil; + return; /* Collect the parameters. */ args = Qnil; @@ -1801,7 +1808,26 @@ cleanup: dbus_message_unref (dmessage); - RETURN_UNGCPRO (Qnil); + UNGCPRO; +} + +/* Read queued incoming messages of the D-Bus BUS. + BUS is either a Lisp symbol, :system or :session, or a string denoting + the bus address. */ + +static Lisp_Object +xd_read_message (Lisp_Object bus) +{ + /* Open a connection to the bus. */ + DBusConnection *connection = xd_initialize (bus, TRUE); + + /* Non blocking read of the next available message. */ + dbus_connection_read_write (connection, 0); + + while (dbus_connection_get_dispatch_status (connection) + != DBUS_DISPATCH_COMPLETE) + xd_read_message_1 (connection, bus); + return Qnil; } /* Read queued incoming messages from all buses. */ === modified file 'src/keyboard.c' --- src/keyboard.c 2010-09-25 12:04:35 +0000 +++ src/keyboard.c 2010-09-26 16:20:01 +0000 @@ -3522,12 +3522,6 @@ static int readable_events (int flags) { -#ifdef HAVE_DBUS - /* Check whether a D-Bus message has arrived. */ - if (xd_pending_messages () > 0) - return 1; -#endif /* HAVE_DBUS */ - if (flags & READABLE_EVENTS_DO_TIMERS_NOW) timer_check (1); @@ -6877,11 +6871,6 @@ void gobble_input (int expected) { -#ifdef HAVE_DBUS - /* Read D-Bus messages. */ - xd_read_queued_messages (); -#endif /* HAVE_DBUS */ - #ifdef SIGIO if (interrupt_input) { === modified file 'src/process.c' --- src/process.c 2010-09-26 06:06:28 +0000 +++ src/process.c 2010-09-26 16:20:01 +0000 @@ -294,9 +294,9 @@ static SELECT_TYPE non_process_wait_mask; -/* Mask for the gpm mouse input descriptor. */ +/* Mask for selecting for write. */ -static SELECT_TYPE gpm_wait_mask; +static SELECT_TYPE write_mask; #ifdef NON_BLOCKING_CONNECT /* Mask of bits indicating the descriptors that we wait for connect to @@ -316,11 +316,8 @@ /* The largest descriptor currently in use for a process object. */ static int max_process_desc; -/* The largest descriptor currently in use for keyboard input. */ -static int max_keyboard_desc; - -/* The largest descriptor currently in use for gpm mouse input. */ -static int max_gpm_desc; +/* The largest descriptor currently in use for input. */ +static int max_input_desc; /* Indexed by descriptor, gives the process (if any) for that descriptor */ Lisp_Object chan_process[MAXDESC]; @@ -366,6 +363,90 @@ static char pty_name[24]; #endif + +struct fd_callback_data +{ + fd_callback func; + void *data; +#define FOR_READ 1 +#define FOR_WRITE 2 + int condition; /* mask of the defines above. */ +} fd_callback_info[MAXDESC]; + + +/* Add a file descriptor FD to be monitored for when read is possible. + When read is possible, call FUNC with argument DATA. */ + +void +add_read_fd (int fd, fd_callback func, void *data) +{ + xassert (fd < MAXDESC); + add_keyboard_wait_descriptor (fd); + + fd_callback_info[fd].func = func; + fd_callback_info[fd].data = data; + fd_callback_info[fd].condition |= FOR_READ; +} + +/* Stop monitoring file descriptor FD for when read is possible. */ + +void +delete_read_fd (int fd) +{ + xassert (fd < MAXDESC); + delete_keyboard_wait_descriptor (fd); + + fd_callback_info[fd].condition &= ~FOR_READ; + if (fd_callback_info[fd].condition == 0) + { + fd_callback_info[fd].func = 0; + fd_callback_info[fd].data = 0; + } +} + +/* Add a file descriptor FD to be monitored for when write is possible. + When write is possible, call FUNC with argument DATA. */ + +void +add_write_fd (int fd, fd_callback func, void *data) +{ + xassert (fd < MAXDESC); + FD_SET (fd, &write_mask); + if (fd > max_input_desc) + max_input_desc = fd; + + fd_callback_info[fd].func = func; + fd_callback_info[fd].data = data; + fd_callback_info[fd].condition |= FOR_WRITE; +} + +/* Stop monitoring file descriptor FD for when write is possible. */ + +void +delete_write_fd (int fd) +{ + int lim = max_input_desc; + + xassert (fd < MAXDESC); + FD_CLR (fd, &write_mask); + fd_callback_info[fd].condition &= ~FOR_WRITE; + if (fd_callback_info[fd].condition == 0) + { + fd_callback_info[fd].func = 0; + fd_callback_info[fd].data = 0; + + if (fd == max_input_desc) + for (fd = lim; fd >= 0; fd--) + if (FD_ISSET (fd, &input_wait_mask) || FD_ISSET (fd, &write_mask)) + { + max_input_desc = fd; + break; + } + + } +} + + /* Compute the Lisp form of the process status, p->status, from the numeric status that was returned by `wait'. */ @@ -3620,6 +3701,7 @@ if (!FD_ISSET (inch, &connect_wait_mask)) { FD_SET (inch, &connect_wait_mask); + FD_SET (inch, &write_mask); num_pending_connects++; } } @@ -4023,6 +4105,7 @@ if (FD_ISSET (inchannel, &connect_wait_mask)) { FD_CLR (inchannel, &connect_wait_mask); + FD_CLR (inchannel, &write_mask); if (--num_pending_connects < 0) abort (); } @@ -4401,10 +4484,8 @@ { register int channel, nfds; SELECT_TYPE Available; -#ifdef NON_BLOCKING_CONNECT - SELECT_TYPE Connecting; - int check_connect; -#endif + SELECT_TYPE Writeok; + int check_write; int check_delay, no_avail; int xerrno; Lisp_Object proc; @@ -4414,9 +4495,7 @@ int count = SPECPDL_INDEX (); FD_ZERO (&Available); -#ifdef NON_BLOCKING_CONNECT - FD_ZERO (&Connecting); -#endif + FD_ZERO (&Writeok); if (time_limit == 0 && microsecs == 0 && wait_proc && !NILP (Vinhibit_quit) && !(CONSP (wait_proc->status) && EQ (XCAR (wait_proc->status), Qexit))) @@ -4552,19 +4631,16 @@ if (update_tick != process_tick) { SELECT_TYPE Atemp; -#ifdef NON_BLOCKING_CONNECT SELECT_TYPE Ctemp; -#endif if (kbd_on_hold_p ()) FD_ZERO (&Atemp); else Atemp = input_wait_mask; - IF_NON_BLOCKING_CONNECT (Ctemp = connect_wait_mask); + Ctemp = write_mask; EMACS_SET_SECS_USECS (timeout, 0, 0); - if ((select (max (max (max_process_desc, max_keyboard_desc), - max_gpm_desc) + 1, + if ((select (max (max_process_desc, max_input_desc) + 1, &Atemp, #ifdef NON_BLOCKING_CONNECT (num_pending_connects > 0 ? &Ctemp : (SELECT_TYPE *)0), @@ -4635,13 +4711,13 @@ break; FD_SET (wait_proc->infd, &Available); check_delay = 0; - IF_NON_BLOCKING_CONNECT (check_connect = 0); + check_write = 0; } else if (!NILP (wait_for_cell)) { Available = non_process_wait_mask; check_delay = 0; - IF_NON_BLOCKING_CONNECT (check_connect = 0); + check_write = 0; } else { @@ -4649,7 +4725,8 @@ Available = non_keyboard_wait_mask; else Available = input_wait_mask; - IF_NON_BLOCKING_CONNECT (check_connect = (num_pending_connects > 0)); + Writeok = write_mask; + check_write = 1; check_delay = wait_channel >= 0 ? 0 : process_output_delay_count; } @@ -4674,10 +4751,6 @@ } else { -#ifdef NON_BLOCKING_CONNECT - if (check_connect) - Connecting = connect_wait_mask; -#endif #ifdef ADAPTIVE_READ_BUFFERING /* Set the timeout for adaptive read buffering if any @@ -4719,15 +4792,10 @@ #else nfds = select #endif - (max (max (max_process_desc, max_keyboard_desc), - max_gpm_desc) + 1, - &Available, -#ifdef NON_BLOCKING_CONNECT - (check_connect ? &Connecting : (SELECT_TYPE *)0), -#else - (SELECT_TYPE *)0, -#endif - (SELECT_TYPE *)0, &timeout); + (max (max_process_desc, max_input_desc) + 1, + &Available, + (check_write ? &Writeok : (SELECT_TYPE *)0), + (SELECT_TYPE *)0, &timeout); } xerrno = errno; @@ -4767,7 +4835,7 @@ if (no_avail) { FD_ZERO (&Available); - IF_NON_BLOCKING_CONNECT (check_connect = 0); + check_write = 0; } #if 0 /* When polling is used, interrupt_input is 0, @@ -4863,12 +4931,26 @@ if (no_avail || nfds == 0) continue; + for (channel = 0; channel <= max_input_desc; ++channel) + { + struct fd_callback_data *d = &fd_callback_info[channel]; + if (FD_ISSET (channel, &Available) + && d->func != 0 + && (d->condition & FOR_READ) != 0) + d->func (channel, d->data, 1); + if (FD_ISSET (channel, &write_mask) + && d->func != 0 + && (d->condition & FOR_WRITE) != 0) + d->func (channel, d->data, 0); + } + /* Really FIRST_PROC_DESC should be 0 on Unix, but this is safer in the short run. */ for (channel = 0; channel <= max_process_desc; channel++) { if (FD_ISSET (channel, &Available) - && FD_ISSET (channel, &non_keyboard_wait_mask)) + && FD_ISSET (channel, &non_keyboard_wait_mask) + && !FD_ISSET (channel, &non_process_wait_mask)) { int nread; @@ -4973,7 +5055,7 @@ } } #ifdef NON_BLOCKING_CONNECT - if (check_connect && FD_ISSET (channel, &Connecting) + if (FD_ISSET (channel, &Writeok) && FD_ISSET (channel, &connect_wait_mask)) { struct Lisp_Process *p; @@ -6745,35 +6827,16 @@ -static int add_gpm_wait_descriptor_called_flag; - void add_gpm_wait_descriptor (int desc) { - if (! add_gpm_wait_descriptor_called_flag) - FD_CLR (0, &input_wait_mask); - add_gpm_wait_descriptor_called_flag = 1; - FD_SET (desc, &input_wait_mask); - FD_SET (desc, &gpm_wait_mask); - if (desc > max_gpm_desc) - max_gpm_desc = desc; + add_keyboard_wait_descriptor (desc); } void delete_gpm_wait_descriptor (int desc) { - int fd; - int lim = max_gpm_desc; - - FD_CLR (desc, &input_wait_mask); - FD_CLR (desc, &non_process_wait_mask); - - if (desc == max_gpm_desc) - for (fd = 0; fd < lim; fd++) - if (FD_ISSET (fd, &input_wait_mask) - && !FD_ISSET (fd, &non_keyboard_wait_mask) - && !FD_ISSET (fd, &non_process_wait_mask)) - max_gpm_desc = fd; + delete_keyboard_wait_descriptor (desc); } /* Return nonzero if *MASK has a bit set @@ -6784,7 +6847,7 @@ { int fd; - for (fd = 0; fd <= max_keyboard_desc; fd++) + for (fd = 0; fd <= max_input_desc; fd++) if (FD_ISSET (fd, mask) && FD_ISSET (fd, &input_wait_mask) && !FD_ISSET (fd, &non_keyboard_wait_mask)) return 1; @@ -7023,12 +7086,10 @@ void add_keyboard_wait_descriptor (int desc) { -#ifdef subprocesses FD_SET (desc, &input_wait_mask); FD_SET (desc, &non_process_wait_mask); - if (desc > max_keyboard_desc) - max_keyboard_desc = desc; -#endif + if (desc > max_input_desc) + max_input_desc = desc; } /* From now on, do not expect DESC to give keyboard input. */ @@ -7036,20 +7097,16 @@ void delete_keyboard_wait_descriptor (int desc) { -#ifdef subprocesses int fd; - int lim = max_keyboard_desc; + int lim = max_input_desc; FD_CLR (desc, &input_wait_mask); FD_CLR (desc, &non_process_wait_mask); - if (desc == max_keyboard_desc) + if (desc == max_input_desc) for (fd = 0; fd < lim; fd++) - if (FD_ISSET (fd, &input_wait_mask) - && !FD_ISSET (fd, &non_keyboard_wait_mask) - && !FD_ISSET (fd, &gpm_wait_mask)) - max_keyboard_desc = fd; -#endif /* subprocesses */ + if (FD_ISSET (fd, &input_wait_mask) || FD_ISSET (fd, &write_mask)) + max_input_desc = fd; } /* Setup coding systems of PROCESS. */ @@ -7306,7 +7363,9 @@ FD_ZERO (&input_wait_mask); FD_ZERO (&non_keyboard_wait_mask); FD_ZERO (&non_process_wait_mask); + FD_ZERO (&write_mask); max_process_desc = 0; + memset (fd_callback_info, 0, sizeof (fd_callback_info)); #ifdef NON_BLOCKING_CONNECT FD_ZERO (&connect_wait_mask); === modified file 'src/process.h' --- src/process.h 2010-09-26 06:06:28 +0000 +++ src/process.h 2010-09-26 16:20:01 +0000 @@ -192,5 +192,12 @@ extern void unhold_keyboard_input (void); extern int kbd_on_hold_p (void); +typedef void (*fd_callback)(int fd, void *data, int for_read); + +extern void add_read_fd (int fd, fd_callback func, void *data); +extern void delete_read_fd (int fd); +extern void add_write_fd (int fd, fd_callback func, void *data); +extern void delete_write_fd (int fd); + /* arch-tag: dffedfc4-d7bc-4b58-a26f-c16155449c72 (do not change this comment) */ ------------------------------------------------------------ revno: 101632 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Sun 2010-09-26 17:30:44 +0200 message: (starttls-negotiate): Avoid the cl.el decf function. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-09-26 13:25:35 +0000 +++ lisp/ChangeLog 2010-09-26 15:30:44 +0000 @@ -1,5 +1,7 @@ 2010-09-26 Lars Magne Ingebrigtsen + * net/gnutls.el (starttls-negotiate): Avoid the cl.el decf function. + * net/netrc.el (netrc-store-data): New function. 2010-09-26 Teodor Zlatanov === modified file 'lisp/net/gnutls.el' --- lisp/net/gnutls.el 2010-09-26 06:06:28 +0000 +++ lisp/net/gnutls.el 2010-09-26 15:30:44 +0000 @@ -82,7 +82,7 @@ (n 25000)) (while (and (not (gnutls-error-fatalp ret)) (> n 0)) - (decf n) + (setq n (1- n)) (gnutls-message-maybe (setq ret (gnutls-handshake proc)) "handshake: %s") ------------------------------------------------------------ revno: 101631 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Sun 2010-09-26 17:18:47 +0200 message: Don't break the build if we don't have the gnutls libraries. diff: === modified file 'ChangeLog' --- ChangeLog 2010-09-26 06:06:28 +0000 +++ ChangeLog 2010-09-26 15:18:47 +0000 @@ -1,3 +1,8 @@ +2010-09-26 Lars Magne Ingebrigtsen + + * configure.in (HAVE_GNUTLS): Don't break if we don't have the + gnutls libraries. + 2010-09-26 Teodor Zlatanov * configure.in: Set up GnuTLS. === modified file 'configure' --- configure 2010-09-22 03:10:16 +0000 +++ configure 2010-09-26 15:18:47 +0000 @@ -1,11 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.66 for emacs 24.0.50. +# Generated by GNU Autoconf 2.65 for emacs 24.0.50. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- +# as_fn_error 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=$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 + 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 fi - $as_echo "$as_me: error: $2" >&2 + $as_echo "$as_me: error: $1" >&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, old GNU/Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` @@ -681,6 +681,8 @@ FONTCONFIG_CFLAGS LIBXMU LIBXTR6 +LIBGNUTLS_LIBS +LIBGNUTLS_CFLAGS LIBSELINUX_LIBS GCONF_LIBS GCONF_CFLAGS @@ -822,6 +824,7 @@ with_dbus with_gconf with_selinux +with_gnutls with_makeinfo with_compress_info with_pkg_config_prog @@ -956,7 +959,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 @@ -982,7 +985,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 @@ -1186,7 +1189,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 @@ -1202,7 +1205,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 @@ -1232,8 +1235,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." ;; *=*) @@ -1241,7 +1244,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 ;; @@ -1259,13 +1262,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 @@ -1288,7 +1291,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' @@ -1302,8 +1305,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 @@ -1318,9 +1321,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. @@ -1359,11 +1362,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 @@ -1403,7 +1406,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 @@ -1532,6 +1535,7 @@ --without-dbus don't compile with D-Bus support --without-gconf don't compile with GConf support --without-selinux don't compile with SELinux support + --without-gnutls don't use -lgnutls for SSL/TLS support --without-makeinfo don't require makeinfo for building manuals --without-compress-info don't compress the installed Info pages --with-pkg-config-prog=PATH @@ -1621,9 +1625,9 @@ if $ac_init_version; then cat <<\_ACEOF emacs configure 24.0.50 -generated by GNU Autoconf 2.66 +generated by GNU Autoconf 2.65 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2009 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1763,10 +1767,10 @@ ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval "test \"\${$3+set}\"" = set; then : + if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -1829,7 +1833,7 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -1893,7 +1897,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 eval "test \"\${$3+set}\"" = set; then : +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1915,18 +1919,15 @@ } # ac_fn_c_check_header_compile -# 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 LINENO SYMBOL VAR +# ------------------------------------ +# Tests whether SYMBOL is declared, 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_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 "$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_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1935,12 +1936,8 @@ int main () { -#ifndef $as_decl_name -#ifdef __cplusplus - (void) $as_decl_use; -#else - (void) $as_decl_name; -#endif +#ifndef $2 + (void) $2; #endif ; @@ -1969,7 +1966,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 eval "test \"\${$3+set}\"" = set; then : +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1999,7 +1996,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 eval "test \"\${$4+set}\"" = set; then : +if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2055,7 +2052,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 eval "test \"\${$3+set}\"" = set; then : +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2123,7 +2120,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 eval "test \"\${$3+set}\"" = set; then : +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else eval "$3=no" @@ -2172,7 +2169,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.66. Invocation command line was +generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ @@ -2282,9 +2279,11 @@ { echo - $as_echo "## ---------------- ## + cat <<\_ASBOX +## ---------------- ## ## Cache variables. ## -## ---------------- ##" +## ---------------- ## +_ASBOX echo # The following way of writing the cache mishandles newlines in values, ( @@ -2318,9 +2317,11 @@ ) echo - $as_echo "## ----------------- ## + cat <<\_ASBOX +## ----------------- ## ## Output variables. ## -## ----------------- ##" +## ----------------- ## +_ASBOX echo for ac_var in $ac_subst_vars do @@ -2333,9 +2334,11 @@ echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + cat <<\_ASBOX +## ------------------- ## ## File substitutions. ## -## ------------------- ##" +## ------------------- ## +_ASBOX echo for ac_var in $ac_subst_files do @@ -2349,9 +2352,11 @@ fi if test -s confdefs.h; then - $as_echo "## ----------- ## + cat <<\_ASBOX +## ----------- ## ## confdefs.h. ## -## ----------- ##" +## ----------- ## +_ASBOX echo cat confdefs.h echo @@ -2406,12 +2411,7 @@ ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - # 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 + ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site @@ -2426,11 +2426,7 @@ { $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" \ - || { { $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; } + . "$ac_site_file" fi done @@ -2511,7 +2507,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. ## @@ -2685,7 +2681,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 ;; @@ -2851,6 +2847,14 @@ fi +# Check whether --with-gnutls was given. +if test "${with_gnutls+set}" = set; then : + withval=$with_gnutls; +else + with_gnutls=yes +fi + + ## For the times when you want to build Emacs but don't have ## a suitable makeinfo, and can live without the manuals. @@ -2980,7 +2984,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" @@ -3098,22 +3102,16 @@ ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - 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 + 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 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, @@ -3127,7 +3125,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; } @@ -3138,16 +3136,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='-' @@ -3172,7 +3170,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 @@ -3180,7 +3178,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='-' @@ -3474,7 +3472,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 @@ -3788,8 +3786,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 @@ -3903,8 +3901,9 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } +{ as_fn_set_status 77 +as_fn_error "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; } @@ -3946,8 +3945,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 @@ -4004,9 +4003,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 @@ -4057,8 +4056,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 @@ -4475,8 +4474,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 @@ -4537,7 +4536,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 @@ -4603,7 +4602,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 @@ -4735,7 +4734,8 @@ 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 " -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -5064,8 +5064,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 @@ -5502,7 +5502,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 @@ -5656,7 +5656,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 @@ -5934,7 +5934,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 @@ -5989,7 +5989,8 @@ 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" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -6180,7 +6181,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 @@ -6215,7 +6216,8 @@ 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" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -7270,7 +7272,7 @@ ;; #( *) - as_fn_error $? "unknown endianness + as_fn_error "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac @@ -7279,7 +7281,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 eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -7287,7 +7289,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;; @@ -7423,7 +7425,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 @@ -7441,7 +7443,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 @@ -7710,7 +7712,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 @@ -7826,7 +7828,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. @@ -7949,7 +7951,8 @@ 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 " -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -8456,7 +8459,8 @@ 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" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -8856,7 +8860,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 @@ -8962,7 +8966,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 @@ -8989,7 +8993,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 @@ -9119,7 +9123,8 @@ 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" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9405,6 +9410,110 @@ fi +HAVE_GNUTLS=no +if test "${with_gnutls}" = "yes" ; then + + succeeded=no + + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + if test "$PKG_CONFIG" = "no" ; then + HAVE_GNUTLS=no + else + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnutls >= 2.2.4" >&5 +$as_echo_n "checking for gnutls >= 2.2.4... " >&6; } + + if $PKG_CONFIG --exists "gnutls >= 2.2.4" 2>&5; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + succeeded=yes + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBGNUTLS_CFLAGS" >&5 +$as_echo_n "checking LIBGNUTLS_CFLAGS... " >&6; } + LIBGNUTLS_CFLAGS=`$PKG_CONFIG --cflags "gnutls >= 2.2.4"|sed -e 's,///*,/,g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBGNUTLS_CFLAGS" >&5 +$as_echo "$LIBGNUTLS_CFLAGS" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBGNUTLS_LIBS" >&5 +$as_echo_n "checking LIBGNUTLS_LIBS... " >&6; } + LIBGNUTLS_LIBS=`$PKG_CONFIG --libs "gnutls >= 2.2.4"|sed -e 's,///*,/,g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBGNUTLS_LIBS" >&5 +$as_echo "$LIBGNUTLS_LIBS" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + LIBGNUTLS_CFLAGS="" + LIBGNUTLS_LIBS="" + ## If we have a custom action on failure, don't print errors, but + ## do set a variable so people can do so. + LIBGNUTLS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gnutls >= 2.2.4"` + + fi + + + + else + echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." + echo "*** See http://www.freedesktop.org/software/pkgconfig" + fi + fi + + if test $succeeded = yes; then + HAVE_GNUTLS=yes + else + HAVE_GNUTLS=no + fi + + if test "${HAVE_GNUTLS}" = "yes"; then + $as_echo "#define HAVE_GNUTLS 1" >>confdefs.h + + fi +fi + + + HAVE_XAW3D=no LUCID_LIBW= if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then @@ -9484,7 +9593,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; } @@ -10661,7 +10770,8 @@ 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" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -10913,7 +11023,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 @@ -11402,7 +11512,8 @@ 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" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func @@ -11466,7 +11577,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. @@ -11662,7 +11773,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 @@ -11751,7 +11862,8 @@ 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" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -11782,7 +11894,8 @@ 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" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -11834,8 +11947,8 @@ static time_t time_t_min; /* Values we'll use to set the TZ environment variable. */ -static const char *tz_strings[] = { - (const char *) 0, "TZ=GMT0", "TZ=JST-9", +static char *tz_strings[] = { + (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])) @@ -11852,7 +11965,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 ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0"); + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); tm.tm_year = 98; tm.tm_mon = 3; @@ -11865,14 +11978,16 @@ } static int -mktime_test1 (time_t now) +mktime_test1 (now) + time_t now; { struct tm *lt; return ! (lt = localtime (&now)) || mktime (lt) == now; } static int -mktime_test (time_t now) +mktime_test (now) + time_t now; { return (mktime_test1 (now) && mktime_test1 ((time_t) (time_t_max - now)) @@ -11896,7 +12011,8 @@ } static int -bigtime_test (int j) +bigtime_test (j) + int j; { struct tm tm; time_t now; @@ -11940,7 +12056,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 ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0"); + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); t = mktime (&tm); @@ -11975,7 +12091,7 @@ for (i = 0; i < N_STRINGS; i++) { if (tz_strings[i]) - putenv ((char*) tz_strings[i]); + putenv (tz_strings[i]); for (t = 0; t <= time_t_max - delta; t += delta) if (! mktime_test (t)) @@ -12027,7 +12143,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 @@ -12896,7 +13012,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 @@ -14043,7 +14159,8 @@ 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" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -14417,14 +14534,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 @@ -14853,6 +14970,7 @@ echo " Does Emacs use -ldbus? ${HAVE_DBUS}" echo " Does Emacs use -lgconf? ${HAVE_GCONF}" echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}" +echo " Does Emacs use -lgnutls (BROKEN)? ${HAVE_GNUTLS}" echo " Does Emacs use -lxml2? ${HAVE_LIBXML2}" echo " Does Emacs use -lfreetype? ${HAVE_FREETYPE}" @@ -14984,7 +15102,6 @@ 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$//' @@ -15147,19 +15264,19 @@ (unset CDPATH) >/dev/null 2>&1 && unset CDPATH -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- +# as_fn_error 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=$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 + 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 fi - $as_echo "$as_me: error: $2" >&2 + $as_echo "$as_me: error: $1" >&2 as_fn_exit $as_status } # as_fn_error @@ -15355,7 +15472,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 @@ -15409,7 +15526,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.66. Invocation command line was +generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -15475,10 +15592,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.66, +configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2009 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -15532,7 +15649,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 ;; @@ -15541,7 +15658,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" @@ -15609,7 +15726,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 @@ -15647,7 +15764,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. @@ -15681,7 +15798,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 @@ -15698,7 +15815,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 { @@ -15706,18 +15823,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 @@ -15812,28 +15929,20 @@ 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 sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ 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[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// s/^[^=]*=[ ]*$// }' fi @@ -15861,7 +15970,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 @@ -15946,7 +16055,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" @@ -15959,7 +16068,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 @@ -15987,7 +16096,7 @@ [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error "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'" @@ -16014,7 +16123,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 @@ -16150,22 +16259,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) # @@ -16176,19 +16285,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 ;; @@ -16225,7 +16334,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. @@ -16246,7 +16355,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 1 + $ac_cs_success || as_fn_exit $? 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-09-26 06:06:28 +0000 +++ configure.in 2010-09-26 15:18:47 +0000 @@ -2002,10 +2002,13 @@ HAVE_GNUTLS=no if test "${with_gnutls}" = "yes" ; then - PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.2.4]) - AC_DEFINE(HAVE_GNUTLS) - HAVE_GNUTLS=yes + PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.2.4], HAVE_GNUTLS=yes, HAVE_GNUTLS=no) + if test "${HAVE_GNUTLS}" = "yes"; then + AC_DEFINE(HAVE_GNUTLS) + fi fi +AC_SUBST(LIBGNUTLS_LIBS) +AC_SUBST(LIBGNUTLS_CFLAGS) dnl Do not put whitespace before the #include statements below. dnl Older compilers (eg sunos4 cc) choke on it. ------------------------------------------------------------ revno: 101630 committer: Dan Nicolaescu branch nick: trunk timestamp: Sun 2010-09-26 18:11:48 +0300 message: Use const for some pointer arguments. * lwlib/lwlib.h (my_strcasecmp, safe_strcmp, name_to_widget) (find_in_table, dialog_spec_p, lw_separator_p): * lwlib/lwlib.c (my_strcasecmp, safe_strcmp, name_to_widget) (find_in_table, dialog_spec_p, lw_separator_p): Use const. diff: === modified file 'lwlib/ChangeLog' --- lwlib/ChangeLog 2010-09-20 11:44:39 +0000 +++ lwlib/ChangeLog 2010-09-26 15:11:48 +0000 @@ -1,3 +1,11 @@ +2010-09-26 Dan Nicolaescu + + Use const for some pointer arguments. + * lwlib.h (my_strcasecmp, safe_strcmp, name_to_widget) + (find_in_table, dialog_spec_p, lw_separator_p): + * lwlib.c (my_strcasecmp, safe_strcmp, name_to_widget) + (find_in_table, dialog_spec_p, lw_separator_p): Use const. + 2010-09-20 Dan Nicolaescu * lwlib.h (lw_register_widget, lw_create_widget): === modified file 'lwlib/lwlib.c' --- lwlib/lwlib.c 2010-09-20 11:44:39 +0000 +++ lwlib/lwlib.c 2010-09-26 15:11:48 +0000 @@ -75,7 +75,7 @@ widget_value *, int, int *); static void instantiate_widget_instance (widget_instance *); -static int my_strcasecmp (char *, char *); +static int my_strcasecmp (const char *, const char *); static void safe_free_str (char *); static void free_widget_value_tree (widget_value *); static widget_value *copy_widget_value_tree (widget_value *, @@ -92,14 +92,14 @@ static widget_info *get_widget_info (LWLIB_ID, Boolean); static widget_instance *get_widget_instance (Widget, Boolean); static widget_instance *find_instance (LWLIB_ID, Widget, Boolean); -static Boolean safe_strcmp (char *, char *); -static Widget name_to_widget (widget_instance *, char *); +static Boolean safe_strcmp (const char *, const char *); +static Widget name_to_widget (widget_instance *, const char *); static void set_one_value (widget_instance *, widget_value *, Boolean); static void update_one_widget_instance (widget_instance *, Boolean); static void update_all_widget_values (widget_info *, Boolean); static void initialize_widget_instance (widget_instance *); -static widget_creation_function find_in_table (char *, widget_creation_entry *); -static Boolean dialog_spec_p (char *); +static widget_creation_function find_in_table (const char *, const widget_creation_entry *); +static Boolean dialog_spec_p (const char *); static void destroy_one_instance (widget_instance *); static void lw_pop_all_widgets (LWLIB_ID, Boolean); static Boolean get_one_value (widget_instance *, widget_value *); @@ -120,7 +120,7 @@ /* Like strcmp but ignore differences in case. */ static int -my_strcasecmp (char *s1, char *s2) +my_strcasecmp (const char *s1, const char *s2) { while (1) { @@ -402,7 +402,7 @@ /* utility function for widget_value */ static Boolean -safe_strcmp (char *s1, char *s2) +safe_strcmp (const char *s1, const char *s2) { if (!!s1 ^ !!s2) return True; return (s1 && s2) ? strcmp (s1, s2) : s1 ? False : !!s2; @@ -586,7 +586,7 @@ /* modifying the widgets */ static Widget -name_to_widget (widget_instance *instance, char *name) +name_to_widget (widget_instance *instance, const char *name) { Widget widget = NULL; @@ -729,9 +729,9 @@ static widget_creation_function -find_in_table (char *type, widget_creation_entry *table) +find_in_table (const char *type, const widget_creation_entry *table) { - widget_creation_entry* cur; + const widget_creation_entry* cur; for (cur = table; cur->type; cur++) if (!my_strcasecmp (type, cur->type)) return cur->function; @@ -739,7 +739,7 @@ } static Boolean -dialog_spec_p (char *name) +dialog_spec_p (const char *name) { /* return True if name matches [EILPQeilpq][1-9][Bb] or [EILPQeilpq][1-9][Bb][Rr][1-9] */ @@ -1317,7 +1317,7 @@ to similar ones that are supported. */ int -lw_separator_p (char *label, enum menu_separator *type, int motif_p) +lw_separator_p (const char *label, enum menu_separator *type, int motif_p) { int separator_p = 0; === modified file 'lwlib/lwlib.h' --- lwlib/lwlib.h 2010-09-20 11:44:39 +0000 +++ lwlib/lwlib.h 2010-09-26 15:11:48 +0000 @@ -186,7 +186,7 @@ MOTIF_P non-zero means map separator types not supported by Motif to similar ones that are supported. */ -int lw_separator_p (char *label, enum menu_separator *type, +int lw_separator_p (const char *label, enum menu_separator *type, int motif_p); #endif /* LWLIB_H */ ------------------------------------------------------------ revno: 101629 committer: Dan Nicolaescu branch nick: trunk timestamp: Sun 2010-09-26 18:06:21 +0300 message: Code simplification in term.c. * src/term.c: Do not include sys/ioctl.h, not needed. (init_tty): Reorder code to reduce the number of #ifdefs. No code changes. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-26 06:06:28 +0000 +++ src/ChangeLog 2010-09-26 15:06:21 +0000 @@ -1,3 +1,9 @@ +2010-09-26 Dan Nicolaescu + + * term.c: Do not include sys/ioctl.h, not needed. + (init_tty): Reorder code to reduce the number of #ifdefs. No code + changes. + 2010-09-26 Teodor Zlatanov * process.h: Set up GnuTLS support. === modified file 'src/term.c' --- src/term.c 2010-09-25 12:31:15 +0000 +++ src/term.c 2010-09-26 15:06:21 +0000 @@ -31,10 +31,6 @@ #include #endif -#ifdef HAVE_SYS_IOCTL_H -#include -#endif - #include #include #include @@ -3407,6 +3403,15 @@ tty->Wcm = (struct cm *) xmalloc (sizeof (struct cm)); Wcm_clear (tty); + encode_terminal_src_size = 0; + encode_terminal_dst_size = 0; + +#ifdef HAVE_GPM + terminal->mouse_position_hook = term_mouse_position; + mouse_face_window = Qnil; +#endif + + #ifndef DOS_NT set_tty_hooks (terminal); @@ -3460,78 +3465,6 @@ add_keyboard_wait_descriptor (fileno (tty->input)); -#endif /* !DOS_NT */ - - encode_terminal_src_size = 0; - encode_terminal_dst_size = 0; - -#ifdef HAVE_GPM - terminal->mouse_position_hook = term_mouse_position; - mouse_face_window = Qnil; -#endif - -#ifdef DOS_NT -#ifdef WINDOWSNT - initialize_w32_display (terminal); -#else /* MSDOS */ - if (strcmp (terminal_type, "internal") == 0) - terminal->type = output_msdos_raw; - initialize_msdos_display (terminal); -#endif /* MSDOS */ - tty->output = stdout; - tty->input = stdin; - /* The following two are inaccessible from w32console.c. */ - terminal->delete_frame_hook = &tty_free_frame_resources; - terminal->delete_terminal_hook = &delete_tty; - - tty->name = xstrdup (name); - terminal->name = xstrdup (name); - tty->type = xstrdup (terminal_type); - - add_keyboard_wait_descriptor (0); - - Wcm_clear (tty); - -#ifdef WINDOWSNT - { - struct frame *f = XFRAME (selected_frame); - - FrameRows (tty) = FRAME_LINES (f); - FrameCols (tty) = FRAME_COLS (f); - tty->specified_window = FRAME_LINES (f); - - FRAME_CAN_HAVE_SCROLL_BARS (f) = 0; - FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none; - } -#else /* MSDOS */ - { - int height, width; - get_tty_size (fileno (tty->input), &width, &height); - FrameCols (tty) = width; - FrameRows (tty) = height; - } -#endif /* MSDOS */ - tty->delete_in_insert_mode = 1; - - UseTabs (tty) = 0; - terminal->scroll_region_ok = 0; - - /* Seems to insert lines when it's not supposed to, messing up the - display. In doing a trace, it didn't seem to be called much, so I - don't think we're losing anything by turning it off. */ - terminal->line_ins_del_ok = 0; -#ifdef WINDOWSNT - terminal->char_ins_del_ok = 1; - baud_rate = 19200; -#else /* MSDOS */ - terminal->char_ins_del_ok = 0; - init_baud_rate (fileno (tty->input)); -#endif /* MSDOS */ - - tty->TN_max_colors = 16; /* Required to be non-zero for tty-display-color-p */ - -#else /* not DOS_NT */ - Wcm_clear (tty); tty->termcap_term_buffer = (char *) xmalloc (buffer_size); @@ -3683,7 +3616,64 @@ tty->TF_underscore = tgetflag ("ul"); tty->TF_teleray = tgetflag ("xt"); -#endif /* !DOS_NT */ +#else /* DOS_NT */ +#ifdef WINDOWSNT + { + struct frame *f = XFRAME (selected_frame); + + initialize_w32_display (terminal); + + FrameRows (tty) = FRAME_LINES (f); + FrameCols (tty) = FRAME_COLS (f); + tty->specified_window = FRAME_LINES (f); + + FRAME_CAN_HAVE_SCROLL_BARS (f) = 0; + FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none; + terminal->char_ins_del_ok = 1; + baud_rate = 19200; + } +#else /* MSDOS */ + { + int height, width; + if (strcmp (terminal_type, "internal") == 0) + terminal->type = output_msdos_raw; + initialize_msdos_display (terminal); + + get_tty_size (fileno (tty->input), &width, &height); + FrameCols (tty) = width; + FrameRows (tty) = height; + terminal->char_ins_del_ok = 0; + init_baud_rate (fileno (tty->input)); + } +#endif /* MSDOS */ + tty->output = stdout; + tty->input = stdin; + /* The following two are inaccessible from w32console.c. */ + terminal->delete_frame_hook = &tty_free_frame_resources; + terminal->delete_terminal_hook = &delete_tty; + + tty->name = xstrdup (name); + terminal->name = xstrdup (name); + tty->type = xstrdup (terminal_type); + + add_keyboard_wait_descriptor (0); + + /* FIXME: this should be removed, done earlier. */ + Wcm_clear (tty); + + tty->delete_in_insert_mode = 1; + + UseTabs (tty) = 0; + terminal->scroll_region_ok = 0; + + /* Seems to insert lines when it's not supposed to, messing up the + display. In doing a trace, it didn't seem to be called much, so I + don't think we're losing anything by turning it off. */ + terminal->line_ins_del_ok = 0; + + tty->TN_max_colors = 16; /* Required to be non-zero for tty-display-color-p */ +#endif /* DOS_NT */ + terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); init_kboard (terminal->kboard); terminal->kboard->Vwindow_system = Qnil; ------------------------------------------------------------ revno: 101628 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Sun 2010-09-26 14:35:50 +0000 message: Merge changes made in Gnus trunk. gnus-picon.el (gnus-picon-create-glyph): Set the background XPM colour explicitly. message.el (message-cite-prefix-regexp): Remove } from the cite prefix. gnus-win.el (gnus-window-to-buffer-helper, gnus-all-windows-visible-p): Function needn't be a symbol. mail-source.el (mail-source-value): Function needn't be a symbol. tls.el (open-tls-stream): Don't query killing process. gnus-win.el: Revert previous patch, since it made Gnus backtrace. nnimap.el: Look up IMAP credentials based on both the virtual and physical server names. mail-source.el (mail-source-value): Revert previous patch. diff: === modified file 'doc/misc/gnus.texi' --- doc/misc/gnus.texi 2010-09-26 04:03:19 +0000 +++ doc/misc/gnus.texi 2010-09-26 14:35:50 +0000 @@ -27333,9 +27333,7 @@ @acronym{TLS} wrapper shipped with Gnus @acronym{TLS}/@acronym{SSL} is now supported in @acronym{IMAP} and -@acronym{NNTP} via @file{tls.el} and GNUTLS. The old -@acronym{TLS}/@acronym{SSL} support via (external third party) -@file{ssl.el} and OpenSSL still works. +@acronym{NNTP} via @file{tls.el} and GNUTLS. @item Improved anti-spam features. === modified file 'doc/misc/message.texi' --- doc/misc/message.texi 2010-09-02 00:55:51 +0000 +++ doc/misc/message.texi 2010-09-26 14:35:50 +0000 @@ -1090,11 +1090,11 @@ @subsection Using PGP/MIME @acronym{PGP/MIME} requires an external OpenPGP implementation, such -as @uref{http://www.gnupg.org/, GNU Privacy Guard}. Pre-OpenPGP -implementations such as PGP 2.x and PGP 5.x are also supported. One +as @uref{http://www.gnupg.org/, GNU Privacy Guard}. Pre-OpenPGP +implementations such as PGP 2.x and PGP 5.x are also supported. One Emacs interface to the PGP implementations, PGG (@pxref{Top, ,PGG, -pgg, PGG Manual}), is included, but Mailcrypt and Florian Weimer's -@code{gpg.el} are also supported. @xref{PGP Compatibility}. +pgg, PGG Manual}), is included, but Mailcrypt is also supported. +@xref{PGP Compatibility}. @cindex gpg-agent Message internally calls GnuPG (the @command{gpg} command) to perform === modified file 'lisp/ChangeLog.14' --- lisp/ChangeLog.14 2010-07-29 02:42:53 +0000 +++ lisp/ChangeLog.14 2010-09-26 14:35:50 +0000 @@ -1,3 +1,7 @@ +2009-02-07 Dave Love + + * net/tls.el (open-tls-stream): Don't query killing process. + 2009-06-21 Chong Yidong * Branch for 23.1. === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-09-26 13:25:35 +0000 +++ lisp/gnus/ChangeLog 2010-09-26 14:35:50 +0000 @@ -1,5 +1,32 @@ 2010-09-26 Lars Magne Ingebrigtsen + * mail-source.el (mail-source-value): Revert previous patch. + + * nnimap.el (nnimap-credentials): Allow inhibiting the password query + on failure. + (nnimap-open-connection): Look up both virtual and physical server name + credentials. + + * gnus-win.el: Revert previous patch, since it made Gnus backtrace. + +2009-02-08 Dave Love + + * gnus-win.el (gnus-window-to-buffer-helper, + gnus-all-windows-visible-p): Function needn't be a symbol. + + * mail-source.el (mail-source-value): Function needn't be a symbol. + +2010-09-26 Lars Magne Ingebrigtsen + + * message.el (message-cite-prefix-regexp): Remove } from the cite + prefix. + + * gnus-art.el (gnus-treatment-function-alist): Do picons before + highlight again, so that the highlight is correct. + + * gnus-picon.el (gnus-picon): Remove again. + (gnus-picon-create-glyph): Set the background XPM colour explicitly. + * gnus-art.el (gnus-treatment-function-alist): Insert picons after doing the header highlightling, so that the background colour of the picon is correct. === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2010-09-26 13:25:35 +0000 +++ lisp/gnus/gnus-art.el 2010-09-26 14:35:50 +0000 @@ -1691,14 +1691,14 @@ (gnus-treat-hide-signature gnus-article-hide-signature) (gnus-treat-strip-list-identifiers gnus-article-hide-list-identifiers) (gnus-treat-leading-whitespace gnus-article-remove-leading-whitespace) + (gnus-treat-from-picon gnus-treat-from-picon) + (gnus-treat-mail-picon gnus-treat-mail-picon) + (gnus-treat-newsgroups-picon gnus-treat-newsgroups-picon) (gnus-treat-strip-pem gnus-article-hide-pem) (gnus-treat-from-gravatar gnus-treat-from-gravatar) (gnus-treat-mail-gravatar gnus-treat-mail-gravatar) (gnus-treat-highlight-headers gnus-article-highlight-headers) (gnus-treat-highlight-signature gnus-article-highlight-signature) - (gnus-treat-from-picon gnus-treat-from-picon) - (gnus-treat-mail-picon gnus-treat-mail-picon) - (gnus-treat-newsgroups-picon gnus-treat-newsgroups-picon) (gnus-treat-strip-trailing-blank-lines gnus-article-remove-trailing-blank-lines) (gnus-treat-strip-leading-blank-lines === modified file 'lisp/gnus/gnus-picon.el' --- lisp/gnus/gnus-picon.el 2010-09-26 13:25:35 +0000 +++ lisp/gnus/gnus-picon.el 2010-09-26 14:35:50 +0000 @@ -85,10 +85,6 @@ (const right)) :group 'gnus-picon) -(defface gnus-picon '((t (:foreground "black" :background "white"))) - "Face to show picon in." - :group 'gnus-picon) - ;;; Internal variables: (defvar gnus-picon-glyph-alist nil @@ -151,13 +147,13 @@ (insert glyph) (gnus-add-wash-type category) (gnus-add-image category (car glyph)) - (let ((start (point))) - (gnus-put-image (car glyph) (unless nostring (cdr glyph)) category) - (put-text-property start (point) 'face 'gnus-picon)))) + (gnus-put-image (car glyph) (unless nostring (cdr glyph)) category))) (defun gnus-picon-create-glyph (file) (or (cdr (assoc file gnus-picon-glyph-alist)) - (cdar (push (cons file (gnus-create-image file)) + (cdar (push (cons file (gnus-create-image + file nil nil + :color-symbols '(("None" . "white")))) gnus-picon-glyph-alist)))) ;;; Functions that does picon transformations: === modified file 'lisp/gnus/message.el' --- lisp/gnus/message.el 2010-09-23 19:00:31 +0000 +++ lisp/gnus/message.el 2010-09-26 14:35:50 +0000 @@ -626,29 +626,23 @@ :type 'regexp) (defcustom message-cite-prefix-regexp - ;; Default to the value of `mail-citation-prefix-regexp' if available. - ;; Note: as for Emacs 21, XEmacs 21.4 and 21.5, it is unavailable - ;; unless sendmail.el is loaded. - (cond ((boundp 'mail-citation-prefix-regexp) - mail-citation-prefix-regexp) - ((string-match "[[:digit:]]" "1") - ;; Support POSIX? XEmacs 21.5.27 doesn't. - "\\([ \t]*[_.[:word:]]+>+\\|[ \t]*[]>|}]\\)+") - (t - ;; ?-, ?_ or ?. MUST NOT be in syntax entry w. - (let (non-word-constituents) - (with-syntax-table text-mode-syntax-table - (setq non-word-constituents - (concat - (if (string-match "\\w" "_") "" "_") - (if (string-match "\\w" ".") "" ".")))) - (if (equal non-word-constituents "") - "\\([ \t]*\\(\\w\\)+>+\\|[ \t]*[]>|}]\\)+" - (concat "\\([ \t]*\\(\\w\\|[" - non-word-constituents - "]\\)+>+\\|[ \t]*[]>|}]\\)+"))))) + (if (string-match "[[:digit:]]" "1") + ;; Support POSIX? XEmacs 21.5.27 doesn't. + "\\([ \t]*[_.[:word:]]+>+\\|[ \t]*[]>|]\\)+" + ;; ?-, ?_ or ?. MUST NOT be in syntax entry w. + (let (non-word-constituents) + (with-syntax-table text-mode-syntax-table + (setq non-word-constituents + (concat + (if (string-match "\\w" "_") "" "_") + (if (string-match "\\w" ".") "" ".")))) + (if (equal non-word-constituents "") + "\\([ \t]*\\(\\w\\)+>+\\|[ \t]*[]>|]\\)+" + (concat "\\([ \t]*\\(\\w\\|[" + non-word-constituents + "]\\)+>+\\|[ \t]*[]>|]\\)+")))) "*Regexp matching the longest possible citation prefix on a line." - :version "23.2" + :version "24.1" :group 'message-insertion :link '(custom-manual "(message)Insertion Variables") :type 'regexp === modified file 'lisp/gnus/nnimap.el' --- lisp/gnus/nnimap.el 2010-09-26 04:03:19 +0000 +++ lisp/gnus/nnimap.el 2010-09-26 14:35:50 +0000 @@ -238,7 +238,7 @@ ?s host ?p port))))) -(defun nnimap-credentials (address ports) +(defun nnimap-credentials (address ports &optional inhibit-create) (let (port credentials) ;; Request the credentials from all ports, but only query on the ;; last port if all the previous ones have failed. @@ -246,7 +246,10 @@ (setq port (pop ports))) (setq credentials (auth-source-user-or-password - '("login" "password") address port nil (null ports)))) + '("login" "password") address port nil + (if inhibit-create + nil + (null ports))))) credentials)) (defun nnimap-keepalive () @@ -318,16 +321,21 @@ (when (eq nnimap-stream 'starttls) (nnimap-command "STARTTLS") (starttls-negotiate (nnimap-process nnimap-object))) + (when nnimap-server-port + (push (format "%s" nnimap-server-port) ports)) (unless (equal connection-result "PREAUTH") (if (not (setq credentials (if (eq nnimap-authenticator 'anonymous) (list "anonymous" (message-make-address)) - (nnimap-credentials - nnimap-address - (if nnimap-server-port - (cons (format "%s" nnimap-server-port) ports) - ports))))) + (or + ;; First look for the credentials based + ;; on the virtual server name. + (nnimap-credentials + (nnoo-current-server 'nnimap) ports t) + ;; Then look them up based on the + ;; physical address. + (nnimap-credentials nnimap-address ports))))) (setq nnimap-object nil) (setq login-result (nnimap-command "LOGIN %S %S" (car credentials) === modified file 'lisp/net/tls.el' --- lisp/net/tls.el 2010-09-02 00:55:51 +0000 +++ lisp/net/tls.el 2010-09-26 14:35:50 +0000 @@ -238,6 +238,10 @@ (setq process (start-process name buffer shell-file-name shell-command-switch formatted-cmd)) + (funcall (if (fboundp 'set-process-query-on-exit-flag) + 'set-process-query-on-exit-flag + 'process-kill-without-query) + process nil) (while (and process (memq (process-status process) '(open run)) (progn ------------------------------------------------------------ revno: 101627 author: Lars Magne Ingebrigtsen committer: Katsumi Yamaoka branch nick: trunk timestamp: Sun 2010-09-26 13:25:35 +0000 message: auth-source.el (auth-source-create): Query the user for whether to store the credentials. auth-source.el: Require netrc. nnml.el (nnml-open-nov): Don't return dead buffers. gnus-picon.el (gnus-picon-xbm): Removed obsolete face. gnus-picon.el (gnus-picon-insert-glyph): Make the background white. gnus-art.el (gnus-treatment-function-alist): Insert picons after doing the header highlightling. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-09-26 06:06:28 +0000 +++ lisp/ChangeLog 2010-09-26 13:25:35 +0000 @@ -1,3 +1,7 @@ +2010-09-26 Lars Magne Ingebrigtsen + + * net/netrc.el (netrc-store-data): New function. + 2010-09-26 Teodor Zlatanov * net/gnutls.el: GnuTLS glue code to set up a connection. === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-09-25 15:07:55 +0000 +++ lisp/gnus/ChangeLog 2010-09-26 13:25:35 +0000 @@ -1,4 +1,150 @@ -2010-09-25 Lars Magne Ingebrigtsen +2010-09-26 Lars Magne Ingebrigtsen + + * gnus-art.el (gnus-treatment-function-alist): Insert picons after + doing the header highlightling, so that the background colour of the + picon is correct. + + * gnus-picon.el (gnus-picon-xbm): Removed obsolete face. + (gnus-picon): Ditto. + (gnus-picon): Reinstate. The background colour for picons is white. + (gnus-picon-insert-glyph): Make the background white. + + * nnml.el (nnml-open-nov): Don't return dead buffers. + + * auth-source.el (auth-source-create): Query the user for whether to + store the credentials. + + * auth-source.el (auth-source-user-or-password): Use the existing auth + sources, if any, for creation. + + * gnus.el (gnus-group-fast-parameter): Return the last matching + parameter instead of the first matching parameter. + +2010-09-26 Julien Danjou + + * gnus-sum.el (gnus-auto-center-group): Transform into a defcustom. + +2010-09-26 Lars Magne Ingebrigtsen + + * mml2015.el (mml2015-use): Remove gpg support. + + * mml1991.el (mml1991-function-alist): Remove gpg function. + (mml1991-gpg-sign): Removed. + +2010-09-26 Andreas Seltenreich + + * gnus-srvr.el (gnus-browse-subscribe-newsgroup-method): New variable. + (gnus-browse-unsubscribe-current-group): Document it. + (gnus-browse-unsubscribe-group): Use it. + +2010-09-26 Lars Magne Ingebrigtsen + + * gnus-group.el (gnus-read-ephemeral-bug-group): Add the bug email + address to the To list for easier response. + + * gnus.el (gnus-play-startup-jingle): Removed. + (gnus-splash): Don't play jingle. + (gnus): Silence gnus-load message. + + * gnus-art.el (gnus-treat-play-sounds): Removed. + + * gnus.el (gnus-play-jingle): Remove audio support. + + * gnus-cus.el (gnus-score-customize): Remove audio reference. + + * earcon.el: Removed -- no users. + + * gnus-audio.el: Removed -- no users of this package. + + * gnus-sum.el (gnus-summary-limit-children): Remove nocem support. + + * gnus-start.el (gnus-setup-news): Remove nocem support. + + * gnus-group.el (gnus-group-get-new-news): Removed nocem call. + + * gnus.el (gnus-use-nocem): Removed. + + * gnus-demon.el (gnus-demon-add-nocem, gnus-demon-scan-nocem): + Removed. + + * gnus-nocem.el (gnus-nocem-issuers): Removed file. Apparently nobody + uses NoCeM any more. + + * gnus-art.el (gnus-ctan-url): Seems not very useful -- removed. + (gnus-button-ctan-handler): Ditto. + (gnus-button-handle-ctan-bogus-regexp): Ditto. + (gnus-button-ctan-directory-regexp): Ditto. + (gnus-button-handle-ctan): Ditto. + (gnus-button-tex-level): Ditto. + (gnus-button-alist): Removed CTAN stuff. + +2010-09-25 Lars Magne Ingebrigtsen + + * nnimap.el (nnimap-wait-for-response): Reversed logic in the + nnimap-streaming test. + + * gnus-start.el (gnus-get-unread-articles): Don't try to open failed + servers twice. + + * nnimap.el (nnimap-open-connection): Add more error reporting when + nnimap fails early. + + * nnheader.el (nnheader-get-report-string): New function. + (nnheader-get-report): Use it. + + * gnus-int.el (gnus-check-server): Say what the error was when opening + failed. + + * nnimap.el (nnimap-wait-for-response): Search further when we're not + using streaming. + +2010-09-25 Julien Danjou + + * gnus-html.el (gnus-html-rescale-image): Use our defalias + gnus-window-inside-pixel-edges. + +2010-09-25 Lars Magne Ingebrigtsen + + * gnus-srvr.el (gnus-server-copy-server): Add documentation. + + * mm-decode.el (mm-save-part): Allow saving to other directories the + normal Emacs way. + + * nndoc.el (nndoc-type-alist): Move mime-parts after mbox. Suggested + by Jay Berkenbilt. + + * gnus-art.el (gnus-mime-delete-part): Fix plural for "byte" when + there isn't a single byte. + + * gnus-int.el (gnus-open-server): Don't query whether to go offline -- + just do it. It doesn't really seem to matter what the user responds + here, I think, so it's just a confusing question. + + * nnimap.el (nnimap-retrieve-group-data-early): Fix typo in the + non-streaming case. + + * gnus-art.el (gnus-flush-original-article-buffer): Separated out. + (gnus-article-encrypt-body): Use it. + + * gnus-sum.el (gnus-summary-show-complete-article): New command and + keystroke. + + * nnimap.el (nnimap-find-wanted-parts-1): Use + gnus-fetch-partial-articles. + + * gnus-art.el (gnus-fetch-partial-articles): New variable. + + * nnimap.el (nnimap-insert-partial-structure): New function. + (nnimap-get-partial-article): New function. + (nnimap-request-article): Use it. + (nnimap-wait-for-response): Return whether the wait was successful. + (nnimap-finish-retrieve-group-infos): Don't do anything if the + retrieval wasn't successful. + (nnimap-retrieve-group-data-early): Allow throttling servers. + (nnimap-streaming): New variable. + (nnimap-fetch-partial-articles): Removed. + + * mm-decode.el (mm-with-part): Protect against killed buffers. * nndraft.el (nndraft-retrieve-headers): Insert Lines and Chars headers for prettier summary display. @@ -209,7 +355,6 @@ 2010-09-23 Teodor Zlatanov - * netrc.el (netrc-parse): Remove encrypt.el mentions. * encrypt.el: Removed. 2010-09-23 Lars Magne Ingebrigtsen === modified file 'lisp/gnus/auth-source.el' --- lisp/gnus/auth-source.el 2010-09-26 12:47:09 +0000 +++ lisp/gnus/auth-source.el 2010-09-26 13:25:35 +0000 @@ -32,9 +32,9 @@ ;;; Code: (require 'gnus-util) +(require 'netrc) (eval-when-compile (require 'cl)) -(autoload 'netrc-machine-user-or-password "netrc") (autoload 'secrets-create-item "secrets") (autoload 'secrets-delete-item "secrets") (autoload 'secrets-get-alias "secrets") @@ -312,25 +312,41 @@ (setq result (mapcar (lambda (m) - (cond - ((equal "password" m) - (let ((passwd (read-passwd - (format "Password for %s on %s: " prot host)))) - (cond - ;; Secret Service API. - ((consp source) - (apply - 'secrets-create-item - (auth-get-source entry) name passwd spec)) - (t)) ;; netrc not implemented yes. - passwd)) - ((equal "login" m) - (or user - (read-string (format "User name for %s on %s: " prot host)))) - (t - "unknownuser"))) + (cons + m + (cond + ((equal "password" m) + (let ((passwd (read-passwd + (format "Password for %s on %s: " prot host)))) + (cond + ;; Secret Service API. + ((consp source) + (apply + 'secrets-create-item + (auth-get-source entry) name passwd spec)) + (t)) ;; netrc not implemented yes. + passwd)) + ((equal "login" m) + (or user + (read-string (format "User name for %s on %s: " prot host)))) + (t + "unknownuser")))) (if (consp mode) mode (list mode)))) - (if (consp mode) result (car result)))) + ;; Allow the source to save the data. + (cond + ((consp source) + ;; Secret Service API -- not implemented. + ) + (t + ;; netrc interface. + (when (y-or-n-p (format "Do you want to save this password in %s? " + source)) + (netrc-store-data source host prot + (or user (cdr (assoc "login" result))) + (cdr (assoc "password" result)))))) + (if (consp mode) + (mapcar #'cdr result) + (cdar result)))) (defun auth-source-delete (entry &rest spec) "Delete credentials according to SPEC in ENTRY." === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2010-09-26 04:03:19 +0000 +++ lisp/gnus/gnus-art.el 2010-09-26 13:25:35 +0000 @@ -1692,13 +1692,13 @@ (gnus-treat-strip-list-identifiers gnus-article-hide-list-identifiers) (gnus-treat-leading-whitespace gnus-article-remove-leading-whitespace) (gnus-treat-strip-pem gnus-article-hide-pem) + (gnus-treat-from-gravatar gnus-treat-from-gravatar) + (gnus-treat-mail-gravatar gnus-treat-mail-gravatar) + (gnus-treat-highlight-headers gnus-article-highlight-headers) + (gnus-treat-highlight-signature gnus-article-highlight-signature) (gnus-treat-from-picon gnus-treat-from-picon) (gnus-treat-mail-picon gnus-treat-mail-picon) (gnus-treat-newsgroups-picon gnus-treat-newsgroups-picon) - (gnus-treat-from-gravatar gnus-treat-from-gravatar) - (gnus-treat-mail-gravatar gnus-treat-mail-gravatar) - (gnus-treat-highlight-headers gnus-article-highlight-headers) - (gnus-treat-highlight-signature gnus-article-highlight-signature) (gnus-treat-strip-trailing-blank-lines gnus-article-remove-trailing-blank-lines) (gnus-treat-strip-leading-blank-lines === modified file 'lisp/gnus/gnus-picon.el' --- lisp/gnus/gnus-picon.el 2010-09-25 13:28:07 +0000 +++ lisp/gnus/gnus-picon.el 2010-09-26 13:25:35 +0000 @@ -85,19 +85,9 @@ (const right)) :group 'gnus-picon) -(defface gnus-picon-xbm '((t (:foreground "black" :background "white"))) - "Face to show xbm picon in." - :group 'gnus-picon) -;; backward-compatibility alias -(put 'gnus-picon-xbm-face 'face-alias 'gnus-picon-xbm) -(put 'gnus-picon-xbm-face 'obsolete-face "22.1") - (defface gnus-picon '((t (:foreground "black" :background "white"))) "Face to show picon in." :group 'gnus-picon) -;; backward-compatibility alias -(put 'gnus-picon-face 'face-alias 'gnus-picon) -(put 'gnus-picon-face 'obsolete-face "22.1") ;;; Internal variables: @@ -161,7 +151,9 @@ (insert glyph) (gnus-add-wash-type category) (gnus-add-image category (car glyph)) - (gnus-put-image (car glyph) (unless nostring (cdr glyph)) category))) + (let ((start (point))) + (gnus-put-image (car glyph) (unless nostring (cdr glyph)) category) + (put-text-property start (point) 'face 'gnus-picon)))) (defun gnus-picon-create-glyph (file) (or (cdr (assoc file gnus-picon-glyph-alist)) === modified file 'lisp/gnus/nnml.el' --- lisp/gnus/nnml.el 2010-09-23 23:14:02 +0000 +++ lisp/gnus/nnml.el 2010-09-26 13:25:35 +0000 @@ -846,7 +846,9 @@ buffer)) (defun nnml-open-nov (group) - (or (cdr (assoc group nnml-nov-buffer-alist)) + (or (let ((buffer (cdr (assoc group nnml-nov-buffer-alist)))) + (and (buffer-name buffer) + buffer)) (let ((buffer (nnml-get-nov-buffer group))) (push (cons group buffer) nnml-nov-buffer-alist) buffer))) === modified file 'lisp/net/netrc.el' --- lisp/net/netrc.el 2010-09-23 03:57:10 +0000 +++ lisp/net/netrc.el 2010-09-26 13:25:35 +0000 @@ -220,6 +220,17 @@ (eq type (car (cddr service))))))) (cadr service))) +(defun netrc-store-data (file host port user password) + (with-temp-buffer + (when (file-exists-p file) + (insert-file-contents file)) + (goto-char (point-max)) + (unless (bolp) + (insert "\n")) + (insert (format "machine %s login %s password %s port %s\n" + host user password port)) + (write-region (point-min) (point-max) file nil 'silent))) + ;;;###autoload (defun netrc-credentials (machine &rest ports) "Return a user name/password pair. ------------------------------------------------------------ revno: 101626 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Sun 2010-09-26 12:47:09 +0000 message: gnus-sum.el (gnus-auto-center-group): Transform into a defcustom. gnus.el (gnus-group-fast-parameter): Return the last matching parameter instead of the first matching parameter. auth-source.el (auth-source-user-or-password): Query for password, although there are no existing auth sources. auth-source.el (auth-source-user-or-password): Use the existing auth sources, if any, for creation. diff: === modified file 'doc/misc/gnus-news.texi' --- doc/misc/gnus-news.texi 2010-09-26 04:03:19 +0000 +++ doc/misc/gnus-news.texi 2010-09-26 12:47:09 +0000 @@ -103,6 +103,12 @@ @c ************************ @itemize @bullet + +@item +Symbols like @code{gcc-self} now has the same presedence rules in +@code{gnus-parameters} as other ``real'' variables: The last match +wins instead of the first match. + @item Old intermediate incoming mail files (@file{Incoming*}) are deleted after a couple of days, not immediately. @xref{Mail Source === modified file 'lisp/gnus/auth-source.el' --- lisp/gnus/auth-source.el 2010-09-18 10:02:19 +0000 +++ lisp/gnus/auth-source.el 2010-09-26 12:47:09 +0000 @@ -430,8 +430,12 @@ (and found (return found))) ;; We haven't found something, so we will create it interactively. - (when (and (not found) choices create-missing) - (setq found (apply 'auth-source-create mode (car choices) search))) + (when (and (not found) create-missing) + (setq found (apply 'auth-source-create + mode (if choices + (car choices) + (car auth-sources)) + search))) ;; Cache the result. (when found === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2010-09-26 04:03:19 +0000 +++ lisp/gnus/gnus-sum.el 2010-09-26 12:47:09 +0000 @@ -451,8 +451,10 @@ (integer :tag "height") (sexp :menu-tag "both" t))) -(defvar gnus-auto-center-group t - "*If non-nil, always center the group buffer.") +(defcustom gnus-auto-center-group t + "If non-nil, always center the group buffer." + :group 'gnus-summary-maneuvering + :type 'boolean) (defcustom gnus-show-all-headers nil "*If non-nil, don't hide any headers." === modified file 'lisp/gnus/gnus.el' --- lisp/gnus/gnus.el 2010-09-26 04:03:19 +0000 +++ lisp/gnus/gnus.el 2010-09-26 12:47:09 +0000 @@ -3862,9 +3862,7 @@ ;; Expand if necessary. (if (and (stringp result) (string-match "\\\\[0-9&]" result)) (setq result (gnus-expand-group-parameter (car head) - result group))) - ;; Exit the loop early. - (setq tail nil)))) + result group)))))) ;; Done. result)))) ------------------------------------------------------------ revno: 101625 committer: Ted Zlatanov branch nick: quickfixes timestamp: Sun 2010-09-26 01:06:28 -0500 message: Set up GnuTLS support. * configure.in: Set up GnuTLS. * lisp/net/gnutls.el: GnuTLS glue code to set up a connection. * src/Makefile.in (LIBGNUTLS_LIBS, LIBGNUTLS_CFLAGS, ALL_CFLAGS) (obj, LIBES): Set up GnuTLS support. * src/config.in: Set up GnuTLS support. * src/emacs.c: Set up GnuTLS support and call syms_of_gnutls. * src/gnutls.c: The source code for GnuTLS support in Emacs. * src/gnutls.h: The GnuTLS glue for Emacs, macros and enums. * src/process.c (make_process, Fstart_process) (read_process_output, send_process): Set up GnuTLS support for process input/output file descriptors. * src/process.h: Set up GnuTLS support. diff: === modified file 'ChangeLog' --- ChangeLog 2010-09-22 03:10:16 +0000 +++ ChangeLog 2010-09-26 06:06:28 +0000 @@ -1,3 +1,7 @@ +2010-09-26 Teodor Zlatanov + + * configure.in: Set up GnuTLS. + 2010-09-22 Chong Yidong * configure.in: Announce whether libxml2 is linked to. === modified file 'configure.in' --- configure.in 2010-09-22 03:10:16 +0000 +++ configure.in 2010-09-26 06:06:28 +0000 @@ -171,6 +171,7 @@ OPTION_DEFAULT_ON([dbus],[don't compile with D-Bus support]) OPTION_DEFAULT_ON([gconf],[don't compile with GConf support]) OPTION_DEFAULT_ON([selinux],[don't compile with SELinux support]) +OPTION_DEFAULT_ON([gnutls],[don't use -lgnutls for SSL/TLS support]) ## For the times when you want to build Emacs but don't have ## a suitable makeinfo, and can live without the manuals. @@ -1999,6 +2000,13 @@ fi AC_SUBST(LIBSELINUX_LIBS) +HAVE_GNUTLS=no +if test "${with_gnutls}" = "yes" ; then + PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.2.4]) + AC_DEFINE(HAVE_GNUTLS) + HAVE_GNUTLS=yes +fi + dnl Do not put whitespace before the #include statements below. dnl Older compilers (eg sunos4 cc) choke on it. HAVE_XAW3D=no @@ -3701,6 +3709,7 @@ echo " Does Emacs use -ldbus? ${HAVE_DBUS}" echo " Does Emacs use -lgconf? ${HAVE_GCONF}" echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}" +echo " Does Emacs use -lgnutls (BROKEN)? ${HAVE_GNUTLS}" echo " Does Emacs use -lxml2? ${HAVE_LIBXML2}" echo " Does Emacs use -lfreetype? ${HAVE_FREETYPE}" === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-09-25 21:57:02 +0000 +++ lisp/ChangeLog 2010-09-26 06:06:28 +0000 @@ -1,3 +1,7 @@ +2010-09-26 Teodor Zlatanov + + * net/gnutls.el: GnuTLS glue code to set up a connection. + 2010-09-25 Julien Danjou * notifications.el: Call dbus-register-signal only if it is bound. === added file 'lisp/net/gnutls.el' --- lisp/net/gnutls.el 1970-01-01 00:00:00 +0000 +++ lisp/net/gnutls.el 2010-09-26 06:06:28 +0000 @@ -0,0 +1,128 @@ +;;; gnutls.el --- Support SSL and TLS connections through GnuTLS +;; Copyright (C) 2010 Free Software Foundation, Inc. + +;; Author: Ted Zlatanov +;; Keywords: comm, tls, ssl, encryption +;; Originally-By: Simon Josefsson (See http://josefsson.org/emacs-security/) + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;; This package provides language bindings for the GnuTLS library +;; using the corresponding core functions in gnutls.c. + +;; Simple test: +;; +;; (setq jas (open-ssl-stream "ssl" (current-buffer) "www.pdc.kth.se" 443)) +;; (process-send-string jas "GET /\r\n\r\n") + +;;; Code: + +(defun open-ssl-stream (name buffer host service) + "Open a SSL connection for a service to a host. +Returns a subprocess-object to represent the connection. +Input and output work as for subprocesses; `delete-process' closes it. +Args are NAME BUFFER HOST SERVICE. +NAME is name for process. It is modified if necessary to make it unique. +BUFFER is the buffer (or `buffer-name') to associate with the process. + Process output goes at end of that buffer, unless you specify + an output stream or filter function to handle the output. + BUFFER may be also nil, meaning that this process is not associated + with any buffer +Third arg is name of the host to connect to, or its IP address. +Fourth arg SERVICE is name of the service desired, or an integer +specifying a port number to connect to." + (let ((proc (open-network-stream name buffer host service))) + (starttls-negotiate proc nil 'gnutls-x509pki))) + +;; (open-ssl-stream "tls" "tls-buffer" "yourserver.com" "https") +(defun starttls-negotiate (proc &optional priority-string + credentials credentials-file) + "Negotiate a SSL or TLS connection. +PROC is the process returned by `starttls-open-stream'. +PRIORITY-STRING is as per the GnuTLS docs. +CREDENTIALS is `gnutls-x509pki' or `gnutls-anon'. +CREDENTIALS-FILE is a filename with meaning dependent on CREDENTIALS." + (let* ((credentials (or credentials 'gnutls-x509pki)) + (credentials-file (or credentials-file + "/etc/ssl/certs/ca-certificates.crt" + ;"/etc/ssl/certs/ca.pem" + )) + + (priority-string (or priority-string + (cond + ((eq credentials 'gnutls-anon) + "NORMAL:+ANON-DH:!ARCFOUR-128") + ((eq credentials 'gnutls-x509pki) + "NORMAL")))) + ret) + + (gnutls-message-maybe + (setq ret (gnutls-boot proc priority-string credentials credentials-file)) + "boot: %s") + + (when (gnutls-errorp ret) + (error "Could not boot GnuTLS for this process")); + + (let ((ret 'gnutls-e-again) + (n 25000)) + (while (and (not (gnutls-error-fatalp ret)) + (> n 0)) + (decf n) + (gnutls-message-maybe + (setq ret (gnutls-handshake proc)) + "handshake: %s") + ;(debug "handshake ret" ret (gnutls-error-string ret))) + ) + (if (gnutls-errorp ret) + (progn + (message "Ouch, error return %s (%s)" + ret (gnutls-error-string ret)) + (setq proc nil)) + (message "Handshake complete %s." ret))) + proc)) + +(defun starttls-open-stream (name buffer host service) + "Open a TLS connection for a service to a host. +Returns a subprocess-object to represent the connection. +Input and output work as for subprocesses; `delete-process' closes it. +Args are NAME BUFFER HOST SERVICE. +NAME is name for process. It is modified if necessary to make it unique. +BUFFER is the buffer (or `buffer-name') to associate with the process. + Process output goes at end of that buffer, unless you specify + an output stream or filter function to handle the output. + BUFFER may be also nil, meaning that this process is not associated + with any buffer +Third arg is name of the host to connect to, or its IP address. +Fourth arg SERVICE is name of the service desired, or an integer +specifying a port number to connect to." + (open-network-stream name buffer host service)) + +(defun gnutls-message-maybe (doit format &rest params) + "When DOIT, message with the caller name followed by FORMAT on PARAMS." + ;; (apply 'debug format (or params '(nil))) + (when (gnutls-errorp doit) + (message "%s: (err=[%s] %s) %s" + "gnutls.el" + doit (gnutls-error-string doit) + (apply 'format format (or params '(nil)))))) + +(provide 'ssl) +(provide 'gnutls) +(provide 'starttls) + +;;; gnutls.el ends here === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-26 01:39:24 +0000 +++ src/ChangeLog 2010-09-26 06:06:28 +0000 @@ -1,3 +1,22 @@ +2010-09-26 Teodor Zlatanov + + * process.h: Set up GnuTLS support. + + * process.c (make_process, Fstart_process) + (read_process_output, send_process): Set up GnuTLS support for + process input/output file descriptors. + + * gnutls.h: The GnuTLS glue for Emacs, macros and enums. + + * gnutls.c: The source code for GnuTLS support in Emacs. + + * emacs.c: Set up GnuTLS support and call syms_of_gnutls. + + * config.in: Set up GnuTLS support. + + * Makefile.in (LIBGNUTLS_LIBS, LIBGNUTLS_CFLAGS, ALL_CFLAGS) + (obj, LIBES): Set up GnuTLS support. + 2010-09-26 Juanma Barranquero * w32.c (get_emacs_configuration_options): Fix previous change. === modified file 'src/Makefile.in' --- src/Makefile.in 2010-09-20 22:35:37 +0000 +++ src/Makefile.in 2010-09-26 06:06:28 +0000 @@ -286,6 +286,9 @@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ +LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ +LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ + INTERVALS_H = dispextern.h intervals.h composite.h GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ @@ -325,6 +328,7 @@ ${LIBXML2_CFLAGS} ${DBUS_CFLAGS} \ ${GCONF_CFLAGS} ${FREETYPE_CFLAGS} ${FONTCONFIG_CFLAGS} \ ${LIBOTF_CFLAGS} ${M17N_FLT_CFLAGS} ${DEPFLAGS} ${PROFILING_CFLAGS} \ + $(LIBGNUTLS_CFLAGS) \ ${C_WARNINGS_SWITCH} ${CFLAGS} ALL_OBJC_CFLAGS=$(ALL_CFLAGS) $(GNU_OBJC_CFLAGS) @@ -349,7 +353,7 @@ alloc.o data.o doc.o editfns.o callint.o \ eval.o floatfns.o fns.o font.o print.o lread.o \ syntax.o $(UNEXEC_OBJ) bytecode.o \ - process.o callproc.o \ + process.o gnutls.o callproc.o \ region-cache.o sound.o atimer.o \ doprnt.o strftime.o intervals.o textprop.o composite.o md5.o xml.o \ $(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) @@ -601,6 +605,7 @@ ${LIBXML2_LIBS} $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \ $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) ${GCONF_LIBS} ${LIBSELINUX_LIBS} \ $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \ + $(LIBGNUTLS_LIBS) \ $(LIB_GCC) $(LIB_MATH) $(LIB_STANDARD) $(LIB_GCC) all: emacs${EXEEXT} $(OTHER_FILES) === modified file 'src/config.in' --- src/config.in 2010-09-10 16:44:35 +0000 +++ src/config.in 2010-09-26 06:06:28 +0000 @@ -255,6 +255,9 @@ /* Define to 1 if you have a gif (or ungif) library. */ #undef HAVE_GIF +/* Define if we have the GNU TLS library. */ +#undef HAVE_GNUTLS + /* Define to 1 if you have the gpm library (-lgpm). */ #undef HAVE_GPM @@ -1094,6 +1097,12 @@ #include config_opsysfile #include config_machfile +#if HAVE_GNUTLS +#define LIBGNUTLS $(LIBGNUTLS_LIBS) +#else /* not HAVE_GNUTLS */ +#define LIBGNUTLS +#endif /* not HAVE_GNUTLS */ + /* Set up some defines, C and LD flags for NeXTstep interface on GNUstep. (There is probably a better place to do this, but right now the Cocoa side does this in s/darwin.h and we cannot === modified file 'src/emacs.c' --- src/emacs.c 2010-09-21 11:13:36 +0000 +++ src/emacs.c 2010-09-26 06:06:28 +0000 @@ -59,6 +59,10 @@ #include "keyboard.h" #include "keymap.h" +#ifdef HAVE_GNUTLS +#include "gnutls.h" +#endif + #ifdef HAVE_NS #include "nsterm.h" #endif @@ -1569,6 +1573,10 @@ syms_of_fontset (); #endif /* HAVE_NS */ +#ifdef HAVE_GNUTLS + syms_of_gnutls (); +#endif + #ifdef HAVE_DBUS syms_of_dbusbind (); #endif /* HAVE_DBUS */ === added file 'src/gnutls.c' --- src/gnutls.c 1970-01-01 00:00:00 +0000 +++ src/gnutls.c 2010-09-26 06:06:28 +0000 @@ -0,0 +1,551 @@ +/* GnuTLS glue for GNU Emacs. + Copyright (C) 2010 Free Software Foundation, Inc. + +This file is part of GNU Emacs. + +GNU Emacs is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +GNU Emacs is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Emacs. If not, see . */ + +#include +#include +#include + +#include "lisp.h" +#include "process.h" + +#ifdef HAVE_GNUTLS +#include + +Lisp_Object Qgnutls_code; +Lisp_Object Qgnutls_anon, Qgnutls_x509pki; +Lisp_Object Qgnutls_e_interrupted, Qgnutls_e_again, + Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake; +int global_initialized; + +int +emacs_gnutls_write (int fildes, gnutls_session_t state, char *buf, + unsigned int nbyte) +{ + register int rtnval, bytes_written; + + bytes_written = 0; + + while (nbyte > 0) + { + rtnval = gnutls_write (state, buf, nbyte); + + if (rtnval == -1) + { + if (errno == EINTR) + continue; + else + return (bytes_written ? bytes_written : -1); + } + + buf += rtnval; + nbyte -= rtnval; + bytes_written += rtnval; + } + fsync (STDOUT_FILENO); + + return (bytes_written); +} + +int +emacs_gnutls_read (int fildes, gnutls_session_t state, char *buf, + unsigned int nbyte) +{ + register int rtnval; + + do { + rtnval = gnutls_read (state, buf, nbyte); + } while (rtnval == GNUTLS_E_INTERRUPTED || rtnval == GNUTLS_E_AGAIN); + fsync (STDOUT_FILENO); + + return (rtnval); +} + +/* convert an integer error to a Lisp_Object; it will be either a + known symbol like `gnutls_e_interrupted' and `gnutls_e_again' or + simply the integer value of the error. GNUTLS_E_SUCCESS is mapped + to Qt. */ +Lisp_Object gnutls_make_error (int error) +{ + switch (error) + { + case GNUTLS_E_SUCCESS: + return Qt; + case GNUTLS_E_AGAIN: + return Qgnutls_e_again; + case GNUTLS_E_INTERRUPTED: + return Qgnutls_e_interrupted; + case GNUTLS_E_INVALID_SESSION: + return Qgnutls_e_invalid_session; + } + + return make_number (error); +} + +DEFUN ("gnutls-get-initstage", Fgnutls_get_initstage, Sgnutls_get_initstage, 1, 1, 0, + doc: /* Return the GnuTLS init stage of PROCESS. +See also `gnutls-boot'. */) + (Lisp_Object proc) +{ + CHECK_PROCESS (proc); + + return make_number (GNUTLS_INITSTAGE (proc)); +} + +DEFUN ("gnutls-errorp", Fgnutls_errorp, Sgnutls_errorp, 1, 1, 0, + doc: /* Returns t if ERROR (as generated by gnutls_make_error) +indicates a GnuTLS problem. */) + (Lisp_Object error) +{ + if (EQ (error, Qt)) return Qnil; + + return Qt; +} + +DEFUN ("gnutls-error-fatalp", Fgnutls_error_fatalp, Sgnutls_error_fatalp, 1, 1, 0, + doc: /* Checks if ERROR is fatal. +ERROR is an integer or a symbol with an integer `gnutls-code' property. */) + (Lisp_Object err) +{ + Lisp_Object code; + + if (EQ (err, Qt)) return Qnil; + + if (SYMBOLP (err)) + { + code = Fget (err, Qgnutls_code); + if (NUMBERP (code)) + { + err = code; + } + else + { + error ("Symbol has no numeric gnutls-code property"); + } + } + + if (!NUMBERP (err)) + error ("Not an error symbol or code"); + + if (0 == gnutls_error_is_fatal (XINT (err))) + return Qnil; + + return Qt; +} + +DEFUN ("gnutls-error-string", Fgnutls_error_string, Sgnutls_error_string, 1, 1, 0, + doc: /* Returns a description of ERROR. +ERROR is an integer or a symbol with an integer `gnutls-code' property. */) + (Lisp_Object err) +{ + Lisp_Object code; + + if (EQ (err, Qt)) return build_string ("Not an error"); + + if (SYMBOLP (err)) + { + code = Fget (err, Qgnutls_code); + if (NUMBERP (code)) + { + err = code; + } + else + { + return build_string ("Symbol has no numeric gnutls-code property"); + } + } + + if (!NUMBERP (err)) + return build_string ("Not an error symbol or code"); + + return build_string (gnutls_strerror (XINT (err))); +} + +DEFUN ("gnutls-deinit", Fgnutls_deinit, Sgnutls_deinit, 1, 1, 0, + doc: /* Deallocate GNU TLS resources associated with PROCESS. +See also `gnutls-init'. */) + (Lisp_Object proc) +{ + gnutls_session_t state; + + CHECK_PROCESS (proc); + state = XPROCESS (proc)->gnutls_state; + + if (GNUTLS_INITSTAGE (proc) >= GNUTLS_STAGE_INIT) + { + gnutls_deinit (state); + GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_INIT - 1; + } + + return Qt; +} + +/* Initializes global GNU TLS state to defaults. +Call `gnutls-global-deinit' when GNU TLS usage is no longer needed. +Returns zero on success. */ +Lisp_Object gnutls_emacs_global_init (void) +{ + int ret = GNUTLS_E_SUCCESS; + + if (!global_initialized) + ret = gnutls_global_init (); + + global_initialized = 1; + + return gnutls_make_error (ret); +} + +/* Deinitializes global GNU TLS state. +See also `gnutls-global-init'. */ +Lisp_Object gnutls_emacs_global_deinit (void) +{ + if (global_initialized) + gnutls_global_deinit (); + + global_initialized = 0; + + return gnutls_make_error (GNUTLS_E_SUCCESS); +} + +DEFUN ("gnutls-boot", Fgnutls_boot, Sgnutls_boot, 3, 6, 0, + doc: /* Initializes client-mode GnuTLS for process PROC. +Currently only client mode is supported. Returns a success/failure +value you can check with `gnutls-errorp'. + +PRIORITY_STRING is a string describing the priority. +TYPE is either `gnutls-anon' or `gnutls-x509pki'. +TRUSTFILE is a PEM encoded trust file for `gnutls-x509pki'. +KEYFILE is ... for `gnutls-x509pki' (TODO). +CALLBACK is ... for `gnutls-x509pki' (TODO). + +Note that the priority is set on the client. The server does not use +the protocols's priority except for disabling protocols that were not +specified. + +Processes must be initialized with this function before other GNU TLS +functions are used. This function allocates resources which can only +be deallocated by calling `gnutls-deinit' or by calling it again. + +Each authentication type may need additional information in order to +work. For X.509 PKI (`gnutls-x509pki'), you need TRUSTFILE and +KEYFILE and optionally CALLBACK. */) + (Lisp_Object proc, Lisp_Object priority_string, Lisp_Object type, + Lisp_Object trustfile, Lisp_Object keyfile, Lisp_Object callback) +{ + int ret = GNUTLS_E_SUCCESS; + + /* TODO: GNUTLS_X509_FMT_DER is also an option. */ + int file_format = GNUTLS_X509_FMT_PEM; + + gnutls_session_t state; + gnutls_certificate_credentials_t x509_cred; + gnutls_anon_client_credentials_t anon_cred; + gnutls_srp_client_credentials_t srp_cred; + gnutls_datum_t data; + Lisp_Object global_init; + + CHECK_PROCESS (proc); + CHECK_SYMBOL (type); + CHECK_STRING (priority_string); + + state = XPROCESS (proc)->gnutls_state; + + /* always initialize globals. */ + global_init = gnutls_emacs_global_init (); + if (! NILP (Fgnutls_errorp (global_init))) + return global_init; + + /* deinit and free resources. */ + if (GNUTLS_INITSTAGE (proc) >= GNUTLS_STAGE_CRED_ALLOC) + { + message ("gnutls: deallocating certificates"); + + if (EQ (type, Qgnutls_x509pki)) + { + message ("gnutls: deallocating x509 certificates"); + + x509_cred = XPROCESS (proc)->x509_cred; + gnutls_certificate_free_credentials (x509_cred); + } + else if (EQ (type, Qgnutls_anon)) + { + message ("gnutls: deallocating anon certificates"); + + anon_cred = XPROCESS (proc)->anon_cred; + gnutls_anon_free_client_credentials (anon_cred); + } + else + { + error ("unknown credential type"); + ret = GNUTLS_EMACS_ERROR_INVALID_TYPE; + } + + if (GNUTLS_INITSTAGE (proc) >= GNUTLS_STAGE_INIT) + { + message ("gnutls: deinitializing"); + + Fgnutls_deinit (proc); + } + } + + GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_EMPTY; + + message ("gnutls: allocating credentials"); + + if (EQ (type, Qgnutls_x509pki)) + { + message ("gnutls: allocating x509 credentials"); + + x509_cred = XPROCESS (proc)->x509_cred; + if (gnutls_certificate_allocate_credentials (&x509_cred) < 0) + memory_full (); + } + else if (EQ (type, Qgnutls_anon)) + { + message ("gnutls: allocating anon credentials"); + + anon_cred = XPROCESS (proc)->anon_cred; + if (gnutls_anon_allocate_client_credentials (&anon_cred) < 0) + memory_full (); + } + else + { + error ("unknown credential type"); + ret = GNUTLS_EMACS_ERROR_INVALID_TYPE; + } + + if (ret < GNUTLS_E_SUCCESS) + return gnutls_make_error (ret); + + GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_CRED_ALLOC; + + message ("gnutls: setting the trustfile"); + + if (EQ (type, Qgnutls_x509pki)) + { + if (STRINGP (trustfile)) + { + ret = gnutls_certificate_set_x509_trust_file + (x509_cred, + XSTRING (trustfile)->data, + file_format); + + if (ret < GNUTLS_E_SUCCESS) + return gnutls_make_error (ret); + + message ("gnutls: processed %d CA certificates", ret); + } + + message ("gnutls: setting the keyfile"); + + if (STRINGP (keyfile)) + { + ret = gnutls_certificate_set_x509_crl_file + (x509_cred, + XSTRING (keyfile)->data, + file_format); + + if (ret < GNUTLS_E_SUCCESS) + return gnutls_make_error (ret); + + message ("gnutls: processed %d CRL(s)", ret); + } + } + + GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_FILES; + + message ("gnutls: gnutls_init"); + + ret = gnutls_init (&state, GNUTLS_CLIENT); + + if (ret < GNUTLS_E_SUCCESS) + return gnutls_make_error (ret); + + XPROCESS (proc)->gnutls_state = state; + + GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_INIT; + + message ("gnutls: setting the priority string"); + + ret = gnutls_priority_set_direct(state, + (char*) SDATA (priority_string), + NULL); + + if (ret < GNUTLS_E_SUCCESS) + return gnutls_make_error (ret); + + GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_PRIORITY; + + message ("gnutls: setting the credentials"); + + if (EQ (type, Qgnutls_x509pki)) + { + message ("gnutls: setting the x509 credentials"); + + ret = gnutls_cred_set (state, GNUTLS_CRD_CERTIFICATE, x509_cred); + } + else if (EQ (type, Qgnutls_anon)) + { + message ("gnutls: setting the anon credentials"); + + ret = gnutls_cred_set (state, GNUTLS_CRD_ANON, anon_cred); + } + else + { + error ("unknown credential type"); + ret = GNUTLS_EMACS_ERROR_INVALID_TYPE; + } + + if (ret < GNUTLS_E_SUCCESS) + return gnutls_make_error (ret); + + XPROCESS (proc)->anon_cred = anon_cred; + XPROCESS (proc)->x509_cred = x509_cred; + XPROCESS (proc)->gnutls_cred_type = type; + + GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_CRED_SET; + + return gnutls_make_error (GNUTLS_E_SUCCESS); +} + +DEFUN ("gnutls-bye", Fgnutls_bye, + Sgnutls_bye, 2, 2, 0, + doc: /* Terminate current GNU TLS connection for PROCESS. +The connection should have been initiated using `gnutls-handshake'. + +If CONT is not nil the TLS connection gets terminated and further +receives and sends will be disallowed. If the return value is zero you +may continue using the connection. If CONT is nil, GnuTLS actually +sends an alert containing a close request and waits for the peer to +reply with the same message. In order to reuse the connection you +should wait for an EOF from the peer. + +This function may also return `gnutls-e-again', or +`gnutls-e-interrupted'. */) + (Lisp_Object proc, Lisp_Object cont) +{ + gnutls_session_t state; + int ret; + + CHECK_PROCESS (proc); + + state = XPROCESS (proc)->gnutls_state; + + ret = gnutls_bye (state, + NILP (cont) ? GNUTLS_SHUT_RDWR : GNUTLS_SHUT_WR); + + return gnutls_make_error (ret); +} + +DEFUN ("gnutls-handshake", Fgnutls_handshake, + Sgnutls_handshake, 1, 1, 0, + doc: /* Perform GNU TLS handshake for PROCESS. +The identity of the peer is checked automatically. This function will +fail if any problem is encountered, and will return a negative error +code. In case of a client, if it has been asked to resume a session, +but the server didn't, then a full handshake will be performed. + +If the error `gnutls-e-not-ready-for-handshake' is returned, you +didn't call `gnutls-boot' first. + +This function may also return the non-fatal errors `gnutls-e-again', +or `gnutls-e-interrupted'. In that case you may resume the handshake +(by calling this function again). */) + (Lisp_Object proc) +{ + gnutls_session_t state; + int ret; + + CHECK_PROCESS (proc); + state = XPROCESS (proc)->gnutls_state; + + if (GNUTLS_INITSTAGE (proc) < GNUTLS_STAGE_HANDSHAKE_CANDO) + return Qgnutls_e_not_ready_for_handshake; + + + if (GNUTLS_INITSTAGE (proc) < GNUTLS_STAGE_TRANSPORT_POINTERS_SET) + { + /* for a network process in Emacs infd and outfd are the same + but this shows our intent more clearly. */ + message ("gnutls: handshake: setting the transport pointers to %d/%d", + XPROCESS (proc)->infd, XPROCESS (proc)->outfd); + + gnutls_transport_set_ptr2 (state, XPROCESS (proc)->infd, + XPROCESS (proc)->outfd); + + GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_TRANSPORT_POINTERS_SET; + } + + message ("gnutls: handshake: handshaking"); + ret = gnutls_handshake (state); + + GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_HANDSHAKE_TRIED; + + if (GNUTLS_E_SUCCESS == ret) + { + /* here we're finally done. */ + GNUTLS_INITSTAGE (proc) = GNUTLS_STAGE_READY; + } + + return gnutls_make_error (ret); +} + +void +syms_of_gnutls (void) +{ + global_initialized = 0; + + Qgnutls_code = intern_c_string ("gnutls-code"); + staticpro (&Qgnutls_code); + + Qgnutls_anon = intern_c_string ("gnutls-anon"); + staticpro (&Qgnutls_anon); + + Qgnutls_x509pki = intern_c_string ("gnutls-x509pki"); + staticpro (&Qgnutls_x509pki); + + Qgnutls_e_interrupted = intern_c_string ("gnutls-e-interrupted"); + staticpro (&Qgnutls_e_interrupted); + Fput (Qgnutls_e_interrupted, Qgnutls_code, + make_number (GNUTLS_E_INTERRUPTED)); + + Qgnutls_e_again = intern_c_string ("gnutls-e-again"); + staticpro (&Qgnutls_e_again); + Fput (Qgnutls_e_again, Qgnutls_code, + make_number (GNUTLS_E_AGAIN)); + + Qgnutls_e_invalid_session = intern_c_string ("gnutls-e-invalid-session"); + staticpro (&Qgnutls_e_invalid_session); + Fput (Qgnutls_e_invalid_session, Qgnutls_code, + make_number (GNUTLS_E_INVALID_SESSION)); + + Qgnutls_e_not_ready_for_handshake = + intern_c_string ("gnutls-e-not-ready-for-handshake"); + staticpro (&Qgnutls_e_not_ready_for_handshake); + Fput (Qgnutls_e_not_ready_for_handshake, Qgnutls_code, + make_number (GNUTLS_E_APPLICATION_ERROR_MIN)); + + defsubr (&Sgnutls_get_initstage); + defsubr (&Sgnutls_errorp); + defsubr (&Sgnutls_error_fatalp); + defsubr (&Sgnutls_error_string); + defsubr (&Sgnutls_boot); + defsubr (&Sgnutls_deinit); + defsubr (&Sgnutls_handshake); + defsubr (&Sgnutls_bye); +} +#endif === added file 'src/gnutls.h' --- src/gnutls.h 1970-01-01 00:00:00 +0000 +++ src/gnutls.h 2010-09-26 06:06:28 +0000 @@ -0,0 +1,60 @@ +/* GnuTLS glue for GNU Emacs. + Copyright (C) 2010 Free Software Foundation, Inc. + +This file is part of GNU Emacs. + +GNU Emacs is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +GNU Emacs is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Emacs. If not, see . */ + +#ifndef EMACS_GNUTLS_DEFINED +#define EMACS_GNUTLS_DEFINED + +#ifdef HAVE_GNUTLS +#include + +typedef enum +{ + /* Initialization stages. */ + GNUTLS_STAGE_EMPTY = 0, + GNUTLS_STAGE_CRED_ALLOC, + GNUTLS_STAGE_FILES, + GNUTLS_STAGE_INIT, + GNUTLS_STAGE_PRIORITY, + GNUTLS_STAGE_CRED_SET, + + /* Handshake stages. */ + GNUTLS_STAGE_HANDSHAKE_CANDO = GNUTLS_STAGE_CRED_SET, + GNUTLS_STAGE_TRANSPORT_POINTERS_SET, + GNUTLS_STAGE_HANDSHAKE_TRIED, + + GNUTLS_STAGE_READY, +} gnutls_initstage_t; + +#define GNUTLS_EMACS_ERROR_INVALID_TYPE GNUTLS_E_APPLICATION_ERROR_MIN + +#define GNUTLS_INITSTAGE(proc) (XPROCESS (proc)->gnutls_initstage) + +#define GNUTLS_PROCESS_USABLE(proc) (GNUTLS_INITSTAGE(proc) >= GNUTLS_STAGE_READY) + +int +emacs_gnutls_write (int fildes, gnutls_session_t state, char *buf, + unsigned int nbyte); +int +emacs_gnutls_read (int fildes, gnutls_session_t state, char *buf, + unsigned int nbyte); + +extern void syms_of_gnutls (void); + +#endif + +#endif === modified file 'src/process.c' --- src/process.c 2010-09-25 12:31:15 +0000 +++ src/process.c 2010-09-26 06:06:28 +0000 @@ -105,6 +105,9 @@ #include "sysselect.h" #include "syssignal.h" #include "syswait.h" +#ifdef HAVE_GNUTLS +#include "gnutls.h" +#endif #if defined (USE_GTK) || defined (HAVE_GCONF) #include "xgselect.h" @@ -583,6 +586,10 @@ p->read_output_skip = 0; #endif +#ifdef HAVE_GNUTLS + p->gnutls_initstage = GNUTLS_STAGE_EMPTY; +#endif + /* If name is already in use, modify it until it is unused. */ name1 = name; @@ -1526,6 +1533,12 @@ XPROCESS (proc)->filter = Qnil; XPROCESS (proc)->command = Flist (nargs - 2, args + 2); +#ifdef HAVE_GNUTLS + /* AKA GNUTLS_INITSTAGE(proc). */ + XPROCESS (proc)->gnutls_initstage = GNUTLS_STAGE_EMPTY; + XPROCESS (proc)->gnutls_cred_type = Qnil; +#endif + #ifdef ADAPTIVE_READ_BUFFERING XPROCESS (proc)->adaptive_read_buffering = (NILP (Vprocess_adaptive_read_buffering) ? 0 @@ -5099,7 +5112,13 @@ #endif if (proc_buffered_char[channel] < 0) { - nbytes = emacs_read (channel, chars + carryover, readmax); +#ifdef HAVE_GNUTLS + if (NETCONN_P(proc) && GNUTLS_PROCESS_USABLE (proc)) + nbytes = emacs_gnutls_read (channel, XPROCESS (proc)->gnutls_state, + chars + carryover, readmax); + else +#endif + nbytes = emacs_read (channel, chars + carryover, readmax); #ifdef ADAPTIVE_READ_BUFFERING if (nbytes > 0 && p->adaptive_read_buffering) { @@ -5132,7 +5151,13 @@ { chars[carryover] = proc_buffered_char[channel]; proc_buffered_char[channel] = -1; - nbytes = emacs_read (channel, chars + carryover + 1, readmax - 1); +#ifdef HAVE_GNUTLS + if (NETCONN_P(proc) && GNUTLS_PROCESS_USABLE (proc)) + nbytes = emacs_gnutls_read (channel, XPROCESS (proc)->gnutls_state, + chars + carryover + 1, readmax - 1); + else +#endif + nbytes = emacs_read (channel, chars + carryover + 1, readmax - 1); if (nbytes < 0) nbytes = 1; else @@ -5542,7 +5567,14 @@ else #endif { - rv = emacs_write (outfd, (char *) buf, this); +#ifdef HAVE_GNUTLS + if (NETCONN_P(proc) && GNUTLS_PROCESS_USABLE (proc)) + rv = emacs_gnutls_write (outfd, + XPROCESS (proc)->gnutls_state, + (char *) buf, this); + else +#endif + rv = emacs_write (outfd, (char *) buf, this); #ifdef ADAPTIVE_READ_BUFFERING if (p->read_output_delay > 0 && p->adaptive_read_buffering == 1) === modified file 'src/process.h' --- src/process.h 2010-08-11 12:34:46 +0000 +++ src/process.h 2010-09-26 06:06:28 +0000 @@ -24,6 +24,10 @@ #include #endif +#ifdef HAVE_GNUTLS +#include "gnutls.h" +#endif + /* This structure records information about a subprocess or network connection. @@ -76,6 +80,10 @@ /* Working buffer for encoding. */ Lisp_Object encoding_buf; +#ifdef HAVE_GNUTLS + Lisp_Object gnutls_cred_type; +#endif + /* After this point, there are no Lisp_Objects any more. */ /* alloc.c assumes that `pid' is the first such non-Lisp slot. */ @@ -121,6 +129,13 @@ needs to be synced to `status'. */ unsigned int raw_status_new : 1; int raw_status; + +#ifdef HAVE_GNUTLS + gnutls_initstage_t gnutls_initstage; + gnutls_session_t gnutls_state; + gnutls_certificate_client_credentials x509_cred; + gnutls_anon_client_credentials_t anon_cred; +#endif }; /* Every field in the preceding structure except for the first two ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.