aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Initial commit. Allow wanted fontification of open string in any mode.scratch/fontify-open-stringAlan Mackenzie2018-07-011-9/+184
| | | | | | | | | | | | | | | | | The wanted fontification is for the string face to end at the first unescaped newline. This is achieved by a new syntax flag `s' on NL, which means "terminate any open string". src/syntax.c (SYNTAX_FLAGS_CLOSE_STRING, back_maybe_string): New functions. (Fstring_to_syntax, Finternal_describe_syntax_value, scan_lists) (scan_sexps_forward): Adapt to handle the `s' flag. lisp/font-lock.el (font-lock-warn-open-string): New defcustom. (font-lock-fontify-syntactically-region): Enhance to fontify " with warning-face. lisp/progmodes/sh-script.el (sh-mode-syntax-table): Add flag `s' to syntax entry for \n.
* Tune SAFE_FREEPaul Eggert2018-06-2813-44/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | On my platform (Fedora 28 x86-64, AMD Phenom II X4 910e) this sped up a SAFE_FREE-using microbenchmark (string-distance "abc" "abc") by about 18%, and shrank the Emacs text size by about 0.1%. * src/callint.c (Fcall_interactively): * src/callproc.c (call_process): * src/doc.c (get_doc_string, Fsnarf_documentation): * src/editfns.c (Freplace_buffer_contents): * src/emacs-module.c (funcall_module): * src/eval.c (Flet): * src/process.c (Fmake_process): * src/term.c (tty_menu_show): * src/xdisp.c (safe__call): * src/xmenu.c (x_menu_show): Use SAFE_FREE_UNBIND_TO. * src/data.c (wrong_choice): No need to call SAFE_FREE here. * src/lisp.h (USE_SAFE_ALLOCA): * src/regex.c (REGEX_USE_SAFE_ALLOCA): Do not declare sa_must_free local; no longer needed. All uses removed. (SAFE_FREE): Rewrite in terms of safe_free. (safe_free): New function, optimized to use xfree. (SAFE_FREE_UNBIND_TO): New macro. (safe_free_unbind_to): New function.
* (format "%d" F) now truncates floating FPaul Eggert2018-06-253-9/+16
| | | | | | | | | | | | | Problem reported by Paul Pogonyshev (Bug#31938). * src/editfns.c: Include math.h, for trunc. (styled_format): For %d, truncate floating-point numbers and convert -0 to 0, going back to how Emacs 26 did things. * doc/lispref/strings.texi (Formatting Strings): Document behavior of %o, %d, %x, %X on floating-point numbers. * src/floatfns.c (trunc) [!HAVE_TRUNC]: Rename from emacs_trunc and make it an extern function, so that editfns.c can use it. All callers changed. * test/src/editfns-tests.el (format-%d-float): New test.
* Clean up redundant code from previous checkinsLars Ingebrigtsen2018-06-251-1/+0
| | | | | | * src/gnutls.c (gnutls_verify_boot): Remove reduntant setting of p->gnutls_certificates, which is now performed by gnutls_deinit_certificates.
* Don't use XCAR in possibly-nil situationsLars Ingebrigtsen2018-06-251-1/+1
| | | | | * src/gnutls.c (Fgnutls_peer_status): certs theoretically may be nil, so don't use XCAR.
* Tweak previous gnutls change for efficiencyLars Ingebrigtsen2018-06-241-6/+4
| | | | | * src/gnutls.c (Fgnutls_peer_status): Minor optimisation to avoid computing the topmost certificate twice.
* Return the entire TLS certificate chain back to the callerLars Ingebrigtsen2018-06-242-34/+77
| | | | | | | | | | | | * src/gnutls.c (gnutls_deinit_certificates): New function. (Fgnutls_peer_status): Return all certificates in the chain back to Lisp land. (gnutls_verify_boot): Compute all the x509 certificates in the chain. * src/process.h (struct Lisp_Process): Adjust gnutls fields so that we can keep tracks of all certificates in the chain instead of just the host certificate.
* Merge from origin/emacs-26Glenn Morris2018-06-231-8/+22
|\ | | | | | | | | | | | | | | | | bbc9d37 (origin/emacs-26) Fix previous change in minibuffer-default-a... 7caeef1 * src/editfns.c (Fformat): Make %x easier to spot in doc stri... ecc29fb Improve responsiveness while in 'replace-buffer-contents' 8182d64 Improve documentation of 'server-start' and friends decdfed Clarify wording about functions' argument lists 5abac8b * lisp/doc-view.el: Fix typos in the commentary. (Bug#31937)
| * * src/editfns.c (Fformat): Make %x easier to spot in doc string. (Bug#31945)Eli Zaretskii2018-06-231-1/+2
| |
| * Improve responsiveness while in 'replace-buffer-contents'Eli Zaretskii2018-06-231-7/+20
| | | | | | | | | | | | | | | | | | * src/editfns.c (buffer_chars_equal): Avoid calling buf_charpos_to_bytepos when the buffer is plain-ASCII. Suggested by Milan Stanojević <mstanojevic@janestreet.com>. Call maybe_quit to improve responsiveness. (Freplace_buffer_contents): Call maybe_quit. Warn in the doc string that the function could be slow. (Bug#31888)
* | Merge from origin/emacs-26Glenn Morris2018-06-232-3/+19
|\ \ | |/ | | | | | | | | | | | | | | | | 5cb3991 Fix a typo in emacs-lisp-intro.texi d6aa55e Avoid segfaults in replace-buffer-contents with large buffers d22b8d1 Adjust for scaling for mode-line popup menus (Bug#31880) 3d2e3dc Change name of `seqp' argument (Bug#26411) 40e1db8 Change index of ";" to better reflect it's usage (Bug#31623) d289e7e Fix bug of 'mouse-drag-and-drop-region' to detect edges of re... e292c09 Fix #'fun handling inside `labels' (Bug#31792)
| * Avoid segfaults in replace-buffer-contents with large buffersEli Zaretskii2018-06-221-2/+3
| | | | | | | | | | * src/editfns.c (Freplace_buffer_contents): Don't release malloc'ed memory as long as we are using it. (Bug#31888)
| * Adjust for scaling for mode-line popup menus (Bug#31880)Robert Pluim2018-06-221-1/+16
| | | | | | | | | | * src/xmenu.c (menu_position_func) [HAVE_GTK3]: Take scaling into account when calculating screen size.
* | Remove broken icon from tooltip (Bug#31884)memeplex2018-06-211-1/+1
| | | | | | | | | | * src/gtkutil.c (xg_show_tooltip): Call gtk_widget_show instead of gtk_widget_show_all, the latter displays an extra placeholder icon.
* | Merge from origin/emacs-26Glenn Morris2018-06-181-2/+1
|\ \ | |/ | | | | | | 3673770 (origin/emacs-26) Fix vertical-motion with 'visual' line-numb... d8bff53 ; CONTRIBUTE: Add a couple of nits.
| * Fix vertical-motion with 'visual' line-number displayEli Zaretskii2018-06-181-2/+1
| | | | | | | | | | * src/indent.c (Fvertical_motion): Don't exempt 'visual' sty;e of line-number display from X coordinate adjustments. (Bug#31875)
| * Handle NSAttributedString inputs (bug#29837)Alan Third2018-06-171-2/+9
| | | | | | | | | | | | ; Do not merge to master. * src/nsterm.m (EmacsView::insertText): Handle NSAttributedString.
| * Allow inserting non-BMP charactersPhilipp Stephani2018-06-173-13/+43
| | | | | | | | | | | | | | | | | | | | * src/coding.h (UTF_16_HIGH_SURROGATE_P, UTF_16_LOW_SURROGATE_P): Move from coding.c and document. (surrogates_to_codepoint): New function. * src/nsterm.m (insertText:): Properly handle surrogate pairs. (cherry picked from commit 703ac3ea1c1ce381f385469a0e88bc29d3fe83c2)
* | Merge from origin/emacs-26Glenn Morris2018-06-181-1/+1
|\ \ | |/ | | | | | | | | ebe065f Prevent errant scroll on mouse click (Bug#31546) ffd2018 Minor documentation fix cf4dc95 * lisp/window.el (window-toggle-side-windows): Doc fix. (Bug...
| * Prevent errant scroll on mouse click (Bug#31546)Aaron Jensen2018-06-171-1/+1
| | | | | | | | | | | | | | * src/nsterm.m (ns_mouse_position): Use correct frame when determining mouse position. * lisp/mouse.el (mouse-drag-track): Only account for mode-line height if `mode-line-format' is non-nil.
* | Merge from origin/emacs-26Glenn Morris2018-06-183-4/+17
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | 63ba73a Fix documentation of ':propertize' in mode-line-format 22aa665 Reject invalid 5-byte sequences when detecting UTF-8 encoding 0d3c358 Fix 'replace-buffer-contents' in multibyte buffers c79a627 Update etc/NEWS for mail-source-movemail-program change 63f1dc4 Improve movemail default 0b1a2ae Delete description of deleted Customize functions fcd66d0 Keep vc-print-log from putting point at buffer end (Bug#31764) Conflicts: etc/NEWS
| * Reject invalid 5-byte sequences when detecting UTF-8 encodingEli Zaretskii2018-06-152-2/+6
| | | | | | | | | | | | | | | | * src/coding.c (detect_coding_utf_8): Reject multibyte sequences whose leading byte is greater than MAX_MULTIBYTE_LEADING_CODE. (Bug#31829) * src/character.h (MAX_MULTIBYTE_LEADING_CODE): Add commentary about the connection between the value of this macro and MAX_CHAR.
| * Fix 'replace-buffer-contents' in multibyte buffersEli Zaretskii2018-06-151-2/+11
| | | | | | | | | | | | | | | | | | * src/editfns.c (buffer_chars_equal): Pass a byte position to BUF_FETCH_CHAR_AS_MULTIBYTE, not a character position. (Bug#31837) * test/src/editfns-tests.el (replace-buffer-contents-bug31837): New test.
* | Merge from origin/emacs-26Glenn Morris2018-06-181-2/+3
|\ \ | |/ | | | | | | | | | | | | | | | | 5bdc344 ; Reduce quoting for SELECTOR in 'make -C test' (Bug#31744) b6b793b ; test/Makefile.in: Add TEST_INTERACTIVE option (Bug#31744). 1aa906f Make 'tags' targets respect --with-silent-rules (Bug#31744) Conflicts: test/Makefile.in test/README
| * Make 'tags' targets respect --with-silent-rules (Bug#31744)Noam Postavsky2018-06-121-2/+3
| | | | | | | | | | | | | | * lwlib/Makefile.in (TAGS): * lisp/Makefile.in (TAGS): * src/Makefile.in (TAGS): Use AM_V_GEN and AM_V_at. * src/Makefile.in: Note that TAGS are generated in build dir.
* | Restore old echo_truncate conditionDaniel Colascione2018-06-161-5/+1
| | | | | | | | | | * src/keyboard.c (read_key_sequence): Restore old echo_truncate condition.
* | Make regex matching reentrant; update syntax during matchDaniel Colascione2018-06-166-417/+446
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.)
* | Decouple dired from regex internalsDaniel Colascione2018-06-161-25/+12
| | | | | | | | | | | | * src/dired.c: Remove use of regex.h (directory_files_internal): Use higher-level regular expression functions.
* | Remove commented-out code in compile_pattern_1Daniel Colascione2018-06-161-7/+0
| | | | | | | | * src/search.c (compile_pattern_1): Remove commented-out code.
* | Tweak field ordering in re_pattern_bufferDaniel Colascione2018-06-161-4/+4
| | | | | | | | | | * src/regex.h (struct re_pattern_buffer): Reorder charset_unibyte field to keep bitfields together.
* | Rewrite memory-limit in LispPaul Eggert2018-06-161-19/+0
| | | | | | | | | | | | | | | | | | | | | | Have it return Emacs virtual memory size, not the sbrk value which is often useless newadays. * doc/lispref/internals.texi (Garbage Collection): * etc/NEWS: Document this. * lisp/subr.el (memory-limit): New implementation in Lisp, written in terms of process-attributes, and which returns virtual memory size. * src/alloc.c (Fmemory_limit): Remove C implementation.
* | Use mint_ptr in w32notify.cEli Zaretskii2018-06-161-4/+4
| | | | | | | | | | | | * src/w32notify.c (Fw32notify_add_watch, Fw32notify_rm_watch) (Fw32notify_valid_p, w32_get_watch_object): Use make_mint_ptr and xmint_pointer.
* | Minor doc string fixes in json.cEli Zaretskii2018-06-161-2/+3
| | | | | | | | * src/json.c (Fjson_serialize, Fjson_insert): Fix 'usage'.
* | Formatting and doc fixes in recent changesEli Zaretskii2018-06-162-8/+9
| | | | | | | | | | | | | | * src/xfaces.c (evaluate_face_filter): Explain the inner braces. (merge_face_ref): Fix whitespace. (syms_of_xfaces) <face-filters-always-match>: Doc fix. * src/xdisp.c (extend_face_to_end_of_line): Fix whitespace.
* | Improve documentation of several recent changesEli Zaretskii2018-06-161-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/xfaces.c (merge_face_ref): Fix a typo in the commentary. (evaluate_face_filter, filter_face_ref): Minor copyedits in the commentary. * doc/lispref/display.texi (Face Remapping): * doc/lispref/text.texi (Special Properties): Document the ':filter' face specs and their effects. Document 'face-filters-always-match'. * doc/emacs/files.texi (Visiting): Document the new possibility to visit large files literally in response to question asked by Emacs. * etc/NEWS: Mention the new possibility to visit large files literally. * lisp/files.el (files--ask-user-about-large-file): Use "literally" instead of "raw", for consistency with find-file-literally. * doc/lispref/frames.texi (Input Focus): Tell explicitly that focus-change events are sometimes supported on TTY frames.
* | Fix a typo in xmenu.cEli Zaretskii2018-06-161-2/+2
| | | | | | | | | | | | * src/xmenu.c (x_menu_show): Replace a call to record_unwind_protect_pointer with record_unwind_protect_ptr. (Bug#31856)
* | Fix --with-cairo buildAri Roponen2018-06-161-2/+2
| | | | | | | | | | | | * src/xterm.c (x_cr_destroy): Remove extra semicolon. (x_cr_export_frames): Fix a typo in calling record_unwind_protect_ptr. (Bug#31856)
* | * src/Makefile.in: Update paxctl comment.Paul Eggert2018-06-151-1/+1
| |
* | Minor CANNOT_DUMP cleanupsPaul Eggert2018-06-151-1/+1
| | | | | | | | | | | | | | | | | | | | Mostly, this avoids munging executables when CANNOT_DUMP = yes, as the munging is needed only for unexec. * configure.ac (PAXCTL_dumped, PAXCTL_notdumped) [CANNOT_DUMP]: Leave these empty. (LD_SWITCH_SYSTEM_TEMACS) [CANNOT_DUMP]: Do not append -no-pie or -nopie. * src/alloc.c (my_heap_start) [CANNOT_DUMP]: Omit; not used.
* | Fix typo in previous macfont.m changePaul Eggert2018-06-151-1/+2
| | | | | | | | | | * src/macfont.m (macfont_descriptor_entity): Fix typo. Problem reported by Clemens Schüller.
* | Restore macfont.m casts to void *Paul Eggert2018-06-151-2/+2
| | | | | | | | | | | | | | * src/macfont.m (macfont_set_family_cache): Restore casts to void * that were mistakenly removed in my recent change. The types in question are pointer-to-const. Problem reported by Clemens Schüller.
* | Fix building --without-x and similarEli Zaretskii2018-06-151-6/+0
| | | | | | | | | | | | * src/keyboard.c (make_lispy_focus_out): Compile it unconditionally, as it is now supported on TTYs as well. Reported by Filipp Gunbin <fgunbin@fastmail.fm>.
* | Remove Lisp_Misc_Save_ValuePaul Eggert2018-06-143-407/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This type and its associated routines are no longer used. * src/alloc.c (voidfuncptr): Move here from src/lisp.h. (free_misc, make_save_int_int_int) (make_save_obj_obj_obj_obj, make_save_ptr) (make_save_ptr_int, make_save_ptr_ptr) (make_save_funcptr_ptr_obj, make_save_memory) (free_save_value, mark_save_value): Remove. (mark_object): Remove mention of Lisp_Misc_Save_Value. * src/lisp.h (Lisp_Misc_Save_Value, SAVE_SLOT_BITS) (SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, enum Lisp_Save_Type) (struct Lisp_Save_Value, SAVE_VALUEP, XSAVE_VALUE) (save_type, XSAVE_POINTER, set_save_pointer) (XSAVE_FUNCPOINTER, XSAVE_INTEGER, set_save_integer) (XSAVE_OBJECT): Remove. (union Lisp_Misc): Remove u_save_value. (voidfuncptr): Move from here to src/alloc.c. * src/print.c (print_object): Remove support for printing Lisp_Misc_Save_Value.
* | New type Lisp_Misc_PtrPaul Eggert2018-06-145-11/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a streamlined version of Lisp_Save_Value, which contains just a pointer, as that is all Lisp_Save_Values are used for any more. With the previous changes, these objects are not primarily used as save values, so just call them "Misc" rather than "Save". * src/alloc.c (make_misc_ptr): New function. (mark_object): Mark Lisp_Misc_Ptr too. * src/lisp.h (Lisp_Misc_Ptr): New constant. (struct Lisp_Misc_Ptr): New type. (make_mint_ptr, mint_ptrp, xmint_pointer): Use Lisp_Misc_Ptr, not Lisp_Save_Value. (union Lisp_Misc): Add Lisp_Misc_Ptr. * src/print.c (print_object): Print Lisp_Misc_Ptr.
* | Avoid allocating Lisp_Save_Value for arraysPaul Eggert2018-06-143-3/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/alloc.c (mark_maybe_objects): New function. * src/eval.c (default_toplevel_binding) (backtrace_eval_unrewind, Fbacktrace__locals): Treat array unwindings like other miscellaneous pdl types. (record_unwind_protect_array): New function. (do_one_unbind): Free the array while unwinding. (mark_specpdl): Mark arrays directly. * src/lisp.h (SPECPDL_UNWIND_ARRAY): New constant. (union specbinding): New member unwind_array. (SAFE_ALLOCA_LISP_EXTRA): Use record_unwind_protect_array instead of make_save_memory + record_unwind_protect.
* | Avoid allocating Lisp_Save_Value for excursionsPaul Eggert2018-06-143-29/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/editfns.c (save_excursion_save): New arg PDL, specifying where to save the state. All uses changed. (save_excursion_restore): Args are now the marker and info rather than a pointer to a Lisp_Save_Value containing them. All uses changed. * src/eval.c (default_toplevel_binding, Fbacktrace__locals): Treat excursions like other miscellaneous pdl types. (record_unwind_protect_excursion): Save data directly into the pdl rather than creating an object on the heap. This avoids the need to allocate and free an object. (do_one_unbind, backtrace_eval_unrewind): Unwind excursions directly. (mark_specpdl): Mark excursions directly. * src/lisp.h (SPECPDL_UNWIND_EXCURSION): New constant. (union specbinding): New member unwind_excursion.
* | Just use cons in macfont_descriptor_entityPaul Eggert2018-06-141-7/+6
| | | | | | | | | | | | * src/macfont.m (macfont_descriptor_entity): Use cons instead of make_save_ptr_int, as this avoids the need for a special type and function for this one-off.
* | Avoid allocating a Lisp_Save_Value in ftfont.cPaul Eggert2018-06-141-14/+12
| | | | | | | | | | | | | | | | | | * src/ftfont.c (struct ftfont_cache_data): New member face_refcount. (ftfont_lookup_cache): Clear it when initializing. Use make_mint_ptr, since this typically avoids the need to allocate a Lisp_Save_Value as refcount is now stored elsewhere. (ftfont_open2, ftfont_close): Manipulate the reference count in the struct, not in the save object.
* | Use record_unwind_protect_ptr to avoid allocationPaul Eggert2018-06-143-15/+27
| | | | | | | | | | | | | | | | | | | | | | * src/term.c (struct tty_pop_down_menu): New type. (tty_pop_down_menu, tty_menu_show): Use it, along with record_unwind_protect_ptr, to avoid allocating a Lisp_Misc. * src/xmenu.c (struct pop_down_menu): New type. (pop_down_menu, x_menu_show): Use it, likewise. * src/xterm.c (x_cr_destroy, x_cr_export_frames): Use record_unwind_protect_pointer to avoid possibly allocating a Lisp_Misc.
* | Avoid Lisp_Misc allocation if C stack sufficesPaul Eggert2018-06-142-18/+37
| | | | | | | | | | | | | | | | | | * src/fileio.c (union read_non_regular): New type. (read_non_regular, Finsert_file_contents): Use it to avoid allocating a Lisp_Misc. * src/keymap.c (union map_keymap): New type. (map_keymap_char_table_item, map_keymap_internal): Use it to avoid allocating a Lisp_Misc.