summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix 'expand-file-name' during startup on MS-WindowsEli Zaretskii2016-11-285-7/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/w32.c (w32_init_file_name_codepage): New function, resets file_name_codepage and w32_ansi_code_page to undo the values recorded during dumping. (codepage_for_filenames): Fix an embarrassing typo. Ignore the cached value of file-name encoding if it is nil, i.e. not initialized yet. Actually cache the last used file-name encoding to avoid calling APIs when not necessary. * src/w32.h (w32_init_file_name_codepage): Add prototype. * src/w32term.c (syms_of_w32term): Set the value of w32_unicode_filenames according to the OS version. This avoids resetting it during startup, which then causes temacs to run with the incorrect value. * src/emacs.c (main): Call w32_init_file_name_codepage early during the startup. * src/fileio.c (Fexpand_file_name) [WINDOWSNT]: Update 'newdir' after converting $HOME to a UTF-8 string, so that 'newdirlim' is consistent with it. (Bug#25038) * lisp/international/mule-cmds.el (set-locale-environment): Set 'default-file-name-coding-system' to the ANSI codepage even in non-interactive sessions. * lisp/files.el (directory-abbrev-alist, abbreviated-home-dir): Doc fix. (abbreviate-file-name): Decode 'abbreviated-home-dir' if it is a unibyte string. * doc/lispref/files.texi (Directory Names): Index 'directory-abbrev-alist'.
* ; * src/lread.c (openp): Correct an inaccuracy in commentary.Eli Zaretskii2016-11-221-1/+1
|
* Improve documentation of functions that accept time valuesEli Zaretskii2016-11-181-12/+26
| | | | | | | | | | | | | | * doc/lispref/os.texi (Time Calculations): Mention the meaning of 'nil' or a scalar number as the time-value argument. Add a cross-reference to 'float-time' for computing a time difference as a scalar number of seconds. * src/editfns.c (Fformat_time_string, Ftime_less_p) (Ftime_subtract, Ftime_add, Fdecode_time, Fcurrent_time_string) (Fcurrent_time_zone): Mention in the doc strings the meaning of nil argument and the fact that a time value can be a scalar number of seconds since the epoch. (Ftime_subtract): Mention 'float-time'.
* Speed up initialization by preferring /dev/urandom to GnuTLSDaniel Colascione2016-11-181-18/+26
| | | | | | * src/sysdep.c (init_random): Try /dev/urandom before GnuTLS. (cherry picked from commit a37eba849eddc41375ad73974f6fcb1258aa8eba)
* Modernize usage of 'macOS' in doc and commentsPaul Eggert2016-11-0615-61/+61
| | | | | | | | Apple changed the spelling of its operating system again, to "macOS", effective with macOS 10.12 Sierra (2016-09-20). Change Emacs documentation and comments to match this. Stick with older OS spellings ("OS X", "Mac OS X") when talking about older releases where the older names are more correct.
* Prefer comments /* like this */ in C codePaul Eggert2016-11-0510-16/+15
| | | | | | | Emacs C code assumes C99 features, but has long used traditional comments /* like this */ instead of C99-style comments // like this. Stick with traditional comments for now, partly for style, partly as it may be safer with compilers that are not fully in C99 mode.
* ; Spelling fixesPaul Eggert2016-11-042-5/+5
|
* 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".
* 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-254-107/+14
| | | | | | | | | | | | | | 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.
* 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)
* Port --enable-gcc-warnings to bleeding-edge glibcPaul Eggert2016-10-231-7/+6
| | | | | | | | | | | Bleeding-edge glibc sets emacs_cv_var_doug_lea_malloc to 'no'. Do not merge to master. * configure.ac: Check for valloc decl when compiling gmalloc.c. * src/gmalloc.c (emacs_abort) [emacs]: Adjust decl to match what is in lisp.h. Remove duplicate decl. (aligned_alloc): #undef before defining. (aligned_alloc, memalign) [!MSDOS]: Declare. (valloc) [HAVE_DECL_VALLOC]: Remove duplicate decl.
* 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)
* Avoid relocating buffers while libxml2 reads its textEli Zaretskii2016-10-231-0/+8
| | | | | * src/xml.c (parse_region) [REL_ALLOC]: Freeze the ralloc arena while libxml2 reads the current buffer's text. (Bug#24764)
* ; Remove redundant code in gmalloc.cEli Zaretskii2016-10-231-4/+0
| | | | | * src/gmalloc.c [WINDOWSNT]: Remove MS-Windows only inclusion of w32heap.h, as the MS-Windows build no longer uses gmalloc.c.
* Attempt to catch reads from a buffer that is relocatedEli Zaretskii2016-10-231-2/+9
| | | | | * src/xml.c (parse_region): Add assertion to ensure buffer text is not relocated while libxml2 is reading it. (Bug#24764)
* ;* src/w32heap.c: Fix typo and wording of the comments.Eli Zaretskii2016-10-231-7/+7
|
* * src/regex.c (re_search_2): Make new code safe for -Wjump-misses-init.Paul Eggert2016-10-231-3/+6
|
* Port to GCC 6.2.1 + --enable-gcc-warningsPaul Eggert2016-10-221-17/+19
| | | | | | | * src/regex.c (ENSURE_FAIL_STACK, re_search_2): Redo recent regex changes to avoid complaints from GCC 6.2.1 when Emacs is configured with --enable-gcc-warnings. Also, work around GCC bug 78081, which was uncovered by this new code.
* Fix handling of allocation in regex matchingNoam Postavsky2016-10-214-17/+103
| | | | | | | | | | | | | | | | | | | | | | | | `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.
* * src/regex.h (re_match_object): Improve commentary.Eli Zaretskii2016-10-191-2/+6
|
* Fix time-related data types in 2 editfns.c functionsEli Zaretskii2016-10-171-2/+9
| | | | | | | * src/editfns.c (format_time_string, Fcurrent_time_zone): Pass a pointer to time_t value to emacs_localtime_rz and gmtime_r, instead of relying on struct timespec's tv_sec member to be of compatible type.
* Avoid crashes due to objects read with the #n=object formEli Zaretskii2016-10-141-1/+12
| | | | | | * src/lread.c (read1): Use Fcons for 'placeholder', not AUTO_CONS, because elements of the list in 'read_objects' cannot be allocated off the stack. (Bug#24640)
* Fix crash in evaluating functionsPhilipp Stephani2016-10-131-2/+4
| | | | | | | See Bug#24673 * src/eval.c (funcall_lambda): Fix crash for bogus functions such as (closure).
* * src/filelock.c (current_lock_owner): Update comment.Paul Eggert2016-10-121-4/+4
|
* Port --enable-gcc-warnings to GCC 6.2.1Paul Eggert2016-10-123-25/+33
| | | | | | | | | Backport from master. * src/conf_post.h (GNUC_PREREQ): New macro. * src/keyboard.c: Use it to work around GCC bug 54561. * src/process.c (would_block): New function. (server_accept_connection, wait_reading_process_output, send_process): Use it.
* Work around Samba bug with ':' in symlink contentsPaul Eggert2016-10-121-13/+22
| | | | | | * src/filelock.c (current_lock_owner): When reading the contents of a lock, treat the UTF-8 for U+F022 as if it were ':' (Bug#24656). Backport from master.
* Port last_marked change to full-program optimizersPaul Eggert2016-10-121-3/+1
| | | | * src/alloc.c (last_marked): Now EXTERNALLY_VISIBLE.
* Adapt GDB scripts to '--enable-check-lisp-object-type' buildsEli Zaretskii2016-10-121-2/+1
| | | | | | | | | | * etc/emacs-buffer.gdb <$qnil>: New variable. (ybuffer-list, yset-buffer): Use $qnil for comparing against 'nil', as direct comparison with Qnil doesn't work in a build with '--enable-check-lisp-object-type'. * src/.gdbinit: Adapt commands of the temporary breakpoint in init_sys_modes to a build with '--enable-check-lisp-object-type'.
* Avoid optimizing out the last_marked[] arrayEli Zaretskii2016-10-111-1/+3
| | | | | | * src/alloc.c <last_marked>: No longer 'static', to avoid having it optimized out in optimized builds, which then makes debugging GC problems harder.
* Allow to disable compaction of font cachesEli Zaretskii2016-10-082-1/+18
| | | | | | | | | * src/font.c (syms_of_font) <inhibit-compacting-font-caches>: New boolean variable. * src/alloc.c (compact_font_caches): Use it to bypass the call to compact_font_cache_entry. (Bug#24634) (Bug#24565) * etc/NEWS: Mention the new variable.
* Allow selection of font for symbols as in Emacs 24.xEli Zaretskii2016-10-081-1/+12
| | | | | | | | | | * src/fontset.c (syms_of_fontset) <use-default-font-for-symbols>: New boolean variable. (face_for_char): Use it to fall back to pre-Emacs 25.1 behavior when selecting fonts for displaying symbol and punctuation characters. (Bug#24644) * etc/NEWS: Mention the new variable.
* Fix infloop in redisplay due to truncated lines and invisible textEli Zaretskii2016-10-081-2/+3
| | | | | | | | | * src/xdisp.c (forward_to_next_line_start): Don't call 'get_next_display_element' after finding the end of line. This avoids setting the row's end position to the wrong value when the next screen line begins with invisible text; that wrong value caused set_cursor_from_row position the cursor in the wrong screen line, and eventually triggered bug#24109.
* Fix compilation with MinGW runtime 3.22.2 and w32api 3.18.2Eli Zaretskii2016-10-061-0/+17
| | | | | | | | | | | | | | | | | * nt/inc/ms-w32.h (_WIN32_WINNT) [!MINGW_W64]: Undefine before defining to avoid redefinition warnings. * nt/inc/sys/stat.h (_SYS_STAT_H, _INC_STAT_H): Define, to avoid inclusion of sys/stat.h from the system headers, which could then lead to compilation errors due to redefinition of 'struct stat' etc. This is needed because latest versions of MinGW runtime include sys/stat.h from wchar.h. * src/image.c (__MINGW_MAJOR_VERSION) [WINDOWSNT]: Temporarily redefine to 4 to avoid conflict between 2 definitions of MemoryBarrier. (Bug#24613) Do not merge to master!
* * src/alloc.c: call only non-null finalizersAurelien Aptel2016-10-051-1/+2
|
* Avoid crashes when setting the cursorEli Zaretskii2016-10-041-2/+1
| | | | | | * src/xdisp.c (display_and_set_cursor): Don't index glyphs of a glyph row if hpos is out of valid bounds. This avoids crashes in some rare cases. (Bug#24614)
* Restore 'command-debug-status' functionalityPhilippe Vaucher2016-10-041-1/+5
| | | | | | | | | | | * src/callint.c (Fcall_interactively): Bind command-debug-status to nil. This restores functionality inadvertently removed in Emacs 25.1. (Bug#24555) * lisp/subr.el (command-debug-status): Declare obsolete. * doc/lispref/debugging.texi (Internals of Debugger): Document that 'command-debug-status' is obsolete.
* Document nil args of compare-buffer-substringsPhilipp Stephani2016-10-031-0/+4
| | | | | * editfns.c (Fcompare_buffer_substrings): Document behavior when the arguments are nil.
* Improve the doc string of 'format'Eli Zaretskii2016-09-231-1/+2
| | | | | | | | * src/editfns.c (Fformat): Fix ambiguity in the doc string's usage of a literal period. (Bug#24407) This was backported from master (cherry picked from commit 7123896626b06c26c4e37839ab41e41980c8f433)
* Fix (next-frame nil t) crash (Bug#24281)Martin Rudalics2016-09-231-1/+1
| | | | | | | | * src/frame.c (candidate_frame): Check minibuf argument before comparing it to zero (Bug#24281). This was backported from master (cherry picked from commit dc491c3df305a73908fe8de20b7c428a5b38c846)
* Fix debugging of string-match-p errorsNoam Postavsky2016-09-232-0/+6
| | | | | | | | | * src/eval.c (call_debugger): Bind inhibit-changing-match-data to nil so that debugger code that needs to do regexp match won't break (Bug #23949, Bug #24166, Bug#16294). This was backported from master (cherry picked from commit 7fb75680b38fe0805c2ff7e9cca3bec8121ba984)
* Fix 'vertical-motion' and 'posn-at-point' under 'visual-line-mode'Eli Zaretskii2016-09-231-12/+52
| | | | | | | | | | | | * src/xdisp.c (move_it_in_display_line_to): Don't assume we can wrap on a whitespace character if it's followed by another whitespace character. When returning under WORD_WRAP for a screen line that is continued, restore to wrap point when atpos/atx position would be displayed on the next screen line due to line-wrap. (Bug#23570) This is backported from master (cherry picked from commit 99848b37d2c3e14c0af45fc6da437a806aa58a80)
* Update commentary of STRING_CHAR and FETCH_MULTIBYTE_CHAREli Zaretskii2016-09-232-15/+2
| | | | | | | * src/character.h (STRING_CHAR): * src/buffer.h (FETCH_MULTIBYTE_CHAR): Update commentary: these two macros no longer do any character unification, so the caveats in those comments are no longer pertinent.
* Fix comments on window height macrosNoam Postavsky2016-09-111-2/+2
| | | | | | * src/window.h (WINDOW_MODE_LINE_HEIGHT, WINDOW_HEADER_LINE_HEIGHT): Fix confusing claim that "height is in pixels and in lines"; in fact it's in pixels.
* Improve and clarify documentation of subprocessesEli Zaretskii2016-08-241-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/processes.texi (Subprocess Creation, Shell Arguments): Mention 'make-process' rather than 'start-process'. Update wrt standard destinations of standard output/error streams and due to different formats of arguments accepted by 'make-process'. (Processes): Mention process objects that represent connections. (Synchronous Processes): Minor clarifications. (Asynchronous Processes): Describe 'make-process' and 'make-pipe-process' before 'start-process'. Update and expand the documentation. (Deleting Processes, Process Information, Input to Processes) (Signals to Processes, Query Before Exit, Network): Update and expand the documentation, especially wrt process objects that represent connections. (Output from Processes): Mention the possibility of separating stderr via 'make-process'. (Filter Functions): Mention that stderr by default arrives at the filter function together with stdout. (Bug#24287) * src/process.c (Fprocess_id, Fprocess_command) (Fprocess_contact, Fprocess_type, Fstop_process): Doc fixes for process objects that represent connections.
* ; ChangeLog spelling fixesPaul Eggert2016-08-211-1/+1
|
* Some assorted documentation clarificationsPhilipp Stephani2016-08-203-2/+17
| | | | | | | | | * src/fileio.c (Fwrite_region): Clarify that END is ignored if START is nil. * src/editfns.c (Fbuffer_size): Add short discussion about narrowing. * src/callproc.c (Fcall_process_region): Discuss behavior when START and END are not buffer positions.
* Improve commentary in src/character.hEli Zaretskii2016-08-181-12/+8
| | | | | | * src/character.h (BYTES_BY_CHAR_HEAD, MULTIBYTE_LENGTH) (MULTIBYTE_LENGTH_NO_CHECK, STRING_CHAR_AND_LENGTH): Remove stale info from commentary and improve it.
* * src/doc.c (Fsubstitute_command_keys): Another fix for smart quotes.Eli Zaretskii2016-08-161-1/+1
| | | | (Bug#24206)