1. 09 Sep, 2015 1 commit
    • Stefan Monnier's avatar
      Make syntax.c call syntax-propertize on demand · ab21f61a
      Stefan Monnier authored
      * lisp/emacs-lisp/syntax.el (syntax--jit-propertize): New function.
      (parse-sexp-propertize-function): Use it.
      (syntax-propertize): Disable parse-sexp-propertize-function.
      
      * src/syntax.c (parse_sexp_propertize, update_syntax_table_forward):
      New functions.
      (syms_of_syntax): New vars `parse-sexp-propertize-done' and
      `parse-sexp-propertize-function'.
      
      * src/syntax.h (struct gl_state_s): Add `e_property_truncated' field.
      (UPDATE_SYNTAX_TABLE_FORWARD): Use update_syntax_table_forward.
      (SETUP_BUFFER_SYNTAX_TABLE): Set e_property_truncated.
      
      * lisp/progmodes/elisp-mode.el (elisp-byte-code-syntax-propertize):
      Don't assume `point' is set.
      ab21f61a
  2. 29 Aug, 2015 1 commit
    • Paul Eggert's avatar
      Fix minor text quoting problems in lisp top level · ff441d35
      Paul Eggert authored
      * lisp/apropos.el (apropos-describe-plist):
      * lisp/cus-theme.el (customize-themes):
      * lisp/dired.el (dired-log):
      * lisp/help-fns.el (describe-variable):
      * lisp/hexl.el (hexl-insert-multibyte-char):
      * lisp/info.el (Info-finder-find-node):
      * lisp/json.el (json-read-string):
      * lisp/novice.el (disabled-command-function)
      (disabled-command-function):
      * lisp/startup.el (normal-mouse-startup-screen):
      * lisp/woman.el (WoMan-log, WoMan-warn):
      Respect text quoting style in doc string or diagnostic.
      * lisp/replace.el (replace-character-fold):
      * src/syntax.c (Fmodify_syntax_entry):
      Escape an apostrophe in a docstring.
      * lisp/tempo.el (tempo-define-template):
      Remove confusing apostrophe from docstring.
      * lisp/whitespace.el (whitespace-mark-x):
      Use directed quotes in docstring.
      ff441d35
  3. 23 Aug, 2015 2 commits
  4. 19 Aug, 2015 1 commit
    • Paul Eggert's avatar
      Use new q ‘format’ flag when fixing quotes in C · 87fbe1a6
      Paul Eggert authored
      * src/image.c (image_size_error): New function.  All uses of
      image_error with "Invalid image size ..."  changed to use it.
      * src/image.c (image_size_error, xbm_load_image, xbm_load)
      (xpm_load, xpm_load_image, xpm_load, pbm_load, png_load_body)
      (jpeg_load_body, tiff_load, gif_load, imagemagick_load_image)
      (imagemagick_load, svg_load, svg_load_image, gs_load)
      (x_kill_gs_process):
      * src/lread.c (load_warn_old_style_backquotes):
      * src/xfaces.c (load_pixmap):
      * src/xselect.c (x_clipboard_manager_error_1):
      Use %qs, not uLSQM and uRSQM.
      * src/syntax.c (Finternal_describe_syntax_value):
      Prefer Fsubstitute_command_keys to Fformat, as this lets
      us use AUTO_STRING.
      * src/xdisp.c (vadd_to_log): Use AUTO_STRING on the format argument,
      as it's now guaranteed to be ASCII.
      * src/xselect.c (x_clipboard_manager_error_2):
      Avoid grave accent in low-level stderr diagnostic.
      87fbe1a6
  5. 14 Aug, 2015 1 commit
    • Paul Eggert's avatar
      Prefer ‘format’ to ‘substitute-command-keys’ · 6af5aad2
      Paul Eggert authored
      * src/character.h (uLSQM, uRSQM): Move here ...
      * src/doc.c (uLSQM, uRSQM): ... from here.
      * src/doc.c (Fsubstitute_command_keys):
      * src/syntax.c (Finternal_describe_syntax_value):
      * lisp/cedet/mode-local.el (mode-local-print-binding)
      (mode-local-describe-bindings-2):
      * lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
      * lisp/cus-theme.el (describe-theme-1):
      * lisp/descr-text.el (describe-text-properties-1, describe-char):
      * lisp/emacs-lisp/cl-extra.el (cl--describe-class):
      * lisp/emacs-lisp/cl-generic.el (cl--generic-describe):
      * lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor):
      * lisp/emacs-lisp/package.el (describe-package-1):
      * lisp/faces.el (describe-face):
      * lisp/help-fns.el (help-fns--key-bindings)
      (help-fns--compiler-macro, help-fns--parent-mode)
      (help-fns--obsolete, help-fns--interactive-only)
      (describe-function-1, describe-variable):
      * lisp/help.el (describe-mode):
      Prefer ‘format’ to ‘substitute-command-keys’ when either will do
      to implement quoting style.  This generally makes the code simpler.
      6af5aad2
  6. 09 Aug, 2015 1 commit
    • Paul Eggert's avatar
      Fix some minor quoting issues with grave accent · 6a45e720
      Paul Eggert authored
      * src/dispnew.c (add_window_display_history) [GLYPH_DEBUG]:
      Remove redundant quotes.
      * src/doc.c (uLSQM, uRSQM): New macros.
      * src/doc.c (Fsubstitute_command_keys):
      * src/syntax.c (Finternal_describe_syntax_value): Follow the user
      preference for quotes rather than hardcoding the ‘grave’ style.
      * src/regex.c (PUSH_FAILURE_POINT, POP_FAILURE_POINT)
      (re_match_2_internal) [DEBUG]: In debugging output, quote C
      strings with "...", not `...'.
      6a45e720
  7. 11 Jun, 2015 1 commit
  8. 29 Apr, 2015 1 commit
  9. 05 Jan, 2015 1 commit
    • Paul Eggert's avatar
      Compute C decls for DEFSYMs automatically · 58f2d6ef
      Paul Eggert authored
      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.
      58f2d6ef
  10. 01 Jan, 2015 2 commits
  11. 06 Nov, 2014 1 commit
  12. 07 Sep, 2014 1 commit
    • Paul Eggert's avatar
      Use SAFE_ALLOCA etc. to avoid unbounded stack allocation. · b3bf18b3
      Paul Eggert authored
      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
      b3bf18b3
  13. 04 Sep, 2014 1 commit
  14. 28 Aug, 2014 1 commit
  15. 27 Aug, 2014 1 commit
  16. 09 Jul, 2014 1 commit
  17. 05 Jul, 2014 1 commit
  18. 08 Feb, 2014 1 commit
  19. 05 Feb, 2014 1 commit
    • Bastien Guerry's avatar
      Fix bug #16453. · bfdd79d3
      Bastien Guerry authored
      * syntax.c (Fforward_word): Call Fconstrain_to_field with
      ESCAPE-FROM-EDGE set to `nil' (Bug#16453).
      bfdd79d3
  20. 01 Jan, 2014 1 commit
  21. 22 Sep, 2013 1 commit
    • Paul Eggert's avatar
      Fix syntax.h bug introduced by recent INLINE change. · c6cfd910
      Paul Eggert authored
      syntax.h defined an extern inline function SYNTAX_ENTRY that was
      conditionally compiled one way in some modules, and a different
      way in others.  This doesn't work with extern inline functions,
      which must have the same definition in all modules, because the
      defining code might be shared across modules, depending on the
      implementation.  Symptoms reported by Martin Rudalics in:
      http://lists.gnu.org/archive/html/emacs-devel/2013-09/msg00414.html
      * regex.c, syntax.c (SYNTAX_ENTRY_VIA_PROPERTY): Remove.
      (SYNTAX, SYNTAX_ENTRY, SYNTAX_WITH_FLAGS): New macros,
      overriding the corresponding functions in syntax.h.
      * syntax.h (syntax_property_entry, syntax_property_with_flags)
      (syntax_property): New inline functions.
      (SYNTAX_ENTRY, SYNTAX_WITH_FLAGS, SYNTAX):
      Rewrite in terms of these new functions.
      c6cfd910
  22. 20 Sep, 2013 1 commit
    • Paul Eggert's avatar
      A simpler, centralized INLINE. · 00382e8b
      Paul Eggert authored
      * lib-src/profile.c (INLINE): New macro.
      (SYSTIME_INLINE): Remove.
      * src/conf_post.h (INLINE): Define only if not already defined.
      This allows us to use a single INLINE, defined by one file
      per executable.
      * src/emacs.c (INLINE): Define it.
      Also, include category.h, charset.h, composite.h, dispextern.h,
      syntax.h, systime.h, so that their INLINE definitions are expanded
      properly for Emacs.
      * src/blockinput.h, src/keyboard.c (BLOCKINPUT_INLINE):
      * src/buffer.h, src/buffer.c (BUFFER_INLINE):
      * src/category.h, src/category.c (CATEGORY_INLINE):
      * src/character.h, src/character.c (CHARACTER_INLINE):
      * src/charset.h, src/charset.c (CHARSET_INLINE):
      * src/composite.h, src/composite.c (COMPOSITE_INLINE):
      * src/dispextern.h, src/dispnew.c (DISPEXTERN_INLINE):
      * src/frame.h, src/frame.c (FRAME_INLINE):
      * src/intervals.h, src/intervals.c (INTERVALS_INLINE):
      * src/keyboard.h, src/keyboard.c (KEYBOARD_INLINE):
      * src/lisp.h, src/alloc.c (LISP_INLINE):
      * src/process.h, src/process.c (PROCESS_INLINE):
      * src/syntax.h, src/syntax.c (SYNTAX_INLINE):
      * src/systime.h, src/sysdep.c (SYSTIME_INLINE):
      * src/termhooks.h, src/terminal.h (TERMHOOKS_INLINE):
      * src/window.h, src/window.c (WINDOW_INLINE):
      Remove.  All uses replaced with INLINE.
      00382e8b
  23. 26 Aug, 2013 1 commit
  24. 13 Aug, 2013 1 commit
    • Xue Fuqiao's avatar
      Doc fix for forward-word and backward-word. · f73f4ce6
      Xue Fuqiao authored
      * doc/lispref/positions.texi (Word Motion): Remove redundant sentence.
      * lisp/simple.el (backward-word): Mention the optional argument.
      * src/syntax.c (forward_word): Mention the optional argument.
      f73f4ce6
  25. 10 Jul, 2013 1 commit
    • Paul Eggert's avatar
      Syntax cleanup, mostly replacing macros with functions. · 45b683a1
      Paul Eggert authored
      This removes the need for the syntax_temp hack.
      * search.c: Include syntax.h after buffer.h, since syntax.h uses BVAR.
      * syntax.c (SYNTAX_INLINE): New macro.
      (SYNTAX_FLAGS_COMSTART_FIRST, SYNTAX_FLAGS_COMSTART_SECOND)
      (SYNTAX_FLAGS_COMEND_FIRST, SYNTAX_FLAGS_COMEND_SECOND)
      (SYNTAX_FLAGS_PREFIX, SYNTAX_FLAGS_COMMENT_STYLEB)
      (SYNTAX_FLAGS_COMMENT_STYLEC, SYNTAX_FLAGS_COMMENT_STYLEC2)
      (SYNTAX_FLAGS_COMMENT_NESTED, SYNTAX_FLAGS_COMMENT_STYLE)
      (SYNTAX_COMEND_FIRST): Now functions, not macros.
      (ST_COMMENT_STYLE, ST_STRING_STYLE, INTERVALS_AT_ONCE):
      Now constants, not macros.
      (syntax_temp) [!__GNUC__]: Remove.
      (SYNTAX_PREFIX): Remove; all uses replaced by syntax_prefix_flag_p.
      (syntax_prefix_flag_p): Move implementation of SYNTAX_PREFIX here.
      (SET_RAW_SYNTAX_ENTRY, SET_RAW_SYNTAX_ENTRY_RANGE, SYNTAX_MATCH)
      (SETUP_SYNTAX_TABLE, SETUP_SYNTAX_TABLE_FOR_OBJECT):
      Move here from syntax.h; now functions, not macros.  Except for the
      last function, these are static since only syntax.c uses them.
      (syntax_multibyte): Rename from SYNTAX_WITH_MULTIBYTE_CHECK.
      All uses changed.  Now a function, not a macro; use this fact
      to simplify the code.
      (scan_lists, scan_sexps_forward): Remove workarounds for ancient
      compiler bugs; no longer relevant.
      * syntax.h: Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
      (SYNTAX_INLINE): New macro.
      (struct gl_state_s, gl_state): Move earlier, so that it's in scope
      for the new functions.  Use bool for boolean member.
      (SYNTAX_ENTRY, SYNTAX, SYNTAX_WITH_FLAGS, SYNTAX_MATCH)
      (SYNTAX_TABLE_BYTE_TO_CHAR, UPDATE_SYNTAX_TABLE_FORWARD)
      (UPDATE_SYNTAX_TABLE_BACKWARD, UPDATE_SYNTAX_TABLE)
      (SETUP_BUFFER_SYNTAX_TABLE):
      Now extern inline functions, not macros.
      (CURRENT_SYNTAX_TABLE, SYNTAX_ENTRY_INT):
      Remove; all uses replaced by implementation.
      (syntax_temp) [!__GNUC__]: Remove decl.
      (SETUP_SYNTAX_TABLE_FOR_OBJECT): New decl.
      45b683a1
  26. 20 Jun, 2013 1 commit
    • Paul Eggert's avatar
      * syntax.c: Integer cleanups. · 1fc71008
      Paul Eggert authored
      (SYNTAX_FLAGS_COMMENT_STYLEC): Return a boolean, not 0-or-2.
      All uses that need 0-or-2 changed to:
      (SYNTAX_FLAGS_COMMENT_STYLEC2): New macro, with the same semantics
      as the old SYNTAX_FLAGS_COMMENT_STYLEC.
      (struct lisp_parse_state, syntax_prefix_flag_p, update_syntax_table)
      (char_quoted, prev_char_comend_first, back_comment)
      (Finternal_describe_syntax_value, skip_chars, skip_syntaxes)
      (in_classes, forw_comment, scan_lists, scan_sexps_forward):
      Use bool for boolean.
      (update_syntax_table, skip_chars, skip_syntaxes):
      Prefer int to unsigned when either will do.
      (back_comment): Return boolean success flag, like forw_comment,
      instead of positive-or-minus-1 (which might have overflowed int anyway).
      Don't stuff ptrdiff_t into int.
      (syntax_spec_code, syntax_code_spec): Now const.
      (Fmatching_paren, scan_lists, scan_sexps_forward):
      Use enum syntaxcode for syntax code.
      (Fmatching_paren): Check that arg is a character, not just an integer.
      (Fstring_to_syntax): Don't assume 0377 fits in enum syntaxcode.
      (Finternal_describe_syntax_value): Omit no-longer-needed
      comparison to 0.
      (skip_chars): Use char, not unsigned char, when the distinction
      doesn't matter.
      (forw_comment, scan_lists): Prefer A |= B to A = A || B when B's cheap.
      * bytecode.c (exec_byte_code):
      * syntax.c (syntax_spec_code, Fchar_syntax)
      (Finternal_describe_syntax_value, skip_chars, skip_syntaxes)
      (init_syntax_once):
      * syntax.h (SYNTAX_WITH_FLAGS):
      Omit unnecessary casts.
      1fc71008
  27. 19 Jun, 2013 1 commit
  28. 10 Feb, 2013 1 commit
  29. 08 Feb, 2013 2 commits
    • Dmitry Antipov's avatar
      * search.c (scan_buffer): Calculate end byte position just once. · 8ca30920
      Dmitry Antipov authored
      (scan_newline): Do not recalculate start_byte.
      (search_command): Use eassert.
      * syntax.c (struct lisp_parse_state): New member location_byte.
      (scan_sexps_forward): Record from_byte and avoid redundant
      character to byte position calculation ...
      (Fparse_partial_sexp): ... here.  Break too long line.
      8ca30920
    • Dmitry Antipov's avatar
      * lisp.h (make_uninit_vector): New function. · 25721f5b
      Dmitry Antipov authored
      * alloc.c (Fvector, Fmake_byte_code):
      * ccl.c (Fregister_ccl_program):
      * charset.c (Fdefine_charset_internal, define_charset_internal):
      * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
      * composite.c (syms_of_composite):
      * font.c (Fquery_font, Ffont_info, syms_of_font):
      * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
      * ftfont.c (ftfont_shape_by_flt):
      * indent.c (recompute_width_table):
      * nsselect.m (clean_local_selection_data):
      * syntax.c (init_syntax_once):
      * w32unsubscribe.c (uniscribe_shape):
      * window.c (Fcurrent_window_configuration):
      * xfaces.c (Fx_family_fonts):
      * xselect.c (selection_data_to_lisp_data): Use it.
      25721f5b
  30. 01 Jan, 2013 1 commit
  31. 01 Oct, 2012 1 commit
    • Paul Eggert's avatar
      Prefer plain 'static' to 'static inline'. · b0ab8123
      Paul Eggert authored
      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
      b0ab8123
  32. 15 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Port better to POSIX hosts lacking _setjmp. · 0328b6de
      Paul Eggert authored
      * 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
      0328b6de
  33. 08 Sep, 2012 1 commit
    • Chong Yidong's avatar
      Introduce "raw syntax descriptor" terminology, and use it. · 6dcef6ec
      Chong Yidong authored
      * syntax.texi (Syntax Table Internals): Define "raw syntax
      descriptor" terminology.
      (Syntax Descriptors): Mention raw syntax descriptors.
      
      * lisp/subr.el (syntax-after, syntax-class): Doc fix.
      
      * syntax.c (Fstring_to_syntax): Doc fix.
      
      Fixes: debbugs:12383
      6dcef6ec
  34. 18 Aug, 2012 1 commit
    • Paul Eggert's avatar
      * buffer.h (BSET): Remove. · 39eb03f1
      Paul Eggert authored
      Replace all uses with calls to new setter functions.
      (bset_bidi_paragraph_direction, bset_case_canon_table)
      (bset_case_eqv_table, bset_directory, bset_display_count)
      (bset_display_time, bset_downcase_table)
      (bset_enable_multibyte_characters, bset_filename, bset_keymap)
      (bset_last_selected_window, bset_local_var_alist)
      (bset_mark_active, bset_point_before_scroll, bset_read_only)
      (bset_truncate_lines, bset_undo_list, bset_upcase_table)
      (bset_width_table):
      * 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):
      * category.c (bset_category_table):
      * syntax.c (bset_syntax_table):
      New setter functions.
      
      Fixes: debbugs:12215
      39eb03f1
  35. 17 Aug, 2012 1 commit
    • Paul Eggert's avatar
      * lisp.h (CSET): Remove. · 742af32f
      Paul Eggert authored
      (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
      (set_char_table_purpose): New functions,
      replacing CSET.  All uses changed.  For example, replace
      "CSET (XCHAR_TABLE (char_table), parent, parent);" with
      "char_table_set_parent (char_table, parent);".
      The old version was confusing because it used the same name
      'parent' for two different things.
      
      Fixes: debbugs:12215
      742af32f
  36. 16 Aug, 2012 2 commits
    • Paul Eggert's avatar
      Use ASCII tests for character types. · 620f13b0
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add c-ctype.
      * lwlib/lwlib-Xaw.c, lwlib/lwlib.c, lwlib/xlwmenu.c:
      Don't include <ctype.h>; no longer needed.
      * lwlib/lwlib-Xaw.c (openFont):
      * lwlib/xlwmenu.c (openXftFont): Test just for ASCII digits.
      * src/category.c, src/dispnew.c, src/doprnt.c, src/editfns.c, src/syntax.c
      * src/term.c, src/xfns.c, src/xterm.c:
      Don't include <ctype.h>; was not needed.
      * src/charset.c, src/doc.c, src/fileio.c, src/font.c, src/frame.c:
      * src/gtkutil.c, src/image.c, src/sysdep.c, src/xfaces.c:
      Include <c-ctype.h> instead of <ctype.h>.
      * src/nsterm.m: Include <c-ctype.h>.
      * src/charset.c (read_hex):
      * src/doc.c (Fsnarf_documentation):
      * src/fileio.c (IS_DRIVE) [WINDOWSNT]:
      (DRIVE_LETTER) [DOS_NT]:
      (Ffile_name_directory, Fexpand_file_name)
      (Fsubstitute_in_file_name):
      * src/font.c (font_parse_xlfd, font_parse_fcname):
      * src/frame.c (x_set_font_backend):
      * src/gtkutil.c (xg_get_font):
      * src/image.c (xbm_scan, xpm_scan, pbm_scan_number):
      * src/nsimage.m (hexchar):
      * src/nsterm.m (ns_xlfd_to_fontname):
      * src/sysdep.c (system_process_attributes):
      * src/xfaces.c (hash_string_case_insensitive):
      Use C-locale tests instead of locale-specific tests for character
      types, since we want the ASCII interpretation here, not the
      interpretation suitable for whatever happens to be the current locale.
      620f13b0
    • Dmitry Antipov's avatar
      Simple interface to set Lisp_Object fields of chararcter tables. · a098c930
      Dmitry Antipov authored
      * lisp.h (CSET): New macro.
      (char_table_set_extras, char_table_set_contents)
      (sub_char_table_set_contents): New function.
      * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
      * syntax.c: Adjust users.
      a098c930