* lisp/wid-edit.el (widget-color-match, widget-color-validate): New
functions.
(color): Use the new functions. Base size on longest defined color
name, defaulting to the longest RGB hex string.
Change calls from 'read-event' to 'read-key' in libraries expecting
mouse events. Do this only when 'xterm-mouse-mode' is enabled. That
way those libraries read decoded mouse events instead of the
underlying escape sequence. Add a parameter to 'read-key' that avoids
running any of the unbound fallbacks in 'read-key-sequence' so the
libraries can read mouse button-down events.
For backward compatibility purposes, the above logic is contained in a
new internal-only function: 'read--potential-mouse-event'.
* doc/lispref/commands.texi (Reading One Event): Document new
parameter to 'read-key'. Mention that non-character events on
terminals need 'read-key'.
* lisp/subr.el (read-key-full-map): Add new keymap used by 'read-key'.
(read-key): Add new parameter 'fallbacks-disabled' to prevent running
any of the unbound fallbacks normally run by 'read-key-sequence'.
(read--potential-mouse-event): Add new function that calls 'read-key'
or 'read-event' depending on if 'xterm-mouse-mode' is set.
* lisp/foldout.el (foldout-mouse-swallow-events):
* lisp/isearch.el (isearch-pre-command-hook):
* lisp/mouse-drag.el (mouse-drag-throw, mouse-drag-drag):
* lisp/mouse.el (mouse-drag-secondary):
* lisp/ruler-mode.el (ruler-mode-mouse-grab-any-column)
(ruler-mode-mouse-drag-any-column-iteration):
* lisp/strokes.el (strokes-read-stroke, strokes-read-complex-stroke):
* lisp/textmodes/artist.el (artist-mouse-draw-continously)
(artist-mouse-draw-poly, artist-mouse-draw-2points):
* lisp/vc/ediff-wind.el (ediff-get-window-by-clicking):
* lisp/wid-edit.el (widget-button--check-and-call-button)
(widget-button-click): Call 'read--potential-mouse-event' instead of
'read-event'.
* lisp/wid-edit.el (widget-key-sequence-read-event): Call 'read-key'
with 'fallbacks-disabled' set instead of 'read-event'. Unlike above
changes, this is unconditionally applied so it works for function
keys too. Apply 'local-function-key-map' instead of
'function-key-map' as that contains the full terminal translations.
* lisp/vc/ediff.el (ediff-windows): Use 'display-mouse-p' to check if
a mouse is available.
* src/lread.c (Fread_event): Recommend 'read-key' in docstring for
'read-event' for non-character events.
* lisp/wid-edit.el (widget-move): Remove code that caused
widget-backward to skip an immediate previous widget when moving
backward from the start of a widget. (Bug#45623)
* test/lisp/wid-edit-tests.el (widget-test-widget-backward): New test.
* lisp/subr.el (read-char-choice-use-read-key): New variable.
(read-char-choice): Use read-char-from-minibuffer when
read-char-choice-use-read-key is nil.
(y-or-n-p-use-read-key): New variable.
(y-or-n-p): Restore old code that calls read-key to use it when
y-or-n-p-use-read-key is non-nil.
* lisp/dired-aux.el (dired--no-subst-ask, dired-query):
* lisp/files.el (files--ask-user-about-large-file)
(hack-local-variables-confirm):
* lisp/userlock.el (ask-user-about-supersession-threat):
* lisp/wid-edit.el (widget-choose): Revert to use read-char-choice
instead of read-char-from-minibuffer.
https://lists.gnu.org/archive/html/emacs-devel/2020-12/msg01919.html
A choice widget should be able to match either no inline values or
inline values, upon request. (Bug#44579)
* lisp/wid-edit.el (choice): New property, :inline-bubbles-p. A
predicate that returns non-nil if the choice widget can act as an
inline widget. Document it.
(widget-choice-inline-bubbles-p): New function, for the
:inline-bubbles-p property of the choice widget.
(widget-inline-p): New function. Use the :inline-bubbles-p property
of the widget, if any.
(widget-match-inline): Use the above to see if the widget can act like
an inline widget. Document it.
(widget-choice-value-create): Account for the case of a choice widget
that has inline members.
(widget-checklist-add-item, widget-editable-list-value-create)
(widget-group-value-create): Use widget-inline-p rather than just
checking for a non-nil :inline property, allowing these functions to
pass the complete information to widgets like the choice widget to
create their values.
* test/lisp/wid-edit-tests.el (widget-test-choice-match-no-inline)
(widget-test-choice-match-all-inline)
widget-test-choice-match-some-inline): New tests, to check that choice
widgets can match its choices, inline or not.
(widget-test-inline-p): New test, for the new function
widget-inline-p.
(widget-test-repeat-can-handle-choice)
(widget-test-repeat-can-handle-inlinable-choice)
(widget-test-list-can-handle-choice)
(widget-test-list-can-handle-inlinable-choice)
(widget-test-option-can-handle-choice)
(widget-test-option-can-handle-inlinable-choice): New tests. This
grouping widgets need to be able to create a choice widget regardless
if it has inline choices or not.
* lisp/wid-edit.el (restricted-sexp widget): New :value-to-external
function. If value is not in the internal format, then we might be
dealing with a bad default value for the widget, so display a warning
about that (bug#25152).
* etc/NEWS (Widget): Announce the feature (bug#6419).
* lisp/wid-edit.el (widget-editable-list-delete-at): Save into a new
widget property, :last-deleted, the WIDGET to be deleted. Add
docstring.
(widget-editable-list-insert-before): If there is a recently deleted
child for the editable list, insert that one, instead of a new default
widget. Add docstring.
(insert-button widget): Make :help-echo a function to avoid the
help-echo string become too long.
(delete-button widget): Tweak the :help-echo string, to document this
behavior.
* test/lisp/wid-edit-tests.el (widget-test-moving-editable-list-item):
Test the feature.
* doc/misc/widget.texi (Utilities): Document widget-choose.
* etc/NEWS: Document the feature (bug#4787).
* lisp/wid-edit.el (widget--simplify-menu): New function, to convert
extended menus into simplified menus when using the menu to prompt
through the minibuffer.
(widget-choose): Accept a keymap menu. When not using x-popup-menu,
simplify the menu with widget--simplify-menu. Document the changes in
the docstring.
* lisp/wid-edit.el (widget-character--escape-sequences-alist): New
variable.
(widget-character--change-character-display): New function. Use the new
variable.
(widget-character-notify): New function, to keep track of the changes
in the character widget, and display characters like tab,
newline and spaces better.
(character widget): Use widget-character-notify as the notify
function. Use widget-character--change-character-display for the
internal representation of value (bug#15925).
* lisp/wid-edit.el (widget-button-click): Remove a
newly-introduced check that made mouse highlights no longer work
(bug#43612). It's unclear what the check was trying to fix.
* lisp/wid-edit.el (widget-specify-field): Extend check for adding the
boundary overlay. Plus, a minor comment indentation fix.
(character widget): Tweak the valid-regexp to allow the newline
character.
* test/lisp/wid-edit-tests.el (widget-test-character-widget-value)
(widget-test-editable-field-widget-value): New tests (bug#15925).
* doc/lispref/customize.texi (Common Keywords): Document it.
* lisp/cus-edit.el (custom-face-value-create): Use a widget
instead of a button so that TAB works (bug#20664).
* lisp/wid-edit.el (face-link): New widget.
(widget-face-link-action): New action.
* lisp/wid-edit.el (widget-button--check-and-call-button): Record the
ending position of event, because we might need it when
the :mouse-down-action function returns non-nil (bug#20664).
* lisp/wid-edit.el (file widget): Add a :match and a :validate
function to the 'file widget, to be able to check if the widget
value is an existent file, when required (bug#25678).
* lisp/help-fns.el (describe-widget-functions): New variable, used by
describe-widget.
(describe-widget): New command, to display information about a widget.
* lisp/button.el (button-describe): New command, for describing a button.
(button--describe): Helper function for button-describe.
* lisp/wid-edit.el (widget-describe): New command, for describing a
widget.
(widget--resolve-parent-action): Helper function, to allow
widget-describe to display more useful information (bug#139).
* lisp/wid-edit.el ('string widget): Peek the word that
ispell-complete-word will try to complete, and only offer completions
when the word is inside of the field (bug#11046).
* lisp/wid-edit.el (widget-completions-at-point): Detect here if point
is not in an editable field.
(widget-complete): And here say there are no completions available
(bug#11562).
* lisp/wid-edit.el (widget 'other): Use \n instead of the %n escape in the
:format property of this widget. If %n is used at the end of the
format string, unrelated widgets get indented. (Bug#12533)
* test/wid-edit-tests.el (widget-test-indentation-after-%n)
(widget-test-indentation-after-newline)
(widget-test-newline-and-indent-same-widget): New tests.
* lisp/wid-edit.el (widget--should-indent-p): New function, to decide
whether to indent or not.
(widget-checklist-value-add-item, widget-radio-add-item)
(widget-editable-list-format-handler)
(widget-editable-list-entry-create)
(widget-group-value-create): Use it (bug#7851).
* lisp/wid-edit.el (widget 'file, widget 'directory): Respect the option
read-file-name-completion-ignore-case.
(widget 'directory): Filter the file names, to only perform directory name
completion.
* lisp/wid-edit.el (widget-link-keymap): New variable, a keymap to use
inside a link widget.
('link widget): Restore the :follow-link property and add
widget-link-keymap as the :keymap property (bug#15682).
* lisp/gnus/gnus-sum.el (gnus-collect-urls): Make sure that
the URL labeled "Link" is the first in the return list.
(gnus-summary-browse-url): Use the 1st URL as the default.
* lisp/wid-edit.el (widget-text): New function.
See bug#11649 for an example problem, and emacs-devel discussion
«Prickliness of the "invalid byte code" stuff».
* lisp/wid-edit.el, lisp/wdired.el, lisp/vc/pcvs-util.el:
* lisp/progmodes/executable.el, lisp/mail/sendmail.el:
* lisp/emacs-lisp/cl-seq.el, lisp/emacs-lisp/cl-macs.el:
* lisp/emacs-lisp/cl-lib.el, lisp/emacs-lisp/cl-extra.el:
* lisp/dired-x.el, lisp/dired-aux.el, lisp/calendar/calendar.el:
Don't use byte-compile-dynamic any more.
Restore lines saying "Maintainer: emacs-devel@gnu.org" when there is
no special maintainer for a file. Although this wasn't documented
it was common practice and removing the lines didn't have consensus.
* lisp/button.el (button-at):
* lisp/wid-edit.el (widget-at): Avoid returning a false positive
when looking for a button and finding a widget, or vice versa.
* test/lisp/button-tests.el:
* test/lisp/wid-edit-tests.el: New files.
This fixes some URLs I omitted from my previous pass,
notably those in lists.gnu.org. Although lists.gnu.org
does not yet support TLS 1.1, TLS 1.0 is better than nothing.
* lisp/erc/erc.el (erc-official-location):
* lisp/mail/emacsbug.el (report-emacs-bug):
Use https:, not http:.
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.