aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* | Fix assertion violations due to non-ASCII text in menusEli Zaretskii2019-09-131-3/+5
| | | | | | | | | | | | | | | | | | * src/xdisp.c (tool_bar_height, redisplay_tool_bar) (display_menu_bar): If the Lisp string to be displayed in the menu-bar or tool-bar window is multibyte, tell the display engine to treat it as multibyte, instead of relying on the initial determination by init_iterator (which is based on the multibyteness of the current buffer). (Bug#37385)
* | * src/profiler.c: Leave `key` hashslots as Qunbound (bug#37382)Stefan Monnier2019-09-121-5/+7
| | | | | | | | | | | | | | | | | | | | Now that "key == Qunbound" is used to determine if a hash table entry is available, we can't stash pre-allocated vectors into the `key` slot anymore, so use the `value` slot instead. (make_log): Pre-fill the `value` slots i.s.o `key`. (evict_lower_half): Stash key back into `value`, i.s.o `key`. (record_backtrace): Get pre-allocated vector for `value` i.s.o `key`.
* | Fix file name encoding when open_directory signalsPaul Eggert2019-09-121-6/+6
| | | | | | | | | | | | * src/dired.c (open_directory): New arg ENCODED_DIRNAME. All callers changed. Signal error with original name, not encoded name.
* | Improve error reporting for DOC file problemsPaul Eggert2019-09-111-1/+1
| | | | | | | | | | * src/doc.c (get_doc_string): Report all serious errors when DOC cannot be opened, not just fd-exhaustion errors.
* | Fix directory-files-and-attributes racePaul Eggert2019-09-111-1/+2
| | | | | | | | | | | | | | * src/dired.c (directory_files_internal): Fix race condition: when some other process removed a file between the readdir and the ensuing lstat, directory-files-and-attributes would return a list containing nil.
* | Omit duplicate test of current directoryPaul Eggert2019-09-111-13/+3
| | | | | | | | | | | | * src/callproc.c (encode_current_directory): Remove redundant call to Ffile_accessible_directory_p. The code checks the encoded name with file_accessible_directory_p anyway.
* | Improve checking of pdump load failuresPaul Eggert2019-09-116-112/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/alloc.c (memory_full): Just report "memory exhausted" if failure occurs during initialization, since fancier recovery schemes are not likely to work when not initialized. * src/emacs.c (dump_error_to_string): Accept int, not enum pdumper_load_result, since the result might not fit in the enum. Use strerror if it was derived from errno. This is for better diagnostics of pdump load failures. (load_pdump_find_executable): Return char *, not enum. 2nd arg is now pointer to buffer size, rather than pointer to pointer to buffer. All callers changed. Use Emacs allocator since they should now be OK even during early startup. Use check_executable instead access, to use effective rather than real permissions. (load_pdump): Return void since callers ignore result. Use int where enum could be too narrow. Use heap rather than stack for possibly-long string. Prefer ptrdiff_t to size_t. * src/fileio.c (check_executable): Now extern. * src/pdumper.c (pdumper_load): Return int that may have errno added to it, for better diagnostics when loads fail.
* | Reset dbus registered buses on dump loadPaul Eggert2019-09-111-4/+8
| | | | | | | | | | | | | | | | Problem reported by Leonard Lausen (Bug#37331). * src/dbusbind.c: Include pdumper.h. (syms_of_dbusbind_for_pdumper): New function, to reset the registered buses. (syms_of_dbusbind): Use it, fixing a TODO.
* | Fix bug when gc-cons-percentage is bumped to 0.8Paul Eggert2019-09-071-17/+28
| | | | | | | | | | | | | | | | | | | | Problem reported by Michael Heerdegen (Bug#37321). * src/alloc.c (gc_threshold): New static var. (bump_consing_until_gc): Change args from DIFF to THRESHOLD and PERCENTAGE. All uses changed. When accounting for a changed gc-cons-percentage, do not assume that total_bytes_of_live_objects returns the same value now that it did the last time we were called.
* | Set inhibit-compacting-font-caches to t by default on MS-WindowsEli Zaretskii2019-09-071-0/+7
| | | | | | | | | | | | | | * src/font.c (syms_of_font) [WINDOWSNT]: Set inhibit-compacting-font-caches to t by default. * etc/NEWS: Mention the change.
* | Allow Zs characters to be composedEli Zaretskii2019-09-071-3/+4
| | | | | | | | | | | | | | | | * src/composite.c (char_composable_p): Allow SPC and other Zs characters to be composed. * lisp/composite.el (compose-gstring-for-graphic): Don't reject characters whose general category is Zs. (Bug#14461)
* | Revert "file-truename now uses realpath for local files"Eli Zaretskii2019-09-071-42/+0
| | | | | | | | | | | | | | This reverts commit a59839d7556ef85058e09b005f0ff32e59b20ec3. This commit broke the MS-Windows build (because there's no realpath on MS-Windows). Even if I change the implementation to always signal an error on MS-Windows, the build fails.
* | file-truename now uses realpath for local filesPaul Eggert2019-09-061-0/+42
| | | | | | | | | | | | | | | | This uses fewer syscalls on GNU/Linux and other GNUish platforms. * lisp/files.el (file-truename): Try fileio--truename if there are no handlers. * src/fileio.c: Include stdlib.h, for realpath. (Ffileio__truename): New function.
* | Fix bugs when recalculating consing_until_gcPaul Eggert2019-09-051-11/+13
| | | | | | | | | | | | | | | | | | | | Problem reported by Joseph Mingrone (Bug#37006#72). * src/alloc.c (watch_gc_cons_threshold) (watch_gc_cons_percentage): Don’t try to store an intmax_t into an int. Redo to make the code clearer. (watch_gc_cons_percentage): Use gc_cons_threshold, not consing_until_gc.
* | Port :safe-renegotiation test to GnuTLS < 3.6.3Paul Eggert2019-09-051-6/+1
| | | | | | | | | | | | | | | | Problem reported by Robert Pluim in https://lists.gnu.org/r/emacs-devel/2019-09/msg00127.html * src/gnutls.c (Fgnutls_peer_status): Simplify test for whether the :safe-renegotiation result is needed, so that it works all the way back to GnuTLS 2.12.2.
* | Use plain ‘static’ for Emacs C inline functionsPaul Eggert2019-09-041-9/+34
| | | | | | | | | | | | | | This improved performance of ‘make compile-always’ by 8.2% on my platform (AMD Phenom II X4 910e, Fedora 30 x86-64). * src/conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN) (INLINE_HEADER_END) [!EMACS_EXTERN_INLINE]: Use plain ‘static’.
* | Tweak xd_append_arg to pacify -Wnull-dereferencePaul Eggert2019-09-041-16/+21
| | | | | | | | | | | | * src/dbusbind.c (xd_append_arg): Redo to pacify gcc -Wnull-dereference. Also, check that the Lisp string won’t overrun the C signature buffer.
* | Don’t mention :safe-renegotiation in TLS 1.3Paul Eggert2019-09-041-5/+11
| | | | | | | | | | | | * src/gnutls.c (Fgnutls_peer_status): Don’t put the safe-renegotiation indication into the status in TLS 1.3, which removed support for renegotiation.
* | Port pdumper mmap to AIXPaul Eggert2019-09-041-1/+1
| | | | | | | | | | * src/pdumper.c (needs_mmap_retry_p) [_AIX]: Return true. Problem observed on AIX 7.1 and 7.2 in GCC compile farm.
* | * src/systime.h (hz): #undef to work around AIX build issue.Paul Eggert2019-09-031-0/+2
| |
* | Prefer functions to macros in buffer.hPaul Eggert2019-09-031-266/+395
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In buffer.h, prefer inline functions to function-like macros when either will do. This helps avoid confusion about how many times an arg is evaluated. On my platform, this patch improves performance of ‘make compile-always’ by 5.7%. Also, prefer enum constants to object-like macros when either will do. * src/buffer.h (BEG, BEG_BYTE, GAP_BYTES_DFL, GAP_BYTES_MIN) (MAX_PER_BUFFER_VARS, NONEXISTENT_MODTIME_NSECS) (UNKNOWN_MODTIME_NSECS, BUFFER_LISP_SIZE, BUFFER_REST_SIZE): Now enum constants, instead of macros. (BUFFER_CEILING_OF, BUFFER_FLOOR_OF, BUF_BEG, BUF_BEG_BYTE) (BUF_BEGV, BUF_BEGV_BYTE, BUF_PT, BUF_PT_BYTE, BUF_ZV) (BUF_ZV_BYTE, BUF_GPT_ADDR, BUF_Z_ADDR, BUF_GAP_END_ADDR) (BUF_COMPUTE_UNCHANGED, SET_PT, TEMP_SET_PT, SET_PT_BOTH) (TEMP_SET_PT_BOTH, BUF_TEMP_SET_PT, SET_BUF_BEGV, SET_BUF_ZV) (SET_BUF_BEGV_BOTH, SET_BUF_ZV_BOTH, SET_BUF_PT_BOTH) (BYTE_POS_ADDR, CHAR_POS_ADDR, CHAR_TO_BYTE, BYTE_TO_CHAR) (PTR_BYTE_POS, FETCH_CHAR, FETCH_CHAR_AS_MULTIBYTE) (BUF_BYTE_ADDRESS, BUF_CHAR_ADDRESS, BUF_PTR_BYTE_POS) (BUF_FETCH_CHAR, BUF_FETCH_CHAR_AS_MULTIBYTE, BUF_FETCH_BYTE) (BUFFER_PVEC_INIT, BUFFER_LIVE_P, BUFFER_HIDDEN_P) (BUFFER_CHECK_INDIRECTION, OVERLAY_POSITION, PER_BUFFER_VALUE_P) (SET_PER_BUFFER_VALUE_P, PER_BUFFER_IDX): Now inline functions instead of macros.
* | * src/xdisp.c (hscroll_window_tree): Fix type typo.Paul Eggert2019-09-031-1/+2
| |
* | Take last_per_buffer_idx privatePaul Eggert2019-09-032-13/+13
| | | | | | | | | | | | | | | | This will simplify future changes. Turn the runtime check into an eassert, since it’s not needed in production. * src/buffer.c (last_per_buffer_idx): Now static. (valid_per_buffer_idx): New function. * src/buffer.h (PER_BUFFER_VALUE_P, SET_PER_BUFFER_VALUE_P): Use it.
* | Avoid macros in pdumper.c when it’s easyPaul Eggert2019-09-031-98/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem with DUMP_SET_REFERRER mentioned by Pip Cet at end of: https://lists.gnu.org/archive/html/emacs-devel/2019-07/msg00548.html * src/pdumper.c (DANGEROUS, EMACS_RELOC_TYPE_BITS) (EMACS_RELOC_LENGTH_BITS, DUMP_RELOC_TYPE_BITS) (DUMP_RELOC_ALIGNMENT_BITS, DUMP_RELOC_OFFSET_BITS) (DUMP_RELOCATION_ALIGNMENT, DUMP_ALIGNMENT) (WEIGHT_NONE, WEIGHT_NORMAL, WEIGHT_STRONG) (PDUMPER_MAX_OBJECT_SIZE): Now a constant, not a macro. (divide_round_up): Now a function, not a macro DIVIDE_ROUND_UP. All uses changed. (enum link_weight_enum, WEIGHT_NONE_VALUE) (WEIGHT_NORMAL_VALUE, WEIGHT_STRONG_VALUE): Remove. (struct link_weight): Just use an int. (dump_set_referrer): New function, replacing DUMP_SET_REFERRER macro with a different API. All uses changed. (dump_clear_referrer): Rename from DUMP_CLEAR_REFERRER. All uses changed. (DEFINE_FROMLISP_FUNC, DEFINE_TOLISP_FUNC): Remove. (intmax_t_from_lisp, intmax_t_to_lisp, dump_off_from_lisp) (dump_off_to_lisp): Define without using macros, (dump_off_from_lisp): Add an eassert range check. (DUMP_FIELD_COPY): Simplify.
* | Avoid casting -1 to possibly-unsigned enumPaul Eggert2019-09-033-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | * src/alloc.c (mark_maybe_pointer): * src/pdumper.h (pdumper_object_p_precise): Use pdumper_valid_object_type_p. * src/pdumper.c (pdumper_find_object_type_impl): * src/pdumper.h (pdumper_find_object_type): Return int, not enum Lisp_Type. All callers changed. * src/pdumper.h (PDUMPER_NO_OBJECT): Do not cast -1 to enum Lisp_Type; in theory, C18 says this could yield 7, which would mean PDUMPER_NO_OBJECT == Lisp_Float (!). (pdumper_valid_object_type_p): New function.
* | Sync consing_until_gc with gc-cons-thresholdPaul Eggert2019-09-031-19/+81
|/ | | | | | | | | | | | Add watchers for gc-cons-threshold and gc-cons-percentage that update consing_until_gc accordingly. Suggested by Eli Zaretskii (Bug#37006#52). * src/alloc.c (consing_threshold, bump_consing_until_gc) (watch_gc_cons_threshold, watch_gc_cons_percentage): New functions. (garbage_collect_1): Use consing_threshold. (syms_of_alloc): Arrange to watch gc-cons-threshold and gc-cons-percentage.
* Check instead of relying on NOTREACHEDPaul Eggert2019-08-312-3/+1
| | | | | | | | | | | | | | | | NOTREACHED was designed for traditional lint decades ago, and _Noreturn now normally subsumes its function. In the one case in Emacs where NORETURN might help and _Noreturn does not, check for NOTREACHED instead of assuming it. * lib-src/etags.c (main): * src/xterm.c (x_connection_closed): Remove NOTREACHED after a call to a _Noreturn function, as NOTREACHED is no longer needed there. Also, one of the NOTREACHEDs was misplaced, which defeated traditional lint checking anyway. * lib-src/pop.c (pop_getline): Redo so as to not need NOTREACHED. * src/emacs.c (main): Use eassume (false) rather than NOTREACHED, so that running with ENABLE_CHECKING catches any internal error causing the toplevel Frecursive_edit to return.
* Fix compilation with CHECK_STRUCTSAndreas Schwab2019-08-311-1/+1
| | | | * src/pdumper.c (dump_hash_table): Update hash of Lisp_Hash_Table.
* ; * src/floatfns.c: Don't use non-ASCII characters in comments.Eli Zaretskii2019-08-311-1/+1
|
* * src/floatfns.c: Check against __FINITE_MATH_ONLY__ (bug#37140)Mattias Engdegård2019-08-301-0/+8
|
* Don't worry about pre-1.0.0 alsa-lib includePaul Eggert2019-08-281-5/+1
| | | | | | | Problem reported by Ergus in: https://lists.gnu.org/r/emacs-devel/2019-08/msg00563.html * configure.ac (ALSA_SUBDIR_INCLUDE): Do not define. * src/sound.c: Assume ALSA_SUBDIR_INCLUDE.
* Port recent gnutls fixes to gcc -Wpointer-signPaul Eggert2019-08-271-1/+2
| | | | | * src/gnutls.c (Fgnutls_format_certificate): Fix pointer signedness problem.
* ; Fix commentary of last change.Eli Zaretskii2019-08-271-3/+3
|
* Fix crashes on MS-Windows when using GnuTLS connectionsEli Zaretskii2019-08-271-10/+14
| | | | | | | | | * src/gnutls.c (init_gnutls_functions) [WINDOWSNT]: Define and load gnutls_free by an explicit call to GetProcAddress. (gnutls_free) [WINDOWSNT]: Define as a macro that dereferences a function pointer. (Bug#31946) (Fgnutls_format_certificate): Use make_string_from_bytes instead of going through an intermediate malloc'ed buffer.
* * src/keyboard.c (parse_tool_bar_item): Use CAPTION when HELP is unavailableJuri Linkov2019-08-271-0/+4
| | | | while adding equivalent key binding to the tooltip. (Bug#36156)
* Fix crashes in networking with GnuTLS on MS-WindowsEli Zaretskii2019-08-261-1/+4
| | | | | | | | * src/gnutls.c (init_gnutls_functions) [WINDOWSNT]: Define and load gnutls_free. (Fgnutls_format_certificate): Use gnutls_free instead of xfree. This prevents crashes on MS-Windows, since the memory being released was allocated inside GnuTLS. (Bug#31946)
* Fix bug with non-paletted transparent PNGsPaul Eggert2019-08-251-8/+9
| | | | | | Adapted from a fix by YAMAMOTO Mitsuharu (Bug#37153#77). * src/image.c (png_load_body): Fix bug with non-paletted transparent images.
* Fix misdisplay of PNG paletted imagesPaul Eggert2019-08-251-9/+25
| | | | | | | | | | | Problem reported by Roland Winkler (Bug#37153). Derived from a patch suggested by YAMAMOTO Mitsuharu (Bug#37153#62). * src/image.c (png_get_valid) [WINDOWSNT]: Do not dynamically link this function. (png_get_tRNS) [WINDOWSNT && PNG_tRNS_SUPPORTED]: Dynamically link this function instead. (png_load_body): Do not assume that every paletted image supplies only transparency data. Fix typo in use of transparent_p.
* Fix a recent change in coding.cEli Zaretskii2019-08-252-7/+14
| | | | | | | | | | This partially reverts the changes in "extern function cleanup". * src/coding.c (encode_string_utf_8, decode_string_utf_8): Now extern again. They should NOT be static, as they are intended to be used by the likes of json.c, where we need highly-optimized code for processing UTF-8 strings. E.g., decode_string_utf_8 beats make_string_from_utf8 by a factor of 2 to 5 in a large number of scenarios.
* ; Improve a recent change.Eli Zaretskii2019-08-251-1/+2
| | | | | * src/frame.c (Fx_parse_geometry): Improve the comment about non-initialization of some locals.
* Clarify Fx_parse_geometry initializationPaul Eggert2019-08-241-5/+6
| | | | | * src/frame.c (Fx_parse_geometry): Clarify why local init isn’t needed.
* Tweak time arithmetic performancePaul Eggert2019-08-241-4/+4
| | | | | * src/timefns.c (time_arith): Prefer mpz_divexact to mpz_tdiv_q when either will do.
* Speed up % and mod with fixnum denomPaul Eggert2019-08-241-48/+52
| | | | | | | * src/data.c (integer_remainder): New function. When the numerator is a bignum and the denominator is small, this function uses mpz_tdiv_ui, which should be faster than mpz_tdiv_r. (Frem, Fmod): Use it.
* Tweak integer mod performancePaul Eggert2019-08-241-1/+1
| | | | | | * src/data.c (integer_mod): Use mpz_tdiv_r not mpz_mod, as that’s more similar to the fixnum case, is a bit more efficient, and otherwise the later ‘sgn_r < 0’ code is useless anyway.
* Make (mod 1.0 0) consistent with (/ 1.0 0)Paul Eggert2019-08-241-1/+3
| | | | | | * src/data.c (Fmod): Do not signal an error for (mod 1.0 0), for the same reason (/ 1.0 0) does not signal an error. * test/src/data-tests.el (data-tests-mod-0): New test.
* extern function cleanupPaul Eggert2019-08-249-38/+23
| | | | | | | | | | | | | Most of these functions can be static. A few are unused. * src/coding.c (encode_string_utf_8, decode_string_utf_8): Define only if ENABLE_UTF_8_CONVERTER_TEST, as they're not needed otherwise. * src/coding.c (encode_string_utf_8, decode_string_utf_8): * src/data.c (integer_mod): * src/fns.c (base64_encode_region_1, base64_encode_string_1): * src/ftfont.c (ftfont_get_fc_charset): Now static. * src/sysdep.c (verrprintf): Remove; unused.
* Tweak gnutls-peer-status reportingPaul Eggert2019-08-231-9/+7
| | | | | | | | | | * src/gnutls.c (Fgnutls_peer_status): Report :compression and :encrypt-then-mac only if the underlying GnuTLS library has the corresponding features. This give the Elisp caller a bit more information about the peer status. * lisp/net/nsm.el (nsm-protocol-check--compression): Don’t worry about compression in newer GnuTLS versions that do not support compression.
* Clarify compiler-pacifier in frame.cPaul Eggert2019-08-231-1/+1
| | | | | | * src/frame.c (Fx_parse_geometry): Pacify the compiler in a different way, so that the human reader can more easily see that the initializations are unnecessary.
* Fix compilation --without--xEli Zaretskii2019-08-231-1/+2
| | | | | | * src/xdisp.c (extend_face_to_end_of_line): Fix a recent change that moved the initialization of default_face. Reported by Glenn Morris <rgm@gnu.org>.
* Avoid a compilation warning in w32.cEli Zaretskii2019-08-231-1/+1
| | | | | * src/w32.c (logon_network_drive): Avoid compilation warning about strncpy arguments.