summaryrefslogtreecommitdiff
path: root/src/search.c
Commit message (Collapse)AuthorAgeFilesLines
...
* | Use shortcuts for FlengthPaul Eggert2019-01-091-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calculating the length of a Lisp object whose type is known, use a specialized length operation on it to save a bit of runtime overhead. * src/callint.c (Fcall_interactively): * src/minibuf.c (read_minibuf_unwind): Use ASIZE rather than Flength on values that must be vectors. * src/charset.c (Fsort_charsets): * src/coding.c (detect_coding_sjis): (Fdefine_coding_system_internal): * src/data.c (wrong_choice): * src/eval.c (Flet, eval_sub, Fapply, apply_lambda): * src/fns.c (sort_list): * src/font.c (font_vconcat_entity_vectors) (font_find_for_lface): * src/frame.c (Fmodify_frame_parameters): * src/fringe.c (get_logical_fringe_bitmap): * src/ftfont.c (ftfont_get_open_type_spec): * src/gtkutil.c (xg_print_frames_dialog): * src/lread.c (read1, read_vector): * src/keymap.c (Fkey_description): * src/kqueue.c (Fkqueue_add_watch): * src/macfont.m (macfont_get_open_type_spec): * src/menu.c (parse_single_submenu, x_popup_menu_1): * src/minibuf.c (Finternal_complete_buffer): * src/nsfont.m (ns_findfonts, nsfont_list_family): * src/process.c (Fmake_process): * src/search.c (Fset_match_data): * src/xfaces.c (Fx_family_fonts): Use list_length rather than Flength on values that must be lists. * src/fns.c (list_length): New function. (Flength): Use it. * src/nsfont.m (ns_findfonts): Use !NILP (x) rather than XFIXNUM (Flength (x)) != 0. * src/xdisp.c (store_mode_line_string): Use SCHARS rather than Flength on values that must be strings.
* | Merge from origin/emacs-26Paul Eggert2018-12-311-1/+1
|\| | | | | | | | | | | 2fcf2df Fix copyright years by hand 26bed8b Update copyright year to 2019 2814292 Fix value of default frame height. (Bug#33921)
| * Update copyright year to 2019Paul Eggert2019-01-011-1/+1
| | | | | | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* | Merge remote-tracking branch 'origin/master' into feature/bignumTom Tromey2018-08-091-18/+18
|\ \
| * | Simplify regex-emacs by assuming Emacs syntaxPaul Eggert2018-08-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/regex-emacs.c (reg_syntax_t) (RE_BACKSLASH_ESCAPE_IN_LISTS, RE_BK_PLUS_QM) (RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS) (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS) (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE) (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT) (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS) (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES) (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING) (RE_NO_GNU_OPS, RE_FRUGAL, RE_SHY_GROUPS) (RE_NO_NEWLINE_ANCHOR, RE_SYNTAX_EMACS, RE_TRANSLATE_P): Remove. All uses removed and resulting code simplified. (TRANSLATE): Treat nil as an absent translation table, not zero. All uses changed.
| * | Simplify regex-emacs code by assuming EmacsPaul Eggert2018-08-051-12/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/regex-emacs.c: Omit no-longer-needed AIX code. Don’t ignore GCC warnings. Include regex-emacs.h immediately after config.h, to test that it’s independent. Omit the "#ifndef emacs" and "#ifdef REGEX_MALLOC" and "#if WIDE_CHAR_SUPPORT" or "#ifdef _REGEX_RE_COMP", code, as we are no longer interested in compiling outside Emacs (with or without debugging or native wide char support) or in avoiding alloca. (REGEX_EMACS_DEBUG, regex_emacs_debug): Rename from DEBUG and debug, to avoid collision with other DEBUGS. All uses changed. In debugging output, change %ld and %zd to %zu when appropriate. No need to include stddef.h, stdlib.h, sys/types.h, wchar.h, wctype.h, locale/localeinfo.h, locale/elem-hash.h, langinfo.h, libintl.h, unistd.h, stdbool.h, string.h, stdio.h, assert.h. All uses of assert changed to eassert. (RE_DUP_MAX, reg_syntax_t, RE_BACKSLASH_ESCAPE_IN_LISTS) (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS) (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS, RE_DOT_NEWLINE) (RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE, RE_INTERVALS) (RE_LIMITED_OPS, RE_NEWLINE_ALT, RE_NO_BK_BRACES) (RE_NO_BK_PARENS, RE_NO_BK_REFS, RE_NO_BK_VBAR) (RE_NO_EMPTY_RANGES, RE_UNMATCHED_RIGHT_PAREN_ORD) (RE_NO_POSIX_BACKTRACKING, RE_NO_GNU_OPS, RE_FRUGAL) (RE_SHY_GROUPS, RE_NO_NEWLINE_ANCHOR, RE_SYNTAX_EMACS) (REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE) (REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN) (REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT) (REG_EEND, REG_ESIZE, REG_ERPAREN, REG_ERANGEX, REG_ESIZEBR) (reg_errcode_t, REGS_UNALLOCATED, REGS_REALLOCATE, REGS_FIXED) (RE_NREGS, RE_TRANSLATE, RE_TRANSLATE_P): Move here from regex-emacs.h. (RE_NREGS): Define unconditionally. (boolean): Remove. All uses replaced by bool. (WIDE_CHAR_SUPPORT, regfree, regexec, regcomp, regerror): (re_set_syntax, re_syntax_options, WEAK_ALIAS, gettext, gettext_noop): Remove. All uses removed. (malloc, realloc, free): Do not redefine. Adjust all callers to use xmalloc, xrealloc, xfree instead. (re_error_msgid): Use C99 to avoid need to keep in same order as reg_error_t. (REGEX_USE_SAFE_ALLOCA): Simplify by using USE_SAFE_ALLOCA. (REGEX_ALLOCATE, REGEX_REALLOCATE, REGEX_FREE, REGEX_ALLOCATE_STACK) (REGEX_REALLOCATE_STACK, REGEX_FREE_STACK): Remove. All callers changed to use the non-REGEX_MALLOC version. (REGEX_TALLOC): Remove. All callers changed to use SAFE_ALLOCA. (re_set_syntax): Remove; unused. (MATCH_MAY_ALLOCATE): Remove; now always true. All uses simplified. (INIT_FAILURE_ALLOC): Define unconditionally. (re_compile_fastmap): Now static. (re_compile_pattern): Avoid unnecessary cast. * src/regex-emacs.h (EMACS_REGEX_H): Renamed from _REGEX_H to avoid possible collision with glibc. Don’t include sys/types.h. All uses of ssize_t changed to ptrdiff_t. Don’t worry about C++ or VMS. Assume emacs is defined and that _REGEX_RE_COMP and WIDE_CHAR_SUPPORT are not. Define struct re_registers before including lisp.h. (REG_ENOSYS, RE_TRANSLATE_TYPE): Remove; all uses replaced by Lisp_Object. (regoff_t): Remove. All uses replaced with ptrdiff_t. (re_match, regcomp, regexec, regerror, regfree): Remove decl of nonexistent functions. (RE_DEBUG, RE_SYNTAX_AWK, RE_SYNTAX_GNU_AWK) (RE_SYNTAX_POSIX_AWK, RE_SYNTAX_GREP, RE_SYNTAX_EGREP) (RE_SYNTAX_POSIX_EGREP, RE_SYNTAX_ED, RE_SYNTAX_SED) (_RE_SYNTAX_POSIX_COMMON, RE_SYNTAX_POSIX_BASIC) (RE_SYNTAX_POSIX_MINIMAL_BASIC, RE_SYNTAX_POSIX_EXTENDED) (RE_SYNTAX_POSIX_MINIMAL_EXTENDED, REG_EXTENDED, REG_ICASE) (REG_NEWLINE, REG_NOSUB, REG_NOTBOL, REG_NOTEOL, regmatch_t): Remove; unused. * src/search.c (Fset_match_data): Simplify range test now that we know it’s ptrdiff_t.
| * | Rename src/regex.c to src/regex-emacs.c.Paul Eggert2018-08-051-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | This is in preparation for using Gnulib regex for etags, to avoid collisions in include directives. * src/regex-emacs.c: Rename from src/regex.c. * src/regex-emacs.h: Rename from src/regex.h. All uses changed. * test/src/regex-emacs-tests.el: Rename from test/src/regex-tests.el.
* | | More macro renamings for bignumTom Tromey2018-08-071-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/alloc.c, src/bidi.c, src/buffer.c, src/buffer.h, 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/character.h, src/charset.c, src/charset.h, src/chartab.c, src/cmds.c, src/coding.c, src/composite.c, src/composite.h, src/data.c, src/dbusbind.c, src/decompress.c, src/dired.c, src/dispextern.h, src/dispnew.c, src/disptab.h, src/doc.c, src/dosfns.c, src/editfns.c, src/emacs-module.c, src/emacs.c, src/eval.c, src/fileio.c, src/floatfns.c, src/fns.c, src/font.c, src/font.h, src/fontset.c, src/frame.c, src/frame.h, src/fringe.c, src/ftcrfont.c, src/ftfont.c, src/gfilenotify.c, src/gnutls.c, src/gtkutil.c, src/image.c, src/indent.c, src/insdel.c, src/intervals.c, src/json.c, src/keyboard.c, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c, src/sound.c, src/syntax.c, src/syntax.h, src/sysdep.c, src/term.c, src/termhooks.h, src/textprop.c, src/undo.c, src/w32.c, src/w32console.c, src/w32fns.c, src/w32font.c, src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c, src/w32term.h, src/w32uniscribe.c, src/window.c, src/xdisp.c, src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xml.c, src/xrdb.c, src/xselect.c, src/xsettings.c, src/xterm.c, src/xwidget.c Rename XINT->XFIXNUM, XFASTINT->XFIXNAT, XUINT->XUFIXNUM.
* | | Rename integerp->fixnum, etc, in preparation for bignumsTom Tromey2018-07-121-35/+35
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/json.c, src/keyboard.c, src/keyboard.h, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c, src/sound.c, src/syntax.c, src/sysdep.c, src/term.c, src/terminal.c, src/textprop.c, src/undo.c, src/w16select.c, src/w32.c, src/w32console.c, src/w32cygwinx.c, src/w32fns.c, src/w32font.c, src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c, src/w32uniscribe.c, src/widget.c, src/window.c, src/xdisp.c, src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xrdb.c, src/xselect.c, src/xterm.c, src/xwidget.c: Rename INTEGERP->FIXNUM, make_number->make_fixnum, CHECK_NUMBER->CHECK_FIXNUM, make_natnum->make_fixed_natum, NUMBERP->FIXED_OR_FLOATP, NATNUMP->FIXNATP, CHECK_NATNUM->CHECK_FIXNAT.
* | Make regex matching reentrant; update syntax during matchDaniel Colascione2018-06-161-378/+417
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/lisp.h (compile_pattern): Remove prototype of now-internal function. * src/regex.c (POS_AS_IN_BUFFER): Consult gl_state instead of re_match_object: the latter can change in Lisp. (re_match_2_internal): Switch back to UPDATE_SYNTAX_* FROM UPDATE_SYNTAX_FAST*, allowing calls into Lisp. * src/regex.h (re_match_object): Uncomment declaration. * src/search.c (struct regexp_cache): Add `busy' field. (thaw_buffer_relocation): Delete; rely on unbind. (compile_pattern_1): Assert pattern isn't busy. (shrink_regexp_cache): Don't shrink busy patterns. (clear_regexp_cache): Don't nuke busy patterns. (unfreeze_pattern, freeze_pattern): New functions. (compile_pattern): Return a regexp_cache pointer instead of the re_pattern_buffer, allowing callers to use `freeze_pattern' if needed. Do not consider busy patterns as cache hit candidates; error if we run out of non-busy cache entries. (looking_at_1, fast_looking_at): Snapshot Vinhibit_changing_match_data; mark pattern busy while we're matching it; unbind. (string_match_1, fast_string_match_internal) (fast_c_string_match_ignore_case): Adjust for compile_pattern return type. (search_buffer_re): Regex code from old search_buffer moved here; snapshot Vinhibit_changing_match_data; mark pattern busy while we're matching it; unbind. (search_buffer_non_re): Non-regex code from old search_buffer moved here. (search_buffer): Split into search_buffer_re, search_buffer_non_re. (syms_of_search): Staticpro re_match_object, even though we really shouldn't have to. * src/syntax.h (UPDATE_SYNTAX_TABLE_FORWARD_FAST): (UPDATE_SYNTAX_TABLE_FAST): Remove. * src/thread.h (struct thread_state): Remove m_re_match_object, which is global again. (It never needs to be preserved across thread switch.)
* | Remove commented-out code in compile_pattern_1Daniel Colascione2018-06-161-7/+0
|/ | | | * src/search.c (compile_pattern_1): Remove commented-out code.
* Note caveat for backward regexp searching in docstring (Bug#31584)Noam Postavsky2018-05-251-1/+4
| | | | | | | * src/search.c (Fre_search_backward): Emphasize that backwards searches may give shorter than expected matches. * doc/lispref/searching.texi (Regexp Search): Add an anchor for re-search-backward to reference.
* Update copyright year to 2018Paul Eggert2018-01-011-1/+1
| | | | Run admin/update-copyright.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-131-1/+1
| | | | | | | | | | | | | Most of this change is to boilerplate commentary such as license URLs. This change was prompted by ftp://ftp.gnu.org's going-away party, planned for November. Change these FTP URLs to https://ftp.gnu.org instead. Make similar changes for URLs to other organizations moving away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and fsf.org when this works, as this will further help defend against man-in-the-middle attacks (for this part I omitted the MS-DOS and MS-Windows sources and the test tarballs to keep the workload down). HTTPS is not fully working to lists.gnu.org so I left those URLs alone for now.
* Merge with gnulib, pacifying GCC 7Paul Eggert2017-05-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This incorporates: 2017-05-16 manywarnings: update for GCC 7 2017-05-15 sys_select: Avoid "was expanded before it was required" * configure.ac (nw): Suppress GCC 7’s new -Wduplicated-branches and -Wformat-overflow=2 options, due to too many false alarms. * doc/misc/texinfo.tex, lib/strftime.c, m4/manywarnings.m4: Copy from gnulib. * m4/gnulib-comp.m4: Regenerate. * src/coding.c (decode_coding_iso_2022): Fix bug uncovered by -Wimplicit-fallthrough. * src/conf_post.h (FALLTHROUGH): New macro. Use it to mark all switch cases that fall through. * src/editfns.c (styled_format): Use !, not ~, on bool. * src/gtkutil.c (xg_check_special_colors): When using sprintf, don’t trust Gtk to output colors in [0, 1] range. (xg_update_scrollbar_pos): Avoid use of possibly-uninitialized bool; this bug was actually caught by Clang. * src/search.c (boyer_moore): Tell GCC that CHAR_BASE, if nonzero, must be a non-ASCII character. * src/xterm.c (x_draw_glyphless_glyph_string_foreground): Tell GCC that glyph->u.glyphless.ch must be a character.
* Avoid compilation warningsEli Zaretskii2017-05-021-1/+1
| | | | | | | | | | * src/w32fns.c (Fx_file_dialog, w32_parse_and_hook_hot_key): * src/w32term.c (x_draw_glyph_string): * src/w32fns.c (compute_tip_xy): * src/w32font.c (w32font_text_extents): * src/w32menu.c (set_frame_menubar): * src/search.c (Freplace_match): Avoid compiler warnings in optimized builds.
* Merge from origin/emacs-25Glenn Morris2017-04-271-31/+21
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 784602b1050 (origin/emacs-25) ; Add release notice 3a34412caae (tag: emacs-25.2) Set Emacs version to 25.2 and update AU... 56a4461a48d ; Move stray item from admin/notes/repo to CONTRIBUTE 2b0d1118199 ; CONTRIBUTE: Remove stray header. f2ab09ec60d Fix a typo in indexing the user manual bc55a574235 * lisp/menu-bar.el (kill-this-buffer): Doc fix. (Bug#26466) a6d50401b4b Document 'line-pixel-height' 0c55cf43e61 * search.c (Fre_search_forward, Fre_search_backward): Imp... c7ed57eaef4 Mention that processes start in default-directory (Bug#18... 856ec9ffa1f * src/xdisp.c (vmessage, message): Clarify commentary. 849a0aaa1c9 Belated fixes for admin.el's M-x make-manuals-dist 84938d79698 default-directory: Remark that it must be a directory name 3f0d047d2eb Delete confuse statement in manual ee1bd94dd0c Improve packaging documentation fb18bff91f0 Expand manual section on quitting windows 9a737079645 Fix docstring of dabbrev-abbrev-char-regexp afe8849bac1 * doc/misc/cl.texi (Iteration Clauses): Clarify example (... ada79442c07 ;* doc/misc/info.texi (Choose menu subtopic): Improve ind... d38fd9229c0 Narrow scope of modification hook renabling in org-src fo... e0e9db4c84a ; Spelling fix # Conflicts: # README # etc/AUTHORS # etc/HISTORY # lisp/ldefs-boot.el
| * * search.c (Fre_search_forward, Fre_search_backward): Improve doc (Bug#25193).Hong Xu2017-04-061-31/+21
| |
* | Throw a `search-failed' derived error in Info searchNoam Postavsky2017-04-031-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | The original fix for Bug#6106 switched from signalling `search-failed' to `user-error'. However, this breaks incremental searching over multiple nodes because the isearch code doesn't expect a `user-error'. * src/search.c (syms_of_search): New error, `user-search-failed', with `user-error' and `search-failed' as parents. * doc/lispref/errors.texi (Standard Errors): Document it. * etc/NEWS: Announce it. * lisp/info.el (Info-search): Use it instead of `user-error' so that isearch will handle failed searches correctly.
* | Fix quitting bug when buffers are frozenPaul Eggert2017-02-011-30/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem noted by Eli Zaretskii in: http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00721.html This patch also fixes some other issues in that report. * src/lisp.h (incr_rarely_quit): Remove. All callers changed to use rarely_quit directly. * src/search.c (freeze_buffer_relocation) (thaw_buffer_relocation): New functions. (looking_at_1, fast_looking_at, search_buffer): Use them to fix bug when quitting when buffers are frozen. * src/sysdep.c (emacs_intr_read): Rename from emacs_nointr_read. All uses changed.
* | Revamp quitting and fix infloopsPaul Eggert2017-02-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes some infinite loops that cannot be quitted out of, e.g., (defun foo () (nth most-positive-fixnum '#1=(1 . #1#))) when byte-compiled and when run under X. See: http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00577.html This also attempts to keep the performance improvements I recently added, as much as possible under the constraint that the infloops must be caught. In some cases this fixes infloop bugs recently introduced when I removed immediate_quit. * src/alloc.c (Fmake_list): Use rarely_quit, not maybe_quit, for speed in the usual case. * src/bytecode.c (exec_byte_code): * src/editfns.c (Fcompare_buffer_substrings): * src/fns.c (Fnthcdr): * src/syntax.c (scan_words, skip_chars, skip_syntaxes) (Fbackward_prefix_chars): Use rarely_quit so that users can C-g out of long loops. * src/callproc.c (call_process_cleanup, call_process): * src/fileio.c (read_non_regular, Finsert_file_contents): * src/indent.c (compute_motion): * src/syntax.c (scan_words, Fforward_comment): Remove now-unnecessary maybe_quit calls. * src/callproc.c (call_process): * src/doc.c (get_doc_string, Fsnarf_documentation): * src/fileio.c (Fcopy_file, read_non_regular, Finsert_file_contents): * src/lread.c (safe_to_load_version): * src/sysdep.c (system_process_attributes) [GNU_LINUX]: Use emacs_read_quit instead of emacs_read in places where C-g handling is safe. * src/eval.c (maybe_quit): Move comment here from lisp.h. * src/fileio.c (Fcopy_file, e_write): Use emacs_write_quit instead of emacs_write_sig in places where C-g handling is safe. * src/filelock.c (create_lock_file): Use emacs_write, not plain write, as emacs_write no longer has a problem. (read_lock_data): Use emacs_read, not read, as emacs_read no longer has a problem. * src/fns.c (rarely_quit): Move to lisp.h and rename to incr_rarely_quit. All uses changed.. * src/fns.c (Fmemq, Fmemql, Fassq, Frassq, Fplist_put, Fplist_member): * src/indent.c (compute_motion): * src/syntax.c (find_defun_start, back_comment, forw_comment) (Fforward_comment, scan_lists, scan_sexps_forward): Use incr_rarely_quit so that users can C-g out of long loops. * src/fns.c (Fnconc): Move incr_rarely_quit call to within inner loop, so that it catches C-g there too. * src/keyboard.c (tty_read_avail_input): Remove commented-out and now-obsolete code dealing with interrupts. * src/lisp.h (rarely_quit, incr_rarely_quit): New functions, the latter moved here from fns.c and renamed from rarely_quit. (emacs_read_quit, emacs_write_quit): New decls. * src/search.c (find_newline, search_buffer, find_newline1): Add maybe_quit to catch C-g. * src/sysdep.c (get_child_status): Always invoke maybe_quit if interruptible, so that the caller need not bother. (emacs_nointr_read, emacs_read_quit, emacs_write_quit): New functions. (emacs_read): Rewrite in terms of emacs_nointr_read. Do not handle C-g or signals; that is now for emacs_read_quit. (emacs_full_write): Replace PROCESS_SIGNALS two-way arg with INTERRUPTIBLE three-way arg. All uses changed.
* | Remove immediate_quit.Paul Eggert2017-02-011-31/+2
| | | | | | | | | | | | | | | | | | The old code that sets and clears immediate_quit was ineffective except when Emacs is running in terminal mode, and has problematic race conditions anyway, so remove it. This will introduce some hangs when Emacs runs in terminal mode, and these hangs should be fixed in followup patches. * src/keyboard.c (immediate_quit): Remove. All uses removed.
* | Replace QUIT with maybe_quitPaul Eggert2017-01-251-24/+25
| | | | | | | | | | | | | | | | There’s no longer need to have QUIT stand for a slug of C statements. Use the more-obvious function-call syntax instead. Also, use true and false when setting immediate_quit. These changes should not affect the generated machine code. * src/lisp.h (QUIT): Remove. All uses replaced by maybe_quit.
* | Merge from origin/emacs-25Paul Eggert2017-01-011-1/+1
|\| | | | | | | | | 2e2a806 Fix copyright years by hand 5badc81 Update copyright year to 2017
| * Update copyright year to 2017Paul Eggert2016-12-311-1/+1
| | | | | | | | Run admin/update-copyright.
* | regex.h now includes sys/types.hPaul Eggert2016-12-251-1/+0
| | | | | | | | | | | | | | * src/dired.c, src/emacs.c, src/search.c, src/syntax.c, src/thread.h: Do not include sys/types.h; no longer needed. * src/regex.h: Include <sys/types.h>, as that's what Gnulib and glibc regex.h does, and POSIX has blessed this since 2008.
* | Merge branch 'concurrency'Eli Zaretskii2016-12-041-11/+11
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts (resolved): configure.ac src/Makefile.in src/alloc.c src/bytecode.c src/emacs.c src/eval.c src/lisp.h src/process.c src/regex.c src/regex.h
| * \ merge from trunkKen Raeburn2015-11-011-220/+449
| |\ \
| * \ \ merge from trunkTom Tromey2013-08-191-2/+2
| |\ \ \
| * \ \ \ merge from trunkTom Tromey2013-07-261-2/+2
| |\ \ \ \
| * \ \ \ \ Merge from trunkTom Tromey2013-07-121-1/+1
| |\ \ \ \ \
| * \ \ \ \ \ merge from trunk; clean up some issuesTom Tromey2013-06-031-11/+11
| |\ \ \ \ \ \
| * \ \ \ \ \ \ merge from trunkTom Tromey2013-03-171-31/+33
| |\ \ \ \ \ \ \
| * \ \ \ \ \ \ \ merge from trunkTom Tromey2013-03-081-124/+134
| |\ \ \ \ \ \ \ \
| * \ \ \ \ \ \ \ \ merge from trunkTom Tromey2013-01-051-5/+8
| |\ \ \ \ \ \ \ \ \
| * \ \ \ \ \ \ \ \ \ merge from trunkTom Tromey2012-12-171-37/+56
| |\ \ \ \ \ \ \ \ \ \
| * \ \ \ \ \ \ \ \ \ \ Merge from trunkTom Tromey2012-08-201-6/+6
| |\ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | This introduces a thread-state object and moves various C globalsTom Tromey2012-08-151-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there. It also introduces #defines for these globals to avoid a monster patch. The #defines mean that this patch also has to rename a few fields whose names clash with the defines. There is currently just a single "thread"; so this patch does not impact Emacs behavior in any significant way.
* | | | | | | | | | | | | Merge from origin/emacs-25Paul Eggert2016-11-041-1/+8
|\ \ \ \ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | acae275 ; Spelling fixes d8fac73 Update README for precompiled windows Emacs. 23570fd Clarify documentation of 'vc-responsible-backend' wrt symlinks f708cb2 Clarify doc string of 'transpose-sexps' cd05b1d Fix docstring of 'browse-url-firefox-new-window-is-tab' bdc89eb Improve documentation of 'font-lock-remove-keywords' 4a0c590 Fix documentation of the command summary key 0221b7a Mark relocation workarounds with REL_ALLOC
| * | | | | | | | | | | | Mark relocation workarounds with REL_ALLOCEli Zaretskii2016-11-041-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/search.c (boyer_moore): Mark workarounds for ralloc.c relocation of buffer text with "#ifdef REL_ALLOC".
* | | | | | | | | | | | | Merge from origin/emacs-25Paul Eggert2016-11-041-28/+43
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dbb3410 python.el: Fix detection of native completion in Python 3 (bu... 91c97b6 * Makefile.in (install-arch-indep): Skip etc/refcards/emacsve... 9c1cb8d * lisp/subr.el (set-transient-map): Exit for unbound events (... 9c247d2 Update category-table for Chinese characters 43986d1 Inhibit buffer relocation during regex searches fee4cef Revert fixes to allocation of regex matching
| * | | | | | | | | | | | Inhibit buffer relocation during regex searchesNoam Postavsky2016-10-251-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/search.c (looking_at_1, fast_looking_at, search_buffer): Prevent relocation of buffer contents during calls to re_search_2. This ensures the pointers into buffer text won't be invalidated by r_alloc_sbrk (called from malloc with configurations where REL_ALLOC=yes).
| * | | | | | | | | | | | Revert fixes to allocation of regex matchingNoam Postavsky2016-10-251-28/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix was not complete, and completing it was proving too complicated. - Revert "* src/regex.c (re_search_2): Make new code safe for -Wjump-misses-init." This reverts commit c2a17924a57483d14692c8913edbe8ad24b5ffbb. - Revert "Port to GCC 6.2.1 + --enable-gcc-warnings" This reverts commit f6134bbda259c115c06d4a9a3ab5c39340a15949. - Revert "Fix handling of allocation in regex matching" This reverts commit ad66b3fadb7ae22a4cbb82bb1507c39ceadf3897. - Revert "Fix handling of buffer relocation in regex.c functions" This reverts commit ee04aedc723b035eedaf975422d4eb242894121b.
* | | | | | | | | | | | | Merge from origin/emacs-25Paul Eggert2016-10-251-3/+15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 96ac0c3 Yet another fix for using pointers into buffer text 1047496 Another fix for using pointer to buffer text 3121992 Fix Bug#24478
| * | | | | | | | | | | | Yet another fix for using pointers into buffer textEli Zaretskii2016-10-241-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/search.c (boyer_moore): Update pointers to buffer text after call to set_search_regs. (Bug#24358)
| * | | | | | | | | | | | Another fix for using pointer to buffer textEli Zaretskii2016-10-241-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/search.c (Freplace_match): Move the call to BYTE_POS_ADDR after the call to xpalloc, to avoid the danger of buffer text relocation after its address was taken. (Bug#24358)
* | | | | | | | | | | | | Merge from origin/emacs-25Paul Eggert2016-10-251-0/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ee04aed Fix handling of buffer relocation in regex.c functions 71ca4f6 Avoid relocating buffers while libxml2 reads its text 1b3fc8a ; Remove redundant code in gmalloc.c 9afea93 Attempt to catch reads from a buffer that is relocated
| * | | | | | | | | | | | Fix handling of buffer relocation in regex.c functionsEli Zaretskii2016-10-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/search.c (search_buffer): Updated the base pointer to buffer text after the call to re_search_2. (Bug#24358)
* | | | | | | | | | | | | Merge from origin/emacs-25Paul Eggert2016-10-231-12/+24
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 50fa7d6 ;* src/w32heap.c: Fix typo and wording of the comments. 6f1325e electric-quote mode no longer worries about coding c2a1792 * src/regex.c (re_search_2): Make new code safe for -Wjump-mi... f6134bb Port to GCC 6.2.1 + --enable-gcc-warnings b2ba630 Explain how to debug emacsclient lisp errors 9da53e2 Let describe-function work for lambda again 5c2da93 Fix kill-line's docstring ad66b3f Fix handling of allocation in regex matching 5a26c9b * lisp/electric.el (electric-quote-mode): Improve doc (Bug#24... 3877c91 vc-region-history: Search just on lines intersecting the region 8988327 Fix documentation of 'alist-get' b6998ea * src/regex.h (re_match_object): Improve commentary. # Conflicts: # etc/NEWS # lisp/help-fns.el
| * | | | | | | | | | | | Fix handling of allocation in regex matchingNoam Postavsky2016-10-211-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `re_match_2_internal' uses pointers to the lisp objects that it searches. Since it may call malloc when growing the "fail stack", these pointers may be invalidated while searching, resulting in memory curruption (Bug #24358). To fix this, we check the pointer that the lisp object (as specified by re_match_object) points to before and after growing the stack, and update existing pointers accordingly. * src/regex.c (STR_BASE_PTR): New macro. (ENSURE_FAIL_STACK, re_search_2): Use it to convert pointers into offsets before possible malloc call, and back into pointers again afterwards. (POS_AS_IN_BUFFER): Add explanatory comment about punning trick. * src/search.c (search_buffer): Instead of storing search location as pointers, store them as pointers and recompute the corresponding address for each call to `re_search_2'. (string_match_1, fast_string_match_internal, fast_looking_at): * src/dired.c (directory_files_internal): Set `re_match_object' to Qnil after calling `re_search' or `re_match_2'. * src/regex.h (re_match_object): Mention new usage in commentary.