Now on revision 109762. ------------------------------------------------------------ revno: 109762 committer: Paul Eggert branch nick: trunk timestamp: Thu 2012-08-23 21:37:57 -0700 message: * buffer.c, buffer.h: Use bool for boolean. * buffer.c (reset_buffer_local_variables) (buffer_lisp_local_variables, Fset_buffer_modified_p) (Frestore_buffer_modified_p, Fset_buffer_multibyte): (overlays_at, overlays_in, mouse_face_overlay_overlaps) (overlay_touches_p, overlay_strings, Foverlay_put) (report_overlay_modification, call_overlay_mod_hooks): (mmap_enlarge, mmap_set_vars): * buffer.h (buffer_has_overlays, uppercasep, lowercasep): Use bool for booleans, instead of int. * buffer.c (compact_buffer, mmap_free_1): Return void, not int, since the 1-or-0 return value is always ignored anyway. (mmap_initialized_p): * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int. * buffer.h, lisp.h: Adjust prototypes to match above changes. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-23 20:31:52 +0000 +++ src/ChangeLog 2012-08-24 04:37:57 +0000 @@ -1,3 +1,21 @@ +2012-08-24 Paul Eggert + + * buffer.c, buffer.h: Use bool for boolean. + * buffer.c (reset_buffer_local_variables) + (buffer_lisp_local_variables, Fset_buffer_modified_p) + (Frestore_buffer_modified_p, Fset_buffer_multibyte): + (overlays_at, overlays_in, mouse_face_overlay_overlaps) + (overlay_touches_p, overlay_strings, Foverlay_put) + (report_overlay_modification, call_overlay_mod_hooks): + (mmap_enlarge, mmap_set_vars): + * buffer.h (buffer_has_overlays, uppercasep, lowercasep): + Use bool for booleans, instead of int. + * buffer.c (compact_buffer, mmap_free_1): Return void, not int, + since the 1-or-0 return value is always ignored anyway. + (mmap_initialized_p): + * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int. + * buffer.h, lisp.h: Adjust prototypes to match above changes. + 2012-08-23 Paul Eggert * bidi.c: Use bool for boolean. === modified file 'src/buffer.c' --- src/buffer.c 2012-08-20 07:42:06 +0000 +++ src/buffer.c 2012-08-24 04:37:57 +0000 @@ -110,10 +110,10 @@ int last_per_buffer_idx; static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, - int after, Lisp_Object arg1, + bool after, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3); static void swap_out_buffer_local_variables (struct buffer *b); -static void reset_buffer_local_variables (struct buffer *b, int permanent_too); +static void reset_buffer_local_variables (struct buffer *, bool); /* Alist of all buffer names vs the buffers. */ /* This used to be a variable, but is no longer, @@ -155,7 +155,7 @@ static void free_buffer_text (struct buffer *b); static struct Lisp_Overlay * copy_overlays (struct buffer *, struct Lisp_Overlay *); static void modify_overlay (struct buffer *, ptrdiff_t, ptrdiff_t); -static Lisp_Object buffer_lisp_local_variables (struct buffer *, int); +static Lisp_Object buffer_lisp_local_variables (struct buffer *, bool); /* These setters are used only in this file, so they can be private. */ static inline void @@ -979,15 +979,13 @@ it does not treat permanent locals consistently. Instead, use Fkill_all_local_variables. - If PERMANENT_TOO is 1, then we reset permanent - buffer-local variables. If PERMANENT_TOO is 0, - we preserve those. */ + If PERMANENT_TOO, reset permanent buffer-local variables. + If not, preserve those. */ static void -reset_buffer_local_variables (register struct buffer *b, int permanent_too) +reset_buffer_local_variables (struct buffer *b, bool permanent_too) { - register int offset; - int i; + int offset, i; /* Reset the major mode to Fundamental, together with all the things that depend on the major mode. @@ -1253,14 +1251,14 @@ /* Return an alist of the Lisp-level buffer-local bindings of buffer BUF. That is, don't include the variables maintained in special slots in the buffer object. - If CLONE is zero elements of the form (VAR . unbound) are replaced + If not CLONE, replace elements of the form (VAR . unbound) by VAR. */ static Lisp_Object -buffer_lisp_local_variables (struct buffer *buf, int clone) +buffer_lisp_local_variables (struct buffer *buf, bool clone) { Lisp_Object result = Qnil; - register Lisp_Object tail; + Lisp_Object tail; for (tail = BVAR (buf, local_var_alist); CONSP (tail); tail = XCDR (tail)) { Lisp_Object val, elt; @@ -1351,11 +1349,9 @@ 1, 1, 0, doc: /* Mark current buffer as modified or unmodified according to FLAG. A non-nil FLAG means mark the buffer modified. */) - (register Lisp_Object flag) + (Lisp_Object flag) { - register int already; - register Lisp_Object fn; - Lisp_Object buffer, window; + Lisp_Object fn, buffer, window; #ifdef CLASH_DETECTION /* If buffer becoming modified, lock the file. @@ -1365,7 +1361,7 @@ /* Test buffer-file-name so that binding it to nil is effective. */ if (!NILP (fn) && ! NILP (BVAR (current_buffer, filename))) { - already = SAVE_MODIFF < MODIFF; + bool already = SAVE_MODIFF < MODIFF; if (!already && !NILP (flag)) lock_file (fn); else if (already && NILP (flag)) @@ -1432,7 +1428,7 @@ /* Test buffer-file-name so that binding it to nil is effective. */ if (!NILP (fn) && ! NILP (BVAR (current_buffer, filename))) { - int already = SAVE_MODIFF < MODIFF; + bool already = SAVE_MODIFF < MODIFF; if (!already && !NILP (flag)) lock_file (fn); else if (already && NILP (flag)) @@ -1676,7 +1672,7 @@ /* Truncate undo list and shrink the gap of BUFFER. */ -int +void compact_buffer (struct buffer *buffer) { /* Verify indirection counters. */ @@ -1718,9 +1714,7 @@ } } buffer->text->compact = buffer->text->modiff; - return 1; } - return 0; } DEFUN ("kill-buffer", Fkill_buffer, Skill_buffer, 0, 1, "bKill buffer: ", @@ -2471,8 +2465,8 @@ struct Lisp_Marker *tail, *markers; struct buffer *other; ptrdiff_t begv, zv; - int narrowed = (BEG != BEGV || Z != ZV); - int modified_p = !NILP (Fbuffer_modified_p (Qnil)); + bool narrowed = (BEG != BEGV || Z != ZV); + bool modified_p = !NILP (Fbuffer_modified_p (Qnil)); Lisp_Object old_undo = BVAR (current_buffer, undo_list); struct gcpro gcpro1; @@ -2821,19 +2815,19 @@ *VEC_PTR and *LEN_PTR should contain a valid vector and size when this function is called. - If EXTEND is non-zero, we make the vector bigger if necessary. - If EXTEND is zero, we never extend the vector, - and we store only as many overlays as will fit. - But we still return the total number of overlays. + If EXTEND, make the vector bigger if necessary. + If not, never extend the vector, + and store only as many overlays as will fit. + But still return the total number of overlays. - If CHANGE_REQ is true, then any position written into *PREV_PTR or + If CHANGE_REQ, any position written into *PREV_PTR or *NEXT_PTR is guaranteed to be not equal to POS, unless it is the default (BEGV or ZV). */ ptrdiff_t -overlays_at (EMACS_INT pos, int extend, Lisp_Object **vec_ptr, +overlays_at (EMACS_INT pos, bool extend, Lisp_Object **vec_ptr, ptrdiff_t *len_ptr, - ptrdiff_t *next_ptr, ptrdiff_t *prev_ptr, int change_req) + ptrdiff_t *next_ptr, ptrdiff_t *prev_ptr, bool change_req) { Lisp_Object overlay, start, end; struct Lisp_Overlay *tail; @@ -2842,7 +2836,7 @@ Lisp_Object *vec = *vec_ptr; ptrdiff_t next = ZV; ptrdiff_t prev = BEGV; - int inhibit_storing = 0; + bool inhibit_storing = 0; for (tail = current_buffer->overlays_before; tail; tail = tail->next) { @@ -2959,13 +2953,13 @@ *VEC_PTR and *LEN_PTR should contain a valid vector and size when this function is called. - If EXTEND is non-zero, we make the vector bigger if necessary. - If EXTEND is zero, we never extend the vector, - and we store only as many overlays as will fit. - But we still return the total number of overlays. */ + If EXTEND, make the vector bigger if necessary. + If not, never extend the vector, + and store only as many overlays as will fit. + But still return the total number of overlays. */ static ptrdiff_t -overlays_in (EMACS_INT beg, EMACS_INT end, int extend, +overlays_in (EMACS_INT beg, EMACS_INT end, bool extend, Lisp_Object **vec_ptr, ptrdiff_t *len_ptr, ptrdiff_t *next_ptr, ptrdiff_t *prev_ptr) { @@ -2976,8 +2970,8 @@ Lisp_Object *vec = *vec_ptr; ptrdiff_t next = ZV; ptrdiff_t prev = BEGV; - int inhibit_storing = 0; - int end_is_Z = end == Z; + bool inhibit_storing = 0; + bool end_is_Z = end == Z; for (tail = current_buffer->overlays_before; tail; tail = tail->next) { @@ -3078,10 +3072,10 @@ } -/* Return non-zero if there exists an overlay with a non-nil +/* Return true if there exists an overlay with a non-nil `mouse-face' property overlapping OVERLAY. */ -int +bool mouse_face_overlay_overlaps (Lisp_Object overlay) { ptrdiff_t start = OVERLAY_POSITION (OVERLAY_START (overlay)); @@ -3110,7 +3104,7 @@ /* Fast function to just test if we're at an overlay boundary. */ -int +bool overlay_touches_p (ptrdiff_t pos) { Lisp_Object overlay; @@ -3327,7 +3321,7 @@ Lisp_Object overlay, window, str; struct Lisp_Overlay *ov; ptrdiff_t startpos, endpos; - int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); + bool multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); overlay_heads.used = overlay_heads.bytes = 0; overlay_tails.used = overlay_tails.bytes = 0; @@ -4321,7 +4315,7 @@ (Lisp_Object overlay, Lisp_Object prop, Lisp_Object value) { Lisp_Object tail, buffer; - int changed; + bool changed; CHECK_OVERLAY (overlay); @@ -4396,7 +4390,7 @@ and the insert-after-hooks of overlay ending at START. This is called both before and after the modification. - AFTER is nonzero when we call after the modification. + AFTER is true when we call after the modification. ARG1, ARG2, ARG3 are arguments to pass to the hook functions. When AFTER is nonzero, they are the start position, @@ -4404,13 +4398,13 @@ and the length of deleted or replaced old text. */ void -report_overlay_modification (Lisp_Object start, Lisp_Object end, int after, +report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) { Lisp_Object prop, overlay; struct Lisp_Overlay *tail; - /* 1 if this change is an insertion. */ - int insertion = (after ? XFASTINT (arg3) == 0 : EQ (start, end)); + /* True if this change is an insertion. */ + bool insertion = (after ? XFASTINT (arg3) == 0 : EQ (start, end)); struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; overlay = Qnil; @@ -4530,7 +4524,7 @@ } static void -call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, int after, +call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, bool after, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) { struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; @@ -4689,7 +4683,7 @@ /* 1 means mmap has been initialized. */ -static int mmap_initialized_p; +static bool mmap_initialized_p; /* Value is X rounded up to the next multiple of N. */ @@ -4785,9 +4779,9 @@ /* Unmap a region. P is a pointer to the start of the user-araa of - the region. Value is non-zero if successful. */ + the region. */ -static int +static void mmap_free_1 (struct mmap_region *r) { if (r->next) @@ -4798,24 +4792,19 @@ mmap_regions = r->next; if (munmap (r, r->nbytes_mapped) == -1) - { - fprintf (stderr, "munmap: %s\n", emacs_strerror (errno)); - return 0; - } - - return 1; + fprintf (stderr, "munmap: %s\n", emacs_strerror (errno)); } /* Enlarge region R by NPAGES pages. NPAGES < 0 means shrink R. - Value is non-zero if successful. */ + Value is true if successful. */ -static int +static bool mmap_enlarge (struct mmap_region *r, int npages) { char *region_end = (char *) r + r->nbytes_mapped; size_t nbytes; - int success = 0; + bool success = 0; if (npages < 0) { @@ -4865,17 +4854,16 @@ } -/* Set or reset variables holding references to mapped regions. If - RESTORE_P is zero, set all variables to null. If RESTORE_P is - non-zero, set all variables to the start of the user-areas - of mapped regions. +/* Set or reset variables holding references to mapped regions. + If not RESTORE_P, set all variables to null. If RESTORE_P, set all + variables to the start of the user-areas of mapped regions. This function is called from Fdump_emacs to ensure that the dumped Emacs doesn't contain references to memory that won't be mapped when Emacs starts. */ void -mmap_set_vars (int restore_p) +mmap_set_vars (bool restore_p) { struct mmap_region *r; === modified file 'src/buffer.h' --- src/buffer.h 2012-08-20 07:42:06 +0000 +++ src/buffer.h 2012-08-24 04:37:57 +0000 @@ -471,7 +471,7 @@ /* Usually 0. Temporarily set to 1 in decode_coding_gap to prevent Fgarbage_collect from shrinking the gap and losing not-yet-decoded bytes. */ - int inhibit_shrinking; + bool inhibit_shrinking; }; /* Most code should use this macro to access Lisp fields in struct buffer. */ @@ -1006,11 +1006,10 @@ extern void delete_all_overlays (struct buffer *); extern void reset_buffer (struct buffer *); -extern int compact_buffer (struct buffer *); +extern void compact_buffer (struct buffer *); extern void evaporate_overlays (ptrdiff_t); -extern ptrdiff_t overlays_at (EMACS_INT pos, int extend, Lisp_Object **vec_ptr, - ptrdiff_t *len_ptr, ptrdiff_t *next_ptr, - ptrdiff_t *prev_ptr, int change_req); +extern ptrdiff_t overlays_at (EMACS_INT, bool, Lisp_Object **, + ptrdiff_t *, ptrdiff_t *, ptrdiff_t *, bool); extern ptrdiff_t sort_overlays (Lisp_Object *, ptrdiff_t, struct window *); extern void recenter_overlay_lists (struct buffer *, ptrdiff_t); extern ptrdiff_t overlay_strings (ptrdiff_t, struct window *, unsigned char **); @@ -1022,7 +1021,7 @@ extern void record_buffer (Lisp_Object); extern _Noreturn void buffer_slot_type_mismatch (Lisp_Object, int); extern void fix_overlays_before (struct buffer *, ptrdiff_t, ptrdiff_t); -extern void mmap_set_vars (int); +extern void mmap_set_vars (bool); /* Get overlays at POSN into array OVERLAYS with NOVERLAYS elements. If NEXTP is non-NULL, return next overlay there. @@ -1067,7 +1066,7 @@ /* Non-zero if current buffer has overlays. */ -BUFFER_INLINE int +BUFFER_INLINE bool buffer_has_overlays (void) { return current_buffer->overlays_before || current_buffer->overlays_after; @@ -1243,7 +1242,7 @@ } /* 1 if C is upper case. */ -BUFFER_INLINE int uppercasep (int c) { return downcase (c) != c; } +BUFFER_INLINE bool uppercasep (int c) { return downcase (c) != c; } /* Upcase a character C known to be not upper case. */ BUFFER_INLINE int @@ -1255,8 +1254,11 @@ } /* 1 if C is lower case. */ -BUFFER_INLINE int lowercasep (int c) -{ return !uppercasep (c) && upcase1 (c) != c; } +BUFFER_INLINE bool +lowercasep (int c) +{ + return !uppercasep (c) && upcase1 (c) != c; +} /* Upcase a character C, or make no change if that cannot be done. */ BUFFER_INLINE int upcase (int c) { return uppercasep (c) ? c : upcase1 (c); } === modified file 'src/lisp.h' --- src/lisp.h 2012-08-21 23:39:56 +0000 +++ src/lisp.h 2012-08-24 04:37:57 +0000 @@ -3110,14 +3110,14 @@ extern void set_time_zone_rule (const char *); /* Defined in buffer.c. */ -extern int mouse_face_overlay_overlaps (Lisp_Object); +extern bool mouse_face_overlay_overlaps (Lisp_Object); extern _Noreturn void nsberror (Lisp_Object); extern void adjust_overlays_for_insert (ptrdiff_t, ptrdiff_t); extern void adjust_overlays_for_delete (ptrdiff_t, ptrdiff_t); extern void fix_start_end_in_overlays (ptrdiff_t, ptrdiff_t); -extern void report_overlay_modification (Lisp_Object, Lisp_Object, int, +extern void report_overlay_modification (Lisp_Object, Lisp_Object, bool, Lisp_Object, Lisp_Object, Lisp_Object); -extern int overlay_touches_p (ptrdiff_t); +extern bool overlay_touches_p (ptrdiff_t); extern Lisp_Object Vbuffer_alist; extern Lisp_Object set_buffer_if_live (Lisp_Object); extern Lisp_Object other_buffer_safely (Lisp_Object); ------------------------------------------------------------ revno: 109761 committer: Paul Eggert branch nick: trunk timestamp: Thu 2012-08-23 21:05:25 -0700 message: Fix file time stamp problem with bzr and CVS (Bug#12001). * vc/vc-cvs.el (vc-cvs-parse-entry): Ignore subsecond information in the file's time stamp, since the version control system loses that information. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-22 23:30:47 +0000 +++ lisp/ChangeLog 2012-08-24 04:05:25 +0000 @@ -1,3 +1,10 @@ +2012-08-24 Paul Eggert + + Fix file time stamp problem with bzr and CVS (Bug#12001). + * vc/vc-cvs.el (vc-cvs-parse-entry): Ignore subsecond information + in the file's time stamp, since the version control system loses + that information. + 2012-08-22 Juri Linkov * info.el (Info-fontify-node): Hide the suffix of the === modified file 'lisp/vc/vc-cvs.el' --- lisp/vc/vc-cvs.el 2012-07-11 23:13:41 +0000 +++ lisp/vc/vc-cvs.el 2012-08-24 04:05:25 +0000 @@ -1178,7 +1178,11 @@ (parse-time-string (concat time " +0000"))))) (cond ((and (not (string-match "\\+" time)) (car parsed-time) - (equal mtime (apply 'encode-time parsed-time))) + ;; Compare just the seconds part of the file time, + ;; since CVS file time stamp resolution is just 1 second. + (let ((ptime (apply 'encode-time parsed-time))) + (and (eq (car mtime) (car ptime)) + (eq (cadr mtime) (cadr ptime))))) (vc-file-setprop file 'vc-checkout-time mtime) (if set-state (vc-file-setprop file 'vc-state 'up-to-date))) (t ------------------------------------------------------------ revno: 109760 committer: Paul Eggert branch nick: trunk timestamp: Thu 2012-08-23 13:31:52 -0700 message: * bidi.c: Use bool for boolean. This is a bit more readable, and makes the text segment of bidi.o 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15). Presumably it's faster too. (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level): Now bool. (bidi_cache_find_level_change, bidi_cache_iterator_state) (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes) (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init) (bidi_explicit_dir_char, bidi_level_of_next_char) (bidi_find_other_level_edge, bidi_move_to_visually_next): Use bool for booleans, instead of int. * dispextern.h (bidi_init_it, bidi_paragraph_init) (bidi_unshelve_cache): Adjust decls to match code. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-23 08:33:56 +0000 +++ src/ChangeLog 2012-08-23 20:31:52 +0000 @@ -1,3 +1,20 @@ +2012-08-23 Paul Eggert + + * bidi.c: Use bool for boolean. + This is a bit more readable, and makes the text segment of bidi.o + 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15). + Presumably it's faster too. + (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level): + Now bool. + (bidi_cache_find_level_change, bidi_cache_iterator_state) + (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes) + (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init) + (bidi_explicit_dir_char, bidi_level_of_next_char) + (bidi_find_other_level_edge, bidi_move_to_visually_next): + Use bool for booleans, instead of int. + * dispextern.h (bidi_init_it, bidi_paragraph_init) + (bidi_unshelve_cache): Adjust decls to match code. + 2012-08-23 Martin Rudalics * keyboard.c (Fposn_at_x_y): Do not allow internal window as === modified file 'src/bidi.c' --- src/bidi.c 2012-07-15 14:41:08 +0000 +++ src/bidi.c 2012-08-23 20:31:52 +0000 @@ -63,7 +63,7 @@ #include "buffer.h" #include "dispextern.h" -static int bidi_initialized = 0; +static bool bidi_initialized = 0; static Lisp_Object bidi_type_table, bidi_mirror_table; @@ -82,10 +82,10 @@ /* UAX#9 says to search only for L, AL, or R types of characters, and ignore RLE, RLO, LRE, and LRO, when determining the base paragraph level. Yudit indeed ignores them. This variable is therefore set - by default to ignore them, but setting it to zero will take them - into account. */ -extern int bidi_ignore_explicit_marks_for_paragraph_level EXTERNALLY_VISIBLE; -int bidi_ignore_explicit_marks_for_paragraph_level = 1; + by default to ignore them, but clearing it will take them into + account. */ +extern bool bidi_ignore_explicit_marks_for_paragraph_level EXTERNALLY_VISIBLE; +bool bidi_ignore_explicit_marks_for_paragraph_level = 1; static Lisp_Object paragraph_start_re, paragraph_separate_re; static Lisp_Object Qparagraph_start, Qparagraph_separate; @@ -438,7 +438,7 @@ that is lower than LEVEL, and return its cache slot index. DIR is the direction to search, starting with the last used cache slot. If DIR is zero, we search backwards from the last occupied cache - slot. BEFORE, if non-zero, means return the index of the slot that + slot. BEFORE means return the index of the slot that is ``before'' the level change in the search direction. That is, given the cached levels like this: @@ -448,9 +448,9 @@ and assuming we are at the position cached at the slot marked with C, searching backwards (DIR = -1) for LEVEL = 2 will return the index of slot B or A, depending whether BEFORE is, respectively, - non-zero or zero. */ + true or false. */ static ptrdiff_t -bidi_cache_find_level_change (int level, int dir, int before) +bidi_cache_find_level_change (int level, int dir, bool before) { if (bidi_cache_idx) { @@ -512,7 +512,7 @@ } static inline void -bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved) +bidi_cache_iterator_state (struct bidi_it *bidi_it, bool resolved) { ptrdiff_t idx; @@ -690,11 +690,11 @@ /* Restore the cache state from a copy stashed away by bidi_shelve_cache, and free the buffer used to stash that copy. - JUST_FREE non-zero means free the buffer, but don't restore the + JUST_FREE means free the buffer, but don't restore the cache; used when the corresponding iterator is discarded instead of being restored. */ void -bidi_unshelve_cache (void *databuf, int just_free) +bidi_unshelve_cache (void *databuf, bool just_free) { unsigned char *p = databuf; @@ -802,7 +802,7 @@ /* Initialize the bidi iterator from buffer/string position CHARPOS. */ void -bidi_init_it (ptrdiff_t charpos, ptrdiff_t bytepos, int frame_window_p, +bidi_init_it (ptrdiff_t charpos, ptrdiff_t bytepos, bool frame_window_p, struct bidi_it *bidi_it) { if (! bidi_initialized) @@ -872,11 +872,10 @@ /* Count bytes in string S between BEG/BEGBYTE and END. BEG and END are zero-based character positions in S, BEGBYTE is byte position - corresponding to BEG. UNIBYTE, if non-zero, means S is a unibyte - string. */ + corresponding to BEG. UNIBYTE means S is a unibyte string. */ static inline ptrdiff_t bidi_count_bytes (const unsigned char *s, const ptrdiff_t beg, - const ptrdiff_t begbyte, const ptrdiff_t end, int unibyte) + const ptrdiff_t begbyte, const ptrdiff_t end, bool unibyte) { ptrdiff_t pos = beg; const unsigned char *p = s + begbyte, *start = p; @@ -900,10 +899,10 @@ /* Fetch and returns the character at byte position BYTEPOS. If S is non-NULL, fetch the character from string S; otherwise fetch the - character from the current buffer. UNIBYTE non-zero means S is a + character from the current buffer. UNIBYTE means S is a unibyte string. */ static inline int -bidi_char_at_pos (ptrdiff_t bytepos, const unsigned char *s, int unibyte) +bidi_char_at_pos (ptrdiff_t bytepos, const unsigned char *s, bool unibyte) { if (s) { @@ -923,9 +922,9 @@ specifies the character position of the next display string, or -1 if not yet computed. When the next character is at or beyond that position, the function updates DISP_POS with the position of the - next display string. DISP_PROP non-zero means that there's really + next display string. *DISP_PROP non-zero means that there's really a display string at DISP_POS, as opposed to when we searched till - DISP_POS without finding one. If DISP_PROP is 2, it means the + DISP_POS without finding one. If *DISP_PROP is 2, it means the display spec is of the form `(space ...)', which is replaced with u+2029 to handle it as a paragraph separator. STRING->s is the C string to iterate, or NULL if iterating over a buffer or a Lisp @@ -933,7 +932,7 @@ static inline int bidi_fetch_char (ptrdiff_t bytepos, ptrdiff_t charpos, ptrdiff_t *disp_pos, int *disp_prop, struct bidi_string_data *string, - int frame_window_p, ptrdiff_t *ch_len, ptrdiff_t *nchars) + bool frame_window_p, ptrdiff_t *ch_len, ptrdiff_t *nchars) { int ch; ptrdiff_t endpos @@ -1134,7 +1133,7 @@ R2L, just use that. Otherwise, determine the paragraph direction from the first strong directional character of the paragraph. - NO_DEFAULT_P non-zero means don't default to L2R if the paragraph + NO_DEFAULT_P means don't default to L2R if the paragraph has no strong directional characters and both DIR and bidi_it->paragraph_dir are NEUTRAL_DIR. In that case, search back in the buffer until a paragraph is found with a strong character, @@ -1145,10 +1144,10 @@ direction as the preceding paragraph, even though Emacs generally views the separator as not belonging to any paragraph. */ void -bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it, int no_default_p) +bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it, bool no_default_p) { ptrdiff_t bytepos = bidi_it->bytepos; - int string_p = bidi_it->string.s != NULL || STRINGP (bidi_it->string.lstring); + bool string_p = bidi_it->string.s || STRINGP (bidi_it->string.lstring); ptrdiff_t pstartbyte; /* Note that begbyte is a byte position, while end is a character position. Yes, this is ugly, but we are trying to avoid costly @@ -1221,8 +1220,8 @@ bidi_it->separator_limit = -1; bidi_it->new_paragraph = 0; - /* The following loop is run more than once only if NO_DEFAULT_P - is non-zero, and only if we are iterating on a buffer. */ + /* The following loop is run more than once only if NO_DEFAULT_P, + and only if we are iterating on a buffer. */ do { ptrdiff_t pos1; @@ -1320,7 +1319,7 @@ The rest of this file constitutes the core of the UBA implementation. ***********************************************************************/ -static inline int +static inline bool bidi_explicit_dir_char (int ch) { bidi_type_t ch_type; @@ -1345,7 +1344,7 @@ int current_level; int new_level; bidi_dir_t override; - int string_p = bidi_it->string.s != NULL || STRINGP (bidi_it->string.lstring); + bool string_p = bidi_it->string.s || STRINGP (bidi_it->string.lstring); /* If reseat()'ed, don't advance, so as to start iteration from the position where we were reseated. bidi_it->bytepos can be less @@ -2189,7 +2188,7 @@ ptrdiff_t nc = bidi_it->nchars; struct bidi_string_data bs = bidi_it->string; bidi_type_t chtype; - int fwp = bidi_it->frame_window_p; + bool fwp = bidi_it->frame_window_p; int dpp = bidi_it->disp_prop; if (bidi_it->nchars <= 0) @@ -2268,8 +2267,8 @@ return level; } -/* Move to the other edge of a level given by LEVEL. If END_FLAG is - non-zero, we are at the end of a level, and we need to prepare to +/* Move to the other edge of a level given by LEVEL. If END_FLAG, + we are at the end of a level, and we need to prepare to resume the scan of the lower level. If this level's other edge is cached, we simply jump to it, filling @@ -2289,7 +2288,7 @@ function moves to point C, whereas the UAX#9 ``level 2 run'' ends at point B. */ static void -bidi_find_other_level_edge (struct bidi_it *bidi_it, int level, int end_flag) +bidi_find_other_level_edge (struct bidi_it *bidi_it, int level, bool end_flag) { int dir = end_flag ? -bidi_it->scan_dir : bidi_it->scan_dir; ptrdiff_t idx; @@ -2363,7 +2362,7 @@ scanning the text whenever we find a level change. */ if (new_level != old_level) { - int ascending = new_level > old_level; + bool ascending = new_level > old_level; int level_to_search = ascending ? old_level + 1 : old_level; int incr = ascending ? 1 : -1; int expected_next_level = old_level + incr; === modified file 'src/dispextern.h' --- src/dispextern.h 2012-08-07 07:33:18 +0000 +++ src/dispextern.h 2012-08-23 20:31:52 +0000 @@ -3002,14 +3002,14 @@ /* Defined in bidi.c */ -extern void bidi_init_it (ptrdiff_t, ptrdiff_t, int, struct bidi_it *); +extern void bidi_init_it (ptrdiff_t, ptrdiff_t, bool, struct bidi_it *); extern void bidi_move_to_visually_next (struct bidi_it *); -extern void bidi_paragraph_init (bidi_dir_t, struct bidi_it *, int); +extern void bidi_paragraph_init (bidi_dir_t, struct bidi_it *, bool); extern int bidi_mirror_char (int); extern void bidi_push_it (struct bidi_it *); extern void bidi_pop_it (struct bidi_it *); extern void *bidi_shelve_cache (void); -extern void bidi_unshelve_cache (void *, int); +extern void bidi_unshelve_cache (void *, bool); /* Defined in xdisp.c */ ------------------------------------------------------------ revno: 109759 committer: martin rudalics branch nick: trunk timestamp: Thu 2012-08-23 10:33:56 +0200 message: In Fposn_at_x_y do not allow internal window as argument. * keyboard.c (Fposn_at_x_y): Do not allow internal window as argument. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-23 08:27:08 +0000 +++ src/ChangeLog 2012-08-23 08:33:56 +0000 @@ -1,3 +1,8 @@ +2012-08-23 Martin Rudalics + + * keyboard.c (Fposn_at_x_y): Do not allow internal window as + argument. + 2012-08-23 Paul Eggert * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean. === modified file 'src/keyboard.c' --- src/keyboard.c 2012-08-21 10:21:04 +0000 +++ src/keyboard.c 2012-08-23 08:33:56 +0000 @@ -11251,7 +11251,7 @@ if (WINDOWP (frame_or_window)) { - struct window *w = decode_valid_window (frame_or_window); + struct window *w = decode_live_window (frame_or_window); XSETINT (x, (XINT (x) + WINDOW_LEFT_EDGE_X (w) ------------------------------------------------------------ revno: 109758 committer: Paul Eggert branch nick: trunk timestamp: Thu 2012-08-23 01:27:08 -0700 message: * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean. * atimer.h: Include . diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-22 16:05:04 +0000 +++ src/ChangeLog 2012-08-23 08:27:08 +0000 @@ -1,3 +1,8 @@ +2012-08-23 Paul Eggert + + * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean. + * atimer.h: Include . + 2012-08-22 Dan Nicolaescu * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to === modified file 'src/atimer.c' --- src/atimer.c 2012-07-10 23:24:36 +0000 +++ src/atimer.c 2012-08-23 08:27:08 +0000 @@ -408,7 +408,7 @@ some systems like HPUX (see process.c). */ void -turn_on_atimers (int on) +turn_on_atimers (bool on) { if (on) { === modified file 'src/atimer.h' --- src/atimer.h 2012-01-19 07:21:25 +0000 +++ src/atimer.h 2012-08-23 08:27:08 +0000 @@ -20,6 +20,7 @@ #define EMACS_ATIMER_H #include "systime.h" /* for EMACS_TIME */ +#include /* Forward declaration. */ @@ -74,7 +75,7 @@ void cancel_atimer (struct atimer *); void do_pending_atimers (void); void init_atimer (void); -void turn_on_atimers (int); +void turn_on_atimers (bool); void stop_other_atimers (struct atimer *); Lisp_Object unwind_stop_other_atimers (Lisp_Object); ------------------------------------------------------------ revno: 109757 fixes bug: http://debbugs.gnu.org/12187 committer: Juri Linkov branch nick: trunk timestamp: Thu 2012-08-23 02:30:47 +0300 message: * lisp/info.el (Info-fontify-node): Hide the suffix of the Info file name in the header line. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-22 17:55:19 +0000 +++ lisp/ChangeLog 2012-08-22 23:30:47 +0000 @@ -1,3 +1,8 @@ +2012-08-22 Juri Linkov + + * info.el (Info-fontify-node): Hide the suffix of the + Info file name in the header line. (Bug#12187) + 2012-08-22 Glenn Morris * calendar/cal-tex.el (cal-tex-weekly-common): === modified file 'lisp/info.el' --- lisp/info.el 2012-08-21 00:12:42 +0000 +++ lisp/info.el 2012-08-22 23:30:47 +0000 @@ -4527,7 +4527,17 @@ ((not (bobp)) ;; Hide the punctuation at the end, too. (skip-chars-backward " \t,") - (put-text-property (point) header-end 'invisible t)))))) + (put-text-property (point) header-end 'invisible t) + ;; Hide the suffix of the Info file name. + (beginning-of-line) + (if (re-search-forward + (format "File: %s\\([^,\n\t]+\\)," + (if (stringp Info-current-file) + (file-name-nondirectory Info-current-file) + Info-current-file)) + header-end t) + (put-text-property (match-beginning 1) (match-end 1) + 'invisible t))))))) ;; Fontify titles (goto-char (point-min))