commit a3024ab4fb6b608d2110aa778c1eadec8113f498 (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Sun May 1 10:01:28 2022 +0300 Document 'help-window-select' * etc/NEWS: * doc/emacs/help.texi (Apropos, Help): Document 'help-window-select'; improve indexing. (Bug#46034) diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi index a4b329d089..3c8f90da10 100644 --- a/doc/emacs/help.texi +++ b/doc/emacs/help.texi @@ -20,10 +20,20 @@ commands (@code{help-for-help}). You can scroll the list with @key{SPC} and @key{DEL}, then type the help command you want. To cancel, type @kbd{C-g}. +@cindex help buffer Many help commands display their information in a special @dfn{help buffer}. In this buffer, you can type @key{SPC} and @key{DEL} to scroll and type @key{RET} to follow hyperlinks. @xref{Help Mode}. +@vindex help-window-select + By default, help commands display the help buffer in a separate +window without selecting that window. The variable +@code{help-window-select} controls this: its default value is +@code{nil}; if it's customized to the value @code{t}, the help window +is unconditionally selected by help commands, and if its value is +@code{other}, the help window is selected only if there are more than +two windows on the selected frame. + @cindex searching documentation efficiently @cindex looking for a subject in documentation If you are looking for a certain feature, but don't know what it is @@ -335,9 +345,9 @@ are included varies depending on the command used. @cindex apropos The @dfn{apropos} commands answer questions like, ``What are the -commands for working with files?'' More precisely, you specify an -@dfn{apropos pattern}, which means either a word, a list of words, or -a regular expression. +commands for working with files?'' More precisely, you specify your +query as an @dfn{apropos pattern}, which is either a word, a list of +words, or a regular expression. Each of the following apropos commands reads an apropos pattern in the minibuffer, searches for items that match the pattern, and @@ -396,6 +406,12 @@ comes with a brief description and a list of keys you can currently invoke it with. In our example, it would say that you can invoke @code{find-file} by typing @kbd{C-x C-f}. +@vindex help-window-select@r{, and apropos commands} + By default, the window showing the apropos buffer with the results +of the query is not selected, but you can cause it to be selected by +customizing the variable @code{help-window-select} to any +non-@code{nil} value. + For more information about a function definition, variable or symbol property listed in an apropos buffer, you can click on it with @kbd{mouse-1} or @kbd{mouse-2}, or move there and type @key{RET}. diff --git a/etc/NEWS b/etc/NEWS index 47e04cfcbe..3f22e0b04e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -478,6 +478,11 @@ displayed, if any. It now only includes local minor modes at the start, and the global minor modes are listed after the major mode. ++++ +*** The user option 'help-window-select' now affects apropos commands. +The apropos commands will now select the apropos window if +'help-window-select' is non-nil. + ** Outline Mode +++ commit d17d9c50c519dfba6b03488e3b702ddba56f54ad Author: Po Lu Date: Sun May 1 05:41:33 2022 +0000 Allow specifying font size in the Haiku font selection dialog * src/haiku_support.cc (struct font_selection_dialog_message): New fields `size' and `size_specified'. (class EmacsFontSelectionDialog): New `size_entry' control. (MessageReceived): Set size from that control if available. (EmacsFontSelectionDialog): Initialize that control. (FrameResized): Handle layout for that control. (be_select_font): New field `size'. * src/haiku_support.h: Update prototypes. * src/haikufont.c (Fx_select_font): Populate font spec with size. diff --git a/src/haiku_support.cc b/src/haiku_support.cc index 776f2d5e7e..d8a064ccac 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -42,6 +42,7 @@ along with GNU Emacs. If not, see . */ #include #include #include +#include #include @@ -132,13 +133,19 @@ enum struct font_selection_dialog_message { /* Whether or not font selection was cancelled. */ - bool cancel; + bool_bf cancel : 1; + + /* Whether or not a size was explictly specified. */ + bool_bf size_specified : 1; /* The index of the selected font family. */ int family_idx; /* The index of the selected font style. */ int style_idx; + + /* The selected font size. */ + int size; }; static color_space dpy_color_space = B_NO_COLOR_SPACE; @@ -2438,6 +2445,7 @@ class EmacsFontSelectionDialog : public BWindow BObjectList all_families; BObjectList all_styles; BButton cancel_button, ok_button; + BTextControl size_entry; port_id comm_port; bool allow_monospace_only; @@ -2497,6 +2505,7 @@ class EmacsFontSelectionDialog : public BWindow void MessageReceived (BMessage *msg) { + const char *text; int idx; struct font_selection_dialog_message rq; @@ -2514,6 +2523,12 @@ class EmacsFontSelectionDialog : public BWindow rq.family_idx = font_family_pane.CurrentSelection (); rq.style_idx = font_style_pane.CurrentSelection (); + text = size_entry.Text (); + rq.size = atoi (text); + + if (rq.size > 0) + rq.size_specified = true; + write_port (comm_port, 0, &rq, sizeof rq); } else if (msg->what == B_CANCEL) @@ -2539,6 +2554,7 @@ class EmacsFontSelectionDialog : public BWindow font_style_scroller.RemoveSelf (); cancel_button.RemoveSelf (); ok_button.RemoveSelf (); + size_entry.RemoveSelf (); basic_view.RemoveSelf (); if (comm_port >= B_OK) @@ -2568,6 +2584,7 @@ class EmacsFontSelectionDialog : public BWindow cancel_button ("Cancel", "Cancel", new BMessage (B_CANCEL)), ok_button ("OK", "OK", new BMessage (B_OK)), + size_entry (NULL, NULL, NULL, NULL), allow_monospace_only (monospace_only) { BStringItem *family_item; @@ -2581,6 +2598,7 @@ class EmacsFontSelectionDialog : public BWindow basic_view.AddChild (&split_view); basic_view.AddChild (&cancel_button); basic_view.AddChild (&ok_button); + basic_view.AddChild (&size_entry); split_view.AddChild (&font_family_scroller, 0.7); split_view.AddChild (&font_style_scroller, 0.3); @@ -2628,24 +2646,35 @@ class EmacsFontSelectionDialog : public BWindow BRect frame = Frame (); float ok_height, ok_width; float cancel_height, cancel_width; + float size_width, size_height; + float bone; int max_height; ok_button.GetPreferredSize (&ok_width, &ok_height); cancel_button.GetPreferredSize (&cancel_width, &cancel_height); + size_entry.GetPreferredSize (&size_width, &size_height); - max_height = std::max (ok_height, cancel_height); + max_height = std::max (std::max (ok_height, cancel_height), + size_height); basic_view.ResizeTo (BE_RECT_WIDTH (frame), BE_RECT_HEIGHT (frame)); split_view.ResizeTo (BE_RECT_WIDTH (frame), BE_RECT_HEIGHT (frame) - 4 - max_height); + + bone = BE_RECT_HEIGHT (frame) - 2 - max_height / 2; + ok_button.MoveTo ((BE_RECT_WIDTH (frame) - 4 - cancel_width - ok_width), - BE_RECT_HEIGHT (frame) - 2 - max_height); + bone - ok_height / 2); cancel_button.MoveTo (BE_RECT_WIDTH (frame) - 2 - cancel_width, - BE_RECT_HEIGHT (frame) - 2 - max_height); + bone - cancel_height / 2); + size_entry.MoveTo (2, bone - size_height / 2); + ok_button.ResizeTo (ok_width, ok_height); cancel_button.ResizeTo (cancel_width, cancel_height); + size_entry.ResizeTo (BE_RECT_WIDTH (frame) / 6, + size_height); } void @@ -4671,7 +4700,7 @@ be_select_font (void (*process_pending_signals_function) (void), bool (*should_quit_function) (void), haiku_font_family_or_style *family, haiku_font_family_or_style *style, - bool allow_monospace_only) + int *size, bool allow_monospace_only) { EmacsFontSelectionDialog *dialog; struct font_selection_dialog_message msg; @@ -4707,6 +4736,7 @@ be_select_font (void (*process_pending_signals_function) (void), memcpy (family, family_buffer, sizeof *family); memcpy (style, style_buffer, sizeof *style); + *size = msg.size_specified ? msg.size : -1; return true; } diff --git a/src/haiku_support.h b/src/haiku_support.h index 9661222710..c9b408589f 100644 --- a/src/haiku_support.h +++ b/src/haiku_support.h @@ -661,7 +661,8 @@ extern bool be_drag_and_drop_in_progress (void); extern bool be_replay_menu_bar_event (void *, struct haiku_menu_bar_click_event *); extern bool be_select_font (void (*) (void), bool (*) (void), haiku_font_family_or_style *, - haiku_font_family_or_style *, bool); + haiku_font_family_or_style *, + int *, bool); #ifdef __cplusplus } diff --git a/src/haikufont.c b/src/haikufont.c index ecbe84aca2..eb00c8ff38 100644 --- a/src/haikufont.c +++ b/src/haikufont.c @@ -1099,9 +1099,9 @@ in the font selection dialog. */) (Lisp_Object frame, Lisp_Object exclude_proportional) { haiku_font_family_or_style family, style; - bool rc; + int rc, size; struct haiku_font_pattern pattern; - Lisp_Object lfamily, lweight, lslant, lwidth, ladstyle; + Lisp_Object lfamily, lweight, lslant, lwidth, ladstyle, lsize; decode_window_system_frame (frame); @@ -1111,7 +1111,7 @@ in the font selection dialog. */) popup_activated_p++; rc = be_select_font (process_pending_signals, haikufont_should_quit_popup, - &family, &style, + &family, &style, &size, !NILP (exclude_proportional)); popup_activated_p--; @@ -1132,10 +1132,12 @@ in the font selection dialog. */) : Qunspecified); ladstyle = (pattern.specified & FSPEC_STYLE ? intern (pattern.style) : Qnil); + lsize = (size >= 0 ? make_fixnum (size) : Qnil); return CALLN (Ffont_spec, QCfamily, lfamily, QCweight, lweight, QCslant, lslant, - QCwidth, lwidth, QCadstyle, ladstyle); + QCwidth, lwidth, QCadstyle, ladstyle, + QCsize, lsize); } void commit 5f220d9555a908dd9957afa27d168d74adf6c7df Author: Stefan Kangas Date: Sun May 1 06:01:28 2022 +0200 Update publicsuffix.txt from upstream * etc/publicsuffix.txt: Update from https://publicsuffix.org/list/public_suffix_list.dat dated 2022-04-30 19:52:14 UTC. diff --git a/etc/publicsuffix.txt b/etc/publicsuffix.txt index 3cf06f92bb..220ad30e48 100644 --- a/etc/publicsuffix.txt +++ b/etc/publicsuffix.txt @@ -22,8 +22,7 @@ org.ac ad nom.ad -// ae : https://en.wikipedia.org/wiki/.ae -// see also: "Domain Name Eligibility Policy" at http://www.aeda.ae/eng/aepolicy.php +// ae : https://tdra.gov.ae/en/aeda/ae-policies ae co.ae net.ae @@ -7131,7 +7130,7 @@ org.zw // newGTLDs -// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2022-02-18T15:13:38Z +// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2022-04-30T15:14:46Z // This list is auto-generated, don't edit it manually. // aaa : 2015-02-26 American Automobile Association, Inc. aaa @@ -7334,7 +7333,7 @@ audi // audible : 2015-06-25 Amazon Registry Services, Inc. audible -// audio : 2014-03-20 UNR Corp. +// audio : 2014-03-20 XYZ.COM LLC audio // auspost : 2015-08-13 Australian Postal Corporation @@ -7472,7 +7471,7 @@ bio // black : 2014-01-16 Afilias Limited black -// blackfriday : 2014-01-16 UNR Corp. +// blackfriday : 2014-01-16 Registry Services, LLC blackfriday // blockbuster : 2015-07-30 Dish DBS Corporation @@ -7703,7 +7702,7 @@ cheap // chintai : 2015-06-11 CHINTAI Corporation chintai -// christmas : 2013-11-21 UNR Corp. +// christmas : 2013-11-21 XYZ.COM LLC christmas // chrome : 2014-07-24 Charleston Road Registry Inc. @@ -7952,7 +7951,7 @@ dhl // diamonds : 2013-09-22 Binky Moon, LLC diamonds -// diet : 2014-06-26 UNR Corp. +// diet : 2014-06-26 XYZ.COM LLC diet // digital : 2014-03-06 Binky Moon, LLC @@ -8198,7 +8197,7 @@ flir // florist : 2013-11-07 Binky Moon, LLC florist -// flowers : 2014-10-09 UNR Corp. +// flowers : 2014-10-09 XYZ.COM LLC flowers // fly : 2014-05-08 Charleston Road Registry Inc. @@ -8285,7 +8284,7 @@ gallo // gallup : 2015-02-19 Gallup, Inc. gallup -// game : 2015-05-28 UNR Corp. +// game : 2015-05-28 XYZ.COM LLC game // games : 2015-05-28 Dog Beach, LLC @@ -8309,7 +8308,7 @@ gdn // gea : 2014-12-04 GEA Group Aktiengesellschaft gea -// gent : 2014-01-23 COMBELL NV +// gent : 2014-01-23 Easyhost BV gent // genting : 2015-03-12 Resorts World Inc Pte. Ltd. @@ -8420,7 +8419,7 @@ guge // guide : 2013-09-13 Binky Moon, LLC guide -// guitars : 2013-11-14 UNR Corp. +// guitars : 2013-11-14 XYZ.COM LLC guitars // guru : 2013-08-27 Binky Moon, LLC @@ -8468,7 +8467,7 @@ hermes // hgtv : 2015-07-02 Lifestyle Domain Holdings, Inc. hgtv -// hiphop : 2014-03-06 UNR Corp. +// hiphop : 2014-03-06 Dot Hip Hop, LLC hiphop // hisamitsu : 2015-07-16 Hisamitsu Pharmaceutical Co.,Inc. @@ -8516,7 +8515,7 @@ hospital // host : 2014-04-17 Radix FZC host -// hosting : 2014-05-29 UNR Corp. +// hosting : 2014-05-29 XYZ.COM LLC hosting // hot : 2015-08-27 Amazon Registry Services, Inc. @@ -8885,7 +8884,7 @@ locus // loft : 2015-07-30 Annco, Inc. loft -// lol : 2015-01-30 UNR Corp. +// lol : 2015-01-30 XYZ.COM LLC lol // london : 2013-11-14 Dot London Domains Limited @@ -9041,7 +9040,7 @@ moe // moi : 2014-12-18 Amazon Registry Services, Inc. moi -// mom : 2015-04-16 UNR Corp. +// mom : 2015-04-16 XYZ.COM LLC mom // monash : 2013-09-30 Monash University @@ -9308,7 +9307,7 @@ philips // phone : 2016-06-02 Dish DBS Corporation phone -// photo : 2013-11-14 UNR Corp. +// photo : 2013-11-14 Registry Services, LLC photo // photography : 2013-09-20 Binky Moon, LLC @@ -9320,7 +9319,7 @@ photos // physio : 2014-05-01 PhysBiz Pty Ltd physio -// pics : 2013-11-14 UNR Corp. +// pics : 2013-11-14 XYZ.COM LLC pics // pictet : 2014-06-26 Pictet Europe S.A. @@ -9551,7 +9550,7 @@ rsvp // rugby : 2016-12-15 World Rugby Strategic Developments Limited rugby -// ruhr : 2013-10-02 regiodot GmbH & Co. KG +// ruhr : 2013-10-02 dotSaarland GmbH ruhr // run : 2015-03-19 Binky Moon, LLC @@ -9902,7 +9901,7 @@ tatamotors // tatar : 2014-04-24 Limited Liability Company "Coordination Center of Regional Domain of Tatarstan Republic" tatar -// tattoo : 2013-08-30 UNR Corp. +// tattoo : 2013-08-30 Top Level Design, LLC tattoo // tax : 2014-03-20 Binky Moon, LLC @@ -9995,7 +9994,7 @@ toray // toshiba : 2014-04-10 TOSHIBA Corporation toshiba -// total : 2015-08-06 Total SA +// total : 2015-08-06 TOTAL SE total // tours : 2015-01-22 Binky Moon, LLC @@ -10633,6 +10632,12 @@ hlx3.page // Submitted by Przemyslaw Plewa beep.pl +// Airkit : https://www.airkit.com/ +// Submitted by Grant Cooksey +airkitapps.com +airkitapps-au.com +airkitapps.eu + // Aiven: https://aiven.io/ // Submitted by Etienne Stalmans aivencloud.com @@ -10827,7 +10832,7 @@ onavstack.net *.advisor.ws // AZ.pl sp. z.o.o: https://az.pl -// Submited by Krzysztof Wolski +// Submitted by Krzysztof Wolski ecommerce-shop.pl // b-data GmbH : https://www.b-data.io @@ -11241,6 +11246,11 @@ deno-staging.dev // Submitted by Peter Thomassen dedyn.io +// Deta: https://www.deta.sh/ +// Submitted by Aavash Shrestha +deta.app +deta.dev + // Diher Solutions : https://diher.solutions // Submitted by Didi Hermawan *.rss.my.id @@ -11658,6 +11668,11 @@ en-root.fr mytuleap.com tuleap-partners.com +// Encoretivity AB: https://encore.dev +// Submitted by André Eriksson +encr.app +encoreapi.com + // ECG Robotics, Inc: https://ecgrobotics.org // Submitted by onred.one @@ -11870,8 +11885,6 @@ app.os.stg.fedoraproject.org // FearWorks Media Ltd. : https://fearworksmedia.co.uk // submitted by Keith Fairley -couk.me -ukco.me conn.uk copro.uk hosp.uk @@ -11984,6 +11997,7 @@ independent-panel.uk independent-review.uk public-inquiry.uk royal-commission.uk +campaign.gov.uk service.gov.uk // CDDO : https://www.gov.uk/guidance/get-an-api-domain-on-govuk @@ -12277,7 +12291,7 @@ günstigbestellen.de günstigliefern.de // Hakaran group: http://hakaran.cz -// Submited by Arseniy Sokolov +// Submitted by Arseniy Sokolov fin.ci free.hr caa.li @@ -12320,7 +12334,7 @@ development.run ravendb.run // home.pl S.A.: https://home.pl -// Submited by Krzysztof Wolski +// Submitted by Krzysztof Wolski homesklep.pl // Hong Kong Productivity Council: https://www.hkpc.org/ @@ -12430,7 +12444,7 @@ to.leg.br pixolino.com // Internet-Pro, LLP: https://netangels.ru/ -// Submited by Vasiliy Sheredeko +// Submitted by Vasiliy Sheredeko na4u.ru // iopsys software solutions AB : https://iopsys.eu/ @@ -12453,7 +12467,7 @@ iserv.dev iobb.net // Jelastic, Inc. : https://jelastic.com/ -// Submited by Ihor Kolodyuk +// Submitted by Ihor Kolodyuk mel.cloudlets.com.au cloud.interhostsolutions.be users.scale.virtualcloud.com.br @@ -12653,6 +12667,10 @@ ip.linodeusercontent.com // Submitted by Victor Velchev we.bs +// Localcert : https://localcert.dev +// Submitted by Lann Martin +*.user.localcert.dev + // localzone.xyz // Submitted by Kenny Niehage localzone.xyz @@ -12780,12 +12798,13 @@ eu.meteorapp.com co.pl // Microsoft Corporation : http://microsoft.com -// Submitted by Mitch Webster +// Submitted by Public Suffix List Admin *.azurecontainer.io azurewebsites.net azure-mobile.net cloudapp.net azurestaticapps.net +1.azurestaticapps.net centralus.azurestaticapps.net eastasia.azurestaticapps.net eastus2.azurestaticapps.net @@ -13080,7 +13099,7 @@ operaunite.com tech.orange // Oursky Limited : https://authgear.com/, https://skygear.io/ -// Submited by Authgear Team , Skygear Developer +// Submitted by Authgear Team , Skygear Developer authgear-staging.com authgearapps.com skygearapp.com @@ -13379,6 +13398,34 @@ sandcats.io logoip.de logoip.com +// Scaleway : https://www.scaleway.com/ +// Submitted by Rémy Léone +fr-par-1.baremetal.scw.cloud +fr-par-2.baremetal.scw.cloud +nl-ams-1.baremetal.scw.cloud +fnc.fr-par.scw.cloud +functions.fnc.fr-par.scw.cloud +k8s.fr-par.scw.cloud +nodes.k8s.fr-par.scw.cloud +s3.fr-par.scw.cloud +s3-website.fr-par.scw.cloud +whm.fr-par.scw.cloud +priv.instances.scw.cloud +pub.instances.scw.cloud +k8s.scw.cloud +k8s.nl-ams.scw.cloud +nodes.k8s.nl-ams.scw.cloud +s3.nl-ams.scw.cloud +s3-website.nl-ams.scw.cloud +whm.nl-ams.scw.cloud +k8s.pl-waw.scw.cloud +nodes.k8s.pl-waw.scw.cloud +s3.pl-waw.scw.cloud +s3-website.pl-waw.scw.cloud +scalebook.scw.cloud +smartlabeling.scw.cloud +dedibox.fr + // schokokeks.org GbR : https://schokokeks.org/ // Submitted by Hanno Böck schokokeks.net @@ -13499,6 +13546,8 @@ srht.site stackhero-network.com // Staclar : https://staclar.com +// Submitted by Q Misell +musician.io // Submitted by Matthias Merkel novecore.site @@ -13597,19 +13646,20 @@ syncloud.it // Synology, Inc. : https://www.synology.com/ // Submitted by Rony Weng -diskstation.me dscloud.biz -dscloud.me -dscloud.mobi +direct.quickconnect.cn dsmynas.com -dsmynas.net -dsmynas.org familyds.com -familyds.net -familyds.org +diskstation.me +dscloud.me i234.me myds.me synology.me +dscloud.mobi +dsmynas.net +familyds.net +dsmynas.org +familyds.org vpnplus.to direct.quickconnect.to @@ -13742,6 +13792,10 @@ syno-ds.de synology-diskstation.de synology-ds.de +// Typedream : https://typedream.com +// Submitted by Putri Karunia +typedream.app + // Typeform : https://www.typeform.com // Submitted by Sergi Ferriz pro.typeform.com commit ece2ee965fe1db5fa30e2ed20b4a3b95b0da5db3 Author: Po Lu Date: Sun May 1 03:20:58 2022 +0000 Allow quitting inside font selection dialogs on Haiku * src/haiku_support.cc (WaitForChoice): Accept new function for checking quit flag. (be_select_font): Pass that function. * src/haiku_support.h: Update prototypes. * src/haikufont.c (haikufont_should_quit_popup): New function. (Fx_select_font): Give said function to `be_select_font'. diff --git a/src/haiku_support.cc b/src/haiku_support.cc index 80b3dc7089..776f2d5e7e 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -2650,7 +2650,8 @@ class EmacsFontSelectionDialog : public BWindow void WaitForChoice (struct font_selection_dialog_message *msg, - void (*process_pending_signals_function) (void)) + void (*process_pending_signals_function) (void), + bool (*should_quit_function) (void)) { int32 reply_type; struct object_wait_info infos[2]; @@ -2683,6 +2684,9 @@ class EmacsFontSelectionDialog : public BWindow if (infos[0].events & B_EVENT_READ) process_pending_signals_function (); + if (should_quit_function ()) + goto cancel; + infos[0].events = B_EVENT_READ; infos[1].events = B_EVENT_READ; } @@ -4664,6 +4668,7 @@ be_get_ui_color (const char *name, uint32_t *color) bool be_select_font (void (*process_pending_signals_function) (void), + bool (*should_quit_function) (void), haiku_font_family_or_style *family, haiku_font_family_or_style *style, bool allow_monospace_only) @@ -4684,7 +4689,8 @@ be_select_font (void (*process_pending_signals_function) (void), } dialog->Show (); - dialog->WaitForChoice (&msg, process_pending_signals_function); + dialog->WaitForChoice (&msg, process_pending_signals_function, + should_quit_function); if (!dialog->LockLooper ()) gui_abort ("Failed to lock font selection dialog looper"); diff --git a/src/haiku_support.h b/src/haiku_support.h index c9f7737798..9661222710 100644 --- a/src/haiku_support.h +++ b/src/haiku_support.h @@ -659,7 +659,7 @@ extern bool be_drag_message (void *, void *, bool, void (*) (void), extern bool be_drag_and_drop_in_progress (void); extern bool be_replay_menu_bar_event (void *, struct haiku_menu_bar_click_event *); -extern bool be_select_font (void (*process_pending_signals_function) (void), +extern bool be_select_font (void (*) (void), bool (*) (void), haiku_font_family_or_style *, haiku_font_family_or_style *, bool); #ifdef __cplusplus diff --git a/src/haikufont.c b/src/haikufont.c index 40e80aa943..ecbe84aca2 100644 --- a/src/haikufont.c +++ b/src/haikufont.c @@ -1082,6 +1082,12 @@ struct font_driver const haikufont_driver = .list_family = haikufont_list_family }; +static bool +haikufont_should_quit_popup (void) +{ + return !NILP (Vquit_flag); +} + DEFUN ("x-select-font", Fx_select_font, Sx_select_font, 0, 2, 0, doc: /* Read a font using a native dialog. Return a font spec describing the font chosen by the user. @@ -1103,7 +1109,9 @@ in the font selection dialog. */) error ("Trying to use a menu from within a menu-entry"); popup_activated_p++; - rc = be_select_font (process_pending_signals, &family, &style, + rc = be_select_font (process_pending_signals, + haikufont_should_quit_popup, + &family, &style, !NILP (exclude_proportional)); popup_activated_p--; commit ed0de6200d5ae62f214d77c4a71c0a31e524faf9 Author: Po Lu Date: Sun May 1 02:43:18 2022 +0000 Allow invoking fonts in the Haiku font dialog * src/haiku_support.cc (MessageReceived): Handle invocations. (EmacsFontSelectionDialog): Set style panel invocation message. diff --git a/src/haiku_support.cc b/src/haiku_support.cc index ec3b96b334..80b3dc7089 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -2507,7 +2507,8 @@ class EmacsFontSelectionDialog : public BWindow } else if (msg->what == FONT_STYLE_SELECTED) UpdateForSelectedStyle (); - else if (msg->what == B_OK) + else if (msg->what == B_OK + && font_style_pane.CurrentSelection () >= 0) { rq.cancel = false; rq.family_idx = font_family_pane.CurrentSelection (); @@ -2545,7 +2546,7 @@ class EmacsFontSelectionDialog : public BWindow } EmacsFontSelectionDialog (bool monospace_only) - : BWindow (BRect (0, 0, 300, 300), + : BWindow (BRect (0, 0, 500, 500), "Select font from list", B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, 0), @@ -2580,8 +2581,8 @@ class EmacsFontSelectionDialog : public BWindow basic_view.AddChild (&split_view); basic_view.AddChild (&cancel_button); basic_view.AddChild (&ok_button); - split_view.AddChild (&font_family_scroller); - split_view.AddChild (&font_style_scroller); + split_view.AddChild (&font_family_scroller, 0.7); + split_view.AddChild (&font_style_scroller, 0.3); basic_view.SetViewUIColor (B_PANEL_BACKGROUND_COLOR); @@ -2592,6 +2593,8 @@ class EmacsFontSelectionDialog : public BWindow font_family_pane.SetSelectionMessage (selection); selection = new BMessage (FONT_STYLE_SELECTED); font_style_pane.SetSelectionMessage (selection); + selection = new BMessage (B_OK); + font_style_pane.SetInvocationMessage (selection); comm_port = create_port (1, "font dialog port"); commit 7dda9835c616e4acde460837b3e6d4a64c18343d Author: Po Lu Date: Sun May 1 02:17:04 2022 +0000 Improvements to the Haiku font dialog * src/haiku_support.cc (class EmacsFontSelectionDialog) (EmacsFontSelectionDialog, FrameResized): Fix colors and respect monospace only. (be_select_font): New parameter `allow_monospace_only'. * src/haiku_support.h: Update prototype. * src/haikufont.c (Fx_select_font): Respect `exclude-proportional'. diff --git a/src/haiku_support.cc b/src/haiku_support.cc index 32b05a499d..ec3b96b334 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -41,6 +41,7 @@ along with GNU Emacs. If not, see . */ #include #include #include +#include #include @@ -2428,13 +2429,17 @@ class EmacsPopUpMenu : public BPopUpMenu class EmacsFontSelectionDialog : public BWindow { + BView basic_view; BSplitView split_view; BListView font_family_pane; BListView font_style_pane; + BScrollView font_family_scroller; + BScrollView font_style_scroller; BObjectList all_families; BObjectList all_styles; BButton cancel_button, ok_button; port_id comm_port; + bool allow_monospace_only; void UpdateStylesForIndex (int idx) @@ -2527,22 +2532,42 @@ class EmacsFontSelectionDialog : public BWindow font_family_pane.MakeEmpty (); font_style_pane.MakeEmpty (); - split_view.RemoveSelf (); + font_family_pane.RemoveSelf (); + font_style_pane.RemoveSelf (); + font_family_scroller.RemoveSelf (); + font_style_scroller.RemoveSelf (); cancel_button.RemoveSelf (); ok_button.RemoveSelf (); + basic_view.RemoveSelf (); if (comm_port >= B_OK) delete_port (comm_port); } - EmacsFontSelectionDialog (void) : BWindow (BRect (0, 0, 300, 300), "", - B_TITLED_WINDOW_LOOK, - B_NORMAL_WINDOW_FEEL, 0), - all_families (20, true), - all_styles (20, true), - cancel_button ("Cancel", "Cancel", - new BMessage (B_CANCEL)), - ok_button ("OK", "OK", new BMessage (B_OK)) + EmacsFontSelectionDialog (bool monospace_only) + : BWindow (BRect (0, 0, 300, 300), + "Select font from list", + B_TITLED_WINDOW_LOOK, + B_NORMAL_WINDOW_FEEL, 0), + basic_view (NULL, 0), + font_family_pane (BRect (0, 0, 10, 10), NULL, + B_SINGLE_SELECTION_LIST, + B_FOLLOW_ALL_SIDES), + font_style_pane (BRect (0, 0, 10, 10), NULL, + B_SINGLE_SELECTION_LIST, + B_FOLLOW_ALL_SIDES), + font_family_scroller (NULL, &font_family_pane, + B_FOLLOW_LEFT | B_FOLLOW_TOP, + 0, false, true), + font_style_scroller (NULL, &font_style_pane, + B_FOLLOW_LEFT | B_FOLLOW_TOP, + 0, false, true), + all_families (20, true), + all_styles (20, true), + cancel_button ("Cancel", "Cancel", + new BMessage (B_CANCEL)), + ok_button ("OK", "OK", new BMessage (B_OK)), + allow_monospace_only (monospace_only) { BStringItem *family_item; int i, n_families; @@ -2550,11 +2575,15 @@ class EmacsFontSelectionDialog : public BWindow uint32 flags; BMessage *selection; - AddChild (&split_view); - AddChild (&cancel_button); - AddChild (&ok_button); - split_view.AddChild (&font_family_pane); - split_view.AddChild (&font_style_pane); + AddChild (&basic_view); + + basic_view.AddChild (&split_view); + basic_view.AddChild (&cancel_button); + basic_view.AddChild (&ok_button); + split_view.AddChild (&font_family_scroller); + split_view.AddChild (&font_style_scroller); + + basic_view.SetViewUIColor (B_PANEL_BACKGROUND_COLOR); FrameResized (801, 801); UpdateForSelectedStyle (); @@ -2576,6 +2605,9 @@ class EmacsFontSelectionDialog : public BWindow all_families.AddItem (family_item); font_family_pane.AddItem (family_item); + + family_item->SetEnabled (!allow_monospace_only + || flags & B_IS_FIXED); } else { @@ -2601,6 +2633,7 @@ class EmacsFontSelectionDialog : public BWindow max_height = std::max (ok_height, cancel_height); + basic_view.ResizeTo (BE_RECT_WIDTH (frame), BE_RECT_HEIGHT (frame)); split_view.ResizeTo (BE_RECT_WIDTH (frame), BE_RECT_HEIGHT (frame) - 4 - max_height); ok_button.MoveTo ((BE_RECT_WIDTH (frame) @@ -4629,7 +4662,8 @@ be_get_ui_color (const char *name, uint32_t *color) bool be_select_font (void (*process_pending_signals_function) (void), haiku_font_family_or_style *family, - haiku_font_family_or_style *style) + haiku_font_family_or_style *style, + bool allow_monospace_only) { EmacsFontSelectionDialog *dialog; struct font_selection_dialog_message msg; @@ -4637,7 +4671,7 @@ be_select_font (void (*process_pending_signals_function) (void), font_family family_buffer; font_style style_buffer; - dialog = new EmacsFontSelectionDialog; + dialog = new EmacsFontSelectionDialog (allow_monospace_only); dialog->CenterOnScreen (); if (dialog->InitCheck () < B_OK) diff --git a/src/haiku_support.h b/src/haiku_support.h index faaee2ed9d..c9f7737798 100644 --- a/src/haiku_support.h +++ b/src/haiku_support.h @@ -661,7 +661,7 @@ extern bool be_drag_and_drop_in_progress (void); extern bool be_replay_menu_bar_event (void *, struct haiku_menu_bar_click_event *); extern bool be_select_font (void (*process_pending_signals_function) (void), haiku_font_family_or_style *, - haiku_font_family_or_style *); + haiku_font_family_or_style *, bool); #ifdef __cplusplus } diff --git a/src/haikufont.c b/src/haikufont.c index bca29c4ed3..40e80aa943 100644 --- a/src/haikufont.c +++ b/src/haikufont.c @@ -1103,7 +1103,8 @@ in the font selection dialog. */) error ("Trying to use a menu from within a menu-entry"); popup_activated_p++; - rc = be_select_font (process_pending_signals, &family, &style); + rc = be_select_font (process_pending_signals, &family, &style, + !NILP (exclude_proportional)); popup_activated_p--; if (!rc) @@ -1122,7 +1123,7 @@ in the font selection dialog. */) ? haikufont_width_to_lisp (pattern.width) : Qunspecified); ladstyle = (pattern.specified & FSPEC_STYLE - ? intern (pattern.style) : Qunspecified); + ? intern (pattern.style) : Qnil); return CALLN (Ffont_spec, QCfamily, lfamily, QCweight, lweight, QCslant, lslant, commit 07ae30d8f24ce46dbb7c2fbfa02002c1b4c2b6b7 Author: Po Lu Date: Sun May 1 09:44:46 2022 +0800 Also fix some compiler warnings in xterm.c that didn't show up * src/xterm.c (x_dnd_begin_drag_and_drop): Don't define unused variable on GTK builds. diff --git a/src/xterm.c b/src/xterm.c index bb50b35c2d..3dd8f320ba 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9778,7 +9778,9 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, #ifdef HAVE_XKB XkbStateRec keyboard_state; #endif +#ifndef USE_GTK struct x_display_info *event_display; +#endif if (!FRAME_VISIBLE_P (f)) { commit 4e6eb023e08a9afba7fedd18940d42b86844170b Author: Po Lu Date: Sun May 1 09:43:08 2022 +0800 Fix the GTK build * src/xterm.c (x_dnd_begin_drag_and_drop): Let GTK handle events again. diff --git a/src/xterm.c b/src/xterm.c index fd0e7cffa3..bb50b35c2d 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9962,6 +9962,7 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, x_next_event_from_any_display (&next_event); #endif +#ifndef USE_GTK event_display = x_display_info_for_display (next_event.xany.display); @@ -9989,6 +9990,7 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, &next_event, &finish, &hold_quit); #endif } +#endif /* The unblock_input below might try to read input, but XTread_socket does nothing inside a drag-and-drop event commit 905fabe5904c9588bf0c5d0ae15ca0ed354b3656 Author: Po Lu Date: Sun May 1 09:41:16 2022 +0800 * src/xterm.c (x_dnd_begin_drag_and_drop): Fix typo. diff --git a/src/xterm.c b/src/xterm.c index 633724b0ff..fd0e7cffa3 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9956,8 +9956,7 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, block_input (); #ifdef USE_GTK gtk_main_iteration (); -#else -#ifdef USE_X_TOOLKIT +#elif defined USE_X_TOOLKIT XtAppNextEvent (Xt_app_con, &next_event); #else x_next_event_from_any_display (&next_event); @@ -9988,7 +9987,6 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, #else handle_one_xevent (event_display, &next_event, &finish, &hold_quit); -#endif #endif } commit ba0264e19153281bcf264e99c01c130c701151e2 Author: Po Lu Date: Sun May 1 09:37:12 2022 +0800 Fix processing events from multiple displays during DND * src/xterm.c (x_next_event_from_any_display): New function. Only used on no-toolkit builds. (x_dnd_begin_drag_and_drop): Compute correct dpyinfo for handle_one_xevent. diff --git a/src/xterm.c b/src/xterm.c index 4baaaf9ee8..633724b0ff 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9703,6 +9703,45 @@ x_top_window_to_frame (struct x_display_info *dpyinfo, int wdesc) return x_window_to_frame (dpyinfo, wdesc); } +static void +x_next_event_from_any_display (XEvent *event) +{ + struct x_display_info *dpyinfo; + fd_set fds; + int fd, maxfd; + + while (true) + { + FD_ZERO (&fds); + maxfd = -1; + + for (dpyinfo = x_display_list; dpyinfo; + dpyinfo = dpyinfo->next) + { + if (XPending (dpyinfo->display)) + { + XNextEvent (dpyinfo->display, event); + return; + } + + fd = XConnectionNumber (dpyinfo->display); + + if (fd > maxfd) + maxfd = fd; + + eassert (fd < FD_SETSIZE); + FD_SET (XConnectionNumber (dpyinfo->display), &fds); + } + + eassert (maxfd >= 0); + + /* We don't have to check the return of pselect, because if an + error occurs XPending will call the IO error handler, which + then brings us out of this loop. */ + pselect (maxfd, &fds, NULL, NULL, NULL, NULL); + } +} + #endif /* USE_X_TOOLKIT || USE_GTK */ static void @@ -9739,6 +9778,7 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, #ifdef HAVE_XKB XkbStateRec keyboard_state; #endif + struct x_display_info *event_display; if (!FRAME_VISIBLE_P (f)) { @@ -9920,31 +9960,38 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, #ifdef USE_X_TOOLKIT XtAppNextEvent (Xt_app_con, &next_event); #else - XNextEvent (FRAME_X_DISPLAY (f), &next_event); + x_next_event_from_any_display (&next_event); #endif + event_display + = x_display_info_for_display (next_event.xany.display); + + if (event_display) + { #ifdef HAVE_X_I18N #ifdef HAVE_XINPUT2 - if (next_event.type != GenericEvent - || !FRAME_DISPLAY_INFO (f)->supports_xi2 - || (next_event.xgeneric.extension - != FRAME_DISPLAY_INFO (f)->xi2_opcode)) - { + if (next_event.type != GenericEvent + || !event_display->supports_xi2 + || (next_event.xgeneric.extension + != event_display->xi2_opcode)) + { #endif - if (!x_filter_event (FRAME_DISPLAY_INFO (f), &next_event)) - handle_one_xevent (FRAME_DISPLAY_INFO (f), - &next_event, &finish, &hold_quit); + if (!x_filter_event (event_display, &next_event)) + handle_one_xevent (event_display, + &next_event, &finish, &hold_quit); #ifdef HAVE_XINPUT2 - } - else - handle_one_xevent (FRAME_DISPLAY_INFO (f), - &next_event, &finish, &hold_quit); + } + else + handle_one_xevent (event_display, + &next_event, &finish, &hold_quit); #endif #else - handle_one_xevent (FRAME_DISPLAY_INFO (f), - &next_event, &finish, &hold_quit); + handle_one_xevent (event_display, + &next_event, &finish, &hold_quit); #endif #endif + } + /* The unblock_input below might try to read input, but XTread_socket does nothing inside a drag-and-drop event loop, so don't let it clear the pending_signals flag. */ commit 61d6d43fe59cb9e6cedb7973e2b6922bccdcd4e2 Author: Po Lu Date: Sun May 1 09:15:52 2022 +0800 Clean up X Windows tooltip code * src/xfns.c (x_hide_tip): Remove "bloodcurdling hack". * src/xterm.c (handle_one_xevent): Add a better version here instead. The code is unlikely to be hit as well, since tooltip frames are typically deleted, not just hidden. diff --git a/src/xfns.c b/src/xfns.c index 06a0d4728c..27bca5523c 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -8243,29 +8243,6 @@ x_hide_tip (bool delete) else x_make_frame_invisible (XFRAME (tip_frame)); -#ifdef USE_LUCID - /* Bloodcurdling hack alert: The Lucid menu bar widget's - redisplay procedure is not called when a tip frame over - menu items is unmapped. Redisplay the menu manually... */ - { - Widget w; - struct frame *f = SELECTED_FRAME (); - - if (FRAME_X_P (f) && FRAME_LIVE_P (f)) - { - w = f->output_data.x->menubar_widget; - - if (!DoesSaveUnders (FRAME_DISPLAY_INFO (f)->screen) - && w != NULL) - { - block_input (); - xlwmenu_redisplay (w); - unblock_input (); - } - } - } -#endif /* USE_LUCID */ - was_open = Qt; } else diff --git a/src/xterm.c b/src/xterm.c index ea86b7f803..4baaaf9ee8 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -14797,6 +14797,34 @@ handle_one_xevent (struct x_display_info *dpyinfo, { bool visible = FRAME_VISIBLE_P (f); +#ifdef USE_LUCID + /* Bloodcurdling hack alert: The Lucid menu bar widget's + redisplay procedure is not called when a tip frame over + menu items is unmapped. Redisplay the menu manually... */ + if (FRAME_TOOLTIP_P (f) && popup_activated ()) + { + Widget w; + Lisp_Object tail, frame; + struct frame *f1; + + FOR_EACH_FRAME (tail, frame) + { + if (!FRAME_X_P (XFRAME (frame))) + continue; + + f1 = XFRAME (frame); + + if (FRAME_LIVE_P (f1)) + { + w = FRAME_X_OUTPUT (f1)->menubar_widget; + + if (w && !DoesSaveUnders (FRAME_DISPLAY_INFO (f1)->screen)) + xlwmenu_redisplay (w); + } + } + } +#endif /* USE_LUCID */ + /* While a frame is unmapped, display generation is disabled; you don't want to spend time updating a display that won't ever be seen. */ commit b2fdf78fd9ef46683775014716a2cbf98f11ad8c Author: Po Lu Date: Sun May 1 00:59:55 2022 +0000 Implement font selection dialog on Haiku * src/haiku_font_support.cc (font_style_to_flags): Handle style allocation failures. (be_font_style_to_flags): New function. * src/haiku_support.cc (struct font_selection_dialog_message): New struct. (class EmacsFontSelectionDialog): New class. (be_select_font): New function. * src/haiku_support.h: Update prototypes. * src/haikufont.c (Fx_select_font): New function. (syms_of_haikufont): Define new subr. diff --git a/src/haiku_font_support.cc b/src/haiku_font_support.cc index 9acdd652e3..95a0db8ae6 100644 --- a/src/haiku_font_support.cc +++ b/src/haiku_font_support.cc @@ -294,6 +294,9 @@ font_style_to_flags (char *st, struct haiku_font_pattern *pattern) char *token; int tok = 0; + if (!style) + return; + pattern->weight = NO_WEIGHT; pattern->width = NO_WIDTH; pattern->slant = NO_SLANT; @@ -804,3 +807,11 @@ be_evict_font_cache (void) font_object_cache[i] = NULL; } } + +void +be_font_style_to_flags (char *style, struct haiku_font_pattern *pattern) +{ + pattern->specified = 0; + + font_style_to_flags (style, pattern); +} diff --git a/src/haiku_support.cc b/src/haiku_support.cc index 8ad3c58a17..32b05a499d 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -38,6 +38,9 @@ along with GNU Emacs. If not, see . */ #include #include #include +#include +#include +#include #include @@ -54,6 +57,7 @@ along with GNU Emacs. If not, see . */ #include #include #include +#include #include #include @@ -84,14 +88,16 @@ along with GNU Emacs. If not, see . */ /* Some messages that Emacs sends to itself. */ enum { - SCROLL_BAR_UPDATE = 3000, - WAIT_FOR_RELEASE = 3001, - RELEASE_NOW = 3002, - CANCEL_DROP = 3003, - SHOW_MENU_BAR = 3004, - BE_MENU_BAR_OPEN = 3005, - QUIT_APPLICATION = 3006, - REPLAY_MENU_BAR = 3007, + SCROLL_BAR_UPDATE = 3000, + WAIT_FOR_RELEASE = 3001, + RELEASE_NOW = 3002, + CANCEL_DROP = 3003, + SHOW_MENU_BAR = 3004, + BE_MENU_BAR_OPEN = 3005, + QUIT_APPLICATION = 3006, + REPLAY_MENU_BAR = 3007, + FONT_FAMILY_SELECTED = 3008, + FONT_STYLE_SELECTED = 3009, }; /* X11 keysyms that we use. */ @@ -122,6 +128,18 @@ enum KEY_ZENKAKU_HANKAKU = 0xff2a, }; +struct font_selection_dialog_message +{ + /* Whether or not font selection was cancelled. */ + bool cancel; + + /* The index of the selected font family. */ + int family_idx; + + /* The index of the selected font style. */ + int style_idx; +}; + static color_space dpy_color_space = B_NO_COLOR_SPACE; static key_map *key_map = NULL; static char *key_chars = NULL; @@ -2408,6 +2426,243 @@ class EmacsPopUpMenu : public BPopUpMenu } }; +class EmacsFontSelectionDialog : public BWindow +{ + BSplitView split_view; + BListView font_family_pane; + BListView font_style_pane; + BObjectList all_families; + BObjectList all_styles; + BButton cancel_button, ok_button; + port_id comm_port; + + void + UpdateStylesForIndex (int idx) + { + int n, i; + uint32 flags; + font_family family; + font_style style; + BStringItem *item; + + n = all_styles.CountItems (); + + font_style_pane.MakeEmpty (); + all_styles.MakeEmpty (); + + if (get_font_family (idx, &family, &flags) == B_OK) + { + n = count_font_styles (family); + + for (i = 0; i < n; ++i) + { + if (get_font_style (family, i, &style, &flags) == B_OK) + item = new BStringItem (style); + else + item = new BStringItem (""); + + font_style_pane.AddItem (item); + all_styles.AddItem (item); + } + } + + UpdateForSelectedStyle (); + } + + bool + QuitRequested (void) + { + struct font_selection_dialog_message rq; + + rq.cancel = true; + write_port (comm_port, 0, &rq, sizeof rq); + + return false; + } + + void + UpdateForSelectedStyle (void) + { + if (font_style_pane.CurrentSelection () < 0) + ok_button.SetEnabled (false); + else + ok_button.SetEnabled (true); + } + + void + MessageReceived (BMessage *msg) + { + int idx; + struct font_selection_dialog_message rq; + + if (msg->what == FONT_FAMILY_SELECTED) + { + idx = font_family_pane.CurrentSelection (); + UpdateStylesForIndex (idx); + } + else if (msg->what == FONT_STYLE_SELECTED) + UpdateForSelectedStyle (); + else if (msg->what == B_OK) + { + rq.cancel = false; + rq.family_idx = font_family_pane.CurrentSelection (); + rq.style_idx = font_style_pane.CurrentSelection (); + + write_port (comm_port, 0, &rq, sizeof rq); + } + else if (msg->what == B_CANCEL) + { + rq.cancel = true; + + write_port (comm_port, 0, &rq, sizeof rq); + } + + BWindow::MessageReceived (msg); + } + +public: + + ~EmacsFontSelectionDialog (void) + { + font_family_pane.MakeEmpty (); + font_style_pane.MakeEmpty (); + + split_view.RemoveSelf (); + cancel_button.RemoveSelf (); + ok_button.RemoveSelf (); + + if (comm_port >= B_OK) + delete_port (comm_port); + } + + EmacsFontSelectionDialog (void) : BWindow (BRect (0, 0, 300, 300), "", + B_TITLED_WINDOW_LOOK, + B_NORMAL_WINDOW_FEEL, 0), + all_families (20, true), + all_styles (20, true), + cancel_button ("Cancel", "Cancel", + new BMessage (B_CANCEL)), + ok_button ("OK", "OK", new BMessage (B_OK)) + { + BStringItem *family_item; + int i, n_families; + font_family name; + uint32 flags; + BMessage *selection; + + AddChild (&split_view); + AddChild (&cancel_button); + AddChild (&ok_button); + split_view.AddChild (&font_family_pane); + split_view.AddChild (&font_style_pane); + + FrameResized (801, 801); + UpdateForSelectedStyle (); + + selection = new BMessage (FONT_FAMILY_SELECTED); + font_family_pane.SetSelectionMessage (selection); + selection = new BMessage (FONT_STYLE_SELECTED); + font_style_pane.SetSelectionMessage (selection); + + comm_port = create_port (1, "font dialog port"); + + n_families = count_font_families (); + + for (i = 0; i < n_families; ++i) + { + if (get_font_family (i, &name, &flags) == B_OK) + { + family_item = new BStringItem (name); + + all_families.AddItem (family_item); + font_family_pane.AddItem (family_item); + } + else + { + family_item = new BStringItem (""); + + all_families.AddItem (family_item); + font_family_pane.AddItem (family_item); + } + } + } + + void + FrameResized (float new_width, float new_height) + { + BRect frame = Frame (); + float ok_height, ok_width; + float cancel_height, cancel_width; + int max_height; + + ok_button.GetPreferredSize (&ok_width, &ok_height); + cancel_button.GetPreferredSize (&cancel_width, + &cancel_height); + + max_height = std::max (ok_height, cancel_height); + + split_view.ResizeTo (BE_RECT_WIDTH (frame), + BE_RECT_HEIGHT (frame) - 4 - max_height); + ok_button.MoveTo ((BE_RECT_WIDTH (frame) + - 4 - cancel_width - ok_width), + BE_RECT_HEIGHT (frame) - 2 - max_height); + cancel_button.MoveTo (BE_RECT_WIDTH (frame) - 2 - cancel_width, + BE_RECT_HEIGHT (frame) - 2 - max_height); + ok_button.ResizeTo (ok_width, ok_height); + cancel_button.ResizeTo (cancel_width, cancel_height); + } + + void + WaitForChoice (struct font_selection_dialog_message *msg, + void (*process_pending_signals_function) (void)) + { + int32 reply_type; + struct object_wait_info infos[2]; + ssize_t status; + + infos[0].object = port_application_to_emacs; + infos[0].type = B_OBJECT_TYPE_PORT; + infos[0].events = B_EVENT_READ; + + infos[1].object = comm_port; + infos[1].type = B_OBJECT_TYPE_PORT; + infos[1].events = B_EVENT_READ; + + while (true) + { + status = wait_for_objects (infos, 2); + + if (status < B_OK) + continue; + + if (infos[1].events & B_EVENT_READ) + { + if (read_port (comm_port, &reply_type, + msg, sizeof *msg) >= B_OK) + return; + + goto cancel; + } + + if (infos[0].events & B_EVENT_READ) + process_pending_signals_function (); + + infos[0].events = B_EVENT_READ; + infos[1].events = B_EVENT_READ; + } + + cancel: + msg->cancel = true; + return; + } + + status_t + InitCheck (void) + { + return comm_port >= B_OK ? B_OK : comm_port; + } +}; + static int32 start_running_application (void *data) { @@ -4370,3 +4625,45 @@ be_get_ui_color (const char *name, uint32_t *color) return 0; } + +bool +be_select_font (void (*process_pending_signals_function) (void), + haiku_font_family_or_style *family, + haiku_font_family_or_style *style) +{ + EmacsFontSelectionDialog *dialog; + struct font_selection_dialog_message msg; + uint32 flags; + font_family family_buffer; + font_style style_buffer; + + dialog = new EmacsFontSelectionDialog; + dialog->CenterOnScreen (); + + if (dialog->InitCheck () < B_OK) + { + dialog->Quit (); + return false; + } + + dialog->Show (); + dialog->WaitForChoice (&msg, process_pending_signals_function); + + if (!dialog->LockLooper ()) + gui_abort ("Failed to lock font selection dialog looper"); + dialog->Quit (); + + if (msg.cancel) + return false; + + if (get_font_family (msg.family_idx, + &family_buffer, &flags) != B_OK + || get_font_style (family_buffer, msg.style_idx, + &style_buffer, &flags) != B_OK) + return false; + + memcpy (family, family_buffer, sizeof *family); + memcpy (style, style_buffer, sizeof *style); + + return true; +} diff --git a/src/haiku_support.h b/src/haiku_support.h index 88edc1ae14..faaee2ed9d 100644 --- a/src/haiku_support.h +++ b/src/haiku_support.h @@ -648,6 +648,7 @@ extern int be_get_display_screens (void); extern bool be_use_subpixel_antialiasing (void); extern const char *be_find_setting (const char *); extern haiku_font_family_or_style *be_list_font_families (size_t *); +extern void be_font_style_to_flags (char *, struct haiku_font_pattern *); extern int be_get_ui_color (const char *, uint32_t *); extern void BMessage_delete (void *); @@ -658,6 +659,9 @@ extern bool be_drag_message (void *, void *, bool, void (*) (void), extern bool be_drag_and_drop_in_progress (void); extern bool be_replay_menu_bar_event (void *, struct haiku_menu_bar_click_event *); +extern bool be_select_font (void (*process_pending_signals_function) (void), + haiku_font_family_or_style *, + haiku_font_family_or_style *); #ifdef __cplusplus } diff --git a/src/haikufont.c b/src/haikufont.c index 7dd23fba7a..bca29c4ed3 100644 --- a/src/haikufont.c +++ b/src/haikufont.c @@ -1082,6 +1082,53 @@ struct font_driver const haikufont_driver = .list_family = haikufont_list_family }; +DEFUN ("x-select-font", Fx_select_font, Sx_select_font, 0, 2, 0, + doc: /* Read a font using a native dialog. +Return a font spec describing the font chosen by the user. + +FRAME is the frame on which to pop up the font chooser. If omitted or +nil, it defaults to the selected frame. +If EXCLUDE-PROPORTIONAL is non-nil, exclude proportional fonts +in the font selection dialog. */) + (Lisp_Object frame, Lisp_Object exclude_proportional) +{ + haiku_font_family_or_style family, style; + bool rc; + struct haiku_font_pattern pattern; + Lisp_Object lfamily, lweight, lslant, lwidth, ladstyle; + + decode_window_system_frame (frame); + + if (popup_activated_p) + error ("Trying to use a menu from within a menu-entry"); + + popup_activated_p++; + rc = be_select_font (process_pending_signals, &family, &style); + popup_activated_p--; + + if (!rc) + quit (); + + be_font_style_to_flags (style, &pattern); + + lfamily = build_string_from_utf8 (family); + lweight = (pattern.specified & FSPEC_WEIGHT + ? haikufont_weight_to_lisp (pattern.weight) + : Qunspecified); + lslant = (pattern.specified & FSPEC_SLANT + ? haikufont_slant_to_lisp (pattern.slant) + : Qunspecified); + lwidth = (pattern.specified & FSPEC_WIDTH + ? haikufont_width_to_lisp (pattern.width) + : Qunspecified); + ladstyle = (pattern.specified & FSPEC_STYLE + ? intern (pattern.style) : Qunspecified); + + return CALLN (Ffont_spec, QCfamily, lfamily, + QCweight, lweight, QCslant, lslant, + QCwidth, lwidth, QCadstyle, ladstyle); +} + void syms_of_haikufont (void) { @@ -1112,5 +1159,7 @@ syms_of_haikufont (void) font_cache = list (Qnil); staticpro (&font_cache); + defsubr (&Sx_select_font); + be_init_font_data (); } commit 02bf6650b073ffad702772a2ebae20023fa8276a Author: Basil L. Contovounesios Date: Sun May 1 01:19:51 2022 +0300 Fix failing image test on nox builds * test/lisp/image-tests.el (image-supported-file-p/built-in): Skip test in --without-x builds. diff --git a/test/lisp/image-tests.el b/test/lisp/image-tests.el index 908df09f15..bc8c3636c3 100644 --- a/test/lisp/image-tests.el +++ b/test/lisp/image-tests.el @@ -75,7 +75,8 @@ (should-not (find-image '((:type png :file "does-not-exist-foo-bar.png"))))) (ert-deftest image-supported-file-p/built-in () - ;; (skip-unless (image-type-available-p 'pbm)) ; always built-in + ;; (skip-unless (image-type-available-p 'pbm)) ; Always built-in + (skip-unless (display-images-p)) ; (except in nox builds). (should (eq (image-supported-file-p "foo.pbm") 'pbm))) (ert-deftest image-supported-file-p/optional () commit 4ea8ab77e295fc508fc910e8278540ebcce293fb Author: Lars Ingebrigtsen Date: Sat Apr 30 21:34:18 2022 +0200 Make `M-x apropos' respect help-window-select * lisp/apropos.el (apropos-print): Respect help-window-select. (apropos): Mention it (bug#46034). diff --git a/lisp/apropos.el b/lisp/apropos.el index a98f2328ac..79c4df10d2 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -663,7 +663,10 @@ search for matches for any two (or more) of those words. With \\[universal-argument] prefix, or if `apropos-do-all' is non-nil, consider all symbols (if they match PATTERN). -Return list of symbols and documentation found." +Return list of symbols and documentation found. + +The *Apropos* window will be selected if `help-window-select' is +non-nil." (interactive (list (apropos-read-pattern "symbol") current-prefix-arg)) (setq apropos--current (list #'apropos pattern do-all)) @@ -1249,7 +1252,9 @@ as a heading." (apropos-print-doc 5 'apropos-widget t) (apropos-print-doc 4 'apropos-plist nil)) (setq-local truncate-partial-width-windows t) - (setq-local truncate-lines t)))) + (setq-local truncate-lines t))) + (when help-window-select + (select-window (get-buffer-window "*Apropos*")))) (prog1 apropos-accumulator (setq apropos-accumulator ()))) ; permit gc commit 95dbe4b6ae2e88213835a8ded3928b6769d78f2c Author: Lars Ingebrigtsen Date: Sat Apr 30 20:34:35 2022 +0200 Make load-path-shadows-mode a special mode * lisp/emacs-lisp/shadow.el (load-path-shadows-mode): Make the mode inherit from special-mode so that the `q' command works. diff --git a/lisp/emacs-lisp/shadow.el b/lisp/emacs-lisp/shadow.el index 8cd371321a..2343a9b589 100644 --- a/lisp/emacs-lisp/shadow.el +++ b/lisp/emacs-lisp/shadow.el @@ -177,12 +177,11 @@ See the documentation for `list-load-path-shadows' for further information." . (1 font-lock-warning-face))) "Keywords to highlight in `load-path-shadows-mode'.") -(define-derived-mode load-path-shadows-mode fundamental-mode "LP-Shadows" +(define-derived-mode load-path-shadows-mode special-mode "LP-Shadows" "Major mode for `load-path' shadows buffer." (setq-local font-lock-defaults '((load-path-shadows-font-lock-keywords))) - (setq buffer-undo-list t - buffer-read-only t)) + (setq buffer-undo-list t)) ;; TODO use text-properties instead, a la dired. (define-button-type 'load-path-shadows-find-file commit 0ea217d6464833b5c67666d9fed15b87884b0988 Author: Lars Ingebrigtsen Date: Sat Apr 30 19:42:42 2022 +0200 Fix compilation-max-output-line-length type * lisp/progmodes/compile.el (compilation-max-output-line-length): Fix the type. diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index a621779f8c..6753cf0b02 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1756,7 +1756,7 @@ If nil, ask to kill it." "Output lines that are longer than this value will be hidden. If nil, don't hide anything." :type '(choice (const :tag "Hide nothing" nil) - number) + integer) :version "29.1") (defun compilation--update-in-progress-mode-line () commit d90f54db2285002ae969f7c685779c21eaec1605 Author: Lars Ingebrigtsen Date: Sat Apr 30 19:14:35 2022 +0200 Avoid regexp overflow in mm-decode-content-transfer-encoding * lisp/gnus/mm-bodies.el (mm-decode-content-transfer-encoding): The base64 may be huge, so avoid backtracking (bug#55195). diff --git a/lisp/gnus/mm-bodies.el b/lisp/gnus/mm-bodies.el index 956449dac1..9f2f80b472 100644 --- a/lisp/gnus/mm-bodies.el +++ b/lisp/gnus/mm-bodies.el @@ -191,18 +191,17 @@ If TYPE is `text/plain' CRLF->LF translation may occur." ((eq encoding 'base64) (base64-decode-region (point-min) - ;; Some mailers insert whitespace - ;; junk at the end which - ;; base64-decode-region dislikes. - ;; Also remove possible junk which could - ;; have been added by mailing list software. (save-excursion + ;; Some mailers insert whitespace junk at the end which + ;; base64-decode-region dislikes. (goto-char (point-min)) (while (re-search-forward "^[\t ]*\r?\n" nil t) (delete-region (match-beginning 0) (match-end 0))) + ;; Also ignore junk which could have been added by + ;; mailing list software by finding the final line with + ;; base64 text. (goto-char (point-max)) - (when (re-search-backward "^[\t ]*[A-Za-z0-9+/]+=*[\t ]*$" - nil t) + (when (re-search-backward "[A-Za-z0-9+/]{3,3}=?[\t ]*$" nil t) (forward-line)) (point)))) ((memq encoding '(nil 7bit 8bit binary)) commit 0ea0aa255c94fd58884fec222ed3b2f69dd0cd5c Author: Lars Ingebrigtsen Date: Sat Apr 30 18:21:51 2022 +0200 Fix Vx_show_tooltip_timeout in ns build, too * src/nsfns.m (Fx_show_tip): Respect Vx_show_tooltip_timeout here, too. diff --git a/src/nsfns.m b/src/nsfns.m index cff31f7fe0..00d4a7d2bd 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -2862,9 +2862,8 @@ Frames are listed from topmost (first) to bottommost (last). */) str = SSDATA (string); f = decode_window_system_frame (frame); if (NILP (timeout)) - timeout = make_fixnum (5); - else - CHECK_FIXNAT (timeout); + timeout = Vx_show_tooltip_timeout; + CHECK_FIXNAT (timeout); if (NILP (dx)) dx = make_fixnum (5); commit 52e6352b8150519a2a0b7bee2deaa86953f861ad Author: Lars Ingebrigtsen Date: Sat Apr 30 18:20:19 2022 +0200 Fix compilation after recent x-show-tooltip-timeout changes * src/dispnew.c (syms_of_display): Move x-show-tooltip-timeout to a common file to avoid breaking other systems. diff --git a/src/dispnew.c b/src/dispnew.c index 2aba0edfe8..1dd64be4ea 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -6721,6 +6721,10 @@ See `buffer-display-table' for more information. */); beginning of the next redisplay). */ redisplay_dont_pause = true; + DEFVAR_LISP ("x-show-tooltip-timeout", Vx_show_tooltip_timeout, + doc: /* The default timeout (in seconds) for `x-show-tip'. */); + Vx_show_tooltip_timeout = make_fixnum (5); + DEFVAR_LISP ("tab-bar-position", Vtab_bar_position, doc: /* Specify on which side from the tool bar the tab bar shall be. Possible values are t (below the tool bar), nil (above the tool bar). diff --git a/src/xfns.c b/src/xfns.c index 8f17ee67cd..06a0d4728c 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -9727,10 +9727,6 @@ eliminated in future versions of Emacs. */); } #endif - DEFVAR_LISP ("x-show-tooltip-timeout", Vx_show_tooltip_timeout, - doc: /* The default timeout (in seconds) for `x-show-tip'. */); - Vx_show_tooltip_timeout = make_fixnum (5); - /* X window properties. */ defsubr (&Sx_change_window_property); defsubr (&Sx_delete_window_property); commit 90904f8ce43d69f2142deb7918e1462001cca922 Author: Lars Ingebrigtsen Date: Sat Apr 30 18:17:47 2022 +0200 Remove the "retro" Gnus/Message tool bars * doc/misc/gnus.texi (Gravatars): Remove documentation. * lisp/gnus/gmm-utils.el (gmm-tool-bar-style): Obsoleted. * lisp/gnus/gnus-group.el (gnus-group-tool-bar): Use the "Gnome" definition. (gnus-group-tool-bar-gnome, gnus-group-tool-bar-retro) (gnus-group-tool-bar-zap-list): Obsolete. * lisp/gnus/gnus-sum.el (gnus-summary-tool-bar): Use the "Gnome" definition. (gnus-summary-tool-bar-gnome, gnus-summary-tool-bar-retro) (gnus-summary-tool-bar-zap-list): Obsolete. * lisp/gnus/message.el (message-tool-bar): Use the "Gnome" definition. (message-tool-bar-gnome, message-tool-bar-retro) (message-tool-bar-zap-list): Obsolete. diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 9faace1a75..e51ae7d424 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -24168,15 +24168,12 @@ If you want to see them in the Cc and To fields, set: @item gnus-group-tool-bar @vindex gnus-group-tool-bar Specifies the tool bar in the group buffer. It can be either a list -or a symbol referring to a list. Pre-defined symbols include -@code{gnus-group-tool-bar-gnome} and @code{gnus-group-tool-bar-retro}. +or a symbol referring to a list. @item gnus-summary-tool-bar @vindex gnus-summary-tool-bar Specifies the tool bar in the summary buffer. It can be either a list -or a symbol referring to a list. Pre-defined symbols include -@code{gnus-summary-tool-bar-gnome} and -@code{gnus-summary-tool-bar-retro}. +or a symbol referring to a list. @end table diff --git a/etc/NEWS b/etc/NEWS index eebde1b4d0..47e04cfcbe 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -929,6 +929,16 @@ the common "utm_" trackers from URLs. ** Gnus ++++ +*** Tool bar changes in Gnus/Message. +There were previously two styles of tool bars available in Gnus and +Message, referred to as 'gnus-summary-tool-bar-retro', +'gnus-group-tool-bar-retro' and 'message-tool-bar-retro', and +'gnus-summary-tool-bar-gnome', 'gnus-group-tool-bar-gnome' and +'message-tool-bar-gnome'. The "retro" tool bars have been removed (as +well as the icons used), and the "Gnome" tool bars are now the only +pre-defined toolbars. + --- *** Gnus now uses a variable-pitch font in the headers by default. To get the monospace font back, you can put something like the diff --git a/etc/images/gnus/catchup.pbm b/etc/images/gnus/catchup.pbm deleted file mode 100644 index 3fc571bdf8..0000000000 Binary files a/etc/images/gnus/catchup.pbm and /dev/null differ diff --git a/etc/images/gnus/catchup.xpm b/etc/images/gnus/catchup.xpm deleted file mode 100644 index cba849712d..0000000000 --- a/etc/images/gnus/catchup.xpm +++ /dev/null @@ -1,33 +0,0 @@ -/* XPM */ -static char * catchup_xpm[] = { -"24 24 6 1", -" c None", -". c #FFFFFFFFFFFF", -"X c #E1E1E0E0E0E0", -"o c #A5A5A5A59595", -"O c #999999999999", -"+ c #000000000000", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" . ", -" . .X ", -" ... .oX . ", -" ..oooX.oXo .X ", -" .oooXXXX..oXXoXX ", -" .oXXXX.XoX.oXooX ", -" X...X.X.XX.XoXX ", -" Xo..X.XXX.XXXX ", -" . Xo.oXX..XXXXXX ", -"OOOOXoXXXXXo.XXXXX++OOOO", -"OOOOOX..X.XXXXXXXX++OOOO", -"OOOOOX..XXXXXXXXX++OOOOO", -"OOOOOOXXXXXXXXX+++OOOOOO", -"OOOOOOOOOXXXX++++OOOOOOO", -"OOOOOOOOO+++++OOOOOOOOOO", -"OOOOOOOOOO+OOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO"}; diff --git a/etc/images/gnus/cu-exit.pbm b/etc/images/gnus/cu-exit.pbm deleted file mode 100644 index 210869cce7..0000000000 Binary files a/etc/images/gnus/cu-exit.pbm and /dev/null differ diff --git a/etc/images/gnus/cu-exit.xpm b/etc/images/gnus/cu-exit.xpm deleted file mode 100644 index 17236223fe..0000000000 --- a/etc/images/gnus/cu-exit.xpm +++ /dev/null @@ -1,31 +0,0 @@ -/* XPM */ -static char * cu_exit_xpm[] = { -"24 24 4 1", -" c None", -". c #000000000000", -"X c #FFFFFFFFFFFF", -"o c #999999999999", -" ", -" ", -" ", -" ", -" ", -" ..... ", -" .. .XXX. ", -" ..X..XXXX... ", -" .XXXX.XXXX.X... ", -" ..XXXX.XXX.XXX.. ", -" .XXX.......... ", -" .XXX.XXX.XXX.. ", -" .XX.XXX.XXX. ", -" .XX.XXX.XX.. ", -" ............ ", -" .X.X.X.X.. ", -"ooooooo..........ooooooo", -"ooooooo.X.X.X.X.oooooooo", -"ooooooo.........oooooooo", -"ooooooo..X...X..oooooooo", -"ooooooo...X.X...oooooooo", -"ooooooo........ooooooooo", -"ooooooooo.....oooooooooo", -"oooooooooooooooooooooooo"}; diff --git a/etc/images/gnus/describe-group.pbm b/etc/images/gnus/describe-group.pbm deleted file mode 100644 index de7bf11043..0000000000 Binary files a/etc/images/gnus/describe-group.pbm and /dev/null differ diff --git a/etc/images/gnus/describe-group.xpm b/etc/images/gnus/describe-group.xpm deleted file mode 100644 index b4a6f42a94..0000000000 --- a/etc/images/gnus/describe-group.xpm +++ /dev/null @@ -1,32 +0,0 @@ -/* XPM */ -static char * describe_group_xpm[] = { -"24 24 5 1", -". c None", -" c #000000000000", -"o c #FFFFF5F5ACAC", -"+ c #E1E1E0E0E0E0", -"@ c #C7C7C6C6C6C6", -"........................", -"........................", -".................oooo...", -" .. .. .. .. .. oo oo o.", -"..............oooooooooo", -".............ooooooooooo", -" .. .. .. .. oo oo oo oo", -"............oooooooooooo", -"............oooooooooooo", -" .. .. .. .. oo oo oo oo", -"............oooooooooooo", -"............oooooooooooo", -" .. .. .. .. oo oo oo oo", -"............oooooooooooo", -"..... ...oooooooooooo", -" .. ++ .. .o oo oo oo", -"... @@@+ ....ooooooooo", -"... @ ....oooooooo.", -" . . .. .. .. ..", -". ..............", -" ................", -" .. .. .. .. .. ..", -" ..................", -" ...................."}; diff --git a/etc/images/gnus/exit-gnus.pbm b/etc/images/gnus/exit-gnus.pbm deleted file mode 100644 index 32ad0e0ebe..0000000000 Binary files a/etc/images/gnus/exit-gnus.pbm and /dev/null differ diff --git a/etc/images/gnus/exit-gnus.xpm b/etc/images/gnus/exit-gnus.xpm deleted file mode 100644 index 534f3c2faf..0000000000 --- a/etc/images/gnus/exit-gnus.xpm +++ /dev/null @@ -1,33 +0,0 @@ -/* XPM */ -static char * exit_gnus_xpm[] = { -"24 24 6 1", -" c None", -". c #8686ADAD7D7D", -"X c #919187876969", -"o c #C2C2B9B99C9C", -"O c #A8A8F0F0ECEC", -"+ c #EFEFEFEFEFEF", -" ", -" .... . ", -" .. .. . ", -" ............. ", -" . . . .... ", -" ............. ", -" .............. .. ", -" . . .......... . ", -" .XXXX... .. ", -" o.XXX. . .. ", -" oo.X. .. ... ", -" ooX. . ... ", -" oXo. .. ", -" ooX . . ", -" ooX ", -"OOOOoXXOOOOOOOOOOOOOOOOO", -"OOOoXoXOOOOOOOOOOOOOOOOO", -"OOOooXXOOOO+OOOOOOOOOOOO", -"O+OoooXOO+OOO+OO+OOO+OOO", -"OXXoXoXoXOO++O++OO++OO+O", -"XXXXXXXXXXXX+OOOOOOOOOOO", -"XXXXXXXXXXXXXX+O++OO++OO", -"XXXXXXXXXXXXXXXXOOOOOOOO", -"O++O++++O+OO++OOOO++OOO+"}; diff --git a/etc/images/gnus/exit-summ.pbm b/etc/images/gnus/exit-summ.pbm deleted file mode 100644 index d019231060..0000000000 Binary files a/etc/images/gnus/exit-summ.pbm and /dev/null differ diff --git a/etc/images/gnus/exit-summ.xpm b/etc/images/gnus/exit-summ.xpm deleted file mode 100644 index 5234ccb11e..0000000000 --- a/etc/images/gnus/exit-summ.xpm +++ /dev/null @@ -1,30 +0,0 @@ -/* XPM */ -static char * exit_summ_xpm[] = { -"24 24 3 1", -". c None", -" c #000000000000", -"X c #E1E1E0E0E0E0", -" .. .. .. .. .. .. .. ..", -"........................", -"........................", -" .. .. .. ..", -"...... XXXX .....", -"...... XXXXXXX .....", -" .. .. XX XX XX .. ..", -"...... XXXXXXXX .....", -"...... XXXXXXX .....", -" .. .. X XX .. ..", -"...... XXXX .....", -"...... XXXX .....", -" .. .. X XXXXX .. ..", -"...... XXXXXXX .....", -"...... XXXXX XX .....", -" .. .. X XXXXX .. ..", -"...... XXXXX .....", -"...... X .....", -" .. . . .. ..", -"........................", -"........................", -" .. .. .. .. .. .. .. ..", -"........................", -"........................"}; diff --git a/etc/images/gnus/get-news.pbm b/etc/images/gnus/get-news.pbm deleted file mode 100644 index c0080716c4..0000000000 Binary files a/etc/images/gnus/get-news.pbm and /dev/null differ diff --git a/etc/images/gnus/get-news.xpm b/etc/images/gnus/get-news.xpm deleted file mode 100644 index d7e7b4a355..0000000000 --- a/etc/images/gnus/get-news.xpm +++ /dev/null @@ -1,31 +0,0 @@ -/* XPM */ -static char * get_news_xpm[] = { -"24 24 4 1", -". c None", -"X c #A5A5A5A59595", -"o c #E1E1E0E0E0E0", -"O c #C7C7C6C6C6C6", -"........................", -"........................", -"........................", -".....XXX................", -"...XXoooXXXXX...........", -"XXXoooooXXoooX.XXX......", -"XoXooXXXooooXXXoooX.....", -"XooXoXoXooXXXoooooX.....", -"XooXXXooXoXoXooooooX....", -"XooXOXooXXXooXooooooX...", -"XoXOOXooXOXooXXooooooX..", -"OXOOOXoXOOXooXoooooooX..", -"OXOooOXOOOXoXOooooooooX.", -".OXooOXOooOXOOooooooooX.", -".OXoooOXooOXOooooooooooX", -"..OXooOXoooOXooooooooooX", -"..OXooOOXooOXooooooooooX", -"...OXooOXoooOXoooooooXXX", -"...OXooXOXooOXooooooXOO.", -"....OXXOOXooXOXoooXXO...", -".....OO..OXXOOXooXOO....", -"..........OO..OXXO......", -"...............OO.......", -"........................"}; diff --git a/etc/images/gnus/gnntg.pbm b/etc/images/gnus/gnntg.pbm deleted file mode 100644 index 2f5e5261a9..0000000000 Binary files a/etc/images/gnus/gnntg.pbm and /dev/null differ diff --git a/etc/images/gnus/gnntg.xpm b/etc/images/gnus/gnntg.xpm deleted file mode 100644 index 21bc5f16eb..0000000000 --- a/etc/images/gnus/gnntg.xpm +++ /dev/null @@ -1,31 +0,0 @@ -/* XPM */ -static char * gnntg_xpm[] = { -"24 24 4 1", -" c None", -". c #000000000000", -"X c #FFFFFFFFFFFF", -"o c #C7C7C6C6C6C6", -" ", -" ....... ", -" .XXXXX. ", -" .XXXXX. ... ", -" .XXXXX... .ooo. ", -" .XXXXX.... ..ooo.. ", -" .XXXXX..o.. ..ooo.. ", -" .XXXXX...o.. ..o.. ", -" .XXXXX. ..o........ ", -" .XXXXX. ..oooooooo. ", -" ....... .oooooooo.. ", -" .ooooo..o. ", -" .oooo..o. ", -" .oooo..o. ", -" .oooo..o. ", -" .oooo..o. ", -" ......... ", -" ......oo. ", -" .ooooo... ", -" .oo..o... ", -" .oo..o.. ", -" ........ ", -" .... ... ", -" ... ... "}; diff --git a/etc/images/gnus/important.pbm b/etc/images/gnus/important.pbm deleted file mode 100644 index 7139ff2d69..0000000000 Binary files a/etc/images/gnus/important.pbm and /dev/null differ diff --git a/etc/images/gnus/important.xpm b/etc/images/gnus/important.xpm deleted file mode 100644 index e972facff2..0000000000 --- a/etc/images/gnus/important.xpm +++ /dev/null @@ -1,32 +0,0 @@ -/* XPM */ -static char *magick[] = { -/* columns rows colors chars-per-pixel */ -"24 24 2 1", -"! c red", -"w c Gray75", -/* pixels */ -"wwwwwwwwwwwwwwwwwwwwwwww", -"wwwwwwwwwwwwwwwwwwwwwwww", -"wwwwwwwww!!!wwwwwwwwwwww", -"wwwwwwwww!!!wwwwwwwwwwww", -"wwwwwwww!!!!!wwwwwwwwwww", -"wwwwwwww!!!!!wwwwwwwwwww", -"wwwwwww!!!!!!!wwwwwwwwww", -"wwwwwww!!!!!!!wwwwwwwwww", -"wwwwwww!!!!!!!wwwwwwwwww", -"wwwwwww!!!!!!!wwwwwwwwww", -"wwwwwww!!!!!!!wwwwwwwwww", -"wwwwwww!!!!!!!wwwwwwwwww", -"wwwwwww!!!!!!!wwwwwwwwww", -"wwwwwwww!!!!!wwwwwwwwwww", -"wwwwwwww!!!!!wwwwwwwwwww", -"wwwwwwww!!!!!wwwwwwwwwww", -"wwwwwwwww!!!wwwwwwwwwwww", -"wwwwwwwwwwwwwwwwwwwwwwww", -"wwwwwwwww!!!wwwwwwwwwwww", -"wwwwwwww!!!!!wwwwwwwwwww", -"wwwwwwww!!!!!wwwwwwwwwww", -"wwwwwwwww!!!wwwwwwwwwwww", -"wwwwwwwwwwwwwwwwwwwwwwww", -"wwwwwwwwwwwwwwwwwwwwwwww" -}; diff --git a/etc/images/gnus/next-ur.pbm b/etc/images/gnus/next-ur.pbm deleted file mode 100644 index 678bbb09f8..0000000000 Binary files a/etc/images/gnus/next-ur.pbm and /dev/null differ diff --git a/etc/images/gnus/next-ur.xpm b/etc/images/gnus/next-ur.xpm deleted file mode 100644 index bea13280b6..0000000000 --- a/etc/images/gnus/next-ur.xpm +++ /dev/null @@ -1,35 +0,0 @@ -/* XPM */ -static char * next_ur_xpm[] = { -"24 24 8 1", -". c None", -" c #000000000000", -"X c #A5A5A5A59595", -"o c #C7C7C6C6C6C6", -"O c #FFFF00000000", -"+ c #9A9A6C6C4E4E", -"@ c #E1E1E0E0E0E0", -"# c #FFFFFFFFFFFF", -" .. .. .. .. .. .. .. ..", -"........................", -"............X...........", -" .. .. .. .XXX. .. .. ..", -".........XXooOX.........", -".......XXooo+O@X........", -" .. XXXoooo++@@@X. .. ..", -"....X@Xoooooo@@@X.......", -"....X@@Xooo@@@@@@X......", -" .. X@@XXoo@@@@@@@X.. ..", -"....X@@Xoo@@@@@@@@@X....", -"....X@Xo@@@XX@@@@@@oX...", -" .. oXoo@XXooO@@@@@@X ..", -"....oXoXXooo+OX@@@@Xo...", -"....XXXoooo++@@X@@Xo....", -" .. X@Xoooooo@@@XX .. ..", -"....X@@Xooo@@@@@@X......", -"....X@@XXoo@@@@@@@X.....", -" .. X@@Xoo@@@@@@@@@X. ..", -"....X@Xo@ @@@@@@@ X...", -"... oXoo ## @@ @@ ## ...", -" .. oXo #### @ #### ..", -".....oX #### @@@ #### ..", -".....oX@ ## @@@@X ## ..."}; diff --git a/etc/images/gnus/post.pbm b/etc/images/gnus/post.pbm deleted file mode 100644 index 577d6236bf..0000000000 Binary files a/etc/images/gnus/post.pbm and /dev/null differ diff --git a/etc/images/gnus/post.xpm b/etc/images/gnus/post.xpm deleted file mode 100644 index 7a3eaa5e3b..0000000000 --- a/etc/images/gnus/post.xpm +++ /dev/null @@ -1,35 +0,0 @@ -/* XPM */ -static char * post_xpm[] = { -"24 24 8 1", -". c None", -" c #434343434343", -"X c #A5A5A5A59595", -"O c #000000000000", -"+ c #C7C7C6C6C6C6", -"@ c #FFFF00000000", -"# c #9A9A6C6C4E4E", -"$ c #E1E1E0E0E0E0", -"O..O..O..O..O..O..O..O..", -"........................", -"............X...........", -"O..O..O..O.XXX.O..O..O..", -".........XX++@X.........", -".......XX+++#@$X........", -"O..OXXX++++##$$$X.O..O..", -"....X$X++++++$$$X.......", -"....X$$X+++$$$$$$X......", -"O..OX$$XX++$$$$$$$X..O..", -"....X$$X++$$$$$$$$$X....", -"....X$X+$$$$$$$$$$$+X...", -"O..O+X++$$$$$$$$$$$$XO..", -"....+X+$$$$$$$$$$$$X+...", -".....+X$$$$$$$$$$$X+....", -"O..O.+X$$$$$$$$$XXO..O..", -"......+X$$$$$$$X++......", -"......+X$$$$$XX+........", -"O..O..O+X$$$X++O..O..O..", -".......+X$$X++..........", -"........+XX+............", -"O..O..O..O+.O..O..O..O..", -"........................", -"........................"}; diff --git a/etc/images/gnus/prev-ur.pbm b/etc/images/gnus/prev-ur.pbm deleted file mode 100644 index 49389198bd..0000000000 Binary files a/etc/images/gnus/prev-ur.pbm and /dev/null differ diff --git a/etc/images/gnus/prev-ur.xpm b/etc/images/gnus/prev-ur.xpm deleted file mode 100644 index 8013133283..0000000000 --- a/etc/images/gnus/prev-ur.xpm +++ /dev/null @@ -1,35 +0,0 @@ -/* XPM */ -static char * prev_ur_xpm[] = { -"24 24 8 1", -". c None", -" c #000000000000", -"X c #A5A5A5A59595", -"o c #C7C7C6C6C6C6", -"O c #FFFF00000000", -"+ c #9A9A6C6C4E4E", -"@ c #E1E1E0E0E0E0", -"# c #FFFFFFFFFFFF", -" .. .. .. .. .. .. .. ..", -"........................", -"............X...........", -" .. .. .. .XXX. .. .. ..", -".........XXooOX.........", -".......XXooo+O@X........", -" .. XXXoooo++@@@X. .. ..", -"....X@Xoooooo@@@X.......", -"....X@@Xooo@@@@@@X......", -" .. X@@XXoo@@@@@@@X.. ..", -"....X@@Xo @@@@@@ X....", -"....X@Xo ## X @ ## X...", -" .. oXo #XXXoO@ #### ..", -"....oXoXXooo+OX #### ...", -"....XXXoooo++@@X ## ....", -" .. X@Xoooooo@@@X .. ..", -"....X@@Xooo@@@@@@X......", -"....X@@XXoo@@@@@@@X.....", -" .. X@@Xoo@@@@@@@@@X. ..", -"....X@Xo@@@@@@@@@@@@X...", -"... oXoo@@@@@@@@@@@@X...", -" .. oXo@@@@@@@@@@@@X....", -".....oX@@@@@@@@@@@X.....", -".....oX@@@@@@@@@@X......"}; diff --git a/etc/images/gnus/receipt.pbm b/etc/images/gnus/receipt.pbm deleted file mode 100644 index 5595239f40..0000000000 Binary files a/etc/images/gnus/receipt.pbm and /dev/null differ diff --git a/etc/images/gnus/receipt.xpm b/etc/images/gnus/receipt.xpm deleted file mode 100644 index 18caaf1cf7..0000000000 --- a/etc/images/gnus/receipt.xpm +++ /dev/null @@ -1,32 +0,0 @@ -/* XPM */ -static char * receipt_xpm[] = { -"24 24 5 1", -" c None", -". c #FFFFFFFFFFFF", -"X c #676766666363", -"o c #FFFF00000000", -"O c #AEAE3E3E4848", -" ", -" ", -" .. ", -" . ", -" . ", -" . ", -" .. ", -" Xooo .. ", -" Xoooooooo.. ", -" Xoooooooooooooo ... ", -" oooooooooooOOoo . ", -" ooooooooooOOOOo. ", -" oooooooooOO...o ", -" ooooooooooOOooo ", -" ooooooooooooooo ", -" ooooooooooooooo ", -" oooooooooooooo ", -" ooooooooooo ", -" ooooooo ", -" oooo ", -" oo ", -" ", -" ", -" "}; diff --git a/etc/images/gnus/reply-wo.pbm b/etc/images/gnus/reply-wo.pbm deleted file mode 100644 index def54da8ed..0000000000 Binary files a/etc/images/gnus/reply-wo.pbm and /dev/null differ diff --git a/etc/images/gnus/reply-wo.xpm b/etc/images/gnus/reply-wo.xpm deleted file mode 100644 index 370678af70..0000000000 --- a/etc/images/gnus/reply-wo.xpm +++ /dev/null @@ -1,31 +0,0 @@ -/* XPM */ -static char * reply_wo_xpm[] = { -"24 24 4 1", -" c None", -". c #000000000000", -"X c #E1E1E0E0E0E0", -"O c #FFFFFFFFFFFF", -" ", -" ", -" ", -" .... ", -" ..X.... ", -" ..XX.XX.. ", -" .O.XX.XXXX.. ", -" ..O.XXX.XXXX... ", -" .OO.XXXX.X....... ", -" .OO.XXXX...XXX.OO.. ", -" ..OO.XX....XXXX.OOOO.. ", -" .......XX.XXXX.OOO.... ", -" .OOO.XXX.XXXX.OO..OOO. ", -" .OOOO....XXX....OOOOO. ", -" .OOOOOOO..XX..OOOOOOO. ", -" .OOOOOOO......OOOOOOO. ", -" .OOOOOO.OO..O..OOOOOO. ", -" .OOOOO.OOOOOOOO.OOOOO. ", -" .OOOO.OOOOOOOOOO.OOOO. ", -" .OOO.OOOOOOOOOOOO.OOO. ", -" .O..OOOOOOOOOOOOOO..O. ", -" ..OOOOOOOOOOOOOOOOOO.. ", -" ...................... ", -" "}; diff --git a/etc/images/gnus/reply.pbm b/etc/images/gnus/reply.pbm deleted file mode 100644 index ee181e663b..0000000000 Binary files a/etc/images/gnus/reply.pbm and /dev/null differ diff --git a/etc/images/gnus/reply.xpm b/etc/images/gnus/reply.xpm deleted file mode 100644 index a45884803f..0000000000 --- a/etc/images/gnus/reply.xpm +++ /dev/null @@ -1,31 +0,0 @@ -/* XPM */ -static char * reply_xpm[] = { -"24 24 4 1", -" c None", -". c #000000000000", -"X c #E1E1E0E0E0E0", -"O c #FFFFFFFFFFFF", -" ", -" ", -" ", -" .... ", -" ..XXX.. ", -" ..XXXXX.. ", -" .O.XXXXXXX.. ", -" ..O.XXXXXXXXX.. ", -" .OO.XXXXXXXXXX... ", -" .OO.XXXXXXXXXX.OO.. ", -" ..OO.XXXXXXXXXX.OOOO.. ", -" .....XXXXXXXXX.OOO.... ", -" .OOO.XXXXXXXX.OO..OOO. ", -" .OOOO...XXXXX...OOOOO. ", -" .OOOOOOO..XX..OOOOOOO. ", -" .OOOOOOO......OOOOOOO. ", -" .OOOOOO.OO..O..OOOOOO. ", -" .OOOOO.OOOOOOOO.OOOOO. ", -" .OOOO.OOOOOOOOOO.OOOO. ", -" .OOO.OOOOOOOOOOOO.OOO. ", -" .O..OOOOOOOOOOOOOO..O. ", -" ..OOOOOOOOOOOOOOOOOO.. ", -" ...................... ", -" "}; diff --git a/etc/images/gnus/rot13.pbm b/etc/images/gnus/rot13.pbm deleted file mode 100644 index 800d9d6327..0000000000 Binary files a/etc/images/gnus/rot13.pbm and /dev/null differ diff --git a/etc/images/gnus/rot13.xpm b/etc/images/gnus/rot13.xpm deleted file mode 100644 index 18faa3e92d..0000000000 --- a/etc/images/gnus/rot13.xpm +++ /dev/null @@ -1,128 +0,0 @@ -/* XPM */ -static char * rot13_xpm[] = { -"24 24 101 2", -" g None", -". g #000000", -"+ g #212121", -"@ g #9E9E9E", -"# g #E6E6E6", -"$ g #E7E7E7", -"% g #C8C8C8", -"& g #A0A0A0", -"* g #131313", -"= g #5F5F5F", -"- g #EDEDED", -"; g #D6D6D6", -"> g #D5D5D5", -", g #DDDDDD", -"' g #D8D8D8", -") g #A1A1A1", -"! g #3C3C3C", -"~ g #353535", -"{ g #EFEFEF", -"] g #CFCFCF", -"^ g #4C4C4C", -"/ g #141414", -"( g #6A6A6A", -"_ g #D0D0D0", -": g #B2B2B2", -"< g #454545", -"[ g #E2E2E2", -"} g #292929", -"| g #0F0F0F", -"1 g #949494", -"2 g #E9E9E9", -"3 g #C3C3C3", -"4 g #1C1C1C", -"5 g #E1E1E1", -"6 g #272727", -"7 g #DEDEDE", -"8 g #B6B6B6", -"9 g #0C0C0C", -"0 g #262626", -"a g #1F1F1F", -"b g #616161", -"c g #5B5B5B", -"d g #232323", -"e g #111111", -"f g #181818", -"g g #3D3D3D", -"h g #636363", -"i g #545454", -"j g #2E2E2E", -"k g #242424", -"l g #070707", -"m g #DCDCDC", -"n g #D3D3D3", -"o g #C5C5C5", -"p g #C2C2C2", -"q g #BFBFBF", -"r g #B5B5B5", -"s g #696969", -"t g #ACACAC", -"u g #999999", -"v g #8F8F8F", -"w g #868686", -"x g #686868", -"y g #B1B1B1", -"z g #9A9A9A", -"A g #909090", -"B g #878787", -"C g #DBDBDB", -"D g #A6A6A6", -"E g #979797", -"F g #8A8A8A", -"G g #8D8D8D", -"H g #838383", -"I g #666666", -"J g #BBBBBB", -"K g #9F9F9F", -"L g #8B8B8B", -"M g #828282", -"N g #676767", -"O g #A3A3A3", -"P g #8E8E8E", -"Q g #888888", -"R g #8C8C8C", -"S g #BABABA", -"T g #818181", -"U g #757575", -"V g #DADADA", -"W g #AFAFAF", -"X g #848484", -"Y g #7F7F7F", -"Z g #7B7B7B", -"` g #B8B8B8", -" . g #D9D9D9", -".. g #ABABAB", -"+. g #929292", -"@. g #939393", -"#. g #808080", -"$. g #919191", -"%. g #ADADAD", -"&. g #969696", -"*. g #4A4A4A", -" ", -" ", -" . . . . . ", -" . + @ # $ % & * ", -" . = - # ; > , ' ) ! . ", -" ~ { ] ^ . . / ( _ : < ", -" . [ ' } . | ( % 1 . ", -" * 2 3 . 4 5 @ . ", -" 6 7 8 . . $ 8 . ", -" 9 0 a b c d e 6 a f a g h i j k l ", -" . 7 m ' ; n o p p p p q r r r s . ", -" . 7 p 8 : t t t t t t t u v w x . ", -" . m p 8 y t t t t t t t z A B s . ", -" . C p r D E E E E E E A F G H I . ", -" . , p 8 J t t t t t t t K L M N . ", -" . m p y O E E E E E E P Q R H ( . ", -" . m p r S t t t t t t t K L T U . ", -" . V p W & E E E E E E F X B Y Z . ", -" . C p y ` t t t t t t t K F B T . ", -" . .p W ..E E E E E E E +.G @.#.. ", -" . $.%.z &.A L F F G $.A A P X *.. ", -" . . . . . . . . . . . . . . . ", -" ", -" "}; diff --git a/etc/images/gnus/save-aif.pbm b/etc/images/gnus/save-aif.pbm deleted file mode 100644 index 15829c289e..0000000000 Binary files a/etc/images/gnus/save-aif.pbm and /dev/null differ diff --git a/etc/images/gnus/save-aif.xpm b/etc/images/gnus/save-aif.xpm deleted file mode 100644 index f0325ac2fb..0000000000 --- a/etc/images/gnus/save-aif.xpm +++ /dev/null @@ -1,33 +0,0 @@ -/* XPM */ -static char * save_aif_xpm[] = { -"24 24 6 1", -" c None", -". c #999999999999", -"X c #E1E1E0E0E0E0", -"o c #C7C7C6C6C6C6", -"O c #000000000000", -"+ c #FFFFFFFFFFFF", -" ", -" ", -" ............. ", -" .XXXXXXXXXX.X.. ", -" .XXXXXXXXXX.XX. ", -" .XXXXXXXXXX.... ", -" .XXXXXXXXXXooo. ", -" .XXXXXXXXXXXXX. ", -" .XXXXXXXXXXXXX. ", -" .XXXXXXXXXXXXX. ", -" OOOOOOOOOOOOOOXXXXXX. ", -" O..O+++++++O.OXXXXXX. ", -" O..O+++++++O.OXXXXXX. ", -" O..O+++++++O.OXXXXXX. ", -" O..O+++++++O.OXXXXXX. ", -" O..O+++++++O.OXXXXXX. ", -" O..OOOOOOOOO.OXXXXXX. ", -" O............OXXXXXX. ", -" O............OXXXXXX. ", -" O..OOOOOOOOO.O....... ", -" O..OoooooO++.O ", -" O..OoooooO++.O ", -" O.OoooooO++.O ", -" OOOOOOOOOOOO "}; diff --git a/etc/images/gnus/save-art.pbm b/etc/images/gnus/save-art.pbm deleted file mode 100644 index 68fe0cb309..0000000000 Binary files a/etc/images/gnus/save-art.pbm and /dev/null differ diff --git a/etc/images/gnus/save-art.xpm b/etc/images/gnus/save-art.xpm deleted file mode 100644 index fe9726fa3f..0000000000 --- a/etc/images/gnus/save-art.xpm +++ /dev/null @@ -1,32 +0,0 @@ -/* XPM */ -static char * save_art_xpm[] = { -"24 24 5 1", -" c None", -". c #000000000000", -"X c #FFFFFFFFFFFF", -"o c #999999999999", -"O c #C7C7C6C6C6C6", -" ", -" ", -" .................. ", -" ...XXXXXXXXXXXXX.. ", -" .XX..XXXXXXXXX..X. ", -" .XXXX..XXXXX..XXX. ", -" .XXXXX......XXXXX. ", -" .XXX..XX..XX..XXX. ", -" .XX..XXXXXXXX..XX. ", -" ...XXXXXXXXXXXX... ", -" ..............XXXXXXX. ", -" .oo.XXXXXXX.o......... ", -" .oo.XXXXXXX.o. ", -" .oo.XXXXXXX.o. ", -" .oo.XXXXXXX.o. ", -" .oo.XXXXXXX.o. ", -" .oo.........o. ", -" .oooooooooooo. ", -" .oooooooooooo. ", -" .oo.........o. ", -" .oo.OOOOO.XXo. ", -" .oo.OOOOO.XXo. ", -" .o.OOOOO.XXo. ", -" ............ "}; diff --git a/etc/images/gnus/subscribe.pbm b/etc/images/gnus/subscribe.pbm deleted file mode 100644 index fe6b3920d3..0000000000 Binary files a/etc/images/gnus/subscribe.pbm and /dev/null differ diff --git a/etc/images/gnus/subscribe.xpm b/etc/images/gnus/subscribe.xpm deleted file mode 100644 index ff193a9e8a..0000000000 --- a/etc/images/gnus/subscribe.xpm +++ /dev/null @@ -1,32 +0,0 @@ -/* XPM */ -static char * subscribe_xpm[] = { -"24 24 5 1", -" c None", -". c #A5A5A5A59595", -"X c #E1E1E0E0E0E0", -"o c #C7C7C6C6C6C6", -"O c #8686ADAD7D7D", -" ", -" ", -" ", -" ... ", -" ..XXX..... ", -"...XXXXX..XXX. ... ", -".X.XX...XXXX...XXX. ", -".XX.X.X.XX...XXXXX. ", -".XX...XX.X.X.XXXXXX. ", -".XX.o.XX...XX.XXXXXX. ", -".X.oo.XX.o.XX..XXXXXX. ", -"o.ooo.X.oo.XX.XXXOXXX. ", -"o.oXXo.ooo.X.oXXOXXXXX. ", -" o.XXo.oXXo.ooXXOXXXXX. ", -" o.XXXo.XXo.oXXXOXXXXXX.", -" o.XXo.XXXo.XOOOOXXXXX.", -" o.XXoo.XXo.XXXOOXXXXX.", -" o.XXo.XXXo.XXXXXXX...", -" o.XX.o.XXo.XXXXXX.oo ", -" o..oo.XX.o.XXX..o ", -" oo o..oo.XX.oo ", -" oo o..o ", -" oo ", -" "}; diff --git a/etc/images/gnus/unimportant.pbm b/etc/images/gnus/unimportant.pbm deleted file mode 100644 index 26a8721624..0000000000 Binary files a/etc/images/gnus/unimportant.pbm and /dev/null differ diff --git a/etc/images/gnus/unimportant.xpm b/etc/images/gnus/unimportant.xpm deleted file mode 100644 index 4298224e56..0000000000 --- a/etc/images/gnus/unimportant.xpm +++ /dev/null @@ -1,32 +0,0 @@ -/* XPM */ -static char *magick[] = { -/* columns rows colors chars-per-pixel */ -"24 24 2 1", -"! c blue", -"w c Gray75", -/* pixels */ -"wwwwwwwwwwwwwwwwwwwwwwww", -"wwwwwwwwwwwwwwwwwwwwwwww", -"wwwwwwwwwww!!!wwwwwwwwww", -"wwwwwwwwwww!!!wwwwwwwwww", -"wwwwwwwwwww!!!wwwwwwwwww", -"wwwwwwwwwww!!!wwwwwwwwww", -"wwwwwwwwwww!!!wwwwwwwwww", -"wwwwwwwwwww!!!wwwwwwwwww", -"wwwwwwwwwww!!!wwwwwwwwww", -"wwwwwwwwwww!!!wwwwwwwwww", -"wwwwwwwwwww!!!wwwwwwwwww", -"wwwwwwwwwww!!!wwwwwwwwww", -"ww!!!wwwwww!!!wwwwww!!!w", -"www!!!wwwww!!!wwwww!!!ww", -"wwww!!!wwww!!!wwww!!!www", -"wwwww!!!www!!!www!!!wwww", -"wwwwww!!!ww!!!ww!!!wwwww", -"wwwwwww!!!w!!!w!!!wwwwww", -"wwwwwwww!!!!!!!!!wwwwwww", -"wwwwwwwww!!!!!!!wwwwwwww", -"wwwwwwwwww!!!!!wwwwwwwww", -"wwwwwwwwwww!!!wwwwwwwwww", -"wwwwwwwwwwwwwwwwwwwwwwww", -"wwwwwwwwwwwwwwwwwwwwwwww" -}; diff --git a/etc/images/gnus/unsubscribe.pbm b/etc/images/gnus/unsubscribe.pbm deleted file mode 100644 index 7d869fb53f..0000000000 Binary files a/etc/images/gnus/unsubscribe.pbm and /dev/null differ diff --git a/etc/images/gnus/unsubscribe.xpm b/etc/images/gnus/unsubscribe.xpm deleted file mode 100644 index a91180d00f..0000000000 --- a/etc/images/gnus/unsubscribe.xpm +++ /dev/null @@ -1,32 +0,0 @@ -/* XPM */ -static char * unsubscribe_xpm[] = { -"24 24 5 1", -" c None", -". c #A5A5A5A59595", -"X c #E1E1E0E0E0E0", -"o c #C7C7C6C6C6C6", -"O c #FFFF00000000", -" ", -" ", -" ", -" ... ", -" ..XXX..... ", -"...XXXXX..XXX. ... ", -".X.XX...XXXX...XXX. ", -".XX.X.X.XX...XXXXX. ", -".XX...XX.X.X.XXXXXX. ", -".XX.o.XX...XX.XXXXXX. ", -".X.oo.XX.o.XX..XXXXXX. ", -"o.ooo.X.oo.XX.XXXXXXX. ", -"o.oXXo.ooo.X.oXXXXXXXX. ", -" o.XXo.oXXo.ooXXOXXXXX. ", -" o.XXXo.XXo.oXXXOXXXXXX.", -" o.XXo.XXXo.XOOOXXXXXX.", -" o.XXoo.XXo.XoOOOXXXXX.", -" o.XXo.XXXo.XOoOXXX...", -" o.XX.o.XXo.XOXoXX.oo ", -" o..oo.XX.o.oXX..o ", -" oo o..oo.XX.oo ", -" oo o..o ", -" oo ", -" "}; diff --git a/etc/images/gnus/uu-decode.pbm b/etc/images/gnus/uu-decode.pbm deleted file mode 100644 index 2b7fada147..0000000000 Binary files a/etc/images/gnus/uu-decode.pbm and /dev/null differ diff --git a/etc/images/gnus/uu-decode.xpm b/etc/images/gnus/uu-decode.xpm deleted file mode 100644 index b9d940cc99..0000000000 --- a/etc/images/gnus/uu-decode.xpm +++ /dev/null @@ -1,36 +0,0 @@ -/* XPM */ -static char * uu_decode_xpm[] = { -"24 24 9 1", -" c None", -". c #919187876969", -"X c #C2C2B9B99C9C", -"o c #868686868686", -"O c #8F8F8F8F8F8F", -"+ c #000000000000", -"@ c #4C4C4C4C4C4C", -"# c #E9E9EFEFE8E8", -"$ c #8686ADAD7D7D", -" ", -" ", -" ", -" .............. ", -" X.o.........O.++ ", -" XX++++++++++..++ ", -" XX@########+..++ ", -" XX@########+..++ ", -" XX@$#$$$#$#+..++ ", -" XX@#$$$$$$#+..++ ", -" XX@##$#####+..++ ", -" XX@##$#$$##+..++ ", -" XX@##$#$$##+..++ ", -" XX@##$$#$$#+..++ ", -" XX@######$#+..++ ", -" XX@########+..++ ", -" XX@########+..++ ", -" XX.@@@@@@@@@..++ ", -" X.XXXXXXXXXX..++ ", -" .XXXXXXXXXXXX.++ ", -" +++++++++++++++ ", -" +++++++++++++++ ", -" ", -" "}; diff --git a/etc/images/gnus/uu-post.pbm b/etc/images/gnus/uu-post.pbm deleted file mode 100644 index a5face7098..0000000000 Binary files a/etc/images/gnus/uu-post.pbm and /dev/null differ diff --git a/etc/images/gnus/uu-post.xpm b/etc/images/gnus/uu-post.xpm deleted file mode 100644 index 7c4204c695..0000000000 --- a/etc/images/gnus/uu-post.xpm +++ /dev/null @@ -1,35 +0,0 @@ -/* XPM */ -static char * uu_post_xpm[] = { -"24 24 8 1", -". c None", -"X c #000000000000", -"+ c #C2C2B9B99C9C", -"@ c #919187876969", -"# c #868686868686", -"% c #4C4C4C4C4C4C", -"& c #E9E9EFEFE8E8", -"* c #8686ADAD7D7D", -"X..X..X..X.XX..X..X..X..", -"..........X.X...........", -".........X...X..........", -"X..X..X.XX..X.XX..X..X..", -".......X.......X........", -"......X.........X.......", -"X..X+X@@@@@@@@@@@XX..X..", -"....+@@@@@@@@@@@@@......", -"....++XXXXXXXXXX@@......", -"X..X++%&&&&&&&&X@@X..X..", -"....++%&&&&&&&&X@@......", -"....++%*&***&*&X@@......", -"X..X++%&******&X@@X..X..", -"....++%&&*&&&&&X@@......", -"....++%&&*&**&&X@@......", -"X..X++%&&*&**&&X@@X..X..", -"....++%&&**&**&X@@......", -"....++%&&&&&&*&X@@......", -"X..X++%&&&&&&&&X@@X..X..", -"....++%&&&&&&&&X@@......", -"....++@%%%%%%%%%@@......", -"X..X+@++++++++++@@X..X..", -"....+++++++++++++@......", -"........................"}; diff --git a/lisp/gnus/gmm-utils.el b/lisp/gnus/gmm-utils.el index 697ce01343..fc18d8a1c5 100644 --- a/lisp/gnus/gmm-utils.el +++ b/lisp/gnus/gmm-utils.el @@ -134,47 +134,8 @@ ARGS are passed to `message'." (const :tag "No map") (plist :inline t :tag "Properties")))) -(define-widget 'gmm-tool-bar-zap-list 'lazy - "Tool bar zap list." - :tag "Tool bar zap list" - :type '(choice (const :tag "Zap all" t) - (const :tag "Keep all" nil) - (list - ;; :value - ;; Work around (bug in customize?), see - ;; - ;; (new-file open-file dired kill-buffer write-file - ;; print-buffer customize help) - (set :inline t - (const new-file) - (const open-file) - (const dired) - (const kill-buffer) - (const save-buffer) - (const write-file) - (const undo) - (const cut) - (const copy) - (const paste) - (const search-forward) - (const print-buffer) - (const customize) - (const help)) - (repeat :inline t - :tag "Other" - (symbol :tag "Icon item"))))) - -(defcustom gmm-tool-bar-style - (if (and (boundp 'tool-bar-mode) - tool-bar-mode - (not (memq (display-visual-class) - (list 'static-gray 'gray-scale - 'static-color 'pseudo-color)))) - 'gnome - 'retro) - "Preferred tool bar style." - :type '(choice (const :tag "GNOME style" gnome) - (const :tag "Retro look" retro))) +(defvar gmm-tool-bar-style 'gnome) +(make-obsolete-variable 'gmm-tool-bar-style nil "29.1") (defvar tool-bar-map) diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 550f4e940a..04d19e29a3 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -983,66 +983,36 @@ simple manner." (gnus-run-hooks 'gnus-group-menu-hook))) - (defvar gnus-group-tool-bar-map nil) -(defun gnus-group-tool-bar-update (&optional symbol value) - "Update group buffer toolbar. -Setter function for custom variables." - (when symbol - (set-default symbol value)) - ;; (setq-default gnus-group-tool-bar-map nil) - ;; (use-local-map gnus-group-mode-map) - (when (gnus-alive-p) - (with-current-buffer gnus-group-buffer - (gnus-group-make-tool-bar t)))) - -(defcustom gnus-group-tool-bar (if (eq gmm-tool-bar-style 'gnome) - 'gnus-group-tool-bar-gnome - 'gnus-group-tool-bar-retro) - "Specifies the Gnus group tool bar. - -It can be either a list or a symbol referring to a list. See -`gmm-tool-bar-from-list' for the format of the list. The -default key map is `gnus-group-mode-map'. - -Pre-defined symbols include `gnus-group-tool-bar-gnome' and -`gnus-group-tool-bar-retro'." - :type '(choice (const :tag "GNOME style" gnus-group-tool-bar-gnome) - (const :tag "Retro look" gnus-group-tool-bar-retro) - (repeat :tag "User defined list" gmm-tool-bar-item) - (symbol)) - :version "23.1" ;; No Gnus - :initialize 'custom-initialize-default - :set 'gnus-group-tool-bar-update - :group 'gnus-group) - -(defcustom gnus-group-tool-bar-gnome +(defcustom gnus-group-tool-bar '((gnus-group-post-news "mail/compose") ;; Some useful agent icons? I don't use the agent so agent users should ;; suggest useful commands: - (gnus-agent-toggle-plugged "unplugged" t - :help "Gnus is currently unplugged. Click to work online." - :visible (and gnus-agent (not gnus-plugged))) - (gnus-agent-toggle-plugged "plugged" t - :help "Gnus is currently plugged. Click to work offline." - :visible (and gnus-agent gnus-plugged)) - ;; FIXME: gnus-agent-toggle-plugged (in gnus-agent-group-make-menu-bar) - ;; should have a better help text. - (gnus-group-send-queue "mail/outbox" t - :visible (and gnus-agent gnus-plugged) - :help "Send articles from the queue group") - (gnus-group-get-new-news "mail/inbox" nil - :visible (or (not gnus-agent) - gnus-plugged)) - ;; FIXME: gnus-*-read-group should have a better help text. - (gnus-topic-read-group "open" nil - :visible (and (boundp 'gnus-topic-mode) - gnus-topic-mode)) - (gnus-group-read-group "open" nil - :visible (not (and (boundp 'gnus-topic-mode) - gnus-topic-mode))) - ;; (gnus-group-find-new-groups "???" nil) + (gnus-agent-toggle-plugged + "unplugged" t + :help "Gnus is currently unplugged. Click to work online." + :visible (and gnus-agent (not gnus-plugged))) + (gnus-agent-toggle-plugged + "plugged" t + :help "Gnus is currently plugged. Click to work offline." + :visible (and gnus-agent gnus-plugged)) + (gnus-group-send-queue + "mail/outbox" t + :visible (and gnus-agent gnus-plugged) + :help "Send articles from the queue group") + (gnus-group-get-new-news + "mail/inbox" nil + :visible (or (not gnus-agent) + gnus-plugged)) + (gnus-topic-read-group + "open" nil + :visible (and (boundp 'gnus-topic-mode) + gnus-topic-mode)) + (gnus-group-read-group + "open" nil + :visible (not (and (boundp 'gnus-topic-mode) + gnus-topic-mode))) (gnus-group-save-newsrc "save") (gnus-group-describe-group "describe") (gnus-group-toggle-subscription-at-point "gnus/toggle-subscription") @@ -1051,44 +1021,22 @@ Pre-defined symbols include `gnus-group-tool-bar-gnome' and (gnus-group-exit "exit") (gmm-customize-mode "preferences" t :help "Edit mode preferences") (gnus-info-find-node "help")) - "List of functions for the group tool bar (GNOME style). - -See `gmm-tool-bar-from-list' for the format of the list." - :type '(repeat gmm-tool-bar-item) - :version "23.1" ;; No Gnus - :initialize 'custom-initialize-default - :set 'gnus-group-tool-bar-update - :group 'gnus-group) + "Specifies the Gnus group tool bar. -(defcustom gnus-group-tool-bar-retro - '((gnus-group-get-new-news "gnus/get-news") - (gnus-group-get-new-news-this-group "gnus/gnntg") - (gnus-group-catchup-current "gnus/catchup") - (gnus-group-describe-group "gnus/describe-group") - (gnus-group-subscribe "gnus/subscribe" t - :help "Subscribe to the current group") - (gnus-group-unsubscribe "gnus/unsubscribe" t - :help "Unsubscribe from the current group") - (gnus-group-exit "gnus/exit-gnus" gnus-group-mode-map)) - "List of functions for the group tool bar (retro look). - -See `gmm-tool-bar-from-list' for the format of the list." - :type '(repeat gmm-tool-bar-item) - :version "23.1" ;; No Gnus - :initialize 'custom-initialize-default - :set 'gnus-group-tool-bar-update +It can be either a list or a symbol referring to a list. See +`gmm-tool-bar-from-list' for the format of the list. The +default key map is `gnus-group-mode-map'." + :type '(choice (repeat :tag "User defined list" gmm-tool-bar-item) + (symbol)) + :version "29.1" :group 'gnus-group) -(defcustom gnus-group-tool-bar-zap-list t - "List of icon items from the global tool bar. -These items are not displayed in the Gnus group mode tool bar. - -See `gmm-tool-bar-from-list' for the format of the list." - :type 'gmm-tool-bar-zap-list - :version "23.1" ;; No Gnus - :initialize 'custom-initialize-default - :set 'gnus-group-tool-bar-update - :group 'gnus-group) +(defvar gnus-group-tool-bar-gnome nil) +(make-obsolete-variable 'gnus-group-tool-bar-gnome nil "29.1") +(defvar gnus-group-tool-bar-retro nil) +(make-obsolete-variable 'gnus-group-tool-bar-retro nil "29.1") +(defvar gnus-group-tool-bar-zap-list t) +(make-obsolete-variable 'gnus-group-tool-bar-zap-list nil "29.1") (defvar image-load-path) (defvar tool-bar-map) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index d2221eb41c..a4f98c9157 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -2887,45 +2887,11 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs)))) (defvar gnus-summary-tool-bar-map nil) -;; Note: The :set function in the `gnus-summary-tool-bar*' variables will only -;; affect _new_ message buffers. We might add a function that walks thru all -;; summary-mode buffers and force the update. -(defun gnus-summary-tool-bar-update (&optional symbol value) - "Update summary mode toolbar. -Setter function for custom variables." - (setq-default gnus-summary-tool-bar-map nil) - (when symbol - ;; When used as ":set" function: - (set-default symbol value)) - (when (gnus-buffer-live-p gnus-summary-buffer) - (with-current-buffer gnus-summary-buffer - (gnus-summary-make-tool-bar)))) - -(defcustom gnus-summary-tool-bar (if (eq gmm-tool-bar-style 'gnome) - 'gnus-summary-tool-bar-gnome - 'gnus-summary-tool-bar-retro) - "Specifies the Gnus summary tool bar. - -It can be either a list or a symbol referring to a list. See -`gmm-tool-bar-from-list' for the format of the list. The -default key map is `gnus-summary-mode-map'. - -Pre-defined symbols include `gnus-summary-tool-bar-gnome' and -`gnus-summary-tool-bar-retro'." - :type '(choice (const :tag "GNOME style" gnus-summary-tool-bar-gnome) - (const :tag "Retro look" gnus-summary-tool-bar-retro) - (repeat :tag "User defined list" gmm-tool-bar-item) - (symbol)) - :version "23.1" ;; No Gnus - :initialize 'custom-initialize-default - :set 'gnus-summary-tool-bar-update - :group 'gnus-summary) - -(defcustom gnus-summary-tool-bar-gnome +(defcustom gnus-summary-tool-bar '((gnus-summary-post-news "mail/compose" nil) - (gnus-summary-insert-new-articles "mail/inbox" nil - :visible (or (not gnus-agent) - gnus-plugged)) + (gnus-summary-insert-new-articles + "mail/inbox" nil + :visible (or (not gnus-agent) gnus-plugged)) (gnus-summary-reply-with-original "mail/reply") (gnus-summary-reply "mail/reply" nil :visible nil) (gnus-summary-followup-with-original "mail/reply-all") @@ -2935,17 +2901,10 @@ Pre-defined symbols include `gnus-summary-tool-bar-gnome' and (gnus-summary-search-article-forward "search" nil :visible nil) (gnus-summary-print-article "print") (gnus-summary-tick-article-forward "flag-followup" nil :visible nil) - ;; Some new commands that may need more suitable icons: (gnus-summary-save-newsrc "save" nil :visible nil) - ;; (gnus-summary-show-article "stock_message-display" nil :visible nil) (gnus-summary-prev-article "left-arrow") (gnus-summary-next-article "right-arrow") (gnus-summary-next-page "next-page") - ;; (gnus-summary-enter-digest-group "right_arrow" nil :visible nil) - ;; - ;; Maybe some sort-by-... could be added: - ;; (gnus-summary-sort-by-author "sort-a-z" nil :visible nil) - ;; (gnus-summary-sort-by-date "sort-1-9" nil :visible nil) (gnus-summary-mark-as-expirable "delete" nil :visible (gnus-check-backend-function 'request-expire-articles @@ -2959,64 +2918,25 @@ Pre-defined symbols include `gnus-summary-tool-bar-gnome' and "mail/not-spam" nil :visible (and (fboundp 'spam-group-spam-contents-p) (spam-group-spam-contents-p gnus-newsgroup-name))) - ;; (gnus-summary-exit "exit") (gmm-customize-mode "preferences" t :help "Edit mode preferences") (gnus-info-find-node "help")) - "List of functions for the summary tool bar (GNOME style). - -See `gmm-tool-bar-from-list' for the format of the list." - :type '(repeat gmm-tool-bar-item) - :version "23.1" ;; No Gnus - :initialize 'custom-initialize-default - :set 'gnus-summary-tool-bar-update - :group 'gnus-summary) + "Specifies the Gnus summary tool bar. -(defcustom gnus-summary-tool-bar-retro - '((gnus-summary-prev-unread-article "gnus/prev-ur") - (gnus-summary-next-unread-article "gnus/next-ur") - (gnus-summary-post-news "gnus/post") - (gnus-summary-followup-with-original "gnus/fuwo") - (gnus-summary-followup "gnus/followup") - (gnus-summary-reply-with-original "gnus/reply-wo") - (gnus-summary-reply "gnus/reply") - (gnus-summary-caesar-message "gnus/rot13") - (gnus-uu-decode-uu "gnus/uu-decode") - (gnus-summary-save-article-file "gnus/save-aif") - (gnus-summary-save-article "gnus/save-art") - (gnus-uu-post-news "gnus/uu-post") - (gnus-summary-catchup "gnus/catchup") - (gnus-summary-catchup-and-exit "gnus/cu-exit") - (gnus-summary-exit "gnus/exit-summ") - ;; Some new command that may need more suitable icons: - (gnus-summary-print-article "gnus/print" nil :visible nil) - (gnus-summary-mark-as-expirable "gnus/close" nil :visible nil) - (gnus-summary-save-newsrc "gnus/save" nil :visible nil) - ;; (gnus-summary-enter-digest-group "gnus/right_arrow" nil :visible nil) - (gnus-summary-search-article-forward "gnus/search" nil :visible nil) - ;; (gnus-summary-insert-new-articles "gnus/paste" nil :visible nil) - ;; (gnus-summary-toggle-threads "gnus/open" nil :visible nil) - ;; - (gnus-info-find-node "gnus/help" nil :visible nil)) - "List of functions for the summary tool bar (retro look). - -See `gmm-tool-bar-from-list' for the format of the list." - :type '(repeat gmm-tool-bar-item) - :version "23.1" ;; No Gnus - :initialize 'custom-initialize-default - :set 'gnus-summary-tool-bar-update +It can be either a list or a symbol referring to a list. See +`gmm-tool-bar-from-list' for the format of the list. The +default key map is `gnus-summary-mode-map'." + :type '(choice (repeat :tag "User defined list" gmm-tool-bar-item) + (symbol)) + :version "29.1" :group 'gnus-summary) -(defcustom gnus-summary-tool-bar-zap-list t - "List of icon items from the global tool bar. -These items are not displayed in the Gnus summary mode tool bar. - -See `gmm-tool-bar-from-list' for the format of the list." - :type 'gmm-tool-bar-zap-list - :version "23.1" ;; No Gnus - :initialize 'custom-initialize-default - :set 'gnus-summary-tool-bar-update - :group 'gnus-summary) +(defvar gnus-summary-tool-bar-gnome nil) +(make-obsolete-variable 'gnus-summary-tool-bar-gnome nil "29.1") +(defvar gnus-summary-tool-bar-retro nil) +(make-obsolete-variable 'gnus-summary-tool-bar-retro nil "29.1") +(defvar gnus-summary-tool-bar-zap-list t) +(make-obsolete-variable 'gnus-summary-tool-bar-zap-list nil "29.1") (defvar image-load-path) (defvar tool-bar-map) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index cc994d3ba5..e7dc089a3c 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -8167,39 +8167,7 @@ which specify the range to operate on." ;; Support for toolbar (defvar tool-bar-mode) -;; Note: The :set function in the `message-tool-bar*' variables will only -;; affect _new_ message buffers. We might add a function that walks thru all -;; message-mode buffers and force the update. -(defun message-tool-bar-update (&optional symbol value) - "Update message mode toolbar. -Setter function for custom variables." - (setq-default message-tool-bar-map nil) - (when symbol - ;; When used as ":set" function: - (set-default symbol value))) - -(defcustom message-tool-bar (if (eq gmm-tool-bar-style 'gnome) - 'message-tool-bar-gnome - 'message-tool-bar-retro) - "Specifies the message mode tool bar. - -It can be either a list or a symbol referring to a list. See -`gmm-tool-bar-from-list' for the format of the list. The -default key map is `message-mode-map'. - -Pre-defined symbols include `message-tool-bar-gnome' and -`message-tool-bar-retro'." - :type '(repeat gmm-tool-bar-list-item) - :type '(choice (const :tag "GNOME style" message-tool-bar-gnome) - (const :tag "Retro look" message-tool-bar-retro) - (repeat :tag "User defined list" gmm-tool-bar-item) - (symbol)) - :version "23.1" ;; No Gnus - :initialize #'custom-initialize-default - :set #'message-tool-bar-update - :group 'message) - -(defcustom message-tool-bar-gnome +(defcustom message-tool-bar '((ispell-message "spell" nil :vert-only t :visible (not flyspell-mode)) @@ -8215,47 +8183,23 @@ Pre-defined symbols include `message-tool-bar-gnome' and (message-insert-importance-high "important" nil :visible nil) (message-insert-importance-low "unimportant" nil :visible nil) (message-insert-disposition-notification-to "receipt" nil :visible nil)) - "List of items for the message tool bar (GNOME style). - -See `gmm-tool-bar-from-list' for details on the format of the list." - :type '(repeat gmm-tool-bar-item) - :version "23.1" ;; No Gnus - :initialize #'custom-initialize-default - :set #'message-tool-bar-update - :group 'message) + "Specifies the message mode tool bar. -(defcustom message-tool-bar-retro - '(;; Old Emacs 21 icon for consistency. - (message-send-and-exit "mail/send") - (message-kill-buffer "close") - (message-dont-send "cancel") - (mml-attach-file "attach" mml-mode-map) - (ispell-message "spell") - (mml-preview "preview" mml-mode-map) - (message-insert-importance-high "gnus/important") - (message-insert-importance-low "gnus/unimportant") - (message-insert-disposition-notification-to "gnus/receipt")) - "List of items for the message tool bar (retro style). - -See `gmm-tool-bar-from-list' for details on the format of the list." - :type '(repeat gmm-tool-bar-item) - :version "23.1" ;; No Gnus - :initialize #'custom-initialize-default - :set #'message-tool-bar-update +It can be either a list or a symbol referring to a list. See +`gmm-tool-bar-from-list' for the format of the list. The +default key map is `message-mode-map'." + :type '(repeat gmm-tool-bar-list-item) + :type '(choice (repeat :tag "User defined list" gmm-tool-bar-item) + (symbol)) + :version "29.1" :group 'message) -(defcustom message-tool-bar-zap-list - '(new-file open-file dired kill-buffer write-file - print-buffer customize help) - "List of icon items from the global tool bar. -These items are not displayed on the message mode tool bar. - -See `gmm-tool-bar-from-list' for the format of the list." - :type 'gmm-tool-bar-zap-list - :version "23.1" ;; No Gnus - :initialize #'custom-initialize-default - :set #'message-tool-bar-update - :group 'message) +(defvar message-tool-bar-gnome nil) +(make-obsolete-variable 'message-tool-bar-gnome nil "29.1") +(defvar message-tool-bar-retro nil) +(make-obsolete-variable 'message-tool-bar-gnome nil "29.1") +(defvar message-tool-bar-zap-list t) +(make-obsolete-variable 'message-tool-bar-zap-list nil "29.1") (defvar image-load-path) (declare-function image-load-path-for-library "image" commit 1e46487e4efb817da38d635dad20044f70003e57 Author: Andreas Schwab Date: Sat Apr 30 14:46:28 2022 +0200 * lisp/gnus/deuglify.el (gnus-article-outlook-rearrange-citation): Add autoload cookie. diff --git a/lisp/gnus/deuglify.el b/lisp/gnus/deuglify.el index d2edfdf09f..732c6062b8 100644 --- a/lisp/gnus/deuglify.el +++ b/lisp/gnus/deuglify.el @@ -439,6 +439,7 @@ If NODISPLAY is non-nil, don't redisplay the article buffer." (unless nodisplay (gnus-outlook-display-article-buffer)) attrib-start)) +;;;###autoload (defun gnus-article-outlook-rearrange-citation (&optional nodisplay) "Repair broken citations. If NODISPLAY is non-nil, don't redisplay the article buffer." commit 655d2319bc50ee09d4acaf9ce90809f9476d8674 Author: Lars Ingebrigtsen Date: Sat Apr 30 17:38:34 2022 +0200 Use x-show-tooltip-timeout in all the implementations * src/haikufns.c (Fx_show_tip): Use the timeout variable. * src/pgtkfns.c (Fx_show_tip): Ditto. * src/w32fns.c (Fx_show_tip): Ditto. * src/xfns.c (Fx_show_tip): Doc fix. diff --git a/src/haikufns.c b/src/haikufns.c index fb79066b77..f7c17567b1 100644 --- a/src/haikufns.c +++ b/src/haikufns.c @@ -2021,9 +2021,8 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, f = decode_window_system_frame (frame); if (NILP (timeout)) - timeout = make_fixnum (5); - else - CHECK_FIXNAT (timeout); + timeout = Vx_show_tooltip_timeout; + CHECK_FIXNAT (timeout); if (NILP (dx)) dx = make_fixnum (5); diff --git a/src/pgtkfns.c b/src/pgtkfns.c index d1a72804cf..a0fcf70f31 100644 --- a/src/pgtkfns.c +++ b/src/pgtkfns.c @@ -3092,7 +3092,8 @@ PARMS is an optional list of frame parameters which can be used to change the tooltip's appearance. Automatically hide the tooltip after TIMEOUT seconds. TIMEOUT nil -means use the default timeout of 5 seconds. +means use the default timeout from the `x-show-tooltip-timeout' +variable. If the list of frame parameters PARMS contains a `left' parameter, display the tooltip at that x-position. If the list of frame parameters @@ -3138,9 +3139,8 @@ Text larger than the specified size is clipped. */) return unbind_to (count, Qnil); if (NILP (timeout)) - timeout = make_fixnum (5); - else - CHECK_FIXNAT (timeout); + timeout = Vx_show_tooltip_timeout; + CHECK_FIXNAT (timeout); if (NILP (dx)) dx = make_fixnum (5); diff --git a/src/w32fns.c b/src/w32fns.c index ead1549d55..0f25c1a594 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -7366,9 +7366,8 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, decode_window_system_frame (frame); if (NILP (timeout)) - timeout = make_fixnum (5); - else - CHECK_FIXNAT (timeout); + timeout = Vx_show_tooltip_timeout; + CHECK_FIXNAT (timeout); if (NILP (dx)) dx = make_fixnum (5); diff --git a/src/xfns.c b/src/xfns.c index 24c3c26022..8f17ee67cd 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -8292,7 +8292,8 @@ PARMS is an optional list of frame parameters which can be used to change the tooltip's appearance. Automatically hide the tooltip after TIMEOUT seconds. TIMEOUT nil -means use the default timeout from the `x-show-tooltip-timeout'. +means use the default timeout from the `x-show-tooltip-timeout' +variable. If the list of frame parameters PARMS contains a `left' parameter, display the tooltip at that x-position. If the list of frame parameters commit 86b6a69f8614663172c64a3f51ffce39526e7ca9 Author: Lars Ingebrigtsen Date: Sat Apr 30 17:09:02 2022 +0200 Don't hard code the default x-show-tip timeout * src/xfns.c (Fx_show_tip): Use it. (syms_of_xfns): Add a new x-show-tooltip-timeout variable (bug#23341). diff --git a/etc/NEWS b/etc/NEWS index 1c943bfd64..eebde1b4d0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1529,6 +1529,12 @@ functions. * Lisp Changes in Emacs 29.1 +--- +** 'x-show-tip' no longer hard-codes a timeout default. +The new 'x-show-tooltip-timeout' variable allows the user to alter +this for packages that don't use 'tooltip-show', but instead calls the +lower level function directly. + +++ ** New function 'window-max-characters-per-line'. diff --git a/src/xfns.c b/src/xfns.c index c7e2984ce1..24c3c26022 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -8292,7 +8292,7 @@ PARMS is an optional list of frame parameters which can be used to change the tooltip's appearance. Automatically hide the tooltip after TIMEOUT seconds. TIMEOUT nil -means use the default timeout of 5 seconds. +means use the default timeout from the `x-show-tooltip-timeout'. If the list of frame parameters PARMS contains a `left' parameter, display the tooltip at that x-position. If the list of frame parameters @@ -8338,9 +8338,8 @@ Text larger than the specified size is clipped. */) f = decode_window_system_frame (frame); if (NILP (timeout)) - timeout = make_fixnum (5); - else - CHECK_FIXNAT (timeout); + timeout = Vx_show_tooltip_timeout; + CHECK_FIXNAT (timeout); if (NILP (dx)) dx = make_fixnum (5); @@ -9727,6 +9726,10 @@ eliminated in future versions of Emacs. */); } #endif + DEFVAR_LISP ("x-show-tooltip-timeout", Vx_show_tooltip_timeout, + doc: /* The default timeout (in seconds) for `x-show-tip'. */); + Vx_show_tooltip_timeout = make_fixnum (5); + /* X window properties. */ defsubr (&Sx_change_window_property); defsubr (&Sx_delete_window_property); commit b05a103ea7a26b2f4099a613015d9f1abdc39a4d Author: Lars Ingebrigtsen Date: Sat Apr 30 16:42:44 2022 +0200 Move the when-let family of macros to subr.el * lisp/subr.el (internal--build-binding) (internal--build-bindings): Moved from subr-x.el and rewritten to not use the threading macro. (if-let*, when-let*, and-let*, if-let, when-let): Moved from subr-x.el. This avoids breaking the build every time somebody uses these macros in functions that end up being called during bootstrap. diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index abf85ab6c6..6c763bd04d 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -81,116 +81,6 @@ Note how the single `-' got converted into a list before threading." (declare (indent 0) (debug thread-first)) `(internal--thread-argument nil ,@forms)) - -(defsubst internal--listify (elt) - "Wrap ELT in a list if it is not one. -If ELT is of the form ((EXPR)), listify (EXPR) with a dummy symbol." - (cond - ((symbolp elt) (list elt elt)) - ((null (cdr elt)) - (list (make-symbol "s") (car elt))) - (t elt))) - -(defsubst internal--check-binding (binding) - "Check BINDING is properly formed." - (when (> (length binding) 2) - (signal - 'error - (cons "`let' bindings can have only one value-form" binding))) - binding) - -(defsubst internal--build-binding-value-form (binding prev-var) - "Build the conditional value form for BINDING using PREV-VAR." - (let ((var (car binding))) - `(,var (and ,prev-var ,(cadr binding))))) - -(defun internal--build-binding (binding prev-var) - "Check and build a single BINDING with PREV-VAR." - (thread-first - binding - internal--listify - internal--check-binding - (internal--build-binding-value-form prev-var))) - -(defun internal--build-bindings (bindings) - "Check and build conditional value forms for BINDINGS." - (let ((prev-var t)) - (mapcar (lambda (binding) - (let ((binding (internal--build-binding binding prev-var))) - (setq prev-var (car binding)) - binding)) - bindings))) - -(defmacro if-let* (varlist then &rest else) - "Bind variables according to VARLIST and evaluate THEN or ELSE. -This is like `if-let' but doesn't handle a VARLIST of the form -\(SYMBOL SOMETHING) specially." - (declare (indent 2) - (debug ((&rest [&or symbolp (symbolp form) (form)]) - body))) - (if varlist - `(let* ,(setq varlist (internal--build-bindings varlist)) - (if ,(caar (last varlist)) - ,then - ,@else)) - `(let* () ,then))) - -(defmacro when-let* (varlist &rest body) - "Bind variables according to VARLIST and conditionally evaluate BODY. -This is like `when-let' but doesn't handle a VARLIST of the form -\(SYMBOL SOMETHING) specially." - (declare (indent 1) (debug if-let*)) - (list 'if-let* varlist (macroexp-progn body))) - -(defmacro and-let* (varlist &rest body) - "Bind variables according to VARLIST and conditionally evaluate BODY. -Like `when-let*', except if BODY is empty and all the bindings -are non-nil, then the result is non-nil." - (declare (indent 1) (debug if-let*)) - (let (res) - (if varlist - `(let* ,(setq varlist (internal--build-bindings varlist)) - (when ,(setq res (caar (last varlist))) - ,@(or body `(,res)))) - `(let* () ,@(or body '(t)))))) - -;;;###autoload -(defmacro if-let (spec then &rest else) - "Bind variables according to SPEC and evaluate THEN or ELSE. -Evaluate each binding in turn, as in `let*', stopping if a -binding value is nil. If all are non-nil return the value of -THEN, otherwise the last form in ELSE. - -Each element of SPEC is a list (SYMBOL VALUEFORM) that binds -SYMBOL to the value of VALUEFORM. An element can additionally be -of the form (VALUEFORM), which is evaluated and checked for nil; -i.e. SYMBOL can be omitted if only the test result is of -interest. It can also be of the form SYMBOL, then the binding of -SYMBOL is checked for nil. - -As a special case, interprets a SPEC of the form \(SYMBOL SOMETHING) -like \((SYMBOL SOMETHING)). This exists for backward compatibility -with an old syntax that accepted only one binding." - (declare (indent 2) - (debug ([&or (symbolp form) ; must be first, Bug#48489 - (&rest [&or symbolp (symbolp form) (form)])] - body))) - (when (and (<= (length spec) 2) - (not (listp (car spec)))) - ;; Adjust the single binding case - (setq spec (list spec))) - (list 'if-let* spec then (macroexp-progn else))) - -;;;###autoload -(defmacro when-let (spec &rest body) - "Bind variables according to SPEC and conditionally evaluate BODY. -Evaluate each binding in turn, stopping if a binding value is nil. -If all are non-nil, return the value of the last form in BODY. - -The variable list SPEC is the same as in `if-let'." - (declare (indent 1) (debug if-let)) - (list 'if-let spec (macroexp-progn body))) - (defsubst hash-table-empty-p (hash-table) "Check whether HASH-TABLE is empty (has 0 elements)." (zerop (hash-table-count hash-table))) diff --git a/lisp/subr.el b/lisp/subr.el index 5fadac6e16..d4f5d0d23b 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2371,6 +2371,102 @@ Affects only hooks run in the current buffer." (let ((delay-mode-hooks t)) ,@body))) +;;; `when-let' and friends. + +(defun internal--build-binding (binding prev-var) + "Check and build a single BINDING with PREV-VAR." + (setq binding + (cond + ((symbolp binding) + (list binding binding)) + ((null (cdr binding)) + (list (make-symbol "s") (car binding))) + (t binding))) + (when (> (length binding) 2) + (signal 'error + (cons "`let' bindings can have only one value-form" binding))) + (let ((var (car binding))) + `(,var (and ,prev-var ,(cadr binding))))) + +(defun internal--build-bindings (bindings) + "Check and build conditional value forms for BINDINGS." + (let ((prev-var t)) + (mapcar (lambda (binding) + (let ((binding (internal--build-binding binding prev-var))) + (setq prev-var (car binding)) + binding)) + bindings))) + +(defmacro if-let* (varlist then &rest else) + "Bind variables according to VARLIST and evaluate THEN or ELSE. +This is like `if-let' but doesn't handle a VARLIST of the form +\(SYMBOL SOMETHING) specially." + (declare (indent 2) + (debug ((&rest [&or symbolp (symbolp form) (form)]) + body))) + (if varlist + `(let* ,(setq varlist (internal--build-bindings varlist)) + (if ,(caar (last varlist)) + ,then + ,@else)) + `(let* () ,then))) + +(defmacro when-let* (varlist &rest body) + "Bind variables according to VARLIST and conditionally evaluate BODY. +This is like `when-let' but doesn't handle a VARLIST of the form +\(SYMBOL SOMETHING) specially." + (declare (indent 1) (debug if-let*)) + (list 'if-let* varlist (macroexp-progn body))) + +(defmacro and-let* (varlist &rest body) + "Bind variables according to VARLIST and conditionally evaluate BODY. +Like `when-let*', except if BODY is empty and all the bindings +are non-nil, then the result is non-nil." + (declare (indent 1) (debug if-let*)) + (let (res) + (if varlist + `(let* ,(setq varlist (internal--build-bindings varlist)) + (when ,(setq res (caar (last varlist))) + ,@(or body `(,res)))) + `(let* () ,@(or body '(t)))))) + +(defmacro if-let (spec then &rest else) + "Bind variables according to SPEC and evaluate THEN or ELSE. +Evaluate each binding in turn, as in `let*', stopping if a +binding value is nil. If all are non-nil return the value of +THEN, otherwise the last form in ELSE. + +Each element of SPEC is a list (SYMBOL VALUEFORM) that binds +SYMBOL to the value of VALUEFORM. An element can additionally be +of the form (VALUEFORM), which is evaluated and checked for nil; +i.e. SYMBOL can be omitted if only the test result is of +interest. It can also be of the form SYMBOL, then the binding of +SYMBOL is checked for nil. + +As a special case, interprets a SPEC of the form \(SYMBOL SOMETHING) +like \((SYMBOL SOMETHING)). This exists for backward compatibility +with an old syntax that accepted only one binding." + (declare (indent 2) + (debug ([&or (symbolp form) ; must be first, Bug#48489 + (&rest [&or symbolp (symbolp form) (form)])] + body))) + (when (and (<= (length spec) 2) + (not (listp (car spec)))) + ;; Adjust the single binding case + (setq spec (list spec))) + (list 'if-let* spec then (macroexp-progn else))) + +(defmacro when-let (spec &rest body) + "Bind variables according to SPEC and conditionally evaluate BODY. +Evaluate each binding in turn, stopping if a binding value is nil. +If all are non-nil, return the value of the last form in BODY. + +The variable list SPEC is the same as in `if-let'." + (declare (indent 1) (debug if-let)) + (list 'if-let spec (macroexp-progn body))) + + + ;; PUBLIC: find if the current mode derives from another. (defun provided-mode-derived-p (mode &rest modes) commit 93549c2b28770a84e1d1b9478a0861e2050df602 Author: Lars Ingebrigtsen Date: Sat Apr 30 16:24:55 2022 +0200 Avoid using if-let in subr.el * lisp/subr.el (string-lines): Avoid using if-let (from subr-x) in subr (bug#55194). diff --git a/lisp/subr.el b/lisp/subr.el index 14cab04d42..5fadac6e16 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -6654,27 +6654,30 @@ lines." (let ((lines nil) (start 0)) (while (< start (length string)) - (if-let ((newline (string-search "\n" string start))) - (progn - (when (or (not omit-nulls) - (not (= start newline))) - (let ((line (substring string start - (if keep-newlines - (1+ newline) - newline)))) - (when (not (and keep-newlines omit-nulls - (equal line "\n"))) - (push line lines)))) - (setq start (1+ newline)) - ;; Include the final newline. - (when (and (= start (length string)) - (not omit-nulls) - (not keep-newlines)) - (push "" lines))) - (if (zerop start) - (push string lines) - (push (substring string start) lines)) - (setq start (length string)))) + (let ((newline (string-search "\n" string start))) + (if newline + (progn + (when (or (not omit-nulls) + (not (= start newline))) + (let ((line (substring string start + (if keep-newlines + (1+ newline) + newline)))) + (when (not (and keep-newlines omit-nulls + (equal line "\n"))) + (push line lines)))) + (setq start (1+ newline)) + ;; Include the final newline. + (when (and (= start (length string)) + (not omit-nulls) + (not keep-newlines)) + (push "" lines))) + ;; No newline in the remaining part. + (if (zerop start) + ;; Avoid a string copy if there are no newlines at all. + (push string lines) + (push (substring string start) lines)) + (setq start (length string))))) (nreverse lines))) (defun buffer-match-p (condition buffer-or-name &optional arg) commit c1fa5bd8ee3c7f37a9b9304eab6b522cf8718472 Author: Eli Zaretskii Date: Sat Apr 30 14:54:35 2022 +0300 ; * doc/lispref/strings.texi (Creating Strings): Fix a typo. diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index 6f620c9d76..5e41f8d57b 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi @@ -436,9 +436,10 @@ display purposes; use @code{truncate-string-to-width} or @defun string-lines string &optional omit-nulls keep-newlines Split @var{string} into a list of strings on newline boundaries. If -@var{omit-nulls}, remove empty lines from the results. if -@var{keep-newlines}, don't remove the trailing newlines from the -result strings. +the optional argument @var{omit-nulls} is non-@code{nil}, remove empty +lines from the results. If the optional argument @var{keep-newlines} +is non-@code{nil}, don't remove the trailing newlines from the result +strings. @end defun @defun string-pad string length &optional padding start commit 4290f64dc9948264b5d9bdad2330ee15aafe6589 Author: Lars Ingebrigtsen Date: Sat Apr 30 13:38:04 2022 +0200 Make the xref--button-map more regular * lisp/progmodes/xref.el (xref--button-map): Remove the mouse-1 binding (bug#35353). diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 6fa9a5c8d6..b379448cdb 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -965,8 +965,6 @@ beginning of the line." (defvar xref--button-map (let ((map (make-sparse-keymap))) - (when mouse-1-click-follows-link - (define-key map [mouse-1] #'xref-goto-xref)) (define-key map [follow-link] 'mouse-face) (define-key map [mouse-2] #'xref-select-and-show-xref) map)) commit 5a10e6377c2b97420e5617f114bb374d67ec1a58 Author: Jin Choi Date: Sat Apr 30 13:34:57 2022 +0200 Make Python evaluation work more reliably * lisp/progmodes/python.el (python-shell-buffer-substring): Make more regions valid Python code (bug#55174). Copyright-paperwork-exempt: yes diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index b7914655aa..11ed732d28 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3292,22 +3292,25 @@ the python shell: (goto-char start) (python-util-forward-comment 1) (current-indentation)))) - (fillstr (and (not no-cookie) - (not starts-at-point-min-p) - (concat - (format "# -*- coding: %s -*-\n" encoding) - (make-string - ;; Subtract 2 because of the coding cookie. - (- (line-number-at-pos start) 2) ?\n))))) + (fillstr (cond (starts-at-point-min-p + nil) + ((not no-cookie) + (concat + (format "# -*- coding: %s -*-\n" encoding) + (make-string + ;; Subtract 2 because of the coding cookie. + (- (line-number-at-pos start) 2) ?\n))) + (t + (make-string (- (line-number-at-pos start) 1) ?\n))))) (with-temp-buffer (python-mode) (when fillstr (insert fillstr)) - (insert substring) - (goto-char (point-min)) (when (not toplevel-p) - (insert "if True:") + (forward-line -1) + (insert "if True:\n") (delete-region (point) (line-end-position))) + (insert substring) (when nomain (let* ((if-name-main-start-end (and nomain diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 1a6a7dc176..01b233cc42 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -3503,10 +3503,7 @@ def foo(): (should (string= (python-shell-buffer-substring (python-tests-look-at "print ('a')") (point-max)) - "if True: - - print ('a') -")))) + "# -*- coding: utf-8 -*-\nif True:\n print ('a')\n\n")))) (ert-deftest python-shell-buffer-substring-11 () "Check substring from partial block and point within indentation." @@ -3521,10 +3518,7 @@ def foo(): (backward-char 1) (point)) (point-max)) - "if True: - - print ('a') -")))) + "# -*- coding: utf-8 -*-\nif True:\n print ('a')\n\n")))) (ert-deftest python-shell-buffer-substring-12 () "Check substring from partial block and point in whitespace." @@ -3539,13 +3533,7 @@ def foo(): (should (string= (python-shell-buffer-substring (python-tests-look-at "# Whitespace") (point-max)) - "if True: - - - # Whitespace - - print ('a') -")))) + "# -*- coding: utf-8 -*-\n\nif True:\n # Whitespace\n\n print ('a')\n\n")))) commit 2a2b3f583430df8495b566a1dfb1f41c4d61292f Author: Po Lu Date: Sat Apr 30 19:02:56 2022 +0800 Fix some cases of flicker on MS Windows * src/w32term.c (w32_read_socket): Fix typo in check before flipping buffers. diff --git a/src/w32term.c b/src/w32term.c index 11675085fc..19786da3a6 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -5976,7 +5976,7 @@ w32_read_socket (struct terminal *terminal, if (f && !w32_disable_double_buffering && FRAME_OUTPUT_DATA (f)->paint_buffer_dirty - && !f->garbaged && ignore_dirty_back_buffer) + && !f->garbaged && !ignore_dirty_back_buffer) w32_show_back_buffer (f); } commit 58398dea254dcfdab58d5439061a513b48cfe895 Author: Lars Ingebrigtsen Date: Sat Apr 30 12:56:18 2022 +0200 Truncate output from grep * doc/emacs/building.texi (Compilation): Document it. * lisp/progmodes/compile.el (compilation-max-output-line-length): New user option (bug#44983). (compilation-filter): Use it. (compilation--insert-abbreviated-line): New function. diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index 5b68b1ef9f..5bf4c8c739 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi @@ -138,6 +138,14 @@ of environment variable settings; each element should be a string of the form @code{"@var{envvarname}=@var{value}"}. These environment variable settings override the usual ones. +@vindex compilation-max-output-line-length + Displaying extremely long lines in compilation output can slow Emacs +down. Lines that are longer than +@code{compilation-max-output-line-length} will have the portion that's +exceeds that limit hidden behind a button that can be clicked on to +reveal the hidden portion. Set this variable to @code{nil} to never +hide anything. + @node Compilation Mode @section Compilation Mode diff --git a/etc/NEWS b/etc/NEWS index 30882ed2fe..1c943bfd64 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -672,6 +672,14 @@ script that was used in ancient South Asia. A new input method, * Changes in Specialized Modes and Packages in Emacs 29.1 +** Compile + ++++ +*** New user option 'compilation-max-output-line-length'. +Lines longer than this will have the ends hidden, with a button to +reveal the hidden text. This speeds up operations like grepping on +files that have few newlines. + ** Flymake +++ diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index e75a44b653..a621779f8c 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1752,6 +1752,13 @@ If nil, ask to kill it." :type 'boolean :version "24.3") +(defcustom compilation-max-output-line-length 400 + "Output lines that are longer than this value will be hidden. +If nil, don't hide anything." + :type '(choice (const :tag "Hide nothing" nil) + number) + :version "29.1") + (defun compilation--update-in-progress-mode-line () ;; `compilation-in-progress' affects the mode-line of all ;; buffers when it changes from nil to non-nil or vice-versa. @@ -2426,13 +2433,16 @@ and runs `compilation-filter-hook'." ;; We used to use `insert-before-markers', so that windows with ;; point at `process-mark' scroll along with the output, but we ;; now use window-point-insertion-type instead. - (insert string) + (if (not compilation-max-output-line-length) + (insert string) + (dolist (line (string-lines string nil t)) + (compilation--insert-abbreviated-line + line compilation-max-output-line-length))) (unless comint-inhibit-carriage-motion (comint-carriage-motion (process-mark proc) (point))) (set-marker (process-mark proc) (point)) ;; Update the number of errors in compilation-mode-line-errors (compilation--ensure-parse (point)) - ;; (setq-local compilation-buffer-modtime (current-time)) (run-hooks 'compilation-filter-hook)) (goto-char pos) (narrow-to-region min max) @@ -2440,6 +2450,40 @@ and runs `compilation-filter-hook'." (set-marker min nil) (set-marker max nil)))))) +(defun compilation--insert-abbreviated-line (string width) + (if (and (> (current-column) 0) + (get-text-property (1- (point)) 'button)) + ;; We already have an abbreviation; just add the string to it. + (let ((beg (point))) + (insert string) + (add-text-properties + beg + ;; Don't make the final newline invisible. + (if (= (aref string (1- (length string))) ?\n) + (1- (point)) + (point)) + (text-properties-at (1- beg)))) + (insert string) + ;; If we exceeded the limit, hide the last portion of the line. + (when (> (current-column) width) + (let ((start (save-excursion + (move-to-column width) + (point)))) + (buttonize-region + start (point) + (lambda (start) + (let ((inhibit-read-only t)) + (remove-text-properties start (save-excursion + (goto-char start) + (line-end-position)) + (text-properties-at start))))) + (put-text-property + start (if (= (aref string (1- (length string))) ?\n) + ;; Don't hide the final newline. + (1- (point)) + (point)) + 'display (if (char-displayable-p ?…) "[…]" "[...]")))))) + (defsubst compilation-buffer-internal-p () "Test if inside a compilation buffer." (local-variable-p 'compilation-locs)) commit 5acf75cec1c2cef383a7c022171f5a1d195c09ca Author: Lars Ingebrigtsen Date: Sat Apr 30 12:47:50 2022 +0200 Make grep-mode-font-lock-keywords more efficient * lisp/progmodes/grep.el (grep-mode-font-lock-keywords): Make the regexp less greedy so that long lines don't take forever to font-lock (bug#44983). diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 17905dec2e..7620536b4b 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -456,7 +456,7 @@ buffer `default-directory'." (defvar grep-mode-font-lock-keywords '(;; Command output lines. - (": \\(.+\\): \\(?:Permission denied\\|No such \\(?:file or directory\\|device or address\\)\\)$" + (": \\(.\\{,200\\}\\): \\(?:Permission denied\\|No such \\(?:file or directory\\|device or address\\)\\)$" 1 grep-error-face) ;; remove match from grep-regexp-alist before fontifying ("^Grep[/a-zA-Z]* started.*" commit aab5d7b3f3bb6fb82924aaabdfdd6e2a79ad3141 Author: Lars Ingebrigtsen Date: Sat Apr 30 12:46:40 2022 +0200 Add a KEEP-NEWLINES argument to string-lines * doc/lispref/strings.texi (Creating Strings): Document it. * lisp/subr.el (string-lines): Add a KEEP-NEWLINES argument. diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index d31807ad2a..6f620c9d76 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi @@ -434,9 +434,11 @@ display purposes; use @code{truncate-string-to-width} or (@pxref{Size of Displayed Text}). @end defun -@defun string-lines string &optional omit-nulls +@defun string-lines string &optional omit-nulls keep-newlines Split @var{string} into a list of strings on newline boundaries. If -@var{omit-nulls}, remove empty lines from the results. +@var{omit-nulls}, remove empty lines from the results. if +@var{keep-newlines}, don't remove the trailing newlines from the +result strings. @end defun @defun string-pad string length &optional padding start diff --git a/lisp/subr.el b/lisp/subr.el index 9623ea63b5..14cab04d42 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -6646,10 +6646,36 @@ is inserted before adjusting the number of empty lines." ((< (- (point) start) lines) (insert (make-string (- lines (- (point) start)) ?\n)))))) -(defun string-lines (string &optional omit-nulls) +(defun string-lines (string &optional omit-nulls keep-newlines) "Split STRING into a list of lines. -If OMIT-NULLS, empty lines will be removed from the results." - (split-string string "\n" omit-nulls)) +If OMIT-NULLS, empty lines will be removed from the results. +If KEEP-NEWLINES, don't strip trailing newlines from the result +lines." + (let ((lines nil) + (start 0)) + (while (< start (length string)) + (if-let ((newline (string-search "\n" string start))) + (progn + (when (or (not omit-nulls) + (not (= start newline))) + (let ((line (substring string start + (if keep-newlines + (1+ newline) + newline)))) + (when (not (and keep-newlines omit-nulls + (equal line "\n"))) + (push line lines)))) + (setq start (1+ newline)) + ;; Include the final newline. + (when (and (= start (length string)) + (not omit-nulls) + (not keep-newlines)) + (push "" lines))) + (if (zerop start) + (push string lines) + (push (substring string start) lines)) + (setq start (length string)))) + (nreverse lines))) (defun buffer-match-p (condition buffer-or-name &optional arg) "Return non-nil if BUFFER-OR-NAME matches CONDITION. diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index e027c68d0b..c431930c27 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -1028,5 +1028,27 @@ final or penultimate step during initialization.")) (should (readablep "foo")) (should-not (readablep (list (make-marker))))) +(ert-deftest test-string-lines () + (should (equal (string-lines "foo") '("foo"))) + (should (equal (string-lines "foo\n") '("foo" ""))) + (should (equal (string-lines "foo\nbar") '("foo" "bar"))) + + (should (equal (string-lines "foo" t) '("foo"))) + (should (equal (string-lines "foo\n" t) '("foo"))) + (should (equal (string-lines "foo\nbar" t) '("foo" "bar"))) + (should (equal (string-lines "foo\n\n\nbar" t) '("foo" "bar"))) + + (should (equal (string-lines "foo" nil t) '("foo"))) + (should (equal (string-lines "foo\n" nil t) '("foo\n"))) + (should (equal (string-lines "foo\nbar" nil t) '("foo\n" "bar"))) + (should (equal (string-lines "foo\n\n\nbar" nil t) + '("foo\n" "\n" "\n" "bar"))) + + (should (equal (string-lines "foo" t t) '("foo"))) + (should (equal (string-lines "foo\n" t t) '("foo\n"))) + (should (equal (string-lines "foo\nbar" t t) '("foo\n" "bar"))) + (should (equal (string-lines "foo\n\n\nbar" t t) + '("foo\n" "bar")))) + (provide 'subr-tests) ;;; subr-tests.el ends here commit 57447f5ce0a723f698d1515485860ca17ce93960 Author: Po Lu Date: Sat Apr 30 18:54:34 2022 +0800 Fix display updating inside the minibuffer on MS Windows * src/minibuf.c (read_minibuf): Call `w32_flip_buffers_if_dirty' after changing the cursor position and redisplaying instead of `flush_frame'. (bug#55193) * src/w32term.c (w32_flip_buffers_if_dirty): New function. * src/w32term.h: Update prototypes. diff --git a/src/minibuf.c b/src/minibuf.c index dacfd1255b..df82bcb121 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -34,6 +34,10 @@ along with GNU Emacs. If not, see . */ #include "systty.h" #include "pdumper.h" +#ifdef HAVE_NTGUI +#include "w32term.h" +#endif + /* List of buffers for use as minibuffers. The first element of the list is used for the outermost minibuffer invocation, the next element is used for a recursive minibuffer @@ -916,7 +920,17 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, XWINDOW (minibuf_window)->cursor.x = 0; XWINDOW (minibuf_window)->must_be_updated_p = true; update_frame (XFRAME (selected_frame), true, true); +#ifndef HAVE_NTGUI flush_frame (XFRAME (XWINDOW (minibuf_window)->frame)); +#else + /* The reason this function isn't `flush_display' in the RIF is + that `flush_frame' is also called in many other circumstances + when some code wants X requests to be sent to the X server, + but there is no corresponding "flush" concept on MS Windows, + and flipping buffers every time `flush_frame' is called + causes flicker. */ + w32_flip_buffers_if_dirty (XFRAME (XWINDOW (minibuf_window)->frame)); +#endif } /* Make minibuffer contents into a string. */ diff --git a/src/w32term.c b/src/w32term.c index 0c16dc1eef..11675085fc 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -774,6 +774,19 @@ w32_buffer_flipping_unblocked_hook (struct frame *f) w32_show_back_buffer (f); } +/* Flip buffers on F if drawing has happened. This function is not + called to flush the display connection of a frame (which doesn't + exist on MS Windows), but also called in some situations in + minibuf.c to make the contents of the back buffer visible. */ +void +w32_flip_buffers_if_dirty (struct frame *f) +{ + if (FRAME_OUTPUT_DATA (f)->paint_buffer + && FRAME_OUTPUT_DATA (f)->paint_buffer_dirty + && !f->garbaged && !buffer_flipping_blocked_p ()) + w32_show_back_buffer (f); +} + /* Draw truncation mark bitmaps, continuation mark bitmaps, overlay arrow bitmaps, or clear the fringes if no bitmaps are required before DESIRED_ROW is made current. This function is called from diff --git a/src/w32term.h b/src/w32term.h index 2dcc43fc59..88b7ec22bd 100644 --- a/src/w32term.h +++ b/src/w32term.h @@ -898,6 +898,7 @@ typedef char guichar_t; extern Lisp_Object w32_popup_dialog (struct frame *, Lisp_Object, Lisp_Object); extern void w32_arrow_cursor (void); extern void w32_release_paint_buffer (struct frame *); +extern void w32_flip_buffers_if_dirty (struct frame *); extern void syms_of_w32term (void); extern void syms_of_w32menu (void); commit 5fd54723536efca5589f9b9ac64825e76f0d1360 Author: Po Lu Date: Sat Apr 30 18:05:44 2022 +0800 Avoid server roundtrip on wheel events from scroll bars on XI2 * src/xterm.c (handle_one_xevent): Translate coordinates for scroll bars correctly when handling XI2 wheel events. diff --git a/src/xterm.c b/src/xterm.c index 6d658cf204..ea86b7f803 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -16863,6 +16863,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, double delta, scroll_unit; int scroll_height; Lisp_Object window; + struct scroll_bar *bar; + + bar = NULL; /* See the comment on top of x_init_master_valuators for more details on how @@ -16880,9 +16883,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (!f) { #if defined USE_MOTIF || !defined USE_TOOLKIT_SCROLL_BARS - struct scroll_bar *bar - = x_window_to_scroll_bar (xi_event->display, - xev->event, 2); + bar = x_window_to_scroll_bar (dpyinfo->display, + xev->event, 2); if (bar) f = WINDOW_XFRAME (XWINDOW (bar->window)); @@ -16899,11 +16901,26 @@ handle_one_xevent (struct x_display_info *dpyinfo, #endif if (FRAME_X_WINDOW (f) != xev->event) - XTranslateCoordinates (dpyinfo->display, - xev->event, FRAME_X_WINDOW (f), - lrint (xev->event_x), - lrint (xev->event_y), - &real_x, &real_y, &dummy); + { + if (!bar) + bar = x_window_to_scroll_bar (dpyinfo->display, xev->event, 2); + + /* If this is a scroll bar, compute the + actual position directly to avoid an + extra roundtrip. */ + + if (bar) + { + real_x = lrint (xev->event_x + bar->left); + real_y = lrint (xev->event_y + bar->top); + } + else + XTranslateCoordinates (dpyinfo->display, + xev->event, FRAME_X_WINDOW (f), + lrint (xev->event_x), + lrint (xev->event_y), + &real_x, &real_y, &dummy); + } else { real_x = lrint (xev->event_x); commit 7b7a124afa0a71f4847ddc5a3934b02ab5d46d2c Author: Eli Zaretskii Date: Sat Apr 30 12:35:48 2022 +0300 ; * src/w32term.c (w32_read_socket): Add comment for recent change. diff --git a/src/w32term.c b/src/w32term.c index 8a98d2f1c6..0c16dc1eef 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -5423,6 +5423,15 @@ w32_read_socket (struct terminal *terminal, window = window_from_coordinates (f, x, y, 0, 1, 1); if (EQ (window, f->tool_bar_window) + /* Make sure the tool bar was previously + pressed, otherwise an event that started + outside of the tool bar will not be handled + correctly when the mouse button is + released. For example, start dragging to + select some buffer text, drag the mouse to + the tool bar, and release the mouse button + -- this should not consider the release + event as a tool-bar click. */ && (inev.modifiers & down_modifier || f->last_tool_bar_item != -1)) { commit 03561b4aad87bbc32131e026e253628e8cef9f2f Author: Eli Zaretskii Date: Sat Apr 30 12:00:33 2022 +0300 ; Minor fixes of documentation of double-buffering on MS-Windows * etc/NEWS: Improve and expand wording of the entry about double-buffering on MS-Windows. * src/w32fns.c (w32_set_inhibit_double_buffering): Fix commentary. diff --git a/etc/NEWS b/etc/NEWS index 5c2f152a12..30882ed2fe 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2147,11 +2147,19 @@ to preserve the old behavior, apply ** MS-Windows --- -*** Emacs now supports double buffering on MS Windows to reduce flicker. -This leads to a noticable reduction in the amount of graphics flicker -during redisplay on many systems, but can also make painting slower. -If that happens, it can be disabled by setting the -'inhibit-double-buffering' frame parameter. +*** Emacs now supports double-buffering on MS-Windows to reduce display flicker. +(This was supported on Free systems since Emacs 26.1.) + +To disable double-buffering (e.g., if it causes display problems), set +the frame parameter 'inhibit-double-buffering' to a non-nil value. +You can do that either by adding + + '(inhibit-double-buffering . t) + +to 'default-frame-alist', or by modifying the frame parameters of the +selected frame by evaluating + + (modify-frame-parameters nil '((inhibit-double-buffering . t))) +++ *** Emacs now supports system dark mode. diff --git a/src/w32fns.c b/src/w32fns.c index fb71fecd95..ead1549d55 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -1802,7 +1802,7 @@ w32_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) w32_change_tool_bar_height (f, nlines * FRAME_LINE_HEIGHT (f)); } -/* Enable or disable double buffering on F. +/* Enable or disable double buffering on frame F. When double buffering is enabled, all drawing happens on a back buffer (a bitmap), which is then displayed as a single operation commit e540c8778b09cc477c23505f63a9b8740df19540 Author: Po Lu Date: Sat Apr 30 16:46:33 2022 +0800 * admin/CPP-DEFINES: Update for new features. diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES index 620ab0bed0..06986ec8f4 100644 --- a/admin/CPP-DEFINES +++ b/admin/CPP-DEFINES @@ -24,6 +24,7 @@ DARWIN_OS Compiling on macOS or pure Darwin (and using s/darwin.h). SOLARIS2 USG USG5_4 +HAIKU Compiling on Haiku. ** Distinguishing GUIs ** @@ -32,16 +33,38 @@ HAVE_NS Use the NeXT/OpenStep/Cocoa UI under macOS or GNUstep. NS_IMPL_GNUSTEP Compile support for GNUstep implementation of NS GUI API. NS_IMPL_COCOA Compile support for Cocoa (Apple) implementation of NS GUI API. HAVE_X11 Compile support for the X11 GUI. +HAVE_PGTK Compile support for using GTK itself without directly using X Windows APIs. +HAVE_HAIKU Compile support for the Haiku window system. HAVE_X_WINDOWS Compile support for X Window system (It looks like, nowadays, if HAVE_X11 is set, HAVE_X_WINDOWS must be, and vice versa. At least, this is true for configure, and msdos; not sure about nt.) -HAVE_X11R6 -HAVE_X11R6_XIM -HAVE_X11XTR6 + +** X Windows features ** +HAVE_X11R6 Whether or not the system has X11R6. (Always defined.) +HAVE_X11R6_XIM Whether or not the system supports XIM features introduced in R6. +HAVE_X11XTR6 Whether or not the Xt is from X11R6 or newer. + USE_LUCID Use the Lucid toolkit for menus&scrollbars. Requires HAVE_X11. USE_MOTIF Use the Motif toolkit for menus&scrollbars. Requires HAVE_X11. -USE_GTK Use the Gtk toolkit for menus&scrollbars. Requires HAVE_X11. +USE_GTK Use the Gtk toolkit for menus&scrollbars. Requires HAVE_X11 or HAVE_PGTK. +HAVE_GTK3 Use GTK version 3 or later. Requires HAVE_X11. + +HAVE_XCB_SHAPE Whether or not XCB supports the Nonrectangular Window Shape extension. +HAVE_XCOMPOSITE Whether or not the XCOMPOSITE extension library is present. +HAVE_XDBE Whether or not to use the Xdbe extension for double buffering. +HAVE_XFIXES Whether or not the Xfixes extension library is present. +HAVE_XINERAMA Whether or not the Xinerama extension library is present. +HAVE_XINPUT2 Whether or not to use version 2 of the X Input Extension for input. +HAVE_XINPUT2_1 Whether or not version 2.1 of the X Input Extension is supported. +HAVE_XINPUT2_2 Whether or not version 2.2 of the X Input Extension is supported. +HAVE_XINPUT2_3 Whether or not version 2.3 of the X Input Extension is supported. +HAVE_XINPUT2_4 Whether or not version 2.4 of the X Input Extension is supported. +HAVE_XKB Whether or not the XKB extension library is present. +HAVE_XRANDR Whether or not the RandR extension library is present. +HAVE_XSHAPE Whether or not the Nonrectangular Window Shape extension library is present. +HAVE_XSYNC Whether or not the X Synchronization Extension library is present. +USE_XCB Whether or not the XCB library is used to optimize some X requests. ** Frame types ** commit 08c6e699f662b40e92ae7b76745236d1c092757a Author: Po Lu Date: Sat Apr 30 15:57:11 2022 +0800 Process editres events not for frames correctly * src/xterm.c (handle_one_xevent): Dispatch Editres events to interested widgets. diff --git a/src/xterm.c b/src/xterm.c index e52f19a8e3..6d658cf204 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -14342,9 +14342,13 @@ handle_one_xevent (struct x_display_info *dpyinfo, { f = any; if (f) - _XEditResCheckMessages (f->output_data.x->widget, - NULL, (XEvent *) event, NULL); - goto done; + { + _XEditResCheckMessages (f->output_data.x->widget, + NULL, (XEvent *) event, NULL); + goto done; + } + + goto OTHER; } #endif /* X_TOOLKIT_EDITRES */ commit 1321b5989c9a8046ce40b8edf23e3e471d2b334a Author: Po Lu Date: Sat Apr 30 15:49:06 2022 +0800 Adjustments to double buffering on MS Windows * src/w32fns.c (w32_set_inhibit_double_buffering): Add comment describing double buffering. (w32_wnd_proc): Respect `w32-disable-double-buffering'. (globals_of_w32fns): New variable `w32-disable-double-buffering'. * src/w32term.c (w32_show_back_buffer): Return immediately if double buffering is disabled on the frame. (w32_scroll_run): Use old scrolling code if `w32-disable-double-buffering' is enabled. (w32_scroll_bar_clear): Document why we don't clear scroll bars when double buffering is enabled. (w32_read_socket): Respect `w32-disable-double-buffering' and clean up some code. * src/w32xfns.c (get_frame_dc): Respect `w32-disable-double-buffering'. diff --git a/src/w32fns.c b/src/w32fns.c index d4e4b2a30b..fb71fecd95 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -1802,9 +1802,16 @@ w32_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) w32_change_tool_bar_height (f, nlines * FRAME_LINE_HEIGHT (f)); } +/* Enable or disable double buffering on F. + + When double buffering is enabled, all drawing happens on a back + buffer (a bitmap), which is then displayed as a single operation + after redisplay is complete. This avoids flicker caused by the + results of an incomplete redisplay becoming visible. */ static void w32_set_inhibit_double_buffering (struct frame *f, Lisp_Object new_value, + /* This parameter is unused. */ Lisp_Object old_value) { block_input (); @@ -4114,7 +4121,8 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) f = w32_window_to_frame (dpyinfo, hwnd); enter_crit (); - if (f && !FRAME_OUTPUT_DATA (f)->paint_buffer) + if (f && (w32_disable_double_buffering + || !FRAME_OUTPUT_DATA (f)->paint_buffer)) { HDC hdc = get_frame_dc (f); GetUpdateRect (hwnd, &wmsg.rect, FALSE); @@ -11236,6 +11244,12 @@ see `w32-ansi-code-page'. */); w32_multibyte_code_page = _getmbcp (); #endif + DEFVAR_BOOL ("w32-disable-double-buffering", w32_disable_double_buffering, + doc: /* Completely disable double buffering. +This variable is used for debugging, and takes precedence over any +value of the `inhibit-double-buffering' frame parameter. */); + w32_disable_double_buffering = false; + if (os_subtype == OS_SUBTYPE_NT) w32_unicode_gui = 1; else diff --git a/src/w32term.c b/src/w32term.c index 205ac74966..8a98d2f1c6 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -283,6 +283,9 @@ w32_show_back_buffer (struct frame *f) output = FRAME_OUTPUT_DATA (f); + if (!output->want_paint_buffer || w32_disable_double_buffering) + return; + enter_crit (); if (output->paint_buffer) @@ -2935,6 +2938,8 @@ w32_scroll_run (struct window *w, struct run *run) struct frame *f = XFRAME (w->frame); int x, y, width, height, from_y, to_y, bottom_y; HDC hdc; + HWND hwnd = FRAME_W32_WINDOW (f); + HRGN expect_dirty = NULL; /* Get frame-relative bounding box of the text display area of W, without mode lines. Include in this box the left and right @@ -2953,6 +2958,9 @@ w32_scroll_run (struct window *w, struct run *run) height = bottom_y - from_y; else height = run->height; + + if (w32_disable_double_buffering) + expect_dirty = CreateRectRgn (x, y + height, x + width, bottom_y); } else { @@ -2962,15 +2970,55 @@ w32_scroll_run (struct window *w, struct run *run) height = bottom_y - to_y; else height = run->height; + + if (w32_disable_double_buffering) + expect_dirty = CreateRectRgn (x, y, x + width, to_y); } block_input (); + /* Cursor off. Will be switched on again in gui_update_window_end. */ gui_clear_cursor (w); - hdc = get_frame_dc (f); - BitBlt (hdc, x, to_y, width, height, hdc, x, from_y, SRCCOPY); - release_frame_dc (f, hdc); + if (!w32_disable_double_buffering) + { + hdc = get_frame_dc (f); + BitBlt (hdc, x, to_y, width, height, hdc, x, from_y, SRCCOPY); + release_frame_dc (f, hdc); + } + else + { + RECT from; + RECT to; + HRGN dirty = CreateRectRgn (0, 0, 0, 0); + HRGN combined = CreateRectRgn (0, 0, 0, 0); + + from.left = to.left = x; + from.right = to.right = x + width; + from.top = from_y; + from.bottom = from_y + height; + to.top = y; + to.bottom = bottom_y; + + ScrollWindowEx (hwnd, 0, to_y - from_y, &from, &to, dirty, + NULL, SW_INVALIDATE); + + /* Combine this with what we expect to be dirty. This covers the + case where not all of the region we expect is actually dirty. */ + CombineRgn (combined, dirty, expect_dirty, RGN_OR); + + /* If the dirty region is not what we expected, redraw the entire frame. */ + if (!EqualRgn (combined, expect_dirty)) + SET_FRAME_GARBAGED (f); + + DeleteObject (dirty); + DeleteObject (combined); + } + unblock_input (); + + if (w32_disable_double_buffering + && expect_dirty) + DeleteObject (expect_dirty); } @@ -4840,7 +4888,12 @@ w32_scroll_bar_clear (struct frame *f) { Lisp_Object bar; - if (FRAME_OUTPUT_DATA (f)->paint_buffer) + /* Return if double buffering is enabled, since clearing a frame + actually clears just the back buffer, so avoid clearing all of + the scroll bars, since that causes the scroll bars to + flicker. */ + if (!w32_disable_double_buffering + && FRAME_OUTPUT_DATA (f)->want_paint_buffer) return; /* We can have scroll bars even if this is 0, @@ -4958,6 +5011,11 @@ w32_read_socket (struct terminal *terminal, struct input_event inev; int do_help = 0; + /* WM_WINDOWPOSCHANGED makes the buffer dirty, but there's no + reason to flush the back buffer after receiving such an + event, and that also causes flicker. */ + bool ignore_dirty_back_buffer = false; + /* DebPrint (("w32_read_socket: %s time:%u\n", */ /* w32_name_of_message (msg.msg.message), */ /* msg.msg.time)); */ @@ -5005,8 +5063,8 @@ w32_read_socket (struct terminal *terminal, } else { - enter_crit (); - if (!FRAME_OUTPUT_DATA (f)->paint_buffer) + if (w32_disable_double_buffering + || !FRAME_OUTPUT_DATA (f)->paint_buffer) { /* Erase background again for safety. But don't do that if the frame's 'garbaged' flag is set, since @@ -5031,7 +5089,6 @@ w32_read_socket (struct terminal *terminal, } else w32_show_back_buffer (f); - leave_crit (); } } break; @@ -5484,6 +5541,7 @@ w32_read_socket (struct terminal *terminal, case WM_WINDOWPOSCHANGED: f = w32_window_to_frame (dpyinfo, msg.msg.hwnd); + ignore_dirty_back_buffer = true; if (f) { @@ -5894,11 +5952,9 @@ w32_read_socket (struct terminal *terminal, that is the case, flush any changes that have been made to the front buffer. */ - if (f && FRAME_OUTPUT_DATA (f)->paint_buffer_dirty - /* WM_WINDOWPOSCHANGED makes the buffer dirty, but there's - no reason to flush it here, and that also causes - flicker. */ - && !f->garbaged && msg.msg.message != WM_WINDOWPOSCHANGED) + if (f && !w32_disable_double_buffering + && FRAME_OUTPUT_DATA (f)->paint_buffer_dirty + && !f->garbaged && ignore_dirty_back_buffer) w32_show_back_buffer (f); } diff --git a/src/w32xfns.c b/src/w32xfns.c index 139985c5bd..22d39ae003 100644 --- a/src/w32xfns.c +++ b/src/w32xfns.c @@ -171,7 +171,8 @@ get_frame_dc (struct frame *f) if (output->paint_dc) { if (output->paint_buffer_width != FRAME_PIXEL_WIDTH (f) - || output->paint_buffer_height != FRAME_PIXEL_HEIGHT (f)) + || output->paint_buffer_height != FRAME_PIXEL_HEIGHT (f) + || w32_disable_double_buffering) w32_release_paint_buffer (f); else { @@ -188,7 +189,8 @@ get_frame_dc (struct frame *f) { select_palette (f, hdc); - if (FRAME_OUTPUT_DATA (f)->want_paint_buffer) + if (!w32_disable_double_buffering + && FRAME_OUTPUT_DATA (f)->want_paint_buffer) { back_buffer = CreateCompatibleBitmap (hdc, FRAME_PIXEL_WIDTH (f), commit 1648791e7c828ce8ced69976e4d88430bf284cf8 Author: Eli Zaretskii Date: Sat Apr 30 10:10:07 2022 +0300 Fix use of kp-decimal in 'vhdl-stutter-mode' * lisp/progmodes/vhdl-mode.el (vhdl-electric-period): Avoid signaling an error when the user presses the kp-decimal key on the numeric pad in 'vhdl-stutter-mode'. (Bug#55079) diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index 642aad509c..cdc8aeb176 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -8785,7 +8785,10 @@ project is defined." (defun vhdl-electric-period (count) "`..' --> ` => '" (interactive "p") (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal))) - (cond ((= (preceding-char) vhdl-last-input-event) + ;; We use this-command-keys below to account for translation of + ;; kp-decimal into '.'; vhdl-last-input-event doesn't catch + ;; that. + (cond ((eq (preceding-char) (aref (this-command-keys) 0)) (progn (delete-char -1) (unless (eq (preceding-char) ? ) (insert " ")) (insert "=> ")))