1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-04 11:00:45 -08:00
Commit graph

15386 commits

Author SHA1 Message Date
Paul Eggert
347e014471 Port to hypothetical case where Qnil is nonzero
* alloc.c (allocate_pseudovector):
* callint.c (Fcall_interactively):
* coding.c (syms_of_coding):
* dispnew.c (realloc_glyph_pool):
* fringe.c (init_fringe):
* lisp.h (memsetnil):
* xdisp.c (init_iterator):
Port to the currently-hypothetical case where Qnil is nonzero.
* dispnew.c (adjust_glyph_matrix): Remove unnecessary verification,
as there are no Lisp_Object values in the data here.
* lisp.h (NIL_IS_NONZERO): New symbol, replacing NIL_IS_ZERO.
All uses changed.  Define only if not already defined, so that one
can debug with -DNIL_IS_NONZERO.
* xdisp.c (init_iterator): Remove unnecessary initializations to 0.
2015-01-19 17:17:30 -08:00
Eli Zaretskii
fb6462f056 Verify that Qnil is zero before relying on that in redisplay.
src/dispnew.c (adjust_glyph_matrix, realloc_glyph_pool): Verify that
 Qnil is represented as zero, before using that to initialize parts
 of the glyph structure.
 src/xdisp.c (init_iterator): Verify that Qnil is represented as
 zero, before using that to initialize parts of the iterator
 structure.
2015-01-19 19:22:17 +02:00
Paul Eggert
b7f83adda5 Prefer memset to repeatedly assigning Qnil
* 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.
2015-01-19 01:01:58 -08:00
Dmitry Antipov
4303d11029 Prefer INLINE functions in font.h to match style used in lisp.h
* 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.
2015-01-16 15:15:32 +03:00
Dmitry Antipov
7ee2733f1e Tiny lisp.h cleanup
* lisp.h (XTERMINAL): Add eassert.
* process.c (make_lisp_proc): Now static here.
2015-01-16 14:41:20 +03:00
Dmitry Antipov
3b48f99542 Tune pseudovector allocation assuming Qnil == 0
* 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.
2015-01-16 11:42:24 +03:00
Paul Eggert
0adc75af18 Give up on -Wsuggest-attribute=const
The attribute doesn't help performance significantly, and the
warning seems to be more trouble than it's worth.  See the thread at:
http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00361.html
* configure.ac (WERROR_CFLAGS): Don't use -Wsuggest-attribute=const.
* lib-src/make-docfile.c (write_globals):
Remove special hack for Fnext_read_file_uses_dialog_p.
* src/decompress.c (Fzlib_available_p):
* src/gnutls.c (Fgnutls_available_p):
* src/gtkutil.h (xg_uses_old_file_dialog):
* src/xdisp.c (Ftool_bar_height):
* src/xmenu.c (popup_activated):
No longer const, since it's not const on at lest some
configurations, and we shouldn't lie to the compiler.
2015-01-15 20:37:44 -08:00
Eli Zaretskii
0f238ea450 Add set-binary-mode primitive to switch a standard stream to binary I/O.
src/fileio.c: Include binary-io.h.
 (Fset_binary_mode): New function.
 (syms_of_fileio): Defsubr it.
 (syms_of_fileio) <Qstdin, Qstdout, Qstderr>: DEFSYM them.

 admin/unidata/unidata/uvs.el (uvs-print-table-ivd): Call set-binary-mode on
 stdout.

 doc/lispref/streams.texi (Input Functions): Document 'set-binary-mode'.
 (Output Functions): Cross-reference to documentation of
 'set-binary-mode'.

 etc/NEWS: Mention 'set-binary-mode'.
2015-01-15 17:50:50 +02:00
Ted Zlatanov
3b7eed4ebb Flag :unknown-ca and :self-signed SSL certs (Bug#19404)
Fixes: debbugs:19404

* gnutls.c (init_gnutls_functions): Import gnutls_x509_crt_check_issuer.
(Fgnutls_peer_status): Use it to set the :self-signed flag.
Rename the previous :self-signed to :unknown-ca.
(Fgnutls_peer_status_warning_describe): Explain :unknown-ca flag.
2015-01-15 09:41:58 -05:00
Eli Zaretskii
e7db8e8d5d Fix crashes on MS-Windows due to pop-up menus (Bug#19596)
src/w32fns.c (w32_wnd_proc): Ignore MENUITEMINFO's dwItemData data
 when FLAGS indicate the item is not highlighted, i.e. it's not our
 help-echo string.
2015-01-14 20:51:33 +02:00
Martin Rudalics
9602b62514 In update_frame_menubar remove garbaged code.
* xmenu.c (update_frame_menubar): Remove garbaged code.
2015-01-14 15:47:19 +01:00
Dmitry Antipov
009836b97c Never move gap in make_buffer_string_both.
* editfns.c (make_buffer_string_both): If requested range intersects
the gap, don't move the latter but copy in two regions, thus avoiding
unnecessary relocation of buffer data.
2015-01-14 15:56:46 +03:00
Dmitry Antipov
da396beb6e Consistently handle time zone specification.
* editfns.c (decode_time_zone): New function, refactored out from ...
(Fencode_time): ... adjusted user.
(Fset_time_zone_rule): Use decode_time_zone.
2015-01-14 12:43:43 +03:00
Paul Eggert
d4b352af3e remove_slash_colon need not be inline
* process.c, process.h (remove_slash_colon): No longer inline.
This saves text bytes without hurting runtime performance.
2015-01-14 00:42:48 -08:00
Dmitry Antipov
d7e26b4410 Consolidate common path transformation code.
* process.h (remove_slash_colon): New function.
* callproc.c (encode_current_directory, call_process):
* process.c (Fstart_process): Use it.
2015-01-14 10:08:44 +03:00
Dmitry Antipov
01ebf7a365 Avoid extra multibyteness check in ENCODE_FILE users.
* callproc.c (encode_current_directory, Fcall_process, call_process):
* dired.c (directory_files_internal, file_name_completion):
Do not check for STRING_MULTIBYTE because encode_file_name
is a no-op for unibyte strings.
2015-01-14 09:50:39 +03:00
Paul Eggert
3ef29501b0 Use bool for boolean in xmenu.c, xml.c
* xmenu.c (x_menu_set_in_use, popup_get_selection)
(Fx_menu_bar_open_internal, popup_widget_loop)
(x_activate_menubar, xg_crazy_callback_abort)
(update_frame_menubar, set_frame_menubar)
(initialize_frame_menubar, free_frame_menubar)
(create_and_show_popup_menu, x_menu_show)
(create_and_show_dialog, x_dialog_show):
* xml.c (libxml2_loaded_p, init_libxml2_functions, parse_region)
(Flibxml_parse_html_region, Flibxml_parse_xml_region):
* xrdb.c (main) [TESTRM]:
* xsettings.c (init_gsettings):
* xterm.c (XFillRectangle, xg_scroll_callback)
(xg_end_scroll_callback):
* xterm.h (x_menu_set_in_use) [USE_GTK || USE_MOTIF]:
Use bool for boolean.
* xmenu.c (TRUE): Remove; no longer used.
(show_help_event): Remove long-unused code.
(set_frame_menubar): Remove "#if 1" and corresponding "#endif" lines.
2015-01-13 21:20:31 -08:00
Paul Eggert
785adfcc8d Don't say Fnext_read_file_uses_dialog_p is const
It's const only if a windowing system is not used; don't say it's
const otherwise.  See:
http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00310.html
* lib-src/make-docfile.c (write_globals):
Add a special hack for Fnext_read_file_uses_dialog_p.
* src/fileio.c (next_read_file_uses_dialog_p): Remove.
Move guts back to ...
(Fnext_read_file_uses_dialog_p): ... here.
Don't declare as const, as make-docfile.c now has a special case
for this function.  This is an ugly hack, but it's better than
lying to the compiler.
2015-01-13 15:23:03 -08:00
Paul Eggert
5647847662 Remove now-unnecessary forward XTYPE decl
* lisp.h (XTYPE): Remove forward declaration.  The recent merge
from emacs-24 fixed the problem in a better way, by moving XPNTR's
definition to after XTYPE's.
2015-01-13 14:04:59 -08:00
Eli Zaretskii
5aa618b058 Fix problems with 32-bit wide-int build exposed by MinGW
lisp.h (XPNTR): Move definition to after XTYPE, to avoid
 compilation error in an unoptimized build when !USE_LSB_TAG.
 src/w32heap.c (DUMPED_HEAP_SIZE): For 32-bit wide-int build, use the
 same larger value as for the 64-bit build.
 src/w32term.h (SCROLL_BAR_PACK): Cast the result to UINT_PTR to
 avoid compiler warnings.
 src/w32proc.c (Fw32_get_codepage_charset, Fw32_set_keyboard_layout):
 Avoid compiler warnings about cast from integer to pointer of
 different size.
 src/w32menu.c (menubar_selection_callback, w32_menu_show): Cast to
 UINT_PTR instead of EMACS_INT, to avoid compiler warnings about
 casting from integer to pointer of different size.
 (add_menu_item): Pass the help-echo string as a pointer to
 Lisp_String, not as a Lisp_Object.
 (w32_menu_display_help): Use make_lisp_ptr to reconstruct a Lisp
 string object from its C pointer.
 src/w32fns.c (w32_msg_pump) <WM_EMACS_UNREGISTER_HOT_KEY>: Use
 make_lisp_ptr instead of XIL, to reconstruct a Lisp_Cons from its
 C pointer.
 <WM_EMACS_TOGGLE_LOCK_KEY>: msg.lparam is now a C integer.
 (Fx_create_frame): Type-cast the result of XFASTINT to avoild
 compiler warnings about size differences.
 (Fw32_unregister_hot_key): Pass the tail of w32_grabbed_keys as a
 pointer to a Lisp_Cons struct, not as a disguised EMACS_INT.
 (Fw32_toggle_lock_key): Pass the new state of the key as a C
 integer; use -1 for nil.  Doc fix.
 src/.gdbinit (xgetsym): New subroutine.
 (xsymname, xsymbol): Use it.
 (xprintsym): No need to call xgetptr.
2015-01-13 19:16:51 +02:00
Dmitry Antipov
0064e36f4f Make Fnext_read_file_uses_dialog_p compatible with recent DEFUN change.
* fileio.c (next_read_file_uses_dialog_p): New workaround ...
(Fnext_read_file_uses_dialog_p): ... called from here to avoid
ATTRIBUTE_CONST dependency from #ifdefs.  For details, see
http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00289.html.
2015-01-13 13:08:32 +03:00
Martin Rudalics
233dcf127d In adjust_frame_size don't return too early after font size change.
* frame.c (adjust_frame_size): Make sure new numbers of
lines/columns get installed after font size change (Bug#19575).
2015-01-13 09:10:05 +01:00
Dmitry Antipov
b53b1ca422 Consolidate duplicated string matching code.
* search.c (fast_string_match_internal): New function,
consolidated from...
(fast_string_match, fast_string_match_ignore_case): ...functions
which are...
* lisp.h (fast_string_match, fast_string_match_ignore_case):
inlined from here now.
(fast_string_match_internal): Add prototype.
* dired.c (file_name_completion): Use fast_string_match_internal.
2015-01-13 07:08:54 +03:00
Dmitry Antipov
ad9c4a4091 Support const and noreturn DEFUN attributes.
* lib-src/make-docfile.c (struct global): New field 'flags'.
(DEFUN_noreturn, DEFUN_const): New enum bitfields.
(add_global): Now return pointer to global.
(write_globals): Add _Noreturn and ATTRIBUTE_CONST attributes
if requested by global's flags.
(stream_match): New function.
(scan_c_stream): Recognize 'attributes:' of DEFUN.

* src/callint.c (Finteractive):
* src/character.c (Fcharacterp, Fmax_char):
* src.data.c (Feq, Fnull, Fconsp, Fatom, Flistp, Fnlistp, Fsymbolp)
(Fstringp, Fchar_or_string_p, Fintegerp, Fnatnump, Fnumberp)
(Ffloatp, Fbyteorder):
* src/decompress.c (Fzlib_available_p):
* src/fns.c (Fidentity):
* src/frame.c (Fframe_windows_min_size):
* src/gnutls.c (Fgnutls_error_p, Fgnutls_available_p):
* src/window.c (Fwindow__sanitize_window_sizes):
* src/xdisp.c (Ftool_bar_height):
* src/xfaces.c (Fface_attribute_relative_p): Add const attribute.
* src/emacs.c (Fkill_emacs):
* src/eval.c (Fthrow):
* src/keyboard.c (Ftop_level, Fexit_recursive_edit)
(Fabor_recursive_edit): Add noreturn attribute.
2015-01-13 06:39:45 +03:00
Paul Eggert
52afe0cfa2 Port to 32-bit MingGW --with-wide-int
Problem reported by Eli Zaretskii in:
http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00265.html
* lisp.h (struct Lisp_Sub_Char_Table): Check that offset matches
what we think it is, rather than checking only its alignment (and
doing so incorrectly on MinGW).
2015-01-12 11:28:05 -08:00
Dmitry Antipov
e946a9acf6 Miscellaneous tiny fixes here and there.
* fileio.c (Ffile_name_as_directory, Fdirectory_file_name):
Remove dead NILP check.
* image.c (Flookup_image): Use regular format for docstring.
* keyboard.c (apply_modifiers_uncached): Use stpcpy.
2015-01-12 20:14:43 +03:00
Martin Rudalics
fb35f1f715 Adjust frame heights to real height of tool bar.
* frame.el (frame-notice-user-settings): Remove code dealing with
frame-initial-frame-tool-bar-height.  Turn off `tool-bar-mode'
only if `window-system-frame-alist' or `default-frame-alist' ask
for it.
(make-frame): Update frame-adjust-size-history if needed.
* dispnew.c (change_frame_size_1): Pass Qchange_frame_size to
adjust_frame_size.
* frame.c (frame_default_tool_bar_height): New variable.
(adjust_frame_size): Possibly add requested adjustment to
Vframe_adjust_size_history.
(make_frame): Initialize tool_bar_redisplayed_once slot.
(Fset_frame_height, Fset_frame_width, Fset_frame_size): Clarify
doc-string.  Call adjust_frame_size unconditionally (the frame's
text size may remain unaltered but the pixel size may change).
(x_figure_window_size): If frame_default_tool_bar_height was
set, use it instead of calculating the tool bar height from
DEFAULT_TOOL_BAR_IMAGE_HEIGHT.  Don't set
Vframe_initial_frame_tool_bar_height.
(Qchange_frame_size, Qxg_frame_set_char_size)
(Qset_window_configuration, Qx_create_frame_1)
(Qx_create_frame_2): New symbols.
(Vframe_initial_frame_tool_bar_height): Remove.
(Vframe_adjust_size_history): New history variable for debugging
frame size adjustments.
* frame.h (struct frame): New boolean slot
tool_bar_redisplayed_once.
(frame_default_tool_bar_height): Extern.
* gtkutil.c (xg_frame_set_char_size): Pass Qxg_frame_set_char_size
to adjust_frame_size.
* nsfns.m (Fx_create_frame): Pass Pass Qx_create_frame_1 and
Qx_create_frame_2 to adjust_frame_size.
* w32fns.c (x_change_tool_bar_height): Call adjust_frame_size with
inhibit 1 when we have not redisplayed the tool bar yet.
(Fx_create_frame): Pass Pass Qx_create_frame_1 and
Qx_create_frame_2 to adjust_frame_size.
* w32menu.c (set_frame_menubar): Simplify adjust_frame_size
call.
* window.c (Fset_window_configuration): Pass
Qset_window_configuration to adjust_frame_size.
* xdisp.c (redisplay_tool_bar): Assign new height to
frame_default_tool_bar_height.
(redisplay_internal): If we haven't redisplayed this frame's
tool bar, call redisplay_tool_bar early so we can adjust the
frame size accordingly.
* xfns.c (x_change_tool_bar_height): Call adjust_frame_size with
inhibit 1 when we have not redisplayed the tool bar yet.
(Fx_create_frame): Pass Pass Qx_create_frame_1 and
Qx_create_frame_2 to adjust_frame_size.
2015-01-12 08:18:00 +01:00
Paul Eggert
d703a4dce5 Have 'make' output better GEN names
* lisp/Makefile.in (PHONY_EXTRAS): New macro.
(.PHONY): Depend on it, and on $(lisp)/loaddefs.el, so that the
relevant files' time stamps are ignored.
(custom-deps, $(lisp)/cus-load.el, finder-data)
($(lisp)/finder-inf.el): Use PHONY_EXTRAS.
(custom-deps, $(lisp)/cus-load.el, finder-data)
($(lisp)/finder-inf.el, autoloads, $(lisp)/loaddefs.el)
($(lisp)/subdirs.el, update-subdirs):
Output more-accurate destination names with GEN.
* src/Makefile.in (gl-stamp, globals.h): Simplify by putting the new
contents of globals.h into gl-stamp.  This lets us use AM_V_GEN
more naturally so that 'make' can output more-accurate names.
2015-01-11 18:20:08 -08:00
Stefan Monnier
23ffeb9015 * src/buffer.c (init_buffer_once): Initialize buffer_local_flags early.
* src/buffer.c (init_buffer_once): Initialize buffer_local_flags before
calling reset_buffer_local_variables, and make sure we initialize
it completely.
2015-01-11 17:38:04 -05:00
Dmitry Antipov
509257822c * coding.c (Fcoding_system_plist): Use common style for docstring. 2015-01-11 20:42:53 +03:00
Paul Eggert
9a57bda315 Port to MSB hosts without optimization
E.g., when configuring --with-wide-int CFLAGS='-O0' on x86,
the inline function XTYPE needs to be declared before being used.
* lisp.h (XTYPE): New forward declaration.
2015-01-11 01:43:15 -08:00
Paul Eggert
6a37ecee08 Port to 32-bit --with-wide-int
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.
2015-01-10 13:42:35 -08:00
Paul Eggert
649937920b Port to HAVE_FREETYPE && !HAVE_XFT
* dispextern.h (struct face.extra) [HAVE_FREETYPE && !HAVE_XFT]:
* font.h (syms_of_xftfont) [HAVE_FREETYPE && !HAVE_XFT]:
Declare in this case too.
2015-01-10 13:42:34 -08:00
Paul Eggert
29eaf3c8a8 Port Qnil==0 changes to 32-bit --with-wide-int
* lisp.h (lisp_h_XSYMBOL, XSYMBOL): Assume USE_LSB_TAG in the
macro-implemented version.  For the non-USE_LSB_TAG case, supply
a new inline function that is the inverse of the new TAG_SYMPTR.
(lisp_h_XUNTAGBASE, XUNTAGBASE): Remove.  All uses removed.
(TAG_SYMPTR) [!USE_LSB_TAG]: If the pointer subtraction yields a
negative number, don't allow sign bits to bleed into the encoded
value.  Shift in zero bits instead.
2015-01-10 13:42:34 -08:00
Eli Zaretskii
485763c0dc MS-Windows followup for change in semantics of XIL and XLI. (Bug#15880)
src/w32fns.c (Fw32_register_hot_key): Use XINT instead of XLI.
 src/w32notify.c (Fw32notify_add_watch, w32_get_watch_object): Use
 make_pointer_integer instead of XIL.
 (Fw32notify_rm_watch): Use XINTPTR instead of XLI.
 src/w32inevt.c (handle_file_notifications): Use make_pointer_integer
 instead of XIL.  Put a list of the descriptor, action, and file
 name in event->arg, instead of spreading them between event->code
 and event->arg.
 src/w32term.c (queue_notifications): Use make_pointer_integer
 instead of XIL.  Put a list of the descriptor, action, and file
 name in event->arg, instead of spreading them between event->code
 and event->arg.
 src/keyboard.c (kbd_buffer_get_event) [HAVE_W32NOTIFY]: Adjust Lisp
 event creation to changes in w32term.c and w32inevt.c above.
2015-01-10 13:27:35 +02:00
Paul Eggert
d1f848ffb9 Refactor pointer-to-integer conversion
* gfilenotify.c (monitor_to_lisp, lisp_to_monitor):
Rename and move to lisp.h.  All uses changed.
* lisp.h (XINTPTR, make_pointer_integer): New inline functions,
which are renamed from gfilenotify.c's lisp_to_monitor and
monitor_to_lisp, and with more-generic void * signatures.
2015-01-09 08:22:35 -08:00
Eli Zaretskii
5fbd17e369 Fix line-move-visual's following of column in R2L lines.
src/simple.el (line-move-visual): When converting X pixel coordinate
 to temporary-goal-column, adjust the value for right-to-left
 screen lines.  This fixes vertical-motion, next/prev-line, etc.

 src/dispnew.c (buffer_posn_from_coords): Fix the value of the column
 returned for right-to-left screen lines.  (Before the change on
 2014-12-30, the incorrectly-computed X pixel coordinate concealed
 this bug.)
2015-01-08 16:04:46 +02:00
Eli Zaretskii
ad83cdacb6 Fix GDB accesses to the 'nil's name.
src/.gdbinit (xsymname): New subroutine.
 (xprintsym, initial-tbreak): Use it to access the name of a symbol
 in a way that doesn't cause GDB to barf when it tries to
 dereference a NULL pointer.
2015-01-08 15:53:09 +02:00
Eli Zaretskii
daa18b5e85 Fix fallout from "Qnil is zero" change in the display engine. (Bug#19535)
src/xdisp.c (next_element_from_c_string): Use Lisp integer zero as
 the object.
 (set_cursor_from_row, try_cursor_movement, dump_glyph)
 (insert_left_trunc_glyphs, append_space_for_newline)
 (extend_face_to_end_of_line, highlight_trailing_whitespace)
 (find_row_edges, ROW_GLYPH_NEWLINE_P, Fmove_point_visually)
 (Fbidi_resolved_levels, produce_special_glyphs)
 (rows_from_pos_range, mouse_face_from_buffer_pos)
 (note_mouse_highlight): Use nil as the object for glyphs inserted
 by the display engine, and test with NILP instead of INTEGERP.
 src/w32fns.c (Fx_show_tip): Use NILP to test for glyphs inserted by
 the display engine.
 src/xfns.c (Fx_show_tip): Use NILP to test for glyphs inserted by
 the display engine.
 src/dispextern.h (struct glyph, struct it): Update comments for the
 OBJECT members.
2015-01-08 15:46:23 +02:00
Paul Eggert
0002f31af9 Port new Lisp symbol init to x86 --with-wide-int
* lisp.h (DEFINE_LISP_SYMBOL_BEGIN, DEFINE_LISP_SYMBOL_END):
Define to empty on platforms where EMACS_INT_MAX != INTPTR_MAX, as
GCC (at least) does not allow a constant initializer to widen an
address constant.
2015-01-08 00:44:18 -08:00
Paul Eggert
206333ee30 * lisp.h (TAG_SYMPTR): Don't do arithmetic on NULL.
This is a followup to the "Port Qnil==0 XUNTAG to clang" patch.
Although clang doesn't need it, some other compiler might, and
it's easy enough to be safe.
2015-01-07 23:40:20 -08:00
Paul Eggert
ce5c361c14 * conf_post.h (ATTRIBUTE_ALLOC_SIZE): Port to clang 3.5.0.
Apparently clang removed support for the alloc_size attribute.
2015-01-07 23:12:04 -08:00
Paul Eggert
f6a27d26dc Port Qnil==0 XUNTAG to clang
clang has undefined behavior if the program subtracts an integer
from (char *) 0.  Problem reported by YAMAMOTO Mitsuharu in:
http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00132.html
* lisp.h (lisp_h_XUNTAG) [USE_LSB_TAG]:
(XUNTAG) [!USE_LSB_TAG]: Port to clang 3.5.0.
2015-01-07 23:02:27 -08:00
Glenn Morris
9f654763f2 # ChangeLog fixes 2015-01-07 21:00:04 -08:00
Paul Eggert
d71659fed4 Port GFileMonitor * hack to Qnil==0 platforms
Reported by Glenn Morris in: http://bugs.gnu.org/15880#112
* gfilenotify.c (monitor_to_lisp, lisp_to_monitor): New functions.
(dir_monitor_callback, Fgfile_add_watch, Fgfile_rm_watch): Use them.
2015-01-07 17:13:05 -08:00
Eli Zaretskii
8596361bb3 src/window.c (Fwindow_body_width): Doc fix. (Bug#19395) 2015-01-08 00:17:32 +01:00
Jan D
c751166609 NS: Fix frame size when height and font set at startup.
* nsterm.m (x_set_window_size): Call updateFrameSize to get real
size instead of using widht/height.  The frame may be constrained.
2015-01-06 20:30:39 +01:00
Paul Eggert
6e8fe3f853 * lisp.h (XSYMBOL): Parenthesize id in forward decl.
Needed when neither optimizing nor inlining.
Also, sort decls alphabetically.
2015-01-05 14:16:23 -08:00
Eli Zaretskii
5b5dab1281 MS-Windows followup to previous commit
src/w32proc.c, src/w32.h, src/w32fns.c, src/w32font.c, src/w32menu.c:
 src/w32notify.c, src/w32proc.c, src/w32select.c, src/w32term.c:
 src/w32uniscribe.c: Remove declarations of Q* variables that
 represent symbols.
2015-01-05 22:13:58 +02:00
Paul Eggert
bc78ff2603 Use 0 for Qnil
Fixes Bug#15880.
If USE_LSB_TAG, arrange for the representation of Qnil to be zero so
that NILP (x) is equivalent to testing whether x is 0 at the
machine level.  The overall effects of this and the previous patch
shrink the size of the text segment by 2.3% and speeds up
compilation of all the .elc files by about 0.5% on my platform,
which is Fedora 20 x86-64.
* lib-src/make-docfile.c (compare_globals):
* src/lisp.h (lisp_h_XPNTR, lisp_h_XSYMBOL, lisp_h_XUNTAG)
(make_lisp_symbol) [USE_LSB_TAG]:
Symbols now tag the difference from lispsym, not the pointer.
(lisp_h_XUNTAGBASE, TAG_SYMPTR): New macros.
(Lisp_Int0, Lisp_Int1, Lisp_Symbol, Lisp_Misc, Lisp_String, Lisp_Cons):
Renumber so that Lisp_Symbol is 0, so that Qnil is zero.
(XSYMBOL): New forward decl.
(XUNTAGBASE): New function.
(XUNTAG): Use it.
2015-01-05 10:15:04 -08:00