1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-11 05:51:21 -08:00
Commit graph

129632 commits

Author SHA1 Message Date
Paul Eggert
dfe73cb06f Remove getc_unlocked configure-time check
* configure.ac (getc_unlocked): Remove check, as unlocked-io now
does this for us.
2017-06-22 13:19:29 -07:00
Paul Eggert
f6ef15cf84 Use unlocked stdio more systematically
This can improve performance significantly on stdio-bottlenecked code.
E.g., make-docfile is 3x faster on my Fedora 25 x86-64 desktop.
* admin/merge-gnulib (GNULIB_MODULES): Add unlocked-io.
* lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
* lib-src/hexl.c, lib-src/make-docfile.c, lib-src/movemail.c:
* lib-src/profile.c, lib-src/update-game-score.c:
Include unlocked-io.h instead of stdio.h, since these programs are
single-threaded.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/unlocked-io.h, m4/unlocked-io.m4: New files, copied from Gnulib.
* src/charset.c, src/cm.c, src/emacs.c, src/image.c, src/keyboard.c:
* src/lread.c, src/term.c:
Include sysstdio.h, possibly instead of stdio.h, to define
the unlocked functions if the system does not provide them.
* src/charset.c, src/lread.c (getc_unlocked):
Remove, since sysstdio.h now defines it if needed.
* src/cm.c (cmputc, cmcheckmagic):
* src/dispnew.c (update_frame, update_frame_with_menu)
(update_frame_1, Fsend_string_to_terminal, Fding, bitch_at_user):
* src/emacs.c (main, Fdump_emacs):
* src/fileio.c (Fdo_auto_save, Fset_binary_mode):
* src/image.c (slurp_file, png_read_from_file, png_load_body)
(our_stdio_fill_input_buffer):
* src/keyboard.c (record_char, kbd_buffer_get_event, handle_interrupt):
* src/lread.c (readbyte_from_file):
* src/minibuf.c (read_minibuf_noninteractive):
* src/print.c (printchar_to_stream, strout)
(Fredirect_debugging_output):
* src/sysdep.c (reset_sys_modes, procfs_ttyname)
(procfs_get_total_memory):
* src/term.c (tty_ring_bell, tty_send_additional_strings)
(tty_set_terminal_modes, tty_reset_terminal_modes)
(tty_update_end, tty_clear_end_of_line, tty_write_glyphs)
(tty_write_glyphs_with_face, tty_insert_glyphs)
(tty_menu_activate):
* src/xfaces.c (Fx_load_color_file):
Use unlocked stdio when it should be safe.
* src/sysstdio.h (clearerr_unlocked, feof_unlocked, ferror_unlocked)
(fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked)
(fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked)
(putc_unlocked, putchar_unloced): Provide substitutes if not declared.
2017-06-22 11:22:53 -07:00
Glenn Morris
18896f7913 * lisp/net/shr.el (shr-fill-text): Actually fill the text. (Bug#27399) 2017-06-22 14:11:29 -04:00
Michal Nazarewicz
21132e2623 unidata: don’t check special casing in unidata-check (bug#26656)
* admin/unidata/unidata-gen.el (unidata-check): Do not test special
casing mapping of characters since that mapping is not constructed from
the unidata.txt file.
Also, check for integer decoder and cons char earlier so that less
unnecessary processing is performed.
2017-06-22 15:58:40 +02:00
Stefan Monnier
0ee2e853ab * lisp/descr-text.el (describe-char): Avoid string-*-multibyte
Avoid string-to-multibyte and string-as-unibyte.
Don't make *Help* unibyte just because the char was in a unibyte buffer.
2017-06-22 09:47:48 -04:00
Martin Rudalics
386a3da920 Fix make_hash_table calls in lread.c
* src/lread.c (readevalloop, read_internal_start): Fix
make_hash_table calls to make build succeed.
2017-06-22 09:24:06 +02:00
Ken Raeburn
85f6aa33f5 Merge several Lisp reader speedups. 2017-06-21 22:46:10 -04:00
Ken Raeburn
59f3c86659 Create less garbage to collect while reading symbols.
* src/lread.c (read1): When interning a symbol, only create a new
string object for the name if we're going to use it for a new symbol
object.
2017-06-21 22:34:33 -04:00
Ken Raeburn
b91455633b Replace read_objects assoc list with two hash tables.
For larger input files with lots of shared data structures, an
association list is too slow.

* src/lread.c (read_objects_map, read_objects_completed): New
variables, replacing read_objects.
(readevalloop): Initialize them with hash tables before starting a
top-level read, if they're not already empty hash tables, and reset
them to Qnil afterwards if something was added to the hash tables.
(read_internal_start): Likewise.
(read1): Store first the placeholder and later the newly read object
into read_objects_map under the specified object number.  If the new
object can contain a reference to itself, store it in
read_objects_completed.
(substitute_objects_recurse): Check read_objects_completed instead of
read_objects for the known possibly-recursive objects.
(syms_of_lread): Update initializations.
2017-06-21 22:34:33 -04:00
Ken Raeburn
efe200c10d Use getc_unlocked.
* configure.ac: Check for getc_unlocked.
* src/charset.c (read_hex, load_charset_map_from_file): Use
getc_unlocked instead of getc.
(getc_unlocked) [!HAVE_GETC_UNLOCKED]: Fall back to getc.
* src/lread.c (readbyte_from_file, Fget_file_char, read1,
getc_unlocked): Likewise.
2017-06-21 22:34:33 -04:00
Stefan Monnier
6af67b4a88 Reduce lread substitutions.
* src/lread.c (read1): After reading an object using the "#n=" syntax,
if the read object is a cons cell, instead of recursively substituting
the placeholder with the new object, mutate the placeholder cons cell
itself to have the correct car and cdr values.
2017-06-21 22:34:32 -04:00
Ken Raeburn
0b3a0f30b2 Short-circuit substitutions for some simple types.
Values that don't contain other values cannot be circular, so checking
for circular objects is a waste of cycles.

* src/lread.c (substitute_object_recurse): If the subtree being
examined is a symbol, number, or property-less string, just return
it.
2017-06-21 22:34:32 -04:00
Paul Eggert
87a44b934c Limit style_format to MAX_ALLOCA
* src/editfns.c (styled_format): Subtract initial buffer size
from sa_avail, since it is nontrivial.
2017-06-21 17:27:58 -07:00
Paul Eggert
35caaf713f Limit bidi_find_bracket_pairs to MAX_ALLOCA
* src/bidi.c (MAX_BPA_STACK): Now a constant, not a macro.
Shrink it to allow for the two struct bidi_it objects in
the same frame.
(PUSH_BPA_STACK): Avoid integer overflow with enormous bidi cache.
(bidi_find_bracket_pairs): Use compile-time check instead of runtime.
2017-06-21 17:27:58 -07:00
Paul Eggert
07a3386fbb Limit insert-file-contents to MAX_ALLOCA
* src/fileio.c (READ_BUF_SIZE): Don’t allocate more than
MAX_ALLOCA bytes in a single stack array.
2017-06-21 17:27:58 -07:00
Paul Eggert
b7dfd39c8b Remove malloc_find_address relic
* src/gmalloc.c (register_heapinfo, _malloc_internal_nolock):
Omit unnecessary initialization.
2017-06-21 12:18:56 -07:00
Paul Eggert
ac1ceadce8 Fix temacs hybrid_malloc core dump
Without this patch, ./temacs would dump core sometimes on Fedora
25 x86-64.  The problem was that the hybrid allocator assumed that
all pointers into bss_sbrk_buffer are allocated via gmalloc.  This
assumption is not true on Fedora, because the standard memory
allocator calls gdefault_morecore, which means its blocks are
interleaved with our blocks.  Usually the code happened to work,
because our data structures agreed with the glibc data structures,
but this was merely luck due to a shared pedigree, and as glibc
mutates our luck has run out.
* src/gmalloc.c (ALLOCATED_BEFORE_DUMPING) [HYBRID_MALLOC]:
Remove; no longer needed.
(BLOCK): Use unsigned division, as that does the right thing near zero.
(register_heapinfo, __malloc_internal_nolock, __free_internal_nolock)
(_realloc_internal_nolock):
Big blocks now have type -1, not 0, as 0 now means the block is
not ours.
(morecore_nolock): Omit now-unnecessary casts to size_t.
(allocated_via_gmalloc) [HYBRID_MALLOC]: New function.
(hybrid_free, hybrid_realloc) [HYBRID_MALLOC]: Use it, to
avoid calling the wrong free or realloc function in some cases.
2017-06-21 12:18:56 -07:00
Katsumi Yamaoka
1de9e2986c Make gnus-article-date-user work
* lisp/gnus/gnus-art.el (article-date-ut):
Work for unfolded multi-line Date header.
(article-transform-date):
Refactor; add header name if it is missing in user-defined date line.
(article-date-user): Fix name of date type.
2017-06-21 08:12:10 +00:00
Noam Postavsky
1ed2086a03 Keep order of completion candidates (Bug#25995, Bug#24676)
* lisp/minibuffer.el (completion-pcm--filename-try-filter)
(completion-pcm--all-completions): Use nreverse to undo the reversing
caused by using push in the loop.
2017-06-20 22:44:24 -04:00
Glenn Morris
d2ea4aee02 * src/lread.c (syms_of_lread) <load-history>: Doc fix. 2017-06-20 21:35:42 -04:00
Alex Gramiak
671921137a Mark prolog indent variables as safe (bug#27369)
* lisp/progmodes/prolog.el (prolog-indent-width)
(prolog-left-indent-regexp, prolog-paren-indent-p)
(prolog-paren-indent): Add :safe property.
2017-06-20 21:05:38 -04:00
Simen Heggestøyl
3d7221d09a Remove :options' from css-electric-keys'
* lisp/textmodes/css-mode.el (css-electric-keys): Remove `:options`
since it just duplicates the default value.
2017-06-20 21:03:22 +02:00
Paul Eggert
fb45f7075a Fix crash when built by GNU Gold linker on x86
Problem reported by Andrés Musetti (Bug#27248).
* src/widget.c (emacsFrameClassRec): Do not initialize superclass here.
(emacsFrameClass): Now a function (which initializes the
superclass) instead of a variable.  All uses changed.
2017-06-20 09:01:43 -07:00
Paul Eggert
6fcbbc393e Simplify autogen.sh version checking
* autogen.sh (get_version): Simplify and make more reliable
by using expr rather than echo | sed.  Check exit status of program.
Run program in subshell in case it cannot be executed.
(check_version): Check exit status of command rather than its output.
Check return status of get_version.
2017-06-20 08:18:55 -07:00
Katsumi Yamaoka
efa2b08dcb Delete old Date header in a simple way
* lisp/gnus/gnus-art.el (article-date-ut): Don't rely on text prop
when searching the old Date header boundary in order to delete it.
2017-06-20 09:11:07 +00:00
Bastien
de296e0d2e Revert "Don't bind org-agenda key to an anonymous function"
This reverts commit 49c0ff29c2.
2017-06-20 07:54:19 +02:00
Katsumi Yamaoka
d0b3a9548c Bind enable-local-variables to nil globally (fix dbe3e41)
* lisp/gnus/mm-view.el (mm-display-inline-fontify):
Bind enable-local-variables to nil globally instead of making it
buffer-local; remove let-bind of local-enable-local-variables.
cf. <b4mtw3bbfp5.fsf@jpl.org> in the emacs-devel list.
2017-06-20 03:46:21 +00:00
Glenn Morris
27aba6d20c ; * lisp/eshell/em-basic.el: Fix commentary.
This file has never provided any such "version" command.
2017-06-19 22:24:29 -04:00
Glenn Morris
70d01daced kill-matching-buffers to optionally not confirm
* lisp/files.el (kill-matching-buffers):
Add option to not confirm killing.  (Bug#27286)
2017-06-19 21:31:50 -04:00
Glenn Morris
087e7e96fc * lisp/files.el (local-enable-local-variables): Doc fix. 2017-06-19 21:28:18 -04:00
Glenn Morris
c4bec6cc2a autogen.sh: try to check for tool being present but broken
* autogen.sh (get_version): Check return status of "--version".
(check_version): Try to distinguish between a missing tool
and a broken one.  (Bug#27288)
2017-06-19 21:13:08 -04:00
Glenn Morris
8b38720220 Avoid a custom-variable-type error (bug#27363)
* lisp/cus-edit.el (custom-variable-type):
Avoid an error due to plist-put becoming stricter of late.
2017-06-19 14:53:47 -04:00
Glenn Morris
65b323e14e Don't put deleted packages in the trash (bug#14967)
* lisp/emacs-lisp/package.el (package-delete):
Don't pay attention to delete-by-moving-to-trash.

; * etc/NEWS: Mention this.
2017-06-19 14:39:25 -04:00
Nicolas Petton
b2fcba4484 Revert "Add current-line in simple.el"
This reverts commit ae98cdf943.
2017-06-19 14:43:39 +02:00
Damien Cassou
ae98cdf943 Add current-line in simple.el
* lisp/simple.el (current-line): New function.
* test/list/simple-tests.el: Add tests for current-line.
2017-06-19 11:17:56 +02:00
Katsumi Yamaoka
dbe3e416af Don't try to eval local variables in Gnus article
* lisp/gnus/mm-view.el (mm-display-inline-fontify): Disable local vars.
2017-06-19 02:10:22 +00:00
Paul Eggert
1b75af59b3 Fix emacs-module.h cleaning
* src/Makefile.in (clean): Do not remove emacs-module.h.in.
(bootstrap-clean): Remove emacs-module.h.
2017-06-18 11:52:46 -07:00
Andreas Schwab
d03244e347 * url/url-util.el (url-get-url-at-point): Add missing group in
regex.
2017-06-18 09:16:38 +02:00
Paul Eggert
5261a7d8bc * lib/gettext.h: Merge from gnulib. 2017-06-17 15:22:13 -07:00
Paul Eggert
209ddb1092 Merge from gnulib
This (and my previous patch) incorporate:
2017-06-17 diffseq: port to GCC 7 with --enable-gcc-warnings
2017-06-15 gettext-h: Update comment
* lib/diffseq.h: Copy from gnulib.
2017-06-17 15:13:21 -07:00
Noam Postavsky
4caa8d4de4 * test/Makefile.in: Don't suppress test failure for single tests. 2017-06-17 17:45:17 -04:00
Philipp Stephani
c66a7cce17 emacs-module.h: Create emacs_env_26
This was part of the original design of the module
API (https://lists.gnu.org/archive/html/emacs-devel/2015-02/msg00960.html),
but I didn't take it into account when adding the should_quit
function.

Instead of duplicating the environment fields or using the C
preprocessor, use configure to build emacs-module.h.

* configure.ac: Expand emacs-module.h template.
2017-06-17 19:16:14 +02:00
Eli Zaretskii
f8cc7a8300 Improve documentation of replace-buffer-contents
* etc/NEWS (replace-buffer-contents): Fix formatting.

* src/editfns.c (Freplace_buffer_contents): Doc fix.
2017-06-17 19:03:30 +03:00
Philipp Stephani
61dc103969 ; * src/emacs-module.c (funcall_module): Add another FIXME 2017-06-17 17:10:41 +02:00
Philipp Stephani
c3813b2aa8 Allow local variables section to begin with a square bracket
Fixes Bug#27391.

* lisp/international/mule.el (find-auto-coding): Fix regular
expression for "Local Variables" section.

* test/lisp/international/mule-tests.el (find-auto-coding--bug27391):
Add unit test.
2017-06-17 16:10:51 +02:00
Philipp Stephani
5575db9216 Remove unnecessary point motion
* src/editfns.c (Freplace_buffer_contents): Remove unnecessary point
motion.
2017-06-17 16:09:05 +02:00
Tino Calancha
8e44350ee2 ; * etc/NEWS (Editing Changes in Emacs 26.1): Fix typo in last commit. 2017-06-17 22:58:27 +09:00
Philipp Stephani
d682f0daa3 Add command to replace buffer contents
Add a new command 'replace-buffer-contents' that uses the Myers diff
algorithm to non-destructively replace the accessible portion of the
current buffer.  The Myers algorithm is implemented in Gnulib.

* src/editfns.c (Freplace_buffer_contents): New command.
(set_bit, bit_is_set, buffer_chars_equal): New helper functions.
(syms_of_editfns): Define new command.

* test/src/editfns-tests.el (replace-buffer-contents-1)
(replace-buffer-contents-2): New unit tests.

* src/buffer.h (BUF_FETCH_CHAR_AS_MULTIBYTE): New helper macro.

* admin/merge-gnulib (GNULIB_MODULES): Add diffseq.h and minmax.h.
2017-06-17 15:40:58 +02:00
Andreas Schwab
46279c1ea1 * international/characters.el: Update list of zero and full width
characters according to Unicode 9.0.0.
2017-06-17 14:57:20 +02:00
Simen Heggestøyl
8960f6aa36 Complete CSS property values less eagerly (Bug#27392)
* lisp/textmodes/css-mode.el (css--complete-property-value): Be less
eager by looking for a colon after the property which values are being
completed for.

* test/lisp/textmodes/css-mode-tests.el (css-test-complete-property):
Add a test case ensuring that properties that are prefixes of other
properties don't hinder further completion.
2017-06-17 10:38:29 +02:00