Paul Eggert [Fri, 23 Aug 2019 18:50:40 +0000 (11:50 -0700)]
Tweak gnutls-peer-status reporting
* src/gnutls.c (Fgnutls_peer_status): Report :compression and
:encrypt-then-mac only if the underlying GnuTLS library has
the corresponding features. This give the Elisp caller a bit
more information about the peer status.
* lisp/net/nsm.el (nsm-protocol-check--compression):
Don’t worry about compression in newer GnuTLS versions
that do not support compression.
Paul Eggert [Fri, 23 Aug 2019 18:17:38 +0000 (11:17 -0700)]
Clarify compiler-pacifier in frame.c
* src/frame.c (Fx_parse_geometry): Pacify the compiler in a
different way, so that the human reader can more easily see
that the initializations are unnecessary.
Noam Postavsky [Fri, 23 Aug 2019 11:59:32 +0000 (07:59 -0400)]
; Fix references to log-edit-generate-changelog-from-diff
* doc/emacs/maintaining.texi (Log Buffer):
* etc/NEWS: Replace log-edit-generate-changelog (an old name which was
changed during editing) to log-edit-generate-changelog-from-diff.
Noam Postavsky [Fri, 23 Aug 2019 11:55:09 +0000 (07:55 -0400)]
Print macro modified macro keys as characters not integers
* lisp/macros.el (macros--insert-vector-macro): Pass all elements to
'prin1-char', not just those that satisfy characterp (because characters
which have modifier bits set wouldn't qualify otherwise).
'prin1-char' will return nil if it can't handle the argument (e.g.,
for symbols representing function keys).
Rename renamed nsm.el variables and functions back
* doc/emacs/misc.texi (Network Security): Start working on
updating the NSM bits, but it's unclear how much of the new stuff
to document.
* lisp/net/nsm.el: Rename all nsm-tls-check-* functions to
nsm-protocol-check--* to bring them back into line with the
documentation.
(network-security-protocol-checks): Renamed back again from
`nsm-tls-checks', as this variable is documented and can't just go
away.
* lisp/net/nsm.el (network-security-level, nsm-tls-checks): Make
`low' a "check nothing" setting again, and move all the `low'
checks back to `medium'. This makes the test suite work again.
Paul Eggert [Fri, 23 Aug 2019 08:11:12 +0000 (01:11 -0700)]
Get the Gnutls code compiling on Fedora 30
The recent changes caused the build to fail on Fedora 30 when built
with --enable-gcc-warnings, among other things with diagnostics that
gnutls_compression_get and gnutls_compression_get_name are deprecated
(this started with GnuTLS 3.6). Fix this by refusing to call these
obsolescent and now-dummy functions in GnuTLS 3.6 and later. However,
this is just a temporary workaround to get the build working; a real
fix is needed, as network-stream-tests fail.
* src/gnutls.c (HAVE_GNUTLS_COMPRESSION_GET): New macro.
(gnutls_compression_get, gnutls_compression_get_name):
Define only if HAVE_GNUTLS_COMPRESSION_GET.
(init_gnutls_functions): Load the two functions only if
HAVE_GNUTLS_COMPRESSION_GET.
(emacs_gnutls_certificate_export_pem): Use alloca instead of xmalloc.
(Fgnutls_peer_status): Just return "NULL" if the functions
are deprecated.
(Fgnutls_format_certificate): Fix pointer signedness glitches.
* src/process.c: Fix spacing.
Put error output from M-! at the end of the error buffer
* lisp/simple.el (shell-command-on-region): Put the error output
at the end of the buffer instead of wherever point is (bug#7513).
This avoids interleaving error output.
Damien Cassou [Fri, 23 Aug 2019 04:30:46 +0000 (06:30 +0200)]
Add imenu support to xref
* lisp/progmodes/xref.el (xref--imenu-prev-index-position)
(xref--imenu-extract-index-name): Add functions to get imenu support.
(xref--xref-buffer-mode): Set imenu variables to the new functions.
* etc/NEWS: Add corresponding entry (bug#36974).
Tweak the warning display to be less like a TLS decoding page
* lisp/net/nsm.el (nsm-parse-subject, nsm-certificate-part):
Restore functions for parsing subjects.
(nsm-format-certificate): Use them to display more user-friendly
data. Also change the display to have fewer lines again so that
the data of interest isn't pushed off the screen.
* lisp/shell.el (shell-mode): This mode can't usefully be called
interactively (and is somewhat destructive, as it disables
`undo'), and it's usually confused with `shell-script-mode'
(bug#19812). So signal an error if it's used interactively.
Make ibuffer-mark-by-file-name-regexp work on the displayed file name
* lisp/ibuf-ext.el (ibuffer-mark-by-file-name-regexp): Perform the
matching on the abbreviated (i.e., displayed) file name, and not
the complete name (bug#18859). This seems like the more expected
action.
Have `M-x battery' list all batteries under GNU/Linux
* lisp/battery.el (battery-upower-device): Remove (bug#25559).
(battery--find-linux-sysfs-batteries): New function.
(battery-status-function, battery-linux-sysfs): Use it to list all
batteries, no matter what they're called.
Signal `invalid-read-syntax' for "trailing garbage"
* src/minibuf.c (string_to_object): Signal `invalid-read-syntax'
instead of the generic `error' for "trailing garbage following
expression" (bug#24649).
Paul Eggert [Thu, 22 Aug 2019 05:29:35 +0000 (22:29 -0700)]
Remove no-longer-needed workaround for GC bug
* src/keymap.c (describe_vector): Remove old workaround for GC bug.
This workaround, introduced in 1993-02-19T05:43:54Z!rms@gnu.org,
has not been needed for some time. Problem reported by Pip Cet in:
https://lists.gnu.org/r/emacs-devel/2019-08/msg00316.html
Paul Eggert [Thu, 22 Aug 2019 05:19:03 +0000 (22:19 -0700)]
Don’t debug fset by default
This GC bug seems to have been fixed, so the check is no longer
needed in production code. From a suggestion by Pip Cet in:
https://lists.gnu.org/r/emacs-devel/2019-08/msg00316.html
* src/alloc.c (SUSPICIOUS_OBJECT_CHECKING) [!ENABLE_CHECKING]:
Do not define.
(find_suspicious_object_in_range, detect_suspicious_free):
Expand to proper dummy expressions if !SUSPICIOUS_OBJECT_CHECKING.
* src/data.c (Ffset): Convert test to an eassert.
Paul Eggert [Thu, 22 Aug 2019 01:54:08 +0000 (18:54 -0700)]
Fix clrhash bug when hash table needs rehashing
Problem reported by Pip Cet in:
https://lists.gnu.org/r/emacs-devel/2019-08/msg00316.html
* src/fns.c (maybe_resize_hash_table): Prefer ASET to gc_aset
where either will do. Simplify appending of Qunbound values.
Put index_size calculation closer to where it’s needed.
(hash_clear): If hash_rehash_needed_p (h), don’t clear the
nonexistent hash vector. Use memclear to speed up clearing.
* src/lisp.h (HASH_TABLE_SIZE): Check that the size is positive,
and tell that to the compiler.
Paul Eggert [Thu, 22 Aug 2019 00:18:33 +0000 (17:18 -0700)]
Don’t hard-loop on cycles in ‘read’ etc.
Problem for ‘read’ reported by Pip Cet in:
https://lists.gnu.org/r/emacs-devel/2019-08/msg00316.html
* src/fns.c (Frequire): Protect against circular current-load-list.
* src/lread.c (Fget_load_suffixes):
Protect against circular load-suffixes or load-file-rep-suffixes.
(Fload): Protect against circular loads-in-progress.
(openp): Protect against circular PATH and SUFFIXES.
(build_load_history): Protect against circular load-history or
current-load-list.
(readevalloop_eager_expand_eval): Protect against circular SUBFORMS.
(read1): Protect against circular data.
* test/src/lread-tests.el (lread-circular-hash): New test.
* lisp/progmodes/hideif.el (hide-ifdef-mode-prefix-key): Make into
a defcustom since it seems like this is something that should be
user-customisable (bug#8922).
Use `quit-window-hook' in Info instead of having its own command
* doc/misc/info.texi (Help-Q): Info now uses `quit-window'.
* lisp/info.el (info-standalone): Adjust doc string.
(Info-exit): Made into obsolete alias.
(Info-mode-map): Bind "q" to `quit-window'.
(Info-mode-menu): Adjust.
(info-tool-bar-map): Ditto.
(Info-mode): Adjust doc string.
(Info-mode): If Info is standalone, kill Emacs on "q".
Call `quit-window-hook' in the `quit-window' command only
* lisp/window.el (quit-restore-window): Don't run quit-window-hook
here...
(quit-window): ... but here instead. Callers that call the former
programmatically can decide themselves whether to call the hook.
(quit-window-hook): Fix doc string.
Paul Eggert [Wed, 21 Aug 2019 07:06:00 +0000 (00:06 -0700)]
Be more careful about pointers to bignum vals
This uses ‘const’ to be better at catching bugs that
mistakenly attempt to modify a bignum value.
Lisp bignums are supposed to be immutable.
* src/alloc.c (make_pure_bignum):
* src/fns.c (sxhash_bignum):
Accept Lisp_Object instead of struct Lisp_Bignum *, as that’s
simpler now. Caller changed.
* src/bignum.h (bignum_val, xbignum_val): New inline functions.
Prefer them to &i->value and XBIGNUM (i)->value, since they
apply ‘const’ to the result.
* src/timefns.c (lisp_to_timespec): Use mpz_t const *
to point to a bignum value.
Paul Eggert [Wed, 21 Aug 2019 00:34:03 +0000 (17:34 -0700)]
Avoid some excess precision in time arithmetic
* doc/misc/emacs-mime.texi (time-date):
Adjust example to match new behavior.
* etc/NEWS: Mention this.
* lisp/calendar/time-date.el (decoded-time-add)
(decoded-time--alter-second):
Don’t lose underestimate precision of seconds component.
* src/bignum.c (mpz): Grow by 1.
* src/timefns.c (trillion_factor): New function.
(timeform_sub_ps_p): Remove.
(time_arith): Avoid unnecessarily-large hz, by reducing the hz
to a value no worse than the worse hz of the two arguments.
The result is always exact unless an error is signaled.
* test/src/timefns-tests.el (timefns-tests--decode-time):
New function.
(format-time-string-with-zone): Test (decode-time LOOK ZONE t)
resolution as well as its numeric value.
Noam Postavsky [Sun, 4 Aug 2019 00:19:31 +0000 (20:19 -0400)]
Respect global-eldoc-mode in minibuffers (Bug#36886)
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Accept
a BODY parameter.
* doc/lispref/modes.texi (Defining Minor Modes): Document new
parameter.
* etc/NEWS: Announce it.
* lisp/simple.el (read--expression): Move eldoc-mode setup to...
* lisp/emacs-lisp/eldoc.el (eldoc--eval-expression-setup): ... here,
new function.
(global-eldoc-mode): Add or remove it to
eval-expression-minibuffer-setup-hook when enabling or disabling
global-eldoc-mode. This enables eldoc in the minibuffer (solving
Bug#27202), only when global-eldoc-mode is enabled.
Paul Eggert [Tue, 20 Aug 2019 21:02:30 +0000 (14:02 -0700)]
Support larger TIMEs in (time-convert TIME t)
Also, improve the doc to match current behavior.
* doc/lispref/os.texi (Time Conversion): Document that
time-convert signals an error for infinite or NaN args,
and that (time-convert TIME t) is exact otherwise.
Mention float-time as an alternative to time-convert.
(Time Calculations): Document that time-add and time-subtract
are exact and do not decrease HZ below the minimum of their args.
* src/timefns.c (decode_float_time): Don’t signal an error for
floating-point arguments whose base-FLT_RADIX exponent is not less
than DBL_MANT_DIG. Instead, convert them to (TICKS . 1) values.
Use two (instead of three) integer exponent comparisons in the
typical case.
* test/src/timefns-tests.el (time-arith-tests):
Add more floating-point tests, including some tests
that the old code fails.
Michael Albinus [Tue, 20 Aug 2019 19:32:34 +0000 (21:32 +0200)]
Another attempt to fix bug#32645
* test/lisp/autorevert-tests.el ()
(auto-revert-test02-auto-revert-deleted-file):
* test/lisp/filenotify-tests.el (file-notify-test04-autorevert):
Check `file-notify-valid-p', not that the descriptor is nil.
Glenn Morris [Tue, 20 Aug 2019 16:01:55 +0000 (09:01 -0700)]
Merge from origin/emacs-26
0b810eb Fix a typo in char-width-table 3f00db7 Minor update in admin/notes/unicode bcd0115 Fix lisp indent infloop on unfinished strings (Bug#37045) 5f992d1 Improve commentary in composite.el 3a04be2 ; Improve commentary in xdisp.c 15de1d1 Fix markup in dired-x.texi bda7fc7 ; Fix typo in a doc string of speedbar.el 6f57ef9 * src/callproc.c (Fcall_process): Doc fix.
Mauro Aranda [Sat, 10 Aug 2019 13:48:24 +0000 (10:48 -0300)]
Don't display wrong ElDoc information when inside ELisp strings or comments
* lisp/progmodes/elisp-mode.el (elisp--fnsym-in-current-sexp): Since
forward-sexp assumes point is not in a string or comment, avoid
calling it and then checking if point is inside a string, since that
sometimes will fail with awkward results. (Bug#35567)
Output `auto-coding-alist' in `describe-current-coding-system'
* lisp/international/mule-diag.el
(describe-current-coding-system): Also output the contents of
`auto-coding-alist', which take precedence over
`file-coding-system-alist' (bug#9575).
* doc/lispref/windows.texi (Quitting Windows): Mention in.
* lisp/window.el (quit-restore-window): Run the new
`quit-window-hook' before doing anything else (bug#9867).
(quit-window): Note that the hook will be run in the doc string.
* lisp/window.el (quit-window-hook): New variable.
Paul Eggert [Tue, 20 Aug 2019 01:04:56 +0000 (18:04 -0700)]
Fix org-table 65536-second bug
* lisp/org/org-table.el (org-table-message-once-per-second):
Fix bug when clock difference goes past a 65536-second boundary.
Don’t assume particular format for current-time result.
Paul Eggert [Tue, 20 Aug 2019 01:02:59 +0000 (18:02 -0700)]
Fix time-add/time-sub validity checking
* src/timefns.c (time_arith): Check the first arg for
validity even if the second arg is not finite.
* test/src/timefns-tests.el (time-arith-tests): Test this.
* doc/lispref/processes.texi (Asynchronous Processes): Note that input
may read when sending data as well.
(Output from Processes): Note that functions which send data may also
trigger reading from processes.
(Input to Processes, Filter Functions): Note that filter functions may
be called recursively.
Tino Calancha [Mon, 19 Aug 2019 15:32:09 +0000 (17:32 +0200)]
Fix query-replace-regexp undo feature
Ensure that non-regexp strings used with `looking-at' are quoted.
* lisp/replace.el (perform-replace): Quote regexp (Bug#37073).
* test/lisp/replace-tests.el (replace-tests-perform-replace-regexp-flag):
New variable.
(replace-tests-with-undo): Use it.
(query-replace-undo-bug37073): Add tests.
Use lexical-binding.
(erc-add-timestamp): Store the timestamp in a closure placed in
cursor-sensor-functions rather than stashing it in an ad-hoc
`timestamp` property.
(erc-echo-timestamp): Simplify accordingly.
Noam Postavsky [Sun, 18 Aug 2019 22:10:50 +0000 (18:10 -0400)]
Handle more subprocess chunking in M-x man (Bug#36927)
* lisp/man.el (Man-bgproc-filter): Make sure not to chop man sections
by narrowing.
(Man-highlight-references0): Revert previous fix, as it's no longer
needed.
* test/lisp/man-tests.el (man-tests-filter-strings): New function.
(man-bgproc-filter-buttonize-includes): New test.
Paul Eggert [Sun, 18 Aug 2019 19:11:06 +0000 (12:11 -0700)]
Improve bignum_integer static checking
* src/bignum.h (bignum_integer): Now returns pointer-to-const,
to catch trivial mistakes where the caller might try to modify
a Lisp bignum. Lisp bignums are supposed to be immutable.
All callers changed.
Eli Zaretskii [Sun, 18 Aug 2019 16:36:31 +0000 (19:36 +0300)]
Support the new Japanese era name
* admin/unidata/NormalizationTest.txt:
* admin/unidata/UnicodeData.txt: Add U+32FF SQUARE ERA NAME REIWA.
Do not merge to master.
* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-tests--failing-lines-part1)
(ucs-normalize-tests--failing-lines-part2): Update. Do not
merge to master.
Paul Eggert [Sun, 18 Aug 2019 00:19:13 +0000 (17:19 -0700)]
Fix org-timer-show-remaining-time > 1 hour
* lisp/org/org-timer.el (org-timer-show-remaining-time):
Don’t assume the remaining time is less than one hour.
Simplify. The simplification removes the need for a
decode-time, and fixes a typo I introduced recently.
Make `describe-function' say that disabled functions are disabled
* lisp/help-fns.el (help-fns--disabled): New function (bug#10853).
(help-fns-describe-function-functions): Add it to the list of
function help functions.
Paul Eggert [Sat, 17 Aug 2019 22:39:18 +0000 (15:39 -0700)]
Add FIXMEs for subsecond support
This adds FIXMEs to areas where Lisp code should support
subsecond information in broken-down timestamps.
It also fixes some unnecessary truncation of timestamps, and
ports the code to a hypothetical future Emacs version where
(decode-time) returns subsecond timestamps by default.
* lisp/calc/calc-forms.el (calc-time, math-iso-dt-to-date)
(calcFunc-now):
* lisp/calendar/icalendar.el (icalendar--add-decoded-times):
* lisp/calendar/iso8601.el (iso8601-parse-interval):
Truncate seconds to an integer, and add a FIXME about
subseconds support.
* lisp/calendar/icalendar.el (icalendar--decode-isodatetime)
(icalendar--decode-isoduration):
Add a FIXME about subseconds support.
* lisp/gnus/gnus-delay.el (gnus-delay-article):
Don’t truncate seconds to an integer, as there’s no need
to do that here.
* lisp/gnus/gnus-util.el (gnus-seconds-today)
(gnus-seconds-month, gnus-seconds-year):
* lisp/gnus/message.el (message-make-expires-date):
* lisp/org/org-timer.el (org-timer-show-remaining-time):
* lisp/vc/ediff-mult.el (ediff-format-date):
Truncate seconds to an integer, as that’s what’s wanted here.
* lisp/midnight.el (midnight-next):
Ceiling seconds to an integer, as that’s what wanted here.