From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#20481: 24.5; , Newlines in message-box output don't work on Windows Date: Thu, 12 Sep 2024 10:49:48 +0800 Message-ID: <87r09ppovn.fsf@yahoo.com> References: <86v7zwwgod.fsf@gnu.org> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40531"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 20481@debbugs.gnu.org, Eli Zaretskii To: Cecilio Pardo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 12 04:51:19 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1soZvR-000AMK-Us for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Sep 2024 04:51:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1soZv9-0005Ps-Uv; Wed, 11 Sep 2024 22:51:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1soZv6-0005H9-6N for bug-gnu-emacs@gnu.org; Wed, 11 Sep 2024 22:50:56 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1soZv5-0005DZ-TW for bug-gnu-emacs@gnu.org; Wed, 11 Sep 2024 22:50:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=Laj/N+RvPjKssbSEsQpIVk2oh7ATcaoxhkTtATMvulY=; b=WNjE1HDSTSoqMN1BRIpYgROdzQMo62ny6SMEd+dn6swn20qMfVUL0QN40zqT2ncnul6+AFoiSBMW6xwKZmhrpNh9l2GYVXVBr7QWUOga31rHn2oti5hJiOgOgF1dajJVaH0uLkTwKTREiFemuNTACESFWKM77qTdBcsE6slgC09pevko6Rf9z4QQ1Kd09vddE9Iga5FIKtLUNBWwVGPUp5+eBZBOhB7hIKjFk8ay2Es+tTOMJWFWrYovjdH72AX0QgdexM6ceKADgDi0pNRFrmPYVotGhaR2/MSwZlUu4MjZ/vNZx9LmFxQdZGFOpgu/MRUwMiTTRWXfbSrILwa8Aw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1soZvC-0001wW-3g for bug-gnu-emacs@gnu.org; Wed, 11 Sep 2024 22:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Sep 2024 02:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20481 X-GNU-PR-Package: emacs Original-Received: via spool by 20481-submit@debbugs.gnu.org id=B20481.17261094227417 (code B ref 20481); Thu, 12 Sep 2024 02:51:02 +0000 Original-Received: (at 20481) by debbugs.gnu.org; 12 Sep 2024 02:50:22 +0000 Original-Received: from localhost ([127.0.0.1]:39840 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soZuX-0001vZ-L7 for submit@debbugs.gnu.org; Wed, 11 Sep 2024 22:50:21 -0400 Original-Received: from sonic303-20.consmr.mail.ne1.yahoo.com ([66.163.188.146]:40230) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soZuV-0001pU-Ew for 20481@debbugs.gnu.org; Wed, 11 Sep 2024 22:50:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1726109406; bh=Laj/N+RvPjKssbSEsQpIVk2oh7ATcaoxhkTtATMvulY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=UQWZcJDCtcxl3CWvs8K+CQ+GKHSfP4LEGV6Ceviaux6JyQFnQQ0JHDWV5dXpiJzAAq5XZiABdnkYMXVEuSnE9cQVPKAViFml/ekGhD6Cxfhbdue9h60h8nnfQuqZrhqrqDFo0h5Jrb+OPuT4u3GSpZFdCRPOAQffBb8D9QpxWt8qcvJ4XFF6ogmSCZyy5Z+RbS/g9X7qt33kw0PbOl+ZqxE1BLBPC298AGKWS7NTDWTJpLc0RVI9sV9mCdguBZIsAFgy7z/aorwMOZdo7DJOEu88LVg7L7hCiYpE1ShWrua6BT0UmNoJvVfeAQjX2XHMUYnqT/PoWtBdQ+Qn/hiDfQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1726109406; bh=WwKwXXL51IJ/u9Du0CsbSVFx5buLguERPTD7YqOYHqw=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=VJeeFbpDAnbcu3EpfGxniEzwQ56Id8VPfmw2WZrc56ALiA9Ds0BVYap65lhGXIyM5qWUPeCdXEkJ9sCI5PaDExWQS15vTQ73EzlK6SX+8P04oZbOTAc2E7t/5vzUOd3b7fHdhbr9n/sJQH+R7s6OQLO4Q5HK6ULun4Sw6pDKdO/gR2CLkFPtjUJgt1jesdxlNnQ/pBEn2Ezpg8HaDjugl4xQnIFpc33R4gpUd0TPWCSN7Qji75AO2kWj8Dzn7tEd7OxnBLmB2oWzk1nPorsn9jhs2NGEE/J7mRQe6plABxGZhG78QcBVFYluB9fv+o3OyAjAlXNT1fufb7foqZjkmg== X-YMail-OSG: nat1ihUVM1l6c7uPI1UDK_xmE35v7DXdK5CGzuS_qqqcuKAtmN3u_06XFRL9Pbs F5p9eC36absYj1WVb1eeolZg65aoawwvFM9eBWMniBNZDaZVSehBNUAVqz8Gr3tjJBlG0zbRSbaW fvMDhW4_T0DMuvOSUvmieejTAMZMqjWIKW0X82ayqFBu9Ic8k1RXM1X_C9giIgYGy7MxqOxftzTG Ux1U1HS.uBHviZ8nsMmoavaZ8mZFzQOWwJP5quBWu7ZiQbJa0wXJsFcK20RpoaoCpp6Ak2PoH2PF _oD8Wzsi_J8PjYYBH0uyfVMFdA03CEhdAmfwNH8rG2AOQfN4o2vZMSYQbqNjO8tJrMCK15nHlM7S OuIFB7w7ldX.Z6RhyksxFeTtMrW6oVefQwHkgKiP2kByqTin89gmcmJ8GDDzTgO0D_VKhFxGC91H WsJBHKSy4LKiL9FlnkmAAvNb0pGUgG16aD57y17flFI25vze8KxjR5WlT1Kq75sRO1U.E_aOhgB2 A41PMSWBCaiOyMp3Hjk1BikNN7FqA03v_LUNhxDs24Rea1eeBCC7iX0NiGXDl_YNKLKqDDZ7yWC7 TvGrhyvw9wr7Gmy5lu21PDF0M92P_95i2oJVIUcmUWDcJOLhPAkJvWxaHFiGLn9kmU.v9URdYLqL O8GuovgORGruwPmFhFjTquxEV9lfgfhOcsyx450NfEfYjb2qX8_q7XI8cwsarfSIz0FfHde.xEff JeB5O9pw43UbGPSNHuose1cPt9KxSsnIMN1wiVLxSP4YHAinSGHSUd3LYp3T9RIfPO4SlEdzcIeB iUTDxG.m0bRKFAsH68wsGumbjn3vnsb4PWwBNFp1_E X-Sonic-MF: X-Sonic-ID: 5588cc4c-56fa-47d6-8e0a-474039abe6b9 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ne1.yahoo.com with HTTP; Thu, 12 Sep 2024 02:50:06 +0000 Original-Received: by hermes--production-sg3-fc85cddf6-qj99b (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 0cad2d1f2b913d6689eaaf6be7e4b53b; Thu, 12 Sep 2024 02:50:01 +0000 (UTC) In-Reply-To: (Cecilio Pardo's message of "Wed, 11 Sep 2024 15:44:28 +0200") X-Mailer: WebService/1.1.22645 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:291618 Archived-At: Cecilio Pardo writes: > On 19/08/2024 19:44, Eli Zaretskii wrote: >>> Date: Mon, 19 Aug 2024 18:13:31 +0200 >>> From: Cecilio Pardo >>> >>> This patch adds support on Windows Vista an later for dialog boxes using >>> TaskDialog. >> Thanks. >> >> First, to accept a contribution of this size we'll need a >> copyright-assignment paperwork from you. Should I send you the form >> to fill with instructions to go with it, so you could start the >> paperwork rolling? >> >> A few comments about the patch: > > Hello, > > The copyright assignment is ready. Here is the patch with your > > comments addressed. I also attach a couple of manual tests. > Thanks. Following are a number of minor stylistic comments. > + while (!NILP (b)) { Please insert a newline before this opening brace and indent the same by one column. > + if (Fconsp (item)) "if (CONSP (item))" > + wide_len = sizeof (WCHAR) * > + pMultiByteToWideChar (CP_UTF8, 0, SSDATA (item_name), > + -1, NULL, 0); Please enclose this expression in parens and break it before the operator, thus: (sizeof (WCHAR) * pMultiByteToWideChar (CP_UTF8, 0, SSDATA (...), ...)) > + { > + /* A nil item means to put all following items on the > + right. We ignore this. */ > + } [...] > + else if (STRINGP (item)) > + { > + /* A string item means an unselectable button. We add a > + button, an then need to disable it on the callback. > + We use ids based on 2000 to mark these buttons. */ Please insert two spaces after sentence stops. > + Lisp_Object item_name = ENCODE_UTF_8 (item); > + wide_len = sizeof (WCHAR) * > + pMultiByteToWideChar (CP_UTF8, 0, SSDATA (item_name), > + -1, NULL, 0); What I said about wrapping long expressions also applies here. > + TASKDIALOGCONFIG config = { }; TASKDIALOGCONFIG config = { 0 }; > + if (!SUCCEEDED (task_dialog_indirect (&config, &pressed_button, > + NULL, NULL))) > + return quit (); This return statement is redundant. Lastly, I observe that you have implemented a bespoke dialog parser for Windows, the likes of which have been a source of difficulties in the past. Is there any particular reason that you decided against implementing the w32_dialog_show function called in the "#ifdef HAVE_DIALOGS" version of w32_popup_dialog?