summaryrefslogtreecommitdiff
path: root/src/font.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused DEFSYMsPaul Eggert2015-05-311-5/+0
| | | | | | | | | | | | | Remove DEFSYMs that aren't used at the C level. Also: * src/decompress.c (Qzlib_dll): * src/font.c (Qunicode_sip): * src/frame.c (Qtip_frame): * src/ftfont.c (Qserif): * src/gnutls.c (Qgnutls_dll): * src/xml.c (Qlibxml2_dll): Move from here ... * src/w32fns.c (syms_of_w32fns): ... to here, as these are used only on MS-Windows.
* Merge branch 'master' into cairoJan D2015-05-231-5/+5
|\
| * Don't quote nil and t in doc stringsPaul Eggert2015-05-211-2/+2
| | | | | | | | | | This is as per "Tips for Documentation Strings" in the elisp manual. For consistency, do the same in diagnostics and comments.
| * Fix minor quoting problems in doc stringsPaul Eggert2015-05-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These were glitches regardless of how or whether we tackle the problem of grave accent in doc strings. * lisp/calc/calc-aent.el (math-restore-placeholders): * lisp/ido.el (ido-ignore-buffers, ido-ignore-files): * lisp/leim/quail/cyrillic.el ("bulgarian-alt-phonetic"): * lisp/leim/quail/hebrew.el ("hebrew-new") ("hebrew-biblical-sil"): * lisp/leim/quail/thai.el ("thai-kesmanee"): * lisp/progmodes/idlw-shell.el (idlwave-shell-file-name-chars): Used curved quotes to avoid ambiguities like ‘`''’ in doc strings. * lisp/calendar/calendar.el (calendar-month-abbrev-array): * lisp/cedet/semantic/mru-bookmark.el (semantic-mrub-cache-flush-fcn): * lisp/cedet/semantic/symref.el (semantic-symref-tool-baseclass): * lisp/cedet/semantic/tag.el (semantic-tag-copy) (semantic-tag-components): * lisp/cedet/srecode/cpp.el (srecode-semantic-handle-:cpp): * lisp/cedet/srecode/texi.el (srecode-texi-texify-docstring): * lisp/emacs-lisp/byte-opt.el (byte-optimize-all-constp): * lisp/emacs-lisp/checkdoc.el (checkdoc-message-text-engine): * lisp/emacs-lisp/generator.el (iter-next): * lisp/gnus/gnus-art.el (gnus-treat-strip-list-identifiers) (gnus-article-mode-syntax-table): * lisp/net/rlogin.el (rlogin-directory-tracking-mode): * lisp/net/soap-client.el (soap-wsdl-get): * lisp/net/telnet.el (telnet-mode): * lisp/org/org-compat.el (org-number-sequence): * lisp/org/org.el (org-remove-highlights-with-change) (org-structure-template-alist): * lisp/org/ox-html.el (org-html-link-org-files-as-html): * lisp/play/handwrite.el (handwrite-10pt, handwrite-11pt) (handwrite-12pt, handwrite-13pt): * lisp/progmodes/f90.el (f90-mode, f90-abbrev-start): * lisp/progmodes/idlwave.el (idlwave-mode, idlwave-check-abbrev): * lisp/progmodes/verilog-mode.el (verilog-tool) (verilog-string-replace-matches, verilog-preprocess) (verilog-auto-insert-lisp, verilog-auto-insert-last): * lisp/textmodes/makeinfo.el (makeinfo-options): * src/font.c (Ffont_spec): Fix minor quoting problems in doc strings, e.g., missing quote, ``x'' where `x' was meant, etc. * lisp/erc/erc-backend.el (erc-process-sentinel-2): Fix minor quoting problem in other string. * lisp/leim/quail/ethiopic.el ("ethiopic"): * lisp/term/tvi970.el (tvi970-set-keypad-mode): Omit unnecessary quotes. * lisp/faces.el (set-face-attribute, set-face-underline) (set-face-inverse-video, x-create-frame-with-faces): * lisp/gnus/gnus-group.el (gnus-group-nnimap-edit-acl): * lisp/mail/supercite.el (sc-attribs-%@-addresses) (sc-attribs-!-addresses, sc-attribs-<>-addresses): * lisp/net/tramp.el (tramp-methods): * lisp/recentf.el (recentf-show-file-shortcuts-flag): * lisp/textmodes/artist.el (artist-ellipse-right-char) (artist-ellipse-left-char, artist-vaporize-fuzziness) (artist-spray-chars, artist-mode, artist-replace-string) (artist-put-pixel, artist-text-see-thru): * lisp/vc/ediff-util.el (ediff-submit-report): * lisp/vc/log-edit.el (log-edit-changelog-full-paragraphs): Use double-quotes rather than TeX markup in doc strings. * lisp/skeleton.el (skeleton-pair-insert-maybe): Reword to avoid the need for grave accent and apostrophe. * lisp/xt-mouse.el (xterm-mouse-tracking-enable-sequence): Don't use grave and acute accents to quote.
* | Add cairo drawing.Jan D2015-02-111-0/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (with-cairo): New option. (USE_CAIRO): Default to yes for Gtk+ 3. Add code to test for cairo, set CAIRO_CFLAGS, CAIRO_LIBS. Add ftcrfonto to FONT_OBJ if cairo. Output "Does Emacs use cairo?". * lisp/version.el (emacs-version): Add cairo version. * src/Makefile.in (CAIRO_CFLAGS, CAIRO_LIBS): New variables. (FONT_OBJ): Add comment about ftcrfont. (ALL_CFLAGS): Add CAIRO_CFLAGS. (LIBES): Add CAIRO_LIBS. * src/dispextern.h (struct image): Add cr_data for cairo. (x_cr_init_fringe): Declare. * src/font.c (syms_of_font): Call syms_of_ftcrfont for cairo. * src/font.h (ftcrfont_driver, syms_of_ftcrfont): Declare * src/fringe.c (x_cr_init_fringe): New function name that shares code with w32_init_fringe. * src/ftcrfont.c: New font driver for cairo, based on the ftfont driver. * src/ftfont.c (ftfont_info_size); New global variable. (ftfont_open2): New extern function almost the same as old ftfont_open, but takes the font_object as argument. (ftfont_open): Build font object and call ftfont_open2. * src/ftfont.h (ftfont_open2, ftfont_info_size): Declare. * src/gtkutil.c (xg_clear_under_internal_border) (xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos): Only queue_draw if not cairo. Change args to x_clear_area. (xg_get_font): Use Qftcr when using cairo, Qxft otherwise. (xg_page_setup_dialog, xg_get_page_setup, draw_page) (xg_print_frames_dialog): New functions for printing. * src/gtkutil.h (xg_page_setup_dialog, xg_get_page_setup) (xg_print_frames_dialog): Declare. * src/image.c: Add defined (USE_CAIRO) for PNG. Add !defined USE_CAIRO for W32 PNG code. (x_clear_image): If cairo, destroy the surface in cr_data. (png_load): Add new cairo compatible implementation. (lookup_image_type): Add defined (USE_CAIRO) for define png_type. * src/xfns.c: New section Printing. (x-export-frames, x-page-setup-dialog, x-get-page-setup) (x-print-frames-dialog): New printing functions. (Fx_create_frame, x_create_tip_frame): Register ftcrfont if cairo. (syms_of_xfns): Defsym Qorientation, Qtop_margin, Qbottom_margin, Qportrait, Qlandscape, Qreverse_portrait, Qreverse_landscape). (syms_of_xfns): Provide cairo and defvar cairo-version-string. defsubr Sx_page_setup_dialog, Sx_get_page_setup, Sx_print_frames_dialog. * src/xterm.c (x_clear_area1, x_prepare_for_xlibdraw) (x_set_clip_rectangles, x_reset_clip_rectangles, x_fill_rectangle) (x_draw_rectangle, x_fill_trapezoid_for_relief, x_clear_window) (x_gc_get_ext_data, x_extension_initialize, x_cr_accumulate_data): Declare. (FRAME_CR_CONTEXT, FRAME_CR_SURFACE): New macros. (max_fringe_bmp, fringe_bmp): New variables. (x_gc_get_ext_data, x_extension_initialize) (x_cr_destroy_surface, x_begin_cr_clip, x_end_cr_clip) (x_set_cr_source_with_gc_foreground) (x_set_cr_source_with_gc_background, x_cr_define_fringe_bitmap) (x_cr_destroy_fringe_bitmap, x_cr_draw_image, x_cr_draw_frame) (x_cr_accumulate_data, x_cr_destroy, x_cr_export_frames) (x_prepare_for_xlibdraw, x_set_clip_rectangles) (x_reset_clip_rectangles, x_fill_rectangle, x_draw_rectangle) (x_clear_window, x_fill_trapezoid_for_relief): New functions. (x_update_begin): Create cairo surface if needed. (x_draw_vertical_window_border): Call x_fill_rectangle for cairo. (x_update_end): Paint cairo drawing surface to xlib surface. (x_clear_under_internal_border, x_after_update_window_line): Adjust arguments to x_clear_area. (x_draw_fringe_bitmap): Call x_fill_rectangle. Get GC values and call x_cr_draw_image for cairo. Call x_reset_clip_rectangles instead of XSetClipMask. (x_set_glyph_string_clipping) (x_set_glyph_string_clipping_exactly): Use x_set_clip_rectangles instead of XSetClipRectangles. (x_clear_glyph_string_rect, x_draw_glyph_string_background): Use x_fill_rectangle instead of XFillRectangle. (x_draw_glyph_string_foreground) (x_draw_composite_glyph_string_foreground) (x_draw_glyphless_glyph_string_foreground): Use x_draw_rectangle instead of XDrawRectangle. (x_draw_relief_rect): Add code for USE_CAIRO. Call x_reset_clip_rectangles instead of XSetClipMask. (x_draw_box_rect): x_set_clip_rectangles instead of XSetClipRectangles, x_fill_rectangle instead of XFillRectangle, x_reset_clip_rectangles instead of XSetClipMask. (x_draw_image_foreground, x_draw_image_foreground_1): x_draw_rectangle instead of XDrawRectangle. (x_draw_glyph_string_bg_rect): x_fill_rectangle instead of XFillRectangle. (x_draw_image_glyph_string): If img has cr_data, use it as a cairo surface. (x_draw_stretch_glyph_string): x_set_clip_rectangles instead of XSetClipRectangles, x_fill_rectangle instead of XFillRectangle. (x_draw_glyph_string): x_fill_rectangle instead of XFillRectangle., x_reset_clip_rectangles instead of XSetClipMask. (x_shift_glyphs_for_insert): Call x_prepare_for_xlibdraw. (x_clear_area1): New function that calls XClearArea. (x_clear_area): Takes frame as parameter, calls x_clear_area1 for non-cairo. (x_clear_frame): x_clear_window instead of XClearWindow. (x_scroll_run): Set frame garbaged if cairo. (XTmouse_position): Initialize *part to 0. (x_scroll_bar_create): Adjust arguments to x_clear_area. (x_scroll_bar_set_handle): x_clear_area1 instead of x_clear_area, x_fill_rectangle instead of XFillRectangle. (XTset_vertical_scroll_bar, XTset_horizontal_scroll_bar): Adjust arguments to x_clear_area. (x_scroll_bar_expose): x_draw_rectangle instead of XDrawRectangle. (handle_one_xevent): Adjust arguments to x_clear_area. Destroy cairo surface for frame if ConfigureNotify. (x_clip_to_row): x_set_clip_rectangles instead of XSetClipRectangles. (x_draw_hollow_cursor): x_draw_rectangle instead of XDrawRectangle, x_reset_clip_rectangles instead of XSetClipMask. (x_draw_bar_cursor): x_fill_rectangle instead of XFillRectangle, x_reset_clip_rectangles instead of XSetClipMask. (x_clear_frame_area): Adjust arguments to x_clear_area. (x_free_frame_resources): Call x_prepare_for_xlibdraw. (x_term_init): Call x_extension_initialize if cairo. (x_redisplay_interface): Add x_cr_define_fringe_bitmap, x_cr_destroy_fringe_bitmap for cairo. (x_initialize): Call x_cr_init_fringe for cairo. * src/xterm.h: Add include of cairo header files. (x_bitmap_record): Add img if cairo. (x_gc_ext_data): New struct for cairo. (x_display_info): Add ext_codes for cairo. (x_output): Add cr_context and cr_surface for cairo. (x_clear_area): Change arguments from Display*/Window to frame pointer. (x_query_color, x_begin_cr_clip, x_end_cr_clip) (x_set_cr_source_with_gc_foreground, x_set_cr_source_with_gc_background) (x_cr_draw_frame, x_cr_export_frames): Declare.
* Remove unused assignment.Dima Kogan2015-02-091-1/+0
| | | | * font.c (font_score): Remove unused variable assignment.
* Use bool for boolean in xfaces.cPaul Eggert2015-01-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dispextern.h: Adjust to signature changes. * font.c (font_at, font_range): * fontset.c (Finternal_char_font): * fringe.c (draw_fringe_bitmap_1): * xdisp.c (handle_face_prop, face_before_or_after_it_pos) (get_next_display_element, highlight_trailing_whitespace) (display_string, calc_line_height_property) (note_mode_line_or_margin_highlight, note_mouse_highlight): * xfaces.c (tty_suppress_bold_inverse_default_colors_p) (menu_face_changed_default, recompute_basic_faces) (Fbitmap_spec_p, parse_rgb_list, tty_lookup_color) (tty_defined_color, defined_color, face_color_gray_p) (face_color_supported_p, load_color2, load_face_colors) (Fx_list_fonts, LFACEP, push_named_merge_point) (resolve_face_name, lface_from_face_name_no_resolve) (lface_from_face_name, get_lface_attributes_no_remap) (get_lface_attributes, lface_fully_specified_p) (set_lface_from_font, merge_face_vectors, merge_named_face) (merge_face_ref, Finternal_make_lisp_face) (Finternal_lisp_face_p, Finternal_copy_lisp_face) (Finternal_set_lisp_face_attribute) (update_face_from_frame_parameter, set_font_frame_param) (face_boolean_x_resource_value) (Finternal_set_lisp_face_attribute_from_resource) (x_update_menu_appearance, Finternal_get_lisp_face_attribute) (Finternal_merge_in_global_face, Fface_font, face_attr_equal_p) (lface_equal_p, Finternal_lisp_face_equal_p) (Finternal_lisp_face_empty_p, lface_same_font_attributes_p) (Fcolor_distance, lookup_named_face, lookup_basic_face) (lookup_derived_face, Fface_attributes_as_vector) (x_supports_face_attributes_p, tty_supports_face_attributes_p) (Fdisplay_supports_face_attributes_p, realize_basic_faces) (realize_default_face, realize_named_face) (realize_non_ascii_face, realize_x_face, map_tty_color) (realize_tty_face, compute_char_face, face_at_buffer_position) (face_for_overlay_string, face_at_string_position): Use bool for boolean. * xfaces.c (set_lface_from_font): Return void, since callers never use the result.
* Count MANY function args more reliablyPaul Eggert2015-01-251-17/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * alloc.c (Fgc_status, purecopy, unbind_to, garbage_collect_1): * buffer.c (Fbuffer_list, Fkill_buffer): * callint.c (read_file_name, Fcall_interactively): * charset.c (Fset_charset_priority, syms_of_charset): * chartab.c (uniprop_encode_value_numeric): * coding.c (syms_of_coding): * composite.c (syms_of_composite): * data.c (wrong_range): * dbusbind.c (syms_of_dbusbind): * dired.c (file_attributes): * editfns.c (Fdecode_time, update_buffer_properties, format2): * eval.c (run_hook_with_args_2, apply1, call1, call2, call3) (call4, call5, call6, call7): * fileio.c (Finsert_file_contents, choose_write_coding_system) (Fcar_less_than_car, build_annotations, auto_save_error): * filelock.c (get_boot_time): * fns.c (internal_equal, nconc2, Fyes_or_no_p, Fwidget_apply): (maybe_resize_hash_table, secure_hash): * font.c (font_style_to_value, font_open_by_name, Flist_fonts): * fontset.c (fontset_add, Fset_fontset_font): * ftfont.c (ftfont_lookup_cache): * gtkutil.c (xg_get_font): * insdel.c (signal_before_change, signal_after_change): * keymap.c (append_key): * lread.c (load_warn_old_style_backquotes, Fload, init_lread): * minibuf.c (Fread_buffer): * print.c (print_preprocess): * process.c (Fformat_network_address, Fmake_network_process) (server_accept_connection): * sound.c (Fplay_sound_internal): * term.c (Fsuspend_tty, Fresume_tty): * window.c (window_list): * xdisp.c (run_redisplay_end_trigger_hook, add_to_log) (message_with_string): * xfaces.c (Fx_list_fonts): * xfont.c (syms_of_xfont): * xselect.c (x_handle_selection_request) (x_handle_selection_clear, x_clear_frame_selections) (x_clipboard_manager_error_1): Prefer CALLMANY and CALLN to counting args by hand. * doc.c (reread_doc_file): Remove unused code. * fns.c (concat2, concat3): Redo to avoid need for local-var vector. (cmpfn_user_defined, hashfn_user_defined, Fmaphash): Prefer call1 and call2 to Ffuncall. * keyboard.c (safe_run_hook_funcall, safe_run_hooks): Use struct literal rather than a local var, for simplicity. * keymap.c (where_is_internal): Use NULL rather than a pointer to unused args. * lisp.h (CALLMANY, CALLN): New macros. * sound.c (Fplay_sound_internal): Coalesce duplicate code. Fixes: bug#19634
* Better isolate code that assumes NIL_IS_ZEROPaul Eggert2015-01-211-2/+2
| | | | | | | | | | | | | Suggested by Stefan Monnier in: http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00588.html * alloc.c (allocate_pseudovector): Use memclear, not memsetnil, to remove a 'verify'. * callint.c (Fcall_interactively): * dispnew.c (realloc_glyph_pool): * xdisp.c (init_iterator): Use memclear, not memset, to remove a 'verify'. * lisp.h (memclear): Rename from memsetnil, and take a byte count rather than a word count. All callers changed.
* Prefer memset to repeatedly assigning QnilPaul Eggert2015-01-191-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | * alloc.c (allocate_pseudovector): Catch more bogus values. * alloc.c (allocate_pseudovector): * callint.c (Fcall_interactively): * coding.c (syms_of_coding): * fringe.c (init_fringe): Verify that Qnil == 0. * callint.c (Fcall_interactively): * eval.c (Fapply, Ffuncall): * fns.c (mapcar1, larger_vector): * font.c (font_expand_wildcards): * fringe.c (init_fringe): Prefer memset to assigning zeros by hand. * callint.c (Fcall_interactively): Remove duplicate assignment of Qnil to args[i]. * coding.c (syms_of_coding): Prefer LISP_INITIALLY_ZERO to assigning zeros by hand. * fileio.c (Ffile_selinux_context): Rewrite to avoid need for Lisp_Object array. * lisp.h (XLI_BUILTIN_LISPSYM): New macro. (DEFINE_LISP_SYMBOL_END): Use it. (NIL_IS_ZERO): New constant. (memsetnil): New function.
* Prefer INLINE functions in font.h to match style used in lisp.hDmitry Antipov2015-01-161-9/+4
| | | | | | | | | | | | * font.h (FONTP, FONT_SPEC_P, FONT_ENTITY_P, FONT_OBJECT_P) (CHECK_FONT, CHECK_FONT_SPEC, CHECK_FONT_ENTITY, CHECK_FONT_OBJECT) (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT, CHECK_FONT_GET_OBJECT): Now functions. * font.c (Ffont_otf_alternates, Fquery_font, Ffont_get_glyphs): * ftfont.c (ftfont_shape): * macfont.m (macfont_shape): * w32uniscribe.c (uniscribe_shape): * xftfont.c (xftfont_shape): Adjust CHECK_FONT_GET_OBJECT users.
* Tune pseudovector allocation assuming Qnil == 0Dmitry Antipov2015-01-161-3/+4
| | | | | | | | | | | | | | | | * alloc.c (allocate_pseudovector): Use memset for both Lisp_Objects and regular slots. Add zerolen arg. * lisp.h (allocate_pseudovector): Adjust prototype. (ALLOCATE_PSEUDOVECTOR): Adjust user. (ALLOCATE_ZEROED_PSEUDOVECTOR): New macro. (allocate_hash_table, allocate_window, allocate_frame) (allocate_process, allocate_terminal): Remove prototypes. * fns.c (allocate_hash_table): Now static here. * frame.c (allocate_frame): * process.c (allocate_process): * terminal.c (allocate_terminal): * window.c (allocate_window): Now static here. Use ALLOCATE_ZEROED_PSEUDOVECTOR. Add comment.
* Port to 32-bit --with-wide-intPaul Eggert2015-01-101-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | Prefer symbol indexes to struct Lisp_Symbol * casted and then widened, as the latter had trouble with GCC on Fedora 21 when configured --with-wide-int and when used in static initializers. * lib-src/make-docfile.c (write_globals): Define and use symbols like iQnil (a small integer, like 0) rather than aQnil (an address constant). * src/alloc.c (garbage_collect_1, which_symbols): * src/lread.c (init_obarray): Prefer builtin_lisp_symbol when it can be used. * src/dispextern.h (struct image_type.type): * src/font.c (font_property_table.key): * src/frame.c (struct frame_parm_table.sym): * src/keyboard.c (scroll_bar_parts, struct event_head): * src/xdisp.c (struct props.name): Use the index of a builtin symbol rather than its address. All uses changed. * src/lisp.h (TAG_SYMPTR, XSYMBOL_INIT): Remove, replacing with ... (TAG_SYMOFFSET, SYMBOL_INDEX): ... new macros that deal with symbol indexes rather than pointers, and which work better on MSB hosts because they shift right before tagging. All uses changed. (DEFINE_LISP_SYMBOL_BEGIN, DEFINE_LISP_SYMBOL_END): No longer noops on wide-int hosts, since they work now. (builtin_lisp_symbol): New function.
* Compute C decls for DEFSYMs automaticallyPaul Eggert2015-01-051-43/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes Bug#15880. This patch also makes Q constants (e.g., Qnil) constant addresses from the C point of view. * make-docfile.c: Revamp to generate table of symbols, too. Include <stdbool.h>. (xstrdup): New function. (main): Don't process the same file twice. (SYMBOL): New constant in enum global_type. (struct symbol): Turn 'value' member into a union, either v.value for int or v.svalue for string. All uses changed. (add_global): New arg svalue, which overrides value, so that globals can have a string value. (close_emacs_global): New arg num_symbols; all uses changed. Output lispsym decl. (write_globals): Output symbol globals too. Output more ATTRIBUTE_CONST, now that Qnil etc. are C constants. Output defsym_name table. (scan_c_file): Move most of guts into ... (scan_c_stream): ... new function. Scan for DEFSYMs and record symbols found. Don't read past EOF if file doesn't end in newline. * alloc.c, bidi.c, buffer.c, bytecode.c, callint.c, casefiddle: * casetab.c, category.c, ccl.c, charset.c, chartab.c, cmds.c, coding.c: * composite.c, data.c, dbusbind.c, decompress.c, dired.c, dispnew.c: * doc.c, editfns.c, emacs.c, eval.c, fileio.c, fns.c, font.c, fontset.c: * frame.c, fringe.c, ftfont.c, ftxfont.c, gfilenotify.c, gnutls.c: * image.c, inotify.c, insdel.c, keyboard.c, keymap.c, lread.c: * macfont.m, macros.c, minibuf.c, nsfns.m, nsfont.m, nsimage.m: * nsmenu.m, nsselect.m, nsterm.m, print.c, process.c, profiler.c: * search.c, sound.c, syntax.c, term.c, terminal.c, textprop.c, undo.c: * window.c, xdisp.c, xfaces.c, xfns.c, xftfont.c, xmenu.c, xml.c: * xselect.c, xsettings.c, xterm.c: Remove Q vars that represent symbols (e.g., Qnil, Qt, Qemacs). These names are now defined automatically by make-docfile. * alloc.c (init_symbol): New function. (Fmake_symbol): Use it. (c_symbol_p): New function. (valid_lisp_object_p, purecopy): Use it. * alloc.c (marked_pinned_symbols): Use make_lisp_symbol instead of make_lisp_ptr. (garbage_collect_1): Mark lispsym symbols. (CHECK_ALLOCATED_AND_LIVE_SYMBOL): New macro. (mark_object): Use it. (sweep_symbols): Sweep lispsym symbols. (symbol_uses_obj): New function. (which_symbols): Use it. Work for lispsym symbols, too. (init_alloc_once): Initialize Vpurify_flag here; no need to wait, since Qt's address is already known now. (syms_of_alloc): Add lispsym count to symbols_consed. * buffer.c (init_buffer_once): Compare to Qnil, not to make_number (0), when testing whether storage is all bits zero. * dispextern (struct image_type): * font.c (font_property_table): * frame.c (struct frame_parm_table, frame_parms): * keyboard.c (scroll_bar_parts, struct event_head): * xdisp.c (struct props): Use XSYMBOL_INIT (Qfoo) and struct Lisp_Symbol * rather than &Qfoo and Lisp_Object *, since Qfoo is no longer an object whose address can be taken. All uses changed. * eval.c (run_hook): New function. Most uses of Frun_hooks changed to use it, so that they no longer need to take the address of a Lisp sym. (syms_of_eval): Don't use DEFSYM on Vrun_hooks, as it's a variable. * frame.c (syms_of_frame): Add defsyms for the frame_parms table. * keyboard.c (syms_of_keyboard): Don't DEFSYM Qmenu_bar here. DEFSYM Qdeactivate_mark before the corresponding var. * keymap.c (syms_of_keymap): Use DEFSYM for Qmenu_bar and Qmode_line instead of interning their symbols; this avoids duplicates. (LISP_INITIALLY, TAG_PTR) (DEFINE_LISP_SYMBOL_BEGIN, DEFINE_LISP_SYMBOL_END, XSYMBOL_INIT): New macros. (LISP_INITIALLY_ZERO): Use it. (enum symbol_interned, enum symbol_redirect, struct Lisp_Symbol) (EXFUN, DEFUN_ARGS_MANY, DEFUN_ARGS_UNEVALLED, DEFUN_ARGS_*): Move decls up, to avoid forward uses. Include globals.h earlier, too. (make_lisp_symbol): New function. (XSETSYMBOL): Use it. (DEFSYM): Now just a placeholder for make-docfile. * lread.c (DEFINE_SYMBOLS): Define, for globals.h. (intern_sym): New function, with body taken from old intern_driver. (intern_driver): Use it. Last arg is now Lisp integer, not ptrdiff_t. All uses changed. (define_symbol): New function. (init_obarray): Define the C symbols taken from lispsym. Use plain DEFSYM for Qt and Qnil. * syntax.c (init_syntax_once): No need to worry about Qchar_table_extra_slots.
* Update copyright year to 2015Paul Eggert2015-01-011-1/+1
| | | | Run admin/update-copyright.
* Allow querying font by name for its height and other info. (Bug#19395)Eli Zaretskii2014-12-181-4/+43
| | | | | | | | | | | | | | | | src/font.c (Ffont_info): Add more font information to the vector returned by the function, inspired by query-font. Doc fix. doc/lispref/display.texi (Low-Level Font): Document font-info and query-font. lisp/international/mule-diag.el (describe-font-internal): Display additional info returned by font-info. lisp/linum.el (linum--face-width): Rename from linum--face-height, and use the new functionality of font-info. (linum-update-window): Use linum--face-width and frame-char-width, instead of approximating with height. etc/NEWS: Mention the enhancement in font-info.
* * font.c (copy_font_spec): Redesign to avoid Fcopy_alistDmitry Antipov2014-10-311-18/+26
| | | | and unnecessary initialization. Adjust comments.
* Spelling fixes.Paul Eggert2014-10-121-9/+8
|
* * font.c (Ffont_get_glyphs): Use validate_subarray and fixDmitry Antipov2014-10-071-24/+30
| | | | the case where an optional string is used. Adjust docstring.
* Consistently use min and max macros from lisp.h.Dmitry Antipov2014-10-031-5/+1
| | | | | | | | | | * coding.c (min, max): * font.c (MAX): * unexhp9k800.c (min): * unexw32.c (min, max): Use definitions from lisp.h. * regex.c (MAX, MIN) [!emacs]: Define own max and min as such. Adjust users. * gmalloc.c (min): Tiny style change.
* Use AUTO_CONS instead of SCOPED_CONS, etc.Paul Eggert2014-09-301-11/+21
| | | | | | | | | | | | | | | | | | | * doc/lispref/internals.texi (Stack-allocated Objects): Adjust to match the revised, less error-prone macros. * src/frame.h (AUTO_FRAME_ARG): Rename from FRAME_PARAMETER. * src/lisp.h (AUTO_CONS): Rename from scoped_cons. (AUTO_LIST1): Rename from scoped_list1. (AUTO_LIST2): Rename from scoped_list2. (AUTO_LIST3): Rename from scoped_list3. (AUTO_LIST4): Rename from scoped_list4. (AUTO_STRING): Rename from SCOPED_STRING. * src/frame.h (AUTO_FRAME_ARG): * src/lisp.h (AUTO_CONS, AUTO_LIST1, AUTO_LIST2, AUTO_LIST3) (AUTO_LIST4, AUTO_STRING): Prepend a new argument 'name'. Declare a variable instead of yielding a value. All uses changed. * src/lisp.h (STACK_CONS, AUTO_CONS_EXPR): New internal macros.
* Simplify stack-allocated Lisp objects, and make them more portable.Paul Eggert2014-09-291-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The build_local_string macro was used in two ways: (1) string literals for which scoped allocation suffices, and (2) file name components, where it's not safe in general to assume bounded-size ASCII data. Simplify by defining a new macro SCOPED_STRING that allocates a block-scope string, and by using SCOPED_STRING for (1) and build_string for (2). Furthermore, actually use stack allocation only for objects known to have sufficient alignment. This simpler implementation means Emacs can make USE_STACK_LISP_OBJECTS the default unless GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS. * lisp.h (GCALIGNED): Align even if !USE_STACK_LISP_OBJECTS, for fewer differences among implementations. (struct Lisp_String): Now GCALIGNED. (USE_STACK_LISP_OBJECTS): Default to true, since the implementation no longer insists on a nonempty GCALIGNED. But make it false if GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS. (SCOPED_CONS_INITIALIZER): Remove, since it's no longer needed separately. Move definiens to scoped_cons. The old definition was incorrect when GCALIGNED was defined to be empty. (union Aligned_String): New type. (USE_STACK_CONS, USE_STACK_STRING): New constants, so that the implementation ports to compilers that don't align strictly enough. Don't worry about the union sizes; it's not worth bothering about. (scoped_cons, scoped_list1, scoped_list3, scoped_list4): Rewrite using USE_STACK_CONS. (scoped_cons): Assume the use of union Aligned_Cons. (lisp_string_size, make_local_string, build_local_string): Remove. Unless otherwise specified, all callers of build_local_string changed to use SCOPED_STRING. (SCOPED_STRING): New macro. * data.c (wrong_choice): * menu.c (single_menu_item): * process.c (Fformat_network_address): Hoist use of SCOPED_STRING out of a scope, so that its returned object lives long enough. * fileio.c (Fexpand_file_name): Use build_string, not SCOPED_STRING, as the string might be long or might not be ASCII.
* Keep stack-allocated Lisp objects fast rather than versatile.Dmitry Antipov2014-09-291-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (HAVE_STATEMENT_EXPRESSIONS): Remove. For USE_STACK_LISP_OBJECTS, we always assume __GNUC__. * lisp.h (union Aligned_Cons) [!GCALIGNED]: Define as such. (SCOPED_CONS_INITIALIZER): New macro. (scoped_cons) [USE_STACK_LISP_OBJECTS]: Use it. (USE_LOCAL_ALLOCA): Remove. (local_cons, local_list1, local_list2, local_list3, local_list4): Remove. Stack overflow checking makes them too slow. (make_local_vector): Likewise. Also we just don't have enough users for it. (enum LISP_STRING_OVERHEAD): Remove. (local_string_init, local_vector_init): Remove prototypes. (make_local_string, build_local_string): Redesign to target short compile-time string constants, fall back to regular string allocation where appropriate. (lisp_string_size): New function. (verify_ascii) [ENABLE_CHECKING]: Add prototype. * alloc.c (local_string_init, local_vector_init): Remove. (verify_ascii) [ENABLE_CHECKING]: New function. * buffer.c, charset.c, chartab.c, data.c, editfns.c, emacs.c, fileio.c: * fns.c, font.c, fontset.c, frame.c, keyboard.c, keymap.c, lread.c: * menu.c, minibuf.c, process.c, textprop.c, xdisp.c, xfns.c, xfont.c: * xselect.c, xterm.c: All related users changed.
* Fix local_cons etc. to not exhaust the stack when in a loop.Paul Eggert2014-09-241-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem reported in: http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00696.html * buffer.c (Fother_buffer, other_buffer_safely, init_buffer): * charset.c (load_charset_map_from_file, Ffind_charset_region) (Ffind_charset_string): * chartab.c (uniprop_encode_value_numeric, uniprop_table): * data.c (wrong_range): * editfns.c (Fpropertize, format2): * emacs.c (init_cmdargs, decode_env_path): * fileio.c (auto_save_error): * fns.c (Fyes_or_no_p): * font.c (font_style_to_value, font_parse_xlfd) (font_parse_family_registry, font_delete_unmatched) (font_add_log): * fontset.c (Fset_fontset_font): * frame.c (x_get_arg): * keyboard.c (echo_dash, safe_run_hooks_error, parse_menu_item) (read_char_minibuf_menu_prompt): * keymap.c (silly_event_symbol_error, describe_vector): * lread.c (load_warn_old_style_backquotes): * menu.c (single_menu_item): * minibuf.c (Fread_buffer): * process.c (status_message, Fformat_network_address) (server_accept_connection): * textprop.c (copy_text_properties): * xdisp.c (Fcurrent_bidi_paragraph_direction): * xfns.c (x_default_scroll_bar_color_parameter): * xfont.c (xfont_open): * xselect.c (x_clipboard_manager_error_1): * xterm.c (x_term_init): Put USE_LOCAL_ALLOCA at the start of the function. * fns.c (maybe_resize_hash_table): Use build_string instead of build_local_string, since we'd otherwise need a conditional USE_LOCAL_ALLOCA here, but this is just debugging output and is not worth the bother of optimization. * font.c (font_delete_unmatched): Remove by-hand code that observed MAX_ALLOCA limit, since it's now done automatically. * keymap.c (Fsingle_key_description): Put USE_SAFE_ALLOCA at top, since build_local_string needs its sa_alloc. * lisp.h (lisp_word_count): New function. (SAFE_ALLOCA_LISP): Use it. (USE_LOCAL_ALLOCA): New macro. (local_cons, make_local_vector, make_local_string): Observe the MAX_ALLOCA limit. (LISP_STRING_OVERHEAD): New constant. (make_local_string): Use it.
* * chartab.c (uniprop_encode_value_numeric):Dmitry Antipov2014-09-241-7/+9
| | | | | | * font.c (font_style_to_value): Use make_local_vector. (font_delete_unmatched): Use local_cons but respect MAX_ALLOCA. * keymap.c (append_key): Use scoped_list1.
* * lisp.h (lispstpcpy): Rename from lispstrcpy, and act like stpcpy.Paul Eggert2014-09-231-1/+1
| | | | | | All callers changed. * xterm.c (x_term_init): Use new functionality to avoid two needs to compute a string length.
* Use known length of a Lisp string to copy it faster.Dmitry Antipov2014-09-231-1/+1
| | | | | | | | | | | | | | | | * lisp.h (lispstrcpy): New function. Add comment. * callproc.c (child_setup): * dbusbind.c (xd_append_arg): * doc.c (get_doc_string): * font.c (Ffont_xlfd_name): * frame.c (xrdb_get_resource): * process.c (Fmake_network_process, network_interface_info): * w32fns.c (Fx_open_connection): * w32proc.c (sys_spawnve): * xfns.c (select_visual): * xfont.c (xfont_list): * xsmfns.c (x_session_initialize): * xterm.c (x_term_init): Use it.
* Avoid extra call to oblookup when interning symbols.Dmitry Antipov2014-09-221-8/+5
| | | | | | | | * lisp.h (intern_driver): Add prototype. * lread.c (intern_driver): New function. (intern1, intern_c_string_1, Fintern): * font.c (font_intern_prop): * w32font.c (intern_font_name): Use it.
* If USE_LOCAL_ALLOCATORS, allocate some Lisp objects on stack.Dmitry Antipov2014-09-151-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp.h (local_cons, local_list1, local_list2, local_list3) [USE_LOCAL_ALLOCATORS]: New macros. [!USE_LOCAL_ALLOCATORS]: Fall back to regular functions. (build_local_string): Avoid argument name expansion clash with make_local_string. * alloc.c (toplevel) [USE_LOCAL_ALLOCATORS && GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS]: Preprocessor guard to avoid impossible configuration. * charset.c (Ffind_charset_region, Ffind_charset_string): Use make_local_vector. * lread.c (read1, substitute_object_recurse): Use scoped_cons. * textprop.c (Fput_text_property, Fadd_face_text_property): Use scoped_list2. (copy_text_properties): Use local_cons and local_list3. * chartab.c (uniprop_table): * data.c (wrong_choice, wrong_range): * doc.c (get_doc_string): * editfns.c (format2): * fileio.c (Fexpand_file_name, auto_save_error): * fns.c (Fyes_or_no_p): * font.c (font_parse_xlfd, font_parse_family_registry, font_add_log): * fontset.c (Fset_fontset_font): * keyboard.c (echo_add_key, echo_dash, parse_menu_item) (read_char_minibuf_menu_prompt): * keymap.c (silly_event_symbol_error, describe_vector): * menu.c (single_menu_item): * minibuf.c (Fread_buffer): * process.c (status_message, Fformat_network_address) (server_accept_connection): Use make_local_string and build_local_string. Prefer compound literals where appropriate.
* Prefer ptrdiff_t to int and avoid integer overflows.Dmitry Antipov2014-09-131-1/+1
| | | | | | | * fileio.c (make_temp_name): * font.c (font_parse_family_registry): Avoid integer overflow on string size calculation. * data.c (Faset): Likewise for byte index.
* Fix the MS-Windows build broken by SAFE_ALLOCA changes.Eli Zaretskii2014-09-071-0/+4
| | | | | | src/callproc.c (child_setup) [WINDOWSNT]: Don't call exec_failed if 'alloca' gets passed arguments larger than MAX_ALLOCA. src/font.c (MAX): Define if not defined elsewhere.
* Use SAFE_ALLOCA etc. to avoid unbounded stack allocation.Paul Eggert2014-09-071-13/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This follows up on the recent thread in emacs-devel on alloca; see: http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00042.html This patch also cleans up alloca-related glitches noted while examining the code looking for unbounded alloca. * alloc.c (listn): * callproc.c (init_callproc): Rewrite to avoid need for alloca. * buffer.c (mouse_face_overlay_overlaps) (report_overlay_modification): * buffer.h (GET_OVERLAYS_AT): * coding.c (make_subsidiaries): * doc.c (Fsnarf_documentation): * editfns.c (Fuser_full_name): * fileio.c (Ffile_name_directory, Fexpand_file_name) (search_embedded_absfilename, Fsubstitute_in_file_name): * fns.c (Fmake_hash_table): * font.c (font_vconcat_entity_vectors, font_update_drivers): * fontset.c (fontset_pattern_regexp, Ffontset_info): * frame.c (Fmake_terminal_frame, x_set_frame_parameters) (xrdb_get_resource, x_get_resource_string): * ftfont.c (ftfont_get_charset, ftfont_check_otf, ftfont_drive_otf): * ftxfont.c (ftxfont_draw): * image.c (xbm_load, xpm_load, jpeg_load_body): * keyboard.c (echo_add_key, menu_bar_items, tool_bar_items): * keymap.c (Fdescribe_buffer_bindings, describe_map): * lread.c (openp): * menu.c (digest_single_submenu, find_and_call_menu_selection) (find_and_return_menu_selection): * print.c (PRINTFINISH): * process.c (Fformat_network_address): * scroll.c (do_scrolling, do_direct_scrolling, scrolling_1): * search.c (search_buffer, Fmatch_data, Fregexp_quote): * sound.c (wav_play, au_play): * syntax.c (skip_chars): * term.c (tty_menu_activate, tty_menu_show): * textprop.c (get_char_property_and_overlay): * window.c (Fset_window_configuration): * xdisp.c (safe__call, next_overlay_change, vmessage) (compute_overhangs_and_x, draw_glyphs, note_mouse_highlight): * xfaces.c (face_at_buffer_position): * xmenu.c (x_menu_show): Use SAFE_ALLOCA etc. instead of plain alloca, since the allocation size isn't bounded. * callint.c (Fcall_interactively): Redo memory_full check so that it can be done at compile-time on some platforms. * coding.c (MAX_LOOKUP_MAX): New constant. (get_translation_table): Use it. * callproc.c (call_process): Use SAFE_NALLOCA instead of SAFE_ALLOCA, to catch integer overflows on size calculation. (exec_failed) [!DOS_NT]: New function. (child_setup) [!DOS_NT]: Use it. * editfns.c (Ftranspose_regions): Hoist USE_SAFE_ALLOC + SAFE_FREE out of 'if'. * editfns.c (check_translation): Allocate larger buffers on the heap. * eval.c (internal_lisp_condition_case): Check for MAX_ALLOCA overflow. * fns.c (sort_vector): Use SAFE_ALLOCA_LISP rather than Fmake_vector. (Fbase64_encode_region, Fbase64_decode_region): Avoid unnecessary calls to SAFE_FREE before 'error'. * buffer.c (mouse_face_overlay_overlaps): * editfns.c (Fget_pos_property, check_translation): * eval.c (Ffuncall): * font.c (font_unparse_xlfd, font_find_for_lface): * ftfont.c (ftfont_drive_otf): * keyboard.c (echo_add_key, read_decoded_event_from_main_queue) (menu_bar_items, tool_bar_items): * sound.c (Fplay_sound_internal): * xdisp.c (load_overlay_strings, dump_glyph_row): Use an ordinary auto buffer rather than alloca, since the allocation size is fixed and small. * ftfont.c: Include <c-strcase.h>. (matching_prefix): New function. (get_adstyle_property): Use it, to avoid need for alloca. * keyboard.c (echo_add_key): * keymap.c (describe_map): Use ptrdiff_t, not int. * keyboard.c (echo_add_key): Prefer sizeof to strlen. * keymap.c (Fdescribe_buffer_bindings): Use SBYTES, not SCHARS, when counting bytes. * lisp.h (xlispstrdupa): Remove, replacing with ... (SAFE_ALLOCA_STRING): ... new macro with different API. This fixes a portability problem, namely, alloca result passed to another function. All uses changed. (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Check for MAX_ALLOCA, not MAX_ALLOCA - 1. * regex.c (REGEX_USE_SAFE_ALLOCA, REGEX_SAFE_FREE) (REGEX_ALLOCATE): New macros. (REGEX_REALLOCATE, REGEX_ALLOCATE_STACK, REGEX_REALLOCATE_STACK) (REGEX_FREE_STACK, FREE_VARIABLES, re_match_2_internal): Use them. * xdisp.c (message3): Use SAFE_ALLOCA_STRING rather than doing it by hand. (decode_mode_spec_coding): Store directly into buf rather than into an alloca temporary and copying the temporary to the buf. Fixes: debbugs:18410
* Revert previous change.Paul Eggert2014-07-261-3/+3
| | | | | | | | There is certainly nothing wrong with writing code like 'lo <= i && i <= hi', even if LO happens to a constant. There isn't even anything wrong in general with writing 'a <= b' if A happens to be a constant. At any rate stylistic changes shouldn't be done like this without discussion.
* Reorder conditions that are written backwardsAndreas Schwab2014-07-261-3/+3
| | | | | | | | | | | | | | | | | | | * alloc.c (xnmalloc, xnrealloc, xpalloc, make_save_value) (Fgarbage_collect): Reorder conditions that are written backwards. * data.c (cons_to_unsigned): Likewise. * dispnew.c (update_frame_1, sit_for): Likewise. * fileio.c (file_offset): Likewise. * filelock.c (read_lock_data, lock_file): Likewise. * fns.c (larger_vector, make_hash_table, Fmake_hash_table): Likewise. * font.c (font_intern_prop, font_style_symbolic): Likewise. * lisp.h (FIXNUM_OVERFLOW_P): Likewise. * lread.c (read1): Likewise. * minibuf.c (read_minibuf_noninteractive): Likewise. * nsterm.m (x_set_frame_alpha): Likewise. * process.c (wait_reading_process_output): Likewise. * region-cache.c (delete_cache_boundaries): Likewise. * xterm.c (x_set_frame_alpha): Likewise.
* 2014-07-19 Kenichi Handa <handa@gnu.org>Kenichi Handa2014-07-201-1/+5
| | | | | | | | | | * xfaces.c (realize_x_face): Call font_load_for_lface with no mandatory font spec (Bug#17973). 2014-07-19 Stefan Monnier <monnier@iro.umontreal.ca> * font.c (font_score): Return the worst score if the size of ENTITY is wrong by more than a factor 2 (Bug#17973).
* * frame.h (enum fullscreen_type) [HAVE_WINDOW_SYSTEM]: Use more naturalDmitry Antipov2014-07-161-3/+9
| | | | | | | | | | | | | | | | values. Add comment. (struct frame): Re-arrange layout to avoid extra padding and use bit fields for output_method, want_fullscreen and vertical_scroll_bar_type. (FRAME_VERTICAL_SCROLL_BAR_TYPE, FRAME_HAS_VERTICAL_SCROLL_BARS) (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT) (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT) [!HAVE_WINDOW_SYSTEM]: Define as no-ops because there are no scroll bars anyway. * frame.c (make_frame, make_terminal_frame, make_initial_frame): Adjust users. * font.c (fset_font_data) [HAVE_XFT || HAVE_FREETYPE]: Add convenient setter. (font_put_frame_data, font_get_frame_data): Use it.
* * font.c, font.h (font_unparse_fcname): Now static.Paul Eggert2014-07-091-2/+9
| | | | Define only if HAVE_XFT || HAVE_FREETYPE || HAVE_NS.
* * font.c (font_build_object) [HAVE_XFT || HAVE_FREETYPE || HAVE_NS]:Dmitry Antipov2014-07-081-1/+27
| | | | | | | | | | New function, with an intention to avoid code duplication between a few font drivers. * font.h (font_build_object) [HAVE_XFT || HAVE_FREETYPE || HAVE_NS]: Add prototype. * ftfont.c (ftfont_open): * macfont.m (macfont_open): * xftfont.c (xftfont_open): Use it.
* Use convenient alists to manage per-frame font driver-specific data.Dmitry Antipov2014-07-031-37/+18
| | | | | | | | | | | | | | | | * frame.h (struct frame): Rename font_data_list to... [HAVE_XFT || HAVE_FREETYPE]: ... font_data, which is a Lisp_Object now. * font.h (struct font_data_list): Remove; no longer need a special data type. (font_put_frame_data, font_get_frame_data) [HAVE_XFT || HAVE_FREETYPE]: Adjust prototypes. * font.c (font_put_frame_data, font_get_frame_data) [HAVE_XFT || HAVE_FREETYPE]: Prefer alist functions to ad-hoc list management. * xftfont.c (xftfont_get_xft_draw, xftfont_end_for_frame): Related users changed. * ftxfont.c (ftxfont_get_gcs, ftxfont_end_for_frame): Likewise. Prefer convenient xmalloc and xfree.
* Merge from emacs-24; up to 2014-06-06T02:22:40Z!monnier@iro.umontreal.caGlenn Morris2014-06-211-0/+3
|\
| * * font.c (font_make_object): Avoid dangling pointer which mayDmitry Antipov2014-06-191-0/+3
| | | | | | | | crash GC (Bug#17771).
* | * lisp.h (STRING_COPYIN): Remove; unused.Dmitry Antipov2014-06-171-4/+2
| | | | | | | | | | * ccl.c (Fccl_execute_on_string): * font.c (fon_intern_prop): Use make_specified_string.
* | * dispextern.h (struct face) [HAVE_XFT]: Ifdef 'extra' member.Dmitry Antipov2014-06-101-1/+0
| | | | | | | | | | | | | | | | | | | | * font.c (font_done_for_face): * xface.c (realize_non_ascii_face): Adjust user. * font.h (struct font_driver): Convert 'prepare_face' to return void because its return value is never used anyway. * xfont.c (xfont_prepare_face): Return void. * xftfont.c (xftfont_prepare_face): Likewise. Use xmalloc. (xftfont_done_face): Use xfree.
* | * font.c (font_matching_entity): Extract font-entity objectDmitry Antipov2014-05-191-1/+1
| | | | | | | | from the vector of matching entities (Bug#17486).
* | Prefer 'ARRAYELTS (x)' to 'sizeof x / sizeof *x'.Paul Eggert2014-04-051-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * alloc.c (memory_full): * charset.c (syms_of_charset): * doc.c (Fsnarf_documentation): * emacs.c (main): * font.c (BUILD_STYLE_TABLE): * keyboard.c (make_lispy_event): * profiler.c (setup_cpu_timer): * xgselect.c (xg_select): * xterm.c (record_event, STORE_KEYSYM_FOR_DEBUG): Use ARRAYELTS. * font.c (FONT_PROPERTY_TABLE_SIZE): Remove. Replace the only use with ARRAYELTS (font_property_table). * xfaces.c (DIM): Remove. All uses replaced by ARRAYELTS.
* | * font.c (font_list_entities): Do not add empty vector to font cache.Dmitry Antipov2014-04-021-15/+18
|/ | | | | (font_matching_entity): Likewise. If matching entity is found, insert 1-item vector with this entity instead of entity itself (Bug#17125).
* Fix bug #16930 with broken build --without-x.Eli Zaretskii2014-03-031-1/+8
| | | | src/font.c (Fframe_font_cache): Fix last change.
* * font.c (toplevel): Adjust comment about font cache layout.Dmitry Antipov2014-03-031-5/+17
| | | | | | | (font_clear_cache): Fix to match real font cache layout. Suggested by <namespace_collision@yahoo.com> in Bug#16069. (Fframe_font_cache) [FONT_DEBUG]: New function. (syms_of_font) [FONT_DEBUG]: Defsubr it.
* Avoid "." at end of error diagnostics.Paul Eggert2014-02-101-1/+1
| | | | | | | | | * cmds.c (Fself_insert_command): Reword and avoid "." at end. * font.c (Ffont_at): * nsfns.m (ns_display_info_for_name): * nsselect.m (Fx_own_selection_internal): * nsterm.m (performDragOperation:): Remove "." from end of diagnostic.
* Spelling fixes.Paul Eggert2014-01-091-1/+1
| | | | | | * mail/unrmail.el (unrmail-mbox-format): Choice is mboxo, not mboxro. * woman.el (woman-mark-horizontal-position): Rename from woman-mark-horizonal-position. Use changed.