Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 103982. ------------------------------------------------------------ revno: 103982 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-04-23 20:24:30 -0400 message: * files.el (auto-mode-alist): Use js-mode for .json (Bug#8529). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-04-24 00:15:26 +0000 +++ lisp/ChangeLog 2011-04-24 00:24:30 +0000 @@ -1,5 +1,7 @@ 2011-04-24 Chong Yidong + * files.el (auto-mode-alist): Use js-mode for .json (Bug#8529). + * apropos.el (apropos-label-face): Avoid variable-pitch face. (apropos-accumulator): Doc fix. (apropos-function, apropos-macro, apropos-command) === modified file 'lisp/files.el' --- lisp/files.el 2011-04-19 13:44:55 +0000 +++ lisp/files.el 2011-04-24 00:24:30 +0000 @@ -2386,6 +2386,7 @@ ("\\.dtd\\'" . sgml-mode) ("\\.ds\\(ss\\)?l\\'" . dsssl-mode) ("\\.js\\'" . js-mode) ; javascript-mode would be better + ("\\.json\\'" . js-mode) ("\\.[ds]?vh?\\'" . verilog-mode) ;; .emacs or .gnus or .viper following a directory delimiter in ;; Unix, MSDOG or VMS syntax. ------------------------------------------------------------ revno: 103981 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-04-23 20:15:26 -0400 message: Improve apropos buffer highlighting. * lisp/apropos.el (apropos-label-face): Avoid variable-pitch face. (apropos-accumulator): Doc fix. (apropos-function, apropos-macro, apropos-command) (apropos-variable, apropos-face, apropos-group, apropos-widget) (apropos-plist): Add face property. (apropos-symbols-internal): Fix indentation. (apropos-print): Simplify help, and recognize apropos-multi-type. (apropos-print-doc): Use button-type-get to extract the button's face property. Fill docstring (Bug#8352). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-04-23 03:07:16 +0000 +++ lisp/ChangeLog 2011-04-24 00:15:26 +0000 @@ -1,3 +1,15 @@ +2011-04-24 Chong Yidong + + * apropos.el (apropos-label-face): Avoid variable-pitch face. + (apropos-accumulator): Doc fix. + (apropos-function, apropos-macro, apropos-command) + (apropos-variable, apropos-face, apropos-group, apropos-widget) + (apropos-plist): Add face property. + (apropos-symbols-internal): Fix indentation. + (apropos-print): Simplify help, and recognize apropos-multi-type. + (apropos-print-doc): Use button-type-get to extract the button's + face property. Fill docstring (Bug#8352). + 2011-04-23 Juanma Barranquero * buff-menu.el (Buffer-menu--buffers): Fix typo in docstring (bug#8535). === modified file 'lisp/apropos.el' --- lisp/apropos.el 2011-04-19 13:44:55 +0000 +++ lisp/apropos.el 2011-04-24 00:15:26 +0000 @@ -83,7 +83,7 @@ :group 'apropos :type 'face) -(defcustom apropos-label-face '(italic variable-pitch) +(defcustom apropos-label-face '(italic) "Face for label (`Command', `Variable' ...) in Apropos output. A value of nil means don't use any special font for them, and also turns off mouse highlighting." @@ -155,7 +155,17 @@ "List of elc files already scanned in current run of `apropos-documentation'.") (defvar apropos-accumulator () - "Alist of symbols already found in current apropos run.") + "Alist of symbols already found in current apropos run. +Each element has the form + + (SYMBOL SCORE FUN-DOC VAR-DOC PLIST WIDGET-DOC FACE-DOC CUS-GROUP-DOC) + +where SYMBOL is the symbol name, SCORE is its relevance score (a +number), FUN-DOC is the function docstring, VAR-DOC is the +variable docstring, PLIST is the list of the symbols names in the +property list, WIDGET-DOC is the widget docstring, FACE-DOC is +the face docstring, and CUS-GROUP-DOC is the custom group +docstring. Each docstring is either nil or a string.") (defvar apropos-item () "Current item in or for `apropos-accumulator'.") @@ -187,6 +197,7 @@ (define-button-type 'apropos-function 'apropos-label "Function" 'apropos-short-label "f" + 'face '(font-lock-function-name-face button) 'help-echo "mouse-2, RET: Display more help on this function" 'follow-link t 'action (lambda (button) @@ -195,6 +206,7 @@ (define-button-type 'apropos-macro 'apropos-label "Macro" 'apropos-short-label "m" + 'face '(font-lock-function-name-face button) 'help-echo "mouse-2, RET: Display more help on this macro" 'follow-link t 'action (lambda (button) @@ -203,6 +215,7 @@ (define-button-type 'apropos-command 'apropos-label "Command" 'apropos-short-label "c" + 'face '(font-lock-function-name-face button) 'help-echo "mouse-2, RET: Display more help on this command" 'follow-link t 'action (lambda (button) @@ -216,6 +229,7 @@ (define-button-type 'apropos-variable 'apropos-label "Variable" 'apropos-short-label "v" + 'face '(font-lock-variable-name-face button) 'help-echo "mouse-2, RET: Display more help on this variable" 'follow-link t 'action (lambda (button) @@ -224,6 +238,7 @@ (define-button-type 'apropos-face 'apropos-label "Face" 'apropos-short-label "F" + 'face '(font-lock-variable-name-face button) 'help-echo "mouse-2, RET: Display more help on this face" 'follow-link t 'action (lambda (button) @@ -232,6 +247,7 @@ (define-button-type 'apropos-group 'apropos-label "Group" 'apropos-short-label "g" + 'face '(font-lock-builtin-face button) 'help-echo "mouse-2, RET: Display more help on this group" 'follow-link t 'action (lambda (button) @@ -241,14 +257,16 @@ (define-button-type 'apropos-widget 'apropos-label "Widget" 'apropos-short-label "w" + 'face '(font-lock-builtin-face button) 'help-echo "mouse-2, RET: Display more help on this widget" 'follow-link t 'action (lambda (button) (widget-browse-other-window (button-get button 'apropos-symbol)))) (define-button-type 'apropos-plist - 'apropos-label "Plist" + 'apropos-label "Properties" 'apropos-short-label "p" + 'face '(font-lock-keyword-face button) 'help-echo "mouse-2, RET: Display more help on this plist" 'follow-link t 'action (lambda (button) @@ -636,15 +654,15 @@ "(not documented)")) (when (boundp symbol) (apropos-documentation-property - symbol 'variable-documentation t)) - (when (setq properties (symbol-plist symbol)) - (setq doc (list (car properties))) - (while (setq properties (cdr (cdr properties))) - (setq doc (cons (car properties) doc))) - (mapconcat #'symbol-name (nreverse doc) " ")) - (when (get symbol 'widget-type) - (apropos-documentation-property - symbol 'widget-documentation t)) + symbol 'variable-documentation t)) + (when (setq properties (symbol-plist symbol)) + (setq doc (list (car properties))) + (while (setq properties (cdr (cdr properties))) + (setq doc (cons (car properties) doc))) + (mapconcat #'symbol-name (nreverse doc) " ")) + (when (get symbol 'widget-type) + (apropos-documentation-property + symbol 'widget-documentation t)) (when (facep symbol) (let ((alias (get symbol 'face-alias))) (if alias @@ -660,8 +678,8 @@ (apropos-documentation-property symbol 'face-documentation t)))) (when (get symbol 'custom-group) - (apropos-documentation-property - symbol 'group-documentation t))))) + (apropos-documentation-property + symbol 'group-documentation t))))) symbols))) (apropos-print keys nil text))) @@ -976,15 +994,9 @@ symbol item) (set-buffer standard-output) (apropos-mode) - (if (display-mouse-p) - (insert - "If moving the mouse over text changes the text's color, " - "you can click\n" - "or press return on that text to get more information.\n")) - (insert "In this buffer, go to the name of the command, or function," - " or variable,\n" - (substitute-command-keys - "and type \\[apropos-follow] to get full documentation.\n\n")) + (insert (substitute-command-keys "Type \\[apropos-follow] on ") + (if apropos-multi-type "a type label" "an entry") + " to view its full documentation.\n\n") (if text (insert text "\n\n")) (dolist (apropos-item p) (when (and spacing (not (bobp))) @@ -1082,30 +1094,49 @@ (defun apropos-print-doc (i type do-keys) - (when (stringp (setq i (nth i apropos-item))) - (if apropos-compact-layout - (insert (propertize "\t" 'display '(space :align-to 32)) " ") - (insert " ")) - (if (null apropos-multi-type) - ;; If the query is only for a single type, there's no point - ;; writing it over and over again. Insert a blank button, and - ;; put the 'apropos-label property there (needed by - ;; apropos-symbol-button-display-help). - (insert-text-button + (let ((doc (nth i apropos-item))) + (when (stringp doc) + (if apropos-compact-layout + (insert (propertize "\t" 'display '(space :align-to 32)) " ") + (insert " ")) + (if apropos-multi-type + (let ((button-face (button-type-get type 'face))) + (unless (consp button-face) + (setq button-face (list button-face))) + (insert-text-button + (if apropos-compact-layout + (format "<%s>" (button-type-get type 'apropos-short-label)) + (button-type-get type 'apropos-label)) + 'type type + ;; Can't use the default button face, since user may have changed the + ;; variable! Just say `no' to variables containing faces! + 'face (append button-face apropos-label-face) + 'apropos-symbol (car apropos-item)) + (insert (if apropos-compact-layout " " ": "))) + + ;; If the query is only for a single type, there's no point + ;; writing it over and over again. Insert a blank button, and + ;; put the 'apropos-label property there (needed by + ;; apropos-symbol-button-display-help). + (insert-text-button " " 'type type 'skip t - 'face 'default 'apropos-symbol (car apropos-item)) - (insert-text-button - (if apropos-compact-layout - (format "<%s>" (button-type-get type 'apropos-short-label)) - (button-type-get type 'apropos-label)) - 'type type - ;; Can't use the default button face, since user may have changed the - ;; variable! Just say `no' to variables containing faces! - 'face apropos-label-face - 'apropos-symbol (car apropos-item)) - (insert (if apropos-compact-layout " " ": "))) - (insert (if do-keys (substitute-command-keys i) i)) - (or (bolp) (terpri)))) + 'face 'default 'apropos-symbol (car apropos-item))) + + (let ((opoint (point)) + (ocol (current-column))) + (cond ((equal doc "") + (setq doc "(not documented)")) + (do-keys + (setq doc (substitute-command-keys doc)))) + (insert doc) + (if (equal doc "(not documented)") + (put-text-property opoint (point) 'font-lock-face 'shadow)) + ;; The labeling buttons might make the line too long, so fill it if + ;; necessary. + (let ((fill-column (+ 5 emacs-lisp-docstring-fill-column)) + (fill-prefix (make-string ocol ?\s))) + (fill-region opoint (point) nil t))) + (or (bolp) (terpri))))) (defun apropos-follow () "Invokes any button at point, otherwise invokes the nearest label button." ------------------------------------------------------------ revno: 103980 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2011-04-23 20:19:56 +0300 message: Fix typos in comments in character.c and textprop.c. diff: === modified file 'src/character.c' --- src/character.c 2011-04-23 10:33:28 +0000 +++ src/character.c 2011-04-23 17:19:56 +0000 @@ -162,11 +162,11 @@ } -/* Return a character whose multibyte form is at P. Set LEN is not +/* Return a character whose multibyte form is at P. If LEN is not NULL, it must be a pointer to integer. In that case, set *LEN to - the byte length of the multibyte form. If ADVANCED is not NULL, is + the byte length of the multibyte form. If ADVANCED is not NULL, it must be a pointer to unsigned char. In that case, set *ADVANCED to - the ending address (i.e. the starting address of the next + the ending address (i.e., the starting address of the next character) of the multibyte form. */ int @@ -206,11 +206,10 @@ } -/* Translate character C by translation table TABLE. If C is - negative, translate a character specified by CHARSET and CODE. If - no translation is found in TABLE, return the untranslated - character. If TABLE is a list, elements are char tables. In this - case, translace C by all tables. */ +/* Translate character C by translation table TABLE. If no translation is + found in TABLE, return the untranslated character. If TABLE is a list, + elements are char tables. In that case, recursively translate C by all the + tables in the list. */ int translate_char (Lisp_Object table, int c) === modified file 'src/textprop.c' --- src/textprop.c 2011-04-16 18:26:30 +0000 +++ src/textprop.c 2011-04-23 17:19:56 +0000 @@ -233,7 +233,7 @@ if (! EQ (Fcar (XCDR (tail1)), Fcar (XCDR (tail2)))) return 0; - /* Property has same value on both lists; go to next one. */ + /* Property has same value on both lists; go to next one. */ found = 1; break; } ------------------------------------------------------------ revno: 103979 fixes bug(s): http://debbugs.gnu.org/8435 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2011-04-23 13:33:28 +0300 message: Fix doprnt so it could be used safely in `verror'. (Bug#8435) src/doprnt.c: Include limits.h. (SIZE_MAX): New macro. (doprnt): Return a size_t value. 2nd arg is now size_t. Many local variables are now size_t instead of int or unsigned. Improve overflow protection. Support `l' modifier for integer conversions. Support %l conversion. Don't assume an EMACS_INT argument for integer conversions and for %c. src/lisp.h (doprnt): Restore prototype. src/makefile.w32-in ($(BLD)/callint.$(O)): Depend on $(SRC)/character.h. src/Makefile.in (base_obj): Add back doprnt.o. src/deps.mk (doprnt.o): Add back prerequisites. (callint.o): Depend on character.h. src/eval.c (internal_lisp_condition_case): Include the handler representation in the error message. (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug when breaking from the loop. src/xdisp.c (vmessage): Call doprnt instead of vsnprintf. src/callint.c (Fcall_interactively): When displaying error message about invalid control letter, pass the character's codepoint, not a pointer to its multibyte form. Improve display of the character in octal and display also its hex code. src/character.c (char_string): Use %x to display the (unsigned) codepoint of an invalid character, to avoid displaying a bogus negative value. src/font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to `error', not SYMBOL_NAME itself. src/coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for character arguments to `error'. src/charset.c (check_iso_charset_parameter): Fix incorrect argument to `error' in error message about FINAL_CHAR argument. Make sure FINAL_CHAR is a character, and use %c when it is passed as argument to `error'. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-04-23 03:07:16 +0000 +++ src/ChangeLog 2011-04-23 10:33:28 +0000 @@ -1,5 +1,53 @@ 2011-04-23 Eli Zaretskii + Fix doprnt so it could be used again safely in `verror'. (Bug#8435) + * doprnt.c: Include limits.h. + (SIZE_MAX): New macro. + (doprnt): Return a size_t value. 2nd arg is now size_t. Many + local variables are now size_t instead of int or unsigned. + Improve overflow protection. Support `l' modifier for integer + conversions. Support %l conversion. Don't assume an EMACS_INT + argument for integer conversions and for %c. + + * lisp.h (doprnt): Restore prototype. + + * makefile.w32-in ($(BLD)/callint.$(O)): Depend on + $(SRC)/character.h. + + * Makefile.in (base_obj): Add back doprnt.o. + + * deps.mk (doprnt.o): Add back prerequisites. + (callint.o): Depend on character.h. + + * eval.c (internal_lisp_condition_case): Include the handler + representation in the error message. + (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug + when breaking from the loop. + + * xdisp.c (vmessage): Call doprnt instead of vsnprintf. + + * callint.c (Fcall_interactively): When displaying error message + about invalid control letter, pass the character's codepoint, not + a pointer to its multibyte form. Improve display of the character + in octal and display also its hex code. + + * character.c (char_string): Use %x to display the (unsigned) + codepoint of an invalid character, to avoid displaying a bogus + negative value. + + * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to + `error', not SYMBOL_NAME itself. + + * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for + character arguments to `error'. + + * charset.c (check_iso_charset_parameter): Fix incorrect argument + to `error' in error message about FINAL_CHAR argument. Make sure + FINAL_CHAR is a character, and use %c when it is passed as + argument to `error'. + +2011-04-23 Eli Zaretskii + * s/ms-w32.h (localtime): Redirect to sys_localtime. * w32.c: Include . === modified file 'src/Makefile.in' --- src/Makefile.in 2011-04-07 03:49:25 +0000 +++ src/Makefile.in 2011-04-23 10:33:28 +0000 @@ -354,7 +354,7 @@ syntax.o $(UNEXEC_OBJ) bytecode.o \ process.o gnutls.o callproc.o \ region-cache.o sound.o atimer.o \ - intervals.o textprop.o composite.o xml.o \ + doprnt.o intervals.o textprop.o composite.o xml.o \ $(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) obj = $(base_obj) $(NS_OBJC_OBJ) === modified file 'src/callint.c' --- src/callint.c 2011-04-14 05:04:02 +0000 +++ src/callint.c 2011-04-23 10:33:28 +0000 @@ -27,6 +27,7 @@ #include "keyboard.h" #include "window.h" #include "keymap.h" +#include "character.h" Lisp_Object Qminus, Qplus; Lisp_Object Qcall_interactively; @@ -786,8 +787,10 @@ if anyone tries to define one here. */ case '+': default: - error ("Invalid control letter `%c' (%03o) in interactive calling string", - *tem, (unsigned char) *tem); + error ("Invalid control letter `%c' (#o%03o, #x%04x) in interactive calling string", + STRING_CHAR ((unsigned char *) tem), + (unsigned) STRING_CHAR ((unsigned char *) tem), + (unsigned) STRING_CHAR ((unsigned char *) tem)); } if (varies[i] == 0) === modified file 'src/character.c' --- src/character.c 2011-04-14 05:04:02 +0000 +++ src/character.c 2011-04-23 10:33:28 +0000 @@ -156,7 +156,7 @@ bytes = BYTE8_STRING (c, p); } else - error ("Invalid character: %d", c); + error ("Invalid character: %x", c); return bytes; } === modified file 'src/charset.c' --- src/charset.c 2011-04-14 20:16:48 +0000 +++ src/charset.c 2011-04-23 10:33:28 +0000 @@ -1436,7 +1436,7 @@ { CHECK_NATNUM (dimension); CHECK_NATNUM (chars); - CHECK_NATNUM (final_char); + CHECK_CHARACTER (final_char); if (XINT (dimension) > 3) error ("Invalid DIMENSION %"pEd", it should be 1, 2, or 3", @@ -1444,12 +1444,8 @@ if (XINT (chars) != 94 && XINT (chars) != 96) error ("Invalid CHARS %"pEd", it should be 94 or 96", XINT (chars)); if (XINT (final_char) < '0' || XINT (final_char) > '~') - { - unsigned char str[MAX_MULTIBYTE_LENGTH + 1]; - int len = CHAR_STRING (XINT (chars), str); - str[len] = '\0'; - error ("Invalid FINAL-CHAR %s, it should be `0'..`~'", str); - } + error ("Invalid FINAL-CHAR %c, it should be `0'..`~'", + (int)XINT (final_char)); } === modified file 'src/coding.c' --- src/coding.c 2011-04-14 05:04:02 +0000 +++ src/coding.c 2011-04-23 10:33:28 +0000 @@ -9071,7 +9071,7 @@ charset_list = CODING_ATTR_CHARSET_LIST (attrs); charset = char_charset (c, charset_list, &code); if (code == CHARSET_INVALID_CODE (charset)) - error ("Can't encode by shift_jis encoding: %d", c); + error ("Can't encode by shift_jis encoding: %c", c); JIS_TO_SJIS (code); return make_number (code); @@ -9142,7 +9142,7 @@ charset_list = CODING_ATTR_CHARSET_LIST (attrs); charset = char_charset (c, charset_list, &code); if (code == CHARSET_INVALID_CODE (charset)) - error ("Can't encode by Big5 encoding: %d", c); + error ("Can't encode by Big5 encoding: %c", c); return make_number (code); } === modified file 'src/deps.mk' --- src/deps.mk 2011-04-07 03:49:25 +0000 +++ src/deps.mk 2011-04-23 10:33:28 +0000 @@ -44,7 +44,8 @@ $(INTERVALS_H) blockinput.h atimer.h systime.h character.h ../lib/unistd.h \ indent.h keyboard.h coding.h keymap.h frame.h lisp.h globals.h $(config_h) callint.o: callint.c window.h commands.h buffer.h keymap.h globals.h msdos.h \ - keyboard.h dispextern.h systime.h coding.h composite.h lisp.h $(config_h) + keyboard.h dispextern.h systime.h coding.h composite.h lisp.h \ + character.h $(config_h) callproc.o: callproc.c epaths.h buffer.h commands.h lisp.h $(config_h) \ process.h systty.h syssignal.h character.h coding.h ccl.h msdos.h \ composite.h w32.h blockinput.h atimer.h systime.h frame.h termhooks.h \ @@ -82,6 +83,7 @@ # doc.o's dependency on buildobj.h is in src/Makefile.in. doc.o: doc.c lisp.h $(config_h) buffer.h keyboard.h keymap.h \ character.h systime.h coding.h composite.h ../lib/unistd.h globals.h +doprnt.o: doprnt.c character.h lisp.h globals.h ../lib/unistd.h $(config_h) dosfns.o: buffer.h termchar.h termhooks.h frame.h blockinput.h window.h \ msdos.h dosfns.h dispextern.h charset.h coding.h atimer.h systime.h \ lisp.h $(config_h) === modified file 'src/doprnt.c' --- src/doprnt.c 2011-04-10 16:44:27 +0000 +++ src/doprnt.c 2011-04-23 10:33:28 +0000 @@ -30,6 +30,11 @@ #include +#include +#ifndef SIZE_MAX +# define SIZE_MAX ((size_t) -1) +#endif + #include "lisp.h" /* Since we use the macro CHAR_HEAD_P, we have to include this, but @@ -51,8 +56,8 @@ String arguments are passed as C strings. Integers are passed as C integers. */ -EMACS_INT -doprnt (char *buffer, register int bufsize, const char *format, +size_t +doprnt (char *buffer, register size_t bufsize, const char *format, const char *format_end, va_list ap) { const char *fmt = format; /* Pointer into format string */ @@ -62,15 +67,15 @@ char tembuf[DBL_MAX_10_EXP + 100]; /* Size of sprintf_buffer. */ - unsigned size_allocated = sizeof (tembuf); + size_t size_allocated = sizeof (tembuf); /* Buffer to use for sprintf. Either tembuf or same as BIG_BUFFER. */ char *sprintf_buffer = tembuf; /* Buffer we have got with malloc. */ - char *big_buffer = 0; + char *big_buffer = NULL; - register int tem; + register size_t tem; char *string; char fixed_buffer[20]; /* Default buffer for small formatting. */ char *fmtcpy; @@ -92,8 +97,9 @@ { if (*fmt == '%') /* Check for a '%' character */ { - unsigned size_bound = 0; - EMACS_INT width; /* Columns occupied by STRING. */ + size_t size_bound = 0; + EMACS_INT width; /* Columns occupied by STRING on display. */ + int long_flag = 0; fmt++; /* Copy this one %-spec into fmtcpy. */ @@ -108,10 +114,11 @@ This might be a field width or a precision; e.g. %1.1000f and %1000.1f both might need 1000+ bytes. Parse the width or precision, checking for overflow. */ - unsigned n = *fmt - '0'; + size_t n = *fmt - '0'; while ('0' <= fmt[1] && fmt[1] <= '9') { - if (n * 10 + fmt[1] - '0' < n) + if (n >= SIZE_MAX / 10 + || n * 10 > SIZE_MAX - (fmt[1] - '0')) error ("Format width or precision too large"); n = n * 10 + fmt[1] - '0'; *string++ = *++fmt; @@ -122,6 +129,13 @@ } else if (*fmt == '-' || *fmt == ' ' || *fmt == '.' || *fmt == '+') ; + else if (*fmt == 'l') + { + long_flag = 1; + if (!strchr ("dox", fmt[1])) + /* %l as conversion specifier, not as modifier. */ + break; + } else break; fmt++; @@ -130,7 +144,7 @@ /* Make the size bound large enough to handle floating point formats with large numbers. */ - if (size_bound + DBL_MAX_10_EXP + 50 < size_bound) + if (size_bound > SIZE_MAX - DBL_MAX_10_EXP - 50) error ("Format width or precision too large"); size_bound += DBL_MAX_10_EXP + 50; @@ -151,23 +165,47 @@ error ("Invalid format operation %%%c", fmt[-1]); /* case 'b': */ + case 'l': case 'd': + { + int i; + long l; + + if (long_flag) + { + l = va_arg(ap, long); + sprintf (sprintf_buffer, fmtcpy, l); + } + else + { + i = va_arg(ap, int); + sprintf (sprintf_buffer, fmtcpy, i); + } + /* Now copy into final output, truncating as necessary. */ + string = sprintf_buffer; + goto doit; + } + case 'o': case 'x': - if (sizeof (int) == sizeof (EMACS_INT)) - ; - else if (sizeof (long) == sizeof (EMACS_INT)) - /* Insert an `l' the right place. */ - string[1] = string[0], - string[0] = string[-1], - string[-1] = 'l', - string++; - else - abort (); - sprintf (sprintf_buffer, fmtcpy, va_arg(ap, char *)); - /* Now copy into final output, truncating as nec. */ - string = sprintf_buffer; - goto doit; + { + unsigned u; + unsigned long ul; + + if (long_flag) + { + ul = va_arg(ap, unsigned long); + sprintf (sprintf_buffer, fmtcpy, ul); + } + else + { + u = va_arg(ap, unsigned); + sprintf (sprintf_buffer, fmtcpy, u); + } + /* Now copy into final output, truncating as necessary. */ + string = sprintf_buffer; + goto doit; + } case 'f': case 'e': @@ -175,7 +213,7 @@ { double d = va_arg(ap, double); sprintf (sprintf_buffer, fmtcpy, d); - /* Now copy into final output, truncating as nec. */ + /* Now copy into final output, truncating as necessary. */ string = sprintf_buffer; goto doit; } @@ -187,13 +225,18 @@ minlen = atoi (&fmtcpy[1]); string = va_arg (ap, char *); tem = strlen (string); + if (tem > MOST_POSITIVE_FIXNUM) + error ("String for %%s or %%S format is too long"); width = strwidth (string, tem); goto doit1; /* Copy string into final output, truncating if no room. */ doit: /* Coming here means STRING contains ASCII only. */ - width = tem = strlen (string); + tem = strlen (string); + if (tem > MOST_POSITIVE_FIXNUM) + error ("Format width or precision too large"); + width = tem; doit1: /* We have already calculated: TEM -- length of STRING, @@ -236,13 +279,8 @@ case 'c': { - /* Sometimes for %c we pass a char, which would widen - to int. Sometimes we pass XFASTINT() or XINT() - values, which would be EMACS_INT. Let's hope that - both are passed the same way, otherwise we'll need - to rewrite callers. */ - EMACS_INT chr = va_arg(ap, EMACS_INT); - tem = CHAR_STRING ((int) chr, (unsigned char *) charbuf); + int chr = va_arg(ap, int); + tem = CHAR_STRING (chr, (unsigned char *) charbuf); string = charbuf; string[tem] = 0; width = strwidth (string, tem); @@ -274,6 +312,6 @@ /* If we had to malloc something, free it. */ xfree (big_buffer); - *bufptr = 0; /* Make sure our string end with a '\0' */ + *bufptr = 0; /* Make sure our string ends with a '\0' */ return bufptr - buffer; } === modified file 'src/eval.c' --- src/eval.c 2011-04-16 21:50:01 +0000 +++ src/eval.c 2011-04-23 10:33:28 +0000 @@ -1416,7 +1416,8 @@ || (CONSP (tem) && (SYMBOLP (XCAR (tem)) || CONSP (XCAR (tem)))))) - error ("Invalid condition handler"); + error ("Invalid condition handler: %s", + SDATA (Fprin1_to_string (tem, Qt))); } c.tag = Qnil; @@ -1995,31 +1996,31 @@ size_t size = sizeof buf; size_t size_max = min (MOST_POSITIVE_FIXNUM, min (INT_MAX, SIZE_MAX - 1)) + 1; + size_t mlen = strlen (m); char *buffer = buf; - int used; + size_t used; Lisp_Object string; while (1) { - used = vsnprintf (buffer, size, m, ap); + used = doprnt (buffer, size, m, m + mlen, ap); - if (used < 0) - { - /* Non-C99 vsnprintf, such as w32, returns -1 when SIZE is too small. - Guess a larger USED to work around the incompatibility. */ - used = (size <= size_max / 2 ? 2 * size - : size < size_max ? size_max - 1 - : size_max); - } - else if (used < size) + /* Note: the -1 below is because `doprnt' returns the number of bytes + excluding the terminating null byte, and it always terminates with a + null byte, even when producing a truncated message. */ + if (used < size - 1) break; - if (size_max <= used) - memory_full (); - size = used + 1; + if (size <= size_max / 2) + size *= 2; + else if (size < size_max - 1) + size = size_max - 1; + else + break; /* and leave the message truncated */ - if (buffer != buf) - xfree (buffer); - buffer = (char *) xmalloc (size); + if (buffer == buf) + buffer = (char *) xmalloc (size); + else + buffer = (char *) xrealloc (buffer, size); } string = make_string (buffer, used); === modified file 'src/font.c' --- src/font.c 2011-04-15 01:26:32 +0000 +++ src/font.c 2011-04-23 10:33:28 +0000 @@ -1795,14 +1795,16 @@ { CHECK_SYMBOL (Fcar (val)); if (SBYTES (SYMBOL_NAME (XCAR (val))) > 4) - error ("Invalid OTF GSUB feature: %s", SYMBOL_NAME (XCAR (val))); + error ("Invalid OTF GSUB feature: %s", + SDATA (SYMBOL_NAME (XCAR (val)))); } otf_features = XCDR (otf_features); for (val = Fcar (otf_features); ! NILP (val); val = Fcdr (val)) { CHECK_SYMBOL (Fcar (val)); if (SBYTES (SYMBOL_NAME (XCAR (val))) > 4) - error ("Invalid OTF GPOS feature: %s", SYMBOL_NAME (XCAR (val))); + error ("Invalid OTF GPOS feature: %s", + SDATA (SYMBOL_NAME (XCAR (val)))); } } === modified file 'src/lisp.h' --- src/lisp.h 2011-04-15 08:22:34 +0000 +++ src/lisp.h 2011-04-23 10:33:28 +0000 @@ -2760,6 +2760,9 @@ extern void float_to_string (char *, double); extern void syms_of_print (void); +/* Defined in doprnt.c */ +extern size_t doprnt (char *, size_t, const char *, const char *, va_list); + /* Defined in lread.c. */ extern Lisp_Object Qvariable_documentation, Qstandard_input; extern Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction; === modified file 'src/makefile.w32-in' --- src/makefile.w32-in 2011-03-19 03:22:14 +0000 +++ src/makefile.w32-in 2011-04-23 10:33:28 +0000 @@ -469,6 +469,7 @@ $(EMACS_ROOT)/nt/inc/sys/time.h \ $(LISP_H) \ $(SRC)/buffer.h \ + $(SRC)/character.h \ $(SRC)/coding.h \ $(SRC)/commands.h \ $(SRC)/composite.h \ === modified file 'src/xdisp.c' --- src/xdisp.c 2011-04-23 03:07:16 +0000 +++ src/xdisp.c 2011-04-23 10:33:28 +0000 @@ -8373,22 +8373,10 @@ { if (m) { - char *buf = FRAME_MESSAGE_BUF (f); - size_t bufsize = FRAME_MESSAGE_BUF_SIZE (f); - int len; - - memset (buf, 0, bufsize); - len = vsnprintf (buf, bufsize, m, ap); - - /* Do any truncation at a character boundary. */ - if (! (0 <= len && len < bufsize)) - { - char *end = memchr (buf, 0, bufsize); - for (len = end ? end - buf : bufsize; - len && ! CHAR_HEAD_P (buf[len - 1]); - len--) - continue; - } + size_t len; + + len = doprnt (FRAME_MESSAGE_BUF (f), + FRAME_MESSAGE_BUF_SIZE (f), m, (char *)0, ap); message2 (FRAME_MESSAGE_BUF (f), len, 0); } ------------------------------------------------------------ revno: 103978 [merge] committer: Glenn Morris branch nick: trunk timestamp: Fri 2011-04-22 20:07:16 -0700 message: Merge from emacs-23; up to r100560. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-04-20 17:39:39 +0000 +++ doc/emacs/ChangeLog 2011-04-23 03:07:16 +0000 @@ -1,3 +1,8 @@ +2011-04-23 Juanma Barranquero + + * mini.texi (Minibuffer Edit): + * screen.texi (Mode Line): Fix typo. + 2011-04-20 Christoph Scholtes * maintaining.texi (Old Revisions): Mention new function vc-ediff. === modified file 'doc/emacs/mini.texi' --- doc/emacs/mini.texi 2011-01-25 04:08:28 +0000 +++ doc/emacs/mini.texi 2011-04-23 03:07:16 +0000 @@ -164,7 +164,7 @@ @vindex resize-mini-windows Normally, the minibuffer window occupies a single screen line. However, if you add two or more lines' worth of text into the -minibuffer, it expands automatically to accomodate the text. The +minibuffer, it expands automatically to accommodate the text. The variable @code{resize-mini-windows} controls the resizing of the minibuffer. The default value is @code{grow-only}, which means the behavior we have just described. If the value is @code{t}, the === modified file 'doc/emacs/screen.texi' --- doc/emacs/screen.texi 2011-01-25 04:08:28 +0000 +++ doc/emacs/screen.texi 2011-04-23 03:07:16 +0000 @@ -259,7 +259,7 @@ additional features on top of the major mode. @xref{Minor Modes}. Some features are listed together with the minor modes whenever they -are turned on, even through they are not really minor modes. +are turned on, even though they are not really minor modes. @samp{Narrow} means that the buffer being displayed has editing restricted to only a portion of its text (@pxref{Narrowing}). @samp{Def} means that a keyboard macro is currently being defined === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2011-04-08 18:53:26 +0000 +++ doc/lispref/ChangeLog 2011-04-23 03:07:16 +0000 @@ -1,3 +1,13 @@ +2011-04-23 Juanma Barranquero + + * windows.texi (Choosing Window): Fix typo. + +2011-04-23 Chong Yidong + + * frames.texi (Layout Parameters): Note the difference between + querying and setting parameters for left-fringe and right-fringe + (Bug#6930). + 2011-03-21 Stefan Monnier * minibuf.texi (Basic Completion): Be a bit more precise about the === modified file 'doc/lispref/frames.texi' --- doc/lispref/frames.texi 2011-01-25 04:08:28 +0000 +++ doc/lispref/frames.texi 2011-04-23 03:07:16 +0000 @@ -681,17 +681,20 @@ @itemx right-fringe The default width of the left and right fringes of windows in this frame (@pxref{Fringes}). If either of these is zero, that effectively -removes the corresponding fringe. A value of @code{nil} stands for -the standard fringe width, which is the width needed to display the -fringe bitmaps. +removes the corresponding fringe. + +When you use @code{frame-parameter} to query the value of either of +these two frame parameters, the return value is always an integer. +When using @code{set-frame-parameter}, passing a @code{nil} value +imposes an actual default value of 8 pixels. The combined fringe widths must add up to an integral number of -columns, so the actual default fringe widths for the frame may be -larger than the specified values. The extra width needed to reach an -acceptable total is distributed evenly between the left and right -fringe. However, you can force one fringe or the other to a precise -width by specifying that width as a negative integer. If both widths are -negative, only the left fringe gets the specified width. +columns, so the actual default fringe widths for the frame, as +reported by @code{frame-parameter}, may be larger than what you +specify. Any extra width is distributed evenly between the left and +right fringe. However, you can force one fringe or the other to a +precise width by specifying that width as a negative integer. If both +widths are negative, only the left fringe gets the specified width. @vindex menu-bar-lines, a frame parameter @item menu-bar-lines === modified file 'doc/lispref/windows.texi' --- doc/lispref/windows.texi 2011-01-25 04:08:28 +0000 +++ doc/lispref/windows.texi 2011-04-23 03:07:16 +0000 @@ -1014,7 +1014,7 @@ windows one above the other that are both at least @code{window-min-height} lines tall. Moreover, if the window that shall be split has a mode line, @code{split-window-sensibly} does not split -the window unless the new window can accomodate a mode line too. +the window unless the new window can accommodate a mode line too. @end defopt @defopt split-width-threshold === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-04-22 20:15:21 +0000 +++ lisp/ChangeLog 2011-04-23 03:07:16 +0000 @@ -1,3 +1,34 @@ +2011-04-23 Juanma Barranquero + + * buff-menu.el (Buffer-menu--buffers): Fix typo in docstring (bug#8535). + + * play/mpuz.el (mpuz-silent): Doc fix. + (mpuz-mode-map): Use mapc. + (mpuz-put-number-on-board): Rename parameter L to COLUMNS. + (mpuz-letter-to-digit, mpuz-check-all-solved, mpuz-create-buffer): + Fix typos in docstrings. + + * play/doctor.el (doc$, doctor-$, doctor-read-print, doctor-read-token) + (doctor-nounp, doctor-pronounp): Fix typos in docstrings. + + * mouse-drag.el (mouse-drag-throw): Fix typo in docstring. + +2011-04-23 Chong Yidong + + * minibuffer.el (completion--do-completion): Avoid the "Next char + not unique" prompt if icomplete-mode is enabled (Bug#5849). + + * mouse.el (mouse-drag-mode-line-1): Make sure that if we push + mouse-2 into unread-command-events, it is interpreted correctly. + + * image-mode.el (image-type, image-mode-map, image-minor-mode-map) + (image-toggle-display): Doc fix. + +2011-04-23 Stephen Berman + + * textmodes/page.el (what-page): Use line-number-at-pos to + calculate line number (Bug#6825). + 2011-04-22 Juanma Barranquero * eshell/esh-mode.el (find-tag-interactive): Declare function. === modified file 'lisp/ChangeLog.14' --- lisp/ChangeLog.14 2011-01-25 04:08:28 +0000 +++ lisp/ChangeLog.14 2011-04-23 03:07:16 +0000 @@ -4287,7 +4287,7 @@ (proced-descend): New variable. (proced-sort): New arg descend. (proced-sort-interactive): Repeated calls toggle sort order. - (proced-format): Accomodate changes of proced-format-alist. + (proced-format): Accommodate changes of proced-format-alist. Undefined attributes are displayed as "?". (proced-process-attributes): New optional arg pid-list. Ignore processes with empty attribute list. === modified file 'lisp/buff-menu.el' --- lisp/buff-menu.el 2011-04-19 13:44:55 +0000 +++ lisp/buff-menu.el 2011-04-23 03:07:16 +0000 @@ -117,7 +117,7 @@ (defvar Buffer-menu--buffers nil "If non-nil, list of buffers shown in the current buffer-menu. This variable determines whether reverting the buffer lists only -this buffers. It affects both manual reverting and reverting by +these buffers. It affects both manual reverting and reverting by Auto Revert Mode.") (make-variable-buffer-local 'Buffer-menu--buffers) === modified file 'lisp/cedet/ChangeLog' --- lisp/cedet/ChangeLog 2011-04-06 12:18:10 +0000 +++ lisp/cedet/ChangeLog 2011-04-23 03:07:16 +0000 @@ -1,3 +1,11 @@ +2011-04-23 Juanma Barranquero + + * ede/pconf.el (ede-proj-tweak-autoconf, ede-proj-flush-autoconf): + * ede/proj-comp.el (ede-proj-tweak-autoconf, ede-proj-flush-autoconf): + * ede/proj-elisp.el (ede-proj-tweak-autoconf, ede-proj-flush-autoconf) + (ede-proj-tweak-autoconf, ede-proj-flush-autoconf): + * ede/proj-scheme.el (ede-proj-tweak-autoconf): Fix typos in docstrings. + 2011-03-07 Chong Yidong * Version 23.3 released. === modified file 'lisp/cedet/ede/pconf.el' --- lisp/cedet/ede/pconf.el 2011-01-26 08:36:39 +0000 +++ lisp/cedet/ede/pconf.el 2011-04-23 03:07:16 +0000 @@ -159,7 +159,7 @@ (ede-proj-configure-synchronize this)) (defmethod ede-proj-tweak-autoconf ((this ede-proj-target)) - "Tweak the configure file (current buffer) to accomodate THIS." + "Tweak the configure file (current buffer) to accommodate THIS." ;; Check the compilers belonging to THIS, and call the autoconf ;; setup for those compilers. (mapc 'ede-proj-tweak-autoconf (ede-proj-compilers this)) @@ -167,7 +167,7 @@ ) (defmethod ede-proj-flush-autoconf ((this ede-proj-target)) - "Flush the configure file (current buffer) to accomodate THIS. + "Flush the configure file (current buffer) to accommodate THIS. By flushing, remove any cruft that may be in the file. Subsequent calls to `ede-proj-tweak-autoconf' can restore items removed by flush." nil) === modified file 'lisp/cedet/ede/proj-comp.el' --- lisp/cedet/ede/proj-comp.el 2011-01-25 04:08:28 +0000 +++ lisp/cedet/ede/proj-comp.el 2011-04-23 03:07:16 +0000 @@ -236,7 +236,7 @@ ;;; Methods: (defmethod ede-proj-tweak-autoconf ((this ede-compilation-program)) - "Tweak the configure file (current buffer) to accomodate THIS." + "Tweak the configure file (current buffer) to accommodate THIS." (mapcar (lambda (obj) (cond ((stringp obj) @@ -248,7 +248,7 @@ (oref this autoconf))) (defmethod ede-proj-flush-autoconf ((this ede-compilation-program)) - "Flush the configure file (current buffer) to accomodate THIS." + "Flush the configure file (current buffer) to accommodate THIS." nil) (defmacro proj-comp-insert-variable-once (varname &rest body) === modified file 'lisp/cedet/ede/proj-elisp.el' --- lisp/cedet/ede/proj-elisp.el 2011-01-25 04:08:28 +0000 +++ lisp/cedet/ede/proj-elisp.el 2011-04-23 03:07:16 +0000 @@ -208,7 +208,7 @@ (error "Don't know how to update load path")))) (defmethod ede-proj-tweak-autoconf ((this ede-proj-target-elisp)) - "Tweak the configure file (current buffer) to accomodate THIS." + "Tweak the configure file (current buffer) to accommodate THIS." (call-next-method) ;; Ok, now we have to tweak the autoconf provided `elisp-comp' program. (let ((ec (ede-expand-filename this "elisp-comp" 'newfile))) @@ -232,7 +232,7 @@ (save-buffer)) ))) (defmethod ede-proj-flush-autoconf ((this ede-proj-target-elisp)) - "Flush the configure file (current buffer) to accomodate THIS." + "Flush the configure file (current buffer) to accommodate THIS." ;; Remove crufty old paths from elisp-compile (let ((ec (ede-expand-filename this "elisp-comp" 'newfile)) ) @@ -372,11 +372,11 @@ ) (defmethod ede-proj-tweak-autoconf ((this ede-proj-target-elisp-autoloads)) - "Tweak the configure file (current buffer) to accomodate THIS." + "Tweak the configure file (current buffer) to accommodate THIS." (error "Autoloads not supported in autoconf yet")) (defmethod ede-proj-flush-autoconf ((this ede-proj-target-elisp-autoloads)) - "Flush the configure file (current buffer) to accomodate THIS." + "Flush the configure file (current buffer) to accommodate THIS." nil) (provide 'ede/proj-elisp) === modified file 'lisp/cedet/ede/proj-scheme.el' --- lisp/cedet/ede/proj-scheme.el 2011-01-25 04:08:28 +0000 +++ lisp/cedet/ede/proj-scheme.el 2011-04-23 03:07:16 +0000 @@ -41,7 +41,7 @@ "This target consists of scheme files.") (defmethod ede-proj-tweak-autoconf ((this ede-proj-target-scheme)) - "Tweak the configure file (current buffer) to accomodate THIS." + "Tweak the configure file (current buffer) to accommodate THIS." (autoconf-insert-new-macro "AM_INIT_GUILE_MODULE")) (provide 'ede/proj-scheme) === modified file 'lisp/image-mode.el' --- lisp/image-mode.el 2011-04-13 02:16:42 +0000 +++ lisp/image-mode.el 2011-04-23 03:07:16 +0000 @@ -296,8 +296,7 @@ ;;; Image Mode setup (defvar image-type nil - "Current image type. -This variable is used to display the current image type in the mode line.") + "The image type for the current Image mode buffer.") (make-variable-buffer-local 'image-type) (defvar image-mode-previous-major-mode nil @@ -324,13 +323,13 @@ (define-key map [remap beginning-of-buffer] 'image-bob) (define-key map [remap end-of-buffer] 'image-eob) map) - "Major mode keymap for viewing images in Image mode.") + "Mode keymap for `image-mode'.") (defvar image-minor-mode-map (let ((map (make-sparse-keymap))) (define-key map "\C-c\C-c" 'image-toggle-display) map) - "Minor mode keymap for viewing images as text in Image mode.") + "Mode keymap for `image-minor-mode'.") (defvar bookmark-make-record-function) @@ -520,9 +519,10 @@ (message "Repeat this command to go back to displaying the file as text")))) (defun image-toggle-display () - "Start or stop displaying an image file as the actual image. -This command toggles between `image-mode-as-text' showing the text of -the image file and `image-mode' showing the image as an image." + "Toggle between image and text display. +If the current buffer is displaying an image file as an image, +call `image-mode-as-text' to switch to text. Otherwise, display +the image by calling `image-mode'." (interactive) (if (image-get-display-property) (image-mode-as-text) === modified file 'lisp/minibuffer.el' --- lisp/minibuffer.el 2011-04-20 22:31:06 +0000 +++ lisp/minibuffer.el 2011-04-23 03:07:16 +0000 @@ -657,7 +657,8 @@ (minibuffer-hide-completions)) ;; Show the completion table, if requested. ((not exact) - (if (cond ((null completion-show-inline-help) t) + (if (cond (icomplete-mode t) + ((null completion-show-inline-help) t) ((eq completion-auto-help 'lazy) (eq this-command last-command)) (t completion-auto-help)) === modified file 'lisp/mouse-drag.el' --- lisp/mouse-drag.el 2011-04-19 13:44:55 +0000 +++ lisp/mouse-drag.el 2011-04-23 03:07:16 +0000 @@ -194,7 +194,7 @@ you'll like it. It's easier to observe than to explain. If the mouse is clicked and released in the same place of time we -assume that the user didn't want to scdebugroll but wanted to whatever +assume that the user didn't want to scroll but wanted to whatever mouse-2 used to do, so we pass it through. Throw scrolling was inspired (but is not identical to) the \"hand\" === modified file 'lisp/mouse.el' --- lisp/mouse.el 2011-02-04 14:54:13 +0000 +++ lisp/mouse.el 2011-04-23 03:07:16 +0000 @@ -541,6 +541,9 @@ ;; a `drag-mouse-1'. In any case `on-link' would have been nulled ;; above if there had been any significant mouse movement. (when (and on-link (eq 'mouse-1 (car-safe event))) + ;; If mouse-2 has never been done by the user, it doesn't + ;; have the necessary property to be interpreted correctly. + (put 'mouse-2 'event-kind 'mouse-click) (push (cons 'mouse-2 (cdr event)) unread-command-events)))))) (defun mouse-drag-mode-line (start-event) === modified file 'lisp/play/doctor.el' --- lisp/play/doctor.el 2011-04-21 12:24:46 +0000 +++ lisp/play/doctor.el 2011-04-23 03:07:16 +0000 @@ -115,11 +115,11 @@ (defun doc// (x) x) (defmacro doc$ (what) - "quoted arg form of doctor-$" + "Quoted arg form of doctor-$." `(doctor-$ ',what)) (defun doctor-$ (what) - "Return the car of a list, rotating the list each time" + "Return the car of a list, rotating the list each time." (let* ((vv (symbol-value what)) (first (car vv)) (ww (append (cdr vv) (list first)))) @@ -832,7 +832,7 @@ (newline arg))) (defun doctor-read-print nil - "top level loop" + "Top level loop." (interactive) (let ((sent (doctor-readin))) (insert "\n") @@ -850,7 +850,7 @@ sentence)) (defun doctor-read-token () - "read one word from buffer" + "Read one word from buffer." (prog1 (intern (downcase (buffer-substring (point) (progn (forward-word 1) @@ -1020,7 +1020,7 @@ nil)))) (defun doctor-nounp (x) - "Returns t if the symbol argument is a noun." + "Return t if the symbol argument is a noun." (or (doctor-pronounp x) (not (or (doctor-verbp x) (equal x 'not) @@ -1028,7 +1028,7 @@ (doctor-modifierp x) )) )) (defun doctor-pronounp (x) - "Returns t if the symbol argument is a pronoun." + "Return t if the symbol argument is a pronoun." (memq x '( i me mine myself we us ours ourselves ourself === modified file 'lisp/play/mpuz.el' --- lisp/play/mpuz.el 2011-04-21 12:24:46 +0000 +++ lisp/play/mpuz.el 2011-04-23 03:07:16 +0000 @@ -39,7 +39,7 @@ (defcustom mpuz-silent 'error "Set this to nil if you want dings on inputs. -t means never ding, and `error' means only ding on wrong input." +The value t means never ding, and `error' means only ding on wrong input." :type '(choice (const :tag "No" nil) (const :tag "Yes" t) (const :tag "If correct" error)) @@ -88,33 +88,14 @@ (defvar mpuz-mode-map (let ((map (make-sparse-keymap))) - (define-key map "a" 'mpuz-try-letter) - (define-key map "b" 'mpuz-try-letter) - (define-key map "c" 'mpuz-try-letter) - (define-key map "d" 'mpuz-try-letter) - (define-key map "e" 'mpuz-try-letter) - (define-key map "f" 'mpuz-try-letter) - (define-key map "g" 'mpuz-try-letter) - (define-key map "h" 'mpuz-try-letter) - (define-key map "i" 'mpuz-try-letter) - (define-key map "j" 'mpuz-try-letter) - (define-key map "A" 'mpuz-try-letter) - (define-key map "B" 'mpuz-try-letter) - (define-key map "C" 'mpuz-try-letter) - (define-key map "D" 'mpuz-try-letter) - (define-key map "E" 'mpuz-try-letter) - (define-key map "F" 'mpuz-try-letter) - (define-key map "G" 'mpuz-try-letter) - (define-key map "H" 'mpuz-try-letter) - (define-key map "I" 'mpuz-try-letter) - (define-key map "J" 'mpuz-try-letter) + (mapc (lambda (ch) + (define-key map (char-to-string ch) 'mpuz-try-letter)) + "abcdefghijABCDEFGHIJ") (define-key map "\C-g" 'mpuz-offer-abort) (define-key map "?" 'describe-mode) map) "Local keymap to use in Mult Puzzle.") - - (defun mpuz-mode () "Multiplication puzzle mode. @@ -171,7 +152,7 @@ "A permutation from [0..9] to [0..9].") (defvar mpuz-letter-to-digit (make-vector 10 0) - "The inverse of mpuz-digit-to-letter.") + "The inverse of `mpuz-digit-to-letter'.") (defmacro mpuz-to-digit (letter) (list 'aref 'mpuz-letter-to-digit letter)) @@ -198,17 +179,16 @@ (defvar mpuz-board (make-vector 10 nil) "The board associates to any digit the list of squares where it appears.") -(defun mpuz-put-number-on-board (number row &rest l) +(defun mpuz-put-number-on-board (number row &rest columns) "Put (last digit of) NUMBER on ROW and COLUMNS of the puzzle board." (let (digit) - (while l + (dolist (column columns) (setq digit (% number 10) - number (/ number 10)) - (aset mpuz-board digit `((,row . ,(car l)) ,@(aref mpuz-board digit))) - (setq l (cdr l))))) + number (/ number 10)) + (aset mpuz-board digit `((,row . ,column) ,@(aref mpuz-board digit)))))) (defun mpuz-check-all-solved (&optional row col) - "Check whether all digits have been solved. Return t if yes." + "Check whether all digits have been solved. Return t if yes." (catch 'solved (let (A B1 B2 C D E squares) (and mpuz-solve-when-trivial @@ -294,7 +274,7 @@ "The general picture of the puzzle screen, as a string.") (defun mpuz-create-buffer () - "Create (or recreate) the puzzle buffer. Return it." + "Create (or recreate) the puzzle buffer. Return it." (let ((buf (get-buffer-create "*Mult Puzzle*")) (face '(face mpuz-text)) buffer-read-only) === modified file 'lisp/textmodes/page.el' --- lisp/textmodes/page.el 2011-01-25 04:08:28 +0000 +++ lisp/textmodes/page.el 2011-04-23 03:07:16 +0000 @@ -156,9 +156,9 @@ (if (= (match-beginning 0) (match-end 0)) (forward-char 1)) (setq count (1+ count))) - (message "Page %d, line %d" - count - (1+ (count-lines (point) opoint))))))) + (message "Page %d, line %d" count (line-number-at-pos opoint)))))) + + ;;; Place `provide' at end of file. (provide 'page) === modified file 'src/ChangeLog' --- src/ChangeLog 2011-04-19 10:48:30 +0000 +++ src/ChangeLog 2011-04-23 03:07:16 +0000 @@ -1,3 +1,21 @@ +2011-04-23 Eli Zaretskii + + * s/ms-w32.h (localtime): Redirect to sys_localtime. + + * w32.c: Include . + (sys_localtime): New function. + +2011-04-23 Chong Yidong + + * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451). + + * buffer.c (syms_of_buffer): Doc fix (Bug#6902). + +2011-04-23 Samuel Thibault (tiny change) + + * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on + zombies (Bug#8467). + 2011-04-19 Eli Zaretskii * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of === modified file 'src/buffer.c' --- src/buffer.c 2011-04-14 19:34:42 +0000 +++ src/buffer.c 2011-04-23 03:07:16 +0000 @@ -5551,7 +5551,8 @@ DEFVAR_PER_BUFFER ("tab-width", &BVAR (current_buffer, tab_width), make_number (LISP_INT_TAG), - doc: /* *Distance between tab stops (for display of tab characters), in columns. */); + doc: /* *Distance between tab stops (for display of tab characters), in columns. +This should be an integer greater than zero. */); DEFVAR_PER_BUFFER ("ctl-arrow", &BVAR (current_buffer, ctl_arrow), Qnil, doc: /* *Non-nil means display control chars with uparrow. === modified file 'src/dispextern.h' --- src/dispextern.h 2011-04-17 18:40:55 +0000 +++ src/dispextern.h 2011-04-23 03:07:16 +0000 @@ -62,7 +62,7 @@ #ifdef HAVE_NS #include "nsgui.h" -/* following typedef needed to accomodate the MSDOS port, believe it or not */ +/* Following typedef needed to accommodate the MSDOS port, believe it or not. */ typedef struct ns_display_info Display_Info; typedef Pixmap XImagePtr; typedef XImagePtr XImagePtr_or_DC; === modified file 'src/msdos.c' --- src/msdos.c 2011-04-06 17:49:21 +0000 +++ src/msdos.c 2011-04-23 03:07:16 +0000 @@ -842,7 +842,7 @@ /* According to RBIL (INTERRUP.A, V-1000), 160 is the maximum possible width of a DOS display in any known text mode. We multiply by 2 to - accomodate the screen attribute byte. */ + accommodate the screen attribute byte. */ #define MAX_SCREEN_BUF 160*2 extern unsigned char *encode_terminal_code (struct glyph *, int, === modified file 'src/s/ms-w32.h' --- src/s/ms-w32.h 2011-02-16 18:47:21 +0000 +++ src/s/ms-w32.h 2011-04-23 03:07:16 +0000 @@ -204,6 +204,7 @@ #define dup2 sys_dup2 #define fopen sys_fopen #define link sys_link +#define localtime sys_localtime #define mkdir sys_mkdir #undef mktemp #define mktemp sys_mktemp === modified file 'src/sysdep.c' --- src/sysdep.c 2011-04-16 21:26:33 +0000 +++ src/sysdep.c 2011-04-23 03:07:16 +0000 @@ -304,7 +304,7 @@ { while (1) { -#if defined (BSD_SYSTEM) || defined (HPUX) +#if (defined (BSD_SYSTEM) || defined (HPUX)) && !defined(__GNU__) /* Note that kill returns -1 even if the process is just a zombie now. But inevitably a SIGCHLD interrupt should be generated and child_sig will do wait3 and make the process go away. */ === modified file 'src/w32.c' --- src/w32.c 2011-04-06 16:05:49 +0000 +++ src/w32.c 2011-04-23 03:07:16 +0000 @@ -34,6 +34,7 @@ #include /* for _mbspbrk */ #include #include +#include /* must include CRT headers *before* config.h */ @@ -62,6 +63,8 @@ #undef strerror +#undef localtime + #include "lisp.h" #include @@ -1942,6 +1945,12 @@ tv->tv_sec = tb.time; tv->tv_usec = tb.millitm * 1000L; + /* Implementation note: _ftime sometimes doesn't update the dstflag + according to the new timezone when the system timezone is + changed. We could fix that by using GetSystemTime and + GetTimeZoneInformation, but that doesn't seem necessary, since + Emacs always calls gettimeofday with the 2nd argument NULL (see + EMACS_GET_TIME). */ if (tz) { tz->tz_minuteswest = tb.timezone; /* minutes west of Greenwich */ @@ -5678,6 +5687,19 @@ return nchars; } +/* The Windows CRT functions are "optimized for speed", so they don't + check for timezone and DST changes if they were last called less + than 1 minute ago (see http://support.microsoft.com/kb/821231). So + all Emacs features that repeatedly call time functions (e.g., + display-time) are in real danger of missing timezone and DST + changes. Calling tzset before each localtime call fixes that. */ +struct tm * +sys_localtime (const time_t *t) +{ + tzset (); + return localtime (t); +} + static void check_windows_init_file (void) { === modified file 'src/xdisp.c' --- src/xdisp.c 2011-04-18 23:21:31 +0000 +++ src/xdisp.c 2011-04-23 03:07:16 +0000 @@ -26997,6 +26997,7 @@ mini_w = XWINDOW (minibuf_window); root_window = FRAME_ROOT_WINDOW (XFRAME (WINDOW_FRAME (mini_w))); + echo_area_window = minibuf_window; if (!noninteractive) { ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.