* lisp/emulation/cua-base.el (cua-cut-handler):
(cua-copy-handler): New aliases (bug#28930).
(cua--init-keymaps): Use them for `C-x' and `C-c' to be able to
distinguish the commands when looking them up in reverse.
* lisp/emulation/cua-base.el: Use lexical-binding.
Remove redundant `:group` arguments.
(cua-mode): Don't use `:require` since the autoload on `define-minor-mode`
takes care of loading the mode when custom-setting it.
* lisp/emulation/cua-gmrk.el: Use lexical-binding.
(cua--copy-rectangle-to-global-mark): Remove unused var `src-buf`.
* lisp/emulation/edt-mapper.el: Use lexical-binding.
* lisp/emulation/edt.el: Use lexical-binding.
Remove redundant `:group` arguments.
(edt-with-position): Allow `top`, `left`, and `far` to be left unused
in `body`.
* lisp/emulation/keypad.el: Use lexical-binding.
* lisp/emulation/viper-cmd.el: Move `provide` to the end.
(viper-read-string-with-history): Strength reduce `eval` to `symbol-value`.
* lisp/emulation/viper-ex.el: Use lexical-binding.
Remove redundant `:group` arguments.
Move `provide` to the end.
* lisp/emulation/viper-init.el: Use lexical-binding.
* lisp/emulation/viper-keym.el (viper-toggle-key): Use `dolist`.
(viper-insert-diehard-map): Use `string`.
(viper-modify-major-mode): Use `alist-get` and `setf`.
* lisp/emulation/viper-macs.el (viper-ex-work-buf):
Move `provide` to the end.
(viper-record-kbd-macro): Strength reduce `eval` to `symbol-value`.
(viper-describe-kbd-macros): Return value is not significant.
(viper-keyseq-is-a-possible-macro): Use `seq-some`.
(viper-common-seq-prefix): Use `seq-every-p`.
* lisp/emulation/viper-mous.el: Use lexical-binding.
Remove redundant `:group` arguments.
Move `provide` to the end.
(viper-remember-current-frame): Accept arbitrary ignored args.
(viper-parse-mouse-key): Strength reduce `eval` to `symbol-value`.
Remove unused var `key-spec`.
(viper-bind-mouse-search-key, viper-bind-mouse-insert-key):
Apply de Morgan.
* lisp/emulation/viper-util.el: Move `provide` to the end.
(viper-move-marker-locally, viper-push-onto-ring, viper-save-setting):
Strength reduce `eval` to `symbol-value`.
(viper-event-vector-p, viper-char-symbol-sequence-p, viper-char-array-p):
Use `seq-every-p`.
* lisp/emulation/viper.el (viper-non-hook-settings): Eta-reduce use of
`viper-remember-current-frame`.
* lisp/simple.el (visual-line-mode): Only save values once, even
if the mode is switched on twice (bug#43730). This makes both
previously set local values for variables like truncate-lines, as
well as default values for truncate-lines restorable.
* lisp/emulation/cua-base.el (cua-mode): Ditto.
* lisp/emulation/cua-base.el (cua-toggle-rectangle-mark): Autoload it.
Library cua-base.el binds cua-toggle-rectangle-mark to a key in the
:set function in (defcustom cua-rectangle-mark-key ...), so it should
ensure that the command is defined.
Copyright-paperwork-exempt: yes
This allows a user to set a non-meta modifier for their terminal
should his/her terminal support it. See bug#35058 for background on
this change.
* lisp/emulation/cua-base.el (cua-rectangle-terminal-modifier-key):
New defcustom.
* lisp/emulation/cua-base.el (cua--shift-control-x-prefix): Use new
defcustom.
* lisp/emulation/cua-base.el (cua--prefix-override-replay):
Push the key to replace wrapped in '(no-record . KEY)', so
that it doesn't get recorded more than once. (Bug#34901)
* src/keyboard.c (read_char): Handle the '(no-record . KEY)'
event by substituting KEY for it.
(syms_of_keyboard) <no-record>: New DEFSYM.
<unread-command-events>: Update the doc string.
* doc/lispref/commands.texi (Event Input Misc): Document the
'(no-record . EVENT)' form.
* lisp/emulation/cua-base.el (cua-scroll-up, cua-scroll-down):
* lisp/progmodes/subword.el (subword-forward, subword-backward):
* lisp/obsolete/crisp.el (crisp-home, crisp-end):
Remove 'CUA' prop; not used any more.
Add a paragraph to minor mode's docstring documenting the mode's ARG
usage if the supplied docstring doesn't already contain the word "ARG".
* easy-mmode.el (easy-mmode--arg-docstring): New const.
(easy-mmode--arg-docstring): New function.
(define-minor-mode): Use them.
Remove argument documentation from all minor modes.
Most of this change is to boilerplate commentary such as license URLs.
This change was prompted by ftp://ftp.gnu.org's going-away party,
planned for November. Change these FTP URLs to https://ftp.gnu.org
instead. Make similar changes for URLs to other organizations moving
away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and
fsf.org when this works, as this will further help defend against
man-in-the-middle attacks (for this part I omitted the MS-DOS and
MS-Windows sources and the test tarballs to keep the workload down).
HTTPS is not fully working to lists.gnu.org so I left those URLs alone
for now.
* lisp/simple.el (prefix-command-echo-keystrokes-functions)
(prefix-command-preserve-state-hook): New hooks.
(internal-echo-keystrokes-prefix): New function.
(prefix-command--needs-update, prefix-command--last-echo): New vars.
(prefix-command-update, prefix-command-preserve): New functions.
(reset-this-command-lengths): New compatibility definition.
(universal-argument--mode): Call prefix-command-update.
(universal-argument, universal-argument-more, negative-argument)
(digit-argument): Call prefix-command-preserve-state.
* src/keyboard.c: Call internal-echo-keystrokes-prefix to build
the "prefix argument" to echo.
(this_command_key_count_reset, before_command_key_count)
(before_command_echo_length): Delete variables.
(echo_add_key): Always add a space.
(echo_char): Remove.
(echo_dash): Don't give up when this_command_key_count is 0, since that
is now the case after a prefix command.
(echo_update): New function, extracted from echo_now.
(echo_now): Use it.
(add_command_key, read_char, record_menu_key): Remove old disabled code.
(command_loop_1): Don't refrain from pushing an undo boundary when
prefix-arg is set. Remove other prefix-arg special case, now handled
directly in the prefix commands instead. But call echo_now if there's
a prefix state to echo.
(read_char, record_menu_key): Use echo_update instead of echo_char.
(read_key_sequence): Use echo_now rather than echo_dash/echo_char.
(Freset_this_command_lengths): Delete function.
(syms_of_keyboard): Define Qinternal_echo_keystrokes_prefix.
(syms_of_keyboard): Don't defsubr Sreset_this_command_lengths.
* lisp/simple.el: Use those new hooks for C-u.
(universal-argument--description): New function.
(prefix-command-echo-keystrokes-functions): Use it.
(universal-argument--preserve): New function.
(prefix-command-preserve-state-hook): Use it.
(command-execute): Call prefix-command-update if needed.
* lisp/kmacro.el (kmacro-step-edit-prefix-commands)
(kmacro-step-edit-prefix-index): Delete variables.
(kmacro-step-edit-query, kmacro-step-edit-insert): Remove ad-hoc
support for prefix arg commands.
(kmacro-step-edit-macro): Don't bind kmacro-step-edit-prefix-index.
* lisp/emulation/cua-base.el (cua--prefix-override-replay)
(cua--shift-control-prefix): Use prefix-command-preserve-state.
Remove now unused arg `arg'.
(cua--prefix-override-handler, cua--prefix-repeat-handler)
(cua--shift-control-c-prefix, cua--shift-control-x-prefix):
Update accordingly.
(cua--prefix-override-timeout): Don't call reset-this-command-lengths
any more.
(cua--keep-active, cua-exchange-point-and-mark): Don't set mark-active
if the mark is not set.
* lisp/delsel.el (delete-selection-save-to-register)
(delsel--replace-text-or-position): New vars.
(delete-active-region): Use them.
(delete-selection-repeat-replace-region): New command, moved from
cua-base.el.
* lisp/emulation/cua-base.el (cua--repeat-replace-text): Remove var.
(cua-repeat-replace-region): Move command to delsel.el.
(cua--init-keymaps): Update binding accordingly.
(cua-mode): Set delete-selection-save-to-register.
Fixes: debbugs:18886
(cua--deactivate-rectangle): Don't deactivate the mark.
(cua-set-rectangle-mark): Don't set mark-active since
cua--activate-rectangle already does it for us.
(cua--rectangle-highlight-for-redisplay): Unhighlight a previous
non-rectangular region.
* lisp/emulation/cua-base.el (cua-repeat-replace-region):
Use with-current-buffer.
* lisp/net/gnutls.el: Use cl-lib.
(gnutls-negotiate): `mapcan' -> cl-mapcan.
instead of deleting the selection "by hand".
Rely on insert-for-yank to yank rectangles.
(cua-highlight-region-shift-only): Mark obsolete.
(cua-mode): Don't enable/disable transient-mark-mode,
shift-select-mode (cua-mode works both with and without them), and
pc-selection-mode (obsolete).
* lisp/emulation/cua-rect.el (cua--activate-rectangle): Activate the mark.
(cua--deactivate-rectangle): Deactivate it.
Fixes: debbugs:16098
* lisp/emulation/cua-base.el (cua--explicit-region-start)
(cua--last-region-shifted): Remove.
(cua--deactivate): Use deactivate-mark.
(cua--pre-command-handler-1): Don't handle shift-selection.
(cua--post-command-handler-1): Don't change transient-mark-mode.
(cua--select-keymaps): Use region-active-p rather than
cua--explicit-region-start or cua--last-region-shifted.
(cua-mode): Enable shift-select-mode.
* lisp/emulation/cua-rect.el (cua--rectangle-highlight-for-redisplay):
New function.
(redisplay-highlight-region-function): Use it.