Now on revision 111962. 1 tag(s) updated. ------------------------------------------------------------ revno: 111962 committer: Paul Eggert branch nick: trunk timestamp: Wed 2013-03-06 23:28:51 -0800 message: Specify utf-8, not iso-8859-1, for ASCII files. diff: === modified file 'doc/misc/emacs-mime.texi' --- doc/misc/emacs-mime.texi 2013-03-04 08:45:03 +0000 +++ doc/misc/emacs-mime.texi 2013-03-07 07:28:51 +0000 @@ -1890,5 +1890,5 @@ @c Local Variables: @c mode: texinfo -@c coding: iso-8859-1 +@c coding: utf-8 @c End: === modified file 'doc/misc/gnus-coding.texi' --- doc/misc/gnus-coding.texi 2013-01-01 09:11:05 +0000 +++ doc/misc/gnus-coding.texi 2013-03-07 07:28:51 +0000 @@ -387,5 +387,5 @@ @c Local Variables: @c mode: texinfo -@c coding: iso-8859-1 +@c coding: utf-8 @c End: === modified file 'lisp/gnus/gnus-cite.el' --- lisp/gnus/gnus-cite.el 2013-01-02 16:13:04 +0000 +++ lisp/gnus/gnus-cite.el 2013-03-07 07:28:51 +0000 @@ -1250,7 +1250,7 @@ (provide 'gnus-cite) ;; Local Variables: -;; coding: iso-8859-1 +;; coding: utf-8 ;; End: ;;; gnus-cite.el ends here === modified file 'lisp/ibuffer.el' --- lisp/ibuffer.el 2013-01-02 16:13:04 +0000 +++ lisp/ibuffer.el 2013-03-07 07:28:51 +0000 @@ -3030,7 +3030,7 @@ (run-hooks 'ibuffer-load-hook) ;; Local Variables: -;; coding: iso-8859-1 +;; coding: utf-8 ;; End: ;;; ibuffer.el ends here ------------------------------------------------------------ revno: 111961 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-03-06 23:03:18 -0800 message: Mention checking autotools when testing tarfile. diff: === modified file 'admin/make-tarball.txt' --- admin/make-tarball.txt 2013-03-05 17:13:01 +0000 +++ admin/make-tarball.txt 2013-03-07 07:03:18 +0000 @@ -77,7 +77,8 @@ compile-NEW.log and compare it against an old one. The easiest way to do that is to visit the old log in Emacs, change the version number of the old Emacs to __, do the same with the new log and do - M-x ediff. Especially check that Info files aren't built. + M-x ediff. Especially check that Info files aren't built, and that + no autotools (autoconf etc) run. 9. cd EMACS_ROOT_DIR && bzr tag TAG TAG is emacs-XX.Y.ZZ for a pretest, emacs-XX.Y for a release. ------------------------------------------------------------ revno: 111960 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2013-03-07 08:42:59 +0400 message: Avoid character to byte conversions in motion subroutines. * indent.h (compute_motion, vmotion): Add byte position argument. * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE. Add eassert. (Fcompute_motion): Break long line. Adjust call to compute_motion. Use list5 for return value. (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE. Adjust comments, style and calls to compute_motion. (Fvertical_motion): Adjust call to vmotion. * window.c (Fdelete_other_windows_internal): Record window start byte position and adjust call to vmotion. (window_scroll_line_based): Likewise with call to compute_motion. Use SET_PT_BOTH. (Frecenter): Adjust calls to vmotion. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-07 03:01:17 +0000 +++ src/ChangeLog 2013-03-07 04:42:59 +0000 @@ -1,5 +1,22 @@ 2013-03-07 Dmitry Antipov + Avoid character to byte conversions in motion subroutines. + * indent.h (compute_motion, vmotion): Add byte position argument. + * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE. + Add eassert. + (Fcompute_motion): Break long line. Adjust call to compute_motion. + Use list5 for return value. + (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE. + Adjust comments, style and calls to compute_motion. + (Fvertical_motion): Adjust call to vmotion. + * window.c (Fdelete_other_windows_internal): Record window start + byte position and adjust call to vmotion. + (window_scroll_line_based): Likewise with call to compute_motion. + Use SET_PT_BOTH. + (Frecenter): Adjust calls to vmotion. + +2013-03-07 Dmitry Antipov + * lisp.h (list2i, list3i): New functions. (list4i): Move from window.c and make LISP_INLINE. * editfns.c (make_lisp_time): === modified file 'src/indent.c' --- src/indent.c 2013-03-06 16:35:23 +0000 +++ src/indent.c 2013-03-07 04:42:59 +0000 @@ -1102,8 +1102,8 @@ the scroll bars if they are turned on. */ struct position * -compute_motion (ptrdiff_t from, EMACS_INT fromvpos, EMACS_INT fromhpos, - bool did_motion, ptrdiff_t to, +compute_motion (ptrdiff_t from, ptrdiff_t frombyte, EMACS_INT fromvpos, + EMACS_INT fromhpos, bool did_motion, ptrdiff_t to, EMACS_INT tovpos, EMACS_INT tohpos, EMACS_INT width, ptrdiff_t hscroll, int tab_offset, struct window *win) { @@ -1186,8 +1186,11 @@ immediate_quit = 1; QUIT; + /* It's just impossible to be too paranoid here. */ + eassert (from == BYTE_TO_CHAR (frombyte) && frombyte == CHAR_TO_BYTE (from)); + pos = prev_pos = from; - pos_byte = prev_pos_byte = CHAR_TO_BYTE (from); + pos_byte = prev_pos_byte = frombyte; contin_hpos = 0; prev_tab_offset = tab_offset; memset (&cmp_it, 0, sizeof cmp_it); @@ -1724,7 +1727,8 @@ and the window's upper-left coordinates as FROMPOS. Pass the buffer's (point-max) as TO, to limit the scan to the end of the visible section of the buffer, and pass LINE and COL as TOPOS. */) - (Lisp_Object from, Lisp_Object frompos, Lisp_Object to, Lisp_Object topos, Lisp_Object width, Lisp_Object offsets, Lisp_Object window) + (Lisp_Object from, Lisp_Object frompos, Lisp_Object to, Lisp_Object topos, + Lisp_Object width, Lisp_Object offsets, Lisp_Object window) { struct window *w; Lisp_Object bufpos, hpos, vpos, prevhpos; @@ -1767,7 +1771,8 @@ if (XINT (to) < BEGV || XINT (to) > ZV) args_out_of_range_3 (to, make_number (BEGV), make_number (ZV)); - pos = compute_motion (XINT (from), XINT (XCDR (frompos)), + pos = compute_motion (XINT (from), CHAR_TO_BYTE (XINT (from)), + XINT (XCDR (frompos)), XINT (XCAR (frompos)), 0, XINT (to), (NILP (topos) @@ -1789,28 +1794,23 @@ XSETINT (vpos, pos->vpos); XSETINT (prevhpos, pos->prevhpos); - return Fcons (bufpos, - Fcons (hpos, - Fcons (vpos, - Fcons (prevhpos, - Fcons (pos->contin ? Qt : Qnil, Qnil))))); - + return list5 (bufpos, hpos, vpos, prevhpos, pos->contin ? Qt : Qnil); } - -/* Fvertical_motion and vmotion */ + +/* Fvertical_motion and vmotion. */ static struct position val_vmotion; struct position * -vmotion (register ptrdiff_t from, register EMACS_INT vtarget, struct window *w) +vmotion (register ptrdiff_t from, register ptrdiff_t from_byte, + register EMACS_INT vtarget, struct window *w) { ptrdiff_t hscroll = w->hscroll; struct position pos; - /* vpos is cumulative vertical position, changed as from is changed */ + /* VPOS is cumulative vertical position, changed as from is changed. */ register EMACS_INT vpos = 0; ptrdiff_t prevline; register ptrdiff_t first; - ptrdiff_t from_byte; ptrdiff_t lmargin = hscroll > 0 ? 1 - hscroll : 0; ptrdiff_t selective = (INTEGERP (BVAR (current_buffer, selective_display)) @@ -1854,29 +1854,24 @@ text_prop_object), TEXT_PROP_MEANS_INVISIBLE (propval)))) prevline = find_newline_no_quit (prevline - 1, -1, &bytepos); - pos = *compute_motion (prevline, 0, - lmargin, - 0, - from, + pos = *compute_motion (prevline, bytepos, 0, lmargin, 0, from, /* Don't care for VPOS... */ 1 << (BITS_PER_SHORT - 1), /* ... nor HPOS. */ 1 << (BITS_PER_SHORT - 1), - -1, hscroll, - 0, - w); + -1, hscroll, 0, w); vpos -= pos.vpos; first = 0; from = prevline; + from_byte = bytepos; } - /* If we made exactly the desired vertical distance, - or if we hit beginning of buffer, - return point found */ + /* If we made exactly the desired vertical distance, or + if we hit beginning of buffer, return point found. */ if (vpos >= vtarget) { val_vmotion.bufpos = from; - val_vmotion.bytepos = CHAR_TO_BYTE (from); + val_vmotion.bytepos = from_byte; val_vmotion.vpos = vpos; val_vmotion.hpos = lmargin; val_vmotion.contin = 0; @@ -1884,11 +1879,12 @@ return &val_vmotion; } - /* Otherwise find the correct spot by moving down */ + /* Otherwise find the correct spot by moving down. */ } - /* Moving downward is simple, but must calculate from beg of line - to determine hpos of starting point */ - from_byte = CHAR_TO_BYTE (from); + + /* Moving downward is simple, but must calculate from + beg of line to determine hpos of starting point. */ + if (from > BEGV && FETCH_BYTE (from_byte - 1) != '\n') { ptrdiff_t bytepos; @@ -1905,17 +1901,12 @@ text_prop_object), TEXT_PROP_MEANS_INVISIBLE (propval)))) prevline = find_newline_no_quit (prevline - 1, -1, &bytepos); - pos = *compute_motion (prevline, 0, - lmargin, - 0, - from, + pos = *compute_motion (prevline, bytepos, 0, lmargin, 0, from, /* Don't care for VPOS... */ 1 << (BITS_PER_SHORT - 1), /* ... nor HPOS. */ 1 << (BITS_PER_SHORT - 1), - -1, hscroll, - 0, - w); + -1, hscroll, 0, w); did_motion = 1; } else @@ -1924,11 +1915,9 @@ pos.vpos = 0; did_motion = 0; } - return compute_motion (from, vpos, pos.hpos, did_motion, + return compute_motion (from, from_byte, vpos, pos.hpos, did_motion, ZV, vtarget, - (1 << (BITS_PER_SHORT - 1)), - -1, hscroll, - 0, - w); + -1, hscroll, 0, w); } DEFUN ("vertical-motion", Fvertical_motion, Svertical_motion, 1, 2, 0, @@ -1995,7 +1984,7 @@ if (noninteractive) { struct position pos; - pos = *vmotion (PT, XINT (lines), w); + pos = *vmotion (PT, PT_BYTE, XINT (lines), w); SET_PT_BOTH (pos.bufpos, pos.bytepos); } else === modified file 'src/indent.h' --- src/indent.h 2013-01-01 09:11:05 +0000 +++ src/indent.h 2013-03-07 04:42:59 +0000 @@ -26,14 +26,14 @@ int contin; }; -struct position *compute_motion (ptrdiff_t from, EMACS_INT fromvpos, - EMACS_INT fromhpos, bool did_motion, - ptrdiff_t to, EMACS_INT tovpos, - EMACS_INT tohpos, +struct position *compute_motion (ptrdiff_t from, ptrdiff_t frombyte, + EMACS_INT fromvpos, EMACS_INT fromhpos, + bool did_motion, ptrdiff_t to, + EMACS_INT tovpos, EMACS_INT tohpos, EMACS_INT width, ptrdiff_t hscroll, int tab_offset, struct window *); -struct position *vmotion (ptrdiff_t from, EMACS_INT vtarget, - struct window *); +struct position *vmotion (ptrdiff_t from, ptrdiff_t from_byte, + EMACS_INT vtarget, struct window *); ptrdiff_t skip_invisible (ptrdiff_t pos, ptrdiff_t *next_boundary_p, ptrdiff_t to, Lisp_Object window); === modified file 'src/window.c' --- src/window.c 2013-03-07 03:01:17 +0000 +++ src/window.c 2013-03-07 04:42:59 +0000 @@ -2743,7 +2743,7 @@ struct window *w, *r, *s; struct frame *f; Lisp_Object sibling, pwindow, swindow IF_LINT (= Qnil), delta; - ptrdiff_t startpos IF_LINT (= 0); + ptrdiff_t startpos IF_LINT (= 0), startbyte IF_LINT (= 0); int top IF_LINT (= 0), new_top, resize_failed; w = decode_valid_window (window); @@ -2782,6 +2782,7 @@ if (!NILP (w->buffer)) { startpos = marker_position (w->start); + startbyte = marker_byte_position (w->start); top = WINDOW_TOP_EDGE_LINE (w) - FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w))); /* Make sure WINDOW is the frame's selected window. */ @@ -2951,7 +2952,7 @@ Fset_buffer (w->buffer); /* This computation used to temporarily move point, but that can have unwanted side effects due to text properties. */ - pos = *vmotion (startpos, -top, w); + pos = *vmotion (startpos, startbyte, -top, w); set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos); w->window_end_valid = 0; @@ -4748,7 +4749,8 @@ register Lisp_Object tem; int lose; Lisp_Object bolp; - ptrdiff_t startpos; + ptrdiff_t startpos = marker_position (w->start); + ptrdiff_t startbyte = marker_byte_position (w->start); Lisp_Object original_pos = Qnil; /* If scrolling screen-fulls, compute the number of lines to @@ -4756,8 +4758,6 @@ if (whole) n *= max (1, ht - next_screen_context_lines); - startpos = marker_position (w->start); - if (!NILP (Vscroll_preserve_screen_position)) { if (window_scroll_preserve_vpos <= 0 @@ -4765,10 +4765,8 @@ || NILP (Fget (KVAR (current_kboard, Vlast_command), Qscroll_command))) { struct position posit - = *compute_motion (startpos, 0, 0, 0, - PT, ht, 0, - -1, w->hscroll, - 0, w); + = *compute_motion (startpos, startbyte, 0, 0, 0, + PT, ht, 0, -1, w->hscroll, 0, w); window_scroll_preserve_vpos = posit.vpos; window_scroll_preserve_hpos = posit.hpos + w->hscroll; } @@ -4784,9 +4782,10 @@ { Fvertical_motion (make_number (- (ht / 2)), window); startpos = PT; + startbyte = PT_BYTE; } - SET_PT (startpos); + SET_PT_BOTH (startpos, startbyte); lose = n < 0 && PT == BEGV; Fvertical_motion (make_number (n), window); pos = PT; @@ -5321,7 +5320,7 @@ iarg = max (iarg, this_scroll_margin); - pos = *vmotion (PT, -iarg, w); + pos = *vmotion (PT, PT_BYTE, -iarg, w); charpos = pos.bufpos; bytepos = pos.bytepos; } @@ -5340,7 +5339,7 @@ iarg = clip_to_bounds (this_scroll_margin, iarg, ht - this_scroll_margin - 1); - pos = *vmotion (PT, - iarg, w); + pos = *vmotion (PT, PT_BYTE, - iarg, w); charpos = pos.bufpos; bytepos = pos.bytepos; } ------------------------------------------------------------ revno: 111959 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2013-03-07 07:01:17 +0400 message: * lisp.h (list2i, list3i): New functions. (list4i): Move from window.c and make LISP_INLINE. * editfns.c (make_lisp_time): * fns.c (Flocale_info): * keyboard.c (parse_modifiers): * xterm.c (x_ewmh_activate_frame): Use list2i. * instel.c (signal_after_change): * nsfns.m (Fx_server_version, Fxw_color_values): * w32fns.c (Fxw_color_values, Fx_server_version): * xfns.c (Fxw_color_values, Fx_server_version): Use list3i. * fileio.c (Fvisited_file_modtime): * nsfns.m (Fns_display_usable_bounds): * w32.c (ltime): Use list4i. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-06 16:35:23 +0000 +++ src/ChangeLog 2013-03-07 03:01:17 +0000 @@ -1,3 +1,19 @@ +2013-03-07 Dmitry Antipov + + * lisp.h (list2i, list3i): New functions. + (list4i): Move from window.c and make LISP_INLINE. + * editfns.c (make_lisp_time): + * fns.c (Flocale_info): + * keyboard.c (parse_modifiers): + * xterm.c (x_ewmh_activate_frame): Use list2i. + * instel.c (signal_after_change): + * nsfns.m (Fx_server_version, Fxw_color_values): + * w32fns.c (Fxw_color_values, Fx_server_version): + * xfns.c (Fxw_color_values, Fx_server_version): Use list3i. + * fileio.c (Fvisited_file_modtime): + * nsfns.m (Fns_display_usable_bounds): + * w32.c (ltime): Use list4i. + 2013-03-06 Eli Zaretskii * search.c (find_newline_no_quit): Rename from find_next_newline. === modified file 'src/editfns.c' --- src/editfns.c 2013-02-20 05:18:20 +0000 +++ src/editfns.c 2013-03-07 03:01:17 +0000 @@ -1484,9 +1484,7 @@ make_lisp_time (EMACS_TIME t) { int ns = EMACS_NSECS (t); - return make_time_tail (EMACS_SECS (t), - list2 (make_number (ns / 1000), - make_number (ns % 1000 * 1000))); + return make_time_tail (EMACS_SECS (t), list2i (ns / 1000, ns % 1000 * 1000)); } /* Decode a Lisp list SPECIFIED_TIME that represents a time. === modified file 'src/fileio.c' --- src/fileio.c 2013-02-11 23:37:18 +0000 +++ src/fileio.c 2013-03-07 03:01:17 +0000 @@ -5413,8 +5413,7 @@ if (EMACS_NSECS (current_buffer->modtime) == NONEXISTENT_MODTIME_NSECS) { /* make_lisp_time won't work here if time_t is unsigned. */ - return list4 (make_number (-1), make_number (65535), - make_number (0), make_number (0)); + return list4i (-1, 65535, 0, 0); } return make_number (0); } === modified file 'src/fns.c' --- src/fns.c 2013-02-17 16:49:27 +0000 +++ src/fns.c 2013-03-07 03:01:17 +0000 @@ -2839,10 +2839,7 @@ but is in the locale files. This could be used by ps-print. */ #ifdef PAPER_WIDTH else if (EQ (item, Qpaper)) - { - return list2 (make_number (nl_langinfo (PAPER_WIDTH)), - make_number (nl_langinfo (PAPER_HEIGHT))); - } + return list2i (nl_langinfo (PAPER_WIDTH), nl_langinfo (PAPER_HEIGHT)); #endif /* PAPER_WIDTH */ #endif /* HAVE_LANGINFO_CODESET*/ return Qnil; === modified file 'src/insdel.c' --- src/insdel.c 2013-01-25 17:13:31 +0000 +++ src/insdel.c 2013-03-07 03:01:17 +0000 @@ -2013,9 +2013,8 @@ && current_buffer != XBUFFER (combine_after_change_buffer)) Fcombine_after_change_execute (); - elt = Fcons (make_number (charpos - BEG), - Fcons (make_number (Z - (charpos - lendel + lenins)), - Fcons (make_number (lenins - lendel), Qnil))); + elt = list3i (charpos - BEG, Z - (charpos - lendel + lenins), + lenins - lendel); combine_after_change_list = Fcons (elt, combine_after_change_list); combine_after_change_buffer = Fcurrent_buffer (); === modified file 'src/keyboard.c' --- src/keyboard.c 2013-02-20 16:37:06 +0000 +++ src/keyboard.c 2013-03-07 03:01:17 +0000 @@ -6225,9 +6225,7 @@ Lisp_Object elements; if (INTEGERP (symbol)) - return (Fcons (make_number (KEY_TO_CHAR (symbol)), - Fcons (make_number (XINT (symbol) & CHAR_MODIFIER_MASK), - Qnil))); + return list2i (KEY_TO_CHAR (symbol), XINT (symbol) & CHAR_MODIFIER_MASK); else if (!SYMBOLP (symbol)) return Qnil; === modified file 'src/lisp.h' --- src/lisp.h 2013-03-06 16:35:23 +0000 +++ src/lisp.h 2013-03-07 03:01:17 +0000 @@ -3001,6 +3001,28 @@ Lisp_Object); enum constype {CONSTYPE_HEAP, CONSTYPE_PURE}; extern Lisp_Object listn (enum constype, ptrdiff_t, Lisp_Object, ...); + +/* Build a frequently used 2/3/4-integer lists. */ + +LISP_INLINE Lisp_Object +list2i (EMACS_INT x, EMACS_INT y) +{ + return list2 (make_number (x), make_number (y)); +} + +LISP_INLINE Lisp_Object +list3i (EMACS_INT x, EMACS_INT y, EMACS_INT w) +{ + return list3 (make_number (x), make_number (y), make_number (w)); +} + +LISP_INLINE Lisp_Object +list4i (EMACS_INT x, EMACS_INT y, EMACS_INT w, EMACS_INT h) +{ + return list4 (make_number (x), make_number (y), + make_number (w), make_number (h)); +} + extern _Noreturn void string_overflow (void); extern Lisp_Object make_string (const char *, ptrdiff_t); extern Lisp_Object make_formatted_string (char *, const char *, ...) === modified file 'src/nsfns.m' --- src/nsfns.m 2013-01-09 08:17:47 +0000 +++ src/nsfns.m 2013-03-07 03:01:17 +0000 @@ -1649,9 +1649,7 @@ The last number is where we distinguish between the Apple and GNUstep implementations ("distributor-specific release number") and give int'ized versions of major.minor. */ - return Fcons (make_number (10), - Fcons (make_number (3), - Fcons (make_number (ns_appkit_version_int()), Qnil))); + return list3i (10, 3, ns_appkit_version_int ()); } @@ -2296,9 +2294,8 @@ [[col colorUsingColorSpaceName: NSCalibratedRGBColorSpace] getRed: &red green: &green blue: &blue alpha: &alpha]; - return list3 (make_number (lrint (red*65280)), - make_number (lrint (green*65280)), - make_number (lrint (blue*65280))); + return list3i (lrint (red * 65280), lrint (green * 65280), + lrint (blue * 65280)); } @@ -2385,11 +2382,10 @@ /* NS coordinate system is upside-down. Transform to screen-specific coordinates. */ - return list4 (make_number ((int) vScreen.origin.x), - make_number ((int) [screen frame].size.height - - vScreen.size.height - vScreen.origin.y), - make_number ((int) vScreen.size.width), - make_number ((int) vScreen.size.height)); + return list4i (vScreen.origin.x, + [screen frame].size.height + - vScreen.size.height - vScreen.origin.y, + vScreen.size.width, vScreen.size.height); } === modified file 'src/w32.c' --- src/w32.c 2013-03-05 22:35:41 +0000 +++ src/w32.c 2013-03-07 03:01:17 +0000 @@ -5580,10 +5580,8 @@ { ULONGLONG time_sec = time_100ns / 10000000; int subsec = time_100ns % 10000000; - return list4 (make_number (time_sec >> 16), - make_number (time_sec & 0xffff), - make_number (subsec / 10), - make_number (subsec % 10 * 100000)); + return list4i (time_sec >> 16, time_sec & 0xffff, + subsec / 10, subsec % 10 * 100000); } #define U64_TO_LISP_TIME(time) ltime (time) === modified file 'src/w32fns.c' --- src/w32fns.c 2013-02-07 16:09:04 +0000 +++ src/w32fns.c 2013-03-07 03:01:17 +0000 @@ -4587,12 +4587,9 @@ CHECK_STRING (color); if (w32_defined_color (f, SDATA (color), &foo, 0)) - return list3 (make_number ((GetRValue (foo.pixel) << 8) - | GetRValue (foo.pixel)), - make_number ((GetGValue (foo.pixel) << 8) - | GetGValue (foo.pixel)), - make_number ((GetBValue (foo.pixel) << 8) - | GetBValue (foo.pixel))); + return list3i ((GetRValue (foo.pixel) << 8) | GetRValue (foo.pixel), + (GetGValue (foo.pixel) << 8) | GetGValue (foo.pixel), + (GetBValue (foo.pixel) << 8) | GetBValue (foo.pixel)); else return Qnil; } @@ -4718,9 +4715,7 @@ If omitted or nil, that stands for the selected frame's display. */) (Lisp_Object display) { - return Fcons (make_number (w32_major_version), - Fcons (make_number (w32_minor_version), - Fcons (make_number (w32_build_number), Qnil))); + return list3i (w32_major_version, w32_minor_version, w32_build_number); } DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0, === modified file 'src/window.c' --- src/window.c 2013-02-26 14:28:37 +0000 +++ src/window.c 2013-03-07 03:01:17 +0000 @@ -300,15 +300,6 @@ adjust_window_count (w, 1); } -/* Build a frequently used 4-integer (X Y W H) list. */ - -static Lisp_Object -list4i (EMACS_INT x, EMACS_INT y, EMACS_INT w, EMACS_INT h) -{ - return list4 (make_number (x), make_number (y), - make_number (w), make_number (h)); -} - DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0, doc: /* Return t if OBJECT is a window and nil otherwise. */) (Lisp_Object object) === modified file 'src/xfns.c' --- src/xfns.c 2013-01-17 06:29:40 +0000 +++ src/xfns.c 2013-03-07 03:01:17 +0000 @@ -3539,9 +3539,7 @@ CHECK_STRING (color); if (x_defined_color (f, SSDATA (color), &foo, 0)) - return list3 (make_number (foo.red), - make_number (foo.green), - make_number (foo.blue)); + return list3i (foo.red, foo.green, foo.blue); else return Qnil; } @@ -3703,9 +3701,8 @@ struct x_display_info *dpyinfo = check_x_display_info (terminal); Display *dpy = dpyinfo->display; - return Fcons (make_number (ProtocolVersion (dpy)), - Fcons (make_number (ProtocolRevision (dpy)), - Fcons (make_number (VendorRelease (dpy)), Qnil))); + return list3i (ProtocolVersion (dpy), ProtocolRevision (dpy), + VendorRelease (dpy)); } DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0, === modified file 'src/xterm.c' --- src/xterm.c 2013-02-17 10:41:33 +0000 +++ src/xterm.c 2013-03-07 03:01:17 +0000 @@ -8951,10 +8951,7 @@ XSETFRAME (frame, f); x_send_client_event (frame, make_number (0), frame, dpyinfo->Xatom_net_active_window, - make_number (32), - Fcons (make_number (1), - Fcons (make_number (last_user_time), - Qnil))); + make_number (32), list2i (1, last_user_time)); } } ------------------------------------------------------------ revno: 111958 fixes bug: http://debbugs.gnu.org/13885 committer: Dmitry Gutov branch nick: trunk timestamp: Wed 2013-03-06 22:56:29 +0400 message: * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function): Only propertize regexp when not inside a string. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-03-06 14:24:39 +0000 +++ lisp/ChangeLog 2013-03-06 18:56:29 +0000 @@ -1,3 +1,8 @@ +2013-03-06 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-syntax-propertize-function): Only + propertize regexp when not inside a string (Bug#13885). + 2013-03-06 Alan Mackenzie Correct the position of point in some line-up functions. === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2013-02-14 05:45:33 +0000 +++ lisp/progmodes/ruby-mode.el 2013-03-06 18:56:29 +0000 @@ -1276,8 +1276,10 @@ "\\)\\s *" ;; The regular expression itself. "\\(/\\)[^/\n\\\\]*\\(?:\\\\.[^/\n\\\\]*\\)*\\(/\\)") - (2 (string-to-syntax "\"/")) - (3 (string-to-syntax "\"/"))) + (3 (unless (nth 3 (syntax-ppss (match-beginning 2))) + (put-text-property (match-beginning 2) (match-end 2) + 'syntax-table (string-to-syntax "\"/")) + (string-to-syntax "\"/")))) ("^=en\\(d\\)\\_>" (1 "!")) ("^\\(=\\)begin\\_>" (1 "!")) ;; Handle here documents. === modified file 'test/automated/ruby-mode-tests.el' --- test/automated/ruby-mode-tests.el 2013-02-14 05:45:33 +0000 +++ test/automated/ruby-mode-tests.el 2013-03-06 18:56:29 +0000 @@ -47,17 +47,16 @@ (defun ruby-test-string (s &rest args) (apply 'format (replace-regexp-in-string "^[ \t]*|" "" s) args)) -(defun ruby-assert-state (content &rest values-plist) +(defun ruby-assert-state (content index value &optional point) "Assert syntax state values at the end of CONTENT. VALUES-PLIST is a list with alternating index and value elements." (ruby-with-temp-buffer content + (when point (goto-char point)) (syntax-propertize (point)) - (while values-plist - (should (eq (nth (car values-plist) - (parse-partial-sexp (point-min) (point))) - (cadr values-plist))) - (setq values-plist (cddr values-plist))))) + (should (eq (nth index + (parse-partial-sexp (point-min) (point))) + value)))) (defun ruby-assert-face (content pos face) (ruby-with-temp-buffer content @@ -104,6 +103,12 @@ (ruby-should-indent "a = %w[abc\n def]\n " 0) (ruby-should-indent "a = \"abc\n def\"\n " 0)) +(ert-deftest ruby-regexp-doest-start-in-string () + (ruby-assert-state "'(/', /\d+/" 3 nil)) + +(ert-deftest ruby-regexp-starts-after-string () + (ruby-assert-state "'(/', /\d+/" 3 ?/ 8)) + (ert-deftest ruby-indent-simple () (ruby-should-indent-buffer "if foo ------------------------------------------------------------ revno: 111957 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2013-03-06 18:35:23 +0200 message: Rename find_next_newline to find_newline_no_quit. src/search.c (find_newline_no_quit): Rename from find_next_newline. Add commentary. src/lisp.h (find_newline_no_quit): Rename prototype. src/xdisp.c (back_to_previous_line_start) (forward_to_next_line_start, get_visually_first_element) (move_it_vertically_backward): Callers of find_newline_no_quit changed. src/indent.c (vmotion): Callers of find_newline_no_quit changed. src/bidi.c (bidi_find_paragraph_start): Callers of find_newline_no_quit changed. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-06 16:21:26 +0000 +++ src/ChangeLog 2013-03-06 16:35:23 +0000 @@ -1,5 +1,17 @@ 2013-03-06 Eli Zaretskii + * search.c (find_newline_no_quit): Rename from find_next_newline. + Add commentary. + + * lisp.h (find_newline_no_quit): Rename prototype. + + * xdisp.c (back_to_previous_line_start) + (forward_to_next_line_start, get_visually_first_element) + (move_it_vertically_backward): Callers of find_newline_no_quit changed. + * indent.c (vmotion): Callers of find_newline_no_quit changed. + * bidi.c (bidi_find_paragraph_start): Callers of + find_newline_no_quit changed. + * msdos.c: Change encoding to cp850. (Bug#13879) (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts. === modified file 'src/bidi.c' --- src/bidi.c 2013-03-05 23:08:11 +0000 +++ src/bidi.c 2013-03-06 16:35:23 +0000 @@ -1108,7 +1108,7 @@ display string? And what if a display string covering some of the text over which we scan back includes paragraph_start_re? */ - pos = find_next_newline (pos - 1, -1, &pos_byte); + pos = find_newline_no_quit (pos - 1, -1, &pos_byte); if (n >= MAX_PARAGRAPH_SEARCH) pos_byte = BEGV_BYTE; return pos_byte; === modified file 'src/indent.c' --- src/indent.c 2013-03-05 23:08:11 +0000 +++ src/indent.c 2013-03-06 16:35:23 +0000 @@ -1843,7 +1843,7 @@ ptrdiff_t bytepos; Lisp_Object propval; - prevline = find_next_newline (from - 1, -1, &bytepos); + prevline = find_newline_no_quit (from - 1, -1, &bytepos); while (prevline > BEGV && ((selective > 0 && indented_beyond_p (prevline, bytepos, selective)) @@ -1853,7 +1853,7 @@ Qinvisible, text_prop_object), TEXT_PROP_MEANS_INVISIBLE (propval)))) - prevline = find_next_newline (prevline - 1, -1, &bytepos); + prevline = find_newline_no_quit (prevline - 1, -1, &bytepos); pos = *compute_motion (prevline, 0, lmargin, 0, @@ -1894,7 +1894,7 @@ ptrdiff_t bytepos; Lisp_Object propval; - prevline = find_next_newline (from, -1, &bytepos); + prevline = find_newline_no_quit (from, -1, &bytepos); while (prevline > BEGV && ((selective > 0 && indented_beyond_p (prevline, bytepos, selective)) @@ -1904,7 +1904,7 @@ Qinvisible, text_prop_object), TEXT_PROP_MEANS_INVISIBLE (propval)))) - prevline = find_next_newline (prevline - 1, -1, &bytepos); + prevline = find_newline_no_quit (prevline - 1, -1, &bytepos); pos = *compute_motion (prevline, 0, lmargin, 0, === modified file 'src/lisp.h' --- src/lisp.h 2013-03-05 23:08:11 +0000 +++ src/lisp.h 2013-03-06 16:35:23 +0000 @@ -3346,7 +3346,7 @@ ptrdiff_t *, ptrdiff_t *, bool); extern EMACS_INT scan_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, EMACS_INT, bool); -extern ptrdiff_t find_next_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t *); +extern ptrdiff_t find_newline_no_quit (ptrdiff_t, ptrdiff_t, ptrdiff_t *); extern ptrdiff_t find_before_next_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t *); extern void syms_of_search (void); === modified file 'src/search.c' --- src/search.c 2013-03-05 23:08:11 +0000 +++ src/search.c 2013-03-06 16:35:23 +0000 @@ -941,15 +941,17 @@ return count * direction; } +/* Like find_newline, but doesn't allow QUITting and doesn't return + SHORTAGE. */ ptrdiff_t -find_next_newline (ptrdiff_t from, ptrdiff_t cnt, ptrdiff_t *bytepos) +find_newline_no_quit (ptrdiff_t from, ptrdiff_t cnt, ptrdiff_t *bytepos) { return find_newline (from, 0, cnt, NULL, bytepos, 0); } -/* Like find_next_newline, but returns position before the newline, - not after, and only search up to TO. This isn't just - find_next_newline (...)-1, because you might hit TO. */ +/* Like find_newline, but returns position before the newline, not + after, and only search up to TO. + This isn't just find_newline_no_quit (...)-1, because you might hit TO. */ ptrdiff_t find_before_next_newline (ptrdiff_t from, ptrdiff_t to, === modified file 'src/xdisp.c' --- src/xdisp.c 2013-03-05 23:08:11 +0000 +++ src/xdisp.c 2013-03-06 16:35:23 +0000 @@ -5905,8 +5905,8 @@ static void back_to_previous_line_start (struct it *it) { - IT_CHARPOS (*it) - = find_next_newline (IT_CHARPOS (*it) - 1, -1, &IT_BYTEPOS (*it)); + IT_CHARPOS (*it) = find_newline_no_quit (IT_CHARPOS (*it) - 1, -1, + &IT_BYTEPOS (*it)); } @@ -5922,7 +5922,7 @@ Newlines may come from buffer text, overlay strings, or strings displayed via the `display' property. That's the reason we can't - simply use find_next_newline_no_quit. + simply use find_newline_no_quit. Note that this function may not skip over invisible text that is so because of text properties and immediately follows a newline. If @@ -5978,7 +5978,7 @@ if (!newline_found_p) { ptrdiff_t bytepos, start = IT_CHARPOS (*it); - ptrdiff_t limit = find_next_newline (start, 1, &bytepos); + ptrdiff_t limit = find_newline_no_quit (start, 1, &bytepos); Lisp_Object pos; eassert (!STRINGP (it->string)); @@ -7432,8 +7432,8 @@ if (string_p) it->bidi_it.charpos = it->bidi_it.bytepos = 0; else - it->bidi_it.charpos - = find_next_newline (IT_CHARPOS (*it), -1, &it->bidi_it.bytepos); + it->bidi_it.charpos = find_newline_no_quit (IT_CHARPOS (*it), -1, + &it->bidi_it.bytepos); bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 1); do { @@ -9067,8 +9067,8 @@ && IT_CHARPOS (*it) > BEGV && FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n') { - ptrdiff_t nl_pos = - find_next_newline (IT_CHARPOS (*it) - 1, -1, NULL); + ptrdiff_t nl_pos = find_newline_no_quit (IT_CHARPOS (*it) - 1, -1, + NULL); move_it_to (it, nl_pos, -1, -1, -1, MOVE_TO_POS); } ------------------------------------------------------------ revno: 111956 fixes bug: http://debbugs.gnu.org/13879 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2013-03-06 18:21:26 +0200 message: Fix bug #13879 with raw-text encoding of msdos.c. src/msdos.c: Change encoding to cp850. (Bug#13879) (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-06 11:26:30 +0000 +++ src/ChangeLog 2013-03-06 16:21:26 +0000 @@ -1,3 +1,8 @@ +2013-03-06 Eli Zaretskii + + * msdos.c: Change encoding to cp850. (Bug#13879) + (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts. + 2013-03-06 Dmitry Antipov Coding system support cleanup and minor refactoring. === modified file 'src/msdos.c' --- src/msdos.c 2013-02-17 16:49:27 +0000 +++ src/msdos.c 2013-03-06 16:21:26 +0000 @@ -1,4 +1,4 @@ -/* MS-DOS specific C utilities. -*- coding: raw-text -*- +/* MS-DOS specific C utilities. -*- coding: cp850 -*- Copyright (C) 1993-1997, 1999-2013 Free Software Foundation, Inc. @@ -20,6 +20,13 @@ /* Contributed by Morten Welinder */ /* New display, keyboard, and mouse control by Kim F. Storm */ +/* Note: This file MUST use a unibyte encoding, to both display the + keys on the non-US keyboard layout as their respective labels, and + provide the correct byte values for the keyboard input to inject + into Emacs. See 'struct dos_keyboard_map' below. As long as there + are only European keyboard layouts here, we are OK with DOS + codepage 850 encoding. */ + /* Note: some of the stuff here was taken from end of sysdep.c in demacs. */ #include @@ -1965,10 +1972,10 @@ static struct dos_keyboard_map us_keyboard = { /* 0 1 2 3 4 5 */ -/* 01234567890123456789012345678901234567890 12345678901234 */ - "`1234567890-= qwertyuiop[] asdfghjkl;'\\ zxcvbnm,./ ", +/* 01234567890123456789012345678901234567890 123 45678901234 */ + "`1234567890-= qwertyuiop[] asdfghjkl;'\\ \\zxcvbnm,./ ", /* 0123456789012345678901234567890123456789 012345678901234 */ - "~!@#$%^&*()_+ QWERTYUIOP{} ASDFGHJKL:\"| ZXCVBNM<>? ", + "~!@#$%^&*()_+ QWERTYUIOP{} ASDFGHJKL:\"| |ZXCVBNM<>? ", 0, /* no Alt-Gr key */ 0 /* no translate table */ }; @@ -1976,9 +1983,9 @@ static struct dos_keyboard_map fr_keyboard = { /* 0 1 2 3 4 5 */ /* 012 3456789012345678901234567890123456789012345678901234 */ - "&\",(-_)= azertyuiop^$ qsdfghjklm* wxcvbnm;:! ", + "&\"'(-_)= azertyuiop^$ qsdfghjklm* WXCVBN?./ ", /* 01234567 89012345678901234567890123456789012345678901234 */ " ~#{[|`\\^@]} ", 0 /* no translate table */ @@ -2000,9 +2007,9 @@ static struct dos_keyboard_map it_keyboard = { /* 0 1 2 3 4 5 */ /* 0 123456789012345678901234567890123456789012345678901234 */ - "\\1234567890'< qwertyuiop+> asdfghjkl zxcvbnm,.- ", + "\\1234567890'< qwertyuiop+> asdfghjkl QWERTYUIOP* ASDFGHJKL ZXCVBNM;:_ ", + "|!\"$%&/()=?^> QWERTYUIOP* ASDFGHJKL >ZXCVBNM;:_ ", /* 0123456789012345678901234567890123456789012345678901234 */ " {}~` [] @# ", it_kbd_translate_table @@ -2011,9 +2018,9 @@ static struct dos_keyboard_map dk_keyboard = { /* 0 1 2 3 4 5 */ /* 0123456789012345678901234567890123456789012345678901234 */ - "1234567890+| qwertyuiop~ asdfghjkl' zxcvbnm,.- ", + "1234567890+| qwertyuiop~ asdfghjkl' ZXCVBNM;:_ ", /* 0123456789012345678901234567890123456789012345678901234 */ " @$ {[]} | ", 0 /* no translate table */ ------------------------------------------------------------ revno: 111955 committer: Alan Mackenzie branch nick: trunk timestamp: Wed 2013-03-06 14:24:39 +0000 message: Correct the position of point in some line-up functions. progmodes/cc-align.el (c-lineup-whitesmith-in-block, c-lineup-assignments) (c-lineup-gcc-asm-reg ): take position of point at column 0 rather than at a random place in the line. doc/misc/cc-mode.texi (Custom Line-Up): State explicitly that point starts at a random position in the line being indented. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2013-03-04 08:45:03 +0000 +++ doc/misc/ChangeLog 2013-03-06 14:24:39 +0000 @@ -1,3 +1,8 @@ +2013-03-06 Alan Mackenzie + + * cc-mode.texi (Custom Line-Up): Clarify position of point on + calling a line-up function. + 2013-03-04 Paul Eggert * emacs-mime.texi, htmlfontify.texi, mairix-el.texi, mh-e.texi: === modified file 'doc/misc/cc-mode.texi' --- doc/misc/cc-mode.texi 2013-02-12 17:36:54 +0000 +++ doc/misc/cc-mode.texi 2013-03-06 14:24:39 +0000 @@ -6475,13 +6475,14 @@ please contact @email{bug-cc-mode@@gnu.org}. Line-up functions are passed a single argument, the syntactic -element (see below). The return value is a @code{c-offsets-alist} -offset specification: for example, an integer, a symbol such as -@code{+}, a vector, @code{nil}@footnote{Returning @code{nil} is useful -when the offset specification for a syntactic element is a list -containing the line-up function (@pxref{c-offsets-alist}).}, or even -another line-up function. Full details of these are in -@ref{c-offsets-alist}. +element (see below). At the time of the call, point will be somewhere +on the line being indented. The return value is a +@code{c-offsets-alist} offset specification: for example, an integer, +a symbol such as @code{+}, a vector, @code{nil}@footnote{Returning +@code{nil} is useful when the offset specification for a syntactic +element is a list containing the line-up function +(@pxref{c-offsets-alist}).}, or even another line-up function. Full +details of these are in @ref{c-offsets-alist}. Line-up functions must not move point or change the content of the buffer (except temporarily). They are however allowed to do === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-03-05 15:55:53 +0000 +++ lisp/ChangeLog 2013-03-06 14:24:39 +0000 @@ -1,3 +1,10 @@ +2013-03-06 Alan Mackenzie + + Correct the position of point in some line-up functions. + * progmodes/cc-align.el (c-lineup-whitesmith-in-block) + (c-lineup-assignments, c-lineup-gcc-asm-reg ): take position of + point at column 0 rather than at a random place in the line. + 2013-03-05 Michael Albinus * net/tramp-compat.el (tramp-compat-delete-directory): Implement === modified file 'lisp/progmodes/cc-align.el' --- lisp/progmodes/cc-align.el 2013-03-04 19:33:23 +0000 +++ lisp/progmodes/cc-align.el 2013-03-06 14:24:39 +0000 @@ -737,7 +737,7 @@ (setq startpos (c-langelem-pos langelem))))) (setq startpos (c-langelem-pos langelem) - endpos (point)) + endpos (c-point 'bol)) ;; Find a syntactically relevant and unnested "=" token on the ;; current line. equalp is in that case set to the number of @@ -1039,6 +1039,7 @@ arglist-intro, arglist-cont-nonempty, arglist-close, and all in* symbols, e.g. inclass and inextern-lang." (save-excursion + (beginning-of-line) (if (and (c-go-up-list-backward) (= (point) (c-point 'boi))) nil @@ -1191,6 +1192,7 @@ (let ((orig-pos (point)) alignto) (save-excursion + (beginning-of-line) (and c-opt-asm-stmt-key ------------------------------------------------------------ revno: 111954 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2013-03-06 15:26:30 +0400 message: Coding system support cleanup and minor refactoring. * coding.h (enum coding_result_code): Remove CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM. (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL. (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY) (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION) (CODING_MODE_SAFE_ENCODING): Rearrange bit values. (decode_coding_region, encode_coding_region, decode_coding_string): Remove unused compatibility macros. * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove. (record_conversion_result): Adjust user. (syms_of_coding): Likewise. (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA. (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE. (decode_coding_object): Simplify since xrealloc never returns NULL. Add eassert. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-06 08:01:47 +0000 +++ src/ChangeLog 2013-03-06 11:26:30 +0000 @@ -1,3 +1,22 @@ +2013-03-06 Dmitry Antipov + + Coding system support cleanup and minor refactoring. + * coding.h (enum coding_result_code): Remove + CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM. + (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL. + (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY) + (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION) + (CODING_MODE_SAFE_ENCODING): Rearrange bit values. + (decode_coding_region, encode_coding_region, decode_coding_string): + Remove unused compatibility macros. + * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove. + (record_conversion_result): Adjust user. + (syms_of_coding): Likewise. + (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA. + (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE. + (decode_coding_object): Simplify since xrealloc never returns NULL. + Add eassert. + 2013-03-06 Paul Eggert Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881). === modified file 'src/coding.c' --- src/coding.c 2013-02-13 04:31:09 +0000 +++ src/coding.c 2013-03-06 11:26:30 +0000 @@ -322,8 +322,7 @@ Lisp_Object Qstart_process, Qopen_network_stream; static Lisp_Object Qtarget_idx; -static Lisp_Object Qinsufficient_source, Qinconsistent_eol, Qinvalid_source; -static Lisp_Object Qinterrupted, Qinsufficient_memory; +static Lisp_Object Qinsufficient_source, Qinvalid_source, Qinterrupted; /* If a symbol has this property, evaluate the value to define the symbol as a coding system. */ @@ -820,18 +819,12 @@ case CODING_RESULT_INSUFFICIENT_SRC: Vlast_code_conversion_error = Qinsufficient_source; break; - case CODING_RESULT_INCONSISTENT_EOL: - Vlast_code_conversion_error = Qinconsistent_eol; - break; case CODING_RESULT_INVALID_SRC: Vlast_code_conversion_error = Qinvalid_source; break; case CODING_RESULT_INTERRUPT: Vlast_code_conversion_error = Qinterrupted; break; - case CODING_RESULT_INSUFFICIENT_MEM: - Vlast_code_conversion_error = Qinsufficient_memory; - break; case CODING_RESULT_INSUFFICIENT_DST: /* Don't record this error in Vlast_code_conversion_error because it happens just temporarily and is resolved when the @@ -6884,22 +6877,8 @@ #define ALLOC_CONVERSION_WORK_AREA(coding) \ do { \ - int size = CHARBUF_SIZE; \ - \ - coding->charbuf = NULL; \ - while (size > 1024) \ - { \ - coding->charbuf = alloca (sizeof (int) * size); \ - if (coding->charbuf) \ - break; \ - size >>= 1; \ - } \ - if (! coding->charbuf) \ - { \ - record_conversion_result (coding, CODING_RESULT_INSUFFICIENT_MEM); \ - return; \ - } \ - coding->charbuf_size = size; \ + coding->charbuf = SAFE_ALLOCA (CHARBUF_SIZE * sizeof (int)); \ + coding->charbuf_size = CHARBUF_SIZE; \ } while (0) @@ -6968,6 +6947,8 @@ int carryover; int i; + USE_SAFE_ALLOCA; + if (BUFFERP (coding->src_object) && coding->src_pos > 0 && coding->src_pos < GPT @@ -7090,6 +7071,8 @@ bset_undo_list (current_buffer, undo_list); record_insert (coding->dst_pos, coding->produced_char); } + + SAFE_FREE (); } @@ -7373,6 +7356,8 @@ int max_lookup; struct ccl_spec cclspec; + USE_SAFE_ALLOCA; + attrs = CODING_ID_ATTRS (coding->id); if (coding->encoder == encode_coding_raw_text) translation_table = Qnil, max_lookup = 0; @@ -7407,6 +7392,8 @@ if (BUFFERP (coding->dst_object) && coding->produced_char > 0) insert_from_gap (coding->produced_char, coding->produced); + + SAFE_FREE (); } @@ -7695,14 +7682,8 @@ set_buffer_internal (XBUFFER (coding->dst_object)); if (dst_bytes < coding->produced) { + eassert (coding->produced > 0); destination = xrealloc (destination, coding->produced); - if (! destination) - { - record_conversion_result (coding, - CODING_RESULT_INSUFFICIENT_MEM); - unbind_to (count, Qnil); - return; - } if (BEGV < GPT && GPT < BEGV + coding->produced_char) move_gap_both (BEGV, BEGV_BYTE); memcpy (destination, BEGV_ADDR, coding->produced); @@ -10408,10 +10389,8 @@ intern_c_string ("coding-category-undecided")); DEFSYM (Qinsufficient_source, "insufficient-source"); - DEFSYM (Qinconsistent_eol, "inconsistent-eol"); DEFSYM (Qinvalid_source, "invalid-source"); DEFSYM (Qinterrupted, "interrupted"); - DEFSYM (Qinsufficient_memory, "insufficient-memory"); DEFSYM (Qcoding_system_define_form, "coding-system-define-form"); defsubr (&Scoding_system_p); === modified file 'src/coding.h' --- src/coding.h 2013-01-02 16:13:04 +0000 +++ src/coding.h 2013-03-06 11:26:30 +0000 @@ -272,37 +272,31 @@ CODING_RESULT_SUCCESS, CODING_RESULT_INSUFFICIENT_SRC, CODING_RESULT_INSUFFICIENT_DST, - CODING_RESULT_INCONSISTENT_EOL, CODING_RESULT_INVALID_SRC, - CODING_RESULT_INTERRUPT, - CODING_RESULT_INSUFFICIENT_MEM + CODING_RESULT_INTERRUPT }; /* Macros used for the member `mode' of the struct coding_system. */ -/* If set, recover the original CR or LF of the already decoded text - when the decoding routine encounters an inconsistent eol format. */ -#define CODING_MODE_INHIBIT_INCONSISTENT_EOL 0x01 - /* If set, the decoding/encoding routines treat the current data as the last block of the whole text to be converted, and do the appropriate finishing job. */ -#define CODING_MODE_LAST_BLOCK 0x02 +#define CODING_MODE_LAST_BLOCK 0x01 /* If set, it means that the current source text is in a buffer which enables selective display. */ -#define CODING_MODE_SELECTIVE_DISPLAY 0x04 +#define CODING_MODE_SELECTIVE_DISPLAY 0x02 /* This flag is used by the decoding/encoding routines on the fly. If set, it means that right-to-left text is being processed. */ -#define CODING_MODE_DIRECTION 0x08 +#define CODING_MODE_DIRECTION 0x04 -#define CODING_MODE_FIXED_DESTINATION 0x10 +#define CODING_MODE_FIXED_DESTINATION 0x08 /* If set, it means that the encoding routines produces some safe ASCII characters (usually '?') for unsupported characters. */ -#define CODING_MODE_SAFE_ENCODING 0x20 +#define CODING_MODE_SAFE_ENCODING 0x10 /* For handling composition sequence. */ #include "composite.h" @@ -725,22 +719,6 @@ /* Macros for backward compatibility. */ -#define decode_coding_region(coding, from, to) \ - decode_coding_object (coding, Fcurrent_buffer (), \ - from, CHAR_TO_BYTE (from), \ - to, CHAR_TO_BYTE (to), Fcurrent_buffer ()) - - -#define encode_coding_region(coding, from, to) \ - encode_coding_object (coding, Fcurrent_buffer (), \ - from, CHAR_TO_BYTE (from), \ - to, CHAR_TO_BYTE (to), Fcurrent_buffer ()) - - -#define decode_coding_string(coding, string, nocopy) \ - decode_coding_object (coding, string, 0, 0, SCHARS (string), \ - SBYTES (string), Qt) - #define encode_coding_string(coding, string, nocopy) \ (STRING_MULTIBYTE(string) ? \ (encode_coding_object (coding, string, 0, 0, SCHARS (string), \ ------------------------------------------------------------ revno: 111953 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-03-06 06:17:39 -0500 message: Auto-commit of generated files. diff: === modified file 'autogen/configure' --- autogen/configure 2013-03-05 03:59:35 +0000 +++ autogen/configure 2013-03-06 11:17:39 +0000 @@ -5896,7 +5896,8 @@ test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS" fi -# Avoid gnulib's tests for O_NOATIME and O_NOFOLLOW, as we don't use them. +# Avoid gnulib's tests for HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW, +# as we don't use them. # Avoid gnulib's threadlib module, as we do threads our own way. @@ -9887,14 +9888,6 @@ ;; esac -if test -n "${term_header}"; then - -cat >>confdefs.h <<_ACEOF -#define TERM_HEADER "${term_header}" -_ACEOF - -fi - if test "$window_system" = none && test "X$with_x" != "Xno"; then # Extract the first word of "X", so it can be a program name with args. set dummy X; ac_word=$2 ------------------------------------------------------------ revno: 111952 [merge] committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-03-06 00:01:47 -0800 message: Merge from emacs-24; up to r111323 diff: === modified file 'ChangeLog' --- ChangeLog 2013-03-05 03:59:35 +0000 +++ ChangeLog 2013-03-06 08:01:47 +0000 @@ -1,3 +1,8 @@ +2013-03-06 Paul Eggert + + * configure.ac (TERM_HEADER): Remove duplicate definition (Bug#13872). + It can mess up 'configure' runs. + 2013-03-05 Glenn Morris * Makefile.in (install-man): Ignore gzip exit status. === modified file 'configure.ac' --- configure.ac 2013-03-05 22:35:41 +0000 +++ configure.ac 2013-03-06 08:01:47 +0000 @@ -1580,11 +1580,6 @@ ;; esac -if test -n "${term_header}"; then - AC_DEFINE_UNQUOTED(TERM_HEADER, "${term_header}", - [Define to the header for the built-in window system.]) -fi - if test "$window_system" = none && test "X$with_x" != "Xno"; then AC_CHECK_PROG(HAVE_XSERVER, X, true, false) if test "$HAVE_XSERVER" = true || === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-05 23:08:11 +0000 +++ src/ChangeLog 2013-03-06 08:01:47 +0000 @@ -1,3 +1,15 @@ +2013-03-06 Paul Eggert + + Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881). + * sysdep.c (list_system_processes) + [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]: + Make it a stub in this case; otherwise the build might fail, + and this code hasn't been tested on such hosts anyway. + Problem reported by Nelson H. F. Beebe in + + and analyzed by Jérémie Courrèges-Anglas in + . + 2013-03-06 Dmitry Antipov * lisp.h (find_next_newline_no_quit): Rename to find_next_newline. @@ -65,16 +77,6 @@ to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov . -2013-03-05 Paul Eggert - - Fix a build failure on OpenBSD 4.x and MirBSD. - * sysdep.c (KERN_PROC, kinfo_proc) - [BSD_SYSTEM && (!KERN_PROC || __MirBSD__)]: - Define to KERN_PROC2 and kinfo_proc2, for OpenBSD 4.9 and MirBSD. - list-system-processes still returns nil, but at least it doesn't crash. - Problem reported by Nelson H. F. Beebe in - . - 2013-03-05 Dmitry Antipov * composite.c (get_composition_id, fill_gstring_header): === modified file 'src/sysdep.c' --- src/sysdep.c 2013-03-05 03:59:35 +0000 +++ src/sysdep.c 2013-03-06 08:01:47 +0000 @@ -2541,20 +2541,12 @@ return proclist; } -#elif defined BSD_SYSTEM - -/* OpenBSD 4.9 and earlier do not have KERN_PROC. Approximate it with - KERN_PROC2. MirBSD's KERN_PROC seems to be busted. */ -# if !defined KERN_PROC || defined __MirBSD__ -# undef KERN_PROC -# define KERN_PROC KERN_PROC2 -# define kinfo_proc kinfo_proc2 -# endif +#elif defined DARWIN_OS || defined __FreeBSD__ Lisp_Object list_system_processes (void) { -#if defined DARWIN_OS || defined __NetBSD__ || defined __OpenBSD__ +#ifdef DARWIN_OS int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL}; #else int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PROC}; @@ -2580,10 +2572,8 @@ len /= sizeof (struct kinfo_proc); for (i = 0; i < len; i++) { -#if defined DARWIN_OS || defined __NetBSD__ +#ifdef DARWIN_OS proclist = Fcons (make_fixnum_or_float (procs[i].kp_proc.p_pid), proclist); -#elif defined __OpenBSD__ - proclist = Fcons (make_fixnum_or_float (procs[i].p_pid), proclist); #else proclist = Fcons (make_fixnum_or_float (procs[i].ki_pid), proclist); #endif ------------------------------------------------------------ revno: 111951 committer: Paul Eggert branch nick: trunk timestamp: Tue 2013-03-05 22:26:55 -0800 message: Mention GZIP_PROG in INSTALL. diff: === modified file 'INSTALL' --- INSTALL 2013-01-01 09:11:05 +0000 +++ INSTALL 2013-03-06 06:26:55 +0000 @@ -656,7 +656,7 @@ path variables - `bindir' and `libexecdir'. The above variables serve analogous purposes in the makefiles for all -GNU software; the following variable is specific to Emacs. +GNU software; the following variables are specific to Emacs. `archlibdir' indicates where Emacs installs and expects the executable files and other architecture-dependent data it uses while @@ -664,6 +664,10 @@ see), is `/usr/local/libexec/emacs/VERSION/CONFIGURATION-NAME' (where VERSION and CONFIGURATION-NAME are as described above). +`GZIP_PROG' is the name of the executable that compresses installed info, + manual, and .el files. It defaults to gzip. Setting it to + the empty string suppresses compression. + Remember that you must specify any variable values you need each time you run `make' in the top directory. If you run `make' once to build emacs, test it, and then run `make' again to install the files, you ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.