Commit graph

8042 commits

Author SHA1 Message Date
Andreas Schwab
8b264ecb46 (simple_search): Avoid CHAR_TO_BYTE in inner loop when
searching backwards through multibyte buffer.
2009-11-22 12:11:00 +00:00
Jan Djärv
872870b29a Use a select wrapper around the GLib event loop, thus taking into account GLib
timeouts and event sources.  This simplifies Gtk+-code a lot, and is needed
for handling GConf death/restart.

* xterm.c: #include xgselect.h.
(x_initialize): Call xgselect_initialize.

* xsettings.c (something_changedCB): C++ comments => C comments.
(init_gconf): Do not deal with any GLib file descriptors, xg_select
does that now.

* gtkutil.c (xg_timer, xg_process_timeouts, xg_start_timer)
(xg_stop_timer, menu_grab_callback_cnt, menu_grab_callback)
(scroll_bar_button_cb): Remove.
(create_menus): C++ comments => C comments. Don't bind grab-notify
event.
(xg_create_scroll_bar): Don't bind button-press-event and
button-release-event.

* process.c: Include xgselect.h if defined (USE_GTK) ||
defined (HAVE_GCONF).
(wait_reading_process_output): Call xg_select for the same condition.

* xgselect.c (xg_select): New function to better integrate with
GLib/Gtk event handling.  Needed if GConf daemon dies/restarts.

* xgselect.h: New file, declare xg_select, xgselect_initialize.

* Makefile.in (XOBJ): Add xgselect.o.
2009-11-21 15:28:59 +00:00
Andreas Schwab
62a6e103dd * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Remove
ignored second argument.  All callers changed.
* regex.c (STRING_CHAR, STRING_CHAR_AND_LENGTH, RE_STRING_CHAR)
(RE_STRING_CHAR_AND_LENGTH): Likewise.
* xdisp.c (string_char_and_length): Likewise.
2009-11-21 11:52:23 +00:00
Dan Nicolaescu
b0ca0f33f7 * xterm.c (x_new_font):
* print.c (print_object):
* cmds.c (Fself_insert_command): Move declarations before statements.
2009-11-21 02:33:45 +00:00
Chong Yidong
dd5a6279bc * s/cygwin.h: Remove unneeded linker flags. 2009-11-20 21:44:58 +00:00
Jan Djärv
0d1d0d26a9 Always suggest system font because .emacs may not have been read yet.
* xfns.c (x_default_font_parameter): Call xsettings_get_system_font.

* xsettings.h: Declare xsettings_get_system_font.

* xsettings.c (xsettings_get_system_font): New function.
(init_gconf): No use initiating gconf unless we have Xft also.
(syms_of_xsettings): Only provide system-font-setting if HAVE_XFT and
HAVE_GCONF.
2009-11-20 09:44:42 +00:00
Jan Djärv
4a8e097d4e gtkutil.c (xg_modify_menubar_widgets): If menubar is totally empty
add a blank entry so it doesn't collapse into nothing.
2009-11-20 08:54:18 +00:00
Stefan Monnier
8ab1650ee3 (Funintern): Comment out last change. 2009-11-19 22:10:40 +00:00
Richard M. Stallman
82c602f0fe * lread.c (Funintern): Error if symbol is t or nil. 2009-11-19 16:13:22 +00:00
Stefan Monnier
87e32266f0 (make_gap_larger): Don't make as many assumptions about the
representation of Lisp integers.
Reported by MJ Chan <mjchan.inbox@gmail.com>.
2009-11-19 01:40:22 +00:00
Andreas Schwab
1b9ac1453d * lisp.h: Remove declaration of Ffont_get_system_font.
* xfns.c: Move include of "xsettings.h".
* xsettings.h: Use EXFUN to declare Ffont_get_system_font.
2009-11-17 21:57:48 +00:00
Jan Djärv
dfb3c4c640 xsettings.c didn't check font-use-system-font, fix that.
* xsettings.c (something_changedCB, Ffont_get_system_font): Check
use_system_font.
(syms_of_xsettings): DEFVAR font-use-system-font.

* font-setting.el (font-use-system-font): Moved ...

* cus-start.el (all): ... to here.
2009-11-17 20:17:46 +00:00
Andreas Schwab
25fe851a7c (x_default_font_parameter): Remove dead assignment. 2009-11-17 19:13:14 +00:00
Andreas Schwab
9370c1d8eb (Fbyteorder, init_font, Ffont_get_system_font): Declare. 2009-11-17 19:11:53 +00:00
Jan Djärv
21050de1b8 * xftfont.c (xftfont_fix_match): Older versions of fontconfig does
not have FC_LCD_*.  #define them if not there.
2009-11-17 13:47:29 +00:00
Jan Djärv
a6eb20d8fe #ifdef on FC_LCD_FILTER.
* xftfont.c (xftfont_fix_match): Older versions of fontconfig does
not have FC_LCD_FILTER.  #ifdef it.

* xsettings.c (parse_xft_settings, apply_xft_settings): Ditto

* xftfont.c (xftfont_fix_match): New function.
(xftfont_open): Call XftDefaultSubstitute before XftFontMatch.
Call xftfont_fix_match after XftFontMatch.
2009-11-17 09:53:45 +00:00
Jan Djärv
637fa98808 Handle system default font and changing font parameters.
* xterm.h (struct x_display_info): Add atoms and Window for xsettings.

* xterm.c (handle_one_xevent): Call xft_settings_event for
ClientMessage, PropertyNotify and DestroyNotify.
(x_term_init): If we have XFT, get DPI from Xft.dpi.
Call xsettings_initialize.

* xftfont.c (xftfont_fix_match): New function.
(xftfont_open): Call XftDefaultSubstitute before XftFontMatch.
Call xftfont_fix_match after XftFontMatch.

* xfont.c (xfont_driver): Initialize all members.

* xfns.c (x_default_font_parameter): Try font from Ffont_get_system_font.
Do not get font from x_default_parameter if we got one from
Ffont_get_system_font.
(Fx_select_font): Get the defaut font name from :name of FRAME_FONT (f).

* w32font.c (w32font_driver): Initialize all members.

* termhooks.h (enum event_kind): CONFIG_CHANGED_EVENT is new.

* lisp.h: Declare syms_of_xsettings.

* keyboard.c (kbd_buffer_get_event, make_lispy_event): Handle
CONFIG_CHANGED_EVENT.

* ftfont.c (ftfont_filter_properties): New function.

* frame.c (x_set_font): Remove unused variable lval.

* font.h (struct font_driver): filter_properties is new.

* font.c (font_put_extra): Don't return if val is nil, it means
boolean option is off.
(font_parse_fcname): Collect all extra properties in extra_props
and call filter_properties for all drivers with extra_props and
font as parameter.
(font_open_entity): Do not use cache, it does not pick up new fontconfig
settings like hinting.
(font_load_for_lface): If spec had a name in it, store it in entity.

* emacs.c (main): Call syms_of_xsettings

* config.in: HAVE_GCONF is new.

* Makefile.in (GCONF_CFLAGS, GCONF_LIBS): New variables for HAVE_GCONF.
xsettings.o is new.

* menu-bar.el: Put "Use system font" in Option-menu.

* loadup.el: If feature system-font-setting or font-render-setting is
there, load font-setting.

* Makefile.in (ELCFILES): font-settings.el is new.
* font-setting.el: New file.

* NEWS: Mention dynamic font changes (font-use-system-font).

* configure.in: New option: --with(out)-gconf.
Set HAVE_GCONF if we find gconf.
2009-11-17 08:21:23 +00:00
Kenichi Handa
5a94293248 (x_produce_glyphs): Consider face-remapping when falling
back to the default font in case that no suitable font is found.
2009-11-17 04:17:19 +00:00
Stefan Monnier
b7c7a4d1f8 (Fx_popup_menu) [HAVE_NS]: Use generic code for window edge.
Suggested by Chad Brown <yandros@mit.edu>.
(push_menu_item): Use MENU_ITEMS_ITEM_* names.
2009-11-17 03:32:04 +00:00
Jan Djärv
072f1e39a2 xmenu.c(x_menu_wait_for_event): Call XFlush before select. 2009-11-16 19:43:40 +00:00
Andreas Schwab
5d1e70a2c4 Ignore errors from mkdir when creating deps
directory.
2009-11-14 18:35:19 +00:00
Jan Djärv
473a99b7c9 gtkutil.c (xg_update_frame_menubar): Do nothing if menubar already has a parent. 2009-11-14 18:22:34 +00:00
Jan Djärv
a53cfbe587 Use gcc-generated dependency files if we can (GNU Make and gcc required).
* Makefile.in: If AUTO_DEPEND is defined, make gcc generate
dependency files in deps/. Include those files into Makefile.

* config.in: Generated (AUTO_DEPEND).

* configure.in: --enable-autodepend is new.  Check for GNU Make
and that gcc supports -MMD -MF. Define AUTO_DEPEND if we can use
gcc and GNU make to generate dependencies.
2009-11-14 15:17:38 +00:00
Michael Albinus
f04bb9b2d8 * dbusbind.c (Vdbus_registered_objects_table): Renamed from
Vdbus_registered_functions_table, because it contains also
properties.  Fix docstring.
(Fdbus_call_method, Fdbus_call_method_asynchronously): Fix
docstring.
2009-11-13 16:12:08 +00:00
Stefan Monnier
8f11f7ecce (mark_object): Don't reprocess marked strings.
Check vector's markbit earlier.  Adjust calls to mark_vectorlike.
(mark_vectorlike, mark_char_table): Assume the object is unmarked.
2009-11-13 15:26:28 +00:00
Kenichi Handa
8a605fe839 (word_boundary_p): Adjusted for the change of the
semantics of Vword_combining_categories.
(Vword_combining_categories): Describe the slight change of the
semantics.
2009-11-13 11:18:02 +00:00
Eli Zaretskii
241c4680c9 (SYSTEM_PURESIZE_EXTRA): Revert last change. 2009-11-13 10:10:15 +00:00
Stefan Monnier
5d58e44c27 (syms_of_xdisp): Fix typo in last change. 2009-11-12 02:09:33 +00:00
Juanma Barranquero
5e13f9d32c * makefile.w32-in: Update dependencies; add dependencies to lisp.h. 2009-11-12 00:51:37 +00:00
David Reitter
cf54c75498 menu.c (Fx_popup_menu): Remove left-over debugging code and rename variables to fix 2009-11-09 change. 2009-11-12 00:26:09 +00:00
Dan Nicolaescu
9143355208 * process.c (ifflag_def): Make flag_sym constant.
(Fnetwork_interface_info): Use a constant pointer.
(ifflag_table):
* xfns.c (cursor_bits):
* xdisp.c (power_letter):
* termcap.c (speeds, esctab):
* sysdep.c (baud_convert):
* keyboard.c (lispy_accent_codes, modifier_names):
* image.c (xbm_format, xpm_format, pbm_format, png_format)
(jpeg_format, tiff_format, gif_format, svg_format)
(interlace_start, interlace_increment, gs_format):
* gtkutil.c (separator_names):
* fringe.c (swap_nibble):
* fns.c (base64_value_to_char, base64_char_to_value):
* fileio.c (make_temp_name_tbl):
* coding.c (suffixes): Make constant.
2009-11-11 20:11:51 +00:00
Dan Nicolaescu
f4265f6c27 * frame.c (make_initial_frame):
* buffer.c (init_buffer_once): Use make_pure_c_string instead of
build_string.
* alloc.c (syms_of_alloc): Build Vmemory_signal_data in pure memory.
2009-11-11 19:25:24 +00:00
Dan Nicolaescu
04420943de * s/freebsd.h:
* s/netbsd.h: Remove code referring to non-existent file: unexsunos4.o.
2009-11-11 19:13:50 +00:00
Dan Nicolaescu
0a5d24aedd Add dependencies to lisp.h. Remove dependencies
for non-existent files: unexmips.c, unexnext.c, abbrev.c, malloc.c.
2009-11-11 06:41:07 +00:00
Dan Nicolaescu
a4ada374d6 * xfns.c (syms_of_xfns): Use make_pure_string instead of build_string.
* xterm.c (syms_of_xterm):
* xfaces.c (syms_of_xfaces):
* xdisp.c (syms_of_xdisp):
* lread.c (syms_of_lread):
* keyboard.c (syms_of_keyboard): Use make_pure_c_string instead of
build_string.
* doc.c (Fsnarf_documentation): Purecopy Vbuild_files.
2009-11-11 06:10:42 +00:00
Stefan Monnier
af98fc7f9a (Fplist_get): Merge the active and the uncommented code. 2009-11-10 21:22:57 +00:00
Jan Djärv
e90292a90c Bug #4574. Common code for file/font dialog. Handle timers with glib-timers.
* keyboard.h: Declare timer_check.

* keyboard.c (timer_check_2): New function that does what the old
timer_check did.
(timer_check): Call timer_check_2 until -1 or a non-zero time is
returned, i.e. don't return -1 with timers pending.

* process.c: Remove extern declaration of timer_check.

* xmenu.c (x_menu_wait_for_event): Remove code that did a timeout
even if timer_check returned -1.

* gtkutil.c (xg_dialog_response_cb): data is now a struct xg_dialog_data
(pop_down_dialog): Destroy widget (if any), cancel timer and unref
the event loop.
(xg_maybe_add_timer, xg_dialog_run): New functions (bug #4574).
(xg_get_file_name, xg_get_font_name): Call xg_dialog_run (bug #4574).
Destroy the dialog after xg_dialog_run.
2009-11-10 19:06:40 +00:00
Stefan Monnier
045b83c00a (Fx_popup_menu) [HAVE_NS]: Remove unused vars. 2009-11-10 18:07:09 +00:00
Jan Djärv
1fb99a3a63 xmenu.c (xmenu_show): Must not be static after 2009-11-09 changes. 2009-11-10 07:58:57 +00:00
Juanma Barranquero
362654a675 Fix typos. 2009-11-09 11:21:04 +00:00
Juanma Barranquero
04e452cb31 * menu.c [HAVE_NTGUI]: Declare current_popup_menu. 2009-11-09 11:07:05 +00:00
Stefan Monnier
ef7417fd76 * menu.c (Fx_popup_menu): Consolidate versions from xmenu.c,
w32menu.c, and nsmenu.m.
Simplify the obsolete case where position is nil.
(cleanup_popup_menu): New function, moved from nsmenu.m.
(struct skp): Remove slot `notreal'.
(single_keymap_panes, keymap_panes): Remove arg `notreal' and adjust callers.
(single_menu_item): Adjust call to parse_menu_item.
(syms_of_menu): Defsubr x-popup-menu.
* menu.h (Vmenu_updating_frame): Consolidate declarations from *menu.c.
(keymap_panes): Don't export any more.
(mouse_position_for_popup, w32_menu_show, ns_menu_show, xmenu_show): Declare.
* keyboard.c (parse_menu_item): Remove arg `notreal'.
(menu_bar_item, read_char_minibuf_menu_prompt): Adjust callers.
* keyboard.h (parse_menu_item): Update declaration.
* xmenu.c (Fx_popup_menu): Remove.
(syms_of_xmenu): Don't defsubr x-popup-menu.
* w32menu.c (Fx_popup_menu): Remove.
(syms_of_w32menu): Don't defsubr x-popup-menu.
* nsmenu.m (cleanup_popup_menu): Remove.
(ns_menu_show): Rename from ns_popup_menu and remove all the code
moved to menu.c's Fx_popup_menu.
(Fx_popup_menu): Remove.
(syms_of_nsmenu): Don't defsubr x-popup-menu, and don't initialize
menu_items (it's done in menu.c already).
2009-11-09 06:21:03 +00:00
Stefan Monnier
424d6179b3 (parse_menu_item): Handle `notreal' a bit earlier.
Use `tem' less.  Make sure KEYEQ holds a string or nil (bug#4879).
2009-11-08 15:06:50 +00:00
Chong Yidong
c0df13a6e3 * xmenu.c (Fx_popup_menu): Hide any tooltip before opening a menu. 2009-11-08 00:14:30 +00:00
Chong Yidong
a20903d09e * xmenu.c (Fx_popup_menu): Extract event timestamp. Pass it to
xmenu_show.
(xmenu_show): New arg.  Pass it to create_and_show_popup_menu.
(create_and_show_popup_menu): New arg.  Pass it to gtk_menu_popup.
2009-11-07 23:49:08 +00:00
Stefan Monnier
2de9f71c22 Let integers use up 2 tags to give them one extra bit and double their range.
* lisp.h (USE_2_TAGS_FOR_INTS): New macro.
(LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P): New macros.
(enum Lisp_Type): Use them.  Give explicit values.
(Lisp_Type_Limit): Remove.
(XINT, XUINT, make_number) [!USE_LISP_UNION_TYPE]:
(MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
Pay attention to USE_2_TAGS_FOR_INTS.
(INTEGERP): Use LISP_INT_TAG_P.
* fns.c (internal_equal): Simplify the default case.
(sxhash): Use case_Lisp_Int.
* data.c (wrong_type_argument): Don't check against Lisp_Type_Limit any more.
(Ftype_of): Use case_Lisp_Int.
(store_symval_forwarding): Take into account the fact that Ints can
now have more than one tag.
* buffer.c (syms_of_buffer): Use LISP_INT_TAG.
buffer_slot_type_mismatch):
* xfaces.c (face_attr_equal_p):
* print.c (print_object):
* alloc.c (mark_maybe_object, mark_object, survives_gc_p): Use case_Lisp_Int.
2009-11-06 18:47:48 +00:00
Eli Zaretskii
7ac65b3893 (SYSTEM_PURESIZE_EXTRA): Reduce by further 30K. 2009-11-06 11:40:24 +00:00
Eli Zaretskii
323637a270 (make_pure_c_string): Fix last change to avoid compiler warning. 2009-11-06 10:55:11 +00:00
Jan Djärv
e511451fd3 Fix bug #4870, issues 3 and 4.
* gtkutil.c (xg_event_is_for_scrollbar): New function (bug#4870).

* gtkutil.h: Declare xg_event_is_for_scrollbar (bug#4870).

* xterm.c (handle_one_xevent): Call xg_event_is_for_scrollbar for
ButtonPressRelease and MotionNotify (bug#4870).
2009-11-06 08:30:43 +00:00
Dan Nicolaescu
5adc433ec6 * keymap.c (syms_of_keymap): Construct exclude_keys in pure memory. 2009-11-06 07:49:31 +00:00