1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-06 03:40:56 -08:00
Commit graph

135455 commits

Author SHA1 Message Date
Stefan Monnier
2028756fa3 * src/syntax.c (update_syntax_table): Prefer 'else' to 'goto' 2019-03-01 16:04:11 -05:00
Stefan Monnier
0c834e9234 * lisp/Makefile.in (leim): Fix void-function pinyin-convert 2019-03-01 15:57:40 -05:00
Alan Mackenzie
31182c1d17 Maintain interval ->position fields correctly in update_interval
Also fix some anomalies in the handling of byte positions in regexp-emacs.c
This fixes bug #34525.

* src/intervals.c (SET_PARENT_POSITION): New macro.
(update_interval): When moving to an interval's parent, set that parent's
->position field, to maintain the consistency of the tree.

* src/intervals.h (struct interval): Amend the comment describing when
->position is valid.

* src/pdumper.c: Update the hash associated with struct interval.

* src/regex-emacs.c: (re_match_2_internal): Only invoke POINTER_TO_OFFSET on a
known character boundary.  Only perform arithmetic on character positions, not
on byte positions.  Correct the argument to an invocation of
UPDATE_SYNTAX_TABLE_FORWARD by adding 1 to it (in case wordend:).

* src/syntax.c: (update_syntax_table): Remove the now redundant code that set
the ->position field of all parents of the interval found by update_interval.
2019-03-01 17:37:56 +00:00
Glenn Morris
287f2a6764 ; Merge from origin/emacs-26
The following commit was skipped:

5ec7ca1 (origin/emacs-26) ; Auto-commit of loaddefs files.
2019-03-01 09:40:22 -08:00
Glenn Morris
cf563dac1f Merge from origin/emacs-26
9df1365 Fix a typo in the Calc manual
f3dab02 Minor improvement in cross-references of the ELisp manual
560c84b Fix last change on 'compilation-parse-errors'
2019-03-01 09:40:22 -08:00
Glenn Morris
b628699ad5 ; Merge from origin/emacs-26
The following commit was skipped:

1dff097 Backport: js--re-search-backward-inner: Fix infloop
2019-03-01 09:40:22 -08:00
Glenn Morris
3c1407cedf Merge from origin/emacs-26
dee3cdc Minor improvement for docs of completion
c86d419 ; * src/image.c (imagemagick_load, svg_load): Fix typos in co...
6d46fa9 Disable the timerfd interface on Cygwin
3707ea4 Fix a typo in the doc string of 'regex-opt'
d9905d5 Document bash 5.0.0 misbehavior in tramp.texi (Bug#34192)

# Conflicts:
#	doc/misc/tramp.texi
2019-03-01 09:40:22 -08:00
Paul Eggert
7e29eae023 Suppress GC stats when obviously not needed
This should help future improvements where these stats can be
bignums that do not fit into intmax_t.
* src/alloc.c (struct gcstat, gcstat): New type and static var,
to package up GC statistics into one C object.  It replaces ...
(total_free_intervals, total_intervals, total_strings)
(total_free_strings, total_string_bytes, total_vectors)
(total_vector_slots, total_free_vector_slots): ... these
removed static vars.  All uses changed.
(garbage_collect_1): Accept a struct gcstat *, not a void *
which was not used anymore anyway.  Return a bool indicating
success, instead of a Lisp object.  All callers changed.
(garbage_collect): New function.  All C callers of
Fgarbage_collect changed to use it, since none of them use the
return value.  Now, only Lisp code uses Fgarbage_collect.
(Fgarbage_collect): No longer noinline.  Cons up the return
value here, not in garbage_collect_1.
2019-03-01 09:09:47 -08:00
Glenn Morris
fb52d961a4 ; Auto-commit of loaddefs files. 2019-03-01 07:31:58 -05:00
Glenn Morris
5ec7ca14d9 ; Auto-commit of loaddefs files. 2019-03-01 06:23:38 -05:00
Eli Zaretskii
9df1365f38 Fix a typo in the Calc manual
* doc/misc/calc.texi (Algebraic Tutorial): Fix parentheses in
@example.  (Bug#34689)
2019-03-01 12:30:47 +02:00
Eli Zaretskii
f3dab02232 Minor improvement in cross-references of the ELisp manual
* doc/lispref/modes.texi (Minor Mode Conventions): Add
cross-references to related major-mode descriptions.  (Bug#34678)
2019-03-01 12:25:40 +02:00
Eli Zaretskii
ed087faa9b Don't signal Quit from 'while-no-input' on TTY frames
* src/keyboard.c (read_char): Don't inject quit-char after
longjmp if while-no-input is in effect.  (Bug#34535)
2019-03-01 12:19:03 +02:00
Tobias Bading
560c84b62b Fix last change on 'compilation-parse-errors'
* lisp/progmodes/compile.el (compilation-parse-errors): Fix
previous change in this function.  (Bug#34479)

Copyright-paperwork-exempt: yes
2019-03-01 12:06:06 +02:00
Evan Moses
4b63c21f08 Add 'breakpoint' to builtins for Python
* lisp/progmodes/python.el (python-font-lock-keywords-level-2)
(python-font-lock-keywords-maxiumum-decoration): Add 'breakpoint'
to the list of builtins, it's new as of Python 3.7.

Copyright-paperwork-exempt: yes
2019-03-01 11:51:35 +02:00
Eli Zaretskii
8eb94161b3 Be more defensive regarding elements of 'load-history'
* lisp/loadhist.el (file-dependents):
* lisp/apropos.el (apropos-library):
* lisp/help-fns.el (help-fns--autoloaded-p, help--loaded-p):
* lisp/emacs-lisp/package.el (package--list-loaded-files):
Don't assume 'load-history' elements must have a string as their
'car'.  (Bug#34462)
2019-03-01 11:44:52 +02:00
Alan Mackenzie
cb95d771a2 * src/pdumper.c: Clarify the message about updating hash values 2019-03-01 09:25:43 +00:00
Eli Zaretskii
f62f7db2c8 ; * src/xfaces.c (syms_of_xfaces): Fix last change. 2019-03-01 10:42:59 +02:00
Federico Tedin
63d0dc7937 Allow control on the threshold for using 'distant-foreground'
* src/xfaces.c (NEAR_SAME_COLOR_THRESHOLD): Macro deleted.
(load_face_colors): Compare against
face_near_same_color_threshold instead of
NEAR_SAME_COLOR_THRESHOLD.
(syms_of_xfaces) <face-near-same-color-threshold>: New
variable.  (Bug#34001)

* etc/NEWS: Announce the change.
2019-03-01 10:36:59 +02:00
Juri Linkov
44b7436d44 * lisp/replace.el (flush-lines): Return the number of deleted lines.
When called interactively, also print the number. (Bug#34520)

* doc/emacs/search.texi (Other Repeating Search): Update
flush-lines that prints the number of deleted lines.
2019-02-28 23:32:39 +02:00
Eli Zaretskii
5d60229bf1 Avoid rare crashes in xbacktrace
* src/eval.c (backtrace_thread_p, backtrace_top): Don't
segfault in "xbacktrace" if called before the specpdl
machinery is initialized in pdumped Emacs.
2019-02-28 21:16:10 +02:00
Michael Albinus
0a5212b996 Adapt test names in tramp-archive-tests.el
* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test39-make-nearby-temp-file)
(tramp-archive-test42-file-system-info)
(tramp-archive-test45-auto-load)
(tramp-archive-test45-delay-load): Rename.
2019-02-28 10:34:33 +01:00
Michael Albinus
a80e10458a Use proper read syntax for all function names in Tramp
* lisp/net/tramp.el:
* lisp/net/tramp-adb.el:
* lisp/net/tramp-archive.el:
* lisp/net/tramp-cache.el:
* lisp/net/tramp-cmds.el:
* lisp/net/tramp-compat.el:
* lisp/net/tramp-ftp.el:
* lisp/net/tramp-gvfs.el:
* lisp/net/tramp-integration.el:
* lisp/net/tramp-rclone.el:
* lisp/net/tramp-sh.el:
* lisp/net/tramp-smb.el:
* lisp/net/tramp-sudoedit.el:
* test/lisp/net/tramp-archive-tests.el:
* test/lisp/net/tramp-tests.el: Use proper read syntax for all
function names.
2019-02-28 10:33:05 +01:00
Paul Eggert
4927f94792 Escape HTML NUL as &#0; in eww
* lisp/net/eww.el (eww-display-html): Escape NUL as &#0; as this
is more appropriate for HTML.
2019-02-27 14:37:38 -08:00
Juri Linkov
4a16e6302d * lisp/vc/vc-annotate.el: Better error handling (bug#34532)
* lisp/vc/vc-annotate.el (vc-annotate-revision-previous-to-line):
Print message when prev-rev is nil.
2019-02-27 23:18:10 +02:00
Juri Linkov
5962a7c341 Directional window swap states (bug#34656)
* lisp/windmove.el (windmove-swap-states-in-direction)
(windmove-swap-states-left, windmove-swap-states-up)
(windmove-swap-states-down, windmove-swap-states-right)
(windmove-swap-states-default-keybindings): New functions.
2019-02-27 23:12:00 +02:00
Juri Linkov
5644369008 * doc/emacs/frames.texi (Multiple Displays): Add make-frame-on-monitor.
* doc/lispref/frames.texi (Multiple Terminals): Add make-frame-on-monitor.
(Bug#34516)
2019-02-27 22:55:41 +02:00
Arash Esbati
b18cecf89b Improve matching of key-val labels (bug#34629)
* lisp/textmodes/reftex-vars.el (reftex-label-regexps): Improve
regexp for key-val labels in order to skip over content in braces.
2019-02-27 18:22:08 +01:00
Robert Pluim
d07f3aae48 Replace NUL characters when calling into libxml
2019-02-27  Robert Pluim  <rpluim@gmail.com>

* lisp/net/eww.el (eww-display-html): Replace NUL characters with
"\0", as libxml can't handle embedded NULLs.  (Bug#34469)
2019-02-27 17:19:21 +01:00
Stefan Monnier
9564fc33f5 * lisp/emacs-lisp/pcase.el (pcase--make-docstring): Autoload 2019-02-27 11:01:15 -05:00
John Shahid
52cd63d528 Add text properties to newlines used to unwrap long lines.
* lisp/term.el (term-emulate-terminal): do it.
2019-02-27 08:53:14 -05:00
Paul Eggert
e828765d01 DEFVAR_INT variables are now intmax_t
Formerly they were fixnums, which led to problems when dealing
with values that might not fit on 32-bit platforms, such as
string-chars-consed or floats_consed.  64-bit counters should
be good enough for these (for a while, anyway...).
While we’re at it, fix some unlikely integer overflow bugs
that have been in the code for a while.
* lib-src/make-docfile.c (write_globals):
* src/data.c (do_symval_forwarding, store_symval_forwarding):
* src/eval.c (restore_stack_limits, call_debugger):
* src/frame.h (struct frame.cost_calculation_baud_rate):
* src/keyboard.c (last_auto_save, bind_polling_period, read_char):
* src/lisp.h (struct Lisp_Intfwd.intvar):
* src/lread.c (defvar_int):
* src/pdumper.c (dump_fwd_int):
* src/thread.h (struct thread_state.m_lisp_eval_depth):
* src/undo.c (truncate_undo_list):
* src/xselect.c (wait_for_property_change)
(x_get_foreign_selection):
* src/xterm.c (x_emacs_to_x_modifiers):
DEFVAR_INT variables now have the C type intmax_t, not EMACS_INT.
* src/data.c (store_symval_forwarding):
* src/gnutls.c (Fgnutls_boot):
* src/keyboard.c (bind_polling_period):
* src/macros.c (pop_kbd_macro, Fexecute_kbd_macro):
* src/undo.c (truncate_undo_list):
Allow any integer that fits into intmax_t, instead of
requiring it to be a Lisp fixnum.
* src/dispnew.c (update_window):
* src/frame.c (x_figure_window_size):
* src/gnutls.c (init_gnutls_functions)
(emacs_gnutls_handle_error):
* src/keyboard.c (make_lisp_event):
* src/nsterm.m (ns_dumpglyphs_image):
* src/profiler.c (make_log):
* src/scroll.c (calculate_scrolling)
(calculate_direct_scrolling):
* src/termcap.c (tputs):
* src/xterm.c (x_draw_image_relief):
Avoid implementation-defined behavior on conversion of
out-of-range integers.
* src/eval.c (when_entered_debugger): Now intmax_t.
(max_ensure_room): New function, that avoids signed integer overflow.
(call_debugger, signal_or_quit): Use it.
* src/fileio.c (Fdo_auto_save):
* src/keyboard.c (make_lisp_event):
* src/term.c (calculate_costs):
* src/xdisp.c (build_desired_tool_bar_string)
(hscroll_window_tree, try_scrolling, decode_mode_spec)
(x_produce_glyphs):
Avoid signed integer overflow.
* src/lisp.h (clip_to_bounds): Generalize to intmax_t.
* src/pdumper.c (dump_emacs_reloc_immediate_emacs_int): Remove, ...
(dump_emacs_reloc_immediate_intmax_t): ... replacing with this
function.  All uses changed.
* src/profiler.c (make_log): Omit args.  All callers changed.
* src/termcap.c: Include stdlib.h, for atoi.
Include intprops.h.
* src/window.c (sanitize_next_screen_context_lines): New function.
(window_scroll_pixel_based, window_scroll_line_based):
Use it to avoid signed integer overflow.
2019-02-27 01:23:30 -08:00
Paul Eggert
2f7885a4b3 Fix mod-test build failure
Problem reported by Glenn Morris in:
https://lists.gnu.org/r/emacs-devel/2019-02/msg00739.html
* test/Makefile.in (HYBRID_MALLOC, LIBEGNU_ARCHIVE):
New macros, taken from ../src/Makefile.in.
(MODULE_CFLAGS): Add -I$(srcdir)/../lib.
($(test_module)): Link $(LIBEGNU_ARCHIVE) too.
2019-02-25 17:45:10 -08:00
Juri Linkov
e0668e6871 * lisp/vc/diff-mode.el (diff-font-lock-keywords): Add more Git headers.
* lisp/gnus/mm-view.el (mm-display-inline-fontify): Set mode to
the selected major-mode, so diff-mode could be detected afterwards.
2019-02-25 23:27:47 +02:00
Juri Linkov
57d2f24005 * lisp/frame.el (make-frame-on-monitor): New command. (Bug#34516)
(make-frame-on-display): Add completion on available display names.
2019-02-25 23:11:34 +02:00
Tassilo Horn
e73adad837 ; Fixup docs for replace-{buffer,region}-contents 2019-02-25 21:07:24 +01:00
Tassilo Horn
3ec62eecdf ; Delete unused variable replace-buffer-contents-max-secs
This variable is a leftover of my now deleted
scratch/replace-region-contents branch and has never been used in
master.
2019-02-25 20:57:25 +01:00
Paul Eggert
e3bb6f90e9 format-time-string: document new '+' flag
* doc/lispref/os.texi (Time Parsing), etc/NEWS:
* src/timefns.c (Fformat_time_string): Document the new
behavior, added for compatibility with POSIX.1-2017.
2019-02-25 11:34:43 -08:00
Paul Eggert
0d49078ad8 Update from Gnulib
This incorporates:
2019-02-24 nstrftime: support the ‘+’ flag
2019-02-24 stat, lstat: fix conflict with relocatable-prog-wrapper
2019-02-23 nstrftime: tweak arg order
2019-02-21 nstrftime: merge glibc strftime changes
2019-02-02 vla: add commentary about VLA_ELEMS
* build-aux/config.guess, doc/misc/texinfo.tex, lib/fstatat.c:
* lib/lstat.c, lib/nstrftime.c, lib/vla.h:
Copy from Gnulib.
2019-02-25 08:27:40 -08:00
Dmitry Gutov
1dff097393 Backport: js--re-search-backward-inner: Fix infloop
Fix JS indentation infloop reported in
https://github.com/mooz/js2-mode/issues/513.

* lisp/progmodes/js.el (js--re-search-backward-inner): Account for
multiline string literals.
* test/manual/indent/js.js: New test example.

(cherry picked from commit b01a4295c2)
2019-02-25 19:14:20 +03:00
Michael Albinus
cedc3410d4 Adapt hooks in Tramp
* lisp/net/tramp-archive.el (tramp-archive-cleanup-hash):
Remove autoload cookie.
(tramp-cleanup-all-connections-hook): Add `tramp-archive-cleanup-hash'.

* lisp/net/tramp-cmds.el (tramp-cleanup-connection-hook)
(tramp-cleanup-all-connections-hook): New hook variables.
(tramp-cleanup-connection): Set `tramp-current-connection' always
to nil.
(tramp-cleanup-connection): Do not call `tramp-recentf-cleanup'.
Run ´tramp-cleanup-connection-hook`.
(tramp-cleanup-all-connections): Do not call
`tramp-archive-cleanup-hash' and ´tramp-recentf-cleanup'.  Run
`tramp-cleanup-all-connections-hook'.

* lisp/net/tramp-ftp.el (top): Simply call `tramp-disable-ange-ftp'.

* lisp/net/tramp-integration.el (tramp-recentf-cleanup-all): New defun.
(top): Adapt `tramp-integration-unload-hook',
`tramp-cleanup-connection-hook' and
`tramp-cleanup-all-connections-hook'.
2019-02-25 11:59:52 +01:00
Alex Branham
6a3b1aaa06
* lisp/comint.el (comint-skip-input): Set inhibit-read-only to t
Bug#33975
2019-02-24 19:10:36 -06:00
Philipp Stephani
72ec233f2a Ignore pending_signals when checking for quits.
pending_signals is often set if no quit is pending.  This results in
bugs in module code if the module returns but no quit is actually
pending.

As a better alternative, add a new process_input environment function
for Emacs 27.  That function processes signals (like maybe_quit).

* configure.ac: Add module snippet for Emacs 27.

* src/module-env-27.h: New file.

* src/emacs-module.h.in: Add process_input function to environment
interface.

* src/emacs-module.c (module_should_quit): Use QUITP macro to check
whether the caller should quit.
(module_process_input): New function.
(initialize_environment): Use it.

* src/eval.c: Remove obsolete comment.

* test/data/emacs-module/mod-test.c (signal_wrong_type_argument)
(signal_errno): New helper functions.
(Fmod_test_sleep_until): New test module function.

* test/src/emacs-module-tests.el (mod-test-sleep-until): New unit
test.

* doc/lispref/internals.texi (Module Misc): Document process_input.
2019-02-24 22:43:07 +01:00
Stefan Monnier
5653b76d0b * lisp/term.el: Fix minor compilation issues with cl-lib and lexbind
Remove left-over comment from the bulk comint->term query/replace.
(term-command-function): Rename from term-command-hook.
Give it a global default value.
(term-suppress-hard-newline): Mark it as generally obsolete.
(term-mode): Don't manually make hooks buffer-local.
(term--remove-fake-newlines): Fix assert -> cl-assert.
(term-char-mode): Use add-function.
(term-send-input): Use run-hook-with-args.
(term-dynamic-complete): Use run-hook-with-args-until-success.
(term-dynamic-simple-complete): Completion tables can be plain lists.
(serial-read-name): Simplify and fix misuse of `set`.
2019-02-24 16:19:59 -05:00
John Shahid
467e6ccb85 Adjust line wrapping on window resize and killing text
* lisp/term.el (term-mode): Advice filter-buffer-substring-function to
remove line unwrapping from killed text.
(term-reset-size): Add or remove line unwrapping depending on the new
terminal width.
(term-suppress-hard-newline): Mark obsolete.
(term-unwrap-line): Use text properties to be able to find the
newlines later.
2019-02-24 15:45:01 -05:00
Eric Abrahamsen
28f7e981c1 Make pinyin to Chinese character mapping available to elisp
* leim/Makefile.in: Build the file pinyin.el from pinyin.map.
* lisp/international/titdic-cnv.el (pinyin-convert): New function that
  writes the library pinyin.el, containing a new constant
  `pinyin-character-map'.
* .gitignore: Ignore the generated pinyin.el file.
2019-02-24 10:57:05 -08:00
Richard Stallman
13e6275e58 fix rmail armor decryption problems
* lisp/mail/rmail.el (rmail-epa-decrypt): Don't decrypt an armor
that was copied into the message from a message it is a reply to.
(rmail-epa-decrypt-1): Catch and ignore errors in
epa-decrypt-region.  Make armor-start and armor-end markers.
2019-02-24 10:46:14 -08:00
Richard Stallman
5a51347027 Don't clobber epa-mail-aliases
* lisp/epa-mail.el (epa-mail-default-recipients):
Copy elements of epa-mail-aliases; don't clobber them.
2019-02-24 08:46:54 -08:00
Eli Zaretskii
982e8f7b21 * doc/lispref/text.texi (Replacing): Fix a typo in recent change. 2019-02-24 18:03:21 +02:00
Michael Albinus
cbcb571876 Cleanup also recentf files in Tramp
* doc/misc/tramp.texi (Cleanup remote connections): Mention also
recentf cache.

* lisp/net/tramp-cmds.el (tramp-cleanup-connection)
(tramp-cleanup-all-connections): Call `tramp-recentf-cleanup'.

* lisp/net/tramp-integration.el: New package.

* lisp/net/tramp.el (tramp-rfn-eshadow-overlay)
(tramp-rfn-eshadow-setup-minibuffer)
(tramp-rfn-eshadow-update-overlay-regexp)
(tramp-rfn-eshadow-update-overlay):
(tramp-eshell-directory-change): Move to tramp-integration.el
2019-02-24 11:15:49 +01:00