diff options
| author | Karoly Lorentey | 2006-05-05 10:30:28 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2006-05-05 10:30:28 +0000 |
| commit | f6cf85ac95e469835a2643024f995b471a4c5d52 (patch) | |
| tree | c6b094a9b60e6234ad97323789283f431fe02e26 /src | |
| parent | c044516d384ff70e820686d4e995dcc23ee22e6f (diff) | |
| parent | 54e573e6f6f76c59e958cc20840dc3b57e72ee0a (diff) | |
| download | emacs-f6cf85ac95e469835a2643024f995b471a4c5d52.tar.gz emacs-f6cf85ac95e469835a2643024f995b471a4c5d52.zip | |
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-263
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-264
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-265
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/gnus--rel--5.10--patch-99
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-100
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-555
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 9 | ||||
| -rw-r--r-- | src/minibuf.c | 2 | ||||
| -rw-r--r-- | src/sound.c | 71 |
3 files changed, 39 insertions, 43 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index bf52364ee66..c0e8f035a17 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2006-05-03 Richard Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * sound.c (Fplay_sound_internal): Dynamically allocate | ||
| 4 | current_sound_device and current_sound. | ||
| 5 | (sound_cleanup): Free them. | ||
| 6 | |||
| 7 | * minibuf.c (read_minibuf): Don't use read_minibuf_noninteractive | ||
| 8 | when inside a keyboard macro. | ||
| 9 | |||
| 1 | 2006-05-02 Andreas Schwab <schwab@suse.de> | 10 | 2006-05-02 Andreas Schwab <schwab@suse.de> |
| 2 | 11 | ||
| 3 | * xmenu.c (restore_menu_items): Return a value. | 12 | * xmenu.c (restore_menu_items): Return a value. |
diff --git a/src/minibuf.c b/src/minibuf.c index 300e2e2ccb5..5f3f7454a0c 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -523,7 +523,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag, | |||
| 523 | build_string ("Command attempted to use minibuffer while in minibuffer")); | 523 | build_string ("Command attempted to use minibuffer while in minibuffer")); |
| 524 | } | 524 | } |
| 525 | 525 | ||
| 526 | if (noninteractive) | 526 | if (noninteractive && NILP (Vexecuting_kbd_macro)) |
| 527 | { | 527 | { |
| 528 | val = read_minibuf_noninteractive (map, initial, prompt, | 528 | val = read_minibuf_noninteractive (map, initial, prompt, |
| 529 | make_number (pos), | 529 | make_number (pos), |
diff --git a/src/sound.c b/src/sound.c index c1d5c40e9bb..0fbeceb4b9e 100644 --- a/src/sound.c +++ b/src/sound.c | |||
| @@ -452,13 +452,12 @@ static Lisp_Object | |||
| 452 | sound_cleanup (arg) | 452 | sound_cleanup (arg) |
| 453 | Lisp_Object arg; | 453 | Lisp_Object arg; |
| 454 | { | 454 | { |
| 455 | if (current_sound_device) | 455 | if (current_sound_device->close) |
| 456 | { | 456 | current_sound_device->close (current_sound_device); |
| 457 | if (current_sound_device->close) | 457 | if (current_sound->fd > 0) |
| 458 | current_sound_device->close (current_sound_device); | 458 | emacs_close (current_sound->fd); |
| 459 | if (current_sound->fd > 0) | 459 | free (current_sound_device); |
| 460 | emacs_close (current_sound->fd); | 460 | free (current_sound); |
| 461 | } | ||
| 462 | 461 | ||
| 463 | return Qnil; | 462 | return Qnil; |
| 464 | } | 463 | } |
| @@ -991,8 +990,6 @@ Internal use only, use `play-sound' instead.\n */) | |||
| 991 | #ifndef WINDOWSNT | 990 | #ifndef WINDOWSNT |
| 992 | Lisp_Object file; | 991 | Lisp_Object file; |
| 993 | struct gcpro gcpro1, gcpro2; | 992 | struct gcpro gcpro1, gcpro2; |
| 994 | struct sound_device sd; | ||
| 995 | struct sound s; | ||
| 996 | Lisp_Object args[2]; | 993 | Lisp_Object args[2]; |
| 997 | #else /* WINDOWSNT */ | 994 | #else /* WINDOWSNT */ |
| 998 | int len = 0; | 995 | int len = 0; |
| @@ -1010,48 +1007,50 @@ Internal use only, use `play-sound' instead.\n */) | |||
| 1010 | #ifndef WINDOWSNT | 1007 | #ifndef WINDOWSNT |
| 1011 | file = Qnil; | 1008 | file = Qnil; |
| 1012 | GCPRO2 (sound, file); | 1009 | GCPRO2 (sound, file); |
| 1013 | bzero (&sd, sizeof sd); | 1010 | current_sound_device = (struct sound_device *) xmalloc (sizeof (struct sound_device)); |
| 1014 | bzero (&s, sizeof s); | 1011 | bzero (current_sound_device, sizeof (struct sound_device)); |
| 1015 | current_sound_device = &sd; | 1012 | current_sound = (struct sound *) xmalloc (sizeof (struct sound)); |
| 1016 | current_sound = &s; | 1013 | bzero (current_sound, sizeof (struct sound)); |
| 1017 | record_unwind_protect (sound_cleanup, Qnil); | 1014 | record_unwind_protect (sound_cleanup, Qnil); |
| 1018 | s.header = (char *) alloca (MAX_SOUND_HEADER_BYTES); | 1015 | current_sound->header = (char *) alloca (MAX_SOUND_HEADER_BYTES); |
| 1019 | 1016 | ||
| 1020 | if (STRINGP (attrs[SOUND_FILE])) | 1017 | if (STRINGP (attrs[SOUND_FILE])) |
| 1021 | { | 1018 | { |
| 1022 | /* Open the sound file. */ | 1019 | /* Open the sound file. */ |
| 1023 | s.fd = openp (Fcons (Vdata_directory, Qnil), | 1020 | current_sound->fd = openp (Fcons (Vdata_directory, Qnil), |
| 1024 | attrs[SOUND_FILE], Qnil, &file, Qnil); | 1021 | attrs[SOUND_FILE], Qnil, &file, Qnil); |
| 1025 | if (s.fd < 0) | 1022 | if (current_sound->fd < 0) |
| 1026 | sound_perror ("Could not open sound file"); | 1023 | sound_perror ("Could not open sound file"); |
| 1027 | 1024 | ||
| 1028 | /* Read the first bytes from the file. */ | 1025 | /* Read the first bytes from the file. */ |
| 1029 | s.header_size = emacs_read (s.fd, s.header, MAX_SOUND_HEADER_BYTES); | 1026 | current_sound->header_size |
| 1030 | if (s.header_size < 0) | 1027 | = emacs_read (current_sound->fd, current_sound->header, |
| 1028 | MAX_SOUND_HEADER_BYTES); | ||
| 1029 | if (current_sound->header_size < 0) | ||
| 1031 | sound_perror ("Invalid sound file header"); | 1030 | sound_perror ("Invalid sound file header"); |
| 1032 | } | 1031 | } |
| 1033 | else | 1032 | else |
| 1034 | { | 1033 | { |
| 1035 | s.data = attrs[SOUND_DATA]; | 1034 | current_sound->data = attrs[SOUND_DATA]; |
| 1036 | s.header_size = min (MAX_SOUND_HEADER_BYTES, SBYTES (s.data)); | 1035 | current_sound->header_size = min (MAX_SOUND_HEADER_BYTES, SBYTES (current_sound->data)); |
| 1037 | bcopy (SDATA (s.data), s.header, s.header_size); | 1036 | bcopy (SDATA (current_sound->data), current_sound->header, current_sound->header_size); |
| 1038 | } | 1037 | } |
| 1039 | 1038 | ||
| 1040 | /* Find out the type of sound. Give up if we can't tell. */ | 1039 | /* Find out the type of sound. Give up if we can't tell. */ |
| 1041 | find_sound_type (&s); | 1040 | find_sound_type (current_sound); |
| 1042 | 1041 | ||
| 1043 | /* Set up a device. */ | 1042 | /* Set up a device. */ |
| 1044 | if (STRINGP (attrs[SOUND_DEVICE])) | 1043 | if (STRINGP (attrs[SOUND_DEVICE])) |
| 1045 | { | 1044 | { |
| 1046 | int len = SCHARS (attrs[SOUND_DEVICE]); | 1045 | int len = SCHARS (attrs[SOUND_DEVICE]); |
| 1047 | sd.file = (char *) alloca (len + 1); | 1046 | current_sound_device->file = (char *) alloca (len + 1); |
| 1048 | strcpy (sd.file, SDATA (attrs[SOUND_DEVICE])); | 1047 | strcpy (current_sound_device->file, SDATA (attrs[SOUND_DEVICE])); |
| 1049 | } | 1048 | } |
| 1050 | 1049 | ||
| 1051 | if (INTEGERP (attrs[SOUND_VOLUME])) | 1050 | if (INTEGERP (attrs[SOUND_VOLUME])) |
| 1052 | sd.volume = XFASTINT (attrs[SOUND_VOLUME]); | 1051 | current_sound_device->volume = XFASTINT (attrs[SOUND_VOLUME]); |
| 1053 | else if (FLOATP (attrs[SOUND_VOLUME])) | 1052 | else if (FLOATP (attrs[SOUND_VOLUME])) |
| 1054 | sd.volume = XFLOAT_DATA (attrs[SOUND_VOLUME]) * 100; | 1053 | current_sound_device->volume = XFLOAT_DATA (attrs[SOUND_VOLUME]) * 100; |
| 1055 | 1054 | ||
| 1056 | args[0] = Qplay_sound_functions; | 1055 | args[0] = Qplay_sound_functions; |
| 1057 | args[1] = sound; | 1056 | args[1] = sound; |
| @@ -1060,27 +1059,15 @@ Internal use only, use `play-sound' instead.\n */) | |||
| 1060 | /* There is only one type of device we currently support, the VOX | 1059 | /* There is only one type of device we currently support, the VOX |
| 1061 | sound driver. Set up the device interface functions for that | 1060 | sound driver. Set up the device interface functions for that |
| 1062 | device. */ | 1061 | device. */ |
| 1063 | vox_init (&sd); | 1062 | vox_init (current_sound_device); |
| 1064 | 1063 | ||
| 1065 | /* Open the device. */ | 1064 | /* Open the device. */ |
| 1066 | sd.open (&sd); | 1065 | current_sound_device->open (current_sound_device); |
| 1067 | 1066 | ||
| 1068 | /* Play the sound. */ | 1067 | /* Play the sound. */ |
| 1069 | s.play (&s, &sd); | 1068 | current_sound->play (current_sound, current_sound_device); |
| 1070 | |||
| 1071 | /* Close the input file, if any. */ | ||
| 1072 | if (!STRINGP (s.data)) | ||
| 1073 | { | ||
| 1074 | emacs_close (s.fd); | ||
| 1075 | s.fd = -1; | ||
| 1076 | } | ||
| 1077 | |||
| 1078 | /* Close the device. */ | ||
| 1079 | sd.close (&sd); | ||
| 1080 | 1069 | ||
| 1081 | /* Clean up. */ | 1070 | /* Clean up. */ |
| 1082 | current_sound_device = NULL; | ||
| 1083 | current_sound = NULL; | ||
| 1084 | UNGCPRO; | 1071 | UNGCPRO; |
| 1085 | 1072 | ||
| 1086 | #else /* WINDOWSNT */ | 1073 | #else /* WINDOWSNT */ |