Commit graph

28784 commits

Author SHA1 Message Date
YAMAMOTO Mitsuharu
5b253e9c5c xfns.c (Fx_show_tip): Subtract last glyph's width only when it is for padding. 2010-04-10 19:59:46 +09:00
YAMAMOTO Mitsuharu
6eff5c3dcd Don't abort try_window with fonts change when showing tooltip (Bug#2423).
* dispextern.h (TRY_WINDOW_CHECK_MARGINS)
(TRY_WINDOW_IGNORE_FONTS_CHANGE): New defines.

* xdisp.c (try_window): Change arg from CHECK_MARGINS to FLAGS.
Don't abort with fonts change if TRY_WINDOW_IGNORE_FONTS_CHANGE is
set in FLAGS.  Callers with non-zero CHECK_MARGINS changed to use
TRY_WINDOW_CHECK_MARGINS.

* xfns.c (Fx_show_tip): Call try_window with TRY_WINDOW_IGNORE_FONTS_CHANGE.
2010-04-10 19:52:30 +09:00
YAMAMOTO Mitsuharu
5634ff8508 xfns.c (Fx_show_tip): Undo last change. 2010-04-10 19:39:16 +09:00
Jan D
b13aef5499 Fix showing the complete tip the first time, bug #2423.
* xfns.c (Fx_show_tip): Call try_window in a loop until
fonts_changed_p is zero (Bug#2423).
2010-04-09 18:49:06 +02:00
Eli Zaretskii
21d2848427 Fix bug#5856: don't dereference glyphs beyond end of glyph_row.
xdisp.c (set_cursor_from_row): Don't dereference glyphs beyond
 the end of TEXT_AREA.  (Bug#5856)
2010-04-09 00:14:33 +03:00
Jan Djärv
0269ef7730 * xsettings.c (XSETTINGS_FONT_NAME): Move XSETTINGS_FONT_NAME out of HAVE_GCONF. 2010-04-08 20:22:51 +02:00
Eli Zaretskii
5930fe974d Fix crash due to incorrect resolution of type of NSM characters (bug#5858).
bidi.c (bidi_resolve_weak): Use prev.type_after_w1, instead of
 prev.orig_type, for resolving type of NSM.
2010-04-08 20:35:10 +03:00
Jan Djärv
99852628a8 Lucid menus can now use Xft for fonts.
* xsettings.c (current_font, SYSTEM_FONT, XSETTINGS_FONT_NAME): New.
(parse_xft_settings): Also check for XSETTINGS_FONT_NAME and save that
in current_font.
(init_gconf): Read value of SYSTEM_FONT and save it in current_font.
(Ffont_get_system_normal_font, xsettings_get_system_normal_font): New
functions.
(syms_of_xsettings): Initialize current_font. defsubr
Sfont_get_system_normal_font.

* xsettings.h (Ffont_get_system_normal_font,
xsettings_get_system_normal_font): Declare.

* xfns.c (extern xlwmenu_default_font): Remove.
(Fx_create_frame): Remove setting of xlwmenu_default_font, moved
to xlwmenu.c.

* menu.c (digest_single_submenu): If USE_LUCID and HAVE_XFT, encode
menu items in UTF-8.

* xmenu.c: include xsettings.h and xlwmenu.h if USE_LUCID.
(apply_systemfont_to_menu): New function.
(set_frame_menubar, create_and_show_popup_menu): Call
apply_systemfont_to_menu.

* xlwmenu.c (xlwmenu_default_font): Make static.
(xlwMenuResources): Add XtNfaceName and XtNdefaultFace.
(string_width): Use XftTextExtentsUtf8 if HAVE_XFT.
(MENU_FONT_HEIGHT, MENU_FONT_ASCENT): Add versions for
HAVE_XFT.
(size_menu): Set max_rest_width in window_state structure.
(display_menu_item): If HAVE_XFT and xft_draw is set, use
XftDrawRect and XftDrawStringUtf8 to draw text.
(make_windows_if_needed): Set max_rest_width and xft_draw
in windows[i].
(openXftFont): New.
(XlwMenuInitialize): Call openXftFont if HAVE_XFT. If mw->menu.font
is not set, load font fixed and save it in xlwmenu_default_font.
(XlwMenuInitialize): Set max_rest_width and xft_draw in windows[0].
(XlwMenuClassInitialize): Initialize xlwmenu_default_font.
(XlwMenuRealize): Set xft_fg, xft_bg, xft_disabled_fg and
windows[0].xft_draw if xft_font is set.
(XlwMenuDestroy): Destroy all xft_draw and close xft_font.
(facename_changed): New.
(XlwMenuSetValues): Call facename_changed. If face name did change,
close old fonts and destroy xft_draw:s.  Then create new ones.

* xlwmenu.h (XtNfaceName, XtCFaceName, XtNdefaultFace,
XtCDefaultFace): New.

* xlwmenuP.h (_window_state): Add max_rest_width and xft_draw.
(_XlwMenu_part): Add faceName,xft_fg, xft_bg, xft_disabled_fg and
xft_font.

* xresources.texi (Lucid Resources): Mention faceName to set Xft fonts.
2010-04-08 18:20:32 +02:00
Jan D
7fc874c42c Fix resizing for X and non-Gtk+ build. Bug #5848.
* frame.h (FRAME_TEXT_LINES_TO_PIXEL_HEIGHT): Don't use
  FRAME_LINE_TO_PIXEL_Y.

* xterm.c (x_set_window_size_1): Don't add border_width/height to
  pixelwidth/height.
2010-04-07 13:39:26 +02:00
Dan Nicolaescu
5e5a3b92e4 Simplify code for HP machines.
* m/hp800.h (LOAD_AVE_TYPE, LOAD_AVE_CVT, NO_REMAP): Do not define
for GNU_LINUX, not needed.
(UNEXEC, NEED_BSDTTY): Move definitions...
* s/hpux10-20.h (UNEXEC, NEED_BSDTTY): ... here.
2010-04-06 23:11:45 -07:00
Dan Nicolaescu
863bf4810a * m/iris4d.h (UNEXEC): Move definition ...
* s/irix6-5.h (UNEXEC): ... here.
2010-04-06 23:01:30 -07:00
Jan D
ac61e7e14f xfns.c (set_machine_and_pid_properties): Fix parantesis 2010-04-05 09:35:53 +02:00
Jan Djärv
6c1b5a1c01 Move declaration before other statements. 2010-04-04 17:29:42 +02:00
Jan Djärv
3e6bec3b8c Set WM_CLIENT_MACHINE and _NET_WM_PID properties (Bug#5828).
* xfns.c (set_machine_and_pid_properties): New function.
         (Fx_create_frame): Call set_machine_and_pid_properties.
2010-04-04 12:47:12 +02:00
Eli Zaretskii
feb72cfb93 Improve commentary of handle_stop_backwards. 2010-04-04 12:30:38 +03:00
Eli Zaretskii
1502b81937 Fix infloop in bidi buffers with vertical cursor motion at ZV.
bidi.c (bidi_resolve_explicit, bidi_level_of_next_char): Check
 bidi_it->bytepos against ZV_BYTE instead of bidi_it->ch against
 BIDI_EOB.
2010-04-03 16:43:23 +03:00
Eli Zaretskii
83d02defce Fix typo in src/ChangeLog. 2010-04-03 12:09:56 +03:00
Stefan Monnier
2912322b80 Merge from emacs-23 2010-04-02 21:54:24 -04:00
Dan Nicolaescu
a568f507d1 * m/intel386.h (NO_REMAP): Move definition ...
* s/msdos.h (NO_REMAP): ... here.
2010-04-02 17:24:53 -07:00
Dan Nicolaescu
4cd9f6c2f9 * m/vax.h (CRT0_DUMMIES): Remove, unused. 2010-04-02 17:20:04 -07:00
Dan Nicolaescu
c435b43224 * ecrt0.c: Remove MSDOS, m68k and __sparc__ conditionals, file not
used on those platforms.
2010-04-02 17:06:38 -07:00
Eli Zaretskii
9cb52861f2 xdisp.c (set_cursor_from_row): Improve comments. 2010-04-02 12:35:01 +03:00
Eli Zaretskii
52f4d8d5bb Fix typos and formatting in ChangeLog entries. 2010-04-02 12:12:21 +03:00
Dan Nicolaescu
42a2c62292 Remove extern errno declarations.
* xterm.c:
* xrdb.c:
* w32term.c:
* unexec.c:
* unexaix.c:
* sysdep.c:
* process.c:
* lread.c:
* keyboard.c:
* floatfns.c:
* filelock.c:
* fileio.c:
* emacs.c (main):
* ecrt0.c:
* dispnew.c:
* callproc.c:
* buffer.c: Remove errno extern declarations.
* s/netbsd.h (NEED_ERRNO): Remove.

* movemail.c:
* etags.c:
* emacsclient.c: Remove extern errno declarations.
2010-04-01 20:10:33 -07:00
Juanma Barranquero
194d44e717 Fix typos in ChangeLogs. 2010-04-02 04:22:17 +02:00
Dan Nicolaescu
8224f93d18 Remove all uses of LIBX11_SYSTEM.
* Makefile.in (LIBX11_SYSTEM): Remove.
* s/msdos.h (LIBX11_SYSTEM): Do not define, define LIBS_SYSTEM
instead.

* configure.in: Remove all references to LIBX11_SYSTEM.
2010-04-01 16:08:14 -07:00
Eli Zaretskii
a039ec6303 msdos.c: Fix last change. 2010-04-01 18:15:16 +03:00
Eli Zaretskii
ed68db4d2c Remove support for DJGPP v1.x (bug#5813).
src/:
 w16select.c (__dpmi_int): Remove DJGPP v1.x compatibility.
 s/msdos.h: 
 unexec.c (make_hdr, copy_text_and_data): 
 sysdep.c (wait_for_termination, sys_subshell): 
 msdos.c (dos_set_window_size, msdos_set_cursor_shape)
 (IT_set_terminal_modes): 
 (__write, _rename, gethostname, gettimeofday, alarm, fork, kill)
 (dos_ttraw, dos_ttcooked, run_msdos_command, abort): Remove DJGPP
 v1.x code and tests of the value of __DJGPP__.
 (nice, pause, sigsetmask, sigblock): Remove DJGPP v1.x
 compatibility code.
 lread.c: 
 gmalloc.c (memalign): 
 fileio.c (Fcopy_file, check_executable, Ffile_modes): 
 emacs.c (main): 
 dosfns.c (init_dosfns): 
 dired.c (file_name_completion_stat): Remove tests of __DJGPP__.

 msdos/:
 sed3.inp:
 sed2.inp:
 sed1.inp:
 mainmake: Files removed.
2010-04-01 17:59:46 +03:00
Eli Zaretskii
814062c766 Fix bug #5816.
xdisp.c (set_cursor_from_row): Fix cursor positioning when the
 string with `cursor' property comes from an `after-string' overlay.
2010-04-01 15:37:28 +03:00
Glenn Morris
0dc2e11dfd Cosmetic change to src/Makefile.in.
* Makefile.in (LIBTIFF, LIBJPEG, LIBPNG, LIBGIF, LIBXPM, XFT_LIBS):
Define as Makefile variables.
(LIBX): Use above variables rather than directly using autoconf.
2010-04-01 00:10:31 -07:00
Chong Yidong
6521c534c4 [merge] Fix last set of Nextstep changes.
* nsfns.m (ns_set_doc_edited): Remove unused arg OLDVAL.
* nsterm.h: Fix prototype.
2010-03-31 18:28:12 -04:00
Dan Nicolaescu
1d29df5994 Clean up BSD_SYSTEM use.
* xterm.c:
* process.c:
* emacs.c: Use HAVE_SYS_IOCTL_H instead of BSD_SYSTEM as a guard
for including <sys/ioctl.h>.
* sysdep.c (wait_without_blocking): Remove BSD_SYSTEM case, this
code is only used for MSDOS.
2010-03-31 13:39:03 -07:00
Juri Linkov
1546c55901 Rename image-extension-data' to image-metadata'.
http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg01456.html

* image.c: Add `Qextension_data'.
(syms_of_image): Initialize and staticpro `Qextension_data'.
(Fimage_metadata): Rename from `Fimage_extension_data'.
(gif_load): Put GIF extension data to the property
`Qextension_data'.

* image.el (image-animated-p): Use `image-metadata' instead of
`image-extension-data'.  Get GIF extenstion data from metadata
property `extension-data'.
2010-03-31 17:55:01 +03:00
Eli Zaretskii
52c3078336 Fix highlight of trailing whitespace is right-to-left lines.
xdisp.c (highlight_trailing_whitespace): Support highlight of
 trailing whitespace in right-to-left rows.
2010-03-31 17:28:16 +03:00
Chong Yidong
95b1abcfaf Fix last set of Nextstep changes.
* nsfns.m (ns_set_doc_edited): Remove unused arg OLDVAL.
* nsterm.h: Fix prototype.
2010-03-31 10:27:50 -04:00
Eli Zaretskii
4a217bedd4 Fix bug #5703.
w32fns.c (x_create_tip_frame): Copy `parms' before we modify it
 in this function.
2010-03-31 12:08:40 +03:00
Stefan Monnier
855a0da7fd Get rid of the direct_output optimizations.
* keyboard.c (nonundocount): Remove extern declaration.
(command_loop_1): Remove brittle optimisation for cheap and common operations.
* xdisp.c (redisplay_internal): Don't bother checking
redisplay_performed_directly_p any more.
* sysdep.c (init_sys_modes): Don't call direct_output_forward_char any more.
* dispnew.c (redisplay_performed_directly_p)
(direct_output_for_insert, direct_output_forward_char):
* dispextern.h (redisplay_performed_directly_p)
(direct_output_for_insert, direct_output_forward_char): Remove.
* cmds.c (nonundocount): Make it static.
2010-03-31 00:14:08 -04:00
Chong Yidong
4f103e0430 * nsterm.h: Fix last change. 2010-03-31 00:00:23 -04:00
Stefan Monnier
857387516c Merge from emacs-23 branch 2010-03-30 22:37:57 -04:00
Stefan Monnier
75d1428c57 (keys_of_window): Remove redundant/overridden bindings. 2010-03-30 22:08:05 -04:00
Chong Yidong
a6d676d9f4 * menu.c (Fx_popup_menu): Use last_event_timestamp (Bug#4930). 2010-03-30 19:26:38 -04:00
Eli Zaretskii
82043cfbb3 Restore original behavior of move_it_in_display_line_to when !bidi_p.
xdisp.c (BUFFER_POS_REACHED_P, move_it_in_display_line_to):
 Restore original behavior when the iterator is not bidi_p.
2010-03-30 15:16:49 -04:00
Dan Nicolaescu
b5dd0ae7be * xdisp.c (syms_of_xdisp): Use intern_c_string instead of intern. 2010-03-30 10:40:04 -07:00
Jan Djärv
67fee863be xdisp.c (note_mouse_highlight): Don't do highlight if pointer is invisible (Bug#5766). 2010-03-30 19:26:58 +02:00
Eli Zaretskii
bd924a5d6c Fix a crash of I-search in a bidi-reordered buffer.
bidi.c (bidi_cache_iterator_state): Invalidate the cache if we
 are outside the range of cached character positions.
2010-03-30 19:29:02 +03:00
Juanma Barranquero
3580374b8a * makefile.w32-in ($(BLD)/bidi.$(O)): Add dependency on w32gui.h. 2010-03-30 14:15:45 +02:00
Eli Zaretskii
a8d11bd341 bidi.c: Update to GPLv3. 2010-03-30 13:02:24 +03:00
Eli Zaretskii
b118e65f9d bidi.c: Update Copyright years. 2010-03-30 12:55:42 +03:00
Eli Zaretskii
a7b0282034 Initial support for bidirectional editing.
Makefile.in (obj): Include bidi.o.
 (bidi.o): New target.
 makefile.w32-in (OBJ1): Add $(BLD)/bidi.$(O).
 ($(BLD)/bidi.$(O)): New target.
 bidi.c: New file.
 buffer.h (struct buffer): New members bidi_display_reordering
 and bidi_paragraph_direction.
 buffer.c (init_buffer_once): Initialize bidi_display_reordering
 and bidi_paragraph_direction.
 (syms_of_buffer): Declare Lisp variables bidi-display-reordering
 and bidi-paragraph-direction.
 (Fbuffer_swap_text): Swap the values of
 bidi_display_reordering and bidi_paragraph_direction.
 dispextern.h (BIDI_MAXLEVEL, BIDI_AT_BASE_LEVEL): New macros.
 (bidi_type_t, bidi_dir_t): New types.
 (bidi_saved_info, bidi_stack, bidi_it): New structures.
 (struct it): New members bidi_p, bidi_it, paragraph_embedding,
 prev_stop, base_level_stop, and eol_pos.
 (bidi_init_it, bidi_get_next_char_visually): New prototypes.
 (IT_STACK_SIZE): Enlarge to 5.
 (struct glyph_row): New member reversed_p.
 <string_buffer_position>: Update prototype.
 (PRODUCE_GLYPHS): Set the reversed_p flag in the iterator's
 glyph_row if bidi_it.paragraph_dir == R2L.
 (struct glyph): New members resolved_level and bidi_type.
 dispnew.c (direct_output_forward_char): Give up if we need bidi
 processing or buffer's direction is right-to-left.
 (prepare_desired_row): Preserve the reversed_p flag.
 (row_equal_p): Compare the reversed_p attributes as well.
 xdisp.c (init_iterator): Initialize it->bidi_p.  Call
 bidi_init_it and set it->paragraph_embedding from the current
 buffer's value of bidi_paragraph_direction.
 (reseat_1): Initialize bidi_it.first_elt.
 (set_iterator_to_next, next_element_from_buffer): Use the value of
 paragraph_embedding to determine the paragraph direction.
 (set_iterator_to_next): Under bidi reordering, call
 bidi_get_next_char_visually.  Call bidi_paragraph_init if the
 new_paragraph flag is set in the bidi iterator.
 (next_element_from_buffer): If bidi_it.first_elt is set,
 initialize paragraph direction and find the first character to
 display in the visual order.  If reseated to a middle of a line,
 prime the bidi iterator starting at the line's beginning.  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.  When moving across stop_charpos,
 record it in prev_stop.
 (display_line): Set row->end and it->start for the next row to the
 next character in logical order.  Always extend reversed_p rows to
 the end of line, even if they end at ZV.  Copy the reversed_p flag
 to the next glyph row.  Keep calling set_cursor_from_row for
 bidi-reordered rows even if we already have a possible candidate
 for cursor position.  Set row_end after all the row's glyphs have
 been produced, by looping over the glyphs.  Record the position
 after EOL in it->eol_pos, and use it to set end_pos of the last
 row produced for a continued line.
 <Qright_to_left, Qleft_to_right>: New variables.
 (syms_of_xdisp): Initialize and staticpro them.
 (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.
 (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.
 (append_glyph, append_composite_glyph)
 (produce_image_glyph, append_stretch_glyph): Set the
 resolved_level and bidi_type members of each glyph.
 (append_glyph): If the glyph row is reversed, prepend the glyph
 rather than appending it.
 (handle_stop_backwards): New function.
 (reseat_1, pop_it, push_it): Set prev_stop and base_level_stop.
 (reseat): call handle_stop_backwards to recompute prev_stop and
 base_level_stop for the new position.
 (handle_invisible_prop): Under bidi iteration, skip invisible text
 using bidi_get_next_char_visually.  If we are `reseat'ed, init the
 paragraph direction.  Update IT->prev_stop after skipping
 invisible text.
 (move_it_in_display_line_to): New variables prev_method
 and prev_pos.  Compare for strict equality in
 BUFFER_POS_REACHED_P.
 (try_cursor_movement): Examine all the candidate rows that occlude
 point, to return the best match.  If rows are bidi-reordered
 and point moved backwards, back up to the row that is not a
 continuation line, and start looking for a suitable row from
 there.
 term.c (append_glyph): Reverse glyphs by pre-pending them,
 rather than appending, if the glyph_row's reversed_p flag is set.
 Set the resolved_level and bidi_type members of each glyph.
 .gdbinit (pbiditype): New command.
 (pgx): Use it to display bidi level and type of the glyph.
 (pitx): Display some bidi information about the iterator.
 (prowlims, pmtxrows): New commands.
 files.el: Make bidi-display-reordering safe variable for boolean
 values.
 mule.texi (International): Mention support of bidirectional editing.
 (Bidirectional Editing): New section.
 HELLO: Reorder Arabic and Hebrew into logical order, and
 insert RLM before the opening paren, to make the display more
 reasonable.  Add setting for bidi-display-reordering in the local
 variables section.
 NEWS: Mention initial support for bidirectional editing.
2010-03-30 05:13:07 -04:00
Eli Zaretskii
4d6ea387e7 Removed src/ChangeLog.bidi from bzr. 2010-03-30 05:02:07 -04:00