]> git.eshelyaron.com Git - emacs.git/log
emacs.git
5 years agoAdd an assertion to xdisp.c
Eli Zaretskii [Wed, 8 May 2019 06:29:20 +0000 (09:29 +0300)]
Add an assertion to xdisp.c

* src/xdisp.c (display_mode_element): Add an assertion where
we assume that 'string' returned by decode_mode_spec is always
either a Lisp string or nil.

5 years ago* lisp/progmodes/flymake.el: Obsolete variable flymake-start-on-newline
Juri Linkov [Tue, 7 May 2019 20:29:14 +0000 (23:29 +0300)]
* lisp/progmodes/flymake.el: Obsolete variable flymake-start-on-newline

(flymake-start-syntax-check-on-newline): Mark it obsolete.
(flymake-after-change-function): Remove obsolete variable
flymake-start-syntax-check-on-newline (temporarily renamed to
flymake-start-on-newline).  (Bug#34294)

* doc/misc/flymake.texi: Remove obsolete variable.

5 years agoPacify GCC 9.1
Paul Eggert [Tue, 7 May 2019 19:26:40 +0000 (12:26 -0700)]
Pacify GCC 9.1

* src/intervals.c (set_intervals_multibyte_1): Omit unused temps.
* src/xdisp.c (display_mode_element): Use !NILP instead of
STRINGP.  This convinces GCC we’re not dereferencing a
possibly-null pointer, and should be a bit faster anyway.

5 years agoFix setting and resetting of scroll-with-delete
John Shahid [Mon, 29 Apr 2019 17:53:38 +0000 (13:53 -0400)]
Fix setting and resetting of scroll-with-delete

The start and end lines of the scroll region must to be in the range
[0,term-height).  There are few placees that incorrectly set the end
line of the scroll region to term-height which is outside the valid
range.  Combined with another off-by-one error in
term-set-scroll-region's clamping logic, this would cause
term-scroll-with-delete to be unnecessarily turned on.

* lisp/term.el (term-scroll-start,term-scroll-end): Use defvar-local
to define the variables and document the valid range of values that
the variables can take.
(term--last-line): New function to calculate the 0-based index of the
last line.
(term--reset-scroll-region): New function to reset the scroll region
to the full height of the terminal.
(term-mode,term-reset-size,term-reset-terminal): Call
term--reset-scroll-region to reset the scroll region.
(term-set-scroll-region): Fix the off-by-one error in the clamping
logic which allowed term-scroll-end to have values outside the valid
range [0,term-height).

5 years ago* src/marker.c (buf_bytepos_to_charpos): Re-add the CHAR_HEAD_P assertion
Stefan Monnier [Tue, 7 May 2019 17:41:54 +0000 (13:41 -0400)]
* src/marker.c (buf_bytepos_to_charpos): Re-add the CHAR_HEAD_P assertion

This assertion was removed in 1c349c62305d432abf0fa2b6e3f5d754fe4cab79
because the assumption was invalid during set_intervals_multibyte_1.
So we change set_intervals_multibyte_1 to solve the problem in the same
way as in the rest of Fset_buffer_multibyte, which actually simplifies
the code.

* src/buffer.c (advance_to_char_boundary): Not static any more.
* src/buffer.h (advance_to_char_boundary): Add prototype.
* src/intervals.c (set_intervals_multibyte_1): Use it.

5 years ago* doc/emacs/text.texi (Fill Commands): Use pxref in parentheses.
Glenn Morris [Tue, 7 May 2019 17:33:36 +0000 (10:33 -0700)]
* doc/emacs/text.texi (Fill Commands): Use pxref in parentheses.

5 years ago* doc/emacs/files.texi (Auto Revert): Fix makeinfo-4.13 compilation.
Glenn Morris [Tue, 7 May 2019 17:32:03 +0000 (10:32 -0700)]
* doc/emacs/files.texi (Auto Revert): Fix makeinfo-4.13 compilation.

5 years agoClarify what constitutes an event (bug#35238)
Basil L. Contovounesios [Sun, 21 Apr 2019 22:02:01 +0000 (23:02 +0100)]
Clarify what constitutes an event (bug#35238)

* doc/lispref/commands.texi (Input Events): Specify that events are
non-nil and remove vestiges of bug#10190.
* doc/lispref/os.texi (Recording Input): Document optional argument
of recent-keys.
* lisp/subr.el (eventp): Check that the car of conses is non-nil.
* etc/NEWS: Announce it as an incompatible change.
* src/keyboard.c (Frecent_keys): Clarify that returned "events" are
not real events.

5 years agoFix 'load-average' on MS-Windows
Eli Zaretskii [Tue, 7 May 2019 14:48:32 +0000 (17:48 +0300)]
Fix 'load-average' on MS-Windows

* src/w32.c (getloadavg): Always return at least one element
of the array.

5 years agoMerge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Wilson Snyder [Mon, 6 May 2019 22:35:59 +0000 (18:35 -0400)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

5 years agoFix verilog-mode module backticks; whitespace from prev commits.
Wilson Snyder [Mon, 6 May 2019 22:35:31 +0000 (18:35 -0400)]
Fix verilog-mode module backticks; whitespace from prev commits.

* verilog-mode.el (verilog-read-inst-module-matcher):
Work when point is near backtick. Reported by Mattias Engdegard.

5 years ago* lisp/emacs-lisp/lisp.el (insert-pair-alist): Turn defvar into defcustom.
Juri Linkov [Mon, 6 May 2019 19:32:26 +0000 (22:32 +0300)]
* lisp/emacs-lisp/lisp.el (insert-pair-alist): Turn defvar into defcustom.

Revert to old default value.  (Bug#35480)

5 years agoMake combine-after-change-calls work in the common case again
Stefan Monnier [Mon, 6 May 2019 18:58:20 +0000 (14:58 -0400)]
Make combine-after-change-calls work in the common case again

* src/insdel.c (signal_after_change): Allow combine_after_change_calls
even when syntax-ppss-flush-cache is on before-change-functions.

5 years agoPrevent accidental edits in the ansi-term buffer from breaking resizing
John Shahid [Sun, 28 Apr 2019 19:59:50 +0000 (15:59 -0400)]
Prevent accidental edits in the ansi-term buffer from breaking resizing

* lisp/term.el (term-unwrap-line, term-emulate-terminal): Prevent the
  `term-line-wrap` property of newlines from spreading accidentally
  when inserting text next to it.

5 years agoc-beginning-of-statement-1: Handle syntactic WS macros properly.
Alan Mackenzie [Mon, 6 May 2019 17:36:28 +0000 (17:36 +0000)]
c-beginning-of-statement-1: Handle syntactic WS macros properly.

* lisp/progmodes/cc-engine.el (c-beginning-of-statement-1): The variable
before-sws-pos should record the position of a closing paren/brace/bracket
before moving backwards over a sexp.  When there is a syntactic WS macro
between the starting point and the closing p/b/b, setq before-sws-pos again
after moving backward over the macro.

5 years ago* lisp/custom.el: Avoid adding vars to load-history multiple times
Stefan Monnier [Mon, 6 May 2019 16:37:00 +0000 (12:37 -0400)]
* lisp/custom.el: Avoid adding vars to load-history multiple times

Avoid the abuse of (eval `(defvar ...)) which tends to end up
adding redundant entries in `load-history`, as discussed in
https://lists.gnu.org/r/help-gnu-emacs/2019-03/msg00237.html

(custom-initialize-default): Don't add to load-history.
(custom-declare-variable): Use internal--define-uninitialized-variable
and only add the var to load-history once.  Do it before calling
`initialize` so the special-variable-p flag is set.

* src/eval.c (Finternal__define_uninitialized_variable): New function.
(Fdefvar, Fdefconst): Use it.
(syms_of_eval): Defsubr' it.

5 years agoUse lambda in tramp-compat-* functions
Michael Albinus [Mon, 6 May 2019 10:04:24 +0000 (12:04 +0200)]
Use lambda in tramp-compat-* functions

* lisp/net/tramp-compat.el (tramp-handle-temporary-file-directory):
Declare.
(tramp-compat-temporary-file-directory-function): Use function symbol.
(tramp-compat-file-attribute-type)
(tramp-compat-file-attribute-link-number)
(tramp-compat-file-attribute-user-id)
(tramp-compat-file-attribute-group-id)
(tramp-compat-file-attribute-modification-time)
(tramp-compat-file-attribute-size)
(tramp-compat-file-attribute-modes)
(tramp-compat-directory-name-p, tramp-compat-file-local-name)
(tramp-compat-file-name-quoted-p, tramp-compat-file-name-quote)
(tramp-compat-file-name-unquote, tramp-compat-exec-path)
(tramp-compat-time-equal-p, tramp-compat-flatten-tree):
Make them lambdas.

5 years ago; Make /etc/NEWS more consistent
Michael Albinus [Mon, 6 May 2019 09:23:54 +0000 (11:23 +0200)]
; Make /etc/NEWS more consistent

5 years agoUse simpler way to print function pointers
Paul Eggert [Mon, 6 May 2019 00:35:05 +0000 (17:35 -0700)]
Use simpler way to print function pointers

The module code can’t possibly work on weird platforms where
function pointers are wider than data pointers, so there’s no need
to bother with the stackoverflow-like approach that is intended
only for portability to such platforms.  Besides, the
stackoverflow-like approach does not work well on weird platforms
where CHAR_BIT is not a multiple of 4.
* src/lisp.h (pMx): New macro.
* src/print.c (data_from_funcptr) [HAVE_MODULES]: New function.
(print_vectorlike) [HAVE_MODULES]: Use it.
(print_object): Make sure buf is big enough for this.

5 years ago* lisp/progmodes/flymake.el (flymake-start): Check for flymake-mode.
Juri Linkov [Sun, 5 May 2019 20:07:44 +0000 (23:07 +0300)]
* lisp/progmodes/flymake.el (flymake-start): Check for flymake-mode.

Check for the value of flymake-mode after hooks are finished (bug#34294)

5 years ago* lisp/progmodes/flymake.el: Rename flymake-start-on-newline (bug#34294)
Juri Linkov [Sun, 5 May 2019 20:05:01 +0000 (23:05 +0300)]
* lisp/progmodes/flymake.el: Rename flymake-start-on-newline (bug#34294)

* lisp/progmodes/flymake.el (flymake-start-on-newline): Rename from
flymake-start-syntax-check-on-newline.
(flymake-start-syntax-check-on-newline): Define obsolete alias.
(flymake-no-changes-timeout): Add customization option nil.

* doc/misc/flymake.texi (Using Flymake): Rename variable.

5 years ago* lisp/vc/ediff-ptch.el (ediff-fixup-patch-map): Remove Git prefixes.
Juri Linkov [Sun, 5 May 2019 19:51:14 +0000 (22:51 +0300)]
* lisp/vc/ediff-ptch.el (ediff-fixup-patch-map): Remove Git prefixes.

Strip possible source/destination prefixes such as a/ and b/
from directory names.   (Bug#35420)
(ediff-fixup-patch-map, ediff-dispatch-file-patching-job)
(ediff-patch-file-internal): Replace string-match with string-match-p.

5 years agoUse ngettext instead of dired-plural-s in Dired (bug#35287)
Juri Linkov [Sun, 5 May 2019 19:43:27 +0000 (22:43 +0300)]
Use ngettext instead of dired-plural-s in Dired (bug#35287)

* lisp/dired-aux.el (dired-map-over-marks-check): Use ngettext
instead of dired-plural-s.
(dired-create-files): Also add colon after operation name.
(dired-compare-directories): Use ngettext and format-message.
(dired-do-compress-to): Use ngettext.

* lisp/dired.el (dired-internal-do-deletions)
(dired-clean-up-after-deletion): Use ngettext instead of dired-plural-s.

5 years ago* lisp/emacs-lisp/lisp.el (insert-pair-alist): Precompute default value.
Juri Linkov [Sun, 5 May 2019 19:34:03 +0000 (22:34 +0300)]
* lisp/emacs-lisp/lisp.el (insert-pair-alist): Precompute default value.

Use unicode-property-table-internal with 'paired-bracket to append
pairs of open/close characters to the default value (bug#35480).

5 years agoRename shell-command-width to async-shell-command-width (bug#35055)
Juri Linkov [Sun, 5 May 2019 19:27:33 +0000 (22:27 +0300)]
Rename shell-command-width to async-shell-command-width (bug#35055)

* lisp/simple.el (async-shell-command-width):
* lisp/net/tramp.el (tramp-handle-shell-command):
* test/lisp/net/tramp-tests.el (tramp-test32-shell-command):
* doc/misc/tramp.texi (Remote processes): Rename this variable.

* doc/emacs/misc.texi (Single Shell): Add async-shell-command-width.

5 years agoPort mod-test to --enable-gcc-warnings
Paul Eggert [Sun, 5 May 2019 16:07:44 +0000 (09:07 -0700)]
Port mod-test to --enable-gcc-warnings

* test/data/emacs-module/mod-test.c (NDEBUG): Undef, to prevent
GCC from complaining “error: unused variable ‘dummy’” and failing
to build the test, if --enable-gcc-warnings.

5 years ago; * doc/emacs/display.texi (Displaying Boundaries): Fix a typo.
Eli Zaretskii [Sun, 5 May 2019 15:10:15 +0000 (18:10 +0300)]
; * doc/emacs/display.texi (Displaying Boundaries): Fix a typo.

5 years agoFix compilation of mod-test.c on MinGW
Eli Zaretskii [Sun, 5 May 2019 15:07:26 +0000 (18:07 +0300)]
Fix compilation of mod-test.c on MinGW

* test/data/emacs-module/mod-test.c (Fmod_test_nanoseconds)
[__MINGW32__]: Use _Static_assert, not static_assert, as the
latter is not available in mingw.org's MinGW's assert.h.

5 years agoFixed fill-column-indicator face removing background.
Jimmy Aguilar Mena [Sun, 5 May 2019 14:14:34 +0000 (16:14 +0200)]
Fixed fill-column-indicator face removing background.

*lisp/faces.el: Removed background in default fill-column-indicator
 face.
*src/xdisp.c: fill-column-indicator face merged with saved face.

5 years ago;Corrected display-fill-column-indicator mode.
Jimmy Aguilar Mena [Fri, 3 May 2019 17:27:59 +0000 (19:27 +0200)]
;Corrected display-fill-column-indicator mode.

Small corrections in the documentation and code format to merge into master.

5 years ago*src/xdisp.c: Fixed fill column indicator position in terminal mode.
Jimmy Aguilar Mena [Mon, 8 Apr 2019 16:11:16 +0000 (18:11 +0200)]
*src/xdisp.c: Fixed fill column indicator position in terminal mode.

5 years agodisplay-fill-column-indicator interface corrections
Jimmy Aguilar Mena [Fri, 5 Apr 2019 10:37:59 +0000 (12:37 +0200)]
display-fill-column-indicator interface corrections

*lisp/display-fill-column-indicator.el: Fixed character selection for
the indicator based in the current faces. Extended condition to set
display-fill-column-indicator-character in graphical displays.

*src/xdisp.c: Fixed some long lines.

5 years ago;Small changes in the documentation
Jimmy Aguilar Mena [Wed, 3 Apr 2019 10:36:46 +0000 (12:36 +0200)]
;Small changes in the documentation

*src/xdisp.c: Fixed docstring for display-fill-column-indicator-column
*etc/NEWS: Concordance fix in the display-fill-column-indicator part.
*doc/emacs/display.texi: Name mismatch fix.

5 years agoAdded correction in the texinfo manual.
Jimmy Aguilar Mena [Wed, 3 Apr 2019 10:05:01 +0000 (12:05 +0200)]
Added correction in the texinfo manual.

*doc/emacs/text.texi: Added a reference to the
display-fill-column-indicator section.

5 years agoAdded fill-column-indicator manual documentation
Jimmy Aguilar Mena [Tue, 2 Apr 2019 20:52:41 +0000 (22:52 +0200)]
Added fill-column-indicator manual documentation

*etc/NEWS: reduced the comments about fill-column-indicator
*doc/emacs/display.texi: Added documentation for fill-column-indicator
 in this section in the manual

5 years agoFixed fill-column-indicator for continuation lines
Jimmy Aguilar Mena [Tue, 2 Apr 2019 14:17:41 +0000 (16:17 +0200)]
Fixed fill-column-indicator for continuation lines

*src/xdisp.c: Grouped the test conditions for
display-fill-column-indicator mode in a macro to simplify future
modifications.

5 years agoDisplay-fill-column-indicator NEWS info.
Jimmy Aguilar Mena [Mon, 18 Mar 2019 23:03:12 +0000 (00:03 +0100)]
Display-fill-column-indicator NEWS info.

*etc/NEWS: Added information about the fill-column-indicator mode.
*lisp/faces.el: Added a face for the display fill column indicator.

5 years agoStart display-fill-column-indicator-mode.
Jimmy Aguilar Mena [Tue, 12 Mar 2019 19:06:28 +0000 (20:06 +0100)]
Start display-fill-column-indicator-mode.

5 years agoDescribe, how to adapt shell command output width in Tramp
Michael Albinus [Sun, 5 May 2019 14:20:14 +0000 (16:20 +0200)]
Describe, how to adapt shell command output width in Tramp

* doc/misc/tramp.texi (Quick Start Guide, GVFS based methods):
Fix @cindex.
(Remote processes): Add some @vindex.  Describe shell command
output width.

5 years agoAvoid compiler warning in print.c
Eli Zaretskii [Sun, 5 May 2019 14:17:24 +0000 (17:17 +0300)]
Avoid compiler warning in print.c

* src/print.c (print_vectorlike): Don't use %hh, as that is
not portable enough; we don't yet assume a C99-compliant
library.

5 years agoAvoid crashes in read_integer
Eli Zaretskii [Sun, 5 May 2019 14:06:01 +0000 (17:06 +0300)]
Avoid crashes in read_integer

* src/lread.c (read_integer): Always allocate a buffer, since
we need to use it even when the radix is invalid.  (Bug#35576)

5 years ago* lisp/files.el (hack-local-variables): Don't burp when files-x isn't loaded
Stefan Monnier [Sun, 5 May 2019 12:57:04 +0000 (08:57 -0400)]
* lisp/files.el (hack-local-variables): Don't burp when files-x isn't loaded

5 years ago; SOme changes in filenotify-tests.el for EMBA
Michael Albinus [Sun, 5 May 2019 11:34:26 +0000 (13:34 +0200)]
; SOme changes in filenotify-tests.el for EMBA

* test/lisp/filenotify-tests.el (file-notify-test03-events)
(file-notify-test05-file-validity)
(file-notify-test09-watched-file-in-watched-dir): Adapt for EMBA.

5 years agoAdapt tests for recent file-notification changes in Tramp
Michael Albinus [Sun, 5 May 2019 10:20:44 +0000 (12:20 +0200)]
Adapt tests for recent file-notification changes in Tramp

* lisp/net/tramp.el (tramp-file-notify-process-sentinel):
Pacify byte compiler.

* test/lisp/autorevert-tests.el
(auto-revert-test02-auto-revert-deleted-file):
* test/lisp/filenotify-tests.el (file-notify-test03-events)
(file-notify-test05-file-validity)
(file-notify-test09-watched-file-in-watched-dir): Adapt for remote
files.

5 years agoReorganise (auto-)revert nodes in the manual
Mattias Engdegård [Tue, 30 Apr 2019 20:35:56 +0000 (22:35 +0200)]
Reorganise (auto-)revert nodes in the manual

Put all information about auto-revert into a section of its own, and
organise the text in a more logical way.  Previously it was mainly
described in the section about reverting (bug#35418).

* doc/emacs/files.texi (Files): Adjust menu.
(Reverting, Auto Revert, Autorevert): Add node `Auto Revert' and move
text on that topic from `Reverting', rearranged.  Turn the old
`Autorevert' node into a subsection under `Auto Revert'.
* doc/emacs/arevert-xtra.texi (Autorevert): Rename and turn into
subsubsection.
* doc/emacs/buffers.texi (Several Buffers): Adjust references.
* doc/emacs/emacs.texi (Top): Adjust menu.
* doc/emacs/emacs-xtra.texi (Top): Adjust menu.
(Non-File Buffers): Add node and section lines.

5 years agoAvoid suppressing -Wcast-function-type warning.
Philipp Stephani [Sat, 4 May 2019 23:56:15 +0000 (01:56 +0200)]
Avoid suppressing -Wcast-function-type warning.

GCC special-cases the type ‘void (*)(void)’ to not emit warnings when
cast, see
https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wcast-function-type.
Make use of this to remove a warning suppression.

* src/dynlib.h: Use void (*)(void) as generic function pointer type.

* src/emacs-module.c: Remove warning suppression.

5 years agoFix compilation of test module.
Philipp Stephani [Sat, 4 May 2019 23:30:23 +0000 (01:30 +0200)]
Fix compilation of test module.

Because all other objects are compiled without -fPIC, we can’t use
them when linking the test module.  Instead, use the source files
directly.

* test/Makefile.in (HYBRID_MALLOC, LIBEGNU_ARCHIVE): Remove.
($(test_module)): Use source files instead of objects and archives.

5 years agoUse extract_time in test module.
Philipp Stephani [Sat, 4 May 2019 23:23:44 +0000 (01:23 +0200)]
Use extract_time in test module.

* test/data/emacs-module/mod-test.c (Fmod_test_sleep_until): Use
extract_time for time argument.
(signal_wrong_type_argument): Remove unused function.

* test/src/emacs-module-tests.el (mod-test-sleep-until): Remove
unnecessary ‘float-time’.

5 years ago* test/Makefile.in (src/emacs-module-tests.elc): Require test module
Philipp Stephani [Sat, 4 May 2019 22:27:19 +0000 (00:27 +0200)]
* test/Makefile.in (src/emacs-module-tests.elc): Require test module

5 years agoRefactoring: Factor out a function to set an mpz_t from a Lisp int.
Philipp Stephani [Sat, 4 May 2019 21:31:40 +0000 (23:31 +0200)]
Refactoring: Factor out a function to set an mpz_t from a Lisp int.

* src/bignum.h (mpz_set_integer): New function.

* src/emacs-module.c (module_make_big_integer): Use it.

5 years agoAvoid undefined behavior when printing function pointers.
Philipp Stephani [Sat, 4 May 2019 20:59:46 +0000 (22:59 +0200)]
Avoid undefined behavior when printing function pointers.

* src/print.c (print_vectorlike): Don’t pass a function pointer to
‘snprintf’, as that is undefined behavior.  Instead, print the
individual bytes making up the function pointer.

5 years agoNotify broken file notification from Tramp
Michael Albinus [Sat, 4 May 2019 20:29:27 +0000 (22:29 +0200)]
Notify broken file notification from Tramp

* lisp/net/tramp.el (tramp-file-notify-process-sentinel): New defun.

* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-notify-add-watch):
* lisp/net/tramp-sh.el (tramp-sh-handle-file-notify-add-watch):
Set process sentinel.

5 years agoPort new fingerprinting scheme to clang + LTO
Paul Eggert [Sat, 4 May 2019 20:15:29 +0000 (13:15 -0700)]
Port new fingerprinting scheme to clang + LTO

* lib-src/make-fingerprint.c (main): Don't consider multiple
instances of the fingerprint to be an error, as this can
happen with clang and -flto.  Instead, replace all instances
of the fingerprint.  There is a tiny chance that this will
silently corrupt the Emacs executable.

This patch suggests that we should go back to fingerprinting
the inputs to the linker instead of its output, as the new
fingerprinting scheme is unnecessarily complicated and this
complexity reduces reliability. The old scheme (i.e., before
commit 2019-05-14T23:31:24Z!eggert@cs.ucla.edu) was simpler
and more portable and good enough, and it's looking like it
would be less trouble in practice than the new scheme.

5 years agoAvoid slow overlay ansi coloring in eshell (Bug#29854)
Noam Postavsky [Sat, 4 May 2019 18:47:29 +0000 (14:47 -0400)]
Avoid slow overlay ansi coloring in eshell (Bug#29854)

* lisp/ansi-color.el (ansi-color-apply-on-region): Reset temporary
markers after finishing with them.
(ansi-color-apply-text-property-face): New function.
* lisp/eshell/esh-mode.el (eshell-handle-ansi-color):
* lisp/man.el (Man-fontify-manpage): Use it as the
`ansi-color-apply-face-function' while calling
`ansi-color-apply-on-region'.  Use `font-lock-face' to propertize
instead of `face'.

5 years agoFix bytecode optimization typo
Paul Eggert [Sat, 4 May 2019 17:16:46 +0000 (10:16 -0700)]
Fix bytecode optimization typo

Problem reported by Simon Frankau (Bug#35562).
* src/bytecode.c (exec_byte_code): Fix typo when optimizing varset.

5 years agoFix Bug#35506
John Shahid [Sat, 4 May 2019 16:25:51 +0000 (18:25 +0200)]
Fix Bug#35506

* lisp/net/tramp.el (tramp-interrupt-process): Kill the entire
process group.  (Bug#35506)

5 years agoMinor fix in .gdbinit
Eli Zaretskii [Sat, 4 May 2019 16:19:58 +0000 (19:19 +0300)]
Minor fix in .gdbinit

* src/.gdbinit (xprintsym): Don't attempt to print the
symbol's name if it is not yet set.  This happens with
built-in symbols at the beginning of 'main'.

5 years ago; * src/minibuf.c (Fread_buffer): Doc fix. (Bug#35361)
Eli Zaretskii [Sat, 4 May 2019 09:47:03 +0000 (12:47 +0300)]
; * src/minibuf.c (Fread_buffer): Doc fix.  (Bug#35361)

5 years ago; * src/xfaces.c (merge_face_ref): Improve commentary.
Eli Zaretskii [Sat, 4 May 2019 06:52:11 +0000 (09:52 +0300)]
; * src/xfaces.c (merge_face_ref): Improve commentary.

5 years agoSkip tests if test subdir is missing
Paul Eggert [Fri, 3 May 2019 21:19:26 +0000 (14:19 -0700)]
Skip tests if test subdir is missing

Problem reported by Jeffrey Walton in:
https://lists.gnu.org/r/emacs-devel/2019-05/msg00041.html
* Makefile.in (CHECK_TARGETS): New macro; use it
to simplify 'check' and similar rules.
($(CHECK_TARGETS)): If tests are missing, do not fail
after issuing a diagnostic.  Just skip the tests.

5 years agoModernize INSTALL a bit
Paul Eggert [Fri, 3 May 2019 20:58:09 +0000 (13:58 -0700)]
Modernize INSTALL a bit

* INSTALL: Omit filesystem space estimates.  These estimates
were (1) wrong and (2) no longer important nowadays, as people
have plenty of space.  Instead, start with how to get and
unpack an Emacs tarball.  Don’t say "disk" as it’s often not
disk nowadays.  Update URLs.

5 years agoSimplify use of NDEBUG in etags.c
Paul Eggert [Fri, 3 May 2019 19:38:28 +0000 (12:38 -0700)]
Simplify use of NDEBUG in etags.c

* lib-src/etags.c [!DEBUG]: Do not define NDEBUG,
as that’s conf_post.h’s job now.
[NDEBUG]: Do not redefine ‘assert’, as that works around
ancient bugs (e.g., sunos4 pcc) that don’t matter any more,
as can be seen that other Emacs source files that successfully
use assert.h without this workaround.

5 years agoPacify librsvg 2.45.1 and later
Paul Eggert [Fri, 3 May 2019 19:16:33 +0000 (12:16 -0700)]
Pacify librsvg 2.45.1 and later

* src/image.c (svg_load_image): Pacify librsvg 2.45.1 and later,
and add a FIXME comment about the deprecated librsvg functions.

5 years agoSimplify xd_signature to pacify GCC 9
Paul Eggert [Fri, 3 May 2019 19:14:38 +0000 (12:14 -0700)]
Simplify xd_signature to pacify GCC 9

* src/dbusbind.c (xd_signature): Use simpler way to set up
the subsignature.  This also pacifies GCC 9 on Fedora 30 x86-64.

5 years agoUpdate from Gnulib
Paul Eggert [Fri, 3 May 2019 19:12:43 +0000 (12:12 -0700)]
Update from Gnulib

This incorporates:
2019-05-03 Port manywarnings to GCC 9
* m4/manywarnings.m4: Copy from Gnulib.

5 years agoAdd tests for remote files in auto-revert-tests
Michael Albinus [Fri, 3 May 2019 15:18:13 +0000 (17:18 +0200)]
Add tests for remote files in auto-revert-tests

* lisp/autorevert.el (auto-revert-debug): New defvar.
(auto-revert-notify-handler): Write traces.

* lisp/filenotify.el (file-notify-debug): New defvar.
(file-notify-handle-event, file-notify-callback): Write traces.

* lisp/net/tramp-sh.el (tramp-sh-handle-vc-registered):
Handle nil `vc-handled-backends'.

* test/lisp/autorevert-tests.el
(auto-revert-test-remote-temporary-file-directory): New defconst.
Handle also $REMOTE_FILE_NOTIFY_LIBRARY.
(auto-revert--test-enabled-remote-checked): New defvar.
(auto-revert--test-enabled-remote): New defun.
(auto-revert--wait-for-revert): Rewrite without timeout.
(auto-revert--deftest-remote): New defmacro.
(auto-revert-test01-auto-revert-several-files):
(auto-revert-test02-auto-revert-deleted-file): Adapt for remote files.
(auto-revert-test02-auto-revert-deleted-file):
Use `auto-revert-debug' for debug messages.
(auto-revert-test00-auto-revert-mode-remote)
(auto-revert-test01-auto-revert-several-files-mode-remote)
(auto-revert-test02-auto-revert-deleted-file-mode-remote)
(auto-revert-test03-auto-revert-tail-mode-mode-remote)
(auto-revert-test04-auto-revert-mode-dired-mode-remote): New tests.

* test/lisp/filenotify-tests.el (file-notify--test-event-handler):
Use `file-notify-debug' for debug messages.

5 years agoFix Gnus inline attachment decoding (bug#35507)
Basil L. Contovounesios [Thu, 2 May 2019 21:06:02 +0000 (22:06 +0100)]
Fix Gnus inline attachment decoding (bug#35507)

Proposed by Andy Moreton <andrewjmoreton@gmail.com>
and Noam Postavsky <npostavs@gmail.com>.
* lisp/gnus/mm-view.el (mm-display-inline-fontify): Always decode
handle text, falling back on 'undecided' coding system.

5 years ago* lisp/server.el: Cosmetic changes
Stefan Monnier [Fri, 3 May 2019 13:49:38 +0000 (09:49 -0400)]
* lisp/server.el: Cosmetic changes

Remove redundant :group args.
(server-temp-file-regexp): Fix ^$ to  \`\'.

5 years agoImprove documentation of 'isearch-regexp-function'
Eli Zaretskii [Fri, 3 May 2019 09:22:55 +0000 (12:22 +0300)]
Improve documentation of 'isearch-regexp-function'

* lisp/isearch.el (isearch-regexp-function): Doc fix.
(Bug#35498)

5 years ago; Fix declaration in tramp-compat.el
Michael Albinus [Fri, 3 May 2019 08:05:15 +0000 (10:05 +0200)]
; Fix declaration in tramp-compat.el

5 years agoRefactor update_window_begin and update_window_end hooks
Alexander Gramiak [Sat, 27 Apr 2019 21:00:13 +0000 (15:00 -0600)]
Refactor update_window_begin and update_window_end hooks

Bug#35464.

* src/dispnew.c (gui_update_window_begin, gui_update_window_end): New
procedures implementing common functionality.

* src/nsterm.m: (ns_update_window_begin, ns_update_window_end):
* src/xterm.c: (x_update_window_begin, x_update_window_end): Remove in
favor of only using the new generic versions.

* src/w32term.c: (w32_update_window_begin, w32_update_window_end):
Remove duplicated and unused code.

5 years agoxref--find-ignores-arguments: Return "" if IGNORES is nil
Dmitry Gutov [Thu, 2 May 2019 23:48:44 +0000 (02:48 +0300)]
xref--find-ignores-arguments: Return "" if IGNORES is nil

5 years agoAllow project-find-regexp'ing inside an ignored dir
Dmitry Gutov [Thu, 2 May 2019 22:52:05 +0000 (01:52 +0300)]
Allow project-find-regexp'ing inside an ignored dir

* lisp/progmodes/project.el (project-find-regexp): Don't pass
project's ignores to project--files-in-directory.  The FILES glob
should be enough, and we don't want to prohibit searching inside
ignored directories this way (it can be counter-intuitive).

5 years ago(xref--mouse-2): Fix not to jump to the next line
Dmitry Gutov [Thu, 2 May 2019 22:47:15 +0000 (01:47 +0300)]
(xref--mouse-2): Fix not to jump to the next line

* lisp/progmodes/xref.el (xref--mouse-2): Fix not to jump to the
next line.

5 years agoFix an "empty identifier" problem
Dmitry Gutov [Thu, 2 May 2019 22:29:59 +0000 (01:29 +0300)]
Fix an "empty identifier" problem

* lisp/progmodes/xref.el (xref--read-identifier): Abort on empty
input if there is no default
(https://lists.gnu.org/archive/html/help-gnu-emacs/2019-05/msg00012.html).

5 years agoFix fontification of first item in CC Mode macro without parentheses
Alan Mackenzie [Thu, 2 May 2019 20:53:47 +0000 (20:53 +0000)]
Fix fontification of first item in CC Mode macro without parentheses

* lisp/progmodes/cc-engine.el (c-find-decl-prefix-search): Handle the new
matching possibility (of a #define construct) in the new
c-decl-prefix-or-start-re.
(c-find-decl-spots): Allow the initial search for an in-macro starting point
settle on the # of #define, to facilitate the regexp matching in
c-find-decl-prefix-search.

* lisp/progmodes/cc-langs.el (c-anchored-hash-define-no-parens): New lang
const.
(c-literal-start-regexp): Correct what was always supposed to be a "generic
string" regexp element.
(c-decl-prefix-or-start-re): Enhance also to match "#define <identifier>".
(c-dposr-cpp-macro-depth): New lang variable and lang constant.

5 years ago* lisp/mail/footnote.el: Add TEXT and POINTERS together
Stefan Monnier [Thu, 2 May 2019 15:00:20 +0000 (11:00 -0400)]
* lisp/mail/footnote.el: Add TEXT and POINTERS together

Rather than adding POINTERS and TEXT separately to footnote--markers-alist,
add them together, so we don't need footnote--first-text-marker because
the TEXT part is never nil.

(footnote--insert-numbered-footnote): Return marker.
(footnote--insert-text-marker, footnote--insert-pointer-marker):
Delete functions.
(footnote--insert-markers): New function to replace them.
(footnote--insert-footnote): Adjust accordingly.
Simplify pointless `unless`.
(footnote--first-text-marker): Remove.  Replace all calls by
(cadr (car footnote--markers-alist)) or just footnote--markers-alist.

5 years agoCC Mode: Fix multiline block comments in macros.
Alan Mackenzie [Thu, 2 May 2019 14:30:29 +0000 (14:30 +0000)]
CC Mode: Fix multiline block comments in macros.

In particulr, handle multiline block comments whose newlines are not escaped.
There is an example of this in #define EXTRA_CONTEXT_FIELDS in editfns.c.

* lisp/progmodes/cc-engine.el (c-beginning-of-macro, c-end-of-macro): Enclose
the loops scanning escaped newlines with outer loops which check
heuristically for, respectively, a block comment ender and a block comment
starter on the lines we end up on.  (A rigorous syntactic check would be too
slow, here.)

* lisp/progmodes/cc-langs.el (c-last-c-comment-end-on-line-re)
(c-last-open-c-comment-start-on-line-re): New language constants/variables.

5 years ago* lisp/mail/footnote.el: Tweak markers convention
Stefan Monnier [Thu, 2 May 2019 14:27:42 +0000 (10:27 -0400)]
* lisp/mail/footnote.el: Tweak markers convention

Instead of using markers that are sometimes before and sometimes after
the [...] and using `insert-before-markers` to make sure those that are
are before stay before, always place them before, and make them
"move after"so they stay with their [...] without the need for
insert-before-markers.

(footnote--current-regexp): Add arg to match previous style.
Include the start/end "tags" in the regexp.  Adjust all callers.
(footnote--markers-alist): Change position of POINTERS.
(footnote--refresh-footnotes, footnote--renumber)
(footnote--make-hole, footnote-delete-footnote)
(footnote-back-to-message): Adjust accordingly, mostly by using
`looking-at` instead of `looking-back`.
(footnote--make-hole): Always return footnote nb to use.
(footnote-add-footnote): Simplify call accordingly.

* test/lisp/mail/footnote-tests.el: New file.

5 years agouse view-mode on score file for ease of scrolling and quitting
Sam Steingold [Thu, 2 May 2019 14:17:56 +0000 (10:17 -0400)]
use view-mode on score file for ease of scrolling and quitting

5 years agotetris-null-map: bind "q" to `quit-window`
Sam Steingold [Thu, 2 May 2019 14:17:04 +0000 (10:17 -0400)]
tetris-null-map: bind "q" to `quit-window`

5 years agoSmall code clean-up of file-notify-add-watch
Mattias Engdegård [Mon, 29 Apr 2019 14:42:04 +0000 (16:42 +0200)]
Small code clean-up of file-notify-add-watch

* lisp/filenotify.el (file-notify-add-watch):
Clearly separate backend-specific code from the rest, and simplify.
(file-notify--add-watch-inotify, file-notify--add-watch-kqueue)
(file-notify--add-watch-w32notify, file-notify--add-watch-gfilenotify):
New functions.

5 years ago* lisp/mail/footnote.el: Use dolist and hoist regexps out of loops
Stefan Monnier [Thu, 2 May 2019 13:00:53 +0000 (09:00 -0400)]
* lisp/mail/footnote.el: Use dolist and hoist regexps out of loops

(footnote--refresh-footnotes): Use pcase-dolist; compute regexp once
outside of the loops.  Use less confusing `literal` arg to `replace-match`
and specify `fixedcase` since footnote--index-to-string already chose
the proper case for us.
(footnote--renumber): Use dolist; compute regexp once
outside of the loops; shortcircuit when number is unchanged.
(footnote--text-under-cursor): Rewrite.
(footnote--make-hole): Use dolist.
(footnote-add-footnote): CSE.
(footnote-delete-footnote): Use dolist; compute regexp once
outside of the loop.
(footnote-delete-footnote): Don't renumber if there's no footnote left.
(footnote-renumber-footnotes): Use dolist.

5 years agoFix tramp-compat-file-name-quoted-p
Michael Albinus [Thu, 2 May 2019 07:51:41 +0000 (09:51 +0200)]
Fix tramp-compat-file-name-quoted-p

* lisp/net/tramp-compat.el (tramp-compat-file-local-name)
(tramp-compat-file-name-quoted-p): Declare them.
(top): Do not use `eval-and-compile'.
(tramp-compat-file-name-quoted-p): Check also func-arity of
`file-name-quoted-p'.

5 years ago* lisp/mail/footnote.el: Consolidate the two marker-alists
Stefan Monnier [Wed, 1 May 2019 21:53:39 +0000 (17:53 -0400)]
* lisp/mail/footnote.el: Consolidate the two marker-alists

Consolidate footnote-text-marker-alist and footnote-pointer-marker-alist
into a single footnote--markers-alist.

(footnote--markers-alist): New var.
(footnote-text-marker-alist, footnote-pointer-marker-alist): Delete vars.
(footnote--refresh-footnotes, footnote--text-under-cursor)
(footnote--calc-fn-alignment-column, footnote-add-footnote)
(footnote-goto-footnote, footnote-back-to-message): Adjust accordingly.
(footnote--make-hole, footnote-delete-footnote)
(footnote-renumber-footnotes): Simplify accordingly.
(footnote-cycle-style): Indicate style name in echo area.
(footnote--renumber): Take a single `alist-elem` arg instead of
`pointer-alist` and `text-alist`.
(footnote--insert-text-marker, footnote--insert-pointer-marker):
Add to footnote--markers-alist instead.
(footnote--first-text-marker): New function.
(footnote--get-area-point-min): Use it.
footnote--goto-first): New function.
(footnote--insert-footnote): Use it.
(footnote-style-number): Use defvar-local.

5 years ago* lisp/mail/footnote.el: Minor simplifications
Stefan Monnier [Wed, 1 May 2019 17:14:31 +0000 (13:14 -0400)]
* lisp/mail/footnote.el: Minor simplifications

Remove redundant :group args.
(footnote-mode-hook): Let define-minor-mode define it.
(footnote--style-p): Delete function.
(footnote--index-to-string): Inline it instead, and simplify.
(footnote-cycle-style): Use a pointer into the alist as the "index"
instead of a number.
(footnote-set-style): Use footnote-style-alist as the completion table.
Prefer `assq` over `footnote--assoc-index`.
(footnote--assoc-index): Delete function.
(footnote--renumber): Remove first (unused) argument; Adjust all callers.
(footnote--sort): Use car-less-than-car.

5 years agoRestore previous calling signature of gnus-set-info
Lars Ingebrigtsen [Wed, 1 May 2019 17:04:36 +0000 (19:04 +0200)]
Restore previous calling signature of gnus-set-info

5 years ago* lisp/emacs-lisp/edebug.el: Better handle instrumentation of `end-of-defun`
Stefan Monnier [Wed, 1 May 2019 16:45:37 +0000 (12:45 -0400)]
* lisp/emacs-lisp/edebug.el: Better handle instrumentation of `end-of-defun`

Remove redundant :group args.
(edebug-read-top-level-form): Let-bind edebug-active.
(edebug-active): Move before this new first use.

5 years ago* lisp/help.el (function-called-at-point): Use Elisp's forward-sexp-function
Stefan Monnier [Wed, 1 May 2019 16:37:48 +0000 (12:37 -0400)]
* lisp/help.el (function-called-at-point): Use Elisp's forward-sexp-function

5 years ago; * etc/NEWS: Fix position of +++ marker
Basil L. Contovounesios [Wed, 1 May 2019 13:51:37 +0000 (14:51 +0100)]
; * etc/NEWS: Fix position of +++ marker

5 years ago; Auto-commit of loaddefs files.
Glenn Morris [Wed, 1 May 2019 13:27:17 +0000 (06:27 -0700)]
; Auto-commit of loaddefs files.

5 years agoMinor region-noncontiguous-p simplification
Basil L. Contovounesios [Tue, 30 Apr 2019 23:39:54 +0000 (00:39 +0100)]
Minor region-noncontiguous-p simplification

* lisp/simple.el (region-noncontiguous-p): Don't needlessly traverse
region-bounds.

5 years ago* lisp/progmodes/cc-engine.el: Silence minor compiler warnings
Stefan Monnier [Tue, 30 Apr 2019 18:56:29 +0000 (14:56 -0400)]
* lisp/progmodes/cc-engine.el: Silence minor compiler warnings

(c-restricted-<>-arglists, c-parse-and-markup-<>-arglists):
Move declaration before first use.
(c-after-change-unmark-raw-strings): Remove unused var `found-end`.

5 years agoFix decode-time/encode-time roundtrip on macOS
Paul Eggert [Tue, 30 Apr 2019 17:45:48 +0000 (10:45 -0700)]
Fix decode-time/encode-time roundtrip on macOS

* src/timefns.c (Fencode_time): Ignore DST flag when the zone is
numeric or is a cons, as the doc string says it’s ignored in that
case, and not ignoring it causes encode-time to not invert
decode-time on some platforms (Bug#35502).
* test/src/timefns-tests.el (encode-time-dst-numeric-zone):
New test.

5 years ago* lisp/progmodes/cc-fonts.el: Silence some compiler warnings
Stefan Monnier [Tue, 30 Apr 2019 17:42:44 +0000 (13:42 -0400)]
* lisp/progmodes/cc-fonts.el: Silence some compiler warnings

(c-font-lock-declarators): Mark `id_end` and `not-top` as unused.

5 years agoUpdate from Gnulib
Paul Eggert [Tue, 30 Apr 2019 16:44:38 +0000 (09:44 -0700)]
Update from Gnulib

* build-aux/config.guess, doc/misc/texinfo.tex:
* lib/mktime-internal.h, lib/mktime.c, lib/timegm.c:
Copy from Gnulib.
* lib/gnulib.mk.in: Regenerate.

5 years ago* lisp/autorevert.el (auto-revert-avoid-polling): Fix :set form.
Mattias Engdegård [Tue, 30 Apr 2019 13:53:56 +0000 (15:53 +0200)]
* lisp/autorevert.el (auto-revert-avoid-polling): Fix :set form.

5 years agoCC Mode: in certain font lock loops, check point is not beyond limit.
Alan Mackenzie [Tue, 30 Apr 2019 13:20:22 +0000 (13:20 +0000)]
CC Mode: in certain font lock loops, check point is not beyond limit.

* /lisp/progmodes/cc-fonts.el (c-font-lock-enum-body)
(autodoc-font-lock-line-markup): As part of the `while' condition, check that
the previous iteration of the loop hasn't moved point past `limit', thus
obviating "wrong side of point" errors in re-search-forward, etc.

5 years agoDon't poll auto-revert files that use notification (bug#35418)
Mattias Engdegård [Wed, 24 Apr 2019 16:39:05 +0000 (18:39 +0200)]
Don't poll auto-revert files that use notification (bug#35418)

It is a waste to periodically poll files that use change notification
in auto-revert mode; stop doing that.  If no files need polling,
turn off the periodic execution entirely to further avoid wasting power.
Use a timer to inhibit immediate reversion for some time after a
notification, for throttling.

This change does not apply to files in global-auto-revert-mode, where
polling is still necessary.  It is disabled by default, and enabled by
setting `auto-revert-avoid-polling' to non-nil.

* lisp/autorevert.el
(toplevel): Require cl-lib.
(auto-revert-avoid-polling, auto-revert--polled-buffers)
(auto-revert--need-polling-p, auto-revert--lockout-interval)
(auto-revert--lockout-timer, auto-revert--end-lockout): New.
(global-auto-revert-mode): Keep notifiers for buffers in auto-revert mode.
(auto-revert-set-timer): Use auto-revert--need-polling-p.
(auto-revert-notify-handler): Restart polling if notification stopped.
Use new lockout timer.
(auto-revert-buffers):
Use auto-revert--polled-buffers and auto-revert--need-polling-p.
(auto-revert-buffers-counter, auto-revert-buffers-counter-lockedout):
Remove.

* etc/NEWS (Changes in Specialized Modes and Packages):
Describe the new auto-revert-avoid-polling variable.

* doc/emacs/files.texi (Reverting):
Add paragraph describing auto-revert-avoid-polling.

5 years agoRefrain from splicing anonymous faces in text properties
Stefan Monnier [Mon, 29 Apr 2019 21:29:47 +0000 (17:29 -0400)]
Refrain from splicing anonymous faces in text properties

* lisp/font-lock.el (font-lock-prepend-text-property): Distinguish
list of faces from property lists.
(font-lock-ensure-function): Remove redundant code.