Eli Zaretskii [Sat, 9 Jan 2010 16:24:37 +0000 (11:24 -0500)]
Recompute prev_stop and base_level_stop when the iterator is
repositioned to a different location.
xdisp.c (handle_stop_backwards): Add a prototype.
(reseat): call handle_stop_backwards to recompute prev_stop and
base_level_stop for the new position. Solves the crash when
scrolling backwards.
Make line<->pixel_y conversion macros aware of native menu/tool bars.
They are placed above the internal border. This supersedes special
treatment of native tool bars in the display code.
This fixes wrong display position of native menu bars and bogus mouse
highlighting of native tool bars, both of which can be found when
internal border width is large. Also it fixes wrong flashed part on
visible bell with native menu bars.
* frame.h (FRAME_TOP_MARGIN_HEIGHT): New macro.
(FRAME_LINE_TO_PIXEL_Y, FRAME_PIXEL_Y_TO_LINE): Take account of pseudo
windows above internal border.
* window.h (WINDOW_MENU_BAR_P, WINDOW_TOOL_BAR_P): New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y): Take account of pseudo
windows above internal border.
* xdisp.c (get_glyph_string_clip_rects, init_glyph_string): Don't treat
tool bar windows specially.
* xfns.c (x_set_tool_bar_lines): Take account of menu bar height.
* xterm.c (x_after_update_window_line): Don't treat tool bar windows
specially.
(XTflash): Take account of menu bar height.
* w32term.c (x_after_update_window_line): Don't treat tool bar windows
specially.
* vc-dir.el (vc-dir-prepare-status-buffer): Pass a (fake) filename
to `create-file-buffer' as it expects, not just a buffer name.
(vc-dir-mode): Include the buffer name in `list-buffers-directory',
to help uniquify.
Jan Djärv [Wed, 6 Jan 2010 19:38:39 +0000 (20:38 +0100)]
Fix slowdown and wrong font choosed by XSETTINGS changes. bug #5157.
* font.c (font_open_entity): Enable chache and call cached_font_ok
for the driver if defined.
(QCuser_spec): New symbol.
(font_spec_from_name): Save name as user-spec.
(font_load_for_lface): Keep user-spec instead of name.
(font_open_by_name): Save name as user-spec.
(syms_of_font): Initialize QCuser_spec.
Jan Djärv [Tue, 5 Jan 2010 14:16:30 +0000 (15:16 +0100)]
Handle change of internal-border width when maximized.
* xterm.c (x_new_font): Move code for setting rows/cols before
resizing ...
(x_set_window_size): ... to here. bug #2568.
* gtkutil.c (xg_clear_under_internal_border): New function.
(xg_frame_resized, xg_frame_set_char_size): Call
xg_clear_under_internal_border.
(xg_update_scrollbar_pos): Clear under old scroll bar position.
Stefan Monnier [Mon, 4 Jan 2010 18:18:38 +0000 (13:18 -0500)]
Avoid dubious uses of save-excursions.
* doc/lispref/positions.texi (Excursions): Recommend the use of
save-current-buffer if applicable.
* doc/lispref/text.texi (Clickable Text): Fix the example code which used
save-excursion in a naive way which sometimes preserves point and
sometimes not.
* doc/lispref/variables.texi (Creating Buffer-Local):
* doc/lispref/os.texi (Session Management):
* doc/lispref/display.texi (GIF Images):
* doc/lispref/control.texi (Cleanups): Use (save|with)-current-buffer.
* doc/misc/gnus.texi (Posting Styles): Use with-current-buffer.
* doc/misc/calc.texi (Defining Simple Commands): Prefer save-current-buffer.
Stefan Monnier [Mon, 4 Jan 2010 17:38:20 +0000 (12:38 -0500)]
(xd_remove_watch): Avoid trying to convert a void* to
Lisp_Object, preferring to convert a lisp_Object to a void* instead.
(Fdbus_init_bus): Use XHASH to get a scalar value from a Lisp_Object.
Dan Nicolaescu [Mon, 4 Jan 2010 06:40:30 +0000 (22:40 -0800)]
(vc-bzr-shelve-map): Change binding for vc-bzr-shelve-apply-at-point.
(vc-bzr-shelve-menu-map):
(vc-bzr-dir-extra-headers): Improve menu and tooltip text.
(vc-bzr-shelve-apply): Make prompt more explicit.
Michael Albinus [Sun, 3 Jan 2010 19:27:17 +0000 (20:27 +0100)]
* dbusbind.c (xd_add_watch): Improve debug message.
(xd_remove_watch): Improve debug message. If DATA is the session
bus, unset D-Bus session environment.
(Fdbus_init_bus): Pass the bus as argument to
dbus_connection_set_watch_functions. (Bug#5283)
Chong Yidong [Sat, 2 Jan 2010 20:14:54 +0000 (15:14 -0500)]
* net/browse-url.el (browse-url-encode-url): Don't escape commas.
They are valid characters in URL paths (rfc3986), and at least
Firefox does not understand the encoded version (Bug#3166).
Chong Yidong [Sat, 2 Jan 2010 19:40:59 +0000 (14:40 -0500)]
Allow use of "end" keyword for terminating Octave-mode blocks.
* progmodes/octave-mod.el (octave-end-keywords)
(octave-block-begin-or-end-regexp, octave-block-match-alist): Add
"end" keyword (Bug#3061).
(octave-end-as-array-index-p): New function.
(calculate-octave-indent): Use it.
Karl Fogel [Sat, 2 Jan 2010 19:14:13 +0000 (14:14 -0500)]
* lisp/bookmark.el: Consistently put the text property on the bookmark name.
(bookmark-bmenu-marks-width): Bump back to 2, to include annotation marks.
(bookmark-bmenu-hide-filenames): Adjust for above, and put the text
property on the bookmark name, instead of not putting it at all.
(bookmark-bmenu-list): Fix where we put the text property.
Karl Fogel [Sat, 2 Jan 2010 18:52:32 +0000 (13:52 -0500)]
* lisp/bookmark.el: Show modified state of bookmark buffer more accurately.
(bookmark-bmenu-list): Initialize buffer-modified-p properly.
(bookmark-send-edited-annotation): Mark bookmark-alist as modified.
(with-buffer-modified-unmodified): New macro.
(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames,
bookmark-bmenu-mark, bookmark-bmenu-unmark, bookmark-bmenu-delete):
Use new macro to preserve the buffer-modified state.
Eli Zaretskii [Sat, 2 Jan 2010 15:57:35 +0000 (10:57 -0500)]
Continue working on handling of properties in bidi iteration.
Region display and extension seems to work.
Solved a crash in bidirectional display of etc/HELLO.
(HELLO display still not 100% OK, e.g. near Kannada.)
.gdbinit (pitx): Display some bidi information about the
iterator.
dispextern.h (BIDI_AT_BASE_LEVEL): Enclose definition in
parentheses.
xdisp.c (handle_stop_backwards): Save and restore it->current
and it->position, instead of expecting the caller to do that.
(next_element_from_buffer): When moving across stop_charpos,
record it in prev_stop. When IT_CHARPOS backs up, call
handle_stop_backwards only if above the base embedding level.
This solves the crash while displaying etc/HELLO in bidi mode.
Karl Fogel [Sat, 2 Jan 2010 05:00:55 +0000 (00:00 -0500)]
* lisp/bookmark.el (bookmark-bmenu-marks-width): Define to 1, not 2.
(bookmark-bmenu-list, bookmark-bmenu-bookmark): Calculate property
positions by using `bookmark-bmenu-marks-width', instead of hardcoding.
This fixes the `bookmark-bmenu-execute-deletions' bug reported here:
http://lists.gnu.org/archive/html/emacs-devel/2009-12/msg00819.html
From: Sun Yijiang <sunyijiang {_AT_} gmail.com>
To: emacs-devel {_AT_} gnu.org
Subject: bookmark.el bug report
Date: Mon, 28 Dec 2009 14:19:16 +0800
Message-ID: 5065e2900912272219y3734fc9fsdaee41167ef99ad7@mail.gmail.com
Karl Fogel [Sat, 2 Jan 2010 04:36:17 +0000 (23:36 -0500)]
* lisp/bookmark.el: Improvements suggested by Drew Adams:
(bookmark-bmenu-ensure-position): New name for
`bookmark-bmenu-check-position'. Just ensure the position;
don't return any meaningful value.
(bookmark-bmenu-header-height, bookmark-bmenu-marks-width): New constants.
Chong Yidong [Fri, 1 Jan 2010 20:42:22 +0000 (15:42 -0500)]
* lisp/gnus/message.el (message-exchange-point-and-mark): Call
exchange-point-and-mark with an argument rather than setting
mark-active by hand (Bug#5175).
Eli Zaretskii [Fri, 1 Jan 2010 15:04:53 +0000 (10:04 -0500)]
Retrospective commit from 2009-12-26.
Redesign handle_stop_backwards.
Fix character mirroring for non-ASCII characters.
xdisp.c (handle_stop_backwards): Call compute_stop_pos in the
loop, instead of calling handle_stop. Call handle_stop only once,
after the loop.
(next_element_from_buffer): Don't call handle_stop_backwards if at
stop position. If base_level_stop is zero, set it to 1.
term.c (append_glyph): Fill resolved_level and bidi_type slots
of struct glyph for unidirectional display.
Eli Zaretskii [Fri, 1 Jan 2010 14:46:25 +0000 (09:46 -0500)]
Retrospective commit from 2009-12-12.
Begin working on faces support. First version of handle_stop_backwards.
Rearrange struct bidi_it for more efficient push/pop ops.
dispextern.h (struct it): New members prev_stop and
base_level_stop.
xdisp.c (handle_stop_backwards): New function.
(next_element_from_buffer): Handle the situation where we
overstepped stop_charpos due to non-linearity of the bidi
iteration. Likewise for when we back up beyond the previous
stop_charpos.
(reseat_1, pop_it, push_it): Set prev_stop and base_level_stop.
dispextern.h (BIDI_AT_BASE_LEVEL): New macro.
bidi.c (bidi_copy_it): Fix compiler warning due to cast of a
pointer to `int'. Don't preserve the first_elt member, as it is
no longer copied, because its position in the structure was
changed, see below.
dispextern.h (struct bidi_it): Move first_elt, new_paragraph,
separator_limit, and paragraph_dir to after bidi_stack. Add a
note that anything beyond the level stack is not preserved when
the bidi iterator state is copied/saved.
Eli Zaretskii [Fri, 1 Jan 2010 11:54:22 +0000 (06:54 -0500)]
Retrospective commit from 2009-11-07.
More fixes for iteration near ZV.
bidi.c (bidi_paragraph_init): Don't overstep end of buffer.
Treat end of buffer as a NEUTRAL_B character.
(bidi_resolve_explicit): Don't special-case ZV when bidi_it->type
is NEUTRAL_B, since bidi_set_paragraph_end no longer sets the
new_paragraph flag.
Eli Zaretskii [Fri, 1 Jan 2010 11:49:38 +0000 (06:49 -0500)]
Retrospective commit from 2009-10-31.
Continue debugging set_cursor_from_row.
Continue debugging display of R2L glyph rows.
xdisp.c (display_line): Always extend reversed_p rows to the end
of line.
(set_cursor_from_row): In R2L rows that don't display text, put
the cursor on the rightmost glyph.
Eli Zaretskii [Fri, 1 Jan 2010 11:45:36 +0000 (06:45 -0500)]
Retrospective commit from 2009-10-24.
Continue working on set_cursor_from_row.
Cleanup of resolved_level and bidi_type members of struct glyph.
xdisp.c (set_cursor_from_row): Fix off-by-one error when
skipping over non-character glyphs at end of a reversed row.
dispextern.h (struct glyph): The `resolved_level' member needs
only 5 bits, not 6. The `bidi_type' member needs only 3 bits.
(bidi_type_t): Rearrange so that types that can appear in the
resolved type are at the beginning and have values less than 8.
Eli Zaretskii [Fri, 1 Jan 2010 11:39:56 +0000 (06:39 -0500)]
Retrospective commit from 2009-10-17.
Continue working on display of R2L glyph rows. Reverse glyphs in
term.c:append_glyph rather than in extend_face_to_end_of_line.
Fix bidi iteration near BEGV and ZV.
dispextern.h (struct glyph): New members resolved_level and
bidi_type.
xdisp.c (append_glyph, append_composite_glyph)
(produce_image_glyph, append_stretch_glyph): Set them.
term.c (append_glyph): Ditto.
xdisp.c (display_line, next_element_from_buffer): Set the glyph
row's reversed_p flag if the paragraph base direction is odd.
(extend_face_to_end_of_line): Don't reverse the glyphs here.
term.c (append_glyph): Reverse glyphs here.
bidi.c (bidi_get_next_char_visually): Don't exit early when at ZV.
(bidi_paragraph_init): Don't step over a newline if at BEGV.
(bidi_paragraph_init): Handle empty buffers.
Eli Zaretskii [Fri, 1 Jan 2010 11:35:03 +0000 (06:35 -0500)]
Retrospective commit from 2009-10-10.
Continue working on set_cursor_from_row.
Disable redisplay optimizations that interfere with R2L glyph rows.
Misc cleanups in bidi.c.
xdisp.c (set_cursor_from_row): Skip over glyphs near end of row
with integer OBJECT even if their CHARPOS is zero.
bidi.c (bidi_cache_iterator_state): Don't cache NEW_PARAGRAPH.
Abort if someone tries to add a cached state whose position is not
the immediate successor to that of the last cached state.
(bidi_paragraph_init): Don't bail out too early after a reseat.
xdisp.c (text_outside_line_unchanged_p, try_window_id): Disable
optimizations if we are reordering bidirectional text and the
paragraph direction can be affected by the change.
Eli Zaretskii [Fri, 1 Jan 2010 11:27:51 +0000 (06:27 -0500)]
Retrospective commit from 2009-10-08.
Finish up working on paragraph's base direction.
Start working on display of right-to-left glyph rows.
Rewrite set_cursor_from_row to support bidi.
xdisp.c (string_buffer_position_lim): New function.
(string_buffer_position): Most of code moved to
string_buffer_position_lim. Last argument and return value are
now EMACS_INT; all callers changed.
(set_cursor_from_row): Rewritten to support bidirectional text and
reversed glyph rows.
dispextern.h <string_buffer_position>: Update prototype.
bidi.c (bidi_paragraph_init): Fix initialization of POS.
dispextern.h (struct glyph_row): New member reversed_p.
buffer.c (syms_of_buffer): Remove DEFVAR_LISP_NOPRO for
default-direction-reversed, default-bidi-display-reordering, and
default-paragraph-direction.
Eli Zaretskii [Fri, 1 Jan 2010 11:22:52 +0000 (06:22 -0500)]
Retrospective commit from 2009-10-05.
Continue working on paragraph base direction.
Support per-buffer default paragraph direction.
buffer.h (struct buffer): New member paragraph_direction.
buffer.c (init_buffer_once): Initialize it.
(syms_of_buffer): Declare Lisp variables
default-paragraph-direction and paragraph-direction.
dispextern.h (struct it): New member paragraph_embedding.
xdisp.c (init_iterator): Initialize it from the buffer's value
of paragraph-direction.
<Qright_to_left, Qleft_to_right>: New variables.
(syms_of_xdisp): Initialize and staticpro them.
(set_iterator_to_next, next_element_from_buffer): Use the value of
paragraph_embedding to determine the paragraph direction.
bidi.c (bidi_line_init): Fix second argument to
bidi_set_sor_type.
(bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
(bidi_get_next_char_visually): Record the last character of the
separator in separator_limit, not the character after that.
(bidi_find_paragraph_start): Accept character and byte positions
instead of the whole iterator stricture. All callers changed.
Eli Zaretskii [Fri, 1 Jan 2010 11:17:13 +0000 (06:17 -0500)]
Retrospective commit from 2009-10-04.
Continue working on determining paragraph's base direction.
bidi.c (bidi_at_paragraph_end): Check for paragraph-start if
paragraph-separate failed to match. Return the length of the
matched separator.
(bidi_line_init): New function.
(bidi_paragraph_init): Use bidi_line_init. Do nothing if in the
middle of a paragraph-separate sequence. Don't override existing
paragraph direction if no strong characters found in this
paragraph. Set separator_limit according to what
bidi_at_paragraph_end returns. Reset new_paragraph flag when a
new paragraph is found.
(bidi_init_it): Reset separator_limit.
dispextern.h (struct bidi_it): New member separator_limit.
bidi.c (bidi_find_paragraph_start): Return the byte position of
the paragraph beginning.
xdisp.c (set_iterator_to_next): Call bidi_paragraph_init if the
new_paragraph flag is set in the bidi iterator.
bidi.c (bidi_at_paragraph_end, bidi_find_paragraph_start): Use
the buffer-local value of paragraph-start and paragraph-separate.
Eli Zaretskii [Fri, 1 Jan 2010 11:06:48 +0000 (06:06 -0500)]
Retrospective commit from 2009-10-03.
Detect paragraph start and paragraph separators (part of determining
paragraph base direction).
(The commit of window.h belongs to the original changes by Kenichi Handa,
it was forgotten earlier.)
bidi.c (bidi_set_paragraph_end): Don't set the new_paragraph
flag in the iterator.
(bidi_init_it): Set the new_paragraph flag.
(bidi_at_paragraph_end): Arguments are now character and byte
position of the next character. All callers changed.
(bidi_resolve_explicit): Don't call bidi_at_paragraph_end, and
don't behave as if at paragraph end if it returns true.
(bidi_get_next_char_visually): Don't call bidi_paragraph_init if
new_paragraph flag is set. Set new_paragraph flag when at end of
a paragraph.
<fallback_paragraph_start_re, fallback_paragraph_separate_re>: New
variables.
<Qparagraph_start, Qparagraph_separate>: New variables.
(bidi_initialize): Initialize and staticpro them.
dispextern.h <struct bidi_it>: New element paragraph_dir. Make
positional elements EMACS_INT.
bidi.c <bidi_overriding_paragraph_direction>: Delete.
Eli Zaretskii [Fri, 1 Jan 2010 11:01:34 +0000 (06:01 -0500)]
Retrospective commit from 2009-09-27.
Support character mirroring.
Support iteration that starts in the middle of a line.
Misc cleanups.
xdisp.c (next_element_from_buffer): If called not at line
beginning, start bidi iteration from line beginning.
bidi.c (bidi_paragraph_init): Use
bidi_overriding_paragraph_direction instead of a literal zero.
(bidi_initialize): Fix some character types, per Unicode 5.x.
(bidi_get_type): Abort if called with invalid character code.
dispextern.h: Add prototype of bidi_mirror_char.
xdisp.c (get_next_display_element): Mirror characters whose
resolved type is STRONG_R.
Eli Zaretskii [Fri, 1 Jan 2010 10:57:17 +0000 (05:57 -0500)]
Retrospective commit from 2009-09-26.
Continued working on initialization.
Started working on paragraph direction initialization.
bidi.c (bidi_paragraph_init): Don't set bidi_it->ch_len. Abort
if called not at beginning of a new paragraph.
(bidi_get_next_char_visually): Prepare and use a sentinel iterator
state when first_elt flag is set.
dispextern.h (struct bidi_it): New struct member first_elt.
bidi.c (bidi_init_it): Initialize bidi_it->first_elt.
(bidi_copy_it): Don't copy the first_elt flag.
xdisp.c (reseat_1): Initialize bidi_it.first_elt. Move bidi
scan start code from here...
(next_element_from_buffer): ...to here. Use bidi_it.first_elt flag.
Eli Zaretskii [Thu, 31 Dec 2009 21:20:15 +0000 (16:20 -0500)]
Retrospective commit from 2009-09-19.
Begin work on bidi initialization and other cleanup.
Remove all STANDALONE code from bidi.c.
xdisp.c (init_iterator): Call bidi_init_it. Set
bidi_it->bytepos if buffer position specified.
(reseat_1): Don't call bidi_init_it. Call bidi_paragraph_init
instead. Move back to preceding character before the call to
bidi_get_next_char_visually.
bidi.c: Remove all STANDALONE parts.
(bidi_init_it): Init bidi_it->charpos and bidi_it->bytepos to -1.
Don't call bidi_paragraph_init. Change arguments.
(bidi_paragraph_init): Remove code for negative pos.
dispextern.h <bidi_it>: Rename orig_type to type_after_w1 and
pristine_type to orig_type.
Eli Zaretskii [Thu, 31 Dec 2009 21:14:26 +0000 (16:14 -0500)]
Retrospective commit from 2009-09-12.
Undo changes from 2009-09-11. Set row->end and row->start in
xdisp.c:display_line.
dispnew.c (direct_output_for_insert): Give up if we are
reordering bidirectional text.
dispextern.h (IT_STACK_SIZE): Enlarge to 5.
xdisp.c (display_line): Set row->end and it->start for the next
row to the next character in logical order. If we are reordering
bidi text, push and pop the iterator before and after momentarily
iterating in logical order.
Eli Zaretskii [Thu, 31 Dec 2009 21:09:28 +0000 (16:09 -0500)]
Retrospective commit from 2009-08-12.
An (unsuccessful) attempt to solve the issue with row->start and row->end.
xdisp.c (set_iterator_to_next, reseat, reseat_1)
(reseat_at_next_visible_line_start): Accept additional argument
force_logical_p; all callers changed. If force_logical_p is
non-zero, force iteration in buffer's logical order even in bidi
buffers.
dispnew.c (direct_output_for_insert): Call set_iterator_to_next
with additional argument zero.
dispextern.h (set_iterator_to_next): Now accepts an additional
argument.
Eli Zaretskii [Thu, 31 Dec 2009 20:49:08 +0000 (15:49 -0500)]
Retrospective commit from 2009-08-22.
Staticpro bidi_char_table, add type checking where bidi type is assigned.
bidi.c (bidi_initialize): staticpro bidi_char_table.
(bidi_check_type): New function.
(bidi_cache_iterator_state, bidi_remember_char)
(bidi_resolve_explicit_1, bidi_resolve_explicit)
(bidi_resolve_weak, bidi_resolve_neutral)
(bidi_level_of_next_char): Use it to validate the bidi type
assigned to the iterator.