unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#11134: 24.0.94; Mac's Text to Speech stopped working in emacs buffers when I moved from Snow Leopard to Lion
@ 2012-03-30 18:09 Charles Magid
  2012-03-31  0:54 ` YAMAMOTO Mitsuharu
  2012-07-21 11:23 ` Jan Djärv
  0 siblings, 2 replies; 9+ messages in thread
From: Charles Magid @ 2012-03-30 18:09 UTC (permalink / raw)
  To: 11134; +Cc: Charles M Magid

From: Charles Magid <cmmagid@gmail.com>
To: bug-gnu-emacs@gnu.org
Subject: 24.0.94; Mac's Text to Speech stopped working in emacs buffers when I moved from Snow Leopard to Lion
--text follows this line--
This bug report will be sent to the Bug-GNU-Emacs mailing list
and the GNU bug tracker at debbugs.gnu.org.  Please check that
the From: line contains a valid email address.  After a delay of up
to one day, you should receive an acknowledgement at that address.

Please write in English if possible, as the Emacs maintainers
usually do not have translators for other languages.

Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug.  If you can, give a recipe
starting from `emacs -Q':

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 <Alt-'>
6. Got to emacs and Highlight some text in a buffer
7. press the speech key combo for me <Alt-'>
8. The name of the buffer is spoken not the highlighted text.

This worked properly in Snow Leapard.


If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/Applications/Emacs.app/Contents/Resources/etc/DEBUG.


In GNU Emacs 24.0.94.1 (x86_64-apple-darwin, NS apple-appkit-1038.36)
 of 2012-02-27 on bob.porkrind.org
Windowing system distributor `Apple', version 10.3.1138
Configured using:
 `configure '--host=x86_64-apple-darwin' '--build=i686-apple-darwin'
 '--with-ns' 'build_alias=i686-apple-darwin'
 'host_alias=x86_64-apple-darwin' 'CC=gcc -mmacosx-version-min=10.5''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default enable-multibyte-characters: t

Major mode: Apropos

Minor modes in effect:
  shell-dirtrack-mode: t
  yas/global-mode: t
  yas/minor-mode: t
  save-visited-files-mode: t
  wrap-region-global-mode: t
  wrap-region-mode: t
  show-paren-mode: t
  textmate-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
u C-a C-d C-d C-x C-s C-x b * s h <return> p w d <return> 
b u <return> <wheel-down> <double-wheel-down> <triple-wheel-down> 
<triple-wheel-down> C-x b n e w <return> <M-S-return> 
A d d SPC a SPC p a g e C-: C-: C-e SPC w h i c h SPC 
m a y SPC n o t SPC b e SPC a SPC f e <backspace> <backspace> 
r e f i n e r y SPC p a g e C-x C-s C-x b <return> 
C-x b C-g C-x 1 C-x 2 C-x o C-x b <return> <M-S-return> 
<M-S-right> l o o g <backspace> k SPC a t SPC m o s 
t SPC f u n d a m e n t a l SPC s c r e e n SPC c a 
s t s SPC o n SPC r o u t e s SPC a n d SPC p a g e 
s SPC a n d SPC c o n t r o l l e r s C-x C-s <help-echo> 
<down-mouse-1> <mouse-1> <wheel-up> <double-wheel-up> 
<triple-wheel-up> <triple-wheel-up> <wheel-down> <double-wheel-down> 
<wheel-up> <double-wheel-up> <wheel-up> <wheel-down> 
C-s l i n e C-v C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-e C-x C-f c o <return> r o u <return> 
<escape> < C-n C-n C-SPC C-n C-n C-n C-n C-n <escape> 
w C-u C-SPC C-SPC C-n C-n C-n C-n C-n C-x C-f r o u 
<tab> C-x C-f C-a C-k C-g C-x C-f r o <tab> u <tab> 
C-x C-f C-a C-k C-g C-h a b u g <return> C-x o C-s 
r e p C-s C-s C-s C-a C-n C-n C-n C-u C-v C-u C-v C-n 
C-n C-n C-p C-p C-p C-SPC C-; C-; C-; <escape> w <escape> 
x C-y <return>

Recent messages:
Wrote /Users/cmmagid/GTD/newgtd.org

Saving file /Users/cmmagid/.emacs.d/emacs-visited-files...
Wrote /Users/cmmagid/.emacs.d/emacs-visited-files
Mark saved where search started
Mark set [3 times]
Quit [2 times]
Type C-x 4 C-o RET to restore the other window.  
Mark saved where search started
Mark set

Load-path shadows:
/Users/cmmagid/.emacs.d/elpa/inflections-1.0/inflections hides /Users/cmmagid/.emacs.d/el-get/rails-el/inflections
~/.emacs.d/vendor/textmate hides ~/.emacs.d/vendor/textmate.el/textmate
/Users/cmmagid/.emacs.d/elpa/ruby-mode-1.1/ruby-mode hides /Applications/Emacs.app/Contents/Resources/lisp/progmodes/ruby-mode

Features:
(shadow sort gnus-util mail-extr emacsbug message rfc822 mml mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr
mail-utils linum find-dired novice rect image-mode css-mode skeleton
rainbow-mode mule-util apropos newcomment dabbrev dired-aux
multi-isearch tabify org-wl org-w3m org-vm org-rmail org-mhe org-mew
org-irc org-jsinfo org-infojs org-html format-spec org-exp ob-exp
org-exp-blocks org-agenda org-info org-gnus org-docview org-bibtex
bibtex org-bbdb pcmpl-unix shell server rename-sgml-tag
mark-more-like-this inline-string-rectangle mark-multiple dirtree
dired-x windata tree-mode tree-widget iy-go-to-char yas/ruby rhtml-mode
rhtml-navigation rhtml-sgml-hacks rhtml-ruby-hook sgml-mode rhtml-erb
rhtml-fonts yasnippet dropdown-list derived assoc vc-git rinari jump
inflections findr ruby-compilation which-func inf-ruby
save-visited-files cus-edit cus-start cus-load wrap-region
Save-visited-files-autoloads iy-go-to-char-autoloads
rainbow-mode-autoloads rinari-autoloads jump-autoloads
inflections-autoloads findr-autoloads ruby-compilation-autoloads
inf-ruby-autoloads ruby-mode-autoloads yaml-mode-autoloads remember
org-remember org-datetree org byte-opt warnings advice advice-preload
ob-emacs-lisp ob-tangle ob-ref ob-lob ob-table org-footnote org-src
ob-comint ob-keys ob ob-eval org-pcomplete pcomplete org-list org-faces
org-compat org-entities org-macs noutline outline cal-menu calendar
cal-loaddefs grep compile paren color-theme-railscasts .loaddefs yari
thingatpt sudo-save vline coffee-mode comint ring rvm rspec-mode
ansi-color edmacro kmacro ruby-mode color-theme wid-edit el-get
help-mode easymenu view autoload help-fns bytecomp byte-compile cconv
macroexp package tabulated-list dired regexp-opt ido peepopen textmate
easy-mmode cl imenu time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel ns-win tool-bar dnd fontset image fringe
lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer loaddefs button faces cus-face files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process ns multi-tty
emacs)






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#11134: 24.0.94; Mac's Text to Speech stopped working in emacs buffers when I moved from Snow Leopard to Lion
  2012-03-30 18:09 bug#11134: 24.0.94; Mac's Text to Speech stopped working in emacs buffers when I moved from Snow Leopard to Lion Charles Magid
@ 2012-03-31  0:54 ` YAMAMOTO Mitsuharu
  2012-03-31  5:44   ` Eli Zaretskii
  2012-03-31 14:34   ` Jan Djärv
  2012-07-21 11:23 ` Jan Djärv
  1 sibling, 2 replies; 9+ messages in thread
From: YAMAMOTO Mitsuharu @ 2012-03-31  0:54 UTC (permalink / raw)
  To: Charles Magid; +Cc: 11134

>>>>> On Fri, 30 Mar 2012 14:09:45 -0400, Charles Magid <cmmagid@gmail.com> said:

> 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 <Alt-'>
> 6. Got to emacs and Highlight some text in a buffer
> 7. press the speech key combo for me <Alt-'>
> 8. The name of the buffer is spoken not the highlighted text.

> This worked properly in Snow Leapard.

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).

*: http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00030.html

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#11134: 24.0.94; Mac's Text to Speech stopped working in emacs buffers when I moved from Snow Leopard to Lion
  2012-03-31  0:54 ` YAMAMOTO Mitsuharu
@ 2012-03-31  5:44   ` Eli Zaretskii
  2012-03-31 14:34   ` Jan Djärv
  1 sibling, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2012-03-31  5:44 UTC (permalink / raw)
  To: YAMAMOTO Mitsuharu; +Cc: cmmagid, 11134

> Date: Sat, 31 Mar 2012 09:54:33 +0900
> From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
> Cc: 11134@debbugs.gnu.org
> 
> >>>>> On Fri, 30 Mar 2012 14:09:45 -0400, Charles Magid <cmmagid@gmail.com> said:
> 
> > 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 <Alt-'>
> > 6. Got to emacs and Highlight some text in a buffer
> > 7. press the speech key combo for me <Alt-'>
> > 8. The name of the buffer is spoken not the highlighted text.
> 
> > This worked properly in Snow Leapard.
> 
> 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.

How about adding this to etc/PROBLEMS?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#11134: 24.0.94; Mac's Text to Speech stopped working in emacs buffers when I moved from Snow Leopard to Lion
  2012-03-31  0:54 ` YAMAMOTO Mitsuharu
  2012-03-31  5:44   ` Eli Zaretskii
@ 2012-03-31 14:34   ` Jan Djärv
  2012-04-01  3:09     ` YAMAMOTO Mitsuharu
  1 sibling, 1 reply; 9+ messages in thread
From: Jan Djärv @ 2012-03-31 14:34 UTC (permalink / raw)
  To: YAMAMOTO Mitsuharu; +Cc: Charles Magid, 11134


31 mar 2012 kl. 02:54 skrev YAMAMOTO Mitsuharu:

>>>>>> On Fri, 30 Mar 2012 14:09:45 -0400, Charles Magid <cmmagid@gmail.com> said:
> 
>> 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 <Alt-'>
>> 6. Got to emacs and Highlight some text in a buffer
>> 7. press the speech key combo for me <Alt-'>
>> 8. The name of the buffer is spoken not the highlighted text.
> 
>> This worked properly in Snow Leapard.
> 
> 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).
> 
> 

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.


=== 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 @@
 
 @implementation EmacsWindow
 
+- (id)accessibilityAttributeValue:(NSString *)attribute
+{
+  Lisp_Object str = Qnil;
+
+  if ([attribute isEqualToString:NSAccessibilityRoleAttribute])
+    return NSAccessibilityTextFieldRole;
+
+  if ([attribute isEqualToString:NSAccessibilitySelectedTextAttribute] &&
+      ! NILP (BVAR (current_buffer, mark_active)))
+    {
+      str = ns_get_local_selection (QPRIMARY, QUTF8_STRING);
+    }
+  else if ([attribute isEqualToString:NSAccessibilityValueAttribute])
+    {
+      if (! NILP (BVAR (current_buffer, mark_active)))
+        str = ns_get_local_selection (QPRIMARY, QUTF8_STRING);
+      if (NILP (str))
+        str = Fbuffer_string ();
+    }
+  
+  
+  if (! NILP (str)) 
+    {
+      if (CONSP (str) && SYMBOLP (XCAR (str)))
+        {
+          str = XCDR (str);
+          if (CONSP (str) && NILP (XCDR (str)))
+            str = XCAR (str);
+        }
+      if (STRINGP (str))
+        {
+          char *utfStr = SSDATA (str);
+          NSString *nsStr = [NSString stringWithUTF8String: utfStr];
+          return nsStr;
+        }
+    }
+  
+  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







^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#11134: 24.0.94; Mac's Text to Speech stopped working in emacs buffers when I moved from Snow Leopard to Lion
  2012-03-31 14:34   ` Jan Djärv
@ 2012-04-01  3:09     ` YAMAMOTO Mitsuharu
  2012-04-01  9:10       ` Jan Djärv
  2012-04-01 13:26       ` Stefan Monnier
  0 siblings, 2 replies; 9+ messages in thread
From: YAMAMOTO Mitsuharu @ 2012-04-01  3:09 UTC (permalink / raw)
  To: Jan Djärv; +Cc: Charles Magid, 11134

>>>>> On Sat, 31 Mar 2012 16:34:56 +0200, Jan Djärv <jan.h.d@swipnet.se> said:

> 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.  

> +  else if ([attribute isEqualToString:NSAccessibilityValueAttribute])
> +    {
> +      if (! NILP (BVAR (current_buffer, mark_active)))
> +        str = ns_get_local_selection (QPRIMARY, QUTF8_STRING);
> +      if (NILP (str))
> +        str = Fbuffer_string ();
> +    }

Is it safe to call Fbuffer_string (in particular, move the gap) inside
read_socket_hook?  It is apparently unsafe without SYNC_INPUT, but I'm
not sure if it is supposed to be OK for the SYNC_INPUT case.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#11134: 24.0.94; Mac's Text to Speech stopped working in emacs buffers when I moved from Snow Leopard to Lion
  2012-04-01  3:09     ` YAMAMOTO Mitsuharu
@ 2012-04-01  9:10       ` Jan Djärv
  2012-04-01 22:50         ` YAMAMOTO Mitsuharu
  2012-04-01 13:26       ` Stefan Monnier
  1 sibling, 1 reply; 9+ messages in thread
From: Jan Djärv @ 2012-04-01  9:10 UTC (permalink / raw)
  To: YAMAMOTO Mitsuharu; +Cc: Charles Magid, 11134

Hello.

1 apr 2012 kl. 05:09 skrev YAMAMOTO Mitsuharu:

>>>>>> On Sat, 31 Mar 2012 16:34:56 +0200, Jan Djärv <jan.h.d@swipnet.se> said:
> 
>> 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.  
> 
>> +  else if ([attribute isEqualToString:NSAccessibilityValueAttribute])
>> +    {
>> +      if (! NILP (BVAR (current_buffer, mark_active)))
>> +        str = ns_get_local_selection (QPRIMARY, QUTF8_STRING);
>> +      if (NILP (str))
>> +        str = Fbuffer_string ();
>> +    }
> 
> Is it safe to call Fbuffer_string (in particular, move the gap) inside
> read_socket_hook?  It is apparently unsafe without SYNC_INPUT, but I'm
> not sure if it is supposed to be OK for the SYNC_INPUT case.
> 


Can you show where move_gap runs Lisp code?
Updating the properties might run hooks, so we probably don't want to use Fbuffer_string for that reason.

	Jan D.






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#11134: 24.0.94; Mac's Text to Speech stopped working in emacs buffers when I moved from Snow Leopard to Lion
  2012-04-01  3:09     ` YAMAMOTO Mitsuharu
  2012-04-01  9:10       ` Jan Djärv
@ 2012-04-01 13:26       ` Stefan Monnier
  1 sibling, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2012-04-01 13:26 UTC (permalink / raw)
  To: YAMAMOTO Mitsuharu; +Cc: Charles Magid, 11134

>> 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.
>> +  else if ([attribute isEqualToString:NSAccessibilityValueAttribute])
>> +    {
>> +      if (! NILP (BVAR (current_buffer, mark_active)))
>> +        str = ns_get_local_selection (QPRIMARY, QUTF8_STRING);
>> +      if (NILP (str))
>> +        str = Fbuffer_string ();
>> +    }
> Is it safe to call Fbuffer_string (in particular, move the gap) inside
> read_socket_hook?  It is apparently unsafe without SYNC_INPUT, but I'm
> not sure if it is supposed to be OK for the SYNC_INPUT case.

Indeed without SYNC_INPUT it's clearly unsafe (not just because of
move_gap).

And to tell you the truth, I'm not sure either what is safe with
SYNC_INPUT and what isn't.

This said, it shouldn't be difficult to change make_buffer_string_both
such that it doesn't need to move the gap, at which point I think it
would be OK.


        Stefan





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#11134: 24.0.94; Mac's Text to Speech stopped working in emacs buffers when I moved from Snow Leopard to Lion
  2012-04-01  9:10       ` Jan Djärv
@ 2012-04-01 22:50         ` YAMAMOTO Mitsuharu
  0 siblings, 0 replies; 9+ messages in thread
From: YAMAMOTO Mitsuharu @ 2012-04-01 22:50 UTC (permalink / raw)
  To: Jan Djärv; +Cc: Charles Magid, 11134

>>>>> On Sun, 1 Apr 2012 11:10:48 +0200, Jan Djärv <jan.h.d@swipnet.se> said:

>> Is it safe to call Fbuffer_string (in particular, move the gap)
>> inside read_socket_hook?  It is apparently unsafe without
>> SYNC_INPUT, but I'm not sure if it is supposed to be OK for the
>> SYNC_INPUT case.

> Can you show where move_gap runs Lisp code?

What I was concerned was not about running Lisp code.  If
read_socket_hook is called while the Lisp interpreter is operating on
some buffer contents through a pointer, then you shouldn't move the
gap in the middle of such an operation.  At least without SYNC_INPUT,
this actually happens.

> Updating the properties might run hooks, so we probably don't want
> to use Fbuffer_string for that reason.

And another reason would be what you are interested in is not always
the same as `current_buffer', but probably `XBUFFER (XWINDOW
(f->selected_window)->buffer)'.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#11134: 24.0.94; Mac's Text to Speech stopped working in emacs buffers when I moved from Snow Leopard to Lion
  2012-03-30 18:09 bug#11134: 24.0.94; Mac's Text to Speech stopped working in emacs buffers when I moved from Snow Leopard to Lion Charles Magid
  2012-03-31  0:54 ` YAMAMOTO Mitsuharu
@ 2012-07-21 11:23 ` Jan Djärv
  1 sibling, 0 replies; 9+ messages in thread
From: Jan Djärv @ 2012-07-21 11:23 UTC (permalink / raw)
  To: Charles Magid; +Cc: 11134-done

Hello.

Patch slightly reworked and checked in.

	Jan D.






^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-07-21 11:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-30 18:09 bug#11134: 24.0.94; Mac's Text to Speech stopped working in emacs buffers when I moved from Snow Leopard to Lion Charles Magid
2012-03-31  0:54 ` YAMAMOTO Mitsuharu
2012-03-31  5:44   ` Eli Zaretskii
2012-03-31 14:34   ` Jan Djärv
2012-04-01  3:09     ` YAMAMOTO Mitsuharu
2012-04-01  9:10       ` Jan Djärv
2012-04-01 22:50         ` YAMAMOTO Mitsuharu
2012-04-01 13:26       ` Stefan Monnier
2012-07-21 11:23 ` Jan Djärv

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).