1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-28 07:45:00 +00:00

Merge from savannah/emacs-30

860840621a Prevent crashes and related issues if initial activity is...
d5c6eb1f96 Doc fix in 'php-ts-mode'
fb15affde8 Avoid compiler warnings in the Cygwin-w32 build
8d354925dd Add new face 'widget-unselected' to wid-edit.el

# Conflicts:
#	etc/NEWS
This commit is contained in:
Po Lu 2024-06-27 11:08:31 +08:00
commit 2078ce4220
8 changed files with 125 additions and 26 deletions

View File

@ -3287,6 +3287,16 @@ Face used for pressed buttons.
Face used for inactive widgets.
@end deffn
@deffn Face widget-unselected
Face used for unselected widgets. This face is also used on the text
labels of radio-button and checkbox widgets.
The default value inherits from the @code{widget-inactive} face. If you
want to visually distinguish the labels of unselected active
radio-button or checkbox widgets from the labels of unselected inactive
widgets, customize this face to a non-default value.
@end deffn
@defopt widget-mouse-face
Face used for highlighting a button when the mouse pointer moves
across it.

View File

@ -1906,6 +1906,12 @@ options of GNU 'ls'.
** Widget
+++
*** New face 'widget-unselected'.
Customize this face to a non-default value to visually distinguish the
labels of unselected active radio-button or checkbox widgets from the
labels of unselected inactive widgets (the default value inherits from
the 'widget-inactive' face).
*** New user option 'widget-skip-inactive'.
If non-nil, moving point forward or backward between widgets by typing
'TAB' or 'S-TAB' skips over inactive widgets. The default value is nil.

View File

@ -74,6 +74,9 @@ public final class EmacsWindow extends EmacsHandleObject
{
private static final String TAG = "EmacsWindow";
/* Whether any windows have yet been created in this session. */
private static boolean initialWindowCreated;
private static class Coordinate
{
/* Integral coordinate. */
@ -192,6 +195,14 @@ private static class Coordinate
this.parent = parent;
this.overrideRedirect = overrideRedirect;
/* The initial frame should always be bound to the startup
activity. */
if (!initialWindowCreated)
{
this.attachmentToken = -1;
initialWindowCreated = true;
}
/* Create the list of children. */
children = new ArrayList<EmacsWindow> ();

View File

@ -174,6 +174,27 @@ && isWindowEligible (consumer, window))
}
}
/* Do not create a multitasking activity for the initial frame,
but arrange to start EmacsActivity. */
if (window.attachmentToken == -1)
{
intent = new Intent (EmacsService.SERVICE,
EmacsActivity.class);
intent.addFlags (Intent.FLAG_ACTIVITY_NEW_TASK);
try
{
EmacsService.SERVICE.startActivity (intent);
}
catch (Exception e)
{
Log.w (TAG, "an activity could not be started on behalf"
+ " of the mapped default window " + window.handle);
}
return;
}
intent = new Intent (EmacsService.SERVICE,
EmacsMultitaskActivity.class);
@ -205,14 +226,22 @@ && isWindowEligible (consumer, window))
window.attachmentToken = token;
intent.putExtra (ACTIVITY_TOKEN, token);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N)
EmacsService.SERVICE.startActivity (intent);
else
try
{
/* Specify the desired window size. */
options = ActivityOptions.makeBasic ();
options.setLaunchBounds (window.getGeometry ());
EmacsService.SERVICE.startActivity (intent, options.toBundle ());
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N)
EmacsService.SERVICE.startActivity (intent);
else
{
/* Specify the desired window size. */
options = ActivityOptions.makeBasic ();
options.setLaunchBounds (window.getGeometry ());
EmacsService.SERVICE.startActivity (intent, options.toBundle ());
}
}
catch (Exception e)
{
Log.w (TAG, "an activity could not be started on behalf"
+ " of a mapped window, " + window.handle);
}
pruneWindows ();

View File

@ -977,7 +977,8 @@ characters of the current line."
:override t
:feature 'property
`((attribute_name) @font-lock-variable-name-face))
"Tree-sitter font-lock settings for `php-html-ts-mode'.")
"Tree-sitter Font-lock settings for HTML when embedded in PHP.
Like `html-ts-mode--font-lock-settings' but adapted for `php-ts-mode'.")
(defvar php-ts-mode--phpdoc-font-lock-settings
(treesit-font-lock-rules

View File

@ -568,6 +568,29 @@ With CHECK-AFTER non-nil, considers also the content after point, if needed."
(delete-overlay inactive)
(widget-put widget :inactive nil))))
(defface widget-unselected
'((t :inherit widget-inactive))
"Face used for unselected widgets."
:group 'widget-faces
:version "30.1")
(defun widget-specify-unselected (widget from to)
"Fontify WIDGET as unselected."
(let ((overlay (make-overlay from to nil t nil)))
(overlay-put overlay 'face 'widget-unselected)
(overlay-put overlay 'evaporate t)
;; The overlay priority here should be lower than the priority in
;; `widget-specify-active' (bug#69942).
(overlay-put overlay 'priority 90)
(widget-put widget :unselected overlay)))
(defun widget-specify-selected (widget)
"Remove fontification of WIDGET as unselected."
(let ((unselected (widget-get widget :unselected)))
(when unselected
(delete-overlay unselected)
(widget-put widget :unselected nil))))
;;; Widget Properties.
(defsubst widget-type (widget)
@ -2450,10 +2473,16 @@ when he invoked the menu."
(defun widget-checkbox-action (widget &optional event)
"Toggle checkbox, notify parent, and set active state of sibling."
(widget-toggle-action widget event)
(let ((sibling (widget-get-sibling widget)))
(let* ((sibling (widget-get-sibling widget))
(from (widget-get sibling :from))
(to (widget-get sibling :to)))
(when sibling
(widget-apply sibling
(if (widget-value widget) :activate :deactivate))
(if (widget-value widget)
(progn
(widget-apply sibling :activate)
(widget-specify-selected sibling))
:deactivate
(widget-specify-unselected sibling from to))
(widget-clear-undo))))
;;; The `checklist' Widget.
@ -2509,15 +2538,18 @@ If the item is checked, CHOSEN is a cons whose cdr is the value."
((eq escape ?v)
(setq child
(cond ((not chosen)
(let ((child (widget-create-child widget type)))
(widget-apply child :deactivate)
(let* ((child (widget-create-child widget type))
(from (widget-get child :from))
(to (widget-get child :to)))
(widget-specify-unselected child from to)
child))
((widget-inline-p type t)
(widget-create-child-value
widget type (cdr chosen)))
(t
(widget-create-child-value
widget type (car (cdr chosen)))))))
widget type (car (cdr chosen)))
(widget-specify-selected child)))))
(t
(error "Unknown escape `%c'" escape)))))
;; Update properties.
@ -2688,8 +2720,11 @@ Return an alist of (TYPE MATCH)."
(widget-create-child-value
widget type value)
(widget-create-child widget type)))
(unless chosen
(widget-apply child :deactivate)))
(if chosen
(widget-specify-selected child)
(let ((from (widget-get child :from))
(to (widget-get child :to)))
(widget-specify-unselected child from to))))
(t
(error "Unknown escape `%c'" escape)))))
;; Update properties.
@ -2739,14 +2774,17 @@ Return an alist of (TYPE MATCH)."
(dolist (current (widget-get widget :children))
(let* ((button (widget-get current :button))
(match (and (not found)
(widget-apply current :match value))))
(widget-apply current :match value)))
(from (widget-get current :from))
(to (widget-get current :to)))
(widget-value-set button match)
(if match
(progn
(widget-value-set current value)
(widget-apply current :activate))
(widget-apply current :deactivate))
(setq found (or found match))))))
(progn
(widget-value-set current value)
(widget-apply current :activate)
(widget-specify-selected current))
(widget-specify-unselected current from to))
(setq found (or found match))))))
(defun widget-radio-validate (widget)
;; Valid if we have made a valid choice.
@ -2766,13 +2804,16 @@ Return an alist of (TYPE MATCH)."
(let ((buttons (widget-get widget :buttons)))
(when (memq child buttons)
(dolist (current (widget-get widget :children))
(let* ((button (widget-get current :button)))
(let* ((button (widget-get current :button))
(from (widget-get current :from))
(to (widget-get current :to)))
(cond ((eq child button)
(widget-value-set button t)
(widget-apply current :activate))
(widget-apply current :activate)
(widget-specify-selected current))
((widget-value button)
(widget-value-set button nil)
(widget-apply current :deactivate)))))))
(widget-specify-unselected current from to)))))))
;; Pass notification to parent.
(widget-apply widget :notify child event))

View File

@ -35,5 +35,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
extern void syms_of_cygw32 (void);
extern char * w32_strerror (int error_no);
extern LPBYTE w32_get_resource (const char * key, const char * name, LPDWORD type);
#endif /* CYGW32_H */

View File

@ -11284,7 +11284,7 @@ typedef USHORT (WINAPI * CaptureStackBackTrace_proc) (ULONG, ULONG, PVOID *,
configure.ac. */
#if defined MINGW_W64 && EMACS_INT_MAX > LONG_MAX
# define DEFAULT_IMAGE_BASE (ptrdiff_t)0x400000000
#else /* 32-bit MinGW build */
#elif !defined CYGWIN /* 32-bit MinGW build */
# define DEFAULT_IMAGE_BASE (ptrdiff_t)0x01000000
#endif