* doc/emacs/custom.texi (Modifier Keys): Document how to enter
Shift, Control, and Meta using "C-x @".
* lisp/simple.el (function-key-map): Add commentary to "C-x @"
bindings to make them easier to discover.
* lisp/startup.el (initial-scratch-message):
* lisp/simple.el (get-scratch-buffer-create): Revert last changes.
* src/window.c (Fset_window_configuration): Force recalculation of
Vwindow_list after restoring the windows.
* src/buffer.c (other_buffer_safely): Make sure we always return a
valid buffer, even if 'get-scratch-buffer-create' signals an
error.
* lisp/startup.el (initial-scratch-message): Don't use \\[...]
commands for substitute-command-keys.
* lisp/simple.el (get-scratch-buffer-create): Don't call
substitute-command-keys on initial-scratch-message, to avoid
signaling an error in rare cases. (Bug#60096)
* lisp/paren.el (show-paren--show-context-in-overlay): Use
show-paren-priority as overlay priority (fixes problem 2 of
bug#59527).
* lisp/simple.el (blink-paren-open-paren-line-string): Ensure the
context lines are font-locked before taking the
buffer-substring (fixes problem 1 of bug#59527).
* lisp/simple.el (completion-list-mode-map): Bind [up] to
'previous-line-completion', and [down] to 'next-line-completion'.
(completion-auto-wrap): Mention `next-line-completion' and
`previous-line-completion' in the docstring.
(previous-line-completion, next-line-completion): New commands.
* lisp/simple.el (execute-extended-command--describe-binding-msg):
New function factored out from...
(execute-extended-command): ...here. Fix bug where a key binding was
displayed as a command with 'suggest-key-bindings'. (Bug#59247)
* test/lisp/simple-tests.el
(simple-execute-extended-command--describe-binding-msg): New test.
Discussed in Bug#51143.
* lisp/simple.el (execute-extended-command--shorter): Compute a
complete list of `commandp' symbols once. This significantly speeds
up complicated cases while the slowdown of simple cases is still
accetable.
When Emacs-25 changed the default of `inhibit-point-motion-hooks` to t,
/etc/NEWS declared it as obsolete and so did its docstring, but
it was not marked as obsolete so as not to emit too many warnings
in code where it was impractical to remove the let-binding while
keeping backward compatibility with older Emacsen.
Those backward compatibility issues are not serious any more now that
Emacs-25 is itself considered old.
* lisp/subr.el (inhibit-point-motion-hooks): Mark it as obsolete.
* src/textprop.c (inhibit-point-motion-hooks): Don't mention it being
obsolete in the docstring any more.
* lisp/simple.el (line-move-1, line-move-finish): Silence warnings.
`line-move-1` was written back before `inhibit-point-motion-hooks`
was made obsolete and it's written under the assumption that its
value is nil, whereas since Emacs-25 it's t.
To work around problems linked to a nil value of
`inhibit-point-motion-hooks`, the code temporarily binds that var to
t while it moves around trying to find the final destination and then
later in a few key spots it binds it "back" to nil so as to run the
point-motion hooks according to the final destination, as if the
overall motion had been made "normally".
Change the code so that the "bind back" indeed binds the var back to
the value it had originally, rather than always to nil.
* lisp/simple.el (line-move-1): Obey `inhibit-point-motion-hooks`
(line-move-finish): New optional arg `not-ipmh`.
Make cconv.el detect when a closure's interactive form needs to
capture variables from the context and tweak the code accordingly
if so.
* lisp/emacs-lisp/cconv.el (cconv--interactive-form-funs): New var.
(cconv-convert): Handle the case where the interactive form captures
vars from the surrounding context. Remove left over handling of
`declare` which was already removed from the cconv-analyze` phase.
(cconv-analyze-form): Adjust analysis of interactive forms accordingly.
* lisp/emacs-lisp/oclosure.el (cconv--interactive-helper): New type and
function.
* lisp/simple.el (function-documentation, oclosure-interactive-form):
Add methods for it.
* test/lisp/emacs-lisp/cconv-tests.el
(cconv-tests-interactive-closure-bug51695): New test.
* lisp/simple.el
(filter-buffer-substring): Support a nil value to be more resilient.
(filter-buffer-substring-function): Doc fix; improve and update for
above change.
* lisp/simple.el (shell-command): Remove save-match-data, since
we're (in many cases) altering the match data earlier in the
function anyway (bug#57795).
* lisp/startup.el (normal-top-level): Move setting of
'window-point-insertion-type' from here...
* lisp/simple.el (messages-buffer-mode): ...to here. This is so
any *Messages* buffers we create instead of the original one, if
it's killed, will have the same type of the window-point marker.
(Bug#57466)
* lisp/simple.el (line-move-finish):
* lisp/window.el (scroll-command--goto-goal-column):
Revert back to using truncate-partial-width-windows instead of
truncated-partial-width-window-p. This change caused test failures
in lisp/ls-lisp-tests.log and lisp/emacs-lisp/edebug-tests.log.
* lisp/simple.el (line-move, line-move-finish):
Use truncated-partial-width-window-p.
* lisp/window.el (count-screen-lines, scroll-command--goto-goal-column):
Use truncated-partial-width-window-p.
(truncated-partial-width-window-p): Replace window-width with
window-total-width.
* src/indent.c (scan_for_column): Bring the logic of using
truncated-partial-width-window-p closer to what the display engine does.
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning):
* lisp/simple.el (command-execute): When warning about an obsolete
command, display the keybinding for the new command.
* src/xdisp.c (mode_line_update_needed, redisplay_window)
(decode_mode_spec): Don't avoid calling current_column, as it is
now fast enough.
(redisplay_window) <optional_new_start>: Don't call 'move_it_to'
if its result will not be used.
(Flong_line_optimizations_p): New primitive.
* src/indent.c (Fcurrent_column): Doc fix.
(current_column, scan_for_column): When in a buffer with long
and/or truncated lines, quickly return an approximate value.
* src/window.c (Frecenter): Use the old text-mode code when the
buffer has very long lines.
* lisp/simple.el (line-move): Avoid costly calls to
'line-move-partial' and 'line-move-visual' when lines are
truncated and/or very long.
(move-beginning-of-line): Call 'line-beginning-position' instead
of the slower 'skip-chars-backward'.
* etc/NEWS: Announce 'long-line-optimizations-p'.
* etc/NEWS: Announce new value of `deactivate-mark'.
* lisp/simple.el (deactivate-mark): Handle new value.
(bug#57147)
* src/keyboard.c (syms_of_keyboard): Update doc string of
`deactivate-mark'.
* lisp/simple.el (primitive-undo): Fix time comparison.
The old code was a circa-2013 mistranslation of what used to be in
src/undo.c’s Fprimitive_undo.
* lisp/minibuffer.el (minibuffer-local-must-match-map): Remove the
M-X binding here, because it's nonsensical outside
read-extended-command (bug#56741).
* lisp/simple.el (read-extended-command-mode-map)
(read-extended-command-mode): New minor mode to bind `M-X' in
read-extended-command.
(read-extended-command-1): Use it.
* lisp/simple.el (read-expression-map): Don't override RET and C-j
here, since that leads to breakages of other usages of this map
(bug#56548).
(read--expression-map): New map.
(read--expression): Use it.
* lisp/simple.el (primitive-undo): If the visited-modtime of the
indirect buffer's file is bogus, use the modtime of the file
visited by its base buffer.
* src/undo.c (record_first_change): Call
'buffer_visited_file_modtime' with the correct buffer, instead of
always calling 'Fvisited_file_modtime', which returns possibly
bogus values for indirect buffers.
* src/fileio.c (Fset_visited_file_modtime): Signal a meaningful
error for indirect buffers.
(buffer_visited_file_modtime): New function, with implementation
taken from 'Fvisited_file_modtime'.
(Fvisited_file_modtime): Call 'buffer_visited_file_modtime'.
* src/lisp.h: Add prototype for 'buffer_visited_file_modtime'.
(Bug#56397)