Glenn Morris [Wed, 3 Oct 2018 16:23:16 +0000 (09:23 -0700)]
Merge from origin/emacs-26
7296b6f Improve cl-do, cl-do* docstrings d416109 Avoid returning early in 'while-no-input' due to subprocesses e8a4d94 Cleanup when opening a new terminal fails. (Bug#32794)
Alan Mackenzie [Wed, 3 Oct 2018 15:57:15 +0000 (15:57 +0000)]
In follow mode, prevent the cursor resting on a partially displayed line
Don't merge to master. This fixes bug #32848
* lisp/follow.el (follow-adjust-window): If point ends up in a partially
displayed line in a left hand or middle window, move it one line
forward, to
prevent unwanted scrolling should make-cursor-line-fully-visible be
non-nil.
* progmodes/lisp/sql.el (sql-use-indent-support): New variable.
(sql-is-indent-available): New function.
(sql-indent-enable): Use above.
(sql-mode-hook, sql-interactive-mode-hook): Add `sql-indent-enable'.
Nicolas Goaziou [Sat, 29 Sep 2018 14:40:42 +0000 (16:40 +0200)]
Org manual: Rewrite the Org Mobile section
* doc/misc/org.texi (Org Mobile): Rewritten from "MobileOrg" section.
Remove all references to non-free software.
Moved into "Miscellaneous", much like Org Crypt library. No longer an
appendix.
(Footnotes): Remove a reference to "MobileOrg".
(Bug#32722)
Eli Zaretskii [Sun, 30 Sep 2018 11:14:59 +0000 (14:14 +0300)]
Allow 'make-cursor-line-fully-visible' name a function
* src/xdisp.c (cursor_row_fully_visible_p): Handle the case of
make-cursor-line-fully-visible being a function. Accept a 3rd
argument; if non-zero, assume the caller already tested the
conditions for the cursor being fully-visible, and don't
recheck them. All callers changed.
(try_cursor_movement, try_window_id): Call
cursor_row_fully_visible_p instead of testing the value of
make-cursor-line-fully-visible directly.
(syms_of_xdisp) <make-cursor-line-fully-visible>: Update the
doc string. Define a symbol Qmake_cursor_line_fully_visible.
(Bug#32848)
* lisp/cus-start.el (standard): Update the Custom form.
* etc/NEWS: Mention the change in possible values of
'make-cursor-line-fully-visible'.
Ibuffer filter by modes: Accept several mode names
Extend all mode filters so that they handle >1 mode.
For instance, if the users want to filter all buffers in
C or C++ mode, then they can call the filter interactively
with input: 'c-mode,c++-mode' (Bug#32731).
* lisp/ibuf-macs.el(define-ibuffer-filter): Add key :accept-list.
If the value of this key is non-nil, then the filter accepts
either a single qualifier or a list of them; in the latter case,
the resultant filter is the `or' composition of the individual ones.
* lisp/ibuf-ext.el (ibuffer-filter-by-used-mode)
(ibuffer-filter-by-mode, ibuffer-filter-by-derived-mode)
Set :accept-list value non-nil.
Interactively, accept a comma separated list of mode names.
Allen Li [Mon, 1 Jan 2018 04:33:21 +0000 (20:33 -0800)]
Avoid writing empty abbrev tables
Fixes bug#29923
'insert-abbrev-table-description' with a non-nil READABLE inserts Lisp
forms suitable for evaluation to restore the defined abbrevs. We
don't have to insert a form for tables that do not have any abbrevs.
To implement this, we need to filter out system abbrevs before
checking if a table is empty, because system abbrevs were previously
skipped in the 'abbrev--write' call, at which point we would already
have started inserting the beginning of a table definition form.
* lisp/abbrev.el (insert-abbrev-table-description):
Skip inserting empty tables when READABLE is non-nil.
Clarify behavior in documentation string.
(abbrev--write): Remove system abbrev check.
* doc/lispref/abbrevs.texi (Abbrev Tables): Document behavior
with empty tables.
* etc/NEWS: Mention the change in behavior of
'insert-abbrev-table-description'.
John Shahid [Fri, 21 Sep 2018 15:15:10 +0000 (11:15 -0400)]
Cleanup when opening a new terminal fails. (Bug#32794)
* src/term.c (init_tty): Call delete_terminal_internal if emacs_open
fail.
* src/terminal.c (delete_terminal): Move some code into
delete_terminal_internal and call it.
(delete_terminal_internal): New function.
* src/termhooks.h: Prototype for delete_terminal_internal.
Alan Third [Fri, 28 Sep 2018 19:23:07 +0000 (20:23 +0100)]
Make all NS drawing be done from drawRect
See bug#31904 and bug#32812.
* src/nsterm.m (ns_update_begin): Don't lock focus, only clip if there
is already a view focused.
(ns_update_end): Don't mess with view focusing any more.
(ns_focus): Only clip drawing if there is already a focused view,
otherwise mark area dirty for later drawing. Renamed ns_clip_to_rect.
All callers changed.
(ns_unfocus): Don't unfocus the view any more. Renamed
ns_reset_clipping. All callers changed.
(ns_clip_to_row): Update to match ns_clip_to_rect.
(ns_clear_frame):
(ns_clear_frame_area):
(ns_draw_fringe_bitmap):
(ns_draw_window_cursor):
(ns_draw_vertical_window_border):
(ns_draw_window_divider):
(ns_dumpglyphs_stretch):
(ns_draw_glyph_string): Only draw if ns_focus or ns_clip_to_row
return YES.
(ns_copy_bits): Remove superfluous calls to ns_(un)focus.
(ns_flush_display): New function.
Paul Eggert [Fri, 28 Sep 2018 17:32:41 +0000 (10:32 -0700)]
Rename time-equal to time-equal-p
This is for consistency with time-less-p.
* doc/lispref/os.texi (Time Calculations), etc/NEWS:
* src/editfns.c (Ftime_equal_p, syms_of_editfns):
* test/lisp/emacs-lisp/timer-tests.el (timer-test-multiple-of-time):
Rename.
Paul Eggert [Fri, 28 Sep 2018 01:28:27 +0000 (18:28 -0700)]
time-equal, and time values of infinity and NaN
* doc/lispref/os.texi (Time Calculations):
Document time-equal, and the behavior on NaNs and infinities of
time-less-p, time-add, time-subtract.
* etc/NEWS: Mention the change.
* src/editfns.c (time_arith): Change last arg from function
to bool. All callers changed. Do the right thing with
infinities and NaNs.
(time_cmp): New function, which handlesx infinities and NaNs.
(Ftime_less_p): Use it.
(Ftime_equal): New function.
* test/lisp/emacs-lisp/timer-tests.el (timer-test-multiple-of-time):
Use it.
Alan Mackenzie [Wed, 26 Sep 2018 17:09:43 +0000 (17:09 +0000)]
CC Mode: consider tails of compound identifiers when seeking found types.
* lisp/progmodes/cc-engine.el (c-forward-over-token): New function, extracted
from ...
(c-forward-over-token-and-ws): Refactor to use the above.
(c-forward-type): Use c-check-qualified-type in place of c-check-type
(twice).
(c-forward-over-compound-identifier): New function.
(c-check-qualified-type): New function.
Paul Eggert [Tue, 25 Sep 2018 02:13:34 +0000 (19:13 -0700)]
Remove some assumptions about timestamp format
These changes remove some assumptions of Lisp code on timestamp
format. Although we’re not going to change the default format any
time soon, I went looking for code that was too intimate about
details of timestamp format and removed assumptions where this was
easy to do with current Emacs primitives.
* lisp/ido.el (ido-wash-history):
Fix test for zero timestamp.
* lisp/time.el (display-time-event-handler):
Use time-less-p rather than doing it by hand.
(display-time-update): Simplify by using float-time
instead of doing the equivalent by hand.
* lisp/url/url-auth.el (url-digest-auth-make-cnonce):
* test/lisp/calendar/parse-time-tests.el (parse-time-tests):
* test/lisp/emacs-lisp/timer-tests.el (timer-test-multiple-of-time):
* test/lisp/net/tramp-tests.el:
(tramp-test19-directory-files-and-attributes)
(tramp-test22-file-times, tramp-test23-visited-file-modtime):
Don’t assume detailed format of returned Lisp timestamps.
Stefan Monnier [Mon, 24 Sep 2018 18:58:11 +0000 (14:58 -0400)]
* doc/emacs/kmacro.texi (Basic Keyboard Macro): Mention old bindings
According to Apple gospel, function keys are partly going the way of the dodo
so F3/F4 can, like in the good old days, be hard to reach for some users.
Paul Eggert [Sat, 22 Sep 2018 15:59:06 +0000 (08:59 -0700)]
Round bignums consistently with other integers
* src/bignum.c (mpz_bufsize): New function.
(bignum_bufsize): Use it.
(mpz_get_d_rounded): New function.
(bignum_to_double): Use it.
* src/bignum.c (bignum_to_double):
* src/data.c (bignum_arith_driver):
When converting bignums to double, round instead of
truncating, to be consistent with what happens with fixnums.
* test/src/floatfns-tests.el (bignum-to-float): Test rounding.
Stefan Monnier [Sat, 22 Sep 2018 15:46:35 +0000 (11:46 -0400)]
* lisp/multifile.el: New file, extracted from etags.el
The main motivation for this change was the introduction of
project-query-replace. dired's multi-file query&replace was implemented
on top of etags.el even though it did not use TAGS in any way, so I moved
this generic multifile code into its own package, with a nicer interface,
and then used that in project.el.
* lisp/progmodes/project.el (project-files): New generic function.
(project-search, project-query-replace): New commands.
* lisp/dired-aux.el (dired-do-search, dired-do-query-replace-regexp):
Use multifile.el instead of etags.el.
* lisp/progmodes/etags.el: Remove redundant :groups.
(next-file-list): Remove var.
(tags-loop-revert-buffers): Make it an obsolete alias.
(next-file): Don't autoload (it can't do anything useful before some
other etags.el function setup the multifile operation).
(tags--all-files): New function, extracted from next-file.
(tags-next-file): Rename from next-file.
Rewrite using tags--all-files and multifile-next-file.
(next-file): Keep it as an obsolete alias.
(tags-loop-operate, tags-loop-scan): Mark as obsolete.
(tags--compat-files, tags--compat-initialize): New function.
(tags-loop-continue): Rewrite using multifile-continue. Mark as obsolete.
(tags--last-search-operate-function): New var.
(tags-search, tags-query-replace): Rewrite using multifile.el.
* lisp/emacs-lisp/generator.el (iter-end-of-sequence): Use 'define-error'.
(iter-make): New macro.
(iter-empty): New iterator.
Eli Zaretskii [Sat, 22 Sep 2018 09:06:51 +0000 (12:06 +0300)]
Improve documentation of directory-local variables
* lisp/files.el (hack-local-variables, normal-mode)
(after-find-file, find-file-hook): Mention directory-local
variables in the doc strings. Suggested by Marcin Borkowski
<mbork@mbork.pl>.
* doc/emacs/custom.texi (File Variables, Directory Variables):
Clarify that directory-local variables are overridden by
file-local ones.
Eli Zaretskii [Sat, 22 Sep 2018 07:54:58 +0000 (10:54 +0300)]
Don't use obsolete variable 'save-place' in documentation
* doc/lispref/customize.texi (Variable Definitions): Replace
example of saveplace defcustom with a fictitious one, which
will not bit-rot with time. (Bug#32741)
Paul Eggert [Fri, 21 Sep 2018 21:24:42 +0000 (14:24 -0700)]
Fix ambiguity in nil DST flag
Formerly nil meant both that DST was not in effect and that
the DST flag was unknown, and different functions interpreted
the flag differently. Now the meaning is consistently nil for
DST not in effect, and -1 for DST flag not known.
* doc/lispref/os.texi (Time Conversion): The DST slot is
now three-valued, not two-.
* doc/misc/emacs-mime.texi (time-date): Adjust to new behavior.
* etc/NEWS: Mention this.
* lisp/calendar/parse-time.el (parse-time-string):
* src/editfns.c (Fdecode_time):
Return -1 for unknown DST flag.
* test/lisp/calendar/parse-time-tests.el (parse-time-tests):
Adjust tests to match new behavior, and add a new
test for nil vs -1.
Paul Eggert [Fri, 21 Sep 2018 00:43:42 +0000 (17:43 -0700)]
Bindat examples in source, not manual
* doc/lispref/processes.texi (Bindat Examples): Remove, fixing
a FIXME in the manual. The long example had bitrotted to some
extent, compared to the more-up-to-date example in bindat.el
commentary, which apparently what people were referring to
anyway. The short example was confusing and not that useful
and will be obsolescent anyway if we change timestamp format.
Suggested by Stefan Monnier here:
https://lists.gnu.org/archive/html/emacs-devel/2018-09/msg00783.html
* lisp/replace.el (occur--parse-occur-buffer): Since point is at the
beginning of the buffer, use `point'.
(occur-revert-function): Prefer `pcase-let' and `point-min'.
Check whether `region-start' or `region-end' are non-nil.
d28d54c (origin/emacs-26) More accurate docs for 'text-char-description' b3baf99 Document synchronous behavior of eshell/make (Bug#32513) 98544ea Fix bs-show with wide characters (Bug#17822) 85af51b Improve Custom menu labels for 2 options 72a2a36 Improve wording of last change in dired-x.texi d4fa83b Fix GnuTLS test suite with GnuTLS versions 3.4.x b5bee6b Fix build with gnutls versions 3.0 to 3.2 (Bug#32446) 67eb80e ; * etc/enriched.txt (hanging-indents): Remove extra indent. c71cfb7 Fix the Bubbles game on TTY frames 3bbf21b Add choice to reshow certificate information (Bug#31877) 6f2c471 * src/alloc.c (Fbool_vector, Flist, Fvector): Doc tweak. 39eecb3 * src/alloc.c (vector): Fix grammatical error in doc string: ...
Eli Zaretskii [Thu, 20 Sep 2018 06:41:55 +0000 (09:41 +0300)]
More accurate docs for 'text-char-description'
* src/keymap.c (Ftext_char_description):
* doc/lispref/help.texi (Describing Characters): More accurate
description of 'text-char-description'. Remove incorrect
examples from the ELisp manual. (Bug#32743)
Document synchronous behavior of eshell/make (Bug#32513)
* doc/misc/eshell.texi (Built-ins):
* lisp/eshell/em-unix.el (eshell/make): Mention that it falls back to
the external 'make' command when called synchronously.
Store the region and orig line into the *Occur* header line.
Retrieve this information in `occur-revert-function'.
* lisp/replace.el (occur--parse-occur-buffer): New defun.
(occur-revert-function): Use it.
(occur-engine): Store region and original position as text properties
into the *Occur* header line.
* lisp/replace.el (occur-engine): Add sensible default values for
(occur--orig-line and nlines.
Eli Zaretskii [Tue, 18 Sep 2018 10:24:29 +0000 (13:24 +0300)]
Fix GnuTLS test suite with GnuTLS versions 3.4.x
* src/gnutls.c (gnutls_cipher_get_tag_size): Make it return
zero only for versions of GnuTLS < 3.2.2, where
gnutls_cipher_get_tag_size was introduced. This fixes the
GnuTLS test suite, which assumes that any cipher whose tag
size is non-zero is AEAD-capable, and doesn't test such ciphers
if AEAD is not available, i.e. for GnuTLS < 3.5.1. (Bug#32446)
Fix build with gnutls versions 3.0 to 3.2 (Bug#32446)
We previously used functions available only in 3.2+ for all 3.x
versions.
* src/gnutls.c [GNUTLS_VERSION_NUMBER < 0x030501]: Replace calls to
gnutls_cipher_get_tag_size with 0.
[GNUTLS_VERSION_NUMBER < 0x030200]: Alias gnutls_cipher_get_iv_size
to gnutls_cipher_get_block_size, gnutls_digest_list to
gnutls_mac_list, and gnutls_digest_get_name to gnutls_mac_get_name.
[WINDOWSNT]: Adjust DLL function definitions and declarations
accordingly.
Stefan Monnier [Mon, 17 Sep 2018 18:02:05 +0000 (14:02 -0400)]
* lisp/emacs-lisp/advice.el: Only use defmacro when needed
(ad-get-advice-info): Mark it inlinable.
(ad-get-advice-info-macro): Make it an obsolete alias.
(ad-copy-advice-info, ad-is-advised, ad-get-advice-info-field)
(ad-find-advice, ad-macrofy, ad-lambdafy, ad-lambda-p, ad-advice-p)
(ad-compiled-p, ad-compiled-code, ad-get-cache-definition)
(ad-get-cache-id, ad-set-cache): Turn macros into defsubsts.
(ad-defadvice-flags): Make it into a plain list.
(ad-set-advice-info-field): Apply a bit of CSE.
Stefan Monnier [Mon, 17 Sep 2018 17:46:21 +0000 (13:46 -0400)]
* lisp/emacs-lisp/advice.el (ad-advised-functions): Make it a plain list
(ad-read-advised-function, ad-do-advised-functions): Adjust accordingly.
(ad-pushnew-advised-function, ad-pop-advised-function): Also make them
into functions.
Eli Zaretskii [Mon, 17 Sep 2018 14:34:31 +0000 (17:34 +0300)]
Fix the Bubbles game on TTY frames
* lisp/play/bubbles.el (bubbles--col-offset)
(bubbles--row-offset): Doc fixes.
(bubbles--compute-offsets): Conflate the GUI and TTY code into
a single common version. Set the offsets to simple numbers,
not to lists.
(bubbles--initialize, bubbles--show-scores): Wrap offset
values in a list, so that they are interpreted as pixel
values, not as units of character width. This fixes the game
on TTY frames. (Bug#32744)
Paul Eggert [Mon, 17 Sep 2018 04:24:04 +0000 (21:24 -0700)]
Move current_timespec decl to timespec.h
This change was motivated by the desire to remove the weird
dependency of lib-src/profile.o on src/systime.h. profile.c
included systime.h only for current_timespec, and this
inclusion required systime.h to have #ifdef emacs in multiple
places and complicated further changes I have in mind.
The current_timespec decl belongs in timespec.h anyway,
and the main effect of this change is to move it there.
* lib-src/profile.c (INLINE): Remove.
Include timespec.h, not systime.h.
* lib/gettime.c (gettime): Prefer clock_gettime to nanotime,
and don’t worry about it failing on a CLOCK_REALTIME arg.
POSIX requires it to succeed and I don’t know of any
counterexamples where the fallbacks would work.
(current_timespec): Move here from src/systime.h.
Nowadays it seems to be better to not have this function
be inline.
* lib/timespec.h: Include arg-nonnull.h.
(current_timespec): New declaration.
(gettime, settime): Declare args to be nonnull.
* lib/gettime.c, lib/timespec.h: Copy from Gnulib.
* src/systime.h: Simplify by assuming ‘emacs’ is defined,
which it always is now.
(current_timespec): Move to lib/timespec.h.
Allen Li [Wed, 1 Aug 2018 10:04:26 +0000 (03:04 -0700)]
Add choice to reshow certificate information (Bug#31877)
In various situations, the window displaying the certificate
information can be hidden (such as if the user accidentally presses ?,
which causes the read-multiple-choice help window to replace it).
Instead of leaving the user to make a choice blindly, add a choice to
reshow the certification information.