Now on revision 112053. ------------------------------------------------------------ revno: 112053 committer: Paul Eggert branch nick: trunk timestamp: Fri 2013-03-15 13:03:31 -0700 message: * coding.c (decode_coding_gap): Fix typo caught by static checking. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-15 16:04:47 +0000 +++ src/ChangeLog 2013-03-15 20:03:31 +0000 @@ -1,3 +1,7 @@ +2013-03-15 Paul Eggert + + * coding.c (decode_coding_gap): Fix typo caught by static checking. + 2013-03-15 handa * insdel.c (insert_from_gap): New arg text_at_gap_tail. === modified file 'src/coding.c' --- src/coding.c 2013-03-15 16:03:54 +0000 +++ src/coding.c 2013-03-15 20:03:31 +0000 @@ -7632,7 +7632,7 @@ if (coding->eol_seen == EOL_SEEN_CR) { unsigned char *src_end = GAP_END_ADDR; - unsigned char *src = src - coding->src_bytes; + unsigned char *src = src_end - coding->src_bytes; while (src < src_end) { ------------------------------------------------------------ revno: 112052 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2013-03-15 18:12:03 +0100 message: nt/config.nt: Sync with autogen/config.in. (BSD_SYSTEM, BSD_SYSTEM_AHB, HAVE_ALARM, HAVE__PUTENV): Remove. (HAVE_DECL_ALARM, HAVE_DECL_FDATASYNC, HAVE_DECL__PUTENV) (HAVE_FDATASYNC): New macros. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2013-03-13 18:42:22 +0000 +++ nt/ChangeLog 2013-03-15 17:12:03 +0000 @@ -1,3 +1,10 @@ +2013-03-15 Juanma Barranquero + + * config.nt: Sync with autogen/config.in. + (BSD_SYSTEM, BSD_SYSTEM_AHB, HAVE_ALARM, HAVE__PUTENV): Remove. + (HAVE_DECL_ALARM, HAVE_DECL_FDATASYNC, HAVE_DECL__PUTENV) + (HAVE_FDATASYNC): New macros. + 2013-03-13 Paul Eggert File synchronization fixes (Bug#13944). === modified file 'nt/config.nt' --- nt/config.nt 2013-03-05 03:59:35 +0000 +++ nt/config.nt 2013-03-15 17:12:03 +0000 @@ -60,12 +60,6 @@ /* Define on FreeBSD to work around an issue when reading from a PTY. */ #undef BROKEN_PTY_READ_AFTER_EAGAIN -/* Define if the system is compatible with BSD 4.2. */ -#undef BSD_SYSTEM - -/* Define if AH_BOTTOM should change BSD_SYSTEM. */ -#undef BSD_SYSTEM_AHB - /* Define if Emacs cannot be dumped on your system. */ #undef CANNOT_DUMP @@ -224,9 +218,6 @@ /* Define to 1 if the file /usr/lpp/X11/bin/smt.exp exists. */ #undef HAVE_AIX_SMT_EXP -/* Define to 1 if you have the `alarm' function. */ -#undef HAVE_ALARM - /* Define to 1 if you have 'alloca' after including , a header that may be supplied by this distribution. */ #undef HAVE_ALLOCA @@ -287,6 +278,14 @@ /* Define to 1 if you have the `dbus_watch_get_unix_fd' function. */ #undef HAVE_DBUS_WATCH_GET_UNIX_FD +/* Define to 1 if you have the declaration of `alarm', and to 0 if you don't. + */ +#undef HAVE_DECL_ALARM + +/* Define to 1 if you have the declaration of `fdatasync', and to 0 if you + don't. */ +#undef HAVE_DECL_FDATASYNC + /* Define to 1 if you have the declaration of `fdopendir', and to 0 if you don't. */ #undef HAVE_DECL_FDOPENDIR @@ -335,6 +334,10 @@ don't. */ #undef HAVE_DECL_UNSETENV +/* Define to 1 if you have the declaration of `_putenv', and to 0 if you + don't. */ +#undef HAVE_DECL__PUTENV + /* Define to 1 if you have the declaration of `__fpending', and to 0 if you don't. */ #undef HAVE_DECL___FPENDING @@ -379,6 +382,9 @@ /* Define to 1 if you have the `faccessat' function. */ #undef HAVE_FACCESSAT +/* Define to 1 if you have the `fdatasync' function. */ +#undef HAVE_FDATASYNC + /* Define to 1 if you have the `fdopendir' function. */ #undef HAVE_FDOPENDIR @@ -1137,9 +1143,6 @@ /* Define to 1 if you have the `_ftime' function. */ #undef HAVE__FTIME -/* Define to 1 if you have the `_putenv' function. */ -#undef HAVE__PUTENV - /* Define to 1 if _setjmp and _longjmp work. */ #define HAVE__SETJMP 1 ------------------------------------------------------------ revno: 112051 [merge] committer: K. Handa branch nick: trunk timestamp: Sat 2013-03-16 01:06:12 +0900 message: Optimize ASCII file reading with EOL format detection and decoding. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-15 10:07:29 +0000 +++ src/ChangeLog 2013-03-15 16:04:47 +0000 @@ -1,3 +1,31 @@ +2013-03-15 handa + + * insdel.c (insert_from_gap): New arg text_at_gap_tail. + (adjust_after_replace): Make it back to static. Delete the third + arg text_at_gap_tail. Cancel the code for handling it. + + * coding.h (struct coding_system): New member eol_seen. + + * coding.c (detect_ascii): New function. + (detect_coding): Set coding->head_ascii and coding->eol_seen only + when the source bytes are actually scanned. On detecting for + coding_category_utf_8_auto, call detect_ascii instead of scanning + source bytes directly. + (produce_chars): Call insert_from_gap with the new arg 0. + (encode_coding): Likewise. + (decode_coding_gap): Control ASCII optimization by the variable + disable_ascii_optimization instead of #ifndef .. #endif. + Deccode EOL format according to coding->eol_seen. + (syms_of_coding): Declare disable-ascii-optimization as a Lisp + variable. + + * global.h (struct emacs_globals): New member + f_disable_ascii_optimization. + (disable_ascii_optimization): New macro. + + * lisp.h (adjust_after_replace): Cancel externing it. + (insert_from_gap): Adjust prototype. + 2013-03-15 Eli Zaretskii * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and === modified file 'src/coding.c' --- src/coding.c 2013-03-10 22:55:25 +0000 +++ src/coding.c 2013-03-15 16:03:54 +0000 @@ -6071,6 +6071,93 @@ #define EOL_SEEN_CR 2 #define EOL_SEEN_CRLF 4 + +static Lisp_Object adjust_coding_eol_type (struct coding_system *coding, int eol_seen); + + +/* Return 1 if all the source bytes are ASCII, and return 0 otherwize. + By side effects, set coding->head_ascii and coding->eol_seen. The + value of coding->eol_seen is "logical or" of EOL_SEEN_LF, + EOL_SEEN_CR, and EOL_SEEN_CRLF, but the value is reliable only when + all the source bytes are ASCII. */ + +static bool +detect_ascii (struct coding_system *coding) +{ + const unsigned char *src, *end; + Lisp_Object eol_type = CODING_ID_EOL_TYPE (coding->id); + int eol_seen; + + eol_seen = (VECTORP (eol_type) ? EOL_SEEN_NONE + : EQ (eol_type, Qunix) ? EOL_SEEN_LF + : EQ (eol_type, Qdos) ? EOL_SEEN_CRLF + : EOL_SEEN_CR); + coding_set_source (coding); + src = coding->source; + end = src + coding->src_bytes; + + if (inhibit_eol_conversion) + { + /* We don't have to check EOL format. */ + while (src < end && !( *src & 0x80)) src++; + eol_seen = EOL_SEEN_LF; + adjust_coding_eol_type (coding, eol_seen); + } + else if (eol_seen != EOL_SEEN_NONE) + { + /* We don't have to check EOL format either. */ + while (src < end && !(*src & 0x80)) src++; + } + else + { + end--; /* We look ahead one byte. */ + while (src < end) + { + int c = *src; + + if (c & 0x80) + break; + src++; + if (c < 0x20) + { + if (c == '\r') + { + if (*src == '\n') + { + eol_seen |= EOL_SEEN_CRLF; + src++; + } + else + eol_seen |= EOL_SEEN_CR; + } + else if (c == '\n') + eol_seen |= EOL_SEEN_LF; + } + } + if (src > end) + /* The last two bytes are CR LF, which means that we have + scanned all bytes. */ + end++; + else if (src == end) + { + end++; + if (! (*src & 0x80)) + { + if (*src == '\r') + eol_seen |= EOL_SEEN_CR; + else if (*src == '\n') + eol_seen |= EOL_SEEN_LF; + src++; + } + } + adjust_coding_eol_type (coding, eol_seen); + } + coding->head_ascii = src - coding->source; + coding->eol_seen = eol_seen; + return (src == end); +} + + /* Detect how end-of-line of a text of length SRC_BYTES pointed by SOURCE is encoded. If CATEGORY is one of coding_category_utf_16_XXXX, assume that CR and LF are encoded by @@ -6215,7 +6302,6 @@ coding_set_source (coding); src_end = coding->source + coding->src_bytes; - coding->head_ascii = 0; /* If we have not yet decided the text encoding type, detect it now. */ @@ -6225,6 +6311,8 @@ struct coding_detection_info detect_info; bool null_byte_found = 0, eight_bit_found = 0; + coding->head_ascii = 0; + coding->eol_seen = EOL_SEEN_NONE; detect_info.checked = detect_info.found = detect_info.rejected = 0; for (src = coding->source; src < src_end; src++) { @@ -6263,6 +6351,26 @@ if (eight_bit_found) break; } + else if (! disable_ascii_optimization + && ! inhibit_eol_conversion) + { + if (c == '\r') + { + if (src < src_end && src[1] == '\n') + { + coding->eol_seen |= EOL_SEEN_CRLF; + src++; + coding->head_ascii++; + } + else + coding->eol_seen |= EOL_SEEN_CR; + } + else if (c == '\n') + { + coding->eol_seen |= EOL_SEEN_LF; + } + } + if (! eight_bit_found) coding->head_ascii++; } @@ -6353,19 +6461,20 @@ coding_systems = AREF (CODING_ID_ATTRS (coding->id), coding_attr_utf_bom); detect_info.found = detect_info.rejected = 0; - for (src = coding->source; src < src_end; src++) + if (detect_ascii (coding)) { - if (*src & 0x80) - break; + setup_coding_system (XCDR (coding_systems), coding); } - coding->head_ascii = src - coding->source; - if (CONSP (coding_systems) - && detect_coding_utf_8 (coding, &detect_info)) + else { - if (detect_info.found & CATEGORY_MASK_UTF_8_SIG) - setup_coding_system (XCAR (coding_systems), coding); - else - setup_coding_system (XCDR (coding_systems), coding); + if (CONSP (coding_systems) + && detect_coding_utf_8 (coding, &detect_info)) + { + if (detect_info.found & CATEGORY_MASK_UTF_8_SIG) + setup_coding_system (XCAR (coding_systems), coding); + else + setup_coding_system (XCDR (coding_systems), coding); + } } } else if (XINT (CODING_ATTR_CATEGORY (CODING_ID_ATTRS (coding->id))) @@ -6378,6 +6487,7 @@ = AREF (CODING_ID_ATTRS (coding->id), coding_attr_utf_bom); detect_info.found = detect_info.rejected = 0; coding->head_ascii = 0; + coding->eol_seen = EOL_SEEN_NONE; if (CONSP (coding_systems) && detect_coding_utf_16 (coding, &detect_info)) { @@ -6815,7 +6925,7 @@ produced = dst - (coding->destination + coding->produced); if (BUFFERP (coding->dst_object) && produced_chars > 0) - insert_from_gap (produced_chars, produced); + insert_from_gap (produced_chars, produced, 0); coding->produced += produced; coding->produced_char += produced_chars; return carryover; @@ -7400,7 +7510,7 @@ } while (coding->consumed_char < coding->src_chars); if (BUFFERP (coding->dst_object) && coding->produced_char > 0) - insert_from_gap (coding->produced_char, coding->produced); + insert_from_gap (coding->produced_char, coding->produced, 0); SAFE_FREE (); } @@ -7510,39 +7620,45 @@ if (CODING_REQUIRE_DETECTION (coding)) detect_coding (coding); attrs = CODING_ID_ATTRS (coding->id); -#ifndef CODING_DISABLE_ASCII_OPTIMIZATION - if (! NILP (CODING_ATTR_ASCII_COMPAT (attrs)) - && NILP (CODING_ATTR_POST_READ (attrs)) - && NILP (get_translation_table (attrs, 0, NULL)) - && (inhibit_eol_conversion - || EQ (CODING_ID_EOL_TYPE (coding->id), Qunix))) + if (! disable_ascii_optimization) { - /* We can skip the conversion if all source bytes are ASCII. */ - if (coding->head_ascii < 0) - { - /* We have not yet counted the number of ASCII bytes at the - head of the source. Do it now. */ - const unsigned char *src, *src_end; - - coding_set_source (coding); - src_end = coding->source + coding->src_bytes; - for (src = coding->source; src < src_end; src++) - { - if (*src & 0x80) - break; - } - coding->head_ascii = src - coding->source; - } - if (coding->src_bytes == coding->head_ascii) - { - /* No need of conversion. Use the data in the gap as is. */ - coding->produced_char = chars; - coding->produced = bytes; - adjust_after_replace (PT, PT_BYTE, Qnil, chars, bytes, 1); + if (! NILP (CODING_ATTR_ASCII_COMPAT (attrs)) + && NILP (CODING_ATTR_POST_READ (attrs)) + && NILP (get_translation_table (attrs, 0, NULL)) + && (coding->head_ascii >= 0 /* We've already called detect_coding */ + ? coding->head_ascii == bytes + : detect_ascii (coding))) + { + if (coding->eol_seen == EOL_SEEN_CR) + { + unsigned char *src_end = GAP_END_ADDR; + unsigned char *src = src - coding->src_bytes; + + while (src < src_end) + { + if (*src++ == '\r') + src[-1] = '\n'; + } + } + else if (coding->eol_seen == EOL_SEEN_CRLF) + { + unsigned char *src = GAP_END_ADDR; + unsigned char *src_beg = src - coding->src_bytes; + unsigned char *dst = src; + + while (src_beg < src) + { + *--dst = *--src; + if (*src == '\n') + src--; + } + bytes -= dst - src; + } + coding->produced_char = coding->produced = bytes; + insert_from_gap (bytes, bytes, 1); return; } } -#endif /* not CODING_DISABLE_ASCII_OPTIMIZATION */ code_conversion_save (0, 0); coding->mode |= CODING_MODE_LAST_BLOCK; @@ -10758,6 +10874,11 @@ decode text as usual. */); inhibit_null_byte_detection = 0; + DEFVAR_BOOL ("disable-ascii-optimization", disable_ascii_optimization, + doc: /* If non-nil, Emacs does not optimize code decoder for ASCII files. +Internal use only. Removed after the experimental optimizer gets stable. */); + disable_ascii_optimization = 0; + DEFVAR_LISP ("translation-table-for-input", Vtranslation_table_for_input, doc: /* Char table for translating self-inserting characters. This is applied to the result of input methods, not their input. === modified file 'src/coding.h' --- src/coding.h 2013-03-10 22:55:25 +0000 +++ src/coding.h 2013-03-15 16:03:54 +0000 @@ -440,9 +440,13 @@ /* How may heading bytes we can skip for decoding. This is set to -1 in setup_coding_system, and updated by detect_coding. So, when this is equal to the byte length of the text being - converted, we can skip the actual conversion process. */ + converted, we can skip the actual conversion process except for + the eol format. */ ptrdiff_t head_ascii; + /* Used internally in coding.c. See the comment of detect_ascii. */ + int eol_seen; + /* The following members are set by encoding/decoding routine. */ ptrdiff_t produced, produced_char, consumed, consumed_char; === modified file 'src/insdel.c' --- src/insdel.c 2013-03-11 04:07:45 +0000 +++ src/insdel.c 2013-03-15 16:03:54 +0000 @@ -977,10 +977,11 @@ } /* Insert a sequence of NCHARS chars which occupy NBYTES bytes - starting at GPT_ADDR. */ + starting at GAP_END_ADDR - NBYTES (if text_at_gap_tail) and at + GPT_ADDR (if not text_at_gap_tail). */ void -insert_from_gap (ptrdiff_t nchars, ptrdiff_t nbytes) +insert_from_gap (ptrdiff_t nchars, ptrdiff_t nbytes, bool text_at_gap_tail) { if (NILP (BVAR (current_buffer, enable_multibyte_characters))) nchars = nbytes; @@ -989,10 +990,13 @@ MODIFF++; GAP_SIZE -= nbytes; - GPT += nchars; + if (! text_at_gap_tail) + { + GPT += nchars; + GPT_BYTE += nbytes; + } ZV += nchars; Z += nchars; - GPT_BYTE += nbytes; ZV_BYTE += nbytes; Z_BYTE += nbytes; if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ @@ -1010,7 +1014,7 @@ current_buffer, 0); } - if (GPT - nchars < PT) + if (! text_at_gap_tail && GPT - nchars < PT) adjust_point (nchars, nbytes); check_markers (); @@ -1162,16 +1166,14 @@ /* Record undo information and adjust markers and position keepers for a replacement of a text PREV_TEXT at FROM to a new text of LEN - chars (LEN_BYTE bytes). If TEXT_AT_GAP_TAIL, the new text - resides at the gap tail; i.e. at (GAP_END_ADDR - LEN_BYTE) - Otherwise, the text resides in the gap just after GPT_BYTE. + chars (LEN_BYTE bytes) which resides in the gap just after + GPT_ADDR. PREV_TEXT nil means the new text was just inserted. */ -void +static void adjust_after_replace (ptrdiff_t from, ptrdiff_t from_byte, - Lisp_Object prev_text, ptrdiff_t len, ptrdiff_t len_byte, - bool text_at_gap_tail) + Lisp_Object prev_text, ptrdiff_t len, ptrdiff_t len_byte) { ptrdiff_t nchars_del = 0, nbytes_del = 0; @@ -1191,11 +1193,8 @@ GAP_SIZE -= len_byte; ZV += len; Z+= len; ZV_BYTE += len_byte; Z_BYTE += len_byte; - if (! text_at_gap_tail) - { - GPT += len; GPT_BYTE += len_byte; - if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ - } + GPT += len; GPT_BYTE += len_byte; + if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ if (nchars_del > 0) adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del, @@ -1250,7 +1249,7 @@ GPT -= len; GPT_BYTE -= len_byte; ZV -= len; ZV_BYTE -= len_byte; Z -= len; Z_BYTE -= len_byte; - adjust_after_replace (from, from_byte, Qnil, newlen, len_byte, 0); + adjust_after_replace (from, from_byte, Qnil, newlen, len_byte); } /* Replace the text from character positions FROM to TO with NEW, === modified file 'src/lisp.h' --- src/lisp.h 2013-03-11 04:02:06 +0000 +++ src/lisp.h 2013-03-15 16:03:54 +0000 @@ -2880,7 +2880,7 @@ extern void insert_and_inherit (const char *, ptrdiff_t); extern void insert_1_both (const char *, ptrdiff_t, ptrdiff_t, bool, bool, bool); -extern void insert_from_gap (ptrdiff_t, ptrdiff_t); +extern void insert_from_gap (ptrdiff_t, ptrdiff_t, bool text_at_gap_tail); extern void insert_from_string (Lisp_Object, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, bool); extern void insert_from_buffer (struct buffer *, ptrdiff_t, ptrdiff_t, bool); @@ -2900,8 +2900,6 @@ extern void modify_region_1 (ptrdiff_t, ptrdiff_t, bool); extern void prepare_to_modify_buffer (ptrdiff_t, ptrdiff_t, ptrdiff_t *); extern void signal_after_change (ptrdiff_t, ptrdiff_t, ptrdiff_t); -extern void adjust_after_replace (ptrdiff_t, ptrdiff_t, Lisp_Object, - ptrdiff_t, ptrdiff_t, bool); extern void adjust_after_insert (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t); extern void adjust_markers_for_delete (ptrdiff_t, ptrdiff_t, ------------------------------------------------------------ revno: 112050 committer: Michael Albinus + + Sync with Tramp 2.2.7. + + * trampver.texi: Update release number. + 2013-03-09 Jay Belanger * calc.texi (Basic Operations on Units): Streamline some === modified file 'doc/misc/trampver.texi' --- doc/misc/trampver.texi 2013-01-02 16:13:04 +0000 +++ doc/misc/trampver.texi 2013-03-15 14:19:06 +0000 @@ -8,7 +8,7 @@ @c In the Tramp CVS, the version number is auto-frobbed from @c configure.ac, so you should edit that file and run @c "autoconf && ./configure" to change the version number. -@set trampver 2.2.7-pre +@set trampver 2.2.7 @c Other flags from configuration @set instprefix /usr/local ------------------------------------------------------------ revno: 112049 committer: Michael Albinus + + Sync with Tramp 2.2.7. + + * net/trampver.el: Update release number. + 2013-03-14 Tassilo Horn * doc-view.el Fix bug#13887. === modified file 'lisp/net/trampver.el' --- lisp/net/trampver.el 2013-01-02 16:13:04 +0000 +++ lisp/net/trampver.el 2013-03-15 14:17:25 +0000 @@ -31,7 +31,7 @@ ;; should be changed only there. ;;;###tramp-autoload -(defconst tramp-version "2.2.7-pre" +(defconst tramp-version "2.2.7" "This version of Tramp.") ;;;###tramp-autoload @@ -44,7 +44,7 @@ (= emacs-major-version 21) (>= emacs-minor-version 4))) "ok" - (format "Tramp 2.2.7-pre is not fit for %s" + (format "Tramp 2.2.7 is not fit for %s" (when (string-match "^.*$" (emacs-version)) (match-string 0 (emacs-version))))))) (unless (string-match "\\`ok\\'" x) (error "%s" x))) ------------------------------------------------------------ revno: 112048 fixes bug: http://debbugs.gnu.org/13935 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2013-03-15 12:07:29 +0200 message: Match the effect of FULLSCREEN_BOTH and FULLSCREEN_MAXIMIZED to docs on Windows. src/w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and FULLSCREEN_MAXIMIZED. diff: === modified file 'doc/lispref/frames.texi' --- doc/lispref/frames.texi 2013-01-01 09:11:05 +0000 +++ doc/lispref/frames.texi 2013-03-15 10:07:29 +0000 @@ -632,8 +632,9 @@ the height shall be set to the size of the screen. The value @code{maximized} specifies that the frame shall be maximized. The difference between @code{maximized} and @code{fullboth} is that the -former still has window manager decorations while the latter really -covers the whole screen. +former can still be resized by dragging window manager decorations +with the mouse, while the latter really covers the whole screen and +does not allow resizing by mouse dragging. @end table @node Layout Parameters === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-15 07:32:28 +0000 +++ src/ChangeLog 2013-03-15 10:07:29 +0000 @@ -1,3 +1,8 @@ +2013-03-15 Eli Zaretskii + + * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and + FULLSCREEN_MAXIMIZED. (Bug#13935) + 2013-03-15 Dmitry Antipov * region-cache.c (find_cache_boundary, move_cache_gap) === modified file 'src/w32term.c' --- src/w32term.c 2013-03-14 17:37:51 +0000 +++ src/w32term.c 2013-03-15 10:07:29 +0000 @@ -5682,10 +5682,10 @@ switch (f->want_fullscreen) { + case FULLSCREEN_BOTH: + PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, SC_MAXIMIZE, 0); + break; case FULLSCREEN_MAXIMIZED: - PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, SC_MAXIMIZE, 0); - break; - case FULLSCREEN_BOTH: height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixel_height) - XINT (Ftool_bar_lines_needed (selected_frame)) ------------------------------------------------------------ revno: 112047 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2013-03-15 09:32:28 +0200 message: src/ChangeLog: Fix a typo in a recent entry. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-15 07:23:49 +0000 +++ src/ChangeLog 2013-03-15 07:32:28 +0000 @@ -35,7 +35,7 @@ 2013-03-13 Eli Zaretskii - * w32term.c (w32_read_socket): If we Emacs frame is being + * w32term.c (w32_read_socket): If the Emacs frame is being activated, call w32fullscreen_hook, to make sure the new frame dimensions are in effect. (Bug#13937) ------------------------------------------------------------ revno: 112046 committer: Dmitry Antipov branch nick: trunk timestamp: Fri 2013-03-15 11:23:49 +0400 message: * region-cache.c (find_cache_boundary, move_cache_gap) (insert_cache_boundary, delete_cache_boundaries, set_cache_region): Simplify debugging check and convert to eassert. Adjust comment. (pp_cache): Put under ENABLE_CHECKING. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-14 17:37:51 +0000 +++ src/ChangeLog 2013-03-15 07:23:49 +0000 @@ -1,3 +1,10 @@ +2013-03-15 Dmitry Antipov + + * region-cache.c (find_cache_boundary, move_cache_gap) + (insert_cache_boundary, delete_cache_boundaries, set_cache_region): + Simplify debugging check and convert to eassert. Adjust comment. + (pp_cache): Put under ENABLE_CHECKING. + 2013-03-14 Eli Zaretskii * w32term.c (w32_read_socket) : Remove old === modified file 'src/region-cache.c' --- src/region-cache.c 2013-03-08 21:37:41 +0000 +++ src/region-cache.c 2013-03-15 07:23:49 +0000 @@ -190,10 +190,9 @@ } /* Some testing. */ - if (BOUNDARY_POS (c, low) > pos - || (low + 1 < c->cache_len - && BOUNDARY_POS (c, low + 1) <= pos)) - emacs_abort (); + eassert (!(BOUNDARY_POS (c, low) > pos + || (low + 1 < c->cache_len + && BOUNDARY_POS (c, low + 1) <= pos))); return low; } @@ -214,14 +213,9 @@ ptrdiff_t buffer_beg = c->buffer_beg; ptrdiff_t buffer_end = c->buffer_end; - if (pos < 0 - || pos > c->cache_len) - emacs_abort (); - /* We mustn't ever try to put the gap before the dummy start boundary. That must always be start-relative. */ - if (pos == 0) - emacs_abort (); + eassert (0 < pos && pos <= c->cache_len); /* Need we move the gap right? */ while (gap_start < pos) @@ -288,26 +282,19 @@ insert_cache_boundary (struct region_cache *c, ptrdiff_t i, ptrdiff_t pos, int value) { - /* i must be a valid cache index. */ - if (i < 0 || i > c->cache_len) - emacs_abort (); - - /* We must never want to insert something before the dummy first - boundary. */ - if (i == 0) - emacs_abort (); + /* I must be a valid cache index, and we must never want + to insert something before the dummy first boundary. */ + eassert (0 < i && i <= c->cache_len); /* We must only be inserting things in order. */ - if (! (BOUNDARY_POS (c, i - 1) < pos - && (i == c->cache_len - || pos < BOUNDARY_POS (c, i)))) - emacs_abort (); + eassert ((BOUNDARY_POS (c, i - 1) < pos + && (i == c->cache_len + || pos < BOUNDARY_POS (c, i)))); /* The value must be different from the ones around it. However, we temporarily create boundaries that establish the same value as the subsequent boundary, so we're not going to flag that case. */ - if (BOUNDARY_VALUE (c, i - 1) == value) - emacs_abort (); + eassert (BOUNDARY_VALUE (c, i - 1) != value); move_cache_gap (c, i, 1); @@ -328,18 +315,13 @@ ptrdiff_t len = end - start; /* Gotta be in range. */ - if (start < 0 - || end > c->cache_len) - emacs_abort (); + eassert (0 <= start && end <= c->cache_len); /* Gotta be in order. */ - if (start > end) - emacs_abort (); + eassert (start <= end); /* Can't delete the dummy entry. */ - if (start == 0 - && end >= 1) - emacs_abort (); + eassert (!(start == 0 && end >= 1)); /* Minimize gap motion. If we're deleting nothing, do nothing. */ if (len == 0) @@ -378,11 +360,8 @@ set_cache_region (struct region_cache *c, ptrdiff_t start, ptrdiff_t end, int value) { - if (start > end) - emacs_abort (); - if (start < c->buffer_beg - || end > c->buffer_end) - emacs_abort (); + eassert (start <= end); + eassert (c->buffer_beg <= start && end <= c->buffer_end); /* Eliminate this case; then we can assume that start and end-1 are both the locations of real characters in the buffer. */ @@ -772,7 +751,8 @@ } } - +#ifdef ENABLE_CHECKING + /* Debugging: pretty-print a cache to the standard error output. */ void pp_cache (struct region_cache *) EXTERNALLY_VISIBLE; @@ -803,3 +783,5 @@ fprintf (stderr, "%"pD"d : %d\n", pos, BOUNDARY_VALUE (c, i)); } } + +#endif /* ENABLE_CHECKING */ ------------------------------------------------------------ revno: 112045 committer: Tassilo Horn branch nick: trunk timestamp: Thu 2013-03-14 22:33:07 +0100 message: * doc-view.el Fix bug#13887. (doc-view-insert-image): Don't modify overlay associated to non-live windows, and implement horizontal centering of image in case it's smaller than the window. (doc-view-new-window-function): Force redisplay of new windows on doc-view buffers. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-03-14 15:24:04 +0000 +++ lisp/ChangeLog 2013-03-14 21:33:07 +0000 @@ -1,9 +1,11 @@ 2013-03-14 Tassilo Horn - * doc-view.el (doc-view-insert-image): Don't modify overlay - associated with pseudo winprops entry, and implement horizontal - centering of image in case it's smaller than the window - (bug#13887). + * doc-view.el Fix bug#13887. + (doc-view-insert-image): Don't modify overlay associated to + non-live windows, and implement horizontal centering of image in + case it's smaller than the window. + (doc-view-new-window-function): Force redisplay of new windows on + doc-view buffers. 2013-03-13 Karl Fogel === modified file 'lisp/doc-view.el' --- lisp/doc-view.el 2013-03-14 15:24:04 +0000 +++ lisp/doc-view.el 2013-03-14 21:33:07 +0000 @@ -324,7 +324,26 @@ ;; `window' property is only effective if its value is a window). (cl-assert (eq t (car winprops))) (delete-overlay ol)) - (image-mode-window-put 'overlay ol winprops))) + (image-mode-window-put 'overlay ol winprops) + (when (windowp (car winprops)) + (if (stringp (get-char-property (point-min) 'display)) + ;; We're not already displaying an image, so this is the + ;; initial window showing the document. + (run-with-timer nil nil + (lambda () + ;; In case a conversion is running, the + ;; refresh will happen as defined by + ;; `doc-view-conversion-refresh-interval'. + (unless doc-view-current-converter-processes + (with-selected-window (car winprops) + (doc-view-goto-page 1))))) + ;; We've split the window showing the document. All we need + ;; to do is selecting the new window to make the image appear + ;; there, too. + (run-with-timer nil nil + (lambda () + (save-window-excursion + (select-window (car winprops))))))))) (defvar doc-view-current-files nil "Only used internally.") @@ -535,7 +554,7 @@ (with-selected-window win (doc-view-goto-page page)))))))) (overlay-put (doc-view-current-overlay) - 'help-echo (doc-view-current-info)))) + 'help-echo (doc-view-current-info)))) (defun doc-view-next-page (&optional arg) "Browse ARG pages forward." @@ -1251,9 +1270,8 @@ (clear-image-cache) (setq doc-view-pending-cache-flush nil)) (let ((ol (doc-view-current-overlay))) - ;; ol might be deleted (see `doc-view-new-window-function'), in - ;; which case we don't want to modify it. - (when (overlay-buffer ol) + ;; Only insert the image if the buffer is visible. + (when (window-live-p (overlay-get ol 'window)) (let* ((image (if (and file (file-readable-p file)) (if (not (and doc-view-scale-internally (fboundp 'imagemagick-types))) ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.