From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jan =?UTF-8?Q?Dj=C3=A4rv?= Newsgroups: gmane.emacs.bugs Subject: bug#11134: 24.0.94; Mac's Text to Speech stopped working in emacs buffers when I moved from Snow Leopard to Lion Date: Sat, 31 Mar 2012 16:34:56 +0200 Message-ID: <8DA592B4-297B-4713-95D4-B53C9269EA6A@swipnet.se> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1333204567 24802 80.91.229.3 (31 Mar 2012 14:36:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 31 Mar 2012 14:36:07 +0000 (UTC) Cc: Charles Magid , 11134@debbugs.gnu.org To: YAMAMOTO Mitsuharu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 31 16:36:05 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SDzPP-0004P9-9T for geb-bug-gnu-emacs@m.gmane.org; Sat, 31 Mar 2012 16:36:03 +0200 Original-Received: from localhost ([::1]:57460 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDzPO-0002xS-NS for geb-bug-gnu-emacs@m.gmane.org; Sat, 31 Mar 2012 10:36:02 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDzPL-0002wm-9B for bug-gnu-emacs@gnu.org; Sat, 31 Mar 2012 10:36:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SDzPJ-0007Vl-Fh for bug-gnu-emacs@gnu.org; Sat, 31 Mar 2012 10:35:58 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36363) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDzPJ-0007Ve-Bm for bug-gnu-emacs@gnu.org; Sat, 31 Mar 2012 10:35:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SDzPN-0005TW-Pr for bug-gnu-emacs@gnu.org; Sat, 31 Mar 2012 10:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 31 Mar 2012 14:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11134 X-GNU-PR-Package: emacs,ns X-GNU-PR-Keywords: Original-Received: via spool by 11134-submit@debbugs.gnu.org id=B11134.133320450520979 (code B ref 11134); Sat, 31 Mar 2012 14:36:01 +0000 Original-Received: (at 11134) by debbugs.gnu.org; 31 Mar 2012 14:35:05 +0000 Original-Received: from localhost ([127.0.0.1]:32901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SDzOT-0005SK-Al for submit@debbugs.gnu.org; Sat, 31 Mar 2012 10:35:05 -0400 Original-Received: from mailout.melmac.se ([62.20.26.67]:44583) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SDzOR-0005S0-Fn for 11134@debbugs.gnu.org; Sat, 31 Mar 2012 10:35:04 -0400 Original-Received: from mail01.melmac.se (mail01.melmac.se [62.20.26.80]) by mailout.melmac.se (Postfix) with ESMTP id 83B13920C for <11134@debbugs.gnu.org>; Sat, 31 Mar 2012 16:34:56 +0200 (CEST) Original-Received: (qmail 15320 invoked by uid 89); 31 Mar 2012 14:31:52 -0000 Original-Received: from h-46-59-42-18.na.cust.bahnhof.se (HELO coolsville.localdomain) (boel.djarv@bdtv.se@46.59.42.18) by mail01.melmac.se with ESMTPA; 31 Mar 2012 14:31:52 -0000 Original-Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id D9EC87FA06C; Sat, 31 Mar 2012 16:34:55 +0200 (CEST) In-Reply-To: X-Mailer: Apple Mail (2.1257) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:58384 Archived-At: 31 mar 2012 kl. 02:54 skrev YAMAMOTO Mitsuharu: >>>>>> On Fri, 30 Mar 2012 14:09:45 -0400, Charles Magid = said: >=20 >> 1. On Mac OS X Lion go into system preferences. >> 2. Click on speach >> 3. Click on text to speech >> 4. Check Speak selected text when key is pressed >> 5. click on change key button and select the button you want to use. = I >> use >> 6. Got to emacs and Highlight some text in a buffer >> 7. press the speech key combo for me >> 8. The name of the buffer is spoken not the highlighted text. >=20 >> This worked properly in Snow Leapard. >=20 > Lion's "text to speech" seems to use accessibility that the NS port > doesn't support yet, and that would explain why the name of the buffer > is spoken. If you try the Mac port (*) that has experimental > accessibility support, the selected text will be spoken (and buffer > text if no selection). >=20 > =0D The NS port does not support accessability at all, but if it is the = function described by YAMAMOTO Mitsuharu above you want, try the patch = below. As we are in feature freeze, a proper checkin will have to wait. Jan D. =3D=3D=3D modified file 'src/nsterm.m' --- src/nsterm.m 2012-02-04 15:10:54 +0000 +++ src/nsterm.m 2012-03-31 14:25:59 +0000 @@ -6034,6 +6034,46 @@ =20 @implementation EmacsWindow =20 +- (id)accessibilityAttributeValue:(NSString *)attribute +{ + Lisp_Object str =3D Qnil; + + if ([attribute isEqualToString:NSAccessibilityRoleAttribute]) + return NSAccessibilityTextFieldRole; + + if ([attribute isEqualToString:NSAccessibilitySelectedTextAttribute] = && + ! NILP (BVAR (current_buffer, mark_active))) + { + str =3D ns_get_local_selection (QPRIMARY, QUTF8_STRING); + } + else if ([attribute isEqualToString:NSAccessibilityValueAttribute]) + { + if (! NILP (BVAR (current_buffer, mark_active))) + str =3D ns_get_local_selection (QPRIMARY, QUTF8_STRING); + if (NILP (str)) + str =3D Fbuffer_string (); + } + =20 + =20 + if (! NILP (str))=20 + { + if (CONSP (str) && SYMBOLP (XCAR (str))) + { + str =3D XCDR (str); + if (CONSP (str) && NILP (XCDR (str))) + str =3D XCAR (str); + } + if (STRINGP (str)) + { + char *utfStr =3D SSDATA (str); + NSString *nsStr =3D [NSString stringWithUTF8String: utfStr]; + return nsStr; + } + } + =20 + return [super accessibilityAttributeValue:attribute]; +} + /* If we have multiple monitors, one above the other, we don't want to restrict the height to just one monitor. So we override this. */ - (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen = *)screen