1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-30 08:09:04 +00:00
Commit Graph

318 Commits

Author SHA1 Message Date
Eli Zaretskii
d8a9c450cf Yet another fix for copying properties by 'format'
* src/textprop.c (extend_property_ranges): Accept an additional
argument OLD_END, and only extend the end of a property range if
its original end is at OLD_END; all the other ranges are left
intact.  (Bug#23897)
* src/editfns.c (styled_format): Pass the original length of the
string to 'extend_property_ranges'.
* src/intervals.h (extend_property_ranges): Adjust prototype.

* test/src/editfns-tests.el (format-properties): Add tests for
bug#23897.
2016-07-08 22:34:34 +03:00
Eli Zaretskii
0644e6f56d Fix copying properties in 'format' when it produces padding
* src/textprop.c (extend_property_ranges): Correct range extension
when the new end is beyond the old end.  (Bug#23859)
2016-06-28 19:03:43 +03:00
Paul Eggert
7352c6c695 Rework C source files to avoid ^(
Work around Bug#22884 by rewording comments and strings to avoid ‘(’
at the start of a line unless it starts a function.  This change
is a short-term hack; in the longer run we plan to fix cc-mode’s
performance for C files that have ‘(’ at the start of a line in a
comment or string.
2016-03-10 07:59:19 -08:00
Paul Eggert
0e963201d0 Update copyright year to 2016
Run admin/update-copyright.
2016-01-01 01:34:24 -08:00
Paul Eggert
63cfb75f3a Include-file cleanup for src directory
Omit ‘#include "foo.h"’ unless the file needs foo.h (Bug#21707).
In a few cases, add ‘#include "foo.h"’ if the file needs foo.h
but does not include it directly.  As a general rule, a source
file should include foo.h if it needs the interfaces that foo.h
defines.
* src/alloc.c: Don’t include process.h.  Include dispextern.h,
systime.h.
* src/atimer.c: Don’t include blockinput.h.
* src/buffer.c: Include coding.h, systime.h.  Don’t include
keyboard.h, coding.h.
* src/callint.c: Don’t include commands.h, keymap.h.
* src/callproc.c: Don’t include character.h, ccl.h, composite.h,
systty.h, termhooks.h.
* src/casetab.c: Don’t include character.h.
* src/category.c: Don’t include charset.h, keymap.h.
* src/ccl.h: Don’t include character.h.
* src/character.c: Don’t include charset.h.
* src/charset.c: Don’t include disptab.h.
* src/chartab.c: Don’t include ccl.h.
* src/cm.c: Don’t include frame.h, termhooks.h.
* src/cmds.c: Don’t include window.h, dispextern.h.
* src/coding.c: Don’t include window.h, frame.h.
* src/composite.c: Include composite.h.  Don’t include window.h,
font.h.
* src/data.c: Don’t include syssignal.h, termhooks.h, font.h.
* src/dbusbind.c: Don’t include frame.h.
* src/decompress.c: Don’t include character.h.
* src/dired.c: Don’t include character.h, commands.h, charset.h.
* src/dispnew.c: Don’t include character.h, indent.h, intervals.h,
process.h, timespec.h.  Include systime.h.
* src/doc.c: Include coding.h.  Don’t include keyboard.h.
* src/editfns.c: Include composite.h.  Don’t include frame.h.
* src/emacs.c: Include fcntl.h, coding.h.  Don’t include
commands.h, systty.h..
* src/fileio.c: Don’t include intervals.h, dispextern.h.
Include composite.h.
* src/filelock.c: Don’t include character.h, systime.h.
* src/fns.c: Don’t include time.h, commands.h, keyboard.h,
keymap.h, frame.h, blockinput.h, xterm.h.  Include composite.h.
* src/font.c: Include termhooks.h.
* src/font.h: Don’t include ccl.h, frame.h.  Add forward decls of
struct composition_it, struct face, struct glyph_string.
* src/fontset.c: Don’t include buffer.h, ccl.h, keyboard.h,
intervals.h, window.h, termhooks.h.
* src/frame.c: Don’t include character.h, commands.h, font.h.
* src/frame.h: Don’t include dispextern.h.
* src/fringe.c: Don’t include character.h.
* src/ftcrfont.c: Don’t include dispextern.h, frame.h,
character.h, charset.h, fontset.h.
* src/ftfont.c: Don’t include frame.h, blockinput.h, coding.h,
fontset.h.
* src/ftxfont.c: Don’t include dispextern.h, character.h,
charset.h, fontset.h.
* src/gfilenotify.c: Don’t include frame.h, process.h.
* src/gtkutil.c: Include dispextern.h, frame.h, systime.h.
Don’t include syssignal.h, buffer.h, charset.h, font.h.
* src/gtkutil.h: Don’t include frame.h.
* src/image.c: Include fcntl.h and stdio.h instead of sysstdio.h.
Don’t include character.h.
* src/indent.c: Don’t include keyboard.h, termchar.h.
* src/inotify.c: Don’t include character.h, frame.h.
* src/insdel.c: Include composite.h.  Don’t include blockinput.h.
* src/intervals.c: Don’t include character.h, keyboard.h.
* src/intervals.h: Don’t include dispextern.h, composite.h.
* src/keyboard.c: Don’t include sysstdio.h, disptab.h, puresize.h.
Include coding.h.
* src/keyboard.h: Don’t incldue systime.h.
* src/keymap.c: Don’t include charset.h, frame.h.
* src/lread.c: Include dispextern.h and systime.h.
Don’t include frame.h.  Include systime.h.
* src/macros.c: Don’t include commands.h, character.h, buffer.h.
* src/menu.c: Include character.h, coding.h.  Don’t include
dispextern.h.
* src/menu.h: Don’t include systime.h.
* src/minibuf.c: Don’t include commands.h, dispextern.h, syntax.h,
intervals.h, termhooks.h.
* src/print.c: Include coding.h.  Don’t include keyboard.h,
window.h, dispextern.h, termchar.h, termhooks.h, font.h.
Add forward decl of struct terminal.
* src/process.c: Don’t include termhooks.h, commands.h,
dispextern.h, composite.h.
* src/region-cache.c: Don’t include character.h.
* src/scroll.c: Don’t include keyboard.h, window.h.
* src/search.c: Don’t include category.h, commands.h.
* src/sound.c: Don’t include dispextern.h.
* src/syntax.c: Don’t include command.h, keymap.h.
* src/sysdep.c: Don’t include window.h, dispextern.h.
* src/systime.h: Use ‘#ifdef emacs’, not ‘#ifdef EMACS_LISP_H’,
* src/term.c: Don’t include systty.h, intervals.h, xterm.h.
* src/terminal.c: Include character.h.
Don’t include charset.h, coding.h.
* src/textprop.c: Don’t include character.h.
* src/undo.c: Don’t include character.h, commands.h, window.h.
* src/unexsol.c: Don’t include character.h, charset.h.
* src/widget.c: Include widget.h.  Don’t include keyboard.h,
window.h, dispextern.h, blockinput.h, character.h, font.h.
* src/widgetprv.h: Don’t include widget.h.
* src/window.c: Don’t include character.h, menu.h, intervals.h.
* src/xdisp.c: Include composite.h, systime.h.  Don’t include
macros.h, process.h.
* src/xfaces.c: Don’t include charset.h, keyboard.h, termhooks.h,
intervals.h.
* src/xfns.c: Don’t include menu.h, character.h, intervals.h,
epaths.h, fontset.h, systime.h, atimer.h, termchar.h.
* src/xfont.c: Don’t include dispextern.h, fontset.h, ccl.h.
* src/xftfont.c: Don’t include dispextern.h, character.h, fontset.h.
* src/xgselect.c: Don’t include timespec.h, frame.h.
Include systime.h.
* src/xgselect.h: Don’t include time.h.
Use a forward decl to struct timespec instead.
* src/xmenu.c: Don’t include keymap.h, character.h, charset.h,
dispextern.h.  Include systime.h.
* src/xml.c: Don’t include character.h.
* src/xrdb.c [USE_MOTIF]: Don’t include keyboard.h.
* src/xselect.c: Don’t include dispextern.h, character.h,
buffer.h, process.h.
* src/xsmfns.c: Don’t include systime.h, sysselect.h.
* src/xterm.c: Don’t include syssignal.h, charset.h, disptab.h,
intervals.h process.h, keymap.h, xgselect.h.  Include composite.h.
2015-10-20 18:35:53 -07:00
Paul Eggert
032ce1c7d1 Omit unnecessary \ before paren in C docstrings
Although \( is needed in docstrings in Elisp code, it is not needed in
docstrings in C code, since C function definitiions do not start with
a parenthesis.  The backslashes made the docstrings a bit harder to
read and to format in columns.  Also, some C docstrings had ( in
column 1 and this did not appear to be causing any problems.  So,
simplify C docstrings by replacing \( with ( and \) with ).
2015-09-16 16:26:07 -07:00
Paul Eggert
60d1b18734 Assume GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS
This removes the need for GCPRO1 etc.  Suggested by Stefan Monnier in:
http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00918.html
* doc/lispref/internals.texi (Writing Emacs Primitives):
* etc/NEWS:
Document the change.
* src/alloc.c (gcprolist, dump_zombies, MAX_ZOMBIES, zombies)
(nzombies, ngcs, avg_zombies, max_live, max_zombies, avg_live)
(Fgc_status, check_gcpros, relocatable_string_data_p, gc-precise):
* src/bytecode.c (mark_byte_stack) [BYTE_MARK_STACK]:
* src/eval.c (gcpro_level) [DEBUG_GCPRO]:
* src/lisp.h (struct handler.gcpro, struct gcpro, GC_MARK_STACK)
(GC_USE_GCPROS_AS_BEFORE, GC_MAKE_GCPROS_NOOPS)
(GC_MARK_STACK_CHECK_GCPROS, GC_USE_GCPROS_CHECK_ZOMBIES)
(BYTE_MARK_STACK, GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6)
(GCPRO7, UNGCPRO, RETURN_UNGCPRO):
Remove.  All uses removed.  The code now assumes
GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS.
* src/bytecode.c (relocate_byte_stack):
Rename from unmark_byte_stack, since it now only relocates.
All callers changed.
* src/frame.c (make_frame): Add an IF_LINT to pacify GCC 5.2
with GCPROs removed.
* src/systime.h: Use EMACS_LISP_H as the canary instead of GCPRO1.
* test/automated/finalizer-tests.el (finalizer-basic)
(finalizer-circular-reference, finalizer-cross-reference)
(finalizer-error):
* test/automated/generator-tests.el (cps-test-iter-close-finalizer):
Remove tests, as they depend on gc-precise.
2015-08-26 19:24:58 -07:00
Paul Eggert
0c2a3cf62a Remove unused DEFSYMs
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.
2015-05-31 11:50:01 -07:00
Stefan Monnier
f655987d63 Un-revert changes mistakenly dropped by f9fabb2b 2015-05-27 22:42:33 -04:00
Paul Eggert
2f5da6d45a Spelling fixes 2015-04-24 23:19:59 -07:00
Eli Zaretskii
168609cc1b Clarify doc strings of functions that search for properties
* src/textprop.c (Fnext_char_property_change)
(Fprevious_char_property_change)
(Fnext_single_char_property_change)
(Fprevious_single_char_property_change, Fnext_property_change)
(Fnext_single_property_change, Fprevious_property_change)
(Fprevious_single_property_change): Clarify doc strings wrt return
value and the optional LIMIT argument.  (Bug#20411)
2015-04-24 11:24:56 +03:00
Paul Eggert
62e170072e Use bool for boolean in textprop.c, undo.c
* src/textprop.c (soft, hard): Now constants instead of macros.
(validate_plist): Rewrite to avoid need for boolean local.
(interval_has_all_properties, interval_has_some_properties)
(interval_has_some_properties_list, add_properties)
(remove_properties, get_char_property_and_overlay)
(Fnext_single_char_property_change)
(Fprevious_single_char_property_change, add_text_properties_1)
(Fremove_text_properties, Fremove_list_of_text_properties)
(copy_text_properties):
* src/tparam.c (tparam1):
* src/undo.c (record_change, record_property_change)
(syms_of_undo):
Use 'true' and 'false' for booleans.
2015-04-19 13:13:52 -07:00
Paul Eggert
3ebf06300b Prefer 'Qfoo' to 'intern ("foo")'
* buffer.c (syms_of_buffer):
* bytecode.c (exec_byte_code):
* callint.c (Fcall_interactively):
* callproc.c (create_temp_file):
* charset.c (define_charset_internal):
* coding.c (syms_of_coding):
* editfns.c (syms_of_editfns):
* emacs.c (main):
* fns.c (syms_of_fns):
* frame.c (delete_frame, Fframe_parameters):
* keyboard.c (syms_of_keyboard):
* keymap.c (syms_of_keymap):
* minibuf.c (read_minibuf, syms_of_minibuf):
* nsfns.m (ns_cursor_type_to_lisp):
* textprop.c (syms_of_textprop):
* xdisp.c (Fformat_mode_line, syms_of_xdisp):
* xfns.c (x_create_tip_frame, Fx_select_font):
* xml.c (parse_region):
Prefer constants like 'Qfoo' to calls like 'intern ("foo")'.
* buffer.c (syms_of_buffer): OK to do (put 'erase-buffer 'disabled
t) here now ...
(keys_of_buffer): ... instead of here.
* ftfont.c (syms_of_ftfont): Move DEFSYM of Qmono from here ...
* xfns.c (syms_of_xfns): ... to here, since ftfont.c is more
optional than xfns.c.
2015-02-21 00:27:00 -08:00
Paul Eggert
58f2d6ef32 Compute C decls for DEFSYMs automatically
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.
2015-01-05 10:14:58 -08:00
Paul Eggert
7e09ef09a4 Update copyright year to 2015
Run admin/update-copyright.
2015-01-01 14:26:41 -08:00
Lars Magne Ingebrigtsen
d1b04a9e7a Implement an `inhibit-read-only' text property
* doc/lispref/text.texi (Special Properties): Mention `inhibit-read-only'.

* src/buffer.c (Fbarf_if_buffer_read_only): Don't raise an error if
the text at POSITION (new optional argument) has the
`inhibit-read-only' text property set.

* src/callint.c (Fcall_interactively): Pass in nil as argument to
Fbarf_if_buffer_read_only.

* src/fileio.c (Finsert_file_contents): Ditto.

* src/insdel.c (prepare_to_modify_buffer_1): Pass start region in.

* src/intervals.h (INTERVAL_WRITABLE_P): Check the `inhibit-read-only'
text property.

* src/textprop.c (verify_interval_modification): Check buffer
readedness after the last interval.
2014-11-16 23:41:55 +01:00
Paul Eggert
27900ac72a Use AUTO_CONS instead of SCOPED_CONS, etc.
* 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.
2014-09-30 20:28:16 -07:00
Dmitry Antipov
71a72686e3 Keep stack-allocated Lisp objects fast rather than versatile.
* 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.
2014-09-29 10:44:31 +04:00
Paul Eggert
10381f5894 Fix local_cons etc. to not exhaust the stack when in a loop.
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.
2014-09-24 19:01:14 -07:00
Dmitry Antipov
edb0288b83 If USE_LOCAL_ALLOCATORS, allocate some Lisp objects on stack.
* 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.
2014-09-15 18:53:23 +04:00
Paul Eggert
b3bf18b3b8 Use SAFE_ALLOCA etc. to avoid unbounded stack allocation.
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
2014-09-07 00:04:01 -07:00
Paul Eggert
d9784824e2 Space before paren, updating recent change. 2014-01-14 09:59:19 -08:00
Daniel Colascione
1b49bd5d72 Correctly handle reaching the end of the interval tree. (Bug#15344) 2014-01-13 15:41:43 -08:00
Paul Eggert
ba3189039a Update copyright year to 2014 by running admin/update-copyright. 2014-01-01 07:43:34 +00:00
Chong Yidong
f5df4cebdb Add/fix docs for add-face-text-property
* doc/lispref/text.texi (Changing Properties): Improve documentation for
add-face-text-property.
(Special Properties): Mention add-face-text-property.

* src/textprop.c (Fadd_face_text_property): Doc fix.  Rename `appendp'
argument to `append'.
2013-12-20 15:12:04 +08:00
Paul Eggert
4aaf6b615b Fix minor problems found by static checking.
* lread.c (load_path_default): Now static.
* textprop.c (text_property_stickiness): Be consistent about the
test used when deciding whether to consider the previous character.
This simplifies the code a bit.
2013-11-25 09:30:09 -08:00
Stefan Monnier
a5fa8eb484 * src/textprop.c (text_property_stickiness): Fix front-stickiness at BOB. 2013-11-25 10:42:06 -05:00
Dmitry Antipov
00012b8625 Invalidate region caches only if buffer text is going to be changed.
* lisp.h (modify_region_1): Remove 3rd arg and rename to...
(modify_text): ...new prototype.
(prepare_to_modify_buffer_1): New prototype.
* textprop.c (modify_region): Rename to...
(modify_text_properties): ...new function.
(add_text_properties_1, set_text_properties, Fremove_text_properties)
(Fremove_list_of_text_properties): Adjust users.
* insdel.c (modify_region_1): Remove 3rd arg and reimplement as...
(modify_text): ...new function.
(prepare_to_modify_buffer): Reimplement mostly as a wrapper for...
(prepare_to_modify_buffer_1): ...new function.
* casefiddle.c (casify_region):
* editfns.c (Fsubst_char_in_region, Ftranslate_region_internal)
(Ftranspose_regions): Use modify_text.
2013-08-06 09:30:18 +04:00
Paul Eggert
6c6f1994bf Prefer list1 (X) to Fcons (X, Qnil) when building lists.
This makes the code easier to read and the executable a bit smaller.
Do not replace all calls to Fcons that happen to create lists,
just calls that are intended to create lists.  For example, when
creating an alist that maps FOO to nil, use list1 (Fcons (FOO, Qnil))
rather than list1 (list1 (FOO)) or Fcons (Fcons (FOO, Qnil), Qnil).
Similarly for list2 through list5.
* buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
* bytecode.c (exec_byte_code):
* callint.c (quotify_arg, Fcall_interactively):
* callproc.c (Fcall_process, create_temp_file):
* charset.c (load_charset_map_from_file)
(Fdefine_charset_internal, init_charset):
* coding.c (get_translation_table, detect_coding_system)
(Fcheck_coding_systems_region)
(Fset_terminal_coding_system_internal)
(Fdefine_coding_system_internal, Fdefine_coding_system_alias):
* composite.c (update_compositions, Ffind_composition_internal):
* dired.c (directory_files_internal, file_name_completion)
(Fsystem_users):
* dispnew.c (Fopen_termscript, bitch_at_user, init_display):
* doc.c (Fsnarf_documentation):
* editfns.c (Fmessage_box):
* emacs.c (main):
* eval.c (do_debug_on_call, signal_error, maybe_call_debugger)
(Feval, eval_sub, Ffuncall, apply_lambda):
* fileio.c (make_temp_name, Fcopy_file, Faccess_file)
(Fset_file_selinux_context, Fset_file_acl, Fset_file_modes)
(Fset_file_times, Finsert_file_contents)
(Fchoose_write_coding_system, Fwrite_region):
* fns.c (Flax_plist_put, Fyes_or_no_p, syms_of_fns):
* font.c (font_registry_charsets, font_parse_fcname)
(font_prepare_cache, font_update_drivers, Flist_fonts):
* fontset.c (Fset_fontset_font, Ffontset_info, syms_of_fontset):
* frame.c (make_frame, Fmake_terminal_frame)
(x_set_frame_parameters, x_report_frame_params)
(x_default_parameter, Fx_parse_geometry):
* ftfont.c (syms_of_ftfont):
* image.c (gif_load):
* keyboard.c (command_loop_1):
* keymap.c (Fmake_keymap, Fmake_sparse_keymap, access_keymap_1)
(Fcopy_keymap, append_key, Fcurrent_active_maps)
(Fminor_mode_key_binding, accessible_keymaps_1)
(Faccessible_keymaps, Fwhere_is_internal):
* lread.c (read_emacs_mule_char):
* menu.c (find_and_return_menu_selection):
* minibuf.c (get_minibuffer):
* nsfns.m (Fns_perform_service):
* nsfont.m (ns_script_to_charset):
* nsmenu.m (ns_popup_dialog):
* nsselect.m (ns_get_local_selection, ns_string_from_pasteboard)
(Fx_own_selection_internal):
* nsterm.m (append2):
* print.c (Fredirect_debugging_output)
(print_prune_string_charset):
* process.c (Fdelete_process, Fprocess_contact)
(Fformat_network_address, set_socket_option)
(read_and_dispose_of_process_output, write_queue_push)
(send_process, exec_sentinel):
* sound.c (Fplay_sound_internal):
* textprop.c (validate_plist, add_properties)
(Fput_text_property, Fadd_face_text_property)
(copy_text_properties, text_property_list, syms_of_textprop):
* unexaix.c (report_error):
* unexcoff.c (report_error):
* unexsol.c (unexec):
* xdisp.c (redisplay_tool_bar, store_mode_line_string)
(Fformat_mode_line, syms_of_xdisp):
* xfaces.c (set_font_frame_param)
(Finternal_lisp_face_attribute_values)
(Finternal_merge_in_global_face, syms_of_xfaces):
* xfns.c (x_default_scroll_bar_color_parameter)
(x_default_font_parameter, x_create_tip_frame):
* xfont.c (xfont_supported_scripts):
* xmenu.c (Fx_popup_dialog, xmenu_show, xdialog_show)
(menu_help_callback, xmenu_show):
* xml.c (make_dom):
* xterm.c (set_wm_state):
Prefer list1 (FOO) to Fcons (FOO, Qnil) when creating a list,
and similarly for list2 through list5.
2013-07-15 23:39:49 -07:00
Lars Magne Ingebrigtsen
708e05f6d1 Implement new function `add-face-text-property'
* doc/lispref/text.texi (Changing Properties): Document `add-face-text-property'.

* src/textprop.c (property_set_type): New enum.
(add_properties): Allow appending/prepending text properties.
(add_text_properties_1): Factored out of Fadd_text_properties.
(Fadd_text_properties): Moved all the code into
add_text_properties_1.
(Fadd_face_text_property): New function that calls
add_text_properties_1.
2013-06-17 17:28:22 +02:00
Paul Eggert
84575e67fc Use functions, not macros, for XINT etc.
In lisp.h, prefer functions to function-like macros, and
constants to object-like macros, when either will do.  This:
 . simplifies use, as there's no more need to worry about
   arguments' side effects being evaluated multiple times.
 . makes the code easier to debug on some platforms.
However, when using gcc -O0, keep using function-like macros
for a few critical operations, for performance reasons.
This sort of thing isn't needed with gcc -Og, but -Og
is a GCC 4.8 feature and isn't widely-enough available yet.
Also, move functions from lisp.h to individual modules when possible.
From a suggestion by Andreas Schwab in <http://bugs.gnu.org/11935#68>.
* alloc.c (XFLOAT_INIT, set_symbol_name):
* buffer.c (CHECK_OVERLAY):
* chartab.c (CHECK_CHAR_TABLE, set_char_table_ascii)
(set_char_table_parent):
* coding.c (CHECK_NATNUM_CAR, CHECK_NATNUM_CDR):
* data.c (BOOLFWDP, INTFWDP, KBOARD_OBJFWDP, OBJFWDP, XBOOLFWD)
(XKBOARD_OBJFWD, XINTFWD, XOBJFWD, CHECK_SUBR, set_blv_found)
(blv_value, set_blv_value, set_blv_where, set_blv_defcell)
(set_blv_valcell):
* emacs.c (setlocale) [!HAVE_SETLOCALE]:
* eval.c (specpdl_symbol, specpdl_old_value, specpdl_where)
(specpdl_arg, specpdl_func, backtrace_function, backtrace_nargs)
(backtrace_args, backtrace_debug_on_exit):
* floatfns.c (CHECK_FLOAT):
* fns.c (CHECK_HASH_TABLE, CHECK_LIST_END)
(set_hash_key_and_value, set_hash_next, set_hash_next_slot)
(set_hash_hash, set_hash_hash_slot, set_hash_index)
(set_hash_index_slot):
* keymap.c (CHECK_VECTOR_OR_CHAR_TABLE):
* marker.c (CHECK_MARKER):
* textprop.c (CHECK_STRING_OR_BUFFER):
* window.c (CHECK_WINDOW_CONFIGURATION):
Move here from lisp.h, and make these functions static rather than
extern inline.
* buffer.c (Qoverlayp):
* data.c (Qsubrp):
* fns.c (Qhash_table_p):
* window.c (Qwindow_configuration_p):
Now static.
* lisp.h: Remove the abovementioned defns and decls.

* configure.ac (WARN_CFLAGS): Remove -Wbad-function-cast,
as it generates bogus warnings about reasonable casts of calls.
* alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]:
Remove enum lsb_bits; no longer needed.
(allocate_misc, free_misc): Don't use XMISCTYPE as an lvalue.
* buffer.c (Qoverlap):
* data.c (Qsubrp):
* fns.c (Qhash_table_p):
Now extern, so lisp.h can use these symbols.
* dispextern.h: Include character.h, for MAX_CHAR etc.
(GLYPH, GLYPH_CHAR, GLYPH_FACE, SET_GLYPH_CHAR, SET_GLYPH_FACE)
(SET_GLYPH, GLYPH_CODE_CHAR, GLYPH_CODE_FACE)
(SET_GLYPH_FROM_GLYPH_CODE, GLYPH_MODE_LINE_FACE, GLYPH_CHAR_VALID_P)
(GLYPH_CODE_P): Move here from lisp.h.
(GLYPH_CHAR, GLYPH_FACE, GLYPH_CODE_CHAR, GLYPH_CODE_FACE)
(GLYPH_CHAR_VALID_P, GLYPH_CODE_P): Now functions, not macros.
(GLYPH_MODE_LINE_FACE): Now enums, not macros.
* eval.c (Fautoload): Cast XUNTAG output to intptr_t, since
XUNTAG now returns void *.
* lisp.h (lisp_h_XLI, lisp_h_XIL, lisp_h_CHECK_LIST_CONS)
(lisp_h_CHECK_NUMBER CHECK_SYMBOL, lisp_h_CHECK_TYPE)
(lisp_h_CONSP, lisp_h_EQ, lisp_h_FLOATP, lisp_h_INTEGERP)
(lisp_h_MARKERP, lisp_h_MISCP, lisp_h_NILP)
(lisp_h_SET_SYMBOL_VAL, lisp_h_SYMBOL_CONSTANT_P)
(lisp_h_SYMBOL_VAL, lisp_h_SYMBOLP, lisp_h_VECTORLIKEP)
(lisp_h_XCAR, lisp_h_XCDR, lisp_h_XCONS, lisp_h_XHASH)
(lisp_h_XPNTR, lisp_h_XSYMBOL):
New macros, renamed from their sans-lisp_h_ counterparts.
(XLI, XIL, CHECK_LIST_CONS, CHECK_NUMBER CHECK_SYMBOL)
(CHECK_TYPE, CONSP, EQ, FLOATP, INTEGERP, MARKERP)
(MISCP, NILP, SET_SYMBOL_VAL, SYMBOL_CONSTANT_P, SYMBOL_VAL, SYMBOLP)
(VECTORLIKEP, XCAR, XCDR, XCONS, XHASH, XPNTR, XSYMBOL):
If compiling via GCC without optimization, define these as macros
in addition to inline functions.
To disable this, compile with -DINLINING=0.
(LISP_MACRO_DEFUN, LISP_MACRO_DEFUN_VOID): New macros.
(check_cons_list) [!GC_CHECK_CONS_LIST]: Likewise.
(make_number, XFASTINT, XINT, XTYPE, XUNTAG): Likewise, but
hand-optimize only in the USE_LSB_TAG case, as GNUish hosts do that.
(INTMASK, VALMASK): Now macros, since static values cannot be
accessed from extern inline functions.
(VALMASK): Also a constant, for benefit of old GDB.
(LISP_INT_TAG_P): Remove; no longer needed as the only caller
is INTEGERP, which can fold it in.
(XLI, XIL, XHASH, XTYPE,XINT, XFASTINT, XUINT)
(make_number, XPNTR, XUNTAG, EQ, XCONS, XVECTOR, XSTRING, XSYMBOL)
(XFLOAT, XPROCESS, XWINDOW, XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE)
(XSUB_CHAR_TABLE, XBOOL_VECTOR, make_lisp_ptr, CHECK_TYPE)
(CHECK_STRING_OR_BUFFER, XCAR, XCDR, XSETCAR, XSETCDR, CAR, CDR)
(CAR_SAFE, CDR_SAFE, STRING_MULTIBYTE, SDATA, SSDATA, SREF, SSET)
(SCHARS, STRING_BYTES, SBYTES, STRING_SET_CHARS, STRING_COPYIN, AREF)
(ASIZE, ASET, CHAR_TABLE_REF_ASCII, CHAR_TABLE_REF)
(CHAR_TABLE_SET, CHAR_TABLE_EXTRA_SLOTS, SYMBOL_VAL, SYMBOL_ALIAS)
(SYMBOL_BLV, SYMBOL_FWD, SET_SYMBOL_VAL, SET_SYMBOL_ALIAS)
(SET_SYMBOL_BLV, SET_SYMBOL_FWD, SYMBOL_NAME, SYMBOL_INTERNED_P)
(SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P, SYMBOL_CONSTANT_P)
(XHASH_TABLE, HASH_TABLE_P, CHECK_HASH_TABLE, HASH_KEY, HASH_VALUE)
(HASH_NEXT, HASH_HASH, HASH_INDEX, HASH_TABLE_SIZE)
(XMISC, XMISCANY, XMARKER, XOVERLAY, XSAVE_VALUE, XFWDTYPE)
(XINTFWD, XBOOLFWD, XOBJFWD, XBUFFER_OBJFWD, XKBOARD_OBJFWD)
(XFLOAT_DATA, XFLOAT_INIT, NILP, NUMBERP, NATNUMP)
(RANGED_INTEGERP, CONSP, FLOATP, MISCP, STRINGP, SYMBOLP)
(INTEGERP, VECTORLIKEP, VECTORP, OVERLAYP)
(MARKERP, SAVE_VALUEP, AUTOLOADP, INTFWDP, BOOLFWDP, OBJFWDP)
(BUFFER_OBJFWDP, KBOARD_OBJFWDP, PSEUDOVECTOR_TYPEP)
(PSEUDOVECTORP, WINDOW_CONFIGURATIONP, PROCESSP, WINDOWP)
(TERMINALP, SUBRP, COMPILEDP, BUFFERP, CHAR_TABLE_P)
(SUB_CHAR_TABLE_P, BOOL_VECTOR_P, FRAMEP, IMAGEP, ARRAYP)
(CHECK_LIST, CHECK_LIST_CONS, CHECK_LIST_END, CHECK_STRING)
(CHECK_STRING_CAR, CHECK_CONS, CHECK_SYMBOL, CHECK_CHAR_TABLE)
(CHECK_VECTOR, CHECK_VECTOR_OR_STRING, CHECK_ARRAY)
(CHECK_VECTOR_OR_CHAR_TABLE, CHECK_BUFFER, CHECK_WINDOW)
(CHECK_WINDOW_CONFIGURATION, CHECK_PROCESS, CHECK_SUBR)
(CHECK_NUMBER, CHECK_NATNUM, CHECK_MARKER, XFLOATINT)
(CHECK_FLOAT, CHECK_NUMBER_OR_FLOAT, CHECK_OVERLAY)
(CHECK_NUMBER_CAR, CHECK_NUMBER_CDR, CHECK_NATNUM_CAR)
(CHECK_NATNUM_CDR, FUNCTIONP, SPECPDL_INDEX, LOADHIST_ATTACH)
Now functions.
(check_cons_list) [!GC_CHECK_CONS_LIST]: New empty function.
(LISP_MAKE_RVALUE, TYPEMASK): Remove; no longer needed.
(VALMASK): Define in one place rather than in two, merging the
USE_LSB_TAG parts; this is simpler.
(aref_addr, gc_aset, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM)
(max, min, struct Lisp_String, UNSIGNED_CMP, ASCII_CHAR_P):
Move up, to avoid use before definition.
Also include "globals.h" earlier, for the same reason.
(make_natnum): New function.
(XUNTAG): Now returns void *, not intptr_t, as this means fewer casts.
(union Lisp_Fwd, BOOLFWDP, BOOL_VECTOR_P, BUFFER_OBJFWDP, BUFFERP)
(CHAR_TABLE_P, CHAR_TABLE_REF_ASCII, CONSP, FLOATP, INTEGERP, INTFWDP)
(KBOARD_OBJFWDP, MARKERP, MISCP, NILP, OBJFWDP, OVERLAYP, PROCESSP)
(PSEUDOVECTORP, SAVE_VALUEP, STRINGP, SUB_CHAR_TABLE_P, SUBRP, SYMBOLP)
(VECTORLIKEP, WINDOWP, Qoverlayp, char_table_ref, char_table_set)
(char_table_translate, Qarrayp, Qbufferp, Qbuffer_or_string_p)
(Qchar_table_p, Qconsp, Qfloatp, Qintegerp, Qlambda, Qlistp, Qmarkerp)
(Qnil, Qnumberp, Qsubrp, Qstringp, Qsymbolp, Qvectorp)
(Qvector_or_char_table_p, Qwholenump, Ffboundp, wrong_type_argument)
(initialized, Qhash_table_p, extract_float, Qprocessp, Qwindowp)
(Qwindow_configuration_p, Qimage): New forward declarations.
(XSETFASTINT): Simplify by rewriting in terms of make_natnum.
(STRING_COPYIN): Remove; unused.
(XCAR_AS_LVALUE, XCDR_AS_LVALUE): Remove these macros, replacing with ...
(xcar_addr, xcdr_addr): New functions.  All uses changed.
(IEEE_FLOATING_POINT): Now a constant, not a macro.
(GLYPH, GLYPH_CHAR, GLYPH_FACE, SET_GLYPH_CHAR, SET_GLYPH_FACE)
(SET_GLYPH, GLYPH_CODE_CHAR, GLYPH_CODE_FACE)
(SET_GLYPH_FROM_GLYPH_CODE, GLYPH_MODE_LINE_FACE, GLYPH_CHAR_VALID_P)
(GLYPH_CODE_P): Move to dispextern.h, to avoid define-before-use.
(TYPE_RANGED_INTEGERP): Simplify.
(Qsubrp, Qhash_table_p, Qoverlayp): New extern decls.
(setlocale, fixup_locale, synchronize_system_messages_locale)
(synchronize_system_time_locale) [!HAVE_SETLOCALE]:
Now empty functions, not macros.
(functionp): Return bool, not int.
* window.c (Qwindow_configuration_p): Now extern,
so window.h can use it.
* window.h (Qwindowp): Move decl back to lisp.h.
2013-06-16 23:03:19 -07:00
Dmitry Antipov
e74aeda863 * window.h (struct window): Replace hchild, vchild and buffer slots
with the only contents slot.  This is possible because each valid
window may have either the child window (in vertical or horizontal
combination) or buffer to display (for the leaf window).  Using that,
a lof of operations to traverse and/or change window hierarchies may
be simplified.  New member horizontal is used to distinguish between
horizontal and vertical combinations of internal windows.
(WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
(WINDOW_VERTICAL_COMBINATION_P): New macros.
(WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
* window.c (wset_hchild, wset_vchild): Remove.  Adjust all users.
Use contents slot, not buffer, where appropriate.
(wset_combination): New function.
(wset_buffer): Add eassert.
(Fframe_first_window): Simplify the loop reaching first window.
(Fwindow_buffer): Use WINDOW_LEAF_P.
(Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
(Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
(unshow_buffer): Convert initial debugging check to eassert.
(replace_window, recombine_windows, Fdelete_other_windows_internal)
(make_parent_window, window_resize_check, window_resize_apply)
(resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
(Fset_window_configuration, delete_all_child_windows, save_window_save):
Adjust to match struct window changes.
(window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
(mark_window_cursors_off, count_windows, get_leaf_windows)
(foreach_window_1): Simplify the loop.
* alloc.c (mark_object): Do not check for the leaf window because
internal windows has no glyph matrices anyway.
* dispnew.c (clear_window_matrices, showing_window_margins_p)
(allocate_matrices_for_window_redisplay, fake_current_matrices)
(allocate_matrices_for_frame_redisplay, free_window_matrices)
(build_frame_matrix_from_window_tree, mirror_make_current)
(frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
(update_window_tree, set_window_update_flags): Simplify the loop.
(sync_window_with_frame_matrix_rows): Enforce live window.
Use contents slot, not buffer, where appropriate.
* frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
and WINDOW_HORIZONTAL_COMBINATION_P.
(make_frame_visible_1): Simplify the loop.
Use contents slot, not buffer, where appropriate.
* xdisp.c (hscroll_window_tree, mark_window_display_accurate)
(redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
(expose_window_tree): Likewise.
Use contents slot, not buffer, where appropriate.
* textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
to avoid deleted windows.  Use contents slot instead of buffer.
* buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
* indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
* nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
* xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
2013-03-28 18:04:49 +04:00
Stefan Monnier
cbae07d5e0 * src/keyboard.c: Move keyboard decoding to read_key_sequence.
(decode_keyboard_code): Remove.
(tty_read_avail_input): Don't try to decode input.
(read_decoded_char): New function.
(read_key_sequence): Use it.
2013-03-10 21:17:40 -04:00
Paul Eggert
81c23309e4 * textprop.c: Use bool for booleans.
(validate_interval_range, Fadd_text_properties)
(Fremove_text_properties): Prefer bool to int when either works.
2013-03-02 10:39:34 -08:00
Eli Zaretskii
18f2ac090d Protect against changes of interval tree when adding/removing text props.
src/textprop.c (Fadd_text_properties, Fremove_text_properties): If
 the interval tree changes as a side effect of calling
 modify_region, re-do processing starting from the call to
 validate_interval_range.  (Bug#13743)
2013-03-02 11:28:53 +02:00
Paul Eggert
ecc0fdd49e Minor textprop integer cleanup.
* intervals.h, textprop.c (add_text_properties_from_list):
Return void, not int, since nobody uses the return value.
* textprop.c (validate_plist, add_properties, remove_properties)
(Fadd_text_properties):
Don't assume list length fits in int.
(interval_has_all_properties, interval_has_some_properties)
(interval_has_some_properties_list, add_properties, remove_properties)
(Fadd_text_properties, Fremove_text_properties)
(Fremove_list_of_text_properties, text_property_stickiness):
Use bool for booleans.
(Fadd_text_properties, Fremove_text_properties):
(Fremove_list_of_text_properties):
Reindent do-while as per GNU style.
2013-02-25 19:09:08 -08:00
Eli Zaretskii
0248b0d70b Fix bug #13743 with crashes due to recursive add-text-properties.
src/textprop.c (Fadd_text_properties, Fremove_text_properties)
 (Fremove_list_of_text_properties): Skip all of the intervals in
 the region between START and END that already have resp. don't
 have the requested properties, not just the first one.  Add
 assertions that the loop afterwards always modifies the
 properties.
2013-02-25 18:13:42 +02:00
Paul Eggert
0877d0dc24 Merge from emacs-24; up to 2012-12-06T01:39:03Z!monnier@iro.umontreal.ca 2013-01-02 08:13:04 -08:00
Paul Eggert
ab422c4d68 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
Dmitry Antipov
1687fb14cd * textprop.c (set_text_properties_1): Do not allow NULL interval.
Rename 4th argument since it may be buffer or string.  Adjust comment.
* intervals.c (graft_intervals_info_buffer): Find an interval here.
2012-12-20 12:49:21 +04:00
Dmitry Antipov
20edc1c9ed * lisp.h (modify_region): Rename to...
(modify_region_1): ...new prototype.
* textprop.c (modify_region): Now static.  Adjust users.
* insdel.c (modify_region): Rename to...
(modify_region_1): ...new function to work with current buffer.
Adjust comment and users.  Use true and false for boolean arg.
2012-12-03 18:13:06 +04:00
Paul Eggert
b0ab8123df Prefer plain 'static' to 'static inline'.
With static functions, modern compilers inline pretty well by
themselves; advice from programmers often hurts as much as it helps.
On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
this change shrinks the text size of the Emacs executable by 1.1%
without affecting CPU significantly in my benchmark.
* alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
(live_float_p, live_misc_p, live_vector_p, live_buffer_p)
(mark_maybe_object, mark_maybe_pointer, bounded_number):
* buffer.c (bset_abbrev_mode, bset_abbrev_table)
(bset_auto_fill_function, bset_auto_save_file_format)
(bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
(bset_bidi_display_reordering, bset_buffer_file_coding_system)
(bset_cache_long_line_scans, bset_case_fold_search)
(bset_ctl_arrow, bset_cursor_in_non_selected_windows)
(bset_cursor_type, bset_display_table, bset_extra_line_spacing)
(bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
(bset_fringe_indicator_alist, bset_fringes_outside_margins)
(bset_header_line_format, bset_indicate_buffer_boundaries)
(bset_indicate_empty_lines, bset_invisibility_spec)
(bset_left_fringe_width, bset_major_mode, bset_mark)
(bset_minor_modes, bset_mode_line_format, bset_mode_name)
(bset_name, bset_overwrite_mode, bset_pt_marker)
(bset_right_fringe_width, bset_save_length)
(bset_scroll_bar_width, bset_scroll_down_aggressively)
(bset_scroll_up_aggressively, bset_selective_display)
(bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
(bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
(set_buffer_overlays_after):
* category.c (bset_category_table):
* charset.c (read_hex):
* coding.c (produce_composition, produce_charset)
(handle_composition_annotation, handle_charset_annotation)
(char_encodable_p):
* dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
(assign_row, set_frame_matrix_frame, make_current)
(add_row_entry):
* eval.c (set_specpdl_symbol, set_specpdl_old_value):
* fns.c (maybe_resize_hash_table):
* frame.c (fset_buffer_predicate, fset_minibuffer_window):
* gmalloc.c (register_heapinfo):
* image.c (lookup_image_type):
* intervals.c (set_interval_object, set_interval_left)
(set_interval_right, copy_interval_parent, rotate_right)
(rotate_left, balance_possible_root_interval):
* keyboard.c (kset_echo_string, kset_kbd_queue)
(kset_keyboard_translate_table, kset_last_prefix_arg)
(kset_last_repeatable_command, kset_local_function_key_map)
(kset_overriding_terminal_local_map, kset_real_last_command)
(kset_system_key_syms, clear_event, set_prop):
* lread.c (digit_to_number):
* marker.c (attach_marker, live_buffer, set_marker_internal):
* nsterm.m (ns_compute_glyph_string_overhangs):
* process.c (pset_buffer, pset_command)
(pset_decode_coding_system, pset_decoding_buf)
(pset_encode_coding_system, pset_encoding_buf, pset_filter)
(pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
(pset_status, pset_tty_name, pset_type, pset_write_queue):
* syntax.c (bset_syntax_table, dec_bytepos):
* terminal.c (tset_param_alist):
* textprop.c (interval_has_some_properties)
(interval_has_some_properties_list):
* window.c (wset_combination_limit, wset_dedicated)
(wset_display_table, wset_hchild, wset_left_fringe_width)
(wset_left_margin_cols, wset_new_normal, wset_new_total)
(wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
(wset_right_fringe_width, wset_right_margin_cols)
(wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
(wset_vertical_scroll_bar_type, wset_window_parameters):
* xdisp.c (wset_base_line_number, wset_base_line_pos)
(wset_column_number_displayed, wset_region_showing)
(window_box_edges, run_window_scroll_functions)
(append_glyph_string_lists, prepend_glyph_string_lists)
(append_glyph_string, set_glyph_string_background_width)
(append_glyph, append_composite_glyph)
(take_vertical_position_into_account):
* xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
(face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
(lface_hash, lface_same_font_attributes_p, lookup_face):
* xml.c (libxml2_loaded_p):
* xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
(x_set_glyph_string_clipping, x_clear_glyph_string_rect):
Now 'static', not 'static inline'.

Fixes: debbugs:12541
2012-09-30 23:36:54 -07:00
Paul Eggert
0328b6de4a Port better to POSIX hosts lacking _setjmp.
* configure.ac (HAVE__SETJMP, HAVE_SIGSETJMP): New symbols.
(_setjmp, _longjmp): Remove.
* src/lisp.h: Include <setjmp.h> here, since we use its symbols here.
All instances of '#include <setjmp.h>' removed, if the
only reason for the instance was because "lisp.h" was included.
(sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
and _longjmp with the new symbols.  Emacs already uses _setjmp if
available, so this change affects only POSIXish hosts that have
sigsetjmp but not _setjmp, such as some versions of Solaris and
Unixware.  (Also, POSIX-2008 marks _setjmp as obsolescent.)
* src/image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
(png_load_body) [HAVE_PNG]:
(PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
(PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
since PNG requires jmp_buf.  This is the only exception to the
general rule that we now use sys_setjmp and sys_longjmp.
This exception is OK since this code does not change the signal
mask or longjmp out of a signal handler.

Fixes: debbugs:12446
2012-09-15 00:06:56 -07:00
Chong Yidong
b4f5313e93 * src/textprop.c (Fget_text_property): Minor doc fix.
Fixes: debbugs:12323
2012-09-07 22:45:28 +08:00
Dmitry Antipov
6632288705 Always use set_buffer_if_live to restore original buffer at unwind.
* buffer.h (record_unwind_current_buffer): New function.
* bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
* keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
* undo.c, window.c: Adjust users.
* buffer.c (set_buffer_if_live): Fix comment.
2012-08-28 10:20:08 +04:00
Paul Eggert
0c94c8d603 A few more naming-convention fixes for getters and setters.
* buffer.c (set_buffer_overlays_before): Move here from buffer.h,
and rename from buffer_overlays_set_before.
(set_buffer_overlays_after): Move here from buffer.h, and rename
from buffer_overlays_set_after.
* buffer.h (buffer_intervals): Rename from buffer_get_intervals.
All uses changed.
(set_buffer_intervals): Rename from buffer_set_intervals.
* intervals.c (set_interval_object): Move here from intervals.h,
and rename from interval_set_object.
(set_interval_left): Move here from intervals.h, and rename from
interval_set_left.
(set_interval_right): Move here from intervals.h, and rename from
interval_set_right.
(copy_interval_parent): Move here from intervals.h, and rename from
interval_copy_parent.
* intervals.h (set_interval_parent): Rename from interval_set_parent.
(set_interval_plist): Rename from interval_set_plist.
Return void, not Lisp_Object, since no caller uses the result.
* lisp.h (string_intervals): Rename from string_get_intervals.
(set_string_intervals): Rename from string_set_intervals.
2012-08-17 14:12:11 -07:00
Dmitry Antipov
8707c1e56c Inline functions to examine and change buffer intervals.
* alloc.c (mark_interval_tree): Remove.
(MARK_INTERVAL_TREE): Simplify.
(UNMARK_BALANCE_INTERVALS): Remove.  Adjust users.
* intervals.c (buffer_balance_intervals): New function.
(graft_intervals_into_buffer): Adjust indentation.
(set_intervals_multibyte): Simplify.
* buffer.h (BUF_INTERVALS): Remove.
(buffer_get_intervals, buffer_set_intervals): New function.
* alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
* intervals.c, textprop.c: Adjust users.
2012-08-08 16:12:40 +04:00
Dmitry Antipov
ad8c997f72 Inline functions to examine and change string intervals.
* lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
(string_get_intervals, string_set_intervals): New function.
* alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
* lread.c, print.c, textprop.c: Adjust users.
2012-08-08 14:23:04 +04:00
Dmitry Antipov
77c7bcb115 Cleanup intervals.
* intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
(NULL_INTERVAL_P): Likewise.  Adjust users.
(FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P): Adjust
comment.  Move under #if 0.
* alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
* print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2012-08-08 10:11:29 +04:00
Dmitry Antipov
6a3d20cc46 Basic functions to set Lisp_Object and pointer slots of intervals.
* intervals.h (interval_set_parent, interval_set_object):
(interval_set_left, interval_set_right, interval_set_plist):
(interval_copy_parent): New function.
(SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
(RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE): Adjust
indentation.
(INTERVAL_SIZE): Remove.  Adjust users.
* alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2012-08-07 15:28:41 +04:00
Dmitry Antipov
d3d50620ed Drop WGET and revert read access to Lisp_Objects slots of struct window.
* window.h (WGET): Remove.
(struct window): Do not use INTERNAL_FIELD.
* alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
* fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
* insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
* nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
* w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
Adjust users.
2012-08-07 11:33:18 +04:00
Dmitry Antipov
077288cf3f Separate read and write access to Lisp_Object slots of struct window.
* window.h (WGET, WSET): New macros similar to AREF and ASET.
* alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
* fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
* insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
* nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
* w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
Adjust users.
2012-08-06 14:24:26 +04:00
Dmitry Antipov
3a45383a47 Use INTERNAL_FIELD for windows.
* src/window.h (WVAR): New macro.
(struct window): Change Lisp_Object members to INTERNAL_FIELD.
* src/alloc.c, src/buffer.c, src/composite.c, src/dispextern.h:
* src/dispnew.c, src/editfns.c, src/fileio.c, src/font.c, src/fontset.c:
* src/frame.c, src/frame.h, src/fringe.c, src/indent.c, src/insdel.c:
* src/keyboard.c, src/keymap.c, src/lisp.h, src/minibuf.c, src/nsterm.m:
* src/print.c, src/textprop.c, src/w32fns.c, src/w32menu.c, src/w32term.c:
* src/window.c, src/xdisp.c, src/xfaces.c, src/xfns.c, src/xmenu.c:
* src/xterm.c: Users changed.
* admin/coccinelle/window.cocci: Semantic patch to replace direct
access to Lisp_Object members of struct window to WVAR.
2012-08-01 09:11:36 +04:00
Dmitry Antipov
cce7fefcab Cleanup and convert miscellaneous checks to eassert.
* alloc.c (mark_interval): Fix comment, partially rephrase
old comment from intervals.h (see below).
* intervals.c (find_interval, adjust_intervals_for_insertion)
(delete_interval, adjust_intervals_for_deletion)
(graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
Convert to eassert.
(adjust_intervals_for_insertion, make_new_interval):
Remove obsolete and unused code.
* intervals.h (struct interval): Remove obsolete comment.
* textprotp.c (erase_properties): Remove unused code.
(Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
(Fremove_list_of_text_properties): Convert to eassert.
2012-07-17 13:12:24 +04:00
Dmitry Antipov
7d7bbefd04 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
* admin/coccinelle/list_loop.cocci: Semantic patch to convert from Fcdr
to XCDR and consistently use CONSP in the list iteration loops.
* admin/coccinelle/vector_contents.cocci: Fix indentation.
* src/callint.c, src/coding.c, src/doc.c, src/editfns.c, src/eval.c,
* src/font.c, src/fontset.c, src/frame.c, src/gnutls.c, src/minibuf.c,
* src/msdos.c, src/textprop.c, src/w32fns.c, src/w32menu.c, src/window.c,
* src/xmenu.c: Changed to use XCAR and XCDR where argument type is known
to be a Lisp_Cons.
2012-07-10 20:53:26 +04:00
Tom Tromey
404dbd373a Auto-generate EXFUN using make-docfile
src
	* window.c (Fset_window_margins, Fset_window_fringes)
	(Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
	* textprop.c (Fprevious_property_change): No longer static.
	* syntax.c (Fsyntax_table_p): No longer static.
	* process.c (Fget_process, Fprocess_datagram_address): No longer
	static.
	* keymap.c (Flookup_key, Fcopy_keymap): No longer static.
	* keyboard.c (Fcommand_execute): No longer static.
	Remove EXFUN.
	* insdel.c (Fcombine_after_change_execute): No longer static.
	* image.c (Finit_image_library): No longer static.
	* fileio.c (Fmake_symbolic_link): No longer static.
	* eval.c (Ffetch_bytecode): No longer static.
	* editfns.c (Fuser_full_name): No longer static.
	* doc.c: (Fdocumentation_property, Fsnarf_documentation): No
	longer static.
	* buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
	static.
	* dired.c (Ffile_attributes): No longer static.
	* composite.c (Fcomposition_get_gstring): No longer static.
	* callproc.c (Fgetenv_internal): No longer static.

	* ccl.h: Remove EXFUNs.
	* buffer.h: Remove EXFUNs.
	* dispextern.h: Remove EXFUNs.
	* intervals.h: Remove EXFUNs.
	* fontset.h: Remove EXFUN.
	* font.h: Remove EXFUNs.
	* dosfns.c (system_process_attributes): Remove EXFUN.
	* keymap.h: Remove EXFUNs.
	* lisp.h: Remove EXFUNs.
	* w32term.h: Remove EXFUNs.
	* window.h: Remove EXFUNs.
	* xsettings.h: Remove EXFUN.
	* xterm.h: Remove EXFUN.

lib-src
	* make-docfile.c (enum global_type) <FUNCTION>: New constant.
	(struct global) <value>: New field.
	(add_global): Add 'value' argument.
	(compare_globals): Sort functions at the end.
	(close_emacs_globals): New function.
	(write_globals): Handle functions.
	(scan_c_file): Call add_global for DEFUN.
2012-07-03 12:24:42 -06:00
Paul Eggert
845ca89390 Switch from NO_RETURN to C11's _Noreturn.
Fixes: debbugs:11750
2012-06-24 10:39:14 -07:00
Andreas Schwab
e5560ff7d2 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
(BUF_FETCH_MULTIBYTE_CHAR): Likewise.
* character.c (_fetch_multibyte_char_p): Remove.
* alloc.c: Include "character.h" before "buffer.h".
* bidi.c: Likewise.
* buffer.c: Likewise.
* bytecode.c: Likewise.
* callint.c: Likewise.
* callproc.c: Likewise.
* casefiddle.c: Likewise.
* casetab.c: Likewise.
* category.c: Likewise.
* cmds.c: Likewise.
* coding.c: Likewise.
* composite.c: Likewise.
* dired.c: Likewise.
* dispnew.c: Likewise.
* doc.c: Likewise.
* dosfns.c: Likewise.
* editfns.c: Likewise.
* emacs.c: Likewise.
* fileio.c: Likewise.
* filelock.c: Likewise.
* font.c: Likewise.
* fontset.c: Likewise.
* fringe.c: Likewise.
* indent.c: Likewise.
* insdel.c: Likewise.
* intervals.c: Likewise.
* keyboard.c: Likewise.
* keymap.c: Likewise.
* lread.c: Likewise.
* macros.c: Likewise.
* marker.c: Likewise.
* minibuf.c: Likewise.
* nsfns.m: Likewise.
* nsmenu.m: Likewise.
* print.c: Likewise.
* process.c: Likewise.
* regex.c: Likewise.
* region-cache.c: Likewise.
* search.c: Likewise.
* syntax.c: Likewise.
* term.c: Likewise.
* textprop.c: Likewise.
* undo.c: Likewise.
* unexsol.c: Likewise.
* w16select.c: Likewise.
* w32fns.c: Likewise.
* w32menu.c: Likewise.
* window.c: Likewise.
* xdisp.c: Likewise.
* xfns.c: Likewise.
* xmenu.c: Likewise.
* xml.c: Likewise.
* xselect.c: Likewise.
2012-06-16 14:24:15 +02:00
Paul Eggert
42b2a986d9 Merge from trunk. 2012-05-25 11:19:24 -07:00
Paul Eggert
261cb4bb75 Assume C89 or later.
* configure.in (AC_C_PROTOTYPES, AC_C_VOLATILE, AC_C_CONST)
(POINTER_TYPE, PROTOTYPES): Remove.
* admin/CPP-DEFINES: Remove NULL, const.
* lib-src/etags.c (static, const): Remove macros.
(PTR): Remove; all uses replaced with void *.  Omit needless casts.
* src/alloc.c, src/buffer.c, lisp.h: Replace POINTER_TYPE with void.
* alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
(xrealloc):
* buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
* editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
* textprop.c, tparam.c (NULL): Remove.
* ralloc.c, vm-limit.c (POINTER): Assume void * works.
* regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
* regex.h (_RE_ARGS): Remove.  All uses rewritten to use prototypes.
* unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
* xterm.c (input_signal_count): Assume volatile works.
2012-05-21 08:36:54 -07:00
Paul Eggert
35cf62d95c Merge from trunk. 2012-01-09 09:36:10 -08:00
Glenn Morris
acaf905b11 Add 2012 to FSF copyright years for Emacs files 2012-01-05 01:46:05 -08:00
Paul Eggert
22bcf20469 Spelling fixes. 2011-12-30 17:27:15 -08:00
Paul Eggert
8f50130c56 Merge from trunk. 2011-12-10 16:56:50 -08:00
Paul Eggert
fa46310344 Spelling fixes. 2011-12-05 00:55:25 -08:00
Paul Eggert
d311d28c3f * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
(allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
(string_bytes, check_sblock, allocate_string_data):
(compact_small_strings, Fmake_bool_vector, make_string)
(make_unibyte_string, make_multibyte_string)
(make_string_from_bytes, make_specified_string)
(allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
(make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
(mark_vectorlike):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(allocate_pseudovector):
Use int, not EMACS_INT, where int is wide enough.
(inhibit_garbage_collection, Fgarbage_collect):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
* bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
int might not be wide enough.
(bidi_cache_search, bidi_cache_find, bidi_init_it)
(bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
(bidi_at_paragraph_end, bidi_find_paragraph_start)
(bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
(bidi_level_of_next_char, bidi_move_to_visually_next):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
* buffer.c (copy_overlays, Fgenerate_new_buffer_name)
(Fkill_buffer, Fset_buffer_major_mode)
(advance_to_char_boundary, Fbuffer_swap_text)
(Fset_buffer_multibyte, overlays_at, overlays_in)
(overlay_touches_p, struct sortvec, record_overlay_string)
(overlay_strings, recenter_overlay_lists)
(adjust_overlays_for_insert, adjust_overlays_for_delete)
(fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
(Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
(Foverlay_recenter, last_overlay_modification_hooks_used)
(report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(validate_region): Omit unnecessary test for b <= e, since
that's guaranteed by the previous test.
(adjust_overlays_for_delete): Avoid pos + length overflow.
(Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
(report_overlay_modification):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
Omit pointer cast, which isn't needed anyway, and doesn't work
after the EMACS_INT -> ptrdiff_t change.
* buffer.h: Adjust decls to match defn changes elsewhere.
(struct buffer_text, struct buffer):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
Use EMACS_INT, not int, where int might not be wide enough.
* bytecode.c (exec_byte_code): Use ptrdiff_t, not int, to avoid
needless 32-bit limit on 64-bit hosts.  Remove unnecessary
memory-full test.  Use EMACS_INT, not ptrdiff_t or int, where
ptrdiff_t or int might not be wide enough.
* callint.c (Fcall_interactively):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
* callproc.c (call_process_kill, Fcall_process):
Don't assume pid_t fits into an Emacs fixnum.
(call_process_cleanup, Fcall_process, child_setup):
Don't assume pid_t fits into int.
(call_process_cleanup, Fcall_process, delete_temp_file)
(Fcall_process_region):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(Fcall_process): Simplify handling of volatile integers.
Use int, not EMACS_INT, where int will do.
* casefiddle.c (casify_object, casify_region, operate_on_word)
(Fupcase_word, Fdowncase_word, Fcapitalize_word):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(casify_object): Avoid integer overflow when overallocating buffer.
* casetab.c (set_identity, shuffle): Prefer int to unsigned when
either works.
* category.c (Fchar_category_set): Don't assume fixnum fits in int.
* category.h (CATEGORYP): Don't assume arg is nonnegative.
* ccl.c (GET_CCL_INT): Remove; no longer needed, since the
integers are now checked earlier.  All uses replaced with XINT.
(ccl_driver):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
For CCL_MapSingle, check that content and value are in int range.
(resolve_symbol_ccl_program): Check that vector header is in range.
Always copy the vector, so that we can check its contents reliably
now rather than having to recheck each instruction as it's being
executed.  Check that vector words fit in 'int'.
(ccl_get_compiled_code, Fregister_ccl_program)
(Fregister_code_conversion_map): Use ptrdiff_t, not int, for
program indexes, to avoid needless 32-bit limit on 64-bit hosts.
(Fccl_execute, Fccl_execute_on_string): Check that initial reg
contents are in range.
(Fccl_execute_on_string): Check that status is in range.
* ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
* character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
Accept and return EMACS_INT, not int, because callers can pass values
out of 'int' range.
(c_string_width, strwidth, lisp_string_width, chars_in_text)
(multibyte_chars_in_text, parse_str_as_multibyte)
(str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
(str_as_unibyte, str_to_unibyte, string_count_byte8)
(string_escape_byte8, Fget_byte):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(Funibyte_string): Use CHECK_CHARACTER, not CHECK_NATNUM, to
avoid mishandling large integers.
* character.h: Adjust decls to match defn changes elsewhere.
* charset.c (load_charset_map_from_file, find_charsets_in_text)
(Ffind_charset_region):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(load_charset_map_from_file): Redo idx calculation to avoid overflow.
(load_charset_map_from_vector, Fdefine_charset_internal):
Don't assume fixnum fits in int or unsigned int.
(load_charset_map_from_vector, Fmap_charset_chars):
Remove now-unnecessary CHECK_NATNUMs.
(Fdefine_charset_internal): Check ranges here, more carefully.
* chartab.c (Fmake_char_table, Fset_char_table_range)
(uniprop_get_decoder, uniprop_get_encoder):
Don't assume fixnum fits in int.
* cmds.c (move_point): New function, that does the gist of
Fforward_char and Fbackward_char, but does so while checking
for integer overflow more accurately.
(Fforward_char, Fbackward_char, internal_self_insert): Use it.
(Fforward_line, Fend_of_line, internal_self_insert)
(internal_self_insert):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
Fix a FIXME, by checking for integer overflow when calculating
target_clm and actual_clm.
* coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
(ASSURE_DESTINATION, coding_alloc_by_realloc)
(coding_alloc_by_making_gap, alloc_destination)
(detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
(encode_coding_utf_16, detect_coding_emacs_mule)
(decode_coding_emacs_mule, encode_coding_emacs_mule)
(detect_coding_iso_2022, decode_coding_iso_2022)
(encode_invocation_designation, encode_designation_at_bol)
(encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
(decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
(encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
(encode_coding_ccl, encode_coding_raw_text)
(detect_coding_charset, decode_coding_charset)
(encode_coding_charset, detect_eol, decode_eol, produce_chars)
(produce_composition, produce_charset, produce_annotation)
(decode_coding, handle_composition_annotation)
(handle_charset_annotation, consume_chars, decode_coding_gap)
(decode_coding_object, encode_coding_object, detect_coding_system)
(Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
(code_convert_region, code_convert_string)
(Fdefine_coding_system_internal):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
(Fdefine_coding_system_internal):
Don't assume fixnums fit in int.
(decode_coding_gap, decode_coding_object, encode_coding_object)
(Fread_coding_system, Fdetect_coding_region, Funencodable_char_position)
(Fcheck_coding_systems_region):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(Ffind_operation_coding_system): NATNUMP can eval its arg twice.
(Fdefine_coding_system_internal): Check for charset-id overflow.
* coding.h: Adjust decls to match defn changes elsewhere.
(struct coding_system):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
* composite.c (get_composition_id, find_composition)
(run_composition_function, update_compositions)
(compose_text, composition_gstring_put_cache)
(composition_gstring_p, composition_gstring_width)
(fill_gstring_header, fill_gstring_body, autocmp_chars)
(composition_compute_stop_pos, composition_reseat_it)
(composition_update_it, struct position_record)
(find_automatic_composition, composition_adjust_point)
(Fcomposition_get_gstring, Ffind_composition_internal):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(update_compositions):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
* composite.h: Adjust decls to match defn changes elsewhere.
(struct composition):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
* data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
Do not attempt to compute the address of the object just before a
buffer; this is not portable.
(Faref, Faset):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(Faset): Use int, not EMACS_INT, where int is wide enough.
(Fstring_to_number): Don't assume fixnums fit in int.
(Frem): Don't assume arg is nonnegative.
* dbusbind.c (xd_append_arg): Check for integers out of range.
(Fdbus_call_method): Don't overflow the timeout int.
* dired.c (directory_files_internal, file_name_completion, scmp)
(file_name_completion_stat):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(file_name_completion): Don't overflow matchcount.
(file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
* dispextern.h: Adjust decls to match defn changes elsewhere.
(struct text_pos, struct glyph, struct bidi_saved_info)
(struct bidi_string_data, struct bidi_it, struct composition_it)
(struct it):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(struct display_pos, struct composition_it, struct it):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
* dispnew.c (increment_matrix_positions)
(increment_row_positions, mode_line_string)
(marginal_area_string):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(change_frame_size_1, Fredisplay):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(duration_to_sec_usec): New function, to check for overflow better.
(Fsleep_for, sit_for): Use it.
* doc.c (get_doc_string, store_function_docstring):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(get_doc_string, Fsnarf_documentation):
Use int, not EMACS_INT, where int is wide enough.
(get_doc_string):
Use SAFE_ALLOCA, not alloca.
Check for overflow when converting EMACS_INT to off_t.
* doprnt.c (doprnt):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
* editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
Don't assume uid_t fits into fixnum.
(buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
(Ffield_string, Ffield_string_no_properties, Ffield_beginning)
(Ffield_end, Fconstrain_to_field, Fline_beginning_position)
(Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
(general_insert_function)
(Finsert_char, make_buffer_string, make_buffer_string_both)
(update_buffer_properties, Fbuffer_substring)
(Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
(Fsubst_char_in_region, check_translation)
(Ftranslate_region_internal, save_restriction_restore, Fformat)
(transpose_markers, Ftranspose_regions):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(clip_to_bounds): Move to lisp.h as an inline function).
(Fconstrain_to_field): Don't assume integers are nonnegative.
(Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
(Fsubst_char_in_region, Fsave_restriction):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(Femacs_pid): Don't assume pid_t fits into fixnum.
(lo_time): Use int, not EMACS_INT, when int suffices.
(lisp_time_argument): Check for usec out of range.
(Fencode_time): Don't assume fixnum fits in int.
* emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
(gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
(PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
(init_cmdargs, Fdump_emacs):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(Fkill_emacs): Don't assume fixnum fits in int; instead, take just
the bottom (typically) 32 bits of the fixnum.
* eval.c (specpdl_size, call_debugger):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(when_entered_debugger, Fbacktrace_debug):
Don't assume fixnum can fit in int.
(Fdefvaralias, Fdefvar): Do not attempt to compute the address of
the object just before a buffer; this is not portable.
(FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
(grow_specpdl, unbind_to):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
(grow_specpdl): Simplify allocation by using xpalloc.
* fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
(Finsert_file_contents, Fwrite_region, Fdo_auto_save):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
(a_write, e_write):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(Fcopy_file, non_regular_nbytes, read_non_regular)
(Finsert_file_contents):
Use int, not EMACS_INT, where int is wide enough.
(READ_BUF_SIZE): Verify that it fits in int.
(Finsert_file_contents): Check that counts are in proper range,
rather than assuming fixnums fit into ptrdiff_t etc.
Don't assume fixnums fit into int.
(Fdo_auto_save, Fset_buffer_auto_saved)
(Fclear_buffer_auto_save_failure):
Don't assume time_t is signed, or that it fits in int.
* fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec)
(concat, string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
(string_char_to_byte, string_byte_to_char)
(string_make_multibyte, string_to_multibyte)
(string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
(Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
(substring_both, Fdelete, internal_equal, Ffillarray)
(Fclear_string, mapcar1)
(Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
(Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
(larger_vector, make_hash_table, maybe_resize_hash_table)
(hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
(Fmaphash, secure_hash):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(concat): Check for string index and length overflow.
(Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
(Frequire):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(larger_vector): New API (vec, incr_min, size_max) replaces old
one (vec, new_size, init).  This catches size overflow.
INIT was removed because it was always Qnil.
All callers changed.
(INDEX_SIZE_BOUND): New macro, which calculates more precisely
the upper bound on a hash table index size.
(make_hash_table, maybe_resize_hash_table): Use it.
(secure_hash): Computer start_byte and end_byte only after
they're known to be in ptrdiff_t range.
* font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
(Ffont_get_glyphs, Ffont_at):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(font_style_to_value, font_prop_validate_style, font_expand_wildcards)
(Flist_fonts, Fopen_font):
Don't assume fixnum can fit in int.
(check_gstring): Don't assume index can fit in int.
(font_match_p): Check that fixnum is a character, not a nonnegative
fixnum, since the later code needs to stuff it into an int.
(font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
(font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
conversion overflow issues.
(Fopen_font): Check for integer out of  range.
(Ffont_get_glyphs): Don't assume index can fit in int.
* font.h: Adjust decls to match defn changes elsewhere.
* fontset.c (reorder_font_vector): Redo score calculation to avoid
integer overflow.
(num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
printmax_t, where ptrdiff_t is wide enough.
(Finternal_char_font):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
* frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
(Fset_frame_height, Fset_frame_width, Fset_frame_size)
(Fset_frame_position, x_set_frame_parameters)
(x_set_line_spacing, x_set_border_width)
(x_set_internal_border_width, x_set_alpha, x_figure_window_size):
Check that fixnums are in proper range for system types.
(frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(Fmodify_frame_parameters): Don't assume fixnum fits in int.
Use SAFE_ALLOCA_LISP, not alloca.
* frame.h (struct frame): Use intptr_t, not EMACS_INT, where
intptr_t is wide enough.
* fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
(Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
(Ffringe_bitmaps_at_pos): Don't assume index fits in int.
Check for fixnum out of range.
* ftfont.c (ftfont_list): Don't assume index fits in int.
Check that fixnums are in proper range for system types.
(ftfont_shape_by_flt):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
Remove no-longer-needed lint_assume.
* gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
Check that fixnums are in proper range for system types.
* gnutls.h: Adjust decls to match defn changes elsewhere.
* gtkutil.c (xg_dialog_run):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(update_frame_tool_bar):
Check that fixnums are in proper range for system types.
* image.c (parse_image_spec): Redo count calculation to avoid overflow.
(lookup_image): Check that fixnums are in proper range for system types.
* indent.c (last_known_column, last_known_column_point):
(current_column_bol_cache):
(skip_invisible, current_column, check_display_width):
(check_display_width, scan_for_column, current_column_1)
(Findent_to, Fcurrent_indentation, position_indentation)
(indented_beyond_p, Fmove_to_column, compute_motion):
(Fcompute_motion, Fvertical_motion):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(last_known_column_modified): Use EMACS_INT, not int.
(check_display_width):
(Fcompute_motion):
Check that fixnums and floats are in proper range for system types.
(compute_motion): Don't assume index or fixnum fits in int.
(compute_motion, Fcompute_motion):
Use int, not EMACS_INT, when it is wide enough.
(vmotion): Omit local var start_hpos that is always 0; that way
we don't need to worry about overflow in expressions involving it.
* indent.h: Adjust decls to match defn changes elsewhere.
(struct position):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
Use int, not EMACS_INT, where int is wide enough.
Remove unused members ovstring_chars_done and tab_offset;
all uses removed.
* insdel.c (move_gap, move_gap_both, gap_left, gap_right)
(adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
(adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
(make_gap, copy_text, insert, insert_and_inherit)
(insert_before_markers, insert_before_markers_and_inherit)
(insert_1, count_combining_before, count_combining_after)
(insert_1_both, insert_from_string)
(insert_from_string_before_markers, insert_from_string_1)
(insert_from_gap, insert_from_buffer, insert_from_buffer_1)
(adjust_after_replace, adjust_after_insert, replace_range)
(replace_range_2, del_range, del_range_1, del_range_byte)
(del_range_both, del_range_2, modify_region)
(prepare_to_modify_buffer, signal_before_change)
(signal_after_change, Fcombine_after_change_execute):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
* intervals.c (traverse_intervals, rotate_right, rotate_left)
(balance_an_interval, split_interval_right, split_interval_left)
(find_interval, next_interval, update_interval)
(adjust_intervals_for_insertion, delete_node, delete_interval)
(interval_deletion_adjustment, adjust_intervals_for_deletion)
(static_offset_intervals, offset_intervals)
(merge_interval_right, merge_interval_left, make_new_interval)
(graft_intervals_into_buffer, temp_set_point_both)
(temp_set_point, set_point, adjust_for_invis_intang)
(set_point_both, move_if_not_intangible, get_property_and_range)
(get_local_map, copy_intervals, copy_intervals_to_string)
(compare_string_intervals, set_intervals_multibyte_1):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
* intervals.h: Adjust decls to match defn changes elsewhere.
(struct interval):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
* keyboard.c (this_command_key_count, this_single_command_key_start)
(before_command_key_count, before_command_echo_length, echo_now)
(echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
(command_loop_1, safe_run_hooks, read_char, timer_check_2)
(menu_item_eval_property, read_key_sequence, Fread_key_sequence)
(Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(last_non_minibuf_size, last_point_position, echo_truncate)
(command_loop_1, adjust_point_for_property, read_char, gen_help_event)
(make_lispy_position, make_lispy_event, parse_modifiers_uncached)
(parse_modifiers, modify_event_symbol, Fexecute_extended_command)
(stuff_buffered_input):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(last_auto_save, command_loop_1, read_char):
Use EMACS_INT, not int, to avoid integer overflow.
(record_char): Avoid overflow in total_keys computation.
(parse_modifiers_uncached): Redo index calculation to avoid overflow.
* keyboard.h: Adjust decls to match defn changes elsewhere.
* keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
(Fkey_description, Fdescribe_vector, Flookup_key):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(click_position): New function, to check that positions are in range.
(Fcurrent_active_maps):
(describe_command):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(Faccessible_keymaps, Fkey_description):
(preferred_sequence_p):
Don't assume fixnum can fit into int.
(Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
Check for integer overflow in size calculations.
(Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
avoid mishandling large integers.
* lisp.h: Adjust decls to match defn changes elsewhere.
(ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
(struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
(struct Lisp_Marker):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(clip_to_bounds): Now an inline function, moved here from editfns.c.
(XSETSUBR): Use size of 0 since the actual size doesn't matter,
and using 0 avoids overflow.
(GLYPH_CODE_P): Check for overflow in system types, subsuming the
need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
All callers changed.
(GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
Assume the arg has valid form, since it always does.
(TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
unsigned integer system type.
(CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
(struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
(duration_to_sec_usec): New decl.
* lread.c (read_from_string_index, read_from_string_index_byte)
(read_from_string_limit, readchar, unreadchar, openp)
(read_internal_start, read1, oblookup):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(Fload, readevalloop, Feval_buffer, Feval_region):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(openp): Check for out-of-range argument to 'access'.
(read1): Use int, not EMACS_INT, where int is wide enough.
Don't assume fixnum fits into int.
* macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
in size calculation.
(Fexecute_kbd_macro):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
* marker.c (cached_charpos, cached_bytepos, CONSIDER)
(byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
(buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
(set_marker_both, set_marker_restricted_both, marker_position)
(marker_byte_position, Fbuffer_has_markers_at):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
* menu.c (ensure_menu_items): Renamed from grow_menu_items.
It now merely ensures that the menu is large enough, without
necessarily growing it, as this avoids some integer overflow issues.
All callers changed.
(keymap_panes, parse_single_submenu, Fx_popup_menu):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
Use SAFE_ALLOCA_LISP, not alloca.
(find_and_return_menu_selection): Avoid unnecessary casts of pointers
to EMACS_INT.  Check that fixnums are in proper range for system types.
* minibuf.c (minibuf_prompt_width, string_to_object)
(Fminibuffer_contents, Fminibuffer_contents_no_properties)
(Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(get_minibuffer, read_minibuf_unwind):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
this simplifies overflow checking.  All callers changed.
(read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
(Ftest_completion):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
* nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
(x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
Check that fixnums are in proper range for system types.
(Fx_create_frame, Fx_show_tip):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
* nsfont.m (ns_findfonts, nsfont_list_family):
Don't assume fixnum fits in long.
* nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
wide enough.
* nsselect.m (ns_get_local_selection):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
* print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
(PRINTDECLARE, PRINTPREPARE):
(strout, print_string):
(print, print_preprocess, print_check_string_charset_prop)
(print_object):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(PRINTDECLARE):
(temp_output_buffer_setup, Fprin1_to_string, print_object):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
(PRINTFINISH): Use SAFE_ALLOCA, not alloca.
(printchar, strout): Use xpalloc to catch size calculation overflow.
(Fexternal_debugging_output): Use CHECK_CHARACTER, not CHECK_NUMBER,
to avoid mishandling large integers.
(print_error_message): Use SAFE_ALLOCA, not alloca.
(print_object): Use int, not EMACS_INT, where int is wide enough.
* process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
(Fset_process_window_size, Fformat_network_address)
(get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
(Fsignal_process, sigchld_handler):
Check that fixnums are in proper range for system types.
(Fformat_network_address, read_process_output, send_process)
(Fprocess_send_region, status_notify):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(Fformat_network_address, Fmake_serial_process, Fmake_network_process)
(wait_reading_process_output, read_process_output, exec_sentinel):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
(Faccept_process_output): Use duration_to_sec_usec to do proper
overflow checking on durations.
* scroll.c (calculate_scrolling, calculate_direct_scrolling)
(line_ins_del): Use int, not EMACS_INT, where int is wide enough.
* search.c (looking_at_1, string_match_1):
(fast_string_match, fast_c_string_match_ignore_case)
(fast_string_match_ignore_case, fast_looking_at, scan_buffer)
(scan_newline, find_before_next_newline, search_command)
(trivial_regexp_p, search_buffer, simple_search, boyer_moore)
(set_search_regs, wordify):
(Freplace_match):
(Fmatch_data):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(string_match_1, search_buffer, set_search_regs):
(Fmatch_data):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(wordify): Check for overflow in size calculation.
(Freplace_match): Avoid potential buffer overflow in search_regs.start.
(Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
Check that fixnums are in proper range for system types.
* sound.c (struct sound_device)
(wav_play, au_play, vox_write, alsa_period_size, alsa_write):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(Fplay_sound_internal):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
* syntax.c (ST_COMMENT_STYLE, ST_STRING_STYLE):
In definitions, make it clearer that these values must be out of range
for the respective integer ranges.  This fixes a bug with ST_STRING_STYLE
and non-ASCII characters.
(struct lisp_parse_state, find_start_modiff)
(Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
(Fparse_partial_sexp):
Don't assume fixnums can fit in int.
(struct lisp_parse_state, find_start_pos, find_start_value)
(find_start_value_byte, find_start_begv)
(update_syntax_table, char_quoted, dec_bytepos)
(find_defun_start, prev_char_comend_first, back_comment):
(scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
(scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(Finternal_describe_syntax_value): Check that match_lisp is a
character, not an integer, since the code stuffs it into int.
(scan_words, scan_sexps_forward):
Check that fixnums are in proper range for system types.
(Fforward_word):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(scan_sexps_forward):
Use CHARACTERP, not INTEGERP, since the value must fit into int.
(Fparse_partial_sexp): Fix doc; element 8 is not ignored.
* syntax.h: Adjust decls to match defn changes elsewhere.
(struct gl_state_s):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
* sysdep.c (wait_for_termination_1, wait_for_termination)
(interruptible_wait_for_termination, mkdir):
Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
(emacs_read, emacs_write):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(system_process_attributes): Don't assume uid_t, gid_t, and
double all fit in int or even EMACS_INT.
* term.c (set_tty_color_mode):
Check that fixnums are in proper range for system types.
* termhooks.h (struct input_event):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
* textprop.c (validate_interval_range, interval_of)
(Fadd_text_properties, set_text_properties_1)
(Fremove_text_properties, Fremove_list_of_text_properties)
(Ftext_property_any, Ftext_property_not_all)
(copy_text_properties, text_property_list, extend_property_ranges)
(verify_interval_modification):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(Fnext_single_char_property_change)
(Fprevious_single_char_property_change):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(copy_text_properties): Check for integer overflow in index calculation.
* undo.c (last_boundary_position, record_point, record_insert)
(record_delete, record_marker_adjustment, record_change)
(record_property_change):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
* w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
(Fx_hide_tip, Fx_file_dialog):
* w32menu.c (set_frame_menubar):
Use ptrdiff_t, not int, for consistency with rest of code.
* window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
(select_window, Fdelete_other_windows_internal)
(window_scroll_pixel_based, window_scroll_line_based)
(Frecenter, Fset_window_configuration):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(Fset_window_hscroll, run_window_configuration_change_hook)
(set_window_buffer, temp_output_buffer_show, scroll_command)
(Fscroll_other_window):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
Don't assume fixnum fits in int.
(Fset_window_scroll_bars):
Check that fixnums are in proper range for system types.
* xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
(string_pos, c_string_pos, number_of_chars, init_iterator)
(in_ellipses_for_invisible_text_p, init_from_display_pos)
(compute_stop_pos, next_overlay_change, compute_display_string_pos)
(compute_display_string_end, handle_face_prop)
(face_before_or_after_it_pos, handle_invisible_prop, handle_display_prop)
(handle_display_spec, handle_single_display_spec)
(display_prop_intangible_p, string_buffer_position_lim)
(string_buffer_position, handle_composition_prop, load_overlay_strings)
(get_overlay_strings_1, get_overlay_strings)
(iterate_out_of_display_property, forward_to_next_line_start)
(back_to_previous_visible_line_start, reseat, reseat_to_string)
(get_next_display_element, set_iterator_to_next)
(get_visually_first_element, compute_stop_pos_backwards)
(handle_stop_backwards, next_element_from_buffer)
(move_it_in_display_line_to, move_it_in_display_line)
(move_it_to, move_it_vertically_backward, move_it_by_lines)
(add_to_log, message_dolog, message_log_check_duplicate)
(message2, message2_nolog, message3, message3_nolog
(with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
(current_message_1, truncate_echo_area, truncate_message_1)
(set_message, set_message_1, store_mode_line_noprop)
(hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
(text_outside_line_unchanged_p, check_point_in_composition)
(reconsider_clip_changes)
(redisplay_internal, set_cursor_from_row, try_scrolling)
(try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
(redisplay_window, find_last_unchanged_at_beg_row)
(find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
(trailing_whitespace_p, find_row_edges, display_line)
(RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
(display_mode_element, store_mode_line_string)
(pint2str, pint2hrstr, decode_mode_spec)
(display_count_lines, display_string, draw_glyphs)
(x_produce_glyphs, x_insert_glyphs)
(rows_from_pos_range, mouse_face_from_buffer_pos)
(fast_find_string_pos, mouse_face_from_string_pos)
(note_mode_line_or_margin_highlight, note_mouse_highlight):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(safe_call, init_from_display_pos, handle_fontified_prop)
(handle_single_display_spec, load_overlay_strings)
(with_echo_area_buffer, setup_echo_area_for_printing)
(display_echo_area, echo_area_display)
(x_consider_frame_title, prepare_menu_bars, update_menu_bar)
(update_tool_bar, hscroll_window_tree, redisplay_internal)
(redisplay_window, dump_glyph_row, display_mode_line, Fformat_mode_line)
(decode_mode_spec, on_hot_spot_p):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(handle_single_display_spec, build_desired_tool_bar_string)
(redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
(get_specified_cursor_type):
Check that fixnums are in proper range for system types.
(struct overlay_entry, resize_mini_window, Fdump_glyph_row)
(Flookup_image_map):
Don't assume fixnums fit in int.
(compare_overlay_entries):
Avoid mishandling comparisons due to subtraction overflow.
(load_overlay_strings): Use SAFE_NALLOCA, not alloca.
(last_escape_glyph_face_id, last_glyphless_glyph_face_id):
(handle_tool_bar_click):
Use int, not unsigned, since we prefer signed and the signedness
doesn't matter here.
(get_next_display_element, next_element_from_display_vector):
Use int, not EMACS_INT, when int is wide enough.
(start_hourglass): Use duration_to_sec_usec to do proper
overflow checking on durations.
* xfaces.c (Fbitmap_spec_p):
Check that fixnums are in proper range for system types.
(compare_fonts_by_sort_order):
Avoid mishandling comparisons due to subtraction overflow.
(Fx_family_fonts, realize_basic_faces):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(Fx_family_fonts):
Don't assume fixnum fits in int.
Use SAFE_ALLOCA_LISP, not alloca.
(merge_face_heights): Remove unnecessary cast to EMACS_INT.
(Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
(face_at_buffer_position, face_for_overlay_string)
(face_at_string_position):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
(merge_faces): Use int, not EMACS_INT, where int is wide enough.
* xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
(Fx_show_tip):
Check that fixnums are in proper range for system types.
(Fx_create_frame, x_create_tip_frame, Fx_show_tip)
(Fx_hide_tip, Fx_file_dialog, Fx_select_font):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(Fx_change_window_property): Don't assume fixnums fit in int.
* xfont.c (xfont_chars_supported):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
* xmenu.c (Fx_popup_dialog, set_frame_menubar)
(create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
* xml.c (parse_region):
* xrdb.c (magic_file_p):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
* xselect.c (TRACE1): Don't assume pid_t promotes to int.
(x_get_local_selection, x_reply_selection_request)
(x_handle_selection_request, wait_for_property_change):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
(selection_data_to_lisp_data): Use short, not EMACS_INT, where
short is wide enough.
(x_send_client_event): Don't assume fixnum fits in int.
* xterm.c (x_x_to_emacs_modifiers):
Don't assume EMACS_INT overflows nicely into int.
(x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
may come from Lisp.
(handle_one_xevent): NATNUMP can eval its arg twice.
(x_connection_closed):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
* xterm.h: Adjust decls to match defn changes elsewhere.
(struct scroll_bar): Use struct vectorlike_header
rather than rolling our own approximation.
(SCROLL_BAR_VEC_SIZE): Remove; not used.
2011-09-21 10:41:20 -07:00
Stefan Monnier
cabf1cac90 * textprop.c (text_property_stickiness): Obey Vtext_property_default_nonsticky.
(syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
* w32fns.c (syms_of_w32fns):
* xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
2011-07-04 14:31:29 -04:00
Juanma Barranquero
cd3520a41d Move DEFSYM to lisp.h and use everywhere. 2011-06-24 23:25:22 +02:00
Paul Eggert
b081724f64 Use ptrdiff_t, not int, for overlay counts.
* buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
* editfns.c (overlays_around, get_pos_property):
* textprop.c (get_char_property_and_overlay):
* xdisp.c (next_overlay_change, note_mouse_highlight):
* xfaces.c (face_at_buffer_position):
* buffer.c (overlays_at, sort_overlays, Foverlays_at)
(Fnext_overlay_change, Fprevious_overlay_change):
Use ptrdiff_t, not int, for sizes.
(overlays_at): Check for size-calculation overflow.
2011-06-21 14:32:10 -07:00
Paul Eggert
55d4c1b248 [ChangeLog]
Use 'inline', not 'INLINE'.
* configure.in, autogen/config.in (INLINE): Remove.
[lib-src/ChangeLog]
Use 'inline', not 'INLINE'.
* etags.c (hash): Now inline unconditionally.
* make-docfile.c (put_char): inline, not INLINE.
[nt/ChangeLog]
Use 'inline', not 'INLINE'.
* config.nt (INLINE): Remove.
[src/ChangeLog]
Use 'inline', not 'INLINE'.
* alloc.c, fontset.c (INLINE): Remove.
* alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
* intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
* xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
* gmalloc.c (register_heapinfo): Use inline unconditionally.
* lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
2011-05-28 15:39:39 -07:00
Glenn Morris
d2fc7e3d0f Merge from emacs-23; up to 2010-06-10T12:56:11Z!michael.albinus@gmx.de. 2011-05-12 00:07:06 -07:00
Drew Adams
e531bdfff1 src/textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655). 2011-05-11 18:38:18 +02:00
Paul Eggert
671875dac1 Merge from mainline. 2011-04-25 23:17:52 -07:00
Eli Zaretskii
e2ad650c71 Minor cleanup in src/textprop.c.
src/textprop.c (syms_of_textprop): Remove dead code.
 (copy_text_properties): Delete obsolete commentary about an
 interface that was deleted long ago.  Fix typos in the description
 of arguments.
2011-04-24 19:28:57 +03:00
Eli Zaretskii
224a3131ee Fix typos in comments in character.c and textprop.c. 2011-04-23 20:19:56 +03:00
Paul Eggert
67769ffc6f * textprop.c (set_text_properties_1): Rewrite for clarity,
and to avoid GCC warning about integer overflow.
2011-04-20 01:38:11 -07:00
Eli Zaretskii
d1dfb56cc8 Fix regex.c, syntax.c and friends for buffers > 2GB.
src/syntax.h (struct gl_state_s): Declare character position members
 EMACS_INT.
 src/syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
 src/textprop.c (verify_interval_modification, interval_of): Declare
 arguments EMACS_INT.
 src/intervals.c (adjust_intervals_for_insertion): Declare arguments
 EMACS_INT.
 src/intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
 src/indent.c (Fvertical_motion): Local variable it_start is now
 EMACS_INT.
 src/regex.c (re_match, re_match_2, re_match_2_internal)
 (bcmp_translate, regcomp, regexec, print_double_string)
 (group_in_compile_stack, re_search, re_search_2, regex_compile)
 (re_compile_pattern, re_exec): Declare arguments and local
 variables `size_t' and `ssize_t' and return values `regoff_t', as
 appropriate.
 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
 <compile_stack_type>: `size' and `avail' are now `size_t'.
 src/regex.h <regoff_t>: Use ssize_t, not int.
 (re_search, re_search_2, re_match, re_match_2): Arguments that
 specify buffer/string position and length are now ssize_t and
 size_t.  Return type is regoff_t.
2011-04-16 21:26:30 +03:00
Paul Eggert
cd64ea1d0d * lisp.h (INFUN): Remove. Suggested by Dan Nicolaescu in
<http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00393.html>.
All uses spelled out.
2011-04-14 12:34:42 -07:00
Paul Eggert
a7ca3326c4 Undo the DEFUN->DEFUE change. 2011-04-13 22:04:02 -07:00
Paul Eggert
50436f3383 * textprop.c (interval_insert_behind_hooks): Now static.
(interval_insert_in_front_hooks): Likewise.
2011-04-13 19:53:50 -07:00
Paul Eggert
955cbe7b17 Declare Lisp_Object Q* variables to be 'static' if not exproted.
This makes it easier for human readers (and static analyzers)
to see whether these variables are used from other modules.
* alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
* ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
* data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
* font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
* lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
* sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
* xmenu.c, xselect.c:
Declare Q* vars static if they are not used in other modules.
* ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
* frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
Remove decls of unexported vars.
* keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
2011-04-10 20:39:45 -07:00
Paul Eggert
16a97296c0 Make Emacs functions such as Fatom 'static' by default.
This makes it easier for human readers (and static analyzers)
to see whether these functions can be called from other modules.
DEFUN now defines a static function.  To make the function external
so that it can be used in other C modules, use the new macro DEFUE.
* lisp.h (DEFINE_FUNC): New macro, with the old contents of DEFUN.
(DEFUN): Rewrite in terms of DEFINE_FUNC.  It now generates a
static function definition.  Use DEFUE if you want an extern one.
(DEFUE, INFUN): New macros.
(Funibyte_char_to_multibyte, Fsyntax_table_p, Finit_image_library):
(Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
(Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
(Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
Remove decls, since these functions are now static.
(Funintern, Fget_internal_run_time): New decls, since these functions
were already external.
* alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
* ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
* doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
* fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
* keyboard.c, keymap.c, lread.c:
* macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
* syntax.c, term.c, terminal.c, textprop.c, undo.c:
* window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
Mark functions with DEFUE instead of DEFUN,
if they are used in other modules.
* buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
decls for now-static functions.
* buffer.h (Fdelete_overlay): Remove decl.
* callproc.c (Fgetenv_internal): Mark as internal.
* composite.c (Fremove_list_of_text_properties): Remove decl.
(Fcomposition_get_gstring): New forward static decl.
* composite.h (Fcomposite_get_gstring): Remove decl.
* dired.c (Ffile_attributes): New forward static decl.
* doc.c (Fdocumntation_property): New forward static decl.
* eval.c (Ffetch_bytecode): New forward static decl.
(Funintern): Remove extern decl; now in .h file where it belongs.
* fileio.c (Fmake_symbolic_link): New forward static decl.
* image.c (Finit_image_library): New forward static decl.
* insdel.c (Fcombine_after_change_execute): Make forward decl static.
* intervals.h (Fprevious_property_change):
(Fremove_list_of_text_properties): Remove decls.
* keyboard.c (Fthis_command_keys): Remove decl.
(Fcommand_execute): New forward static decl.
* keymap.c (Flookup_key): New forward static decl.
(Fcopy_keymap): Now static.
* keymap.h (Flookup_key): Remove decl.
* process.c (Fget_process): New forward static decl.
(Fprocess_datagram_address): Mark as internal.
* syntax.c (Fsyntax_table_p): New forward static decl.
(skip_chars): Remove duplicate decl.
* textprop.c (Fprevious_property_change): New forward static decl.
* window.c (Fset_window_fringes, Fset_window_scroll_bars):
Now internal.
(Fset_window_margins, Fset_window_vscroll): New forward static decls.
* window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
2011-04-10 18:41:15 -07:00
Paul Eggert
1e792e4d80 * textprop.c (set_text_properties_1): Change while to do-while,
since the condition is always true at first.
2011-04-04 12:30:48 -07:00
Paul Eggert
ff08eb8560 * textprop.c (property_change_between_p): Remove; unused. 2011-03-18 09:42:05 -07:00
Glenn Morris
73b0cd5003 Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
Tom Tromey
29208e8237 Move all DEFVAR'd globals into a structure -- threading infrastructure
* globals.h: New file.
	* xterm.h (Vx_pixel_size_width_font_regexp): Remove declaration.
	* window.h (Vinitial_window_system, Vminibuf_scroll_window)
	(Vwindow_system_version): Remove declaration.
	* w32term.h (Vw32_enable_palette)
	(Vx_pixel_size_width_font_regexp): Remove declaration.
	* w32menu.c (Voverriding_local_map)
	(Voverriding_local_map_menu_flag): Remove declaration.
	* w32inevt.c (Vw32_alt_is_meta, Vw32_apps_modifier)
	(Vw32_capslock_is_shiftlock, Vw32_enable_caps_lock)
	(Vw32_enable_num_lock, Vw32_lwindow_modifier)
	(Vw32_pass_lwindow_to_system, Vw32_pass_rwindow_to_system)
	(Vw32_phantom_key_code, Vw32_recognize_altgr)
	(Vw32_rwindow_modifier, Vw32_scroll_lock_modifier)
	(w32_use_full_screen_buffer): Remove declaration.
	* w32.c (Vsystem_configuration, Vw32_downcase_file_names)
	(Vw32_generate_fake_inodes, Vw32_get_true_file_attributes)
	(w32_num_mouse_buttons, w32_pipe_read_delay): Remove declaration.
	* termopts.h (Vtruncate_partial_width_windows, inverse_video)
	(no_redraw_on_reenter, visible_bell): Remove declaration.
	* sysdep.c (Vsystem_name): Remove declaration.
	* syntax.h (parse_sexp_lookup_properties): Remove declaration.
	* menu.h (Vmenu_updating_frame): Remove declaration.
	* macros.h (Vexecuting_kbd_macro, executing_kbd_macro_index):
	Remove declaration.
	* lisp.h (Vafter_init_time, Vafter_load_alist)
	(Vauto_save_list_file_name, Vbefore_init_time, Vcommand_history)
	(Vcompletion_regexp_list, Vcurrent_load_list)
	(Vcurrent_prefix_arg, Vdata_directory, Vdebug_on_error)
	(Vdoc_directory, Vdoc_file_name, Vdynamic_library_alist)
	(Vexec_directory, Vexec_path, Vexec_suffixes)
	(Vface_font_rescale_alist, Vface_ignored_fonts, Vfeatures)
	(Vhelp_form, Vhistory_length, Vinhibit_field_text_motion)
	(Vinhibit_quit, Vinhibit_read_only, Vinhibit_redisplay)
	(Vinstallation_directory, Vinvocation_directory)
	(Vinvocation_name, Vload_file_rep_suffixes, Vload_history)
	(Vload_suffixes, Vmark_even_if_inactive, Vmemory_full)
	(Vmessage_log_max, Vobarray, Vprint_length, Vprint_level)
	(Vpurify_flag, Vquit_flag, Vsaved_region_selection)
	(Vscalable_fonts_allowed, Vselect_active_regions)
	(Vshell_file_name, Vstandard_input, Vstandard_output)
	(Vsystem_name, Vtemporary_file_directory, Vthrow_on_input)
	(Vtop_level, Vtty_erase_char, Vundo_outer_limit)
	(Vuser_login_name, Vwindow_scroll_functions)
	(Vwindow_system_version, Vx_no_window_manager)
	(Vx_resource_class, Vx_resource_name, baud_rate)
	(completion_ignore_case, debug_on_next_call, gc_cons_threshold)
	(history_delete_duplicates, inhibit_x_resources)
	(last_nonmenu_event, load_in_progress, max_specpdl_size)
	(minibuffer_auto_raise, print_escape_newlines, scroll_margin)
	(use_dialog_box, use_file_dialog): Remove declaration.  Include
	globals.h.
	* keymap.h (Voverriding_local_map)
	(Voverriding_local_map_menu_flag, meta_prefix_char): Remove
	declaration.
	* keyboard.h (Vdouble_click_time, Vfunction_key_map)
	(Vinput_method_function, Vkey_translation_map)
	(Vlucid_menu_bar_dirty_flag, Vthis_original_command)
	(do_mouse_tracking, extra_keyboard_modifiers)
	(num_nonmacro_input_events): Remove declaration.
	* intervals.h (Vchar_property_alias_alist)
	(Vdefault_text_properties, Vinhibit_point_motion_hooks)
	(Vtext_property_default_nonsticky): Remove declaration.
	* gtkutil.h (x_gtk_file_dialog_help_text)
	(x_gtk_show_hidden_files, x_gtk_use_old_file_dialog)
	(x_gtk_whole_detached_tool_bar): Remove declaration.
	* frame.h (Vdefault_frame_alist, Vframe_alpha_lower_limit)
	(Vmenu_bar_mode, Vmouse_highlight, Vterminal_frame)
	(Vtool_bar_mode, Vx_resource_class, Vx_resource_name)
	(focus_follows_mouse): Remove declaration.
	* fontset.h (Valternate_fontname_alist, Vfontset_alias_alist)
	(Vignore_relative_composition, Votf_script_alist)
	(Vuse_default_ascent, Vvertical_centering_font_regexp): Remove
	declaration.
	* font.h (Vfont_log): Remove declaration.
	* dosfns.h (Vdos_display_scancodes, Vdos_version)
	(Vdos_windows_version, dos_codepage, dos_country_code)
	(dos_decimal_point, dos_hyper_key, dos_keyboard_layout)
	(dos_keypad_mode, dos_super_key, dos_timezone_offset): Remove
	declaration.
	* disptab.h (Vglyph_table, Vstandard_display_table): Remove
	declaration.
	* dispextern.h (Vface_remapping_alist, Vglyphless_char_display)
	(Vmouse_autoselect_window, Voverflow_newline_into_fringe)
	(Vshow_trailing_whitespace, Vtool_bar_button_margin)
	(Vtool_bar_style, cursor_in_echo_area, display_hourglass_p)
	(inverse_video, mode_line_in_non_selected_windows)
	(tool_bar_button_relief, tool_bar_max_label_size)
	(underline_minimum_offset)
	(unibyte_display_via_language_environment, x_stretch_cursor_p):
	Remove declaration.
	* composite.h (Vauto_composition_function)
	(Vcomposition_function_table): Remove declaration.
	* commands.h (Vexecuting_kbd_macro)
	(Vminibuffer_local_completion_map)
	(Vminibuffer_local_filename_completion_map)
	(Vminibuffer_local_filename_must_match_map)
	(Vminibuffer_local_map, Vminibuffer_local_must_match_map)
	(Vminibuffer_local_ns_map, Vthis_command)
	(Vunread_command_events, cursor_in_echo_area)
	(last_command_event, last_nonmenu_event, unread_command_char):
	Remove declaration.
	* coding.h (Vcoding_system_for_read, Vcoding_system_for_write)
	(Vdefault_file_name_coding_system)
	(Vdefault_process_coding_system, Vfile_name_coding_system)
	(Vlast_coding_system_used, Vlocale_coding_system)
	(Vselect_safe_coding_system_function)
	(Vtranslation_table_for_input, coding_system_require_warning)
	(eol_mnemonic_dos, eol_mnemonic_mac, eol_mnemonic_undecided)
	(eol_mnemonic_unix, inherit_process_coding_system): Remove
	declaration.
	* charset.h (Vcharset_list, Vcurrent_iso639_language): Remove
	declaration.
	* character.h (Vauto_fill_chars, Vchar_direction_table)
	(Vchar_script_table, Vchar_width_table, Vprintable_chars)
	(Vscript_representative_chars, Vtranslation_table_vector)
	(Vunicode_category_table): Remove declaration.
	* ccl.h (Vfont_ccl_encoder_alist): Remove declaration.
	* buffer.h (Vafter_change_functions, Vbefore_change_functions)
	(Vdeactivate_mark, Vfirst_change_hook, Vtransient_mark_mode)
	(inhibit_modification_hooks): Remove declaration.
	* xterm.c (syms_of_xterm): Update.
	(Vx_alt_keysym, Vx_hyper_keysym, Vx_keysym_table)
	(Vx_meta_keysym, Vx_super_keysym, Vx_toolkit_scroll_bars)
	(x_mouse_click_focus_ignore_position)
	(x_underline_at_descent_line)
	(x_use_underline_position_properties): Remove.
	* xsmfns.c (syms_of_xsmfns): Update.
	(Vx_session_id, Vx_session_previous_id): Remove.
	* xsettings.c (syms_of_xsettings): Update.
	(Vxft_settings, use_system_font): Remove.
	* xselect.c (syms_of_xselect): Update.
	(Vselection_converter_alist, Vx_lost_selection_functions)
	(Vx_sent_selection_functions, x_selection_timeout): Remove.
	* xfns.c (syms_of_xfns): Update.
	(Vgtk_version_string, Vmotif_version_string)
	(Vx_cursor_fore_pixel, Vx_hourglass_pointer_shape)
	(Vx_max_tooltip_size, Vx_mode_pointer_shape)
	(Vx_no_window_manager, Vx_nontext_pointer_shape)
	(Vx_pixel_size_width_font_regexp, Vx_pointer_shape)
	(Vx_sensitive_text_pointer_shape)
	(Vx_window_horizontal_drag_shape, x_gtk_file_dialog_help_text)
	(x_gtk_show_hidden_files, x_gtk_use_old_file_dialog)
	(x_gtk_use_system_tooltips, x_gtk_whole_detached_tool_bar):
	Remove.
	* xfaces.c (syms_of_xfaces): Update.
	(Vface_default_stipple, Vface_font_rescale_alist)
	(Vface_ignored_fonts, Vface_new_frame_defaults)
	(Vface_remapping_alist, Vfont_list_limit)
	(Vscalable_fonts_allowed, Vtty_defined_color_alist): Remove.
	* xdisp.c (syms_of_xdisp): Update.
	(Vauto_resize_tool_bars, Vblink_cursor_alist)
	(Vdisplay_pixels_per_inch, Vfontification_functions)
	(Vframe_title_format, Vglobal_mode_string)
	(Vglyphless_char_display, Vhourglass_delay, Vhscroll_step)
	(Vicon_title_format, Vinhibit_redisplay)
	(Vline_number_display_limit, Vline_prefix)
	(Vmax_mini_window_height, Vmenu_bar_update_hook)
	(Vmenu_updating_frame, Vmessage_log_max)
	(Vmouse_autoselect_window, Vnobreak_char_display)
	(Voverlay_arrow_position, Voverlay_arrow_string)
	(Voverlay_arrow_variable_list, Vredisplay_end_trigger_functions)
	(Vresize_mini_windows, Vshow_trailing_whitespace)
	(Vtool_bar_border, Vtool_bar_button_margin, Vtool_bar_style)
	(Vtruncate_partial_width_windows, Vvoid_text_area_pointer)
	(Vwindow_scroll_functions, Vwindow_size_change_functions)
	(Vwindow_text_change_functions, Vwrap_prefix)
	(auto_raise_tool_bar_buttons_p, automatic_hscrolling_p)
	(debug_end_pos, display_hourglass_p, emacs_scroll_step)
	(highlight_nonselected_windows, hscroll_margin)
	(inhibit_eval_during_redisplay, inhibit_free_realized_faces)
	(inhibit_menubar_update, inhibit_try_cursor_movement)
	(inhibit_try_window_id, inhibit_try_window_reusing)
	(line_number_display_limit_width)
	(make_cursor_line_fully_visible_p, message_truncate_lines)
	(mode_line_inverse_video, multiple_frames, overline_margin)
	(scroll_conservatively, scroll_margin, tool_bar_button_relief)
	(tool_bar_max_label_size, underline_minimum_offset)
	(unibyte_display_via_language_environment, x_stretch_cursor_p):
	Remove.
	* window.c (syms_of_window): Update.
	(Vminibuf_scroll_window, Vother_window_scroll_buffer)
	(Vrecenter_redisplay, Vscroll_preserve_screen_position)
	(Vtemp_buffer_show_function, Vwindow_configuration_change_hook)
	(Vwindow_point_insertion_type, auto_window_vscroll_p)
	(mode_line_in_non_selected_windows, next_screen_context_lines)
	(window_min_height, window_min_width): Remove.
	(scroll_margin): Remove declaration.
	* w32term.c (syms_of_w32term): Update.
	(Vw32_capslock_is_shiftlock, Vw32_grab_focus_on_raise)
	(Vw32_recognize_altgr, Vw32_swap_mouse_buttons)
	(Vx_toolkit_scroll_bars, w32_num_mouse_buttons)
	(w32_use_visible_system_caret, x_underline_at_descent_line)
	(x_use_underline_position_properties): Remove.
	(Vcommand_line_args, Vsystem_name, extra_keyboard_modifiers):
	Remove declaration.
	* w32select.c (syms_of_w32select): Update.
	(Vnext_selection_coding_system, Vselection_coding_system): Remove.
	* w32proc.c (syms_of_ntproc): Update.
	(Vw32_downcase_file_names, Vw32_generate_fake_inodes)
	(Vw32_get_true_file_attributes, Vw32_quote_process_args)
	(Vw32_start_process_inherit_error_mode)
	(Vw32_start_process_share_console)
	(Vw32_start_process_show_window, w32_pipe_read_delay): Remove.
	(Vsystem_name): Remove declaration.
	* w32font.c (syms_of_w32font): Update.
	(Vw32_charset_info_alist): Remove.
	* w32fns.c (globals_of_w32fns, syms_of_w32fns): Update.
	(Vw32_alt_is_meta, Vw32_apps_modifier, Vw32_bdf_filename_alist)
	(Vw32_color_map, Vw32_enable_caps_lock, Vw32_enable_num_lock)
	(Vw32_enable_palette, Vw32_lwindow_modifier)
	(Vw32_pass_alt_to_system, Vw32_pass_lwindow_to_system)
	(Vw32_pass_rwindow_to_system, Vw32_phantom_key_code)
	(Vw32_rwindow_modifier, Vw32_scroll_lock_modifier)
	(Vx_cursor_fore_pixel, Vx_hourglass_pointer_shape)
	(Vx_max_tooltip_size, Vx_mode_pointer_shape)
	(Vx_no_window_manager, Vx_nontext_pointer_shape)
	(Vx_pixel_size_width_font_regexp, Vx_pointer_shape)
	(Vx_sensitive_text_pointer_shape)
	(Vx_window_horizontal_drag_shape, w32_ansi_code_page)
	(w32_enable_synthesized_fonts, w32_mouse_button_tolerance)
	(w32_mouse_move_interval)
	(w32_pass_extra_mouse_buttons_to_system)
	(w32_pass_multimedia_buttons_to_system, w32_quit_key)
	(w32_strict_fontnames, w32_strict_painting): Remove.
	(Vhourglass_delay, Vmenu_bar_mode, Vtool_bar_mode)
	(Vw32_recognize_altgr, Vwindow_system_version)
	(w32_num_mouse_buttons, w32_use_visible_system_caret): Remove
	declaration.
	* w32console.c (syms_of_ntterm): Update.
	(w32_use_full_screen_buffer): Remove.
	(Vtty_defined_color_alist): Remove declaration.
	* w16select.c (syms_of_win16select): Update.
	(Vnext_selection_coding_system, Vselection_coding_system): Remove.
	* undo.c (syms_of_undo): Update.
	(Vundo_outer_limit, Vundo_outer_limit_function)
	(undo_inhibit_record_point, undo_limit, undo_strong_limit):
	Remove.
	* textprop.c (syms_of_textprop): Update.
	(Vchar_property_alias_alist, Vdefault_text_properties)
	(Vinhibit_point_motion_hooks, Vtext_property_default_nonsticky):
	Remove.
	* terminal.c (syms_of_terminal): Update.
	(Vdelete_terminal_functions, Vring_bell_function): Remove.
	* term.c (syms_of_term): Update.
	(Vresume_tty_functions, Vsuspend_tty_functions)
	(no_redraw_on_reenter, system_uses_terminfo, visible_cursor):
	Remove.
	* syntax.c (syms_of_syntax): Update.
	(Vfind_word_boundary_function_table, multibyte_syntax_as_symbol)
	(open_paren_in_column_0_is_defun_start)
	(parse_sexp_ignore_comments, parse_sexp_lookup_properties)
	(words_include_escapes): Remove.
	* search.c (syms_of_search): Update.
	(Vinhibit_changing_match_data, Vsearch_spaces_regexp): Remove.
	* process.c (syms_of_process): Update.
	(Vprocess_adaptive_read_buffering, Vprocess_connection_type)
	(delete_exited_processes): Remove.
	* print.c (syms_of_print): Update.
	(Vfloat_output_format, Vprint_charset_text_property)
	(Vprint_circle, Vprint_continuous_numbering, Vprint_gensym)
	(Vprint_length, Vprint_level, Vprint_number_table)
	(Vstandard_output, print_escape_multibyte)
	(print_escape_newlines, print_escape_nonascii, print_quoted):
	Remove.
	* msdos.c (syms_of_msdos): Update.
	(Vdos_unsupported_char_glyph): Remove.
	(unibyte_display_via_language_environment): Remove declaration.
	* minibuf.c (syms_of_minibuf): Update.
	(Vcompletion_regexp_list, Vhistory_add_new_input)
	(Vhistory_length, Vminibuffer_completing_file_name)
	(Vminibuffer_completion_confirm)
	(Vminibuffer_completion_predicate, Vminibuffer_completion_table)
	(Vminibuffer_exit_hook, Vminibuffer_help_form)
	(Vminibuffer_history_position, Vminibuffer_history_variable)
	(Vminibuffer_prompt_properties, Vminibuffer_setup_hook)
	(Vread_buffer_function, Vread_expression_map)
	(completion_ignore_case, enable_recursive_minibuffers)
	(history_delete_duplicates, minibuffer_allow_text_properties)
	(minibuffer_auto_raise, read_buffer_completion_ignore_case):
	Remove.
	* marker.c (syms_of_marker): Update.
	(byte_debug_flag): Remove.
	* macros.c (syms_of_macros): Update.
	(Vexecuting_kbd_macro, executing_kbd_macro_index): Remove.
	* lread.c (syms_of_lread): Update.
	(Vafter_load_alist, Vbyte_boolean_vars)
	(Vbytecomp_version_regexp, Vcurrent_load_list)
	(Veval_buffer_list, Vload_file_name, Vload_file_rep_suffixes)
	(Vload_history, Vload_path, Vload_read_function)
	(Vload_source_file_function, Vload_suffixes, Vobarray)
	(Vold_style_backquotes, Vpreloaded_file_list, Vread_circle)
	(Vread_symbol_positions_list, Vread_with_symbol_positions)
	(Vsource_directory, Vstandard_input, Vuser_init_file, Vvalues)
	(force_load_messages, load_convert_to_unibyte)
	(load_dangerous_libraries, load_force_doc_strings)
	(load_in_progress): Remove.
	* keymap.c (syms_of_keymap): Update.
	(Vdefine_key_rebound_commands, Vemulation_mode_map_alists)
	(Vminibuffer_local_completion_map)
	(Vminibuffer_local_filename_completion_map)
	(Vminibuffer_local_filename_must_match_map)
	(Vminibuffer_local_map, Vminibuffer_local_must_match_map)
	(Vminibuffer_local_ns_map, Vminor_mode_map_alist)
	(Vminor_mode_overriding_map_alist, Vwhere_is_preferred_modifier):
	Remove.
	* keyboard.c (syms_of_keyboard): Update.
	(Vauto_save_timeout, Vcommand_error_function)
	(Vcommand_hook_internal, Vdeactivate_mark)
	(Vdeferred_action_function, Vdeferred_action_list)
	(Vdisable_point_adjustment, Vdouble_click_time)
	(Vecho_keystrokes, Venable_disabled_menus_and_buttons)
	(Vfunction_key_map, Vglobal_disable_point_adjustment)
	(Vhelp_char, Vhelp_event_list, Vhelp_form)
	(Vinput_method_function, Vinput_method_previous_message)
	(Vkey_translation_map, Vlast_event_frame)
	(Vlucid_menu_bar_dirty_flag, Vmenu_bar_final_items)
	(Vminibuffer_message_timeout, Voverriding_local_map)
	(Voverriding_local_map_menu_flag, Vpost_command_hook)
	(Vpre_command_hook, Vprefix_help_command)
	(Vsaved_region_selection, Vselect_active_regions)
	(Vshow_help_function, Vspecial_event_map, Vsuggest_key_bindings)
	(Vthis_command, Vthis_command_keys_shift_translated)
	(Vthis_original_command, Vthrow_on_input, Vtimer_idle_list)
	(Vtimer_list, Vtool_bar_separator_image_expression, Vtop_level)
	(Vtty_erase_char, Vunread_command_events)
	(Vunread_input_method_events, Vunread_post_input_method_events)
	(auto_save_interval, cannot_suspend, do_mouse_tracking)
	(double_click_fuzz, extra_keyboard_modifiers)
	(inhibit_local_menu_bar_menus, last_command_event)
	(last_input_event, last_nonmenu_event, menu_prompt_more_char)
	(menu_prompting, meta_prefix_char, num_input_keys)
	(num_nonmacro_input_events, polling_period, unread_command_char):
	Remove.
	* insdel.c (syms_of_insdel): Update.
	(Vcombine_after_change_calls, check_markers_debug_flag): Remove.
	* indent.c (syms_of_indent): Update.
	(indent_tabs_mode): Remove.
	* image.c (syms_of_image): Update.
	(Vimage_cache_eviction_delay, Vimage_types)
	(Vimagemagick_render_type, Vmax_image_size, Vx_bitmap_file_path)
	(cross_disabled_images): Remove.
	* fringe.c (syms_of_fringe): Update.
	(Vfringe_bitmaps, Voverflow_newline_into_fringe): Remove.
	* frame.c (syms_of_frame): Update.
	(Vdefault_frame_alist, Vdefault_frame_scroll_bars)
	(Vdelete_frame_functions, Vframe_alpha_lower_limit)
	(Vmake_pointer_invisible, Vmenu_bar_mode, Vmouse_highlight)
	(Vmouse_position_function, Vterminal_frame, Vtool_bar_mode)
	(Vx_resource_class, Vx_resource_name, focus_follows_mouse):
	Remove.
	* fontset.c (syms_of_fontset): Update.
	(Valternate_fontname_alist, Vfont_encoding_charset_alist)
	(Vfontset_alias_alist, Vignore_relative_composition)
	(Votf_script_alist, Vuse_default_ascent)
	(Vvertical_centering_font_regexp): Remove.
	* font.c (syms_of_font): Update.
	(Vfont_encoding_alist, Vfont_log, Vfont_slant_table)
	(Vfont_weight_table, Vfont_width_table): Remove.
	* fns.c (syms_of_fns): Update.
	(Vfeatures, use_dialog_box, use_file_dialog): Remove.
	* filelock.c (syms_of_filelock): Update.
	(Vtemporary_file_directory): Remove.
	* fileio.c (syms_of_fileio): Update.
	(Vafter_insert_file_functions, Vauto_save_include_big_deletions)
	(Vauto_save_list_file_name, Vauto_save_visited_file_name)
	(Vdefault_file_name_coding_system, Vfile_name_coding_system)
	(Vfile_name_handler_alist, Vinhibit_file_name_handlers)
	(Vinhibit_file_name_operation, Vset_auto_coding_function)
	(Vwrite_region_annotate_functions)
	(Vwrite_region_annotations_so_far)
	(Vwrite_region_post_annotation_function)
	(delete_by_moving_to_trash, write_region_inhibit_fsync): Remove.
	(Vw32_get_true_file_attributes): Remove declaration.
	* eval.c (syms_of_eval): Update.
	(Vdebug_ignored_errors, Vdebug_on_error, Vdebug_on_signal)
	(Vdebugger, Vinhibit_quit, Vmacro_declaration_function)
	(Vquit_flag, Vsignal_hook_function, Vstack_trace_on_error)
	(debug_on_next_call, debug_on_quit, debugger_may_continue)
	(max_lisp_eval_depth, max_specpdl_size): Remove.
	* emacs.c (syms_of_emacs): Update.
	(Vafter_init_time, Vbefore_init_time, Vcommand_line_args)
	(Vdynamic_library_alist, Vemacs_copyright, Vemacs_version)
	(Vinstallation_directory, Vinvocation_directory)
	(Vinvocation_name, Vkill_emacs_hook, Vpath_separator)
	(Vprevious_system_messages_locale, Vprevious_system_time_locale)
	(Vsystem_configuration, Vsystem_configuration_options)
	(Vsystem_messages_locale, Vsystem_time_locale, Vsystem_type)
	(inhibit_x_resources, noninteractive1): Remove.
	* editfns.c (syms_of_editfns): Update.
	(Vbuffer_access_fontified_property)
	(Vbuffer_access_fontify_functions, Vinhibit_field_text_motion)
	(Voperating_system_release, Vsystem_name, Vuser_full_name)
	(Vuser_login_name, Vuser_real_login_name): Remove.
	* dosfns.c (syms_of_dosfns): Update.
	(Vdos_display_scancodes, Vdos_version, Vdos_windows_version)
	(dos_codepage, dos_country_code, dos_decimal_point)
	(dos_hyper_key, dos_keyboard_layout, dos_keypad_mode)
	(dos_super_key, dos_timezone_offset): Remove.
	* doc.c (syms_of_doc): Update.
	(Vbuild_files, Vdoc_file_name): Remove.
	* dispnew.c (syms_of_display): Update.
	(Vglyph_table, Vinitial_window_system)
	(Vredisplay_preemption_period, Vstandard_display_table)
	(Vwindow_system_version, baud_rate, cursor_in_echo_area)
	(inverse_video, redisplay_dont_pause, visible_bell): Remove.
	* dired.c (syms_of_dired): Update.
	(Vcompletion_ignored_extensions): Remove.
	(Vw32_get_true_file_attributes): Remove declaration.
	* dbusbind.c (syms_of_dbusbind): Update.
	(Vdbus_debug, Vdbus_registered_buses)
	(Vdbus_registered_objects_table): Remove.
	* data.c (syms_of_data): Update.
	(Vmost_negative_fixnum, Vmost_positive_fixnum): Remove.
	* composite.c (syms_of_composite): Update.
	(Vauto_composition_function, Vauto_composition_mode)
	(Vcompose_chars_after_function, Vcomposition_function_table):
	Remove.
	* coding.c (syms_of_coding): Update.
	(Vcharset_revision_table, Vcoding_category_list)
	(Vcoding_system_alist, Vcoding_system_for_read)
	(Vcoding_system_for_write, Vcoding_system_list)
	(Vdefault_process_coding_system, Venable_character_translation)
	(Vfile_coding_system_alist, Vlast_code_conversion_error)
	(Vlast_coding_system_used, Vlatin_extra_code_table)
	(Vlocale_coding_system, Vnetwork_coding_system_alist)
	(Vprocess_coding_system_alist)
	(Vselect_safe_coding_system_function)
	(Vstandard_translation_table_for_decode)
	(Vstandard_translation_table_for_encode)
	(Vtranslation_table_for_input, coding_system_require_warning)
	(eol_mnemonic_dos, eol_mnemonic_mac, eol_mnemonic_undecided)
	(eol_mnemonic_unix, inherit_process_coding_system)
	(inhibit_eol_conversion, inhibit_iso_escape_detection)
	(inhibit_null_byte_detection): Remove.
	* cmds.c (syms_of_cmds): Update.
	(Vpost_self_insert_hook): Remove.
	* charset.c (syms_of_charset): Update.
	(Vcharset_list, Vcharset_map_path, Vcurrent_iso639_language)
	(inhibit_load_charset_map): Remove.
	* character.c (syms_of_character): Update.
	(Vauto_fill_chars, Vchar_direction_table, Vchar_script_table)
	(Vchar_width_table, Vprintable_chars)
	(Vscript_representative_chars, Vtranslation_table_vector)
	(Vunicode_category_table): Remove.
	* ccl.c (syms_of_ccl): Update.
	(Vcode_conversion_map_vector, Vfont_ccl_encoder_alist)
	(Vtranslation_hash_table_vector): Remove.
	* category.c (syms_of_category): Update.
	(Vword_combining_categories, Vword_separating_categories): Remove.
	* callproc.c (syms_of_callproc): Update.
	(Vconfigure_info_directory, Vdata_directory, Vdoc_directory)
	(Vexec_directory, Vexec_path, Vexec_suffixes)
	(Vinitial_environment, Vprocess_environment)
	(Vshared_game_score_directory, Vshell_file_name): Remove.
	* callint.c (syms_of_callint): Update.
	(Vcommand_debug_status, Vcommand_history, Vcurrent_prefix_arg)
	(Vmark_even_if_inactive, Vmouse_leave_buffer_hook): Remove.
	* bytecode.c (syms_of_bytecode): Update.
	(Vbyte_code_meter, byte_metering_on): Remove.
	* buffer.c (syms_of_buffer): Update.
	(Vafter_change_functions, Vbefore_change_functions)
	(Vchange_major_mode_hook, Vfirst_change_hook)
	(Vinhibit_read_only, Vkill_buffer_query_functions)
	(Vtransient_mark_mode, inhibit_modification_hooks): Remove.
	* alloc.c (syms_of_alloc): Update.
	(Vgc_cons_percentage, Vgc_elapsed, Vmemory_full)
	(Vmemory_signal_data, Vpost_gc_hook, Vpurify_flag)
	(cons_cells_consed, floats_consed, garbage_collection_messages)
	(gc_cons_threshold, gcs_done, intervals_consed)
	(misc_objects_consed, pure_bytes_used, string_chars_consed)
	(strings_consed, symbols_consed, vector_cells_consed): Remove.

	* lisp.h (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL)
	(DEFVAR_INT): Assume global is in `globals'.
	* alloc.c (globals): Define.
2011-01-18 13:45:37 -07:00
Glenn Morris
0d9f702fd0 Nuke arch-tags. 2011-01-15 15:16:57 -08:00
Stefan Monnier
77ab81d054 Merge from emacs-23 2011-01-14 12:18:41 -05:00
Glenn Morris
5df4f04cd3 Add 2011 to FSF/AIST copyright years. 2011-01-02 15:50:46 -08:00
Andreas Schwab
59fc5cf9ec Protoize
* dispnew.c (add_window_display_history)
(add_frame_display_history, glyph_row_slice_p)
(find_glyph_row_slice, flush_stdout)
(check_matrix_pointer_lossage, matrix_row)
(check_matrix_invariants, check_window_matrix_pointers)
(check_matrix_pointers, window_to_frame_vpos)
(window_to_frame_hpos): Prototize.
* textprop.c (erase_properties): Likewise.
2010-12-27 18:23:29 +01:00
Stefan Monnier
ef1b0ba7e5 Minor clean up to silence some gcc warnings.
* src/window.c (Fset_window_buffer):
* src/xterm.c (x_set_frame_alpha): Restructure code to silence
compiler warning.
(handle_one_xevent): Remove unused var `p'.
(do_ewmh_fullscreen): Remove unused var `lval'.
(xembed_set_info): Remove unused var `atom'.
* src/textprop.c (Fremove_list_of_text_properties): Add braces to silence
compiler warning.
* src/fontset.c (fontset_id_valid_p, dump_fontset):
* src/ftfont.c (ftfont_drive_otf): Modernize k&r declaration.
* src/eval.c (Feval, Ffuncall): Avoid unneeded gotos.
* src/dispnew.c (update_frame, update_frame_1): Compile the `do_pause'
label only when it's used.
* src/image.c (x_create_bitmap_from_xpm_data):
* src/dispextern.h (x_create_bitmap_from_xpm_data): Use const char** like
its callers.
* src/coding.c (detect_coding_utf_16): Remove unused vars `src_base' and
`consumed_chars'.
(DECODE_EMACS_MULE_21_COMPOSITION): Remove unused var `charbuf_base'.
(decode_coding_emacs_mule): Remove unused label `retry'.
(detect_eol): Add parens to silence compiler warning.
* src/alloc.c (bytes_used_when_reconsidered): Move to the #ifdef where
it's used to silence the compiler.
(make_number): Modernize k&r declaration.
(mark_char_table): Add parens to silence compiler warning.
2010-12-19 00:43:42 -05:00
Eli Zaretskii
2452438f0c Fix int/EMACS_INT use in textprop.c and window.c.
window.c (Fpos_visible_in_window_p, Fdelete_other_windows)
 (Fselect_window, window_scroll_pixel_based)
 (window_scroll_line_based, Frecenter, Fset_window_configuration):
 Use EMACS_INT for buffer positions.
 textprop.c (validate_interval_range, interval_of)
 (property_change_between_p, Fadd_text_properties)
 (set_text_properties_1, Fremove_text_properties)
 (Fremove_list_of_text_properties, Ftext_property_any)
 (Ftext_property_not_all, copy_text_properties)
 (text_property_list, extend_property_ranges)
 (verify_interval_modification): Use EMACS_INT for buffer
 positions.
2010-09-25 09:21:20 -04:00
Dan Nicolaescu
5842a27bbf Convert DEFUNs to standard C.
* src/alloc.c: Convert DEFUNs to standard C.
* src/buffer.c:
* src/bytecode.c:
* src/callint.c:
* src/callproc.c:
* src/casefiddle.c:
* src/casetab.c:
* src/category.c:
* src/character.c:
* src/charset.c:
* src/chartab.c:
* src/cmds.c:
* src/coding.c:
* src/composite.c:
* src/data.c:
* src/dbusbind.c:
* src/dired.c:
* src/dispnew.c:
* src/doc.c:
* src/dosfns.c:
* src/editfns.c:
* src/emacs.c:
* src/eval.c:
* src/fileio.c:
* src/filelock.c:
* src/floatfns.c:
* src/fns.c:
* src/font.c:
* src/fontset.c:
* src/frame.c:
* src/fringe.c:
* src/image.c:
* src/indent.c:
* src/insdel.c:
* src/keyboard.c:
* src/keymap.c:
* src/lread.c:
* src/macros.c:
* src/marker.c:
* src/menu.c:
* src/minibuf.c:
* src/msdos.c:
* src/nsfns.m:
* src/nsmenu.m:
* src/nsselect.m:
* src/print.c:
* src/process.c:
* src/search.c:
* src/sound.c:
* src/syntax.c:
* src/term.c:
* src/terminal.c:
* src/textprop.c:
* src/undo.c:
* src/w16select.c:
* src/w32console.c:
* src/w32fns.c:
* src/w32font.c:
* src/w32menu.c:
* src/w32proc.c:
* src/w32select.c:
* src/window.c:
* src/xdisp.c:
* src/xfaces.c:
* src/xfns.c:
* src/xmenu.c:
* src/xselect.c:
* src/xsettings.c:
* src/xsmfns.c: Likewise.
2010-07-08 14:25:08 -07:00
Dan Nicolaescu
971de7fb15 Convert (most) functions in src to standard C.
* src/alloc.c: Convert function definitions to standard C.
* src/atimer.c:
* src/bidi.c:
* src/bytecode.c:
* src/callint.c:
* src/callproc.c:
* src/casefiddle.c:
* src/casetab.c:
* src/category.c:
* src/ccl.c:
* src/character.c:
* src/charset.c:
* src/chartab.c:
* src/cmds.c:
* src/coding.c:
* src/composite.c:
* src/data.c:
* src/dbusbind.c:
* src/dired.c:
* src/dispnew.c:
* src/doc.c:
* src/doprnt.c:
* src/ecrt0.c:
* src/editfns.c:
* src/fileio.c:
* src/filelock.c:
* src/filemode.c:
* src/fns.c:
* src/font.c:
* src/fontset.c:
* src/frame.c:
* src/fringe.c:
* src/ftfont.c:
* src/ftxfont.c:
* src/gtkutil.c:
* src/indent.c:
* src/insdel.c:
* src/intervals.c:
* src/keymap.c:
* src/lread.c:
* src/macros.c:
* src/marker.c:
* src/md5.c:
* src/menu.c:
* src/minibuf.c:
* src/prefix-args.c:
* src/print.c:
* src/ralloc.c:
* src/regex.c:
* src/region-cache.c:
* src/scroll.c:
* src/search.c:
* src/sound.c:
* src/strftime.c:
* src/syntax.c:
* src/sysdep.c:
* src/termcap.c:
* src/terminal.c:
* src/terminfo.c:
* src/textprop.c:
* src/tparam.c:
* src/undo.c:
* src/unexelf.c:
* src/window.c:
* src/xfaces.c:
* src/xfns.c:
* src/xfont.c:
* src/xftfont.c:
* src/xgselect.c:
* src/xmenu.c:
* src/xrdb.c:
* src/xselect.c:
* src/xsettings.c:
* src/xsmfns.c:
* src/xterm.c: Likewise.
2010-07-04 00:50:25 -07:00
Jan D
f57e2426f0 Remove __P and P_ from .c and .m files and definition of P_
* lisp.h:
* atimer.h: Remove define for P_.

* alloc.c: Remove __P and P_ from .c and .m files.
* atimer.c:
* buffer.c:
* callint.c:
* category.c:
* charset.c:
* chartab.c:
* cm.c:
* coding.c:
* composite.c:
* data.c:
* dired.c:
* dispnew.c:
* doc.c:
* editfns.c:
* emacs.c:
* eval.c:
* fileio.c:
* filelock.c:
* fns.c:
* font.c:
* fontset.c:
* frame.c:
* ftfont.c:
* ftxfont.c:
* gmalloc.c:
* gtkutil.c:
* image.c:
* indent.c:
* intervals.c:
* keyboard.c:
* keymap.c:
* lread.c:
* marker.c:
* menu.c:
* minibuf.c:
* print.c:
* process.c:
* scroll.c:
* search.c:
* sound.c:
* strftime.c:
* syntax.c:
* sysdep.c:
* term.c:
* terminal.c:
* textprop.c:
* unexalpha.c:
* w32console.c:
* w32fns.c:
* w32font.c:
* w32menu.c:
* w32term.c:
* w32uniscribe.c:
* window.c:
* xdisp.c:
* xfaces.c:
* xfns.c:
* xfont.c:
* xftfont.c:
* xmenu.c:
* xselect.c:
* xterm.c: Likewise.

* ebrowse.c: Remove P_ and __P.
* etags.c:
* movemail.c:
* pop.c:
* update-game-score.c: Likewise.
2010-07-02 14:19:53 +02:00
Alan Mackenzie
eeff0f4859 Suppress spurious second invocation of before-change-functions 2010-01-19 13:16:01 +00:00
Glenn Morris
114f9c9679 Add 2010 to copyright years. 2010-01-13 00:35:10 -08:00
Chong Yidong
e398c61cb1 Fix bounds checking for text properties in `format' (Bug#5306).
* intervals.h, textprop.c (extend_property_ranges): Return value
and args changed.  Discard properties that begin at or after the
new end (Bug#5306).

* editfns.c (Fformat): Caller changed.
2010-01-09 17:32:47 -05:00
Alan Mackenzie
9c34521302 Fix spurious before-change-functions invocation from (insert ?\n).
textprop.c (set_text_properties): rename parameter
`signal_after_change_p' to `coherent_change_p', and make the invocation
of `modify_region' conditional on it.

------------- This line and the following will be ignored --------------

modified:
  src/ChangeLog
  src/textprop.c
unknown:
  Makefile
  config.log
  config.status
  doc/emacs/Makefile
  doc/lispintro/Makefile
  doc/lispref/Makefile
  doc/misc/Makefile
  etc/DOC-23.1.91.1
  leim/Makefile
  leim/changed.misc
  leim/changed.tit
  lib-src/Makefile
  lib-src/Makefile.c
  lib-src/b2m
  lib-src/ctags
  lib-src/digest-doc
  lib-src/ebrowse
  lib-src/emacsclient
  lib-src/etags
  lib-src/fakemail
  lib-src/hexl
  lib-src/make-docfile
  lib-src/movemail
  lib-src/profile
  lib-src/sorted-doc
  lib-src/test-distrib
  lib-src/update-game-score
  lisp/Makefile
  lwlib/Makefile
  oldXMenu/Makefile
  src/Makefile
  src/Makefile.c
  src/bootstrap-emacs
  src/deps/
  src/emacs
  src/emacs-23.1.91.1
  src/prefix-args
  src/stamp-oldxmenu
  src/temacs
2010-01-08 13:41:42 +00:00
Dan Nicolaescu
d67b4f80db * xterm.c (syms_of_xterm):
* xselect.c (syms_of_xselect):
* xmenu.c (syms_of_xmenu):
* xfns.c (syms_of_xfns):
* xfaces.c (syms_of_xfaces):
* xdisp.c (syms_of_xdisp):
* window.c (syms_of_window):
* w32fns.c (syms_of_w32fns):
* undo.c (syms_of_undo):
* textprop.c (syms_of_textprop):
* terminal.c (syms_of_terminal):
* syntax.c (syms_of_syntax):
* sound.c (syms_of_sound):
* search.c (syms_of_search):
* print.c (syms_of_print):
* minibuf.c (syms_of_minibuf):
* macros.c (syms_of_macros):
* keymap.c (syms_of_keymap, initial_define_key)
(initial_define_lispy_key):
* keyboard.c (syms_of_keyboard):
* insdel.c (syms_of_insdel):
* image.c (syms_of_image):
* fringe.c (syms_of_fringe):
* frame.c (syms_of_frame):
* fontset.c (syms_of_fontset):
* fns.c (syms_of_fns):
* fns.c (syms_of_fns):
* fileio.c (syms_of_fileio):
* fileio.c (syms_of_fileio):
* eval.c (syms_of_eval):
* doc.c (syms_of_doc):
* dispnew.c (syms_of_display):
* dired.c (syms_of_dired):
* dbusbind.c (syms_of_dbusbind):
* data.c (syms_of_data):
* composite.c (syms_of_composite):
* coding.c (syms_of_coding):
* cmds.c (syms_of_cmds):
* charset.c (define_charset_internal, syms_of_character):
* ccl.c (syms_of_ccl):
* category.c (syms_of_category, init_category_once):
* casetab.c (syms_of_casetab):
* casefiddle.c (syms_of_casefiddle):
* callint.c (syms_of_callint):
* bytecode.c (syms_of_bytecode):
* buffer.c (keys_of_buffer, syms_of_buffer):
* alloc.c (syms_of_alloc):
* process.c (syms_of_process, init_process):
* lread.c (syms_of_lread, init_obarray):
* font.c (build_style_table):
* emacs.c (syms_of_emacs, main): Replace calls to intern with
intern_c_string, calls to make_pure_string with
make_pure_c_string.  Use pure_cons instead of Fcons.

* process.c (socket_options): Make it const.
(set_socket_option, init_process): Use a const pointer.

* lread.c (intern_c_string): New function.
(defvar_kboard, defvar_lisp, defvar_lisp_nopro, defvar_bool)
(defvar_int): Uset it.  Make the name const char*.

* font.c (struct table_entry): Remove unused member.  Make NAMES
constant.
(weight_table, slant_table, width_table): Make constant.

* emacs.c (struct standard_args): Make name and longname constant.
2009-11-06 06:50:52 +00:00