From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Filipe Cabecinhas Newsgroups: gmane.emacs.devel Subject: visible-bell patch for Mac OS X Date: Sat, 30 Jan 2010 13:34:32 +0000 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=00032557aed2f4e272047e61cfa2 X-Trace: ger.gmane.org 1264903709 13386 80.91.229.12 (31 Jan 2010 02:08:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 31 Jan 2010 02:08:29 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 31 03:08:26 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NbPEd-0000CA-P5 for ged-emacs-devel@m.gmane.org; Sun, 31 Jan 2010 03:08:25 +0100 Original-Received: from localhost ([127.0.0.1]:36204 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NbPEZ-0003fo-Is for ged-emacs-devel@m.gmane.org; Sat, 30 Jan 2010 21:08:19 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NbDTC-00064L-Me for emacs-devel@gnu.org; Sat, 30 Jan 2010 08:34:38 -0500 Original-Received: from [199.232.76.173] (port=41233 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NbDTB-00063p-S1 for emacs-devel@gnu.org; Sat, 30 Jan 2010 08:34:37 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NbDT9-0004Ae-6h for emacs-devel@gnu.org; Sat, 30 Jan 2010 08:34:37 -0500 Original-Received: from mail-bw0-f215.google.com ([209.85.218.215]:36995) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NbDT8-0004AO-MU for emacs-devel@gnu.org; Sat, 30 Jan 2010 08:34:35 -0500 Original-Received: by bwz7 with SMTP id 7so1620810bwz.26 for ; Sat, 30 Jan 2010 05:34:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=lrU7ILpGc3Lv+o8i2rG65qmOCbGXeW65QAW5NLiLjjU=; b=ULLZdkp8UOYc4jrBjl5oFi39pqmEVwXulFB8low6EE4aFAMPqrEorNQLExGFMreS95 B5TwLEzH2mhT4l/y0xuVrCaA9hxGcbOZOHXkYdeEo0KkyH/ITQAT55cThByqekfp9o0L pR/k6h9Rt3Ef//YfyhV+2Sd7rsRN8XpDFjV0I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=MpJfYg0oYavn6N0M8p+yvMo7pNHneZRgJozGXrYGhsNZVtNWg97/va322sOzbhJ+7g clu3TPNxgbj1FAlbgr9f4gKuVZY70YZHBCmxojVgeuH32boS/tXQo48wSmdg2P0gN3QE jCb6I3yTtuAZ2MPTOyt/SMeLureHYTRxzUivY= Original-Received: by 10.204.48.198 with SMTP id s6mr1437743bkf.8.1264858472702; Sat, 30 Jan 2010 05:34:32 -0800 (PST) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-Mailman-Approved-At: Sat, 30 Jan 2010 21:07:42 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:120732 Archived-At: --00032557aed2f4e272047e61cfa2 Content-Type: multipart/alternative; boundary=00032557aed2f4e267047e61cfa0 --00032557aed2f4e267047e61cfa0 Content-Type: text/plain; charset=UTF-8 Hi, I've made a patch to remove that ugly black rectangle from ns_ring_bell, when visible-bell is 't. The patch makes Emacs behave like the X version, inverting the colors of the top and bottom lines, and bounces the Dock icon once if Emacs is not the frontmost app (which can be extended to when visible-bell is 'nil, if desired (just hoist it outside the if). There is one difference in behaviour to the X version. When we have horizontally-split frames, the scrollbars between frames also get inverted. If we want to invert all the scrollbars, we just need to change the CGRect calculations to not take the scrollbar into account. Patch made against revision 99416. Regards, Filipe --00032557aed2f4e267047e61cfa0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi,

I've made a patch to remove that ugly black rect= angle from=C2=A0ns_ring_bell, when visible-bell is 't.
The pa= tch makes Emacs behave like the X version, inverting the colors of the top = and bottom lines, and bounces the Dock icon once if Emacs is not the frontm= ost app (which can be extended to when visible-bell is 'nil, if desired= (just hoist it outside the if).

There is one difference in behaviour to the X version. = When we have horizontally-split frames, the scrollbars between frames also = get inverted. If we want to invert all the scrollbars, we just need to chan= ge the CGRect calculations to not take the scrollbar into account.

Patch made against revision=C2=A099416.

<= /div>
Regards,

=C2=A0=C2=A0Filipe

--00032557aed2f4e267047e61cfa0-- --00032557aed2f4e272047e61cfa2 Content-Type: application/octet-stream; name="cocoa-visible-bell.patch" Content-Disposition: attachment; filename="cocoa-visible-bell.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g52g24ms0 IyBCYXphYXIgbWVyZ2UgZGlyZWN0aXZlIGZvcm1hdCAyIChCYXphYXIgMC45MCkKIyByZXZpc2lv bl9pZDogZmlsY2FiQGdtYWlsLmNvbS0yMDEwMDEzMDEzMzEzOS1xYzlrMjY3amxjNjlmOTluCiMg dGFyZ2V0X2JyYW5jaDogaHR0cDovL2J6ci5zYXZhbm5haC5nbnUub3JnL3IvZW1hY3MvdHJ1bmsK IyB0ZXN0YW1lbnRfc2hhMTogMjdjODAyNjQ5NGVmNDZlNjhhZDc5Zj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gICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5ECi0g ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChGUkFNRV9ERUZBVUxUX0ZBQ0Ug KGZyYW1lKSksIGZyYW1lKSBzZXRdOwotICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAg ICAgIC8qIEdldCB0aGUgYm91bmRzIG9mIG91ciBOU1ZpZXcgKi8KKyAgICAgICAgICBOU1JlY3Qg dmlld0JvdW5kcyA9IFt2aWV3IGJvdW5kc107CisKKyAgICAgICAgICAvKiBIZWlnaHQgb2YgZWFj aCBsaW5lIHRvIGZsYXNoLiAgKi8KKyAgICAgICAgICBpbnQgZmxhc2hfaGVpZ2h0ID0gRlJBTUVf TElORV9IRUlHSFQgKGZyYW1lKTsKKyAgICAgICAgICBpbnQgd2lkdGggPSBGUkFNRV9QSVhFTF9X SURUSCAoZnJhbWUpCisgICAgICAgICAgICAgICAgICAgIC0gTlNfU0NST0xMX0JBUl9XSURUSCAo ZnJhbWUpOworCisgICAgICAgICAgLyogR2V0IHRoZSBHcmFwaGljc0NvbnRleHQgKi8KKyAgICAg ICAgICBDR0NvbnRleHRSZWYgY3R4dCA9IFtbTlNHcmFwaGljc0NvbnRleHQgY3VycmVudENvbnRl eHRdIGdyYXBoaWNzUG9ydF07CisgICAgICAgICAgQ0dSZWN0IGxvd2VyTGluZSwgdXBwZXJMaW5l OworICAgICAgICAgIGxvd2VyTGluZSA9CisgICAgICAgICAgQ0dSZWN0TWFrZSh2aWV3Qm91bmRz Lm9yaWdpbi54LCB2aWV3Qm91bmRzLm9yaWdpbi55LAorICAgICAgICAgICAgICAgICAgICAgd2lk dGggKyBOU19TQ1JPTExfQkFSX1dJRFRIKGZyYW1lKSwKKyAgICAgICAgICAgICAgICAgICAgIGZs YXNoX2hlaWdodCArIEZSQU1FX0lOVEVSTkFMX0JPUkRFUl9XSURUSCAoZnJhbWUpKTsKKyAgICAg ICAgICB1cHBlckxpbmUgPQorICAgICAgICAgIENHUmVjdE1ha2Uodmlld0JvdW5kcy5vcmlnaW4u eCwKKyAgICAgICAgICAgICAgICAgICAgIHZpZXdCb3VuZHMub3JpZ2luLnkgKyB2aWV3Qm91bmRz LnNpemUuaGVpZ2h0CisgICAgICAgICAgICAgICAgICAgICAtIChmbGFzaF9oZWlnaHQgKyBGUkFN RV9JTlRFUk5BTF9CT1JERVJfV0lEVEggKGZyYW1lKSksCisgICAgICAgICAgICAgICAgICAgICB3 aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgIGZsYXNoX2hlaWdodCArIEZSQU1FX0lOVEVSTkFM X0JPUkRFUl9XSURUSCAoZnJhbWUpKTsKKworICAgICAgICAgIC8qIEludmVydCB0aGUgY29sb3Jz IHVzaW5nIGEgZGlmZmVyZW5jZSBibGVuZC4gICovCisgICAgICAgICAgQ0dDb250ZXh0U2V0Qmxl bmRNb2RlKGN0eHQsIGtDR0JsZW5kTW9kZURpZmZlcmVuY2UpOworICAgICAgICAgIENHQ29udGV4 dFNldEdyYXlGaWxsQ29sb3IoY3R4dCwgMSwgMSk7CisKKyAgICAgICAgICAvKiBJZiB3aW5kb3cg aXMgdGFsbCwgZmxhc2ggdG9wIGFuZCBib3R0b20gbGluZS4gICovCisgICAgICAgICAgaWYgKHZp ZXdCb3VuZHMuc2l6ZS5oZWlnaHQgPiAzICogRlJBTUVfTElORV9IRUlHSFQgKGZyYW1lKSkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgQ0dDb250ZXh0RmlsbFJlY3QoY3R4dCwgdXBwZXJM aW5lKTsKKyAgICAgICAgICAgICAgQ0dDb250ZXh0RmlsbFJlY3QoY3R4dCwgbG93ZXJMaW5lKTsK KyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICAvKiBJZiBpdCBpcyBz aG9ydCwgZmxhc2ggaXQgYWxsLiAgKi8KKyAgICAgICAgICAgIENHQ29udGV4dEZpbGxSZWN0KGN0 eHQsIE5TUmVjdFRvQ0dSZWN0KFt2aWV3IGJvdW5kc10pKTsKKworICAgICAgICAgIC8qIEJvdW5j ZSBEb2NrIGljb24uIE1heWJlIHdlIGNhbiBhbGxvdyBzb21lIGNvbmZpZ3VyYXRpb24gaGVyZS4g ICovCisgICAgICAgICAgW05TQXBwIHJlcXVlc3RVc2VyQXR0ZW50aW9uOiBOU0luZm9ybWF0aW9u YWxSZXF1ZXN0XTsKKwogICAgICAgICAgIFtbdmlldyB3aW5kb3ddIGZsdXNoV2luZG93XTsKICAg ICAgICAgICBuc190aW1lb3V0ICgxNTAwMDApOwotICAgICAgICAgIFtbdmlldyB3aW5kb3ddIHJl c3RvcmVDYWNoZWRJbWFnZV07CisKKyAgICAgICAgICAvKiBJZiB3aW5kb3cgaXMgdGFsbCwgZmxh c2ggdG9wIGFuZCBib3R0b20gbGluZS4gICovCisgICAgICAgICAgaWYgKHZpZXdCb3VuZHMuc2l6 ZS5oZWlnaHQgPiAzICogRlJBTUVfTElORV9IRUlHSFQgKGZyYW1lKSkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgQ0dDb250ZXh0RmlsbFJlY3QoY3R4dCwgdXBwZXJMaW5lKTsKKyAgICAg ICAgICAgICAgQ0dDb250ZXh0RmlsbFJlY3QoY3R4dCwgbG93ZXJMaW5lKTsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICAvKiBJZiBpdCBpcyBzaG9ydCwgZmxhc2gg aXQgYWxsLiAgKi8KKyAgICAgICAgICAgIENHQ29udGV4dEZpbGxSZWN0KGN0eHQsIE5TUmVjdFRv Q0dSZWN0KFt2aWV3IGJvdW5kc10pKTsKKwogICAgICAgICAgIFtbdmlldyB3aW5kb3ddIGZsdXNo V2luZG93XTsKICAgICAgICAgICBuc191bmZvY3VzIChmcmFtZSk7CiAgICAgICAgIH0KCiMgQmVn aW4gYnVuZGxlCkl5QkNZWHBoWVhJZ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