Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 102405. ------------------------------------------------------------ revno: 102405 committer: Dan Nicolaescu branch nick: trunk timestamp: Mon 2010-11-15 22:44:51 -0800 message: Convert definitions to standard C. * src/strftime.c (LOCALE_PARAM_DECL): Update for standard C. (LOCALE_PARAM, LOCALE_PARAM_PROTO): Remove, unused. (memcpy_lowcase, so_week_days, extra_args_spec, emacs_strftimeu): Convert definitions to standard C. * src/regex.c: Do not include , config.h does it. Include unistd.h. (xrealloc, init_syntax_once, re_match, regcomp, regexec) (regerror, regfree): Convert definitions to standard C. * src/mktime.c (my_mktime_localtime_r, ydhms_tm_diff, ranged_convert) (__mktime_internal): Convert definitions to standard C. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-11-15 17:21:18 +0000 +++ src/ChangeLog 2010-11-16 06:44:51 +0000 @@ -1,3 +1,16 @@ +2010-11-16 Dan Nicolaescu + + * strftime.c (LOCALE_PARAM_DECL): Update for standard C. + (LOCALE_PARAM, LOCALE_PARAM_PROTO): Remove, unused. + (memcpy_lowcase, so_week_days, extra_args_spec, emacs_strftimeu): + Convert definitions to standard C. + * regex.c: Do not include , config.h does it. + Include unistd.h. + (xrealloc, init_syntax_once, re_match, regcomp, regexec) + (regerror, regfree): Convert definitions to standard C. + * mktime.c (my_mktime_localtime_r, ydhms_tm_diff, ranged_convert) + (__mktime_internal): Convert definitions to standard C. + 2010-11-15 Dan Nicolaescu * w32proc.c: === modified file 'src/mktime.c' --- src/mktime.c 2010-07-02 12:55:51 +0000 +++ src/mktime.c 2010-11-16 06:44:51 +0000 @@ -110,9 +110,7 @@ localtime to localtime_r, since many localtime_r implementations are buggy. */ static struct tm * -my_mktime_localtime_r (t, tp) - const time_t *t; - struct tm *tp; +my_mktime_localtime_r (const time_t *t, struct tm *tp) { struct tm *l = localtime (t); if (! l) @@ -130,9 +128,7 @@ If TP is null, return a nonzero value. If overflow occurs, yield the low order bits of the correct answer. */ static time_t -ydhms_tm_diff (year, yday, hour, min, sec, tp) - int year, yday, hour, min, sec; - const struct tm *tp; +ydhms_tm_diff (int year, int yday, int hour, int min, int sec, const struct tm *tp) { if (!tp) return 1; @@ -163,14 +159,8 @@ If *T is out of range for conversion, adjust it so that it is the nearest in-range value and then convert that. */ static struct tm * -ranged_convert (convert, t, tp) -#ifdef PROTOTYPES - struct tm *(*convert) (const time_t *, struct tm *); -#else - struct tm *(*convert)(); -#endif - time_t *t; - struct tm *tp; +ranged_convert (struct tm *(*convert) (const time_t *, struct tm *), + time_t *t, struct tm *tp) { struct tm *r; @@ -217,14 +207,8 @@ compared to what the result would be for UTC without leap seconds. If *OFFSET's guess is correct, only one CONVERT call is needed. */ time_t -__mktime_internal (tp, convert, offset) - struct tm *tp; -#ifdef PROTOTYPES - struct tm *(*convert) (const time_t *, struct tm *); -#else - struct tm *(*convert)(); -#endif - time_t *offset; +__mktime_internal (struct tm *tp, struct tm *(*convert) (const time_t *, struct tm *), + time_t *offset) { time_t t, dt, t0, t1, t2; struct tm tm; @@ -558,5 +542,3 @@ End: */ -/* arch-tag: 9456752f-7ddd-47cb-8286-fa807b1355ae - (do not change this comment) */ === modified file 'src/regex.c' --- src/regex.c 2010-10-14 14:32:27 +0000 +++ src/regex.c 2010-11-16 06:44:51 +0000 @@ -196,18 +196,14 @@ even if config.h says that we can. */ # undef REL_ALLOC -# if defined STDC_HEADERS || defined _LIBC -# include -# else -char *malloc (); -char *realloc (); +# ifdef HAVE_UNISTD_H +# include # endif /* When used in Emacs's lib-src, we need xmalloc and xrealloc. */ void * -xmalloc (size) - size_t size; +xmalloc (size_t size) { register void *val; val = (void *) malloc (size); @@ -220,9 +216,7 @@ } void * -xrealloc (block, size) - void *block; - size_t size; +xrealloc (void *block, size_t size) { register void *val; /* We must call malloc explicitly when BLOCK is 0, since some @@ -435,7 +429,7 @@ static char re_syntax_table[CHAR_SET_SIZE]; static void -init_syntax_once () +init_syntax_once (void) { register int c; static int done = 0; @@ -4978,11 +4972,8 @@ /* re_match is like re_match_2 except it takes only a single string. */ int -re_match (bufp, string, size, pos, regs) - struct re_pattern_buffer *bufp; - const char *string; - int size, pos; - struct re_registers *regs; +re_match (struct re_pattern_buffer *bufp, const char *string, + int size, int pos, struct re_registers *regs) { int result = re_match_2_internal (bufp, NULL, 0, (re_char*) string, size, pos, regs, size); @@ -6534,10 +6525,8 @@ the return codes and their meanings.) */ int -regcomp (preg, pattern, cflags) - regex_t *__restrict preg; - const char *__restrict pattern; - int cflags; +regcomp (regex_t *__restrict preg, const char *__restrict pattern, + int cflags) { reg_errcode_t ret; reg_syntax_t syntax @@ -6619,12 +6608,8 @@ We return 0 if we find a match and REG_NOMATCH if not. */ int -regexec (preg, string, nmatch, pmatch, eflags) - const regex_t *__restrict preg; - const char *__restrict string; - size_t nmatch; - regmatch_t pmatch[__restrict_arr]; - int eflags; +regexec (const regex_t *__restrict preg, const char *__restrict string, + size_t nmatch, regmatch_t pmatch[__restrict_arr], int eflags) { int ret; struct re_registers regs; @@ -6696,11 +6681,7 @@ error with msvc8 compiler. */ size_t -regerror (err_code, preg, errbuf, errbuf_size) - int err_code; - const regex_t *preg; - char *errbuf; - size_t errbuf_size; +regerror (int err_code, const regex_t *preg, char *errbuf, size_t errbuf_size) { const char *msg; size_t msg_size; @@ -6736,8 +6717,7 @@ /* Free dynamically allocated space used by PREG. */ void -regfree (preg) - regex_t *preg; +regfree (regex_t *preg) { free (preg->buffer); preg->buffer = NULL; @@ -6756,5 +6736,3 @@ #endif /* not emacs */ -/* arch-tag: 4ffd68ba-2a9e-435b-a21a-018990f9eeb2 - (do not change this comment) */ === modified file 'src/strftime.c' --- src/strftime.c 2010-07-04 20:42:36 +0000 +++ src/strftime.c 2010-11-16 06:44:51 +0000 @@ -318,14 +318,10 @@ # undef _NL_CURRENT # define _NL_CURRENT(category, item) \ (current->values[_NL_ITEM_INDEX (item)].string) -# define LOCALE_PARAM , loc # define LOCALE_ARG , loc -# define LOCALE_PARAM_DECL __locale_t loc; -# define LOCALE_PARAM_PROTO , __locale_t loc +# define LOCALE_PARAM_DECL , __locale_t loc # define HELPER_LOCALE_ARG , current #else -# define LOCALE_PARAM -# define LOCALE_PARAM_PROTO # define LOCALE_ARG # define LOCALE_PARAM_DECL # ifdef _LIBC @@ -363,30 +359,16 @@ more reliable way to accept other sets of digits. */ #define ISDIGIT(Ch) ((unsigned int) (Ch) - L_('0') <= 9) -static CHAR_T *memcpy_lowcase (CHAR_T *dest, const CHAR_T *src, - size_t len LOCALE_PARAM_PROTO); - static CHAR_T * -memcpy_lowcase (dest, src, len LOCALE_PARAM) - CHAR_T *dest; - const CHAR_T *src; - size_t len; - LOCALE_PARAM_DECL +memcpy_lowcase (CHAR_T *dest, const CHAR_T *src, size_t len LOCALE_PARAM_DECL) { while (len-- > 0) dest[len] = TOLOWER ((UCHAR_T) src[len], loc); return dest; } -static CHAR_T *memcpy_uppcase (CHAR_T *dest, const CHAR_T *src, - size_t len LOCALE_PARAM_PROTO); - static CHAR_T * -memcpy_uppcase (dest, src, len LOCALE_PARAM) - CHAR_T *dest; - const CHAR_T *src; - size_t len; - LOCALE_PARAM_DECL +memcpy_uppcase (CHAR_T *dest, const CHAR_T *src, size_t len LOCALE_PARAM_DECL) { while (len-- > 0) dest[len] = TOUPPER ((UCHAR_T) src[len], loc); @@ -437,9 +419,7 @@ __inline__ #endif static int -iso_week_days (yday, wday) - int yday; - int wday; +iso_week_days (int yday, int wday) { /* Add enough to the first operand of % to make it nonnegative. */ int big_enough_multiple_of_7 = (-YDAY_MINIMUM / 7 + 2) * 7; @@ -470,7 +450,7 @@ #ifdef my_strftime # define extra_args , ut, ns -# define extra_args_spec int ut; int ns; +# define extra_args_spec , int ut, int ns # define extra_args_spec_iso , int ut, int ns #else # ifdef COMPILE_WIDE @@ -517,13 +497,8 @@ anywhere, so to determine how many characters would be written, use NULL for S and (size_t) UINT_MAX for MAXSIZE. */ size_t -my_strftime (s, maxsize, format, tp extra_args LOCALE_PARAM) - CHAR_T *s; - size_t maxsize; - const CHAR_T *format; - const struct tm *tp; - extra_args_spec - LOCALE_PARAM_DECL +my_strftime (CHAR_T *s, size_t maxsize, const CHAR_T *format, + const struct tm *tp extra_args_spec LOCALE_PARAM_DECL) { #if defined _LIBC && defined USE_IN_EXTENDED_LOCALE_MODEL struct locale_data *const current = loc->__locales[LC_TIME]; @@ -1474,16 +1449,10 @@ /* For Emacs we have a separate interface which corresponds to the normal strftime function plus the ut argument, but without the ns argument. */ size_t -emacs_strftimeu (s, maxsize, format, tp, ut) - char *s; - size_t maxsize; - const char *format; - const struct tm *tp; - int ut; +emacs_strftimeu (char *s, size_t maxsize, const char *format, + const struct tm *tp, int ut) { return my_strftime (s, maxsize, format, tp, ut, 0); } #endif -/* arch-tag: 662bc9c4-f8e2-41b6-bf96-b8346d0ce0d8 - (do not change this comment) */ ------------------------------------------------------------ revno: 102404 author: Lars Magne Ingebrigtsen committer: Katsumi Yamaoka branch nick: trunk timestamp: Tue 2010-11-16 00:04:25 +0000 message: Allow gnus-html to register image displayer callbacks. gnus-html.el (gnus-html-wash-images): Register a displayer. gnus-util.el (gnus-find-text-property-region): Return markers. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-11-15 23:45:55 +0000 +++ lisp/gnus/ChangeLog 2010-11-16 00:04:25 +0000 @@ -1,5 +1,9 @@ 2010-11-15 Lars Magne Ingebrigtsen + * gnus-html.el (gnus-html-wash-images): Register a displayer. + + * gnus-util.el (gnus-find-text-property-region): Return markers. + * shr.el (shr-tag-img): Put a displayer in the text property. * gnus-util.el (gnus-find-text-property-region): New utility function. === modified file 'lisp/gnus/gnus-html.el' --- lisp/gnus/gnus-html.el 2010-11-15 23:45:55 +0000 +++ lisp/gnus/gnus-html.el 2010-11-16 00:04:25 +0000 @@ -189,19 +189,26 @@ (let* ((handle (mm-get-content-id (setq url (match-string 1 url)))) (image (when handle - (gnus-create-image (mm-with-part handle (buffer-string)) - nil t)))) + (gnus-create-image + (mm-with-part handle (buffer-string)) + nil t)))) (when image (let ((string (buffer-substring start end))) (delete-region start end) - (gnus-put-image (gnus-rescale-image image (gnus-html-maximum-image-size)) + (gnus-put-image (gnus-rescale-image + image (gnus-html-maximum-image-size)) (gnus-string-or string "*") 'cid) (gnus-add-image 'cid image)))) ;; Normal, external URL. - (let ((alt-text (when (string-match "\\(alt\\|title\\)=\"\\([^\"]+\\)" - parameters) - (xml-substitute-special (match-string 2 parameters))))) + (let ((alt-text + (when (string-match "\\(alt\\|title\\)=\"\\([^\"]+\\)" + parameters) + (xml-substitute-special (match-string 2 parameters))))) (gnus-put-text-property start end 'image-url url) + (gnus-put-text-property + start end 'image-displayer + (lambda (url start end) + (gnus-html-display-image url start end))) (if (gnus-html-image-url-blocked-p url (if (buffer-live-p gnus-summary-buffer) === modified file 'lisp/gnus/gnus-util.el' --- lisp/gnus/gnus-util.el 2010-11-15 23:45:55 +0000 +++ lisp/gnus/gnus-util.el 2010-11-16 00:04:25 +0000 @@ -288,7 +288,10 @@ (if (not end) (setq start nil) (when value - (push (list start end value) regions)) + (push (list (set-marker (make-marker) start) + (set-marker (make-marker) end) + value) + regions)) (setq start (next-single-property-change start prop)))) (nreverse regions))) ------------------------------------------------------------ revno: 102403 author: Lars Magne Ingebrigtsen committer: Katsumi Yamaoka branch nick: trunk timestamp: Mon 2010-11-15 23:45:55 +0000 message: Rework how Gnus is supposed to be able to display all the images in HTML. shr.el (shr-tag-img): Put a displayer in the text property. gnus-util.el (gnus-find-text-property-region): New utility function. gnus-html.el (gnus-html-display-image): Make the alt optional. gnus-html.el (gnus-html-show-images): Remove. gnus-art.el (gnus-article-show-images): New, more general function. gnus-html.el, shr.el: Use image-url instead of gnus-image-url to unify the image url text properties. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-11-15 22:12:43 +0000 +++ lisp/gnus/ChangeLog 2010-11-15 23:45:55 +0000 @@ -1,5 +1,19 @@ 2010-11-15 Lars Magne Ingebrigtsen + * shr.el (shr-tag-img): Put a displayer in the text property. + + * gnus-util.el (gnus-find-text-property-region): New utility function. + + * gnus-html.el (gnus-html-display-image): Make the alt optional. + (gnus-html-show-images): Remove. + + * gnus-art.el (gnus-article-show-images): New, more general function. + + * gnus-html.el: Use image-url instead of gnus-image-url to unify the + image url text properties. + + * shr.el: Ditto. + * gnus-agent.el (gnus-agentize): Only do the auto-agentizing if gnus-agent-auto-agentize-methods is set. Which it isn't. === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2010-11-12 05:59:53 +0000 +++ lisp/gnus/gnus-art.el 2010-11-15 23:45:55 +0000 @@ -2271,6 +2271,17 @@ (dolist (elem gnus-article-image-alist) (gnus-delete-images (car elem))))) +(defun gnus-article-show-images () + "Show any images that are in the HTML-rendered article buffer. +This only works if the article in question is HTML." + (interactive) + (gnus-with-article-buffer + (dolist (region (gnus-find-text-property-region (point-min) (point-max) + 'image-displayer)) + (destructuring-bind (start end function) region + (funcall function (get-text-property start 'image-url) + start end))))) + (defun gnus-article-treat-fold-newsgroups () "Unfold folded message headers. Only the headers that fit into the current window width will be === modified file 'lisp/gnus/gnus-html.el' --- lisp/gnus/gnus-html.el 2010-11-04 22:18:09 +0000 +++ lisp/gnus/gnus-html.el 2010-11-15 23:45:55 +0000 @@ -201,7 +201,7 @@ (let ((alt-text (when (string-match "\\(alt\\|title\\)=\"\\([^\"]+\\)" parameters) (xml-substitute-special (match-string 2 parameters))))) - (gnus-put-text-property start end 'gnus-image-url url) + (gnus-put-text-property start end 'image-url url) (if (gnus-html-image-url-blocked-p url (if (buffer-live-p gnus-summary-buffer) @@ -237,7 +237,7 @@ (> width 4))) (gnus-html-display-image url start end alt-text)))))))))) -(defun gnus-html-display-image (url start end alt-text) +(defun gnus-html-display-image (url start end &optional alt-text) "Display image at URL on text from START to END. Use ALT-TEXT for the image string." (if (gnus-html-cache-expired url gnus-html-image-cache-ttl) @@ -247,7 +247,7 @@ (current-buffer) (list url alt-text)) ;; It's already cached, so just insert it. - (gnus-html-put-image (gnus-html-get-image-data url) url alt-text))) + (gnus-html-put-image (gnus-html-get-image-data url) url (or alt-text "*")))) (defun gnus-html-wash-tags () (let (tag parameters string start end images url) @@ -344,7 +344,7 @@ (defun gnus-html-browse-image () "Browse the image under point." (interactive) - (browse-url (get-text-property (point) 'gnus-image-url))) + (browse-url (get-text-property (point) 'image-url))) (defun gnus-html-browse-url () "Browse the image under point." @@ -415,9 +415,9 @@ "Put an image with DATA from URL and optional ALT-TEXT." (when (gnus-graphic-display-p) (let* ((start (text-property-any (point-min) (point-max) - 'gnus-image-url url)) + 'image-url url)) (end (when start - (next-single-property-change start 'gnus-image-url)))) + (next-single-property-change start 'image-url)))) ;; Image found? (when start (let* ((image @@ -459,7 +459,7 @@ 'gnus-alt-text alt-text) (when url (gnus-put-text-property start (point) - 'gnus-image-url url)) + 'image-url url)) (gnus-add-image 'external image) t) ;; Bad image, try to show something else @@ -482,16 +482,6 @@ url blocked-images)) ret)) -(defun gnus-html-show-images () - "Show any images that are in the HTML-rendered article buffer. -This only works if the article in question is HTML." - (interactive) - (gnus-with-article-buffer - (dolist (overlay (overlays-in (point-min) (point-max))) - (let ((o (overlay-get overlay 'gnus-image))) - (when o - (apply 'gnus-html-display-image o)))))) - ;;;###autoload (defun gnus-html-prefetch-images (summary) (when (buffer-live-p summary) === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2010-11-15 02:40:42 +0000 +++ lisp/gnus/gnus-sum.el 2010-11-15 23:45:55 +0000 @@ -2136,7 +2136,7 @@ "d" gnus-article-display-face "s" gnus-treat-smiley "D" gnus-article-remove-images - "W" gnus-html-show-images + "W" gnus-article-show-images "f" gnus-treat-from-picon "m" gnus-treat-mail-picon "n" gnus-treat-newsgroups-picon === modified file 'lisp/gnus/gnus-util.el' --- lisp/gnus/gnus-util.el 2010-11-10 04:08:15 +0000 +++ lisp/gnus/gnus-util.el 2010-11-15 23:45:55 +0000 @@ -277,6 +277,21 @@ (setq start (when end (next-single-property-change start prop)))))) +(defun gnus-find-text-property-region (start end prop) + "Return a list of text property regions that has property PROP." + (let (regions value) + (unless (get-text-property start prop) + (setq start (next-single-property-change start prop))) + (while start + (setq value (get-text-property start prop) + end (text-property-not-all start (point-max) prop value)) + (if (not end) + (setq start nil) + (when value + (push (list start end value) regions)) + (setq start (next-single-property-change start prop)))) + (nreverse regions))) + (defun gnus-newsgroup-directory-form (newsgroup) "Make hierarchical directory name from NEWSGROUP name." (let* ((newsgroup (gnus-newsgroup-savable-name newsgroup)) === modified file 'lisp/gnus/gnus.el' --- lisp/gnus/gnus.el 2010-11-01 01:40:12 +0000 +++ lisp/gnus/gnus.el 2010-11-15 23:45:55 +0000 @@ -2876,7 +2876,6 @@ gnus-start-date-timer gnus-stop-date-timer gnus-mime-view-all-parts) ("gnus-int" gnus-request-type) - ("gnus-html" gnus-html-show-images) ("gnus-start" gnus-newsrc-parse-options gnus-1 gnus-no-server-1 gnus-dribble-enter gnus-read-init-file gnus-dribble-touch gnus-check-reasonable-setup) === modified file 'lisp/gnus/shr.el' --- lisp/gnus/shr.el 2010-11-11 04:01:12 +0000 +++ lisp/gnus/shr.el 2010-11-15 23:45:55 +0000 @@ -154,7 +154,7 @@ (defun shr-browse-image () "Browse the image under point." (interactive) - (let ((url (get-text-property (point) 'shr-image))) + (let ((url (get-text-property (point) 'image-url))) (if (not url) (message "No image under point") (message "Browsing %s..." url) @@ -163,7 +163,7 @@ (defun shr-insert-image () "Insert the image under point into the buffer." (interactive) - (let ((url (get-text-property (point) 'shr-image))) + (let ((url (get-text-property (point) 'image-url))) (if (not url) (message "No image under point") (message "Inserting %s..." url) @@ -572,7 +572,12 @@ t)))) (put-text-property start (point) 'keymap shr-map) (put-text-property start (point) 'shr-alt alt) - (put-text-property start (point) 'shr-image url) + (put-text-property start (point) 'image-url url) + (put-text-property start (point) 'image-displayer + (lambda (url start end) + (url-retrieve url 'shr-image-fetched + (list (current-buffer) start end) + t))) (put-text-property start (point) 'help-echo alt) (setq shr-state 'image))))) ------------------------------------------------------------ revno: 102402 author: Lars Magne Ingebrigtsen committer: Katsumi Yamaoka branch nick: trunk timestamp: Mon 2010-11-15 22:12:43 +0000 message: gnus-agent.el (gnus-agentize): Only do the auto-agentizing if gnus-agent-auto-agentize-methods is set. Which it isn't. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-11-15 02:40:42 +0000 +++ lisp/gnus/ChangeLog 2010-11-15 22:12:43 +0000 @@ -1,3 +1,8 @@ +2010-11-15 Lars Magne Ingebrigtsen + + * gnus-agent.el (gnus-agentize): Only do the auto-agentizing if + gnus-agent-auto-agentize-methods is set. Which it isn't. + 2010-11-15 Katsumi Yamaoka * gnus-sum.el (gnus-summary-move-article): Fix `while' loop to make it === modified file 'lisp/gnus/gnus-agent.el' --- lisp/gnus/gnus-agent.el 2010-10-24 09:55:56 +0000 +++ lisp/gnus/gnus-agent.el 2010-11-15 22:12:43 +0000 @@ -695,7 +695,9 @@ ;; If the servers file doesn't exist, auto-agentize some servers and ;; save the servers file so this auto-agentizing isn't invoked ;; again. - (unless (file-exists-p (nnheader-concat gnus-agent-directory "lib/servers")) + (when (and (not (file-exists-p (nnheader-concat + gnus-agent-directory "lib/servers"))) + gnus-agent-auto-agentize-methods) (gnus-message 3 "First time agent user, agentizing remote groups...") (mapc (lambda (server-or-method) ------------------------------------------------------------ revno: 102401 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2010-11-15 16:40:30 -0500 message: * lisp/emacs-lisp/checkdoc.el (checkdoc-syntax-table): Fix last change. (checkdoc-sentencespace-region-engine, checkdoc-this-string-valid) (checkdoc-proper-noun-region-engine): Use with-syntax-table. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-15 12:27:33 +0000 +++ lisp/ChangeLog 2010-11-15 21:40:30 +0000 @@ -1,3 +1,9 @@ +2010-11-15 Stefan Monnier + + * emacs-lisp/checkdoc.el (checkdoc-syntax-table): Fix last change. + (checkdoc-sentencespace-region-engine, checkdoc-this-string-valid) + (checkdoc-proper-noun-region-engine): Use with-syntax-table. + 2010-11-15 Agustín Martín * textmodes/flyspell.el (flyspell-generic-progmode-verify): === modified file 'lisp/emacs-lisp/checkdoc.el' --- lisp/emacs-lisp/checkdoc.el 2010-11-08 20:01:01 +0000 +++ lisp/emacs-lisp/checkdoc.el 2010-11-15 21:40:30 +0000 @@ -434,7 +434,7 @@ ;; When dealing with syntax in doc strings, make sure that - are ;; encompassed in words so we can use cheap \\> to get the end of a symbol, ;; not the end of a word in a conglomerate. - (modify-syntax-entry ?- "w" checkdoc-syntax-table) + (modify-syntax-entry ?- "w" st) st) "Syntax table used by checkdoc in document strings.") @@ -1370,12 +1370,8 @@ documentation string") (point) (+ (point) 1) t))))) (if (and (not err) (looking-at "\"")) - (let ((old-syntax-table (syntax-table))) - (unwind-protect - (progn - (set-syntax-table checkdoc-syntax-table) - (checkdoc-this-string-valid-engine fp)) - (set-syntax-table old-syntax-table))) + (with-syntax-table checkdoc-syntax-table + (checkdoc-this-string-valid-engine fp)) err))) (defun checkdoc-this-string-valid-engine (fp) @@ -1987,49 +1983,45 @@ If the offending word is in a piece of quoted text, then it is skipped." (save-excursion (let ((case-fold-search nil) - (errtxt nil) bb be - (old-syntax-table (syntax-table))) - (unwind-protect - (progn - (set-syntax-table checkdoc-syntax-table) - (goto-char begin) - (while (re-search-forward checkdoc-proper-noun-regexp end t) - (let ((text (match-string 1)) - (b (match-beginning 1)) - (e (match-end 1))) - (if (and (not (save-excursion - (goto-char b) - (forward-char -1) - (looking-at "`\\|\"\\|\\.\\|\\\\"))) - ;; surrounded by /, as in a URL or filename: /emacs/ - (not (and (= ?/ (char-after e)) - (= ?/ (char-before b)))) - (not (checkdoc-in-example-string-p begin end)) - ;; info or url links left alone - (not (thing-at-point-looking-at - help-xref-info-regexp)) - (not (thing-at-point-looking-at - help-xref-url-regexp))) - (if (checkdoc-autofix-ask-replace - b e (format "Text %s should be capitalized. Fix? " - text) - (capitalize text) t) - nil - (if errtxt - ;; If there is already an error, then generate - ;; the warning output if applicable - (if checkdoc-generate-compile-warnings-flag - (checkdoc-create-error - (format - "Name %s should appear capitalized as %s" - text (capitalize text)) - b e)) - (setq errtxt - (format - "Name %s should appear capitalized as %s" - text (capitalize text)) - bb b be e))))))) - (set-syntax-table old-syntax-table)) + (errtxt nil) bb be) + (with-syntax-table checkdoc-syntax-table + (goto-char begin) + (while (re-search-forward checkdoc-proper-noun-regexp end t) + (let ((text (match-string 1)) + (b (match-beginning 1)) + (e (match-end 1))) + (if (and (not (save-excursion + (goto-char b) + (forward-char -1) + (looking-at "`\\|\"\\|\\.\\|\\\\"))) + ;; surrounded by /, as in a URL or filename: /emacs/ + (not (and (= ?/ (char-after e)) + (= ?/ (char-before b)))) + (not (checkdoc-in-example-string-p begin end)) + ;; info or url links left alone + (not (thing-at-point-looking-at + help-xref-info-regexp)) + (not (thing-at-point-looking-at + help-xref-url-regexp))) + (if (checkdoc-autofix-ask-replace + b e (format "Text %s should be capitalized. Fix? " + text) + (capitalize text) t) + nil + (if errtxt + ;; If there is already an error, then generate + ;; the warning output if applicable + (if checkdoc-generate-compile-warnings-flag + (checkdoc-create-error + (format + "Name %s should appear capitalized as %s" + text (capitalize text)) + b e)) + (setq errtxt + (format + "Name %s should appear capitalized as %s" + text (capitalize text)) + bb b be e))))))) (if errtxt (checkdoc-create-error errtxt bb be))))) (defun checkdoc-sentencespace-region-engine (begin end) @@ -2037,43 +2029,39 @@ (if sentence-end-double-space (save-excursion (let ((case-fold-search nil) - (errtxt nil) bb be - (old-syntax-table (syntax-table))) - (unwind-protect - (progn - (set-syntax-table checkdoc-syntax-table) - (goto-char begin) - (while (re-search-forward "[^ .0-9]\\(\\. \\)[^ \n]" end t) - (let ((b (match-beginning 1)) - (e (match-end 1))) - (unless (or (checkdoc-in-sample-code-p begin end) - (checkdoc-in-example-string-p begin end) - (save-excursion - (goto-char b) - (condition-case nil - (progn - (forward-sexp -1) - ;; piece of an abbreviation - ;; FIXME etc - (looking-at - "\\([a-z]\\|[iI]\\.?e\\|[eE]\\.?g\\)\\.")) - (error t)))) - (if (checkdoc-autofix-ask-replace - b e - "There should be two spaces after a period. Fix? " - ". ") - nil - (if errtxt - ;; If there is already an error, then generate - ;; the warning output if applicable - (if checkdoc-generate-compile-warnings-flag - (checkdoc-create-error - "There should be two spaces after a period" - b e)) - (setq errtxt - "There should be two spaces after a period" - bb b be e))))))) - (set-syntax-table old-syntax-table)) + (errtxt nil) bb be) + (with-syntax-table checkdoc-syntax-table + (goto-char begin) + (while (re-search-forward "[^ .0-9]\\(\\. \\)[^ \n]" end t) + (let ((b (match-beginning 1)) + (e (match-end 1))) + (unless (or (checkdoc-in-sample-code-p begin end) + (checkdoc-in-example-string-p begin end) + (save-excursion + (goto-char b) + (condition-case nil + (progn + (forward-sexp -1) + ;; piece of an abbreviation + ;; FIXME etc + (looking-at + "\\([a-z]\\|[iI]\\.?e\\|[eE]\\.?g\\)\\.")) + (error t)))) + (if (checkdoc-autofix-ask-replace + b e + "There should be two spaces after a period. Fix? " + ". ") + nil + (if errtxt + ;; If there is already an error, then generate + ;; the warning output if applicable + (if checkdoc-generate-compile-warnings-flag + (checkdoc-create-error + "There should be two spaces after a period" + b e)) + (setq errtxt + "There should be two spaces after a period" + bb b be e))))))) (if errtxt (checkdoc-create-error errtxt bb be)))))) ;;; Ispell engine ------------------------------------------------------------ revno: 102400 committer: Dan Nicolaescu branch nick: trunk timestamp: Mon 2010-11-15 10:11:52 -0800 message: * src/callproc.c (child_setup): Fix previous change. diff: === modified file 'src/callproc.c' --- src/callproc.c 2010-11-15 17:11:08 +0000 +++ src/callproc.c 2010-11-15 18:11:52 +0000 @@ -1231,6 +1231,7 @@ report_file_error ("Spawning child process", Qnil); return pid; #endif /* MSDOS */ +#endif /* not WINDOWSNT */ } #ifndef WINDOWSNT ------------------------------------------------------------ revno: 102399 committer: Ken Manheimer branch nick: trunk timestamp: Mon 2010-11-15 12:41:33 -0500 message: (allout-version): micro increment diff: === modified file 'lisp/allout.el' --- lisp/allout.el 2010-11-14 01:55:37 +0000 +++ lisp/allout.el 2010-11-15 17:41:33 +0000 @@ -6,7 +6,7 @@ ;; Author: Ken Manheimer ;; Maintainer: Ken Manheimer ;; Created: Dec 1991 -- first release to usenet -;; Version: 2.2.1 +;; Version: 2.2.2 ;; Keywords: outlines wp languages ;; Website: http://myriadicity.net/Sundry/EmacsAllout @@ -917,7 +917,7 @@ ;;;_ #1 Internal Outline Formatting and Configuration ;;;_ : Version ;;;_ = allout-version -(defvar allout-version "2.2.1" +(defvar allout-version "2.2.2" "Version of currently loaded outline package. (allout.el)") ;;;_ > allout-version (defun allout-version (&optional here) ------------------------------------------------------------ revno: 102398 committer: Dan Nicolaescu branch nick: trunk timestamp: Mon 2010-11-15 09:21:18 -0800 message: Remove config.h include guards. * src/w32proc.c: * src/w32inevt.c: * src/w32heap.c: * src/w32.c: Remove config.h include guards. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-11-15 17:11:08 +0000 +++ src/ChangeLog 2010-11-15 17:21:18 +0000 @@ -1,5 +1,10 @@ 2010-11-15 Dan Nicolaescu + * w32proc.c: + * w32inevt.c: + * w32heap.c: + * w32.c: Remove config.h include guards. + * callproc.c (child_setup): Reorder code to simplify #ifdefs. No code changes. === modified file 'src/w32.c' --- src/w32.c 2010-10-14 14:32:27 +0000 +++ src/w32.c 2010-11-15 17:21:18 +0000 @@ -38,9 +38,7 @@ /* must include CRT headers *before* config.h */ -#ifdef HAVE_CONFIG_H #include -#endif #undef access #undef chdir @@ -6086,5 +6084,3 @@ /* end of w32.c */ -/* arch-tag: 90442dd3-37be-482b-b272-ac752e3049f1 - (do not change this comment) */ === modified file 'src/w32heap.c' --- src/w32heap.c 2010-10-14 14:32:27 +0000 +++ src/w32heap.c 2010-11-15 17:21:18 +0000 @@ -21,10 +21,7 @@ Geoff Voelker (voelker@cs.washington.edu) 7-29-94 */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include @@ -301,5 +298,3 @@ #endif -/* arch-tag: 9a6a9860-040d-422d-8905-450dd535cd9c - (do not change this comment) */ === modified file 'src/w32inevt.c' --- src/w32inevt.c 2010-11-14 06:55:27 +0000 +++ src/w32inevt.c 2010-11-15 17:21:18 +0000 @@ -23,10 +23,7 @@ */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include @@ -784,5 +781,3 @@ return ret; } -/* arch-tag: 0bcb39b7-d085-4b85-9070-6750e8c03047 - (do not change this comment) */ === modified file 'src/w32proc.c' --- src/w32proc.c 2010-10-14 14:32:27 +0000 +++ src/w32proc.c 2010-11-15 17:21:18 +0000 @@ -32,10 +32,7 @@ #include /* must include CRT headers *before* config.h */ - -#ifdef HAVE_CONFIG_H #include -#endif #undef signal #undef wait @@ -2370,7 +2367,5 @@ staticpro (&Vw32_valid_locale_ids); staticpro (&Vw32_valid_codepages); } -/* end of ntproc.c */ +/* end of w32proc.c */ -/* arch-tag: 23d3a34c-06d2-48a1-833b-ac7609aa5250 - (do not change this comment) */ ------------------------------------------------------------ revno: 102397 committer: Dan Nicolaescu branch nick: trunk timestamp: Mon 2010-11-15 09:11:08 -0800 message: * src/callproc.c (child_setup): Reorder code to simplify #ifdefs. No code changes. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-11-15 06:27:41 +0000 +++ src/ChangeLog 2010-11-15 17:11:08 +0000 @@ -1,5 +1,8 @@ 2010-11-15 Dan Nicolaescu + * callproc.c (child_setup): Reorder code to simplify #ifdefs. + No code changes. + * process.c: Include unconditionally, keyboard.c already does it. === modified file 'src/callproc.c' --- src/callproc.c 2010-11-15 06:10:35 +0000 +++ src/callproc.c 2010-11-15 17:11:08 +0000 @@ -1154,6 +1154,14 @@ #ifdef WINDOWSNT prepare_standard_handles (in, out, err, handles); set_process_dir (SDATA (current_dir)); + /* Spawn the child. (See ntproc.c:Spawnve). */ + cpid = spawnve (_P_NOWAIT, new_argv[0], new_argv, env); + reset_standard_handles (in, out, err, handles); + if (cpid == -1) + /* An error occurred while trying to spawn the process. */ + report_file_error ("Spawning child process", Qnil); + return cpid; + #else /* not WINDOWSNT */ /* Make sure that in, out, and err are not actually already in descriptors zero, one, or two; this could happen if Emacs is @@ -1192,34 +1200,15 @@ emacs_close (out); if (err != in && err != out) emacs_close (err); -#endif /* not MSDOS */ -#endif /* not WINDOWSNT */ #if defined(USG) #ifndef SETPGRP_RELEASES_CTTY setpgrp (); /* No arguments but equivalent in this case */ #endif -#else +#else /* not USG */ setpgrp (pid, pid); -#endif /* USG */ +#endif /* not USG */ -#ifdef MSDOS - pid = run_msdos_command (new_argv, pwd_var + 4, in, out, err, env); - xfree (pwd_var); - if (pid == -1) - /* An error occurred while trying to run the subprocess. */ - report_file_error ("Spawning child process", Qnil); - return pid; -#else /* not MSDOS */ -#ifdef WINDOWSNT - /* Spawn the child. (See ntproc.c:Spawnve). */ - cpid = spawnve (_P_NOWAIT, new_argv[0], new_argv, env); - reset_standard_handles (in, out, err, handles); - if (cpid == -1) - /* An error occurred while trying to spawn the process. */ - report_file_error ("Spawning child process", Qnil); - return cpid; -#else /* not WINDOWSNT */ /* setpgrp_of_tty is incorrect here; it uses input_fd. */ tcsetpgrp (0, pid); @@ -1233,8 +1222,15 @@ emacs_write (1, new_argv[0], strlen (new_argv[0])); emacs_write (1, "\n", 1); _exit (1); -#endif /* not WINDOWSNT */ -#endif /* not MSDOS */ + +#else /* MSDOS */ + pid = run_msdos_command (new_argv, pwd_var + 4, in, out, err, env); + xfree (pwd_var); + if (pid == -1) + /* An error occurred while trying to run the subprocess. */ + report_file_error ("Spawning child process", Qnil); + return pid; +#endif /* MSDOS */ } #ifndef WINDOWSNT ------------------------------------------------------------ revno: 102396 committer: Agustin Martin branch nick: trunk timestamp: Mon 2010-11-15 13:27:33 +0100 message: flyspell.el (flyspell-generic-progmode-verify): Make sure to check inside the word (Bug#6761). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-14 02:09:11 +0000 +++ lisp/ChangeLog 2010-11-15 12:27:33 +0000 @@ -1,3 +1,8 @@ +2010-11-15 Agustín Martín + + * textmodes/flyspell.el (flyspell-generic-progmode-verify): + Make sure to check inside the word (Bug#6761). + 2010-11-14 Chong Yidong * startup.el (command-line): If the cursorColor resource is set, === modified file 'lisp/textmodes/flyspell.el' --- lisp/textmodes/flyspell.el 2010-11-10 10:54:43 +0000 +++ lisp/textmodes/flyspell.el 2010-11-15 12:27:33 +0000 @@ -380,7 +380,8 @@ (defun flyspell-generic-progmode-verify () "Used for `flyspell-generic-check-word-predicate' in programming modes." - (let ((f (get-text-property (point) 'face))) + ;; (point) is next char after the word. Must check one char before. + (let ((f (get-text-property (- (point) 1) 'face))) (memq f flyspell-prog-text-faces))) ;;;###autoload ------------------------------------------------------------ revno: 102395 committer: Dan Nicolaescu branch nick: trunk timestamp: Sun 2010-11-14 22:42:21 -0800 message: * lib-src/test-distrib.c: Remove include guards for config.h and fcntl.h. (O_RDONLY): Do not define. (cool_read): Fix type for variable "sofar". diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2010-10-25 00:48:26 +0000 +++ lib-src/ChangeLog 2010-11-15 06:42:21 +0000 @@ -1,3 +1,9 @@ +2010-11-15 Dan Nicolaescu + + * test-distrib.c: Remove include guards for config.h and fcntl.h. + (O_RDONLY): Do not define. + (cool_read): Fix type for variable "sofar". + 2010-10-25 Glenn Morris * makefile.w32-in (OTHER_PLATFORM_SUPPORT): Remove easymenu.elc. === modified file 'lib-src/test-distrib.c' --- lib-src/test-distrib.c 2010-10-03 23:35:22 +0000 +++ lib-src/test-distrib.c 2010-11-15 06:42:21 +0000 @@ -19,24 +19,14 @@ along with GNU Emacs. If not, see . */ -#ifdef HAVE_CONFIG_H #include -#endif - #include - -#ifdef HAVE_FCNTL_H #include -#endif #ifdef HAVE_UNISTD_H #include #endif -#ifndef O_RDONLY -#define O_RDONLY 0 -#endif - /* Break string in two parts to avoid buggy C compilers that ignore characters after nulls in strings. */ @@ -55,7 +45,7 @@ cool_read (int fd, char *buf, size_t size) { ssize_t num; - size_t sofar = 0; + ssize_t sofar = 0; while (1) {