From 89a5aa4ca791b3ffefb0a5d464fa433f310a8398 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Mon, 18 Apr 2022 18:38:35 +0800 Subject: [PATCH] Add missing Motif atoms * src/xselect.c (symbol_to_x_atom): (x_atom_to_symbol): (syms_of_xselect): Optimize for XmTRANSFER_SUCCESS and XmTRANSFER_FAILURE as well. --- src/xselect.c | 68 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 50 insertions(+), 18 deletions(-) diff --git a/src/xselect.c b/src/xselect.c index f855980a300..6d167c0b6f8 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -208,24 +208,49 @@ static Atom symbol_to_x_atom (struct x_display_info *dpyinfo, Lisp_Object sym) { Atom val; - if (NILP (sym)) return 0; - if (EQ (sym, QPRIMARY)) return XA_PRIMARY; - if (EQ (sym, QSECONDARY)) return XA_SECONDARY; - if (EQ (sym, QSTRING)) return XA_STRING; - if (EQ (sym, QINTEGER)) return XA_INTEGER; - if (EQ (sym, QATOM)) return XA_ATOM; - if (EQ (sym, QCLIPBOARD)) return dpyinfo->Xatom_CLIPBOARD; - if (EQ (sym, QTIMESTAMP)) return dpyinfo->Xatom_TIMESTAMP; - if (EQ (sym, QTEXT)) return dpyinfo->Xatom_TEXT; - if (EQ (sym, QCOMPOUND_TEXT)) return dpyinfo->Xatom_COMPOUND_TEXT; - if (EQ (sym, QUTF8_STRING)) return dpyinfo->Xatom_UTF8_STRING; - if (EQ (sym, QDELETE)) return dpyinfo->Xatom_DELETE; - if (EQ (sym, QMULTIPLE)) return dpyinfo->Xatom_MULTIPLE; - if (EQ (sym, QINCR)) return dpyinfo->Xatom_INCR; - if (EQ (sym, Q_EMACS_TMP_)) return dpyinfo->Xatom_EMACS_TMP; - if (EQ (sym, QTARGETS)) return dpyinfo->Xatom_TARGETS; - if (EQ (sym, QNULL)) return dpyinfo->Xatom_NULL; - if (!SYMBOLP (sym)) emacs_abort (); + if (NILP (sym)) + return 0; + if (EQ (sym, QPRIMARY)) + return XA_PRIMARY; + if (EQ (sym, QSECONDARY)) + return XA_SECONDARY; + if (EQ (sym, QSTRING)) + return XA_STRING; + if (EQ (sym, QINTEGER)) + return XA_INTEGER; + if (EQ (sym, QATOM)) + return XA_ATOM; + if (EQ (sym, QCLIPBOARD)) + return dpyinfo->Xatom_CLIPBOARD; + if (EQ (sym, QTIMESTAMP)) + return dpyinfo->Xatom_TIMESTAMP; + if (EQ (sym, QTEXT)) + return dpyinfo->Xatom_TEXT; + if (EQ (sym, QCOMPOUND_TEXT)) + return dpyinfo->Xatom_COMPOUND_TEXT; + if (EQ (sym, QUTF8_STRING)) + return dpyinfo->Xatom_UTF8_STRING; + if (EQ (sym, QDELETE)) + return dpyinfo->Xatom_DELETE; + if (EQ (sym, QMULTIPLE)) + return dpyinfo->Xatom_MULTIPLE; + if (EQ (sym, QINCR)) + return dpyinfo->Xatom_INCR; + if (EQ (sym, Q_EMACS_TMP_)) + return dpyinfo->Xatom_EMACS_TMP; + if (EQ (sym, QTARGETS)) + return dpyinfo->Xatom_TARGETS; + if (EQ (sym, QNULL)) + return dpyinfo->Xatom_NULL; + if (EQ (sym, QXdndSelection)) + return dpyinfo->Xatom_XdndSelection; + if (EQ (sym, QXmTRANSFER_SUCCESS)) + return dpyinfo->Xatom_XmTRANSFER_SUCCESS; + if (EQ (sym, QXmTRANSFER_FAILURE)) + return dpyinfo->Xatom_XmTRANSFER_FAILURE; + + if (!SYMBOLP (sym)) + emacs_abort (); TRACE1 (" XInternAtom %s", SSDATA (SYMBOL_NAME (sym))); block_input (); @@ -287,6 +312,10 @@ x_atom_to_symbol (struct x_display_info *dpyinfo, Atom atom) return QNULL; if (atom == dpyinfo->Xatom_XdndSelection) return QXdndSelection; + if (atom == dpyinfo->Xatom_XmTRANSFER_SUCCESS) + return QXmTRANSFER_SUCCESS; + if (atom == dpyinfo->Xatom_XmTRANSFER_FAILURE) + return QXmTRANSFER_FAILURE; block_input (); x_catch_errors (dpyinfo->display); @@ -2793,6 +2822,9 @@ A value of 0 means wait as long as necessary. This is initialized from the DEFSYM (Qx_lost_selection_functions, "x-lost-selection-functions"); DEFSYM (Qx_sent_selection_functions, "x-sent-selection-functions"); + DEFSYM (QXmTRANSFER_SUCCESS, "XmTRANSFER_SUCCESS"); + DEFSYM (QXmTRANSFER_FAILURE, "XmTRANSFER_FAILURE"); + pdumper_do_now_and_after_load (syms_of_xselect_for_pdumper); } -- 2.39.2