[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacsでのバッファ名の文字列による取得について



 南谷です。
At 15 Jan 2001 03:35:33 +0900,
Koichi INOUE wrote:
> >  bufferはlist型でした。文字列じゃないので、バッファー型だと
> 
> そういえばエラーの中の
> ("*Dialogue*")
> みたいなのがありましたね。()がよけいについているので、リストの第1要素が
> 文字列"*Dialogue*"であるようなリストです。
> (car buffer)
> とするとこの文字列が取得できます。carはリストの第1要素を返す関数です。
> ちなみに、cdrは第2要素(多くの場合はそこから連なるリスト)を返します。
 このあたりの話はマニュアルで読みました。

> 
> > 思いこんでいました。変数の前に$とかついているといいのですが(笑)。
> 
> リストも「変数」です。
> Emacs Lisp Manualの最初に近い部分はていねいに読む方が後からはまらないで
> すむと思います。
 むむ、たしかにそうですね。私がわずかながらに知っているc, perlとは
かなり違うみたいですね。
> >  で、さらなる質問なのですが、dtk-speakで発声する声の質を変えるには
> > どうしたらよいのでしょうか。dtk-speakはオプションパラメータで
> > 発声スピードはとれるみたいですが、声質はとれないみたいですね。
> 
> この辺、私はハックしたことがありません。渡辺さんお願いします。
> # Emacspeakも謎が多くて・・・
 私からもぜひぜひお願いします。
どうもfont-lockに対応するものとしてvoice-lockがあるみたいですね。
声質の定義部も見つけたのですが、バッファー内のリージョンではなく、
dtk-speakにわたす文字列の声質を変える方法が分かりません。
#定義部をみているとやはりDtalkerはDEC-Talkより表現力が少ないようですね。
#Outloud/Festivalはどうなのかな
 
 それとbep(emacspeak)が外部からの利用を想定している関数群はどこか
一つのファイルに集められているのでしょうか。

 それで、以前irchatのadviceパッケージを作りたいと申したのですが、
「時代はliece」と知り、emacspeak-liece.elをちょっと書いてみました。
やってることは
 起動時、終了時のモードラインの読み上げ
 キーバインドされているモード変更時のモードラインの読み上げ
 任意のチャンネルへの移動時のチャンネル名/番号の読み上げ
 参加している全チャンネルへのメッセージの書き込みの即時読み上げ
です。「参加している全チャンネルへのメッセージの書き込みの即時読み上げ」
 は選択されているチャンネルのみの読み上げにしようかとも思いましたが、
 現在は個人的趣味でこうなっています。また、正しく読めていないのではと
 思われる部分もあります。メッセージ投稿時の時刻の表示は読みません。
 (趣味&実装がらくだった。)
  もう少し改造したい点がいくつかありますが、ひとまずメールに添付して
 おきます。とにかく、私が使う分にはそれなりに意味のあるものになって
 きました。
 #自分のメッセージの声質を変えたい。
  emacspeakではミニバッファーに表示された文字列は明示的に指定しないと
 読まないのでしょうかニックネーム変更時のプロンプトを読んでくれないのですが。

  elispは先日勉強し始めたばかり&irc経験も皆無に近いので問題が
 あるかも知れません。ご指摘よろしくお願いします。


;;; emacspeak-liece.el --- Speech enable liece
;;; This file is not part of GNU Emacs, but the same permissions apply.
;;;
;;; GNU Emacs is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2, or (at your option)
;;; any later version.
;;;
;;; GNU Emacs is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Emacs; see the file COPYING.  If not, write to
;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

(require 'cl)
(declaim  (optimize  (safety 0) (speed 3)))
(require 'emacspeak-speak)

(require 'emacspeak-sounds)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defadvice liece (after emacspeak pre act )
  "read the mode line after liece starts."
  (emacspeak-speak-mode-line))

(defadvice liece-command-quit (after emacspeak pre act )
  "announces after liece quit."
  (emacspeak-speak-mode-line))

(defadvice liece-command-toggle-channel-buffer-mode (after emacspeak pre act )
  "read the mode line after liece-command-toggle-channel-buffer-mode."
  (emacspeak-speak-mode-line))

;next 2 functions do not effectually work.
;(defadvice liece-command-toggle-nick-buffer-mode (after emacspeak pre act )
;  "read the mode line after liece-command-toggle-nick-buffer-mode."
;  (emacspeak-speak-mode-line))
;
;(defadvice liece-own-freeze (after emacspeak pre act )
;  "read the mode line after liece-own-freeze."
;  (emacspeak-speak-mode-line))

(defadvice liece-switch-to-channel (after emacspeak pre act )
  "read the channel name after liece-switch-to-channel."
  (dtk-speak chnl))

(defadvice liece-switch-to-channel-no (after emacspeak pre act )
  "read the channel number after liece-switch-to-channel-no."
  (dtk-speak num))

(defadvice liece-insert-internal (after emacspeak pre act )
  "speak liece-insert-internal"
  (if (eq liece-dialogue-buffer buffer)
      (dtk-speak string)))