From: tomo Date: Tue, 9 May 2000 02:19:49 +0000 (+0000) Subject: This commit was generated by cvs2svn to compensate for changes in r1383, X-Git-Tag: r21-2-32~2^2~2 X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=commitdiff_plain;h=2bf45e07013c281a55bc509b24f5e83568f3d0fd;hp=5e4b9842b4eae09992b4f88326dc3b88a19ded7e This commit was generated by cvs2svn to compensate for changes in r1383, which included commits to RCS files with non-trunk default branches. --- diff --git a/INSTALL b/INSTALL index ce6d91f..d00a221 100644 --- a/INSTALL +++ b/INSTALL @@ -176,13 +176,9 @@ defaults to "-g -O" for gcc and "-g" for all other compilers. The `--dynamic' option specifies that configure should try to link emacs dynamically rather than statically. -The `--const-is-losing' option is for use if you have trouble -compiling due to the `const' storage class in C. This is defined by -default. Most users should have no need to change this. - You can build XEmacs for several different machine types from a single source directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. Make separate +supports the `VPATH' variable, such as GNU `make'. Create separate build directories for the different configuration types, and in each one, run the XEmacs `configure' script. `configure' looks for the Emacs source code in the directory that `configure' is in. diff --git a/PROBLEMS b/PROBLEMS index db106ae..b5414a5 100644 --- a/PROBLEMS +++ b/PROBLEMS @@ -394,21 +394,22 @@ Richard Cognot writes: *** On HP-UX, problems with make -Marcus Thiessel +Marcus Thiessel Some releases of XEmacs (e.g. 20.4) require GNU make to build successfully. You don't need GNU make when building 21.x. *** On HP-UX 9.05 XEmacs won't compile or coredump during the build. -Marcus Thiessel +Marcus Thiessel This might be a sed problem. For your own safety make sure to use GNU sed while dumping XEmacs. -*** On HP-UX 11.0 XEmacs causes excessive X11 errors when running. +*** On HP-UX 11.0 XEmacs causes excessive X11 errors when running. + (also appears on AIX as reported in comp.emacs.xemacs) -Marcus Thiessel +Marcus Thiessel Unfortunately, XEmacs releases prior to 21.0 don't work with Motif2.1. It will compile but you will get excessive X11 errors like @@ -424,6 +425,19 @@ Marcus Thiessel Make sure /usr/lib/Motif1.2_R6/libXm.sl is a link to /usr/lib/Motif1.2_R6/libXm.3. +*** On HP-UX 11.0: Object "" does not have windowed ancestor + +Marcus Thiessel + + XEmacs dies without core file and reports: + + Error: Object "" does not have windowed ancestor. + + This is a bug. Please apply the patch PHSS_19964 (check if + superseded). The other alternative is to link with Motif1.2_R6 (see + previous item). + + ** SCO OpenServer *** Native cc on SCO OpenServer 5 is now OK. Icc may still throw you a curve. Here is what Robert Lipe says: diff --git a/etc/TUTORIAL.ja b/etc/TUTORIAL.ja index e7cfc57..c4da971 100644 --- a/etc/TUTORIAL.ja +++ b/etc/TUTORIAL.ja @@ -1,741 +1,1052 @@ - ============================== - 日本語 GNUEMACS(Mule) 入門編 - ============================== +Copyright (c) 1985, 1996 Free Software Foundation, Inc. +使用条件はファイル最後を参照のこと + あなたが現在見ているのは XEmacs 入門ガイドです。 -注意: この入門編は、「習うより慣れろ」をモットーに作成されていま - す。">>" から始まる行は、その時何をすべきかを指示しています。 +XEmacs のコマンドを入力するには、一般にコントロールキー(キートップに +CTRL とか CTL と書いてある)やメタキーを使います。キーボードによっては、 +META キーは ALT や EDIT と書かれていたり、他のものであったりします +(例えば、Sun のキーボードでは、スペースバーの左のダイアモンドキーが +META です)。META キーが無い場合は、ESC を代わりに使うことができます。 +そこで、META とか CONTROL とかを書く代わりに、次のような記号を使うこと +にします。 + C-<文字> コントロールキーを押したまま、<文字>キーを押します。例えば、 + C-f はコントロールキーを押しながら f のキーを押すことです。 - Mule のコマンドを入力するときには、一般的にコントロール・キー(キー・ -トップに、CTRL あるいは、CTL と書いてある)やメタ・キー(普通、エスケープ・ -キーを使う)が使われます。そこで、CONTROL とか META とか書く代わりに、次の -ような記号を使うことにします。 + M-<文字> メタキーを押したまま、<文字>キーを押します。もしメタキーがな + い場合は、エスケープキーを押してから離し、それから<文字>キー + を押します。以降エスケープキーのことを と書きます。 -C-<文字> コントロール・キーを押したまま、<文字>キーを押します。例えば、 - C-f は、コントロール・キーを押しながら f のキーを押すことを - 意味します。 -<> - >> それでは、C-v(View Next Screen; 次の画面を見る)をタイプして - みて下さい。次の画面に進むことができます。 - 以降、一画面を読み終えるたびに同様にして次の画面に読み進んで - 下さい。 +!重要!: XEmacsを終了するには、C-x C-c をタイプします。 -ESC <文字> エスケープ・キーを押してから離し、それから<文字>キーを押しま - す。 +">>" で始まる行は、その時何をすべきかを指示しています。例えば、 +<> +>> では C-v (次の画面を見る)をタイプして次の画面に進んで下さい。 + (さあ、やってみましょう。コントロールキーを押しながら v です) + 以降、一画面を読み終えるたびに同様にして次の画面に読み進んで下さい。 -注意: <文字>は、大文字でも小文字でもコマンドとしては同じ意味になり - ます。メタキーが使えるならば ESC <文字> の代わりに M-<文字> - (メタキーを押したまま<文字>キーを押す) が使えます。 +前の画面と次の画面とでは、表示される内容に何行かの重なりがあります。こ +れは、表示されている内容が連続していることがすぐ判るようにするためです。 -重要です: Emacsを終了させたい時は、C-x C-c をタイプします。Emacsをcsh - から起動している場合、サスペンドする(一時的に止める)ことが - 出来ます。Emacsをサスペンドするには、C-zをタイプします。 +まずは、ファイルの中を移動して行く方法を知る必要があります。C-v によっ +て先に進むことはもう判りました。元に戻るには、M-v (メタキーを押しなが +ら v、もしくは を押して離して v)です。 +>> M-v と C-v を使って、前後に移動することを何回か試して下さい。 - さて、これからは、一画面分読み終えたら、C-v を入力して行って下さい。 - 前の画面と次の画面とでは、表示される内容に何行文かの重なりがあります。 -これは、表示されている内容が連続していることがすぐ判るようにするためです。 +*ここまでの要約 +================ - - まずは、ファイルの中を移動して行く方法を知る必要があります。C-v によ -って先に進むことはもう判りました。元に戻るには、ESC v をタイプします。 - - >> ESC v と C-v を使って、前後に移動することを何回か試してみなさい。 - -要約 -==== ファイルを画面毎に見て行くには、次のコマンドを使います。 - C-v 前に一画面分進む - ESC v 後ろに一画面分戻る - C-l 画面を書き直す。このとき、元カーソルのあった行が - 画面の中央にくるようにする + C-v 次の画面に進む + M-v 前の画面に戻る + C-l 画面を書き直す。このとき、カーソルのある行が画面の中央に + くるようにする。(C-1 じゃなくって C-L ですよ!) - >> 今カーソルがどこにあるか、その近くにどんなテキストが書かれている - かを覚えなさい。C-l をタイプし、カーソルがどこに移動したか、その - 近くのテキストはどうなったかを調べてみなさい。 +>> カーソルを見つけ、その近くにどんな文章が書かれているかを覚え、 + それから C-l をタイプして下さい。 + カーソルがどこに移動したか、その近くのテキストはどうなったかを調べ + てみましょう。 -基本的なカーソルの制御 -====================== - 画面毎の移動はできるようになりました。今度は、画面の中で、特定の場所に -移動するための方法を憶えましょう。これにはいくつかのやり方があります。一つ -の方法は、前(previous)次(next)先(forward)後(backward)に移動するコマンドを使 -うことです。これらのコマンドはそれぞれ、C-p, C-n, C-f,C-b に割り当てられて -おり、現在の場所から新しい場所にカーソルを移動させます。図で書けば、 +*基本的なカーソルの制御 +======================== +画面毎の移動はできるようになりました。今度は、画面の中で、特定の場所に +移動するための方法を憶えましょう。 + +これにはいくつかのやり方があります。一番基本的な方法は C-p, C-b, C-f, +C-n を使うことです。これらはそれぞれカーソルを前の行、前の文字、次の文 +字、次の行に移動させます。図で書けば、 前の行,C-p : : - 後の文字,C-b .... 現在のカーソル位置 .... 先の文字,C-f + 前の文字,C-b .... 現在のカーソル位置 .... 次の文字,C-f : : 次の行,C-n +>> C-n と C-p でカーソルを上図の真中の行に動かして下さい。それから C-l + をタイプして図の全体が画面中央にくるようにしてみましょう。 - これらは、それぞれ、Previous, Next, Backward, Forward の頭文字になって -いるので、憶えやすいでしょう。これらは、基本的なカーソル移動コマンドであり、 -いつでも使うものです。 - >> C-n を何回かタイプし、(今、あなたが読んでいる)この行までカーソ - ルを移動させなさい。 +これらはのコマンドはそれぞれ、Previous, Next, Backward, Forward の頭文 +字になっているので、憶えやすいでしょう。これらは、基本的なカーソル移動 +コマンドであり、いつでも使うものです。今ここで覚えて下さい。 - >> C-f を使って行の中ほどに移動し、C-p で何行か上に移動してみなさ - い。カーソルの位置の変化に注意しなさい。 +>> C-n を何回かタイプし、(今、あなたが読んでいる)この行までカーソル + を移動させましょう。 - >> 行の先頭で C-b をタイプしてみなさい。カーソルはどこに移動しますか - ?さらにもう少し C-b をタイプし、今度は C-f で行末の方に戻りなさ - い。カーソルが行末を越えるとどうなりますか? +>> C-f を使って行の中ほどに移動し、C-p で何行か上に移動させましょう。 + カーソルの位置の変化に注意して下さい。 +各行の最後には(目には見えない) Newline 文字があります。これは次の行 +との区切りを示すためです。ファイルの最後も Newline を付けるべきです +(もっとも XEmacs はそれを強制はしませんが)。 - 画面の先頭や末尾を越えてカーソルを移動させようとすると、その方向にある -テキストが移動して来て、カーソルは常に画面内にあるようにされます。 +>> 行の先頭で C-b をタイプしてみましょう。カーソルは前の行の末尾に移動 + するはずです。これは C-b が前の Newline 文字を越えて戻ったからです。 - >> C-n を使って、カーソルを画面の下端より下に移動させてみなさい。何 - が起こりましたか?カーソルの位置はどう変りましたか? +同様に C-f はカーソルを Newline 文字を越えて次に進めることができます。 - 一文字単位の移動ではまどろっこしいと思うなら、単語単位で移動することも -できます。ESC f で一単語分先に進み、ESC b で一単語分前に戻ります。 +>> さらにもう少し C-b をタイプしてカーソル移動の感じを把んで下さい。 + 今度は C-f で行末まで進んで下さい。 + さらにもう一度 C-f をタイプして次の行に進んで下さい。 -注意: 日本語については、単語の切れ目を認識することはできませんが、 - 疑似的な文節を単語の切れ目としています。 +画面の先頭や末尾を越えてカーソルを移動させようとすると、その方向にある +文章が画面の中に移動して来てます。これを「スクロール」と呼びます。画面 +がスクロールすることによって、カーソルを移動させても、カーソルは常に画 +面内にあるようにされます。 - >> ESC f や ESC b を何回かタイプしてみなさい。C-f や C-b と併用して - みなさい。 +>> C-n を使って、カーソルを画面の下端より下に移動させてみなさい。何 + が起こりましたか? - C-f や C-b に対する、ESC f や ESC b の類似性に注目しましょう。多くの -場合、ESC <文字>は文書関係の処理に使われ、一方C-<文字>はそれよりももっと基 -本的な対象(文字とか行とか)に対する操作に使われます。 +一文字単位の移動ではまどろっこしいなら、単語単位で移動することもできま +す。M-f ( f) で一単語先へ、M-b ( b) で一単語前へ移動します。 - C-a と C-e も知っていて便利なコマンドです。C-a はカーソルを行の先頭に -移動させ、C-e は行の末尾に移動させます。 +注意: 日本語については、単語の切れ目を認識することはできませんが、疑 + 似的な文節を単語の切れ目としています。 +>> M-f や M-b を何回か試してみましょう。 - >> C-a を2回、それから C-e を2回入力してみなさい。これらのコマンド - を2回以上繰返しても、カーソルはそれ以上移動しないことに注意。 +単語の中程にいる時は、M-f はその単語の終わりまで進みます。もし空白文字 +にいる時には M-f は次の単語の終わりまで進みます。M-b も同様です、方向 +は逆ですが。 - あと二つ、簡単なカーソル移動コマンドがあります。ファイルの先頭に移動す -る ESC < と、ファイルの末尾に移動する ESC > です。 +>> M-f と M-b を C-f と C-b を交えながら数回試し、単語の中に入る時と、 + 単語と単語の間にいる時の動きを調べて下さい。 - テキスト中でカーソルの存在する位置を「ポイント」と呼びます。言いかえれ -ば、カーソルは、テキストのどこにポイントがあるかを画面上で示しているのです。 +C-f と C-b に対する、M-f と M-b の類似性に注目しましょう。多くの場合、 +メタキーは文書を構成するユニット(単語、文、段落)に対する操作に使い、 +コントロールキーはそれよりももっと基本的な対象(文字とか行等)に対する +操作に使います。 - 以下に単純な移動操作について要約します。このなかには、単語や行単位での -移動コマンドも含まれています。 +この類似性は行と文の関係にもあります。C-a と C-e はそれぞれ行頭と行末 +に移動し、M-a と M-e はそれぞれ文頭と文末に移動します。 - C-f 一文字先に進む - C-b 一文字後に戻る +>> C-a を2回、それから C-e を2回試しましょう。 + M-a を2回、それから M-e を2回試しましょう。 - ESC f 一単語先に進む - ESC b 一単語後に戻る +C-a や C-e は繰返してもそれ以上移動しませんが、M-a を繰り返すとどんど +ん前の文頭に戻っていきます。この部分では類似性が破れていますが、まあこ +れが自然な動作ではないでしょうか。 - C-n 次の行に移動 - C-p 前の行に移動 +文章中でカーソルがある位置を「ポイント」と呼びます。言いかえれば、カー +ソルは、文章のどこにポイントがあるかを画面上で示しているのです。 - ESC ] 段落の終わりに移動 - ESC [ 段落の先頭に移動 +以下に単純なカーソル移動操作について要約します。このなかには、単語や行 +単位での移動コマンドも含まれています。 - C-a 行の最初に移動 - C-e 行の最後に移動 + C-f 一文字次に進む + C-b 一文字前に戻る - ESC < ファイルの最初に移動 - ESC > ファイルの最後に移動 + M-f 一単語次に進む + M-b 一単語前に戻る - >> 各々のコマンドを試してみなさい。これらのコマンドは、最もしばしば - 使われるものです。最後の二つでは、この場所とは離れたところに移動 - するので、 C-v や ESC v を使ってここに戻って来るようにしなさい。 + C-n 次の行に移動 + C-p 前の行に移動 - Emacsの他のコマンドと同様に、これらのコマンドには、繰り返しの回数を指 -定する引数 を与えることができます。そのためには、コマンドを入力する前に、 -C-uに続いて繰り返す回数を入力します。 + C-a 行頭に移動 + C-e 行末に移動 - 例えば、C-u 8 C-f とすると、8文字分先に移動します。 +>> これら全部を何度か試して練習しましょう。 + どれも頻繁に使うコマンドです。 - >> C-n あるいは C-p に適当な引数を指定して、一回の移動でなるべくこ - の行の近くに来るようにしてみなさい。 +あと二つ、重要なカーソル移動コマンドがあります。ファイルの先頭に移動す +る M-< と、ファイルの末尾に移動する M-> です。 - C-v や ESC v については少し違います。この場合、指定された数の行だけ画 -面を移動することになります。 +大抵の端末では "<" キーは ","キー(コンマ)の上にあり、それをタイプす +るにはシフトキーを使う必要があります。したがって M-< をタイプするには、 +メタキーとシフトキーとコンマキーを同時に押さねばなりません。 - >> C-u 3 C-v と入力してみなさい。 +>> M-< を試して、この入門ガイドの先頭に移動しましょう。 + それから、C-v を何度か使ってここまで帰ってきてください。 - 元に戻るには、C-u 3 ESC v を使えばよいのです。 +>> M-> を試して、この入門ガイドの末尾に移動しましょう。 + それから、M-v を何度か使ってここまで帰ってきてください。 -中止コマンド -============ +もし端末に矢印キーがあれば、それを使ってカーソルを動かすこともできます。 +けれど、次の3つの理由から C-b, C-f, C-n, C-p を覚えることを勧めます。 +第一に、これらはどんな端末でも使えます。第二に、XEmacsを使うのが上達し +てくれば、これらのコントロール文字を打つ方が、矢印キーを打つよりずっと +速いことが分るでしょう(手を通常の位置から大きく動かさないでよいので)。 +最後に、一度これらのコントロール文字を打つ習慣を付けたら、もっと進んだ +カーソル移動コマンドも簡単に覚えることができます。 - C-g というコマンドで、入力を必要とするようなコマンドを中止することが -できます。例えば、引数を入力している途中や、2つ以上のキー入力を必要とする -コマンドを入力している最中に、それをやめたくなったら、C-g を使えば良いので -す。 +XEmacsの大抵のコマンドには数値引数を与えることができます。大抵の場合こ +の数値で繰り返し回数を指示することになります。数値引数を与えるには、コ +マンドを入力する前に C-u に続いて数字何桁かタイプします。もしメタキー +が使えるなら、メタキーを押しながら数字をタイプすることもできます。でも +やはり C-u を覚えることを勧めます。それはどんな端末でも使えるからです。 - >> C-u 100 をタイプして引数を100に設定し、C-g をタイプしなさい。 - そのあとで C-f をタイプしてみなさい。何文字移動しましたか?もし - 間違って ESC を入力してしまった時も、C-g を入力すれば取り消せま - す。 +例えば C-u 8 C-f とタイプすると8文字分先に移動します。 -エラー -====== +>> 適当な数値引数を C-n あるいは C-p に与え、一回のコマンドでなるべく + この行の近くに来るようにしてみましょう。 - 時には、Emacsで許されていない操作をしてしまうことがあります。例えば、 -コマンドの定義されていないコントロール・キーを入力してしまった時には、Emacs -はベルを鳴らし、さらに、画面の一番下に、何が悪かったかを表示します。 +大抵のコマンドは数値引数を繰り返し回数と解釈しますが、中には例外もあり +ます。C-v や M-v がそうです。この場合、指定された数の行だけ画面をスク +ロールさせることになります。例えば C-u 4 C-v は画面を4行分上にスクロー +ルさせます。 - Emacsのバージョンによっては、この入門編に書かれていることを実行できな -い場合があり得ます。その様な場合には、エラーメッセージが表示されますから、 -何かカーソル移動キーを押して、その次の部分に進んで下さい。 +>> C-u 8 C-v を試してみましょう。 -ウィンドウ -========== +画面が上に8行スクロールしたはずです。また画面を下にスクロールさせるには +M-v に引数を与えればよいのです。 - Emacsは幾つものウィンドウを持つことと、そのそれぞれに対してテキストを -表示することができます。ヘルプや、幾つかのコマンドからの出力を表示するため -に現れた余分なウィンドウを消すために、次のコマンドを知る必要があります。 +もし X ウィンドウを使っているのなら、スクロールバーと呼ばれる縦長の四 +角いエリアが XEmacs のウィンドウの右端にあるはずです。そこをマウスで操 +作して画面をスクロールさせることもできます。 - C-x 1 ウィンドウを1つにする。 +>> スクロールバーの中でマウスの真中のボタンを押してみましょう。ボタン + を押した位置で決まる文章の位置まで画面がスクロールします。 - C-x 1 は、他のウィンドウを消して、カーソルのあるウィンドウを、画面全体 -に広げます。 +>> スクロールバーの一番上から3行目ほどのところにマウスを移動して、左 + のボタンを何度か押してみましょう。 - >> カーソルをこの行に持ってきて、C-u 0 C-l とタイプします。 +* X 端末でのカーソルのコントロール +---------------------------------- - >> C-h k C-f とタイプしなさい。新しいウィンドウが C-f コマンドのドキ - ュメントを表示するために現れると同時に、このウィンドウがどのよう - に縮むかを観察しなさい。 +X 端末があると、おそらくキーパッドでカーソルを操作する方が簡単だと感じ +るでしょう。left, right, up, down の矢印キーは予想通りの方向に移動しあ +す。それら、C-b, C-f, C-p, C-n と全く同じように動作しますが、よりタイ +プが簡単で、覚えるのも簡単です。単語ごとでの移動に C-left と C-right +を使うこともでき、塊 (例えば、テキスト編集中には段落) で移動するため +にC-up と C-down を使うこともできます。HOME (もしくは BEGIN) と END +と書かれたキーがあれば、それぞれ行の最初と最後に移動し、C_home と +C-end はファイルの最初と最後に移動します。キーボードに PgUp と PgDn キー +があれば、M-v と C-v のように、一度に一画面毎、上下に移動するために使 +うことができます。 - >> C-x 1とタイプして、ドキュメントの現われていたウィンドウを消しなさ - い。 +これら全てのコマンドは上で説明されているように数値引数を取ることができ +ます。これらの引数の入力に短縮路を取ることができます。CONTROL か META +キーを押したまま数字をタイプするだけです。例えば、右に12語移動するた +めには、C-1 C-2 C-right とタイプします。打鍵の間に CONTROL キーを離さ +なくてよいので、タイプは非常に簡単です。 -挿入と削除 -========== - テキストをタイプしたければ、単にそれをタイプするだけで構いません。目に -見える文字('A','7','*','あ'など)はEmacsによってテキストであるとみなされ、 -そのまま挿入されます。行の終わりは改行文字で表され、これを入力するには - をタイプします。 +* XEmacs がハングした時(動かなくなった時) +========================================== + +もし XEmacs がコマンドに反応しなくなったら、C-g をタイプすることで +XEmacs を安全に止めることができます。C-g でとても時間のかかるコマンド +を止めることができます。 - 直前に入力した文字を削除するには、 を入力します。 は、 -キーボードで「Delete」と書いてあるキーを押して入力します。「Delete」のかわ -りに「Rubout」と書いてあるかも知れません。より一般的には、 は、現在 -カーソルのある位置の直前の文字を削除します。 +C-g はまた、数値引数を取り止めたり、2つ以上のキー入力を必要とする +コマンドを入力している最中にそれを取り止めたりするのにも使えます。 - >> 文字をいくつかタイプし、それからそれらを を使って削除し - なさい。 +>> C-u 100 とタイプして引数100を設定してから C-g を打ってみましょう。 + それから C-f を打って下さい。一文字しか進まないはずです。なぜなら、 + C-g で数値引数がキャンセルされたからです。 - >> 右マージンを越えるまでテキストをタイプしなさい。テキストが一行の - 幅以上に長くなると、その行は画面からはみ出して「継続」されます。 - 右端にある'\'記号は、その行が継続されていることを表しています。 - Emacsは、現在編集中の位置が見えるように行をスクロールします。画面 - の右あるいは左の端にある'\'記号は、その方向に行がまだ続いているこ - とを表しています。 +間違って をタイプしてしまった時も、C-g でそれを取り消せます。 - これは、文章で説明するより実際にやった方がよく判るでしょう。 - >> 先ほど入力した、継続された行の上にカーソルをもっていき、C-d でテ - キストを削除して、テキストが一行に収まるようにしてみなさい。継続 - を表す'\'記号は消えましたね。 +*使用不可 (disabled) コマンド +================================== - >> カーソルを行の先頭に移動し、 を入力しなさい。これはその行 - の直前の行句切りを削除するので、その行が前の行とつながってしまい - ます。つながった行が画面の幅より長くなると、継続の表示がされるで - しょう。 +いくつかのコマンドは初心者が間違って使わないよう使用不可になっています。 - >> を押して、もう一度行句切りを挿入しなさい。 +もし何れかの使用不可コマンドをタイプしたら、それはどういうコマンドかが +表示され、本当にそれを実行したいのかどうか訊ねられます。 - Emacsのほとんどのコマンドは、繰り返しの回数を与えることができます。こ -のことは、文字の挿入についても当てはまります。 +もし本当に実行したいのならスペースキーをタイプして下さい。もし実行した +くなければ "n" とタイプして下さい。 - >> C-u 8 * と入力してみなさい。どうなりましたか。 +>> `C-x n p' : とタイプしてみましょう(これは使用不可コマンドです)。 + それから n とタイプしましょう。 - 二つの行の間に空白行を作りたい場合には、二番目の行の先頭に行き、C-o を -入力します。 - >> 適当な行の先頭に行き、そこで C-o を入力してみなさい。 +*ウィンドウ +============ - これで、Emacsで、テキストを入力し、また間違いを修正するもっとも基本的 -な方法を学んだことになります。文字と同じ様に、単語や行も削除することができ -ます。削除操作について要約すると次のようになります。 +XEmacs は幾つものウィンドウに、それぞれ個別の文章を表示することができ +ます。XEmacs で使われている「ウィンドウ」はウィンドウシステムでの重なっ +ている別のウィンドウに言及しているのではなく、単一の X ウィンドウ下で +の別の窓のことを言っていることに注意してください。(XEmacs は複数の X +のウィンドウ、XEmacs の用語では「フレーム」を持つこともできます。これ +は後ほど説明します。) - カーソルの直前の文字を削除 - C-d カーソルのある文字を削除 +ここでは、複数のウィンドウを使う技術には触らないほうが賢明でしょう。で +も、ヘルプや特定のコマンドの出力で現れるかもしれない余分なウィンドウを +消して、どうやって元の一つのウィンドウの状態に戻るかを説明することは必 +要でしょう。それは簡単です。 - ESC カーソルの直前の単語を削除 - ESC d カーソル位置以降にある単語を削除 + C-x 1 ウィンドウを1つにする(つまり他のウィンドウを全部消す) - C-k カーソル位置から行末までを削除 +つまり C-x を打ってからさらに 1 を打つのです。このコマンドはカーソルの +あるウィンドウを画面全体に広げます。他のウィンドウは全部消えます。 - 何かを削除した後で、それを元に戻したくなることがあります。Emacsは、一 -文字よりも大きい単位で削除を行った時には、削除した内容を保存しておきます。 -元に戻すには、C-y を使います。注意したいのは、C-y を削除を行った場所だけで -はなく、どこにでも出来ることです。C-y は、保存されたテキストを現在カーソル -のある場所に挿入するためのコマンドですから、これを使ってテキストの移動を行 -うことができます。 +>> カーソルをこの行に持ってきて、C-u 0 C-l とタイプしてみて下さい。 - 削除を行うコマンドには、"Delete" コマンドと、"Kill" コマンドとがありま -す。"Kill" コマンドでは削除されたものは保存されますが、"Delete" コマンドで -は保存されません。ただし、繰り返し回数が与えられると、保存されます。 +(C-l が画面を再描画することを思い出してください。それに数値引数を与え +ると、「画面を再描画して現在の行を画面の最上部からその数だけ離れたとこ +ろに移動しなさい」という意味になります。ですから、C-u 0 C-l は「画面を +再描画して、現在の行を最上部にする」という意味になります。) - >> C-n を2回ほどタイプして、画面の適当な場所に移動しなさい。そして、 - C-k で、その行を削除しなさい。 +>> 続いて Control-x 2 とタイプして下さい。 + 新しいウィンドウがこのバッファの内容を表示するために現れるとともに、 + このウィンドウがどのように縮むかを見て下さい。 - 一回目の C-k でその行の内容が削除され、もう一度 C-k を入力すると、その -行自身が削除されます。もし、C-k に繰り返し回数を指定した場合には、その回数 -だけの行が(内容と行自身とが同時に)削除されます。 +>> C-x 1 とタイプして、新しいウィンドウが消えるのを見て下さい。 - 今削除されたテキストは、保存されているので、それを取り出すことができま -す。そのためには、C-y をタイプします。 - >> C-y を試してみなさい。 +*挿入と削除 +============ + +テキストを入力したければ、単にそれをタイプして下さい。XEmacs は、目に +見える文字(A, 7, * 等)をテキストであるとみなすので、それらはそのまま +挿入されます。(改行キー)をタイプすれば改行文字が挿入されます。 - C-k を何度も続けて行うと、削除されるテキストは、まとめて保存され、C-y -で、その全てが取り出されます。 +直前に入力した文字を削除するには、 をタイプします。 は、 +キーボード上に「Del」と書いてあるキーです。時には キーも + として動作しますが、いつもではありません。 - >> C-k を何度もタイプしてみなさい。 +より一般的には、 は現在カーソルのある位置の直前の文字を削除し +ます。 - >> テキストを取り出すには、C-y です。カーソルを数行下に移動させ、も - う一度 C-y をタイプしてみなさい。これでテキストのコピーができるわ - けです。 +>> 文字をいくつかタイプし、それからそれらを を使って削除し + て下さい。このファイルを変更することを気にする必要はありません。オ + リジナルの入門ガイドファイルは変更されませんから。今見ているファイ + ルはあなたのためのコピーです。 - 現在何かのテキストが保存されていて、さらに他のテキストを削除するとどう -なるでしょうか。C-y は、もっとも最近削除されたものを取り出します。 +文章の一行が画面に収まらない程長くなった場合、その行は画面上の次の行へ +と継続(continued)されます。画面の右端の backslash 文字 ("\") は、そ +の行が継続されていることを表しています。 +>> 画面の右端まで文章を入力し、さらに入力を続けて下さい。 + 継続行ができるのが分るでしょう。 - >> 行を削除し、カーソルを移動させ、別の行を削除しなさい。C-y を行う - と、2番目の行が得られます。 +>> を使って画面に収まるところまで現在の行を短くしてみてくださ + い。継続行は消えます。 -取り消し(UNDO) -============== +改行文字も他の文字と同じように削除できます。2つの行の間の改行文字を消 +すとそれらの行が合わさり1つの行になります。もしその合わさった行が画面 +の幅よりも長い場合は、継続行となって表示されます。 + +>> カーソルを行の先頭に移動し、 をタイプして下さい。現在の行が + その前の行とつながります。 + +>> をタイプして、今削除した改行文字をまた挿入して下さい。 + +XEmacs のほとんどのコマンドは、繰り返しの回数指定できることを思い出し +て下さい。これは、文字の挿入についても当てはまります。 + +>> C-u 8 * とタイプすると ******** が挿入されます。試してみましょう。 + +これで、XEmacs でテキストを入力し、また間違いを修正するもっとも基本的 +な方法を学んだことになります。文字と同じ様に、単語や行も削除することが +できます。削除操作について要約すると次のようになります。 + + カーソルの直前の文字を削除(delete) + C-d カーソルのある文字を削除(delete) + + M- カーソルの直前の単語を消去(kill) + M-d カーソル位置以降にある単語を消去(kill) + + C-k カーソル位置から行末までを消去(kill) + M-k カーソル位置から文末までを消去(kill) + + と C-d に対する M- と M-d は、C-f と M-f で始まった類 +似性をまた拡張します。ここで はコントロール文字ではありません +が、まあ、それは気にしないで下さい。C-k と M-k の関係は C-e と M-e の +関係(行と文の対比)と同じです。 + +一度に2文字以上消した場合、XEmacs はその消したテキストを保存しておい +て、また元に戻すことができるようにしています。この「元に戻す」という動 +作を再入(yanking)と呼びます。消したテキストは、元と同じ場所にでも元 +とは違う場所にでも再入できます。また、何度も再入してテキストのコピーを +複数作ることもできます。再入のためのコマンドは C-y です。 + +「消去(kill)」と「削除(delete)」の違いに気をつけて下さい。消去した +テキストは再入できますが、削除したものは再入できません。一般に、大量の +テキストを消すコマンドはそのテキストを保存しておきますが、一文字とか空 +白行や空白文字を削除するコマンドは削除したものを保存しきません。 + +>> 空行でない行の先頭にカーソルを移動させて下さい。 + それから C-k でその行のテキストを消去して下さい。 +>> もう一度 C-k をタイプしてください。その行に続く改行文字が消されるの + が分りましたか。 + +一回目の C-k はその行のテキストを消し、2回目の C-k はその行自身を消し +てその先の行を上げてきます。C-k の数値引数の扱いは特殊です。引数分の行 +(行の内容と行自身)を消します。これは単なる繰り返しではありません。 +C-u 2 C-k は2つの行とそれぞれに続く改行文字を消しますが、C-k を2度タ +イプしてもそうはなりません。 + +最後に消去したテキストを現在カーソルがある位置に再入するには C-y をタ +イプします。 + +>> 試して下さい。C-y をタイプして最後に消去したテキストを再入しましょう。 + +C-y は、あなたが無くしたものを取り戻すものだと考えましょう。C-k を続け +て実行すると、消去した各行は全部まとめて保存されるので、一回の C-y で +それらの行が全部再入されます。 + +>> C-k を何度か続けてタイプしてみて下さい。 - いつでも、テキストを変更したけれども、それをもとに戻したいときはC-x u -で直ります。普通は間違えたコマンドを無効にする働きをします。繰り返してUNDO -を行なおうとする時は、何度もそのコマンドを行なえば出来るようになっています。 +さあ、消去したテキストを再入しましょう。 - >> この行をC-kで消して下さい。そして、C-x uで戻して下さい。 +>> C-y をタイプして下さい。次にカーソルを数行下に移動させ、また C-y を + タイプして下さい。どうやってテキストをコピーするか分りましたね。 - C-_は、UNDOを行なう、もう一つのコマンドです。機能は、C-x uと同じです。 +過去に消去したテキストを再入したいのに、別のテキストをその後消去した時 +はどうすればよいでしょう? C-y は最後に消去したものを再入します。でも +それでより以前に消去したテキストがなくなるわけではありません。そういう +テキストは M-y で再入できます。C-y で最後に消去したテキストを再入した +直後にM-y をタイプすると、その再入されたテキストはそれ以前に消去したも +のに変更されます。何度も続けて M-y をタイプすると、さらに前に消去した +テキストを呼び戻せます。望みのテキストに行き当ったら、それはそのままに +して編集作業を続ければよいのです。 - C-_やC-x uにUNDOの回数を、与えることが出来ます。 +ある回数だけ M-y を繰り返したら、また最初(つまり最後に消去したテキス +ト)に戻ります。 +>> 一行消去し、別の行に行ってその行を消去して下さい。 + それから C-y で2番目(最後)に消去した行を再入して下さい。 + 続いて M-y でその行を最初に消去した行に変えて下さい。 + M-y を続けどうなるか見てみましょう。2番目に消去した行が戻って来る + まで M-y を繰り返し、さらにもう何度か M-y をしましょう。 + もし望みなら M-y に正もしくは負の数値引数を与えても良いでしょう。 -ファイル -======== - テキストへの変更を永久的にするためには、それをファイルに保存しなければ -なりません。保存されないと、ほどこした変更は、Emacsを終了すると同時に失われ -てしまいます。 +*取り消し(UNDO) +================ - いま見ているファイルに対して、あなたの編集を行ったものを書き込みます。 -いま見ているファイルとは、簡単にいえば編集しているファイル自体のことです。 +もし、文章を変更した後でその変更は間違いだったと思ったら、取り消し +(undo)コマンド C-x u でその変更を取り消すことができます。 - あなたがファイルをセーブ(保存する)するまで、今までの変更は編集してい -るファイルに書き込まれる事はありません。それは、あなたがそのように行いたく -ないのに、途中まで変更を加えたものが勝手に書き込まれるような事がないように +通常、C-x u は一つのコマンドによる変更を取り消します。続けて何度も C-x +u を行えばそのたびに一つ前のコマンドが取り消しになります。 + +ただしこれには例外が二つあります。まず、文章を変更しないコマンドは取り +消しになりません。カーソル移動やスクロールのコマンドがそれに当たります。 +それから、テキスト文字の挿入(自己挿入コマンド)は 20 個一まとめで扱わ +れます。これはテキストの挿入を取り消すための C-x u の回数を減らすため です。 - セーブを行った後でさえ変更したものが間違っていた時のためにEmacsは名前 -を変えてオリジナルのファイルを残します。 +>> この行をC-kで消して下さい。そして、C-x u で戻して下さい。 -備考: また、Emacsは不測の事態に対し、一定のタイミングごとに自動的 - に編集しているファイルの内容を名前を変えたファイルにセーブし - ます。これによって、万一の場合は行ったの変更に対し最小限の被 - 害で済むようになっています。 +C-_ も取り消し(undo)を行なうコマンドです。機能は、C-x u と同じですが、 +続けて何度もタイプする場合はより便利です。C-_ の問題は、キーボードによっ +てはどうやってタイプするのか分りづらい事です。だから C-x u があるので +す。端末によっては、コントロールキーを押したまま / をタイプすると C-_ +をタイプしたことになります。 - 画面の下の方を見ると、このような感じでモードラインが表示されていると思 -います。 +C-_ や C-x u は数値引数を繰り返し回数と解釈します。 -(例) [--]J:--**-Mule: MULE.tut (Fundamental) ---55%-------------- +*ファイル +========== +編集している文章を恒久的な物にするには、それをファイルに保存しなければ +なりません。さもないと、XEmacs の終了と同時にそれはなくなってしまいま +す。編集した物をファイルに入れるにはファイルを開いてからします。(ファ +イルを "visit" するとも言います)。 - このEmacsチュートリアルのコピーはMULE.tutと呼ばれています。ファイルを -ファインド(ファイルを見つけてバッファに読み込むこと)すると、MULE.tutの部 -分に表示されます。例えば、new-fileという名前のファイルをファインドしたなら -ば、"Mule: new-file"というモードラインになるでしょう。 +ファイルを開くとは、そのファイルの中身を XEmacs で見ることを意味します。 +色々な意味で、それはあなたがファイル自身を編集しているかの様です。しか +し、XEmacs で行う変更はファイルをセーブする迄は恒久的なものとなりませ +ん。これは、それを望まないのに、途中まで変更したファイルが残るのを避け +るためです。セーブした後でさえ、変更したものが間違っていた時のために、 +元のファイルは名前を変えて残されます。 -注意: モードラインについては後ほど説明します。少しお待ちを。 +画面の一番下近くに、"ISO7--%%-XEmacs: TUTORIAL.ja" の様な文字列で始ま +り "----" で終っている行があるはずです。画面のこの部分は常に現在開いて +いるファイルの名前が表示されています。今は "TUTORIAL.ja" という名のファ +イル(これは XEmacs 入門ガイドのあなた用のコピーです)を開いています。 +XEmacs でファイルを開くとそのファイルの名前がこの部分に現れます。 - ファイルをファインドしたり、セーブしたりするコマンドは、これまでのもの -とは違い、2つの文字からなっています。C-x に続いて入力する文字が、ファイル -に対して行う操作を表します。 +ファイルを開いたり保存したりするコマンドは、2つの文字から成るという点 +で今まで学んだ他のコマンドとは違います。両方とも、Control-x という文字 +で始まります。Control-x で始まるコマンドはたくさんあります。多くはファ +イル、バッファやそれらに関連したものに関係したことをします。これらのコ +マンドは2、3、4文字です。 - もう一つこれまでのものと違う点は、ファインドの時、ファイル名をEmacsに -問われます。このことを、端末から引数を読み込んでくるコマンドと言っています。 +ファイルを開くためのコマンドはこれまで学んだものとは違い、ファイルの名 +前を指定しなければなりません。これを、コマンドが「端末から引数を読み込 +む」と言います。今の場合は引数はファイル名です。次のコマンド -注意: この場合はファイル名です。 + C-x C-f Find a file - C-x C-f ファイルを見つける(ファインドする) +をタイプすると、XEmacs はファイル名を聞いてきます。タイプしたファイル +名は画面の最下行に表示されます。この最下行は、こういう入力のために使っ +ている時は、ミニバッファと呼びます。通常の編集コマンドでファイル名を編 +集することもできます。 - Emacsはファイル名を聞いてきます。それは、画面の下の行に現れます。ファ -イル名を指定している部分は、ミニバッファと呼ばれるものです。ミニバッファは -この様な使われ方をします。ファイル名に続いて、リターンキーを押すと、ミニバ -ッファに表示されていた内容はもう必要ではなくなるので消えてしまいます。 +ファイル名の入力中(あるいはその他のミニバッファ入力中)に C-g によっ +てコマンドをキャンセルできます。 - >> C-x C-fとタイプした後にC-gとタイプして下さい。ミニバッファの内容 - を取り消し、また、C-x C-fコマンドも取り消します。と言う訳で、何も - ファイルを見つけるようなことはしません。 +>> C-x C-f をタイプしてから C-g をタイプしてみましょう。ミニバッファが + 取り消され、それを使っていたコマンド C-x C-f 自体も取り消されます。 + だから、ファイルは何も開かれません。 - 今度はファイルをセーブしてみましょう。今までの変更を保存するためには次 -のようなコマンドを使います。 +ファイル名を入力したら、キーをタイプし入力を完了させます。そう +すると、C-x C-f コマンドが走り始め指定したファイルを開きます。ミニバッ +ファは C-x C-f コマンドの終了とともに消えます。 - C-x C-s ファイルをセーブする +ファイルの内容が画面に表示されると、その内容を変更することができます。 +加えた変更を恒久的なものにしたければ、次のコマンドをタイプします。 - Emacsの内容はファイルに書き出されます。セーブする時、オリジナルの -ファイルは新しい名前をつけられて残されているので内容は失われません。そ -の新しい名前はオリジナルのファイルの名前に'~'をつけたものです。 + C-x C-s Save the file - セーブが終わると、Emacsはセーブしたファイルの名前を表示します。 +これは XEmacs が保持している文章をファイルにコピーします。初めてこれを +実行するときは、元のファイルを新しい名前に付け替えるので、その内容は失 +われません。その新しい名前は元のファイルの名前の最後に'~'をつけたもの +です。 - >> C-x C-sとタイプしてチュートリアルのコピーをセーブして下さい。その - 時、画面の下の方に"Wrote ...../MULE.tut"と表示されます。 +セーブが終わると、セーブしたファイルの名前が表示されます。割と頻繁にセー +ブした方が良いでしょう。システムが落ちてもせっかくの作業がパアにならな +いように。 - 新しいファイルを作る時、あたかも以前からあったファイルをファインドする -ようなフリをします。そうして、そのファインドしたファイルにタイプしていきま -す。 +>> C-x C-s とタイプしてこの入門ガイドのコピーをセーブして下さい。 + 画面最下段に "Wrote ...TUTORIAL.ja" と表示されます。 - ファイルをセーブしようとした時に初めて、Emacsは今まで編集していた内容 -をファイルの中に書き込みます。 +注意:システムによっては C-x C-s とタイプすると画面が動かなくなり +XEmacs が表示しようとするものが何も画面に出なくなります。これは、フロー +コントロールと呼ばれるOSの機能が C-s を捉え、XEmacs に渡さないように +しているのです。これを解除するには C-q をタイプします。それから XEmacs +マニュアルの "Spontaneous Entry to Incremental Search (知らぬ間にイン +クリメンタルサーチになる)" の節を読んでください。このやっかいなOSの +機能にどう対処すれば良いかが載っています。 +既存のファイルを開き、内容を見、編集することができます。存在しないファ +イルを開くこともできます。XEmacs で新しいファイルを作るには次のように +します。ファイルを開きます。最初は空っぽですね。文章を入力していきます。 +ファイルをセーブしようとした時に初めて新しいファイルが作られ、今まで入 +力した内容がそれに書き込まれます。それ以降は、あなたは既存のファイル +(たった今作られたファイル)を編集していると思って下さい。 -バッファ -======== - もし、2番目のファイルを C-x C-f で取り出すと、1番目のファイルはEmacs -内部に残ります。Emacs内部にあるファイルからテキストを読み込んで保存している -ものはバッファと呼ばれます。ファイルの取り出しは、Emacs内部に新しいバッファ -を作ります。 +*バッファ +========== - Emacsの中に保存しているバッファのリストを見るには、次のようにタイプし -ます。 +2つ目のファイルを C-x C-f で開いても、最初のファイルは XEmacs 内部に +残ったままです。そっちのファイルに戻るにはもう一度 C-x C-f でそのファ +イルを開けばよいのです。こうやって、幾つものファイルを XEmacs で開くこ +とができます。 - C-x C-b +>> "foo" という名のファイルを作りましょう。C-x C-f foo です。 + 何か文章を入れ、編集し、C-x C-s で "foo" をセーブして下さい。 + 最後に C-x C-f TUTORIAL.ja とタイプし + 入門ガイドに戻りましょう。 + +XEmacs はファイルの内容をバッファ(buffer)と呼ばれるものの中に格納し +ています。ファイルを開くと新しいバッファができます。XEmacs が現在持っ +ているバッファのリストを見るには、次のようにタイプします。 - >> C-x C-b とタイプしなさい。それぞれのバッファがどのように名前を持 - っているか、そして、どのようなファイル名をつけているのか観察しな - さい。 + C-x C-b List buffers - バッファにはファイルと一致ないものもあります。たとえば、 -"*Buffer List*" というファイルはありません。これは C-x C-b によって作られ -たバッファリストに対してのバッファです。 +>> C-x C-b を試してみましょう。 - あなたが見ているEmacsウィンドウ内にある、どんなテキストでも、いずれか -のバッファ内にあります。 +各バッファがどんな風に名前やそれが開いているファイルに対するファイル名 +を持っているか見て下さい。ファイルを開いていないバッファもあります。た +とえば、"*Buffer List*" という名のバッファはどんなファイルも開いていま +せん。これはバッファのリストを内容とするバッファで、C-x C-b で作られた +ものです。XEmacs のウィンドウ内にあるテキストはどれも、いずれかのバッ +ファの一部です。 - >> バッファリストを消すため C-x 1 とタイプしなさい。 +>> C-x 1 とタイプしてバッファリストを消しましょう。 - もし、あるファイルのテキストに変更を行なってから、他のファイルを取り出 -したとしたら、最初のファイルはセーブされていません。その変更はEmacs内部のフ -ァイルと対応するバッファの中だけに行なわれています。 +あるファイルの内容になんらかの変更を加え、それから他のファイルを開いて +も、最初のファイルはまだセーブされません。変更は XEmacs の内部、そのファ +イルに対応するバッファの中に残ったままです。2番目のファイルのバッファ +を作ったり、編集したりしても、最初のファイルのバッファには何の影響もあ +りません。これはとても役に立ちますが、最初のファイルのバッファをセーブ +する何か便利な方法が必要だということでもあります。 C-x C-s でセーブす +るために C-x C-f で元のバッファに戻るのはは厄介です。そこで次のコマン +ドを使います。 - 2番目のファイルに対応するバッファを作ったり、エディットしたりしても、 -1番目のファイルに対応するバッファには何も影響を与えません。これはとても使 -い易く、また、1番目のファイルに対応するバッファを取っておくために役に立つ -方法です。 + C-x s 何れかのバッファをセーブする - C-x C-s でバッファをセーブするために C-x C-f でバッファを切り替えるの -は厄介です。そこで次のコマンドを使います。 +C-x s は、まだセーブしていない変更があるバッファそれぞれについて、それ +をセーブするかどうかを聞いてきます。 - C-x s 現在あるバッファをセーブする。 +>> 一行テキストを入力してから C-x s とタイプして下さい。 + TUTORIAL.ja というバッファをセーブするかどうか聞いてくるはずです。 + 「はい」と答えるために "y" とタイプして下さい。 - C-x s は内容を変えたバッファ全てをファイルにセーブします。この時、ひと -つひとつの(セーブされるべき)バッファに対して、セーブするか、しないかをyかn -で問われます。この表示は画面の下の行に表示されます。例えば、このようにです。 +*メニューを使う +---------------- - Save file /usr/private/yours/MULE.tut? (y or n) +もし X 端末を使っていれば、XEmacs の画面の最上部にメニューバーがあるこ +とに気付くでしょう。このメニューバーを使って「ファイルを開く」というよ +うなほとんどのよく使う XEmacs のコマンドを使用することができます。特定 +のコマンドを使用するための打鍵を覚えなくてよいので、最初はこの方が簡単 +に思えるでしょう。XEmacs に慣れてくるにしたがって、キーボードのコマン +ドを使うことが簡単になってくるでしょう。対応するキーボードコマンドがコ +マンドの次に書かれているからです。 +メニューバーにはキーボードで完全に同等に対応するものが無い項目が多くあ +ります。例えば、Buffers メニューは最近使われた順に選択可能なバッファの +一覧を表示します。単に Buffers メニューで名前を見つけて選択するだけで +どのバッファにでも移動できます。 -コマンドの拡張 -============== +*マウスを使う +-------------- + +X の下で実行されているときは、XEmacs は完全にマウス機能と一体化してい +ます。望みの場所で左ボタンをクリックすることでテキストのカーソルを移動 +することができ、選択したいテキストを左マウスボタンでドラッグすることで +テキストを選択することができます。(もしくは、その代わりにテキストを選 +択するために一方の端で左マウスボタンをクリックし、他の端に移動して +Shift を押しながらクリックすることができます。) + +選択したテキストを消去 (kill) するためには、C-w か、Edit メニューの +Cut 項目を使えます。これらは等価では*無い*ことに注意してください: C-w +はXEmacs の内部のみにテキストを保存しますが(上で説明した C-k と似てい +ます)、Cut はこれとともにテキストを他のアプリケーションが使用可能な X +のクリップボードにも入れます。 - エディタには、コントロール・キーやメタ・キーで入力できるものよりもずっ -と多くのコマンドがあります。これらを扱うために、拡張(eXtend)コマンドを +X のクリップボードからテキストを取得するには、Edit メニューの Paste 項 +目を使ってください。 + +真中のマウスのボタンは普通は画面で見えているものを選択するために使われ +ます。例えば、Info(オンライン XEmacs 説明文書)に C-h i か Help メニュー +を使って入れば、ハイライトされたリンクを真中のボタンを押すことで追うこ +とができます。同様に、ファイル名を入力しているときに(例えば、「ファイ +ルを開く」で入力を促されたとき) TAB で補完候補を表示させると、候補の +一つを選択するために真中のボタンでクリックすることができます。 + +右のマウスのボタンはポップアップメニューを表示しますこのメニューの内容 +は今のモードに依存し、普通は使用し易いように2、3の良く使われるコマン +ドを含んできます。 + +>> 右マウスボタンを押してください。 + +メニューを表示させ続けるためにはボタンを押し続ける必要があります。 + + +*コマンドの拡張 +================ + +XEmacs には、コントロール文字やメタ文字に割当られるよりもずっとずっと +多くのコマンドがあります。これらを扱うために、拡張(eXtend)コマンドを 使います。それには、以下の2つの種類があります。 C-x 文字による拡張。続けて一文字を入力します。 ESC x 名前による拡張。続けてコマンドの名前を入力します。 - これらは一般に、便利だけれども、これまで見てきたものほど頻繁には用いら -れないコマンドのためのものです。C-x C-f (ファインド)や C-x C-s(セーブ) -はこの仲間です。他に、C-x C-c(エディタの終了)もそうです。 +これらは、一般的には便利だけれども、これまで見てきたものほどは頻繁に用 +いられないコマンドです。C-x C-f (ファイルを開く)や C-x C-s(ファイル +をセーブ)はこの仲間です。他に、C-x C-c(XEmacs を終了)もそうです。 +C-x C-c に関しては、それまでに加えた変更が無くなるのを心配する必要はあ +りません。XEmacs を終了させる前に変更された各ファイルをセーブするかど +うか聞いてきますから。 - C-zはEmacsを抜けるのに良く使われる方法です。Emacsを終了することなく、 -一旦、cshのレベルに戻るには一番良い方法と言えるでしょう。C-zを行なわれても -Emacsはストップしているだけで、内容が破壊されるということはありません。 +C-z は「一時的に」 XEmacs を抜けるコマンドです。また同じ XEmacs セッショ +ンに戻ることができます。 -注意: ただしX-windowで行なっている場合、もしくは使用しているシェル - がshの時は、この限りではありません。 +それができるシステム上なら、C-z は XEmacs を「中断」させます。つまり +XEmacs を終了することなく、コマンドシェルに戻ることができます。大方の +標準的なシェルなら、`fg' コマンドもしくは `%emacs' によって XEmacs を +再開できます。 +「中断」機能を実装していないシステムでは、C-z は XEmacs の下で走るサブ +シェルを作り、他のプログラムを走らせてからまた XEmacs に戻ることができ +るようにします。この場合本当に XEmacs から抜け出るわけではありませんの +で、シェルコマンドの `exit' がそのサブシェルから XEmacs に戻る普通のや +り方です。 - C-x コマンドは、たくさんあります。すでに学んだものは以下のものです。 +C-x C-c はログアウトしようと思う時に使うものです。メールツール(mail +コマンド等)やその他の様々なアプリケーションプログラムが起動した +XEmacs から抜け出る場合に使うのも正しい使い方です。これらのプログラム +は XEmacs の中断にどう対処して良いか知らないでしょうから。しかしながら、 +普通の場合は、ログアウトしようしない限りは XEmacs を終了させるよりは +C-z で中断させる方が良いでしょう。 - C-x C-f ファイルの編集(Find) - C-x C-s ファイルの保存(Save) - C-x C-b バッファリストの表示 - C-x C-c エディタを終了する。ファイルの保存は、自動的には行われませ - ん。しかし、もしファイルが変更されていれば、ファイルの保存 - をするのかどうかを聞いてきます。保存して終了する普通の方法 - は、C-x C-s C-x C-c とすることです。 +C-x コマンドはたくさんあります。これまでに、以下を学びました。 - 名前による拡張コマンドには、あまり使われないものや、特定のモードでしか -使わないものなどがあります。例として、"command-apropos" をとりあげます。こ -のコマンドはキーワードを入力させ、それにマッチする全てのコマンドの名前を表 -示します。ESC x とタイプすると、スクリーンの下に "M-x" が表示されます。これ -に対して、実行するコマンドの名前(今の場合、"command-apropos")を入力します。 -"command-a" まで入力した後スペースを入れれば、後の部分は自動的に補われます。 -この後、キーワードを聞かれますから、知りたい文字列をタイプします。なお、キー -ワードを入れないと、全てのコマンドが表示されます。 + C-x C-f ファイルを開く(Find) + C-x C-s ファイルのセーブ(Save) + C-x C-b バッファのリストアップ + C-x C-c XEmacs を終了 + C-x u 取り消し - >> ESC x をタイプし、続けて、"command-apropos" あるいは - "command-a" とタイプします。次に、"kanji" - とタイプします。 +名前による拡張コマンドには、あまり使わないものや、特定のモードでしか使 +わないものがあります。たとえば replace-string ですが、これは文字列を置 +換するものです。M-x をタイプすると、XEmacs は画面の最下行に M-x と表示 +し入力を促すので、そこにコマンドの名前(この場合 "replace-string")を +入れなければなりません。"repl s" とだけタイプすると XEmacs がコマ +ンド名を補完してくれます。コマンド名を入れたら を打って下さい。 - 現れた「ウィンドウ」を消すには、C-x 1 とタイプします。 +"Replace string" コマンドには引数が二つ必要です。どの文字列をどう置換 +するかです。各引数を入力するたびに を打って下さい。 -モードライン -============ - もしゆっくりとコマンドを打ったならば、画面の下底のエコーエリアと呼ばれ -る場所に打ったものが表示されます。エコーエリアは画面の1ばん下の行です。その -すぐ上の行は、モードラインと呼ばれています。モードラインはこんな風に表示さ -れているでしょう。 +>> カーソルをここから2行下の空行に移動させて下さい。 + M-x repl schangedAltered とタイプしましょう。 - [--]J:--**-Mule: MULE.tut (Fundamental) ---NN%-------------- + この行がどう変わるか(changed)見ましょう。あなたはカーソル以降全部の + c-h-a-n-g-e-d という語を "altered" に変えたのです。 -注意: NN%のNNは数字が入っています。あなたが使っているEmacsのモー - ドラインと違うかも知れないけど、慌てないように。例えば、時間 - やuptimeが表示されているのは、display-timeという機能が動いて - いるからです。 +*自動セーブ +============ - この行によって多くの有用な情報が得られます。 +ファイルに変更を加えてまだセーブしていない場合、それらの変更は計算機が +クラッシュすると失われてしまう可能性があります。そういう事態を避けるた +め、編集中の各ファイルについて自動セーブファイルが定期的に書かれます。 +自動セーブファイルは頭とお尻に # が付いています。例えば "hello.c" とい +うファイルの自動セーブファイルは "#hello.c#" です。通常の方法でファイ +ルをセーブしたときに、そういう自動セーブファイルは消されます。 +計算機がクラッシュした場合、自動セーブされた編集を回復させることができ +ます。普通にファイル(編集していたもので、自動セーブファイルじゃありま +せん)を開き、それから M-x recover file とタイプするのです。確 +認を求めてきますので、yes とタイプし自動セーブされたデータを回 +復します。 - 今、あなたが見ているファイル名を表示しています。NN%は現在スクリーン上 -にファイルの一番上から何パーセント目が表示されているかを示しています。ファ -イルの一番最初を表示しているならば、--Top--と表示されてます。ファイルの一番 -最後を表示しているならば、--Bot--と表示されます。画面の中にファイルの全てが -表示されているならば、--All--と表示されます。 - モードラインの小括弧の中は、今どんなモードに入っているかを示しています。 -現在は、デフォルトのFundamentalに入っています。これもメジャーモードの一例で -す。 +*エコーエリア +============== - EmacsはLisp modeやText modeのようなことなるプログラム言語やテキストに -対してエディットを行うための幾つかのメジャーモードを持っています。どんな時 -でも必ずいずれかのメジャーモードの状態になっています。 +もしゆっくりとコマンドを打ったならば、画面の下のエコーエリアと呼ばれ +る場所に打ったものが表示されます。エコーエリアは画面の最下行です。 - それぞれのメジャーモードは幾つかのコマンドを全く違う振る舞いにしてしま -います。例を上げてみましょう。プログラムの中にコメントを作るコマンドがあり -ます。コメントをどの様な形式にするかは、各プログラム言語によって違いますが、 -それぞれのメジャーモードは、きちんと入れてくれます。 - それぞれのメジャーモードに入るためのコマンドはモード名の拡張されたもの -になっています。例えば、M-x fundamental-modeはFundamentalに入るためのもので -す。 +*モードライン +============== - もし、英語をエディットするならば、Text modeに入ります。 +エコーエリアのすぐ上の行は、モードラインと呼びます。モードラインはこんな風に見えるでしょう。 - >> M-x text-mode とタイプしなさい。 +ISO7-----XEmacs: TUTORIAL.ja (Fundamental)--L670--58%---------------- - 現在のメジャーモードについてのドキュメントを見たい時は、C-h mとタイプ -します。 +この行は XEmacs の状態及び編集中の文章について有益な情報を与えてくれま +す。 - >> C-h m を使ってText modeとFundamental modeの違いを調べなさい。 +ファイル名についてはもう分っていますね。それはあなたが開いたファイルで +す。-NN%-- は文章中の現在位置を示しています。文章の NN% が画面最上段よ +り前にあるということです。もし文章の最初の行が画面にある時には --00%-- +の代りに --Top-- と表示します。もし文章の最後の行が画面にある時には +--Bot-- と表示します。もし画面に全部収まってしまうような短い文章を見て +いるときには --All-- と表示します。 + +括弧に囲まれた部分はどうな編集モードにいるかを示します。デフォルトは +"Fundamental" というモード、これが現在のモードです。これは「メジャーモー +ド(major mode)」の一例です。 + +XEmacs には多くの種類のメジャーモードがあります。Lisp mode やText mode +のように、どんなプログラム言語やどんな種類の文章を編集中かを意味するも +のもあります。いつでも必ずいずれかのメジャーモードの状態になっています。 +どのメジャーモードにいるのかは、モードラインの現在は "Fundamental" と +表示している部分を見れば分ります。 + +各メジャーモードは幾つかのコマンドに異なる振る舞いをさせます。例えば、 +プログラムリスト中にコメントを入れるためのコマンドがあります。コメント +の形式(シンタックス)は、プログラム言語によって異なり、メジャーモード +は、それに対応する言語に合った形式でコメントを挿入します。各メジャーモー +ドは拡張コマンドの名前になっています。つまりその拡張コマンドを使ってメ +ジャーモードを切り換えるのです。例えば、M-x fundamental-mode というの +は Fundamental モードに切り換えるためのコマンドです。 + +もし、通常の英語や日本語の文章(このファイルのような)を編集するのなら +ば、Text mode を使いましょう。 + +>> M-x text-mode とタイプしてみて下さい。 + +心配しないで。これまで学んだコマンドはたいして変わりませんから。だけど、 +M-f や M-b がアポストロフィ "'" を単語の一部だと解釈するようになったの +が分るでしょう。以前の Fundamental モードでは M-f や M-b は "'" を単語 +の区切りと見なしていました。 + +メジャーモードはこのように些細な違いを生みます。大概のコマンドはどのメ +ジャーモードでも同じ働きをしますが、実際の動きは少しだけことなるのです。 + +現在のメジャーモードについての説明文を見るには C-h m とタイプします。 + +>> C-u C-v を一二度やってこの行を画面の上の方に持っていきましょう。 +>> C-h m とタイプし、Text mode と Fundamental mode の違いをみましょう。 +>> q で Text mode の説明文を画面から消しましょう。 + +メジャーモードが「メジャー」というからには「マイナーモード」もあります。 +マイナーモードはメジャーモードの代わりになるものではなく、それをちょっ +とだけ修正するものです。各マイナーモードは、メジャーモードや他のマイナー +モードに影響を与えずに、それだけをオンオフできます。つまり、マイナーモー +ドを全く使わなかったり、一個だけ使ったり、いくつかを同時に使ったりでき +るのです。 + +通常の文章を編集している時にとても便利なマイナーモードの一つにオートフィ +ル(Auto Fill)モードというのがあります。このモードがオンの時に文章を +入力していって行を長くしすぎた場合、自動的に単語と単語の間で行が分割さ +れます(日本語の場合はどの文字の間でも)。 + +Auto Fill モードは M-x auto-fill-mode とやればオンにできます。 +それがオンの状態で M-x auto-fill-mode とやれがオフにできます。 +このコマンドは、モードがオフならオンに、オンならオフにするのです。こう +いうのを「モードをトグルする」と言います。 + +>> M-x auto-fill-mode とタイプして、 "asdf " で始まる行を入力 + して下さい。行が分割されるまで何度も "asdf " とタイプしましょう。ス + ペースを忘れずに。Auto Fill はスペースが入力された時のみ働きます。 + +右マージンは通常 70 文字(カラム)ですが、C-x f コマンドでこれを変更す +ることができます。指定の文字数を数値引数として与えます。 + +>> 数値引数 20 で C-x f をやりましょう。 (C-u 2 0 C-x f)。 + それから適当な文章(英語)を入力し、20 文字で行が分割されるのを見て + みましょう。それから C-x f コマンドでまたマージンを 70 文字に戻して + 下さい。 + +パラグラフの途中を変更しても Auto Fill モードはそれを自動的にフィルし +直しはしません。 +パラグラフをフィルし直すにはカーソルをそのパラグラフの中に置いてから +M-q をタイプします。 + +>> カーソルをこの行直前のパラグラフに移動させ M-q とタイプして下さい。 + +*検索 +====== - >> C-x 1でドキュメントを画面から消しなさい。 +文章中の特定の文字列を、前向きにも後向きにも探す事ができます。文字列を +探すというのはカーソル移動コマンドです。つまり、次にその文字列が現れる +場所までカーソルを移動させるのです。 - 左端の '[--]' は現在のキー入力のモードを示しています。[--] の時には -英語アルファベットがそのまま入力できます。入力モードについての詳しい説明は -「たまご」のマニュアルを調べて下さい。 +XEmacs の検索コマンドは他の大概のエディタの検索コマンドとは異り「イン +クリメンタル」です。検索する文字列をタイプしているそばから検索が起るの +です。 - そのすぐ右にはコード体系 (coding-system) に関するフラグの状態が表 -示されています。Mule は、ファイル入出力、入力、画面出力について、それぞれ独 -立にコード体系を指定させることが出来ますが、通常はファイル用のコード体系の -ニーモニックのみ表示しています。 +検索を始めるためのコマンドは、前向きに検索するならば C-s、後向きなら +C-r です。まだです!!今はまだ試さないで下さい。 - >> モードライン上に"J:","S:",もしくは "E:"が表示されているかどうか確 - 認しなさい。 +C-s を打つと "I-search" という文字列がエコーエリアに表示されるのが見え +るでしょう。これは XEmacs がインクリメンタル検索という状態にいて、あな +たが探したい文字列を入力するのを待っているのです。 を打てば検 +索を終われます。 - 最初の一文字がコード体系のニーモニック、次の ':' が現在英語以外の文字 -(日本語、中国語など)もちゃんと表示するということを示しています。JはJUNET -で使われている JIS コード、S は Shift-JIS、E は日本語EUC を示しています。 -多国語の表示の有無は C-x C-k t で ON/OFFのトグルができます。 +>> さて C-s とタイプして検索を始めましょう。ゆっくりと1文字ずつ + "cursor" という単語を入力します。1文字打つ毎にカーソルがどう動くか + 見ましょう。 + さあ、"cursor" が1回見つかりました。 +>> もう一度 C-s と打って次の "cursor" を見つけましょう。 +>> 今度は を4回打って、カーソルの動きを見て下さい。 +>> と打って検索を終了しましょう。 - 次の例は、一度多国語表示をOFFしてから、もう一度ONを行ってみます。 +何が起ったか分りますか?インクリメンタル検索では、便利なためにハイライ +トをし、あなたがそれまでに打った文字列が現れるところに行こうとします。 +次の "cursor" に行くにはもう一度 C-s と打ちます。もしもうそういう文字 +列が無かったら、ベルをならして検索が現在は失敗していることを知らせます。 +C-g を打てば検索を終われます。 - >> C-x C-k tを2度行いなさい。 +注意:システムによっては C-s とタイプすると画面が動かなくなり XEmacs +が表示しようとするものが何も画面に出なくなります。これは、フローコント +ロールと呼ばれるOSの機能が C-s を捉え、XEmacs に渡さないようにしてい +るのです。これを解除するには C-q をタイプします。それから XEmacs マニュ +アルの "Spontaneous Entry to Incremental Search (知らぬ間にインクリメ +ンタルサーチになる)" の節を読んでください。このやっかいなOSの機能に +どう対処すれば良いかが載っています。 - 入力モードがJISコードの設定となっている時、もしあなたの使っている端末 -にメタ・キーが付いているなら、エスケープ・キーの代わりにそれを使うことが出 -来ます。その時、メタ・キーの使い方はコントロール・キーと同様に押しながら文 -字をタイプします。ESC <文字>もM-<文字>も同じ働きをします。今までの説明でESC -<文字>と行なっていたところが、M-<文字>となります。注意しなければならないの -は、シフトJISやEUCコードの時は使用できません。 +インクリメンタル検索の途中で を打つと検索文字列中の1番後ろの +文字が消えます。そして、カーソルは、前回の位置に戻ります。たとえば、 +"c" とタイプして最初の "c" を探します。それから "u" を打つと最初の +"cu" の場所にカーソルが動きます。そこで を打つと "u" を検索文 +字列から消して、カースルは最初に "c" が現れた場所に戻ります。 - コード体系のの切り替えは、各々のバッファに対してのみ有効です。それぞれ -の、コード体系指定については、C-h a coding-system で見ること -が出来ます。 - >> C-h a coding-system で出てくるドキュメント中の、 - set-display-coding-system, set-file-coding-system, - set-process-coding-system の説明を読みなさい。 +C-s は、現在のカーソル位置以降に出てくる検索文字列を探し始めます。もし、 +文章の前の方を探したかったら、C-r をタイプします。これまでの C-s につ +いての説明はすべて C-r にも当てはまります。検索の方向が反対なだけです。 -検索 -===== +*複数のウィンドウ +================== - 文字列を、ファイル内で、前方又は後方に、探す事ができます。検索を始める -コマンドは、カーソル位置以降を検索するならば C-s、カーソル位置以前ならば -C-r です。C-s をタイプすると、エコーエリアに "I-search:"という文字列がプロ -ンプトとして表示されます。ESCを押すと、終了できます。 +XEmacs の素敵な機能の一つとして、一つの画面に同時にいくつものウィンド +ウを表示することができます。 +>> カーソルをこの行に持ってきて C-u 0 C-l とタイプして下さい。 - >> C-sで検索が始まります。それから、ゆっくりと1文字ずつ"cursor"とい - う単語を入力します。1文字入力するごとに、カーソルは、どんな動き - をしますか? +>> それから C-x 2 とタイプし画面を2つのウィンドウに分割しましょう。 + どちらのウィンドウもこの入門ガイドを表示しています。カーソルは上の + ウィンドウにあります。 - >> もう1度 C-s をタイプすると、次の"cursor"を見つけられます。 +>> C-M-v とタイプし下のウィンドウをスクロールさせましょう。 + (メタキーがない場合は ESC C-v とタイプします。) - >> を4回入力して、カーソルの動きを見なさい。 +>> C-x o ("o" は "other(他方)" を意味します)をタイプし下のウィンド + ウにカーソルを移して下さい。 +>> 下のウィンドウで C-v や M-v を使ってスクロールさせましょう。 + ここに書いてある指示は上のウィンドウで読み進んでください。 - >> ESCを押して、終了します。 +>> もう一度 C-x o とタイプし、カーソルを上のウィンドウに戻します。 + カーソルは上のウィンドウの元あった位置に戻ります。 - 探したい文字列をタイプ中でも、タイプした文字部分だけで、検索を始めます。 -次の文字を探すには、再びC-sをタイプします。もし、文字列が存在しなかったら、 -メッセージが表示されます。C-g でも終了できます。 +C-x o を使ってウィンドウ間を行ったり来たりできます。各ウィンドウはそれ +自身のカーソル位置を保持していますが、一度には一つのウィンドウだけがカー +ソルを表示します。通常の編集コマンドは皆カーソルがあるウィンドウに対し +て働きます。そのウィンドウを "selected window (選択中のウィンドウ)" と +呼びます。 - 検索実行中にを入力すると、検索文字列の1番後ろの文字が消えます。 -そして、カーソルは、前回の位置に戻ります。たとえば、"cu"とタイプして、最初 -の"cu"の位置にカーソルが動いたとします。ここでを入力すると、サーチ -ラインの'u'が消え、カーソルは、'u'をタイプする前に、カーソルがあった'c'の位 -置に、移動します。 +C-M-v コマンドは、一つのウィンドウで文章を編集中に他のウィンドウを参照 +している時に役立ちます。編集中の場所にカーソルを保ったまま、C-M-v で他 +のウィンドウを読み進めて行くことができます。 - 検索実行中に、C-s や C-r 以外のコントロール文字をタイプすると、検索は -終了します。 +C-M-v はコントロールメタ文字の一例です。メタキーがある場合は、コントロー +ルキーとメタキーを押しながら v をタイプします。コントロールキーとメタ +キーはどちらを先に押しても構いません。どちらもその後にタイプされる文字 +に対する修飾キー (modifier key) として働くからです。 - C-s は、現在のカーソル位置以降に出てくる検索文字列を探します。もし、前 -の方を探したかったら、C-r をタイプすることで、逆方向検索ができます。C-s と -C-r は、検索の方向が反対なだけで、全て同じ働きをします。 +メタキーが無い場合、ESC キーを使いますが、この場合順番が大事です。まず +ESC を押してから離して CTRL-v を打ちます。CTRL-ESC v では駄目です。こ +れはESC はそれ自体が一つの文字で修飾キーではないからです。 -リカーシブ エディティング レベル +>> 上のウィンドウで C-x 1 とタイプし下のウィンドウを消しましょう - ときどき、(不本意に)リカーシブ エディティング レベルと呼ばれる状態に -入ることがあります。メジャーモードの小括弧'()'の回りを中括弧'[]'で囲んだも -のがモードライン上に表示されます。例えば、(Fundamental)と表示される代わりに -[(Fundamental)]のようになります。 +(もし下のウィンドウで C-x 1 とタイプすると上のウィンドウが消えます。 +このコマンドは「現在自分がいるウィンドウだけにしなさい」というものだと +思って下さい。) -注意: ここではリカーシブ エディティング レベル自体については説明し - ません。 +同じバッファを両方のウィンドウに表示する必要はありません。一方のウィン +ドウで C-x C-f でファイルを開いても他方のウィンドウは変化しません。各 +ウィンドウにおいて別々のファイルを開くことができるのです。 - リカーシブ エディティング レベルから抜けでるためには、M-x top-level -とタイプします。 +>> C-x 4 C-f とタイプし続けて何か自分のファイル名を入力して下さい。 + で入力を終わらせて下さい。今指定したファイルが下のウィンド + ウに現れます。カーソルもそっちに移ります。 - >> 試してみて下さい。スクリーンの底に"Back to top level"と表示されま - す。 +>> C-x o とタイプし上のウィンドウに戻って下さい。それから C-x 1 で下の + ウィンドウを消しましょう。 - 本当は、この試みが行われた時は、すでにトップレベルにいたのです。M-x -top-levelは、何も影響を与えていません。 - リカーシブ エディティング レベルから抜け出るのに対してはC-gは効きませ -ん。 +*再帰編集レベル (RECURSIVE EDITING LEVELS) +時々(不本意に)再帰編集レベルと呼ばれる状態に入ることがあります。モー +ドラインのメジャーモード名を囲む丸括弧 "()" がさらに鉤括弧 "[]" で囲ま +れます。例えば、(Fundamental) と表示される代わりに [(Fundamental)] の +ようになります。 -ヘルプ -====== +再帰編集レベルから抜け出すには ESC ESC ESC とタイプします。これは汎用 +「抜け出し」コマンドです。余分なウィンドウを消したり、ミニバッファから +抜けたりするのにも使えます。 - Emacsには、たくさんの役に立つ機能があり、ここで、すべてを説明すること -は、不可能です。しかし、まだ知らない多くの機能を学ぶためには、と呼ば -れる C-h をタイプすることで、たくさんの情報を手に入れることができます。 - 使い方は、C-h をタイプし、続いて必要なオプションを1文字タイプします。 -わからなければ、C-h ? とタイプすると、どんなオプションがあるのか表示されま -す。もし、C-h をタイプしてから気が変わったら、C-g をタイプすれば、取り消す -ことができます。 +>> M-x とタイプしミニバッファに入って下さい。それから ESC ESC ESC とタ + イプし抜け出してみましょう。 - 最も基本的なものは、C-h c です。これに続いてキーを入力すると、そのコマ -ンドについての短い説明を表示します。 +C-g では再帰編集レベルからは抜け出せません。これは、C-g が再帰編集レベ +ル内でのコマンドや引数を取り消すのに使われているからです。 - >> C-h c C-p とタイプしてみなさい。"C-p runs the command previous- - line"のようなメッセージが表示されるはずです。 - 見たことはあるが、覚えてはいないコマンドも思い出せるのです。C-x C-s の -ような複数で1つのコマンドもC-h c の後ろに続けられます。 +*もっともっとヘルプ +==================== - もっと詳しく知りたかったら、c の代わりに k を指定します。 +この入門ガイドでは XEmacs を使い始めるのに十分な情報を提供したつもりで +す。XEmacs にはあまりにも多くの機能があるので、ここですべてを説明する +のは無理です。それでも役に立つ機能をもっと多く学びたいと思う人のために +は、XEmacs のコマンドの説明を読むためのコマンドがあります。これらの +「ヘルプ」コマンドは皆 Control-h 文字(ヘルプ文字と呼びます)で始まり +ます。 + +ヘルプ機能を使うには、C-h に続いてどんな種類のヘルプが必要かを示す1文 +字をタイプします。もしそれすら分らない場合は C-h ? とタイプしましょう。 +どんな種類のヘルプを提供できるかが示されます。もし、C-h をタイプしてか +ら気が変わったら、C-g をタイプして取り消すことができます。 - >> C-h k C-p とタイプしてみなさい。 +(サイトによっては C-h 文字を再束縛します。総括的な手段としてそんなこ +とをするべきではありません。そういう場合はシステム管理者に文句を言いま +しょう。ま、ともかく、もし C-h が画面の下の方にヘルプのメッセージを出 +さなければ、M-x help RET を試してみて下さい。) - Emacsのウィンドウに、コマンドの名前と機能が表示されます。読み終えたら、 -C-x 1 とタイプすると、抜けられます。 +最も基本的なヘルプ機能は C-h c です。C-h、それから c、そしてコマンドの +文字若しくはそのシーケンスをタイプすると、そのコマンドについての短い説 +明を表示します。 - 他にも役に立つオプションがあります。 +>> C-h c Control-p とタイプしてみましょう。 + 以下のようなメッセージが表示されるはずです。 - C-h f ファンクション名を入力すると、ファンクションを表示します。 + C-p runs the command previous-line - >> C-h f previous-line をタイプし、 を押しなさい。C-p コマン - ドを実行するファンクションについての情報を表示します。 +これは「ファンクションの名前」を表示したのです。ファンクション名は主に +XEmacs をカスタマイズしたり拡張したりするのに使われます。しかし、ファ +ンクション名はそのコマンドが何をするものなのかが分るように付けられます +ので、簡単な説明としてもそのまま役に立ちます。一度学んだコマンドについ +て思い出すには十分です。 - C-h a キーワードを入力すると、名前にそのキーワードを含む、全てのコ - マンドを表示します。これらのコマンドはすべてESC x で実行でき - ます。 +C-x C-s や(メタキーやアルトキーがない場合の) v などの複数文字 +のコマンドを C-h c の後にタイプすることもできます。 - >> C-h a file とタイプし、を押しなさい。名前に"file"という文 - 字を持つ全てのコマンドを表示します。また、find-file や write-file - という名の C-x C-f や C-x C-w のようなコマンドも表示されます。 +コマンドについてもっと多くの情報が欲しければ C-h c の代わりに C-h k を +使います。 -おわりに -======== +>> C-h k Control-p とタイプしてみましょう。 -忘れずに: 終了するには、C-x C-c とします。 +XEmacsのウィンドウに、コマンドの名前と同時にその機能の説明が表示されま +す。読み終えたら、q とタイプしてヘルプのテキストを消しましょう。 +C-h には他にも役に立つオプションがあります。 - この入門編は、まったくの初心者にもわかりやすいようにと意図しています。 -ですから、もし何かわかりにくい点があったなら、一人で愚痴を言うのではなく、 -文句をつけて下さい。 + C-h f ファンクションの説明。ファンクション名を入力します。 +>> C-h f previous-line とタイプしてみましょう。 + C-p コマンドを実行するファンクションについてのすべての情報を表示し + ます。 - もし、EMACS を何日かでも使ってみれば、それをやめてしまうことなどできな -くなるでしょう。最初は戸惑うかも知れません。しかし、それはどんなエディタで -も同様です。EMACS のように、非常に多くのことができる場合には特にそうでしょ -う。そして、EMACS では、実際、何でもできるのですから。 + C-h a ハイパーアプロポス。キーワードを入力すると、そのキーワー + ドを名前に含む全ての関数と変数をリストアップします。 + Meta-x で起動できるコマンドには左側にアスタリスクが付 + きます。 +>> C-h a newline とタイプしてみて下さい。 +"newline"という文字列を名前の一部に持つ全ての関数と変数を表示します。 +関数や変数をより詳しく知るために か真中のマウスボタンを押して +ください。hyper-apropos を終了するためには `q' を入力します。 -謝辞 -===== - この文書は、JUNETで流された"日本語 MicroEMACS (kemacs) 入門編" をGNUE- -macs (Nemacs)のTutorial用に書き換えたものです。 - Jonathan Payne による "JOVE Tutorial" (19 January 86) を変更したもので - あり、それはもともとは、CCA-UNIXのSteve Zimmerman によって変更された、 - MIT の "Teach-Emacs" 入門編 (31 October 85) を(さらに)変更したもので - した。 +*おわりに +========== - Update - February 1986 by Dana Hoggatt. +忘れないで!XEmacs を終了するには、C-x C-c です。また XEmacs に戻って +来られるように一時的にシェルに戻るだけなら C-z です。(X では、これは +現在の XEmacs のフレームをアイコン化します。) - Update - December 1986 by Kim Leburg. +この入門ガイドは、まったくの初心者にもわかりやすいようにと意図していま +す。ですから、もし何かわかりにくい点があったなら、自分を責めないで文句 +をつけて下さい。 - Update/Translate - July 1987 by SANETO Takanori -特別な謝辞 -========== +*この翻訳版についての謝辞 +========================== + +この文書は XEmacs Ver.21.2 付属の英語版の入門ガイドを日本語に翻訳した +ものです。その際、Emacs 付属の日本語ガイドを元に修正しました。その日本 +語ガイドは、元は SANETO Takanori 氏が日本語 MicroXEmacs(kemacs) 入門編 +として翻訳され、それを鈴木裕信氏 がNemacs/Mule 用 +に変更、さらに吉田茂樹氏が修正されたものです。これらの方々に深く感謝し +ます。 - 最初にこれの日本語訳を作られた、SANETO Takanoriさん。この文章はGMW + -Wnn + Nemacsを使って書きました。そのような素晴らしいプログラムを作った方々 -へ感謝の意を表したいと思います。翻訳とか、入力とかを色々と手伝ってくれた、 -藤原祥子さん、どうもありがとう。 +*著作権表示 +============ +ここに元の英語版の著作権表示をそのまま付けます。この翻訳版もこれに従い +ます。 +This tutorial descends from a long line of Emacs tutorials +starting with the one written by Stuart Cracraft for the original Emacs. +Ben Wing updated the tutorial for X Windows. Martin Buchholz and +Hrvoje Niksic added more corrections for XEmacs. +This version of the tutorial, like XEmacs, is copyrighted, and comes +with permission to distribute copies on certain conditions: -誤訳、嘘、その他、の文責は、以下の者にあります。 +Copyright (c) 1985, 1996 Free Software Foundation - 鈴木裕信 hironobu@sra.co.jp + Permission is granted to anyone to make or distribute verbatim copies + of this document as received, in any medium, provided that the + copyright notice and permission notice are preserved, + and that the distributor grants the recipient permission + for further redistribution as permitted by this notice. + Permission is granted to distribute modified versions + of this document, or of portions of it, + under the above conditions, provided also that they + carry prominent notices stating who last altered them. -Update/Add - December 1987 by Hironobu Suzuki -Update/Add - November 1989 by Ken'ichi Handa -Update/Add - January 1990 by Shigeki Yoshida -Update/Add - March 1992 by Kenichi HANDA +The conditions for copying XEmacs itself are more complex, but in the +same spirit. Please read the file COPYING and then do give copies of +XEmacs to your friends. Help stamp out software obstructionism +("ownership") by using, writing, and sharing free software! diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 07877cd..4fd173f 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,7 @@ +2000-02-21 Martin Buchholz + + * XEmacs 21.2.30 is released. + 2000-02-16 Martin Buchholz * XEmacs 21.2.29 is released. diff --git a/lib-src/movemail.c b/lib-src/movemail.c index 941ada9..6fa783e 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c @@ -204,7 +204,9 @@ struct option longopts[] = #define DEFAULT_LOCKING DOTLOCKING #endif +#ifndef DISABLE_DIRECT_ACCESS static void lock_dot(char *); +#endif static void unlock_dot(char *); static int parse_lock_method(char *); static char *unparse_lock_method(int); @@ -566,6 +568,7 @@ dot_filename(char *filename) static char *dotlock_filename = NULL; +#ifndef DISABLE_DIRECT_ACCESS static void lock_dot(char *filename) { @@ -625,6 +628,7 @@ lock_dot(char *filename) } strcpy(dotlock_filename, filename); } +#endif /* not DISABLE_DIRECT_ACCESS */ static void unlock_dot(char *filename) diff --git a/lisp/about.el b/lisp/about.el index 47f7768..ea2061c 100644 --- a/lisp/about.el +++ b/lisp/about.el @@ -71,7 +71,7 @@ (jmiller "Jeff Miller" "jmiller@smart.net") (juhp "Jens-Ulrik Holger Petersen" "petersen@kurims.kyoto-u.ac.jp") (jwz "Jamie Zawinski" "jwz@jwz.org") - (kazz "IENAGA Kazuyuki" "ienaga@jsys.co.jp") + (kazz "IENAGA Kazuyuki" "ienaga@xemacs.org") (kyle "Kyle Jones" "kyle_jones@wonderworks.com") (larsi "Lars Magne Ingebrigtsen" "larsi@gnus.org") (marcpa "Marc Paquette" "marcpa@CAM.ORG") diff --git a/lisp/buffer.el b/lisp/buffer.el index c829284..002ce0d 100644 --- a/lisp/buffer.el +++ b/lisp/buffer.el @@ -60,11 +60,10 @@ the window-buffer correspondences." (set-buffer-major-mode buf)))) (push-window-configuration) (set-buffer buf) - (or norecord (record-buffer buf)) (set-window-buffer (if (eq (selected-window) (minibuffer-window)) (next-window (minibuffer-window)) (selected-window)) - buf) + buf norecord) buf)) (defun pop-to-buffer (bufname &optional not-this-window-p on-frame) diff --git a/lisp/byte-optimize.el b/lisp/byte-optimize.el index 6c4847e..2ab79db 100644 --- a/lisp/byte-optimize.el +++ b/lisp/byte-optimize.el @@ -473,6 +473,10 @@ (byte-compile-log " all subforms of %s called for effect; deleted" form)) (and backwards + ;; Now optimize the rest of the forms. We need the return + ;; values. We already did the car. + (setcdr backwards + (mapcar 'byte-optimize-form (cdr backwards))) (cons fn (nreverse backwards)))) (cons fn (mapcar 'byte-optimize-form (cdr form))))) @@ -699,33 +703,37 @@ (setq form (byte-optimize-delay-constants-math form 1 '+)) (if (memq 0 form) (setq form (delq 0 (copy-sequence form)))) ;;(setq form (byte-optimize-associative-two-args-math form)) + (case (length (cdr form)) - ((0) + ((0) ; (+) (condition-case () (eval form) (error form))) - ;; `add1' and `sub1' are a marginally fewer instructions - ;; than `plus' and `minus', so use them when possible. - ((2) - (cond - ((eq (nth 1 form) 1) `(1+ ,(nth 2 form))) ; (+ 1 x) --> (1+ x) - ((eq (nth 2 form) 1) `(1+ ,(nth 1 form))) ; (+ x 1) --> (1+ x) - ((eq (nth 1 form) -1) `(1- ,(nth 2 form))) ; (+ -1 x) --> (1- x) - ((eq (nth 2 form) -1) `(1- ,(nth 1 form))) ; (+ x -1) --> (1- x) - (t form))) - ;; It is not safe to delete the function entirely - ;; (actually, it would be safe if we know the sole arg + ;; (actually, it would be safe if we knew the sole arg ;; is not a marker). - ;; ((null (cdr (cdr form))) (nth 1 form)) - (t form))) + ;; ((1) + ;; (nth 1 form)) + + ((2) ; (+ x y) + (byte-optimize-predicate + (cond + ;; `add1' and `sub1' are a marginally fewer instructions + ;; than `plus' and `minus', so use them when possible. + ((eq (nth 1 form) 1) `(1+ ,(nth 2 form))) ; (+ 1 x) --> (1+ x) + ((eq (nth 2 form) 1) `(1+ ,(nth 1 form))) ; (+ x 1) --> (1+ x) + ((eq (nth 1 form) -1) `(1- ,(nth 2 form))) ; (+ -1 x) --> (1- x) + ((eq (nth 2 form) -1) `(1- ,(nth 1 form))) ; (+ x -1) --> (1- x) + (t form)))) + + (t (byte-optimize-predicate form)))) (defun byte-optimize-minus (form) ;; Put constants at the end, except the last constant. (setq form (byte-optimize-delay-constants-math form 2 '+)) - ;; Now only first and last element can be a number. - (let ((last (car (reverse (nthcdr 3 form))))) + ;; Now only first and last element can be an integer. + (let ((last (last (nthcdr 3 form)))) (cond ((eq 0 last) ;; (- x y ... 0) --> (- x y ...) (setq form (copy-sequence form)) @@ -735,54 +743,55 @@ (numberp last)) (setq form (nconc (list '- (- (nth 1 form) last) (nth 2 form)) (delq last (copy-sequence (nthcdr 3 form)))))))) - (setq form -;;; It is not safe to delete the function entirely -;;; (actually, it would be safe if we know the sole arg -;;; is not a marker). -;;; (if (eq (nth 2 form) 0) -;;; (nth 1 form) ; (- x 0) --> x - (byte-optimize-predicate - (if (and (null (cdr (cdr (cdr form)))) - (eq (nth 1 form) 0)) ; (- 0 x) --> (- x) - (cons (car form) (cdr (cdr form))) - form)) -;;; ) - ) - - ;; `add1' and `sub1' are a marginally fewer instructions than `plus' - ;; and `minus', so use them when possible. - (cond ((and (null (nthcdr 3 form)) - (eq (nth 2 form) 1)) - (list '1- (nth 1 form))) ; (- x 1) --> (1- x) - ((and (null (nthcdr 3 form)) - (eq (nth 2 form) -1)) - (list '1+ (nth 1 form))) ; (- x -1) --> (1+ x) - (t - form)) - ) + + (case (length (cdr form)) + ((0) ; (-) + (condition-case () + (eval form) + (error form))) + + ;; It is not safe to delete the function entirely + ;; (actually, it would be safe if we knew the sole arg + ;; is not a marker). + ;; ((1) + ;; (nth 1 form) + + ((2) ; (+ x y) + (byte-optimize-predicate + (cond + ;; `add1' and `sub1' are a marginally fewer instructions than `plus' + ;; and `minus', so use them when possible. + ((eq (nth 2 form) 1) `(1- ,(nth 1 form))) ; (- x 1) --> (1- x) + ((eq (nth 2 form) -1) `(1+ ,(nth 1 form))) ; (- x -1) --> (1+ x) + ((eq (nth 1 form) 0) `(- ,(nth 2 form))) ; (- 0 x) --> (- x) + (t form)))) + + (t (byte-optimize-predicate form)))) (defun byte-optimize-multiply (form) (setq form (byte-optimize-delay-constants-math form 1 '*)) - ;; If there is a constant in FORM, it is now the last element. + ;; If there is a constant integer in FORM, it is now the last element. (cond ((null (cdr form)) 1) ;;; It is not safe to delete the function entirely ;;; (actually, it would be safe if we know the sole arg ;;; is not a marker or if it appears in other arithmetic). ;;; ((null (cdr (cdr form))) (nth 1 form)) - ((let ((last (car (reverse form)))) - (cond ((eq 0 last) (cons 'progn (cdr form))) - ((eq 1 last) (delq 1 (copy-sequence form))) - ((eq -1 last) (list '- (delq -1 (copy-sequence form)))) - ((and (eq 2 last) - (memq t (mapcar 'symbolp (cdr form)))) - (prog1 (setq form (delq 2 (copy-sequence form))) - (while (not (symbolp (car (setq form (cdr form)))))) - (setcar form (list '+ (car form) (car form))))) - (form)))))) + ((let ((last (last form))) + (byte-optimize-predicate + (cond ((eq 0 last) (cons 'progn (cdr form))) + ((eq 1 last) (delq 1 (copy-sequence form))) + ((eq -1 last) (list '- (delq -1 (copy-sequence form)))) + ((and (eq 2 last) + (memq t (mapcar 'symbolp (cdr form)))) + (prog1 (setq form (delq 2 (copy-sequence form))) + (while (not (symbolp (car (setq form (cdr form)))))) + (setcar form (list '+ (car form) (car form))))) + (form))))))) (defun byte-optimize-divide (form) (setq form (byte-optimize-delay-constants-math form 2 '*)) - (let ((last (car (reverse (cdr (cdr form)))))) + ;; If there is a constant integer in FORM, it is now the last element. + (let ((last (last (cdr (cdr form))))) (if (numberp last) (cond ((= (length form) 3) (if (and (numberp (nth 1 form)) @@ -801,13 +810,13 @@ (cond ;;; ((null (cdr (cdr form))) ;;; (nth 1 form)) - ((eq (nth 1 form) 0) - (append '(progn) (cdr (cdr form)) '(0))) - ((eq last -1) - (list '- (if (nthcdr 3 form) - (butlast form) - (nth 1 form)))) - (form)))) + ((eq (nth 1 form) 0) + (append '(progn) (cdr (cdr form)) '(0))) + ((eq last -1) + (list '- (if (nthcdr 3 form) + (butlast form) + (nth 1 form)))) + (form)))) (defun byte-optimize-logmumble (form) (setq form (byte-optimize-delay-constants-math form 1 (car form))) diff --git a/lisp/etags.el b/lisp/etags.el index cba03e0..f68527b 100644 --- a/lisp/etags.el +++ b/lisp/etags.el @@ -771,7 +771,7 @@ Variables of note: '(find-tag find-tag-other-window tags-loop-continue)))) (push-tag-mark)) (if other-window - (pop-to-buffer tag-buf) + (pop-to-buffer tag-buf t) (switch-to-buffer tag-buf)) (widen) (push-mark) @@ -787,7 +787,7 @@ Variables of note: ;;;###autoload (defun find-tag-other-window (tagname &optional next) - "*Find tag whose name contains TAGNAME. + "*Find tag whose name contains TAGNAME, in another window. Selects the buffer that the tag is contained in in another window and puts point at its definition. If TAGNAME is a null string, the expression in the buffer diff --git a/lisp/font-lock.el b/lisp/font-lock.el index be8df46..b942db4 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -2339,8 +2339,9 @@ The name is assumed to begin with a capital letter.") '("\\<\\(false\\|null\\|true\\)\\>" (1 font-lock-keyword-face)) ;; Class names: - (list (concat "\\\\s *" java-font-lock-identifier-regexp) - 1 'font-lock-function-name-face) + (list (concat "\\<\\(class\\|interface\\)\\>\\s *" + java-font-lock-identifier-regexp) + 2 'font-lock-function-name-face) ;; Package declarations: (list (concat "\\<\\(package\\|import\\)\\>\\s *" @@ -2478,7 +2479,7 @@ The name is assumed to begin with a capital letter.") (list - ;; Java doc tags + ;; Javadoc tags '("@\\(author\\|exception\\|throws\\|deprecated\\|param\\|return\\|see\\|since\\|version\\)\\s " 0 font-lock-keyword-face t) @@ -2487,34 +2488,30 @@ The name is assumed to begin with a capital letter.") 1 'font-lock-variable-name-face t) ;; Doc tag - Exception types - (list (concat "@exception\\s +" + (list (concat "@\\(exception\\|throws\\)\\s +" java-font-lock-identifier-regexp) - '(1 (if (equal (char-after (match-end 0)) ?.) + '(2 (if (equal (char-after (match-end 0)) ?.) font-lock-reference-face font-lock-type-face) t) (list (concat "\\=\\." java-font-lock-identifier-regexp) '(goto-char (match-end 0)) nil '(1 (if (equal (char-after (match-end 0)) ?.) 'font-lock-reference-face 'font-lock-type-face) t))) - ;; Doc tag - Exception types - (list (concat "@exception\\s +" - java-font-lock-identifier-regexp) - '(1 (if (equal (char-after (match-end 0)) ?.) - font-lock-reference-face font-lock-type-face) t) - (list (concat "\\=\\." java-font-lock-identifier-regexp) - '(goto-char (match-end 0)) nil - '(1 (if (equal (char-after (match-end 0)) ?.) - 'font-lock-reference-face 'font-lock-type-face) t))) - ;; Doc tag - Cross-references, usually to methods '("@see\\s +\\(\\S *[^][ \t\n\r\f(){},.;:]\\)" 1 font-lock-function-name-face t) + ;; Doc tag - docRoot (1.3) + '("\\({ *@docRoot *}\\)" + 0 font-lock-keyword-face t) + ;; Doc tag - beaninfo, unofficial but widely used, even by Sun + '("\\(@beaninfo\\)" + 0 font-lock-keyword-face t) ;; Doc tag - Links - '("{@link\\s +\\([^}]*\\)}" + '("{ *@link\\s +\\([^}]+\\)}" 0 font-lock-keyword-face t) ;; Doc tag - Links - '("{@link\\s +\\(\\S +\\s +\\S +\\)}" + '("{ *@link\\s +\\(\\(\\S +\\)\\|\\(\\S +\\s +\\S +\\)\\) *}" 1 font-lock-function-name-face t) ))) diff --git a/lisp/info.el b/lisp/info.el index 344adf4..0bcda60 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -413,7 +413,7 @@ nil or `never' never auto-generate a directory listing, (const :tag "if-outdated" if-outdated)) :group 'info) -(defcustom Info-save-auto-generated-dir nil +(defcustom Info-save-auto-generated-dir 'never "*Whether an auto-generated info directory listing should be saved. Possible values are: nil or `never', the default, auto-generated info directory diff --git a/lisp/ldap.el b/lisp/ldap.el index a0eaddf..c27747a 100644 --- a/lisp/ldap.el +++ b/lisp/ldap.el @@ -5,7 +5,7 @@ ;; Author: Oscar Figueiredo ;; Maintainer: Oscar Figueiredo ;; Created: Jan 1998 -;; Version: $Revision: 1.7.2.6 $ +;; Version: $Revision: 1.7.2.7 $ ;; Keywords: help comm ;; This file is part of XEmacs @@ -35,6 +35,10 @@ ;;; Code: +(eval-when '(load) + (if (not (fboundp 'ldap-open)) + (error "No LDAP support compiled in this XEmacs"))) + (defgroup ldap nil "Lightweight Directory Access Protocol" :group 'comm) @@ -145,6 +149,11 @@ Valid properties include: (integer :tag "(number of records)"))))) :group 'ldap) +(defcustom ldap-verbose nil + "*If non-nil, LDAP operations echo progress messages." + :type 'boolean + :group 'ldap) + (defcustom ldap-ignore-attribute-codings nil "*If non-nil, do not perform any encoding/decoding on LDAP attribute values." :type 'boolean @@ -436,8 +445,17 @@ and the corresponding decoder is then retrieved from (cons name (mapcar decoder values)) attr))) +(defun ldap-search (arg1 &rest args) + "Perform an LDAP search." + (apply (if (ldapp arg1) + 'ldap-search-basic + 'ldap-search-entries) arg1 args)) + +(make-obsolete 'ldap-search + "Use `ldap-search-entries' instead or +`ldap-search-basic' for the low-level search API.") -(defun ldap-search (filter &optional host attributes attrsonly withdn) +(defun ldap-search-entries (filter &optional host attributes attrsonly withdn) "Perform an LDAP search. FILTER is the search filter in RFC1558 syntax, i.e., something that looks like \"(cn=John Smith)\". @@ -459,13 +477,16 @@ entry according to the value of WITHDN." (let ((host-plist (cdr (assoc host ldap-host-parameters-alist))) ldap result) - (message "Opening LDAP connection to %s..." host) + (if ldap-verbose + (message "Opening LDAP connection to %s..." host)) (setq ldap (ldap-open host host-plist)) - (message "Searching with LDAP on %s..." host) - (setq result (ldap-search-internal ldap filter - (plist-get host-plist 'base) - (plist-get host-plist 'scope) - attributes attrsonly withdn)) + (if ldap-verbose + (message "Searching with LDAP on %s..." host)) + (setq result (ldap-search ldap filter + (plist-get host-plist 'base) + (plist-get host-plist 'scope) + attributes attrsonly withdn + ldap-verbose)) (ldap-close ldap) (if ldap-ignore-attribute-codings result @@ -474,6 +495,120 @@ entry according to the value of WITHDN." (mapcar 'ldap-decode-attribute record))) result)))) +(defun ldap-add-entries (entries &optional host binddn passwd) + "Add entries to an LDAP directory. +ENTRIES is a list of entry specifications of +the form (DN (ATTR . VALUE) (ATTR . VALUE) ...) where +DN is the distinguished name of an entry to add, the following +are cons cells containing attribute/value string pairs. +HOST is the LDAP host, defaulting to `ldap-default-host' +BINDDN is the DN to bind as to the server +PASSWD is the corresponding password" + (or host + (setq host ldap-default-host) + (error "No LDAP host specified")) + (let ((host-plist (cdr (assoc host ldap-host-parameters-alist))) + ldap + (i 1)) + (if (or binddn passwd) + (setq host-plist (copy-seq host-plist))) + (if binddn + (setq host-plist (plist-put host-plist 'binddn binddn))) + (if passwd + (setq host-plist (plist-put host-plist 'passwd passwd))) + (if ldap-verbose + (message "Opening LDAP connection to %s..." host)) + (setq ldap (ldap-open host host-plist)) + (if ldap-verbose + (message "Adding LDAP entries...")) + (mapcar (function + (lambda (thisentry) + (ldap-add ldap (car thisentry) (cdr thisentry)) + (if ldap-verbose + (message "%d added" i)) + (setq i (1+ i)))) + entries) + (ldap-close ldap))) + + +(defun ldap-modify-entries (entry-mods &optional host binddn passwd) + "Modify entries of an LDAP directory. +ENTRY_MODS is a list of entry modifications of the form + (DN MOD-SPEC1 MOD-SPEC2 ...) where DN is the distinguished name of +the entry to modify, the following are modification specifications. +A modification specification is itself a list of the form +(MOD-OP ATTR VALUE1 VALUE2 ...) MOD-OP and ATTR are mandatory, +VALUEs are optional depending on MOD-OP. +MOD-OP is the type of modification, one of the symbols `add', `delete' +or `replace'. ATTR is the LDAP attribute type to modify. +HOST is the LDAP host, defaulting to `ldap-default-host' +BINDDN is the DN to bind as to the server +PASSWD is the corresponding password" + (or host + (setq host ldap-default-host) + (error "No LDAP host specified")) + (let ((host-plist (cdr (assoc host ldap-host-parameters-alist))) + ldap + (i 1)) + (if (or binddn passwd) + (setq host-plist (copy-seq host-plist))) + (if binddn + (setq host-plist (plist-put host-plist 'binddn binddn))) + (if passwd + (setq host-plist (plist-put host-plist 'passwd passwd))) + (if ldap-verbose + (message "Opening LDAP connection to %s..." host)) + (setq ldap (ldap-open host host-plist)) + (if ldap-verbose + (message "Modifying LDAP entries...")) + (mapcar (function + (lambda (thisentry) + (ldap-modify ldap (car thisentry) (cdr thisentry)) + (if ldap-verbose + (message "%d modified" i)) + (setq i (1+ i)))) + entry-mods) + (ldap-close ldap))) + + +(defun ldap-delete-entries (dn &optional host binddn passwd) + "Delete an entry from an LDAP directory. +DN is the distinguished name of an entry to delete or +a list of those. +HOST is the LDAP host, defaulting to `ldap-default-host' +BINDDN is the DN to bind as to the server +PASSWD is the corresponding password." + (or host + (setq host ldap-default-host) + (error "No LDAP host specified")) + (let ((host-plist (cdr (assoc host ldap-host-parameters-alist))) + ldap) + (if (or binddn passwd) + (setq host-plist (copy-seq host-plist))) + (if binddn + (setq host-plist (plist-put host-plist 'binddn binddn))) + (if passwd + (setq host-plist (plist-put host-plist 'passwd passwd))) + (if ldap-verbose + (message "Opening LDAP connection to %s..." host)) + (setq ldap (ldap-open host host-plist)) + (if (consp dn) + (let ((i 1)) + (if ldap-verbose + (message "Deleting LDAP entries...")) + (mapcar (function + (lambda (thisdn) + (ldap-delete ldap thisdn) + (if ldap-verbose + (message "%d deleted" i)) + (setq i (1+ i)))) + dn)) + (if ldap-verbose + (message "Deleting LDAP entry...")) + (ldap-delete ldap dn)) + (ldap-close ldap))) + + (provide 'ldap) ;;; ldap.el ends here diff --git a/lisp/modeline.el b/lisp/modeline.el index 08886a9..c5e428d 100644 --- a/lisp/modeline.el +++ b/lisp/modeline.el @@ -79,7 +79,23 @@ a scrollbar for its own text, which then moves in the opposite direction." (set-glyph-image modeline-pointer-glyph "fleur" 'global 'x)) (t (set-glyph-image modeline-pointer-glyph "sb_v_double_arrow" - 'global 'x))))) + 'global 'x)))) + (when (featurep 'mswindows) + (cond ((eq val t) + (set-glyph-image modeline-pointer-glyph + [mswindows-resource :resource-type cursor + :resource-id "SizeAll"] + 'global 'mswindows)) + ((eq val 'scrollbar) + (set-glyph-image modeline-pointer-glyph + [mswindows-resource :resource-type cursor + :resource-id "Normal"] + 'global 'mswindows)) + (t + (set-glyph-image modeline-pointer-glyph + [mswindows-resource :resource-type cursor + :resource-id "SizeNS"] + 'global 'mswindows))))) :group 'modeline) (defun mouse-drag-modeline (event) diff --git a/lisp/msw-faces.el b/lisp/msw-faces.el index f4e4125..7c34cc7 100644 --- a/lisp/msw-faces.el +++ b/lisp/msw-faces.el @@ -29,12 +29,23 @@ ;; This file does the magic to parse mswindows font names, and make sure that ;; the default and modeline attributes of new frames are specified enough. -;;; Force creation of the default face font so that if it fails we get an -;;; error now instead of a crash at frame creation. (defun mswindows-init-device-faces (device) - (unless (face-font-instance 'default device) - (error "Can't find a suitable default font"))) - + (let ((color-default (device-system-metric device 'color-default)) + (color-3d-face (device-system-metric device 'color-3d-face))) + ; Force creation of the default face font so that if it fails we get + ; an error now instead of a crash at frame creation. + (unless (face-font-instance 'default device) + (error "Can't find a suitable default font")) + + (if (car color-default) + (set-face-foreground 'default (car color-default)) device) + (if (cdr color-default) + (set-face-background 'default (cdr color-default)) device) + (if (car color-3d-face) + (set-face-foreground 'gui-element (car color-3d-face)) device) + (if (cdr color-3d-face) + (set-face-background 'gui-element (cdr color-3d-face)) device) + (set-face-font 'gui-element "MS Sans Serif:Regular:8" device))) (defun mswindows-init-frame-faces (frame) ) diff --git a/lisp/package-get.el b/lisp/package-get.el index b84b4a7..587ea39 100644 --- a/lisp/package-get.el +++ b/lisp/package-get.el @@ -239,7 +239,7 @@ is the directory on the site in which packages may be found. This variable is used to initialize `package-get-remote', the variable actually used to specify package download sites." :tag "Package download sites" - :type '(repeat (list hostname directory)) + :type '(repeat (list (string :tag "Name") host-name directory)) :group 'package-get) (defcustom package-get-remove-copy t diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog index 3424d79..bf5ee4b 100644 --- a/lwlib/ChangeLog +++ b/lwlib/ChangeLog @@ -1,3 +1,33 @@ +2000-02-21 Martin Buchholz + + * XEmacs 21.2.30 is released. + +2000-02-21 Andy Piper + + * lwlib.c (merge_widget_value_args): don't delete the args before + copying, lw_copy_widget_value_args will do this for us if + necessary. + (lw_add_widget_value_arg): Allow existing args to be replaced. + (free_widget_value_args): Set args to 0 rather than 0xdeadbeef, + reference couting works better that way. + (lw_copy_widget_value_args): Do the right thing. + + * lwlib-Xm.c (xm_create_progress): Make sensitive as this looks + much better. + * lwlib-Xaw.c (xaw_create_progress): ditto. + +2000-02-12 Jan Vroonhof + + * xlwmenu.h (XmUNSPECIFIED_PIXMAP): Define this if we are using Motif + compatible resource names. + + * xlwmenu.c (make_shadow_gcs): Always check for XmUNSPECIFIED_PIXMAP + even if we are only 'compatible' with the Motif resources. + +2000-02-15 Andy Piper + + * xlwgauge.c (GaugeExpose): remove shadows. + 2000-02-16 Martin Buchholz * XEmacs 21.2.29 is released. diff --git a/lwlib/lwlib-Xaw.c b/lwlib/lwlib-Xaw.c index 3ff9460..dd766dc 100644 --- a/lwlib/lwlib-Xaw.c +++ b/lwlib/lwlib-Xaw.c @@ -788,7 +788,7 @@ xaw_create_progress (widget_instance *instance) int ac = 0; Widget scale = 0; widget_value* val = instance->info->val; - +#if 0 /* This looks too awful, although more correct. */ if (!val->call_data) { XtSetArg (al [ac], XtNsensitive, False); ac++; @@ -797,6 +797,10 @@ xaw_create_progress (widget_instance *instance) { XtSetArg (al [ac], XtNsensitive, val->enabled); ac++; } +#else + XtSetArg (al [ac], XtNsensitive, True); ac++; +#endif + XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++; XtSetArg (al [ac], XtNorientation, XtorientHorizontal); ac++; XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0);ac++; diff --git a/lwlib/lwlib-Xm.c b/lwlib/lwlib-Xm.c index 87008b5..ff1b8ff 100644 --- a/lwlib/lwlib-Xm.c +++ b/lwlib/lwlib-Xm.c @@ -1646,7 +1646,7 @@ xm_create_progress (widget_instance *instance) int ac = 0; Widget scale = 0; widget_value* val = instance->info->val; - +#if 0 /* This looks too awful, although more correct. */ if (!val->call_data) { XtSetArg (al [ac], XmNsensitive, False); ac++; @@ -1655,6 +1655,9 @@ xm_create_progress (widget_instance *instance) { XtSetArg (al [ac], XmNsensitive, val->enabled); ac++; } +#else + XtSetArg (al [ac], XmNsensitive, True); ac++; +#endif XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; XtSetArg (al [ac], XmNuserData, val->call_data); ac++; XtSetArg (al [ac], XmNmappedWhenManaged, FALSE); ac++; diff --git a/lwlib/lwlib.c b/lwlib/lwlib.c index 35be751..27f7a08 100644 --- a/lwlib/lwlib.c +++ b/lwlib/lwlib.c @@ -261,7 +261,6 @@ merge_widget_value_args (widget_value *old, widget_value *new) { /* #### Do something more sensible here than just copying the new values (like actually merging the values). */ - free_widget_value_args (old); lw_copy_widget_value_args (new, old); changed = True; } @@ -1365,6 +1364,7 @@ void lw_add_value_args_to_args (widget_value* wv, ArgList addto, int* offset) void lw_add_widget_value_arg (widget_value* wv, String name, XtArgVal value) { + int i = 0; if (!wv->args) { wv->args = (widget_args *) malloc (sizeof (widget_args)); @@ -1378,7 +1378,19 @@ void lw_add_widget_value_arg (widget_value* wv, String name, XtArgVal value) if (wv->args->nargs > 10) return; - XtSetArg (wv->args->args [wv->args->nargs], name, value); wv->args->nargs++; + /* If the arg is already there then we must replace it. */ + for (i = 0; i < wv->args->nargs; i++) + { + if (!strcmp (wv->args->args[i].name, name)) + { + XtSetArg (wv->args->args [i], name, value); + break; + } + } + if (i >= wv->args->nargs) + { + XtSetArg (wv->args->args [wv->args->nargs], name, value); wv->args->nargs++; + } } static void free_widget_value_args (widget_value* wv) @@ -1397,20 +1409,22 @@ static void free_widget_value_args (widget_value* wv) #endif free (wv->args->args); free (wv->args); - wv->args = (widget_args*)0xDEADBEEF; + wv->args = 0; } } } void lw_copy_widget_value_args (widget_value* val, widget_value* copy) { - if (!val->args) + if (val == copy || val->args == copy->args) + return; + + if (copy->args) { - if (copy->args) - free_widget_value_args (copy); - copy->args = 0; + free_widget_value_args (copy); } - else + + if (val->args) { copy->args = val->args; copy->args->ref_count++; diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c index c7ef3b4..a35a629 100644 --- a/lwlib/xlwmenu.c +++ b/lwlib/xlwmenu.c @@ -2809,30 +2809,22 @@ make_shadow_gcs (XlwMenuWidget mw) xgcv.foreground = mw->menu.top_shadow_color; xgcv.background = mw->core.background_pixel; /* xgcv.stipple = mw->menu.top_shadow_pixmap; gtb */ -#ifdef NEED_MOTIF if (mw->menu.top_shadow_pixmap && mw->menu.top_shadow_pixmap != XmUNSPECIFIED_PIXMAP) xgcv.stipple = mw->menu.top_shadow_pixmap; else xgcv.stipple = 0; -#else - xgcv.stipple = mw->menu.top_shadow_pixmap; -#endif /* NEED_MOTIF */ pm = (xgcv.stipple ? GCStipple|GCFillStyle : 0); mw->menu.shadow_top_gc = XtGetGC((Widget)mw, GCForeground|GCBackground|pm, &xgcv); xgcv.foreground = mw->menu.bottom_shadow_color; /* xgcv.stipple = mw->menu.bottom_shadow_pixmap; gtb */ -#ifdef NEED_MOTIF if (mw->menu.bottom_shadow_pixmap && mw->menu.bottom_shadow_pixmap != XmUNSPECIFIED_PIXMAP) xgcv.stipple = mw->menu.bottom_shadow_pixmap; else xgcv.stipple = 0; -#else - xgcv.stipple = mw->menu.bottom_shadow_pixmap; -#endif /* NEED_MOTIF */ pm = (xgcv.stipple ? GCStipple|GCFillStyle : 0); mw->menu.shadow_bottom_gc = XtGetGC ((Widget)mw, GCForeground|GCBackground|pm, &xgcv); diff --git a/lwlib/xlwmenu.h b/lwlib/xlwmenu.h index 24d9635..2644a2b 100644 --- a/lwlib/xlwmenu.h +++ b/lwlib/xlwmenu.h @@ -56,6 +56,7 @@ # define XmCTopShadowPixmap "TopShadowPixmap" # define XmNbottomShadowPixmap "bottomShadowPixmap" # define XmCBottomShadowPixmap "BottomShadowPixmap" +# define XmUNSPECIFIED_PIXMAP 2 # define XmRHorizontalDimension "HorizontalDimension" # define XmNspacing "spacing" # define XmCSpacing "Spacing" diff --git a/man/ChangeLog b/man/ChangeLog index c548505..142c7d2 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,23 @@ +2000-02-21 Martin Buchholz + + * XEmacs 21.2.30 is released. + +2000-02-21 Jonathan Harris + + * internals/internals.texi: Made texinfmt-friendly. + +2000-01-20 Mark Thomas + + * lispref/backups.texi (Numbered Backups): + * xemacs/files.texi (Backup Deletion): + Change trim-versions-without-asking to delete-old-versions. + +2000-02-19 Martin Buchholz + + * internals/internals.texi (Conversion to and from External Data): + Document TO_EXTERNAL_FORMAT and friends. + Doc bug fixes. + 2000-02-16 Martin Buchholz * XEmacs 21.2.29 is released. diff --git a/man/cl.texi b/man/cl.texi index a3c3100..27d6d72 100644 --- a/man/cl.texi +++ b/man/cl.texi @@ -3218,8 +3218,8 @@ Emacs 19. @example (declaim (inline foo bar)) (eval-when (compile load eval) (proclaim '(inline foo bar))) -(proclaim-inline foo bar) ; XEmacs only -(defsubst foo (...) ...) ; instead of defun; Emacs 19 only +(proclaim-inline foo bar) ; XEmacs only +(defsubst foo (...) ...) ; instead of defun; Emacs 19 only @end example @strong{Please note:} This declaration remains in effect after the @@ -5549,8 +5549,8 @@ referring to the name of a function. In Emacs Lisp, it works just as well to use a regular quote: @example -(loop for x in y by #'cddr collect (mapcar #'plusp x)) ; Common Lisp -(loop for x in y by 'cddr collect (mapcar 'plusp x)) ; Emacs Lisp +(loop for x in y by #'cddr collect (mapcar #'plusp x)) ; Common Lisp +(loop for x in y by 'cddr collect (mapcar 'plusp x)) ; Emacs Lisp @end example When @code{#'} introduces a @code{lambda} form, it is best to diff --git a/man/internals/internals.texi b/man/internals/internals.texi index c858f39..f432589 100644 --- a/man/internals/internals.texi +++ b/man/internals/internals.texi @@ -138,7 +138,9 @@ This Info file contains v1.0 of the XEmacs Internals Manual. * Interface to X Windows:: * Index:: -@detailmenu --- The Detailed Node Listing --- +@detailmenu + +--- The Detailed Node Listing --- A History of Emacs @@ -189,7 +191,6 @@ Allocation of Objects in XEmacs Lisp * Allocation from Frob Blocks:: * lrecords:: * Low-level allocation:: -* Pure Space:: * Cons:: * Vector:: * Bit Vector:: @@ -966,7 +967,7 @@ Java, which is inexcusable. Unfortunately, there is no perfect language. Static typing allows a compiler to catch programmer errors and produce more efficient code, but -makes programming more tedious and less fun. For the forseeable future, +makes programming more tedious and less fun. For the foreseeable future, an Ideal Editing and Programming Environment (and that is what XEmacs aspires to) will be programmable in multiple languages: high level ones like Lisp for user customization and prototyping, and lower level ones @@ -1619,25 +1620,17 @@ stuffs a pointer together with a tag, as follows: [ 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 ] [ 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 ] - <---> ^ <------------------------------------------------------> - tag | a pointer to a structure, or an integer - | - mark bit -@end example - -The tag describes the type of the Lisp object. For integers and chars, -the lower 28 bits contain the value of the integer or char; for all -others, the lower 28 bits contain a pointer. The mark bit is used -during garbage-collection, and is always 0 when garbage collection is -not happening. (The way that garbage collection works, basically, is that it -loops over all places where Lisp objects could exist---this includes -all global variables in C that contain Lisp objects [including -@code{Vobarray}, the C equivalent of @code{obarray}; through this, all -Lisp variables will get marked], plus various other places---and -recursively scans through the Lisp objects, marking each object it finds -by setting the mark bit. Then it goes through the lists of all objects -allocated, freeing the ones that are not marked and turning off the mark -bit of the ones that are marked.) + <---------------------------------------------------------> <-> + a pointer to a structure, or an integer tag +@end example + +A tag of 00 is used for all pointer object types, a tag of 10 is used +for characters, and the other two tags 01 and 11 are joined together to +form the integer object type. This representation gives us 31 bits +integers, 30 bits characters and pointers are represented directly +without any bit masking. This representation, though, assumes that +pointers to structs are always aligned to multiples of 4, so the lower 2 +bits are always zero. Lisp objects use the typedef @code{Lisp_Object}, but the actual C type used for the Lisp object can vary. It can be either a simple type @@ -1654,97 +1647,16 @@ decode Lisp objects when debugging. The choice of which type to use is determined by the preprocessor constant @code{USE_UNION_TYPE} which is defined via the @code{--use-union-type} option to @code{configure}. -@cindex record type - -Note that there are only eight types that the tag can represent, but -many more actual types than this. This is handled by having one of the -tag types specify a meta-type called a @dfn{record}; for all such -objects, the first four bytes of the pointed-to structure indicate what -the actual type is. - -Note also that having 28 bits for pointers and integers restricts a lot -of things to 256 megabytes of memory. (Basically, enough pointers and -indices and whatnot get stuffed into Lisp objects that the total amount -of memory used by XEmacs can't grow above 256 megabytes. In older -versions of XEmacs and GNU Emacs, the tag was 5 bits wide, allowing for -32 types, which was more than the actual number of types that existed at -the time, and no ``record'' type was necessary. However, this limited -the editor to 64 megabytes total, which some users who edited large -files might conceivably exceed.) - -Also, note that there is an implicit assumption here that all pointers -are low enough that the top bits are all zero and can just be chopped -off. On standard machines that allocate memory from the bottom up (and -give each process its own address space), this works fine. Some -machines, however, put the data space somewhere else in memory -(e.g. beginning at 0x80000000). Those machines cope by defining -@code{DATA_SEG_BITS} in the corresponding @file{m/} or @file{s/} file to -the proper mask. Then, pointers retrieved from Lisp objects are -automatically OR'ed with this value prior to being used. - -A corollary of the previous paragraph is that @strong{(pointers to) -stack-allocated structures cannot be put into Lisp objects}. The stack -is generally located near the top of memory; if you put such a pointer -into a Lisp object, it will get its top bits chopped off, and you will -lose. - -Actually, there's an alternative representation of a @code{Lisp_Object}, -invented by Kyle Jones, that is used when the -@code{--use-minimal-tagbits} option to @code{configure} is used. In -this case the 2 lower bits are used for the tag bits. This -representation assumes that pointers to structs are always aligned to -multiples of 4, so the lower 2 bits are always zero. - -@example - [ 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 ] - [ 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 ] - - <---------------------------------------------------------> <-> - a pointer to a structure, or an integer tag -@end example - -A tag of 00 is used for all pointer object types, a tag of 10 is used -for characters, and the other two tags 01 and 11 are joined together to -form the integer object type. The markbit is moved to part of the -structure being pointed at (integers and chars do not need to be marked, -since no memory is allocated). This representation has these -advantages: - -@enumerate -@item -31 bits can be used for Lisp Integers. -@item -@emph{Any} pointer can be represented directly, and no bit masking -operations are necessary. -@end enumerate - -The disadvantages are: - -@enumerate -@item -An extra level of indirection is needed when accessing the object types -that were not record types. So checking whether a Lisp object is a cons -cell becomes a slower operation. -@item -Mark bits can no longer be stored directly in Lisp objects, so another -place for them must be found. This means that a cons cell requires more -memory than merely room for 2 lisp objects, leading to extra memory use. -@end enumerate - Various macros are used to construct Lisp objects and extract the components. Macros of the form @code{XINT()}, @code{XCHAR()}, -@code{XSTRING()}, @code{XSYMBOL()}, etc. mask out the pointer/integer -field and cast it to the appropriate type. All of the macros that -construct pointers will @code{OR} with @code{DATA_SEG_BITS} if -necessary. @code{XINT()} needs to be a bit tricky so that negative -numbers are properly sign-extended: Usually it does this by shifting the -number four bits to the left and then four bits to the right. This -assumes that the right-shift operator does an arithmetic shift (i.e. it -leaves the most-significant bit as-is rather than shifting in a zero, so -that it mimics a divide-by-two even for negative numbers). Not all -machines/compilers do this, and on the ones that don't, a more -complicated definition is selected by defining -@code{EXPLICIT_SIGN_EXTEND}. +@code{XSTRING()}, @code{XSYMBOL()}, etc. shift out the tag field if +needed cast it to the appropriate type. @code{XINT()} needs to be a bit +tricky so that negative numbers are properly sign-extended. Since +integers are stored left-shifted, if the right-shift operator does an +arithmetic shift (i.e. it leaves the most-significant bit as-is rather +than shifting in a zero, so that it mimics a divide-by-two even for +negative numbers) the shift to remove the tag bit is enough. This is +the case on all the systems we support. Note that when @code{ERROR_CHECK_TYPECHECK} is defined, the extractor macros become more complicated---they check the tag bits and/or the @@ -1844,9 +1756,8 @@ done during the dumping process: If possible, the initialized data segment is re-mapped so that it becomes part of the (unmodifiable) code segment in the dumped executable. This allows this memory to be shared among multiple running XEmacs processes. XEmacs is careful to place as -much constant data as possible into initialized variables (in -particular, into what's called the @dfn{pure space}---see below) during -the @file{temacs} phase. +much constant data as possible into initialized variables during the +@file{temacs} phase. @cindex copy-on-write @strong{Please note:} This kludge only works on a few systems nowadays, @@ -2265,19 +2176,22 @@ Without Mule support, an @code{Emchar} is equivalent to an The data representing the text in a buffer or string is logically a set of @code{Bufbyte}s. -XEmacs does not work with character formats all the time; when reading -characters from the outside, it decodes them to an internal format, and -likewise encodes them when writing. @code{Bufbyte} (in fact +XEmacs does not work with the same character formats all the time; when +reading characters from the outside, it decodes them to an internal +format, and likewise encodes them when writing. @code{Bufbyte} (in fact @code{unsigned char}) is the basic unit of XEmacs internal buffers and -strings format. +strings format. A @code{Bufbyte *} is the type that points at text +encoded in the variable-width internal encoding. One character can correspond to one or more @code{Bufbyte}s. In the -current implementation, an ASCII character is represented by the same -@code{Bufbyte}, and extended characters are represented by a sequence of -@code{Bufbyte}s. +current Mule implementation, an ASCII character is represented by the +same @code{Bufbyte}, and other characters are represented by a sequence +of two or more @code{Bufbyte}s. -Without Mule support, a @code{Bufbyte} is equivalent to an -@code{Emchar}. +Without Mule support, there are exactly 256 characters, implicitly +Latin-1, and each character is represented using one @code{Bufbyte}, and +there is a one-to-one correspondence between @code{Bufbyte}s and +@code{Emchar}s. @item Bufpos @itemx Charcount @@ -2287,8 +2201,8 @@ A @code{Bufpos} represents a character position in a buffer or string. A @code{Charcount} represents a number (count) of characters. Logically, subtracting two @code{Bufpos} values yields a @code{Charcount} value. Although all of these are @code{typedef}ed to -@code{int}, we use them in preference to @code{int} to make it clear -what sort of position is being used. +@code{EMACS_INT}, we use them in preference to @code{EMACS_INT} to make +it clear what sort of position is being used. @code{Bufpos} and @code{Charcount} values are the only ones that are ever visible to Lisp. @@ -2298,7 +2212,7 @@ ever visible to Lisp. @cindex Bytind @cindex Bytecount A @code{Bytind} represents a byte position in a buffer or string. A -@code{Bytecount} represents the distance between two positions in bytes. +@code{Bytecount} represents the distance between two positions, in bytes. The relationship between @code{Bytind} and @code{Bytecount} is the same as the relationship between @code{Bufpos} and @code{Charcount}. @@ -2325,10 +2239,10 @@ learn about them. @table @code @item MAX_EMCHAR_LEN @cindex MAX_EMCHAR_LEN -This preprocessor constant is the maximum number of buffer bytes per -Emacs character, i.e. the byte length of an @code{Emchar}. It is useful -when allocating temporary strings to keep a known number of characters. -For instance: +This preprocessor constant is the maximum number of buffer bytes to +represent an Emacs character in the variable width internal encoding. +It is useful when allocating temporary strings to keep a known number of +characters. For instance: @example @group @@ -2449,107 +2363,135 @@ stuff (such as the infamous \201 characters) leak out. The interface to conversion between the internal and external representations of text are the numerous conversion macros defined in -@file{buffer.h}. Before looking at them, we'll look at the external -formats supported by these macros. - -Currently meaningful formats are @code{FORMAT_BINARY}, -@code{FORMAT_FILENAME}, @code{FORMAT_OS}, and @code{FORMAT_CTEXT}. Here -is a description of these. +@file{buffer.h}. There used to be a fixed set of external formats +supported by these macros, but now any coding system can be used with +these macros. The coding system alias mechanism is used to create the +following logical coding systems, which replace the fixed external +formats. The (dontusethis-set-symbol-value-handler) mechanism was +enhanced to make this possible (more work on that is needed - like +remove the @code{dontusethis-} prefix). @table @code -@item FORMAT_BINARY -Binary format. This is the simplest format and is what we use in the -absence of a more appropriate format. This converts according to the -@code{binary} coding system: +@item Qbinary +This is the simplest format and is what we use in the absence of a more +appropriate format. This converts according to the @code{binary} coding +system: @enumerate a @item -On input, bytes 0--255 are converted into characters 0--255. +On input, bytes 0--255 are converted into (implicitly Latin-1) +characters 0--255. A non-Mule xemacs doesn't really know about +different character sets and the fonts to display them, so the bytes can +be treated as text in different 1-byte encodings by simply setting the +appropriate fonts. So in a sense, non-Mule xemacs is a multi-lingual +editor if, for example, different fonts are used to display text in +different buffers, faces, or windows. The specifier mechanism gives the +user complete control over this kind of behavior. @item On output, characters 0--255 are converted into bytes 0--255 and other -characters are converted into `X'. +characters are converted into `~'. @end enumerate -@item FORMAT_FILENAME -Format used for filenames. In the original Mule, this is user-definable -with the @code{pathname-coding-system} variable. For the moment, we -just use the @code{binary} coding system. +@item Qfile_name +Format used for filenames. This is user-definable via either the +@code{file-name-coding-system} or @code{pathname-coding-system} (now +obsolete) variables. -@item FORMAT_OS +@item Qnative Format used for the external Unix environment---@code{argv[]}, stuff from @code{getenv()}, stuff from the @file{/etc/passwd} file, etc. +Currently this is the same as Qfile_name. The two should be +distinguished for clarity and possible future separation. -Perhaps should be the same as FORMAT_FILENAME. - -@item FORMAT_CTEXT -Compound--text format. This is the standard X format used for data +@item Qctext +Compound--text format. This is the standard X11 format used for data stored in properties, selections, and the like. This is an 8-bit -no-lock-shift ISO2022 coding system. +no-lock-shift ISO2022 coding system. This is a real coding system, +unlike Qfile_name, which is user-definable. @end table -The macros to convert between these formats and the internal format, and -vice versa, follow. +There are two fundamental macros to convert between external and +internal format. + +@code{TO_INTERNAL_FORMAT} converts external data to internal format, and +@code{TO_EXTERNAL_FORMAT} converts the other way around. The arguments +each of these receives are a source type, a source, a sink type, a sink, +and a coding system (or a symbol naming a coding system). + +A typical call looks like +@example +TO_EXTERNAL_FORMAT (LISP_STRING, str, C_STRING_MALLOC, ptr, Qfile_name); +@end example + +which means that the contents of the lisp string @code{str} are written +to a malloc'ed memory area which will be pointed to by @code{ptr}, after +the function returns. The conversion will be done using the +@code{file-name} coding system, which will be controlled by the user +indirectly by setting or binding the variable +@code{file-name-coding-system}. + +Some sources and sinks require two C variables to specify. We use some +preprocessor magic to allow different source and sink types, and even +different numbers of arguments to specify different types of sources and +sinks. + +So we can have a call that looks like +@example +TO_INTERNAL_FORMAT (DATA, (ptr, len), + MALLOC, (ptr, len), + coding_system); +@end example + +The parenthesized argument pairs are required to make the preprocessor +magic work. + +Here are the different source and sink types: @table @code -@item GET_CHARPTR_INT_DATA_ALLOCA -@itemx GET_CHARPTR_EXT_DATA_ALLOCA -These two are the most basic conversion macros. -@code{GET_CHARPTR_INT_DATA_ALLOCA} converts external data to internal -format, and @code{GET_CHARPTR_EXT_DATA_ALLOCA} converts the other way -around. The arguments each of these receives are @var{ptr} (pointer to -the text in external format), @var{len} (length of texts in bytes), -@var{fmt} (format of the external text), @var{ptr_out} (lvalue to which -new text should be copied), and @var{len_out} (lvalue which will be -assigned the length of the internal text in bytes). The resulting text -is stored to a stack-allocated buffer. If the text doesn't need -changing, these macros will do nothing, except for setting -@var{len_out}. - -The macros above take many arguments which makes them unwieldy. For -this reason, a number of convenience macros are defined with obvious -functionality, but accepting less arguments. The general rule is that -macros with @samp{INT} in their name convert text to internal Emacs -representation, whereas the @samp{EXT} macros convert to external -representation. - -@item GET_C_CHARPTR_INT_DATA_ALLOCA -@itemx GET_C_CHARPTR_EXT_DATA_ALLOCA -As their names imply, these macros work on C char pointers, which are -zero-terminated, and thus do not need @var{len} or @var{len_out} -parameters. - -@item GET_STRING_EXT_DATA_ALLOCA -@itemx GET_C_STRING_EXT_DATA_ALLOCA -These two macros convert a Lisp string into an external representation. -The difference between them is that @code{GET_STRING_EXT_DATA_ALLOCA} -stores its output to a generic string, providing @var{len_out}, the -length of the resulting external string. On the other hand, -@code{GET_C_STRING_EXT_DATA_ALLOCA} assumes that the caller will be -satisfied with output string being zero-terminated. - -Note that for Lisp strings only one conversion direction makes sense. - -@item GET_C_CHARPTR_EXT_BINARY_DATA_ALLOCA -@itemx GET_CHARPTR_EXT_BINARY_DATA_ALLOCA -@itemx GET_STRING_BINARY_DATA_ALLOCA -@itemx GET_C_STRING_BINARY_DATA_ALLOCA -@itemx GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA -@itemx ... -These macros convert internal text to a specific external -representation, with the external format being encoded into the name of -the macro. Note that the @code{GET_STRING_...} and -@code{GET_C_STRING...} macros lack the @samp{EXT} tag, because they -only make sense in that direction. - -@item GET_C_CHARPTR_INT_BINARY_DATA_ALLOCA -@itemx GET_CHARPTR_INT_BINARY_DATA_ALLOCA -@itemx GET_C_CHARPTR_INT_FILENAME_DATA_ALLOCA -@itemx ... -These macros convert external text of a specific format to its internal -representation, with the external format being incoded into the name of -the macro. +@item @code{DATA, (ptr, len),} +input data is a fixed buffer of size @var{len} at address @var{ptr} +@item @code{ALLOCA, (ptr, len),} +output data is placed in an alloca()ed buffer of size @var{len} pointed to by @var{ptr} +@item @code{MALLOC, (ptr, len),} +output data is in a malloc()ed buffer of size @var{len} pointed to by @var{ptr} +@item @code{C_STRING_ALLOCA, ptr,} +equivalent to @code{ALLOCA (ptr, len_ignored)} on output. +@item @code{C_STRING_MALLOC, ptr,} +equivalent to @code{MALLOC (ptr, len_ignored)} on output +@item @code{C_STRING, ptr,} +equivalent to @code{DATA, (ptr, strlen (ptr) + 1)} on input +@item @code{LISP_STRING, string,} +input or output is a Lisp_Object of type string +@item @code{LISP_BUFFER, buffer,} +output is written to @code{(point)} in lisp buffer @var{buffer} +@item @code{LISP_LSTREAM, lstream,} +input or output is a Lisp_Object of type lstream +@item @code{LISP_OPAQUE, object,} +input or output is a Lisp_Object of type opaque @end table +Often, the data is being converted to a '\0'-byte-terminated string, +which is the format required by many external system C APIs. For these +purposes, a source type of @code{C_STRING} or a sink type of +@code{C_STRING_ALLOCA} or @code{C_STRING_MALLOC} is appropriate. +Otherwise, we should try to keep XEmacs '\0'-byte-clean, which means +using (ptr, len) pairs. + +The sinks to be specified must be lvalues, unless they are the lisp +object types @code{LISP_LSTREAM} or @code{LISP_BUFFER}. + +For the sink types @code{ALLOCA} and @code{C_STRING_ALLOCA}, the +resulting text is stored in a stack-allocated buffer, which is +automatically freed on returning from the function. However, the sink +types @code{MALLOC} and @code{C_STRING_MALLOC} return @code{xmalloc()}ed +memory. The caller is responsible for freeing this memory using +@code{xfree()}. + +Note that it doesn't make sense for @code{LISP_STRING} to be a source +for @code{TO_INTERNAL_FORMAT} or a sink for @code{TO_EXTERNAL_FORMAT}. +You'll get an assertion failure if you try. + + @node General Guidelines for Writing Mule-Aware Code, An Example of Mule-Aware Code, Conversion to and from External Data, Coding for Mule @subsection General Guidelines for Writing Mule-Aware Code @@ -2577,10 +2519,23 @@ XEmacs can crash if unexpected 8bit sequences are copied to its internal buffers literally. This means that when a system function, such as @code{readdir}, returns -a string, you need to convert it using one of the conversion macros +a string, you may need to convert it using one of the conversion macros described in the previous chapter, before passing it further to Lisp. -In the case of @code{readdir}, you would use the -@code{GET_C_CHARPTR_INT_FILENAME_DATA_ALLOCA} macro. + +Actually, most of the basic system functions that accept '\0'-terminated +string arguments, like @code{stat()} and @code{open()}, have been +@strong{encapsulated} so that they are they @code{always} do internal to +external conversion themselves. This means you must pass internally +encoded data, typically the @code{XSTRING_DATA} of a Lisp_String to +these functions. This is actually a design bug, since it unexpectedly +changes the semantics of the system functions. A better design would be +to provide separate versions of these system functions that accepted +Lisp_Objects which were lisp strings in place of their current +@code{char *} arguments. + +@example +int stat_lisp (Lisp_Object path, struct stat *buf); /* Implement me */ +@end example Also note that many internal functions, such as @code{make_string}, accept Bufbytes, which removes the need for them to convert the data @@ -2592,10 +2547,9 @@ passed around in internal format. @node An Example of Mule-Aware Code, , General Guidelines for Writing Mule-Aware Code, Coding for Mule @subsection An Example of Mule-Aware Code -As an example of Mule-aware code, we shall will analyze the -@code{string} function, which conses up a Lisp string from the character -arguments it receives. Here is the definition, pasted from -@code{alloc.c}: +As an example of Mule-aware code, we will analyze the @code{string} +function, which conses up a Lisp string from the character arguments it +receives. Here is the definition, pasted from @code{alloc.c}: @example @group @@ -2708,7 +2662,7 @@ All @file{.c} files should @code{#include } first. Almost all Generated header files should be included using the @code{#include <...>} syntax, not the @code{#include "..."} syntax. The generated headers are: -@file{config.h puresize-adjust.h sheap-adjust.h paths.h Emacs.ad.h} +@file{config.h sheap-adjust.h paths.h Emacs.ad.h} The basic rule is that you should assume builds using @code{--srcdir} and the @code{#include <...>} syntax needs to be used when the @@ -2741,6 +2695,27 @@ make check @end example @end itemize +Here is a checklist of things to do when creating a new lisp object type +named @var{foo}: + +@enumerate +@item +create @var{foo}.h +@item +create @var{foo}.c +@item +add definitions of syms_of_@var{foo}, etc. to @var{foo}.c +@item +add declarations of syms_of_@var{foo}, etc. to symsinit.h +@item +add calls to syms_of_@var{foo}, etc. to emacs.c(main_1) +@item +add definitions of macros like CHECK_FOO and FOOP to @var{foo}.h +@item +add the new type index to enum lrecord_type +@item +add DEFINE_LRECORD_IMPLEMENTATION call to @var{foo}.c +@end enumerate @node A Summary of the Various XEmacs Modules, Allocation of Objects in XEmacs Lisp, Rules When Writing New C Code, Top @chapter A Summary of the Various XEmacs Modules @@ -3039,8 +3014,6 @@ special-purpose argument types requiring definitions not in @example alloc.c -pure.c -puresize.h @end example The large module @file{alloc.c} implements all of the basic allocation and @@ -3066,35 +3039,6 @@ require changes to the generic subsystem code or affect any of the other subtypes in the subsystem; this provides a great deal of robustness to the XEmacs code. -@cindex pure space -@file{pure.c} contains the declaration of the @dfn{purespace} array. -Pure space is a hack used to place some constant Lisp data into the code -segment of the XEmacs executable, even though the data needs to be -initialized through function calls. (See above in section VIII for more -info about this.) During startup, certain sorts of data is -automatically copied into pure space, and other data is copied manually -in some of the basic Lisp files by calling the function @code{purecopy}, -which copies the object if possible (this only works in temacs, of -course) and returns the new object. In particular, while temacs is -executing, the Lisp reader automatically copies all compiled-function -objects that it reads into pure space. Since compiled-function objects -are large, are never modified, and typically comprise the majority of -the contents of a compiled-Lisp file, this works well. While XEmacs is -running, any attempt to modify an object that resides in pure space -causes an error. Objects in pure space are never garbage collected -- -almost all of the time, they're intended to be permanent, and in any -case you can't write into pure space to set the mark bits. - -@file{puresize.h} contains the declaration of the size of the pure space -array. This depends on the optional features that are compiled in, any -extra purespace requested by the user at compile time, and certain other -factors (e.g. 64-bit machines need more pure space because their Lisp -objects are larger). The smallest size that suffices should be used, so -that there's no wasted space. If there's not enough pure space, you -will get an error during the build process, specifying how much more -pure space is needed. - - @example eval.c @@ -4418,7 +4362,6 @@ Asian-language support, and is not currently used. * Allocation from Frob Blocks:: * lrecords:: * Low-level allocation:: -* Pure Space:: * Cons:: * Vector:: * Bit Vector:: @@ -4449,10 +4392,10 @@ Some Lisp objects, especially those that are primarily used internally, have no corresponding Lisp primitives. Every Lisp object, though, has at least one C primitive for creating it. - Recall from section (VII) that a Lisp object, as stored in a 32-bit -or 64-bit word, has a mark bit, a few tag bits, and a ``value'' that -occupies the remainder of the bits. We can separate the different -Lisp object types into four broad categories: + Recall from section (VII) that a Lisp object, as stored in a 32-bit or +64-bit word, has a few tag bits, and a ``value'' that occupies the +remainder of the bits. We can separate the different Lisp object types +into three broad categories: @itemize @bullet @item @@ -4463,54 +4406,28 @@ for such objects. Lisp objects of these types do not need to be @code{GCPRO}ed. @end itemize - In the remaining three categories, the value is a pointer to a -structure. - -@itemize @bullet -@item -@cindex frob block -(b) Those for whom the tag directly specifies the type. Recall that -there are only three tag bits; this means that at most five types can be -specified this way. The most commonly-used types are stored in this -format; this includes conses, strings, vectors, and sometimes symbols. -With the exception of vectors, objects in this category are allocated in -@dfn{frob blocks}, i.e. large blocks of memory that are subdivided into -individual objects. This saves a lot on malloc overhead, since there -are typically quite a lot of these objects around, and the objects are -small. (A cons, for example, occupies 8 bytes on 32-bit machines---4 -bytes for each of the two objects it contains.) Vectors are individually -@code{malloc()}ed since they are of variable size. (It would be -possible, and desirable, to allocate vectors of certain small sizes out -of frob blocks, but it isn't currently done.) Strings are handled -specially: Each string is allocated in two parts, a fixed size structure -containing a length and a data pointer, and the actual data of the -string. The former structure is allocated in frob blocks as usual, and -the latter data is stored in @dfn{string chars blocks} and is relocated -during garbage collection to eliminate holes. -@end itemize - In the remaining two categories, the type is stored in the object itself. The tag for all such objects is the generic @dfn{lrecord} -(Lisp_Record) tag. The first four bytes (or eight, for 64-bit machines) -of the object's structure are a pointer to a structure that describes -the object's type, which includes method pointers and a pointer to a -string naming the type. Note that it's possible to save some space by -using a one- or two-byte tag, rather than a four- or eight-byte pointer -to store the type, but it's not clear it's worth making the change. +(Lisp_Type_Record) tag. The first bytes of the object's structure are an +integer (actually a char) characterising the object's type and some +flags, in particular the mark bit used for garbage collection. A +structure describing the type is accessible thru the +lrecord_implementation_table indexed with said integer. This structure +includes the method pointers and a pointer to a string naming the type. @itemize @bullet @item -(c) Those lrecords that are allocated in frob blocks (see above). This +(b) Those lrecords that are allocated in frob blocks (see above). This includes the objects that are most common and relatively small, and -includes floats, compiled functions, symbols (when not in category (b)), +includes conses, strings, subrs, floats, compiled functions, symbols, extents, events, and markers. With the cleanup of frob blocks done in 19.12, it's not terribly hard to add more objects to this category, but -it's a bit trickier than adding an object type to type (d) (esp. if the +it's a bit trickier than adding an object type to type (c) (esp. if the object needs a finalization method), and is not likely to save much space unless the object is small and there are many of them. (In fact, if there are very few of them, it might actually waste space.) @item -(d) Those lrecords that are individually @code{malloc()}ed. These are +(c) Those lrecords that are individually @code{malloc()}ed. These are called @dfn{lcrecords}. All other types are in this category. Adding a new type to this category is comparatively easy, and all types added since 19.8 (when the current allocation scheme was devised, by Richard @@ -4519,17 +4436,11 @@ category. @end itemize Note that bit vectors are a bit of a special case. They are -simple lrecords as in category (c), but are individually @code{malloc()}ed +simple lrecords as in category (b), but are individually @code{malloc()}ed like vectors. You can basically view them as exactly like vectors except that their type is stored in lrecord fashion rather than in directly-tagged fashion. - Note that FSF Emacs redesigned their object system in 19.29 to follow -a similar scheme. However, given RMS's expressed dislike for data -abstraction, the FSF scheme is not nearly as clean or as easy to -extend. (FSF calls items of type (c) @code{Lisp_Misc} and items of type -(d) @code{Lisp_Vectorlike}, with separate tags for each, although -@code{Lisp_Vectorlike} is also used for vectors.) @node Garbage Collection, GCPROing, Introduction to Allocation, Allocation of Objects in XEmacs Lisp @section Garbage Collection @@ -4549,61 +4460,11 @@ Traversing all these objects means traversing all frob blocks, all vectors (which are chained in one big list), and all lcrecords (which are likewise chained). - Note that, when an object is marked, the mark has to occur -inside of the object's structure, rather than in the 32-bit -@code{Lisp_Object} holding the object's pointer; i.e. you can't just -set the pointer's mark bit. This is because there may be many -pointers to the same object. This means that the method of -marking an object can differ depending on the type. The -different marking methods are approximately as follows: - -@enumerate -@item -For conses, the mark bit of the car is set. -@item -For strings, the mark bit of the string's plist is set. -@item -For symbols when not lrecords, the mark bit of the -symbol's plist is set. -@item -For vectors, the length is negated after adding 1. -@item -For lrecords, the pointer to the structure describing -the type is changed (see below). -@item -Integers and characters do not need to be marked, since -no allocation occurs for them. -@end enumerate - - The details of this are in the @code{mark_object()} function. - - Note that any code that operates during garbage collection has -to be especially careful because of the fact that some objects -may be marked and as such may not look like they normally do. -In particular: + Garbage collection can be invoked explicitly by calling +@code{garbage-collect} but is also called automatically by @code{eval}, +once a certain amount of memory has been allocated since the last +garbage collection (according to @code{gc-cons-threshold}). -@itemize @bullet -Some object pointers may have their mark bit set. This will make -@code{FOOBARP()} predicates fail. Use @code{GC_FOOBARP()} to deal with -this. -@item -Even if you clear the mark bit, @code{FOOBARP()} will still fail -for lrecords because the implementation pointer has been -changed (see below). @code{GC_FOOBARP()} will correctly deal with -this. -@item -Vectors have their size field munged, so anything that -looks at this field will fail. -@item -Note that @code{XFOOBAR()} macros @emph{will} work correctly on object -pointers with their mark bit set, because the logical shift operations -that remove the tag also remove the mark bit. -@end itemize - - Finally, note that garbage collection can be invoked explicitly -by calling @code{garbage-collect} but is also called automatically -by @code{eval}, once a certain amount of memory has been allocated -since the last garbage collection (according to @code{gc-cons-threshold}). @node GCPROing, Garbage Collection - Step by Step, Garbage Collection, Allocation of Objects in XEmacs Lisp @section @code{GCPRO}ing @@ -4616,14 +4477,17 @@ of accessibility are: @enumerate @item -All objects that have been @code{staticpro()}d. This is used for -any global C variables that hold Lisp objects. A call to -@code{staticpro()} happens implicitly as a result of any symbols -declared with @code{defsymbol()} and any variables declared with -@code{DEFVAR_FOO()}. You need to explicitly call @code{staticpro()} -(in the @code{vars_of_foo()} method of a module) for other global -C variables holding Lisp objects. (This typically includes -internal lists and such things.) +All objects that have been @code{staticpro()}d or +@code{staticpro_nodump()}ed. This is used for any global C variables +that hold Lisp objects. A call to @code{staticpro()} happens implicitly +as a result of any symbols declared with @code{defsymbol()} and any +variables declared with @code{DEFVAR_FOO()}. You need to explicitly +call @code{staticpro()} (in the @code{vars_of_foo()} method of a module) +for other global C variables holding Lisp objects. (This typically +includes internal lists and such things.). Use +@code{staticpro_nodump()} only in the rare cases when you do not want +the pointed variable to be saved at dump time but rather recompute it at +startup. Note that @code{obarray} is one of the @code{staticpro()}d things. Therefore, all functions and variables get marked through this. @@ -4822,16 +4686,16 @@ function evaluates calls of elisp functions and works according to The upshot is that garbage collection can basically occur everywhere @code{Feval}, respectively @code{Ffuncall}, is used - either directly or -through another function. Since calls to these two functions are -hidden in various other functions, many calls to -@code{garabge_collect_1} are not obviously foreseeable, and therefore -unexpected. Instances where they are used that are worth remembering are -various elisp commands, as for example @code{or}, -@code{and}, @code{if}, @code{cond}, @code{while}, @code{setq}, etc., -miscellaneous @code{gui_item_...} functions, everything related to -@code{eval} (@code{Feval_buffer}, @code{call0}, ...) and inside -@code{Fsignal}. The latter is used to handle signals, as for example the -ones raised by every @code{QUITE}-macro triggered after pressing Ctrl-g. +through another function. Since calls to these two functions are hidden +in various other functions, many calls to @code{garbage_collect_1} are +not obviously foreseeable, and therefore unexpected. Instances where +they are used that are worth remembering are various elisp commands, as +for example @code{or}, @code{and}, @code{if}, @code{cond}, @code{while}, +@code{setq}, etc., miscellaneous @code{gui_item_...} functions, +everything related to @code{eval} (@code{Feval_buffer}, @code{call0}, +...) and inside @code{Fsignal}. The latter is used to handle signals, as +for example the ones raised by every @code{QUITE}-macro triggered after +pressing Ctrl-g. @node garbage_collect_1, mark_object, Invocation, Garbage Collection - Step by Step @subsection @code{garbage_collect_1} @@ -4852,7 +4716,7 @@ Next the correct frame in which to put all the output occurring during garbage collecting is determined. In order to be able to restore the old display's state after displaying the message, some data about the current cursor position has to be -saved. The variables @code{pre_gc_curser} and @code{cursor_changed} take +saved. The variables @code{pre_gc_cursor} and @code{cursor_changed} take care of that. @item The state of @code{gc_currently_forbidden} must be restored after @@ -4995,7 +4859,7 @@ carefully by going over it and removing just the unmarked pairs. @item The function @code{prune_specifiers} checks all listed specifiers held -in @code{Vall_speficiers} and removes the ones from the lists that are +in @code{Vall_specifiers} and removes the ones from the lists that are unmarked. @item @@ -5301,25 +5165,15 @@ more defensive but less efficient and is used for error-checking.) [see @file{lrecord.h}] All lrecords have at the beginning of their structure a @code{struct -lrecord_header}. This just contains a pointer to a @code{struct +lrecord_header}. This just contains a type number and some flags, +including the mark bit. The type number, thru the +@code{lrecord_implementation_table}, gives access to a @code{struct lrecord_implementation}, which is a structure containing method pointers and such. There is one of these for each type, and it is a global, constant, statically-declared structure that is declared in the -@code{DEFINE_LRECORD_IMPLEMENTATION()} macro. (This macro actually -declares an array of two @code{struct lrecord_implementation} -structures. The first one contains all the standard method pointers, -and is used in all normal circumstances. During garbage collection, -however, the lrecord is @dfn{marked} by bumping its implementation -pointer by one, so that it points to the second structure in the array. -This structure contains a special indication in it that it's a -@dfn{marked-object} structure: the finalize method is the special -function @code{this_marks_a_marked_record()}, and all other methods are -null pointers. At the end of garbage collection, all lrecords will -either be reclaimed or unmarked by decrementing their implementation -pointers, so this second structure pointer will never remain past -garbage collection. - - Simple lrecords (of type (c) above) just have a @code{struct +@code{DEFINE_LRECORD_IMPLEMENTATION()} macro. + + Simple lrecords (of type (b) above) just have a @code{struct lrecord_header} at their beginning. lcrecords, however, actually have a @code{struct lcrecord_header}. This, in turn, has a @code{struct lrecord_header} at its beginning, so sanity is preserved; but it also @@ -5534,7 +5388,7 @@ simply return the object's size in bytes, exactly as you might expect. For an example, see the methods for window configurations and opaques. @end enumerate -@node Low-level allocation, Pure Space, lrecords, Allocation of Objects in XEmacs Lisp +@node Low-level allocation, Cons, lrecords, Allocation of Objects in XEmacs Lisp @section Low-level allocation Memory that you want to allocate directly should be allocated using @@ -5606,12 +5460,7 @@ appropriate times; this keeps statistics on how much memory is allocated, so that garbage-collection can be invoked when the threshold is reached. -@node Pure Space, Cons, Low-level allocation, Allocation of Objects in XEmacs Lisp -@section Pure Space - - Not yet documented. - -@node Cons, Vector, Pure Space, Allocation of Objects in XEmacs Lisp +@node Cons, Vector, Low-level allocation, Allocation of Objects in XEmacs Lisp @section Cons Conses are allocated in standard frob blocks. The only thing to @@ -5649,13 +5498,8 @@ tag field in bit vector Lisp words is ``lrecord'' rather than @node Symbol, Marker, Bit Vector, Allocation of Objects in XEmacs Lisp @section Symbol - Symbols are also allocated in frob blocks. Note that the code -exists for symbols to be either lrecords (category (c) above) -or simple types (category (b) above), and are lrecords by -default (I think), although there is no good reason for this. - - Note that symbols in the awful horrible obarray structure are -chained through their @code{next} field. + Symbols are also allocated in frob blocks. Symbols in the awful +horrible obarray structure are chained through their @code{next} field. Remember that @code{intern} looks up a symbol in an obarray, creating one if necessary. @@ -6006,12 +5850,17 @@ A bunch of tables needed to reassign properly the global pointers are then written. They are: @enumerate -@item the staticpro array -@item the dumpstruct array -@item the lrecord_implementation_table array -@item a vector of all the offsets to the objects in the file that include a +@item +the staticpro array +@item +the dumpstruct array +@item +the lrecord_implementation_table array +@item +a vector of all the offsets to the objects in the file that include a description (for faster relocation at reload time) -@item the pdump_wired and pdump_wired_list arrays +@item +the pdump_wired and pdump_wired_list arrays @end enumerate For each of the arrays we write both the pointer to the variables and @@ -6581,13 +6430,13 @@ in the lambda list. are converted into an internal form for faster execution. When a compiled function is executed for the first time by -@code{funcall_compiled_function()}, or when it is @code{Fpurecopy()}ed -during the dump phase of building XEmacs, the byte-code instructions are -converted from a @code{Lisp_String} (which is inefficient to access, -especially in the presence of MULE) into a @code{Lisp_Opaque} object -containing an array of unsigned char, which can be directly executed by -the byte-code interpreter. At this time the byte code is also analyzed -for validity and transformed into a more optimized form, so that +@code{funcall_compiled_function()}, or during the dump phase of building +XEmacs, the byte-code instructions are converted from a +@code{Lisp_String} (which is inefficient to access, especially in the +presence of MULE) into a @code{Lisp_Opaque} object containing an array +of unsigned char, which can be directly executed by the byte-code +interpreter. At this time the byte code is also analyzed for validity +and transformed into a more optimized form, so that @code{execute_optimized_program()} can really fly. Here are some of the optimizations performed by the internal byte-code @@ -6602,7 +6451,7 @@ variable are checked for being correct non-constant (i.e. not @code{t}, @code{nil}, or @code{keywordp}) symbols, so that the byte interpreter doesn't have to. @item -The maxiumum number of variable bindings in the byte-code is +The maximum number of variable bindings in the byte-code is pre-computed, so that space on the @code{specpdl} stack can be pre-reserved once for the whole function execution. @item @@ -6708,7 +6557,7 @@ All of these are very simple and work as expected, calling @code{let} and @code{let*}) using @code{specbind()} to create bindings and @code{unbind_to()} to undo the bindings when finished. -Note that, with the exeption of @code{Fprogn}, these functions are +Note that, with the exception of @code{Fprogn}, these functions are typically called in real life only in interpreted code, since the byte compiler knows how to convert calls to these functions directly into byte code. @@ -8049,7 +7898,7 @@ Furthermore, there is logically a @dfn{selected console}, @dfn{selected display}, @dfn{selected frame}, and @dfn{selected window}. Each of these objects is distinguished in various ways, such as being the default object for various functions that act on objects of that type. -Note that every containing object rememembers the ``selected'' object +Note that every containing object remembers the ``selected'' object among the objects that it contains: e.g. not only is there a selected window, but every frame remembers the last window in it that was selected, and changing the selected frame causes the remembered window @@ -8422,7 +8271,7 @@ Output changes Implemented by @code{redisplay-output.c}, @code{redisplay-x.c}, @code{redisplay-msw.c} and @code{redisplay-tty.c} @end enumerate -Steps 1 and 2 are device-independant and relatively complex. Step 3 is +Steps 1 and 2 are device-independent and relatively complex. Step 3 is mostly device-dependent. Determining the desired display @@ -8433,7 +8282,7 @@ Display attributes are stored in @code{display_line} structures. Each dynarr's of @code{display_line}'s are held by each window representing the current display and the desired display. -The @code{display_line} structures are tighly tied to buffers which +The @code{display_line} structures are tightly tied to buffers which presents a problem for redisplay as this connection is bogus for the modeline. Hence the @code{display_line} generation routines are duplicated for generating the modeline. This means that the modeline @@ -8766,7 +8615,7 @@ is generally possible to display an image-instance in multiple domains. For instance if we create a Pixmap, we can actually display this on multiple windows - even though we only need a single Pixmap instance to do this. If caching wasn't done then it would be necessary -to create image-instances for every displayable occurrance of a glyph - +to create image-instances for every displayable occurrence of a glyph - and every usage - and this would be extremely memory and cpu intensive. Widget-glyphs (a.k.a native widgets) are not cached in this way. This is @@ -8802,7 +8651,7 @@ tree recursively. This has desirable properties such as lw_modify_all_widgets which is called from glyphs-x.c and updates all the properties of a widget without having to know what the widget is or what toolkit it is from. -Unfortunately this also has hairy properrties such as making the lwlib +Unfortunately this also has hairy properties such as making the lwlib code quite complex. And of course lwlib has to know at some level what the widget is and how to set its properties. diff --git a/man/lispref/backups.texi b/man/lispref/backups.texi index 59aa856..62fc2e8 100644 --- a/man/lispref/backups.texi +++ b/man/lispref/backups.texi @@ -226,7 +226,7 @@ backup version 3 is excess. The function @code{find-backup-file-name} (@pxref{Backup Names}) is responsible for determining which backup versions to delete, but does not delete them itself. -@defopt trim-versions-without-asking +@defopt delete-old-versions If this variable is non-@code{nil}, then saving a file deletes excess backup versions silently. Otherwise, it asks the user whether to delete them. diff --git a/man/xemacs/files.texi b/man/xemacs/files.texi index 7ca98a7..7ee4fcf 100644 --- a/man/xemacs/files.texi +++ b/man/xemacs/files.texi @@ -477,8 +477,8 @@ The values are used just after a new backup version is made; that newly made backup is included in the count in @code{kept-new-versions}. By default, both variables are 2. -@vindex trim-versions-without-asking - If @code{trim-versions-without-asking} is non-@code{nil}, excess +@vindex delete-old-versions + If @code{delete-old-versions} is non-@code{nil}, excess middle versions are deleted without notification. If it is @code{nil}, the default, you are asked whether the excess middle versions should really be deleted. diff --git a/nt/ChangeLog b/nt/ChangeLog index 7565951..0ec6b19 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,18 @@ +2000-02-21 Martin Buchholz + + * XEmacs 21.2.30 is released. + +2000-02-21 Jonathan Harris + + * README: Tidy up. + Document need for makeinfo program or texinfo package. + + * Xmd.patch: New file, previously in README. + +2000-02-17 Martin Buchholz + + * config.h: Delete unused HAVE_LINUX_VERSION_H. + 2000-02-16 Martin Buchholz * XEmacs 21.2.29 is released. diff --git a/nt/README b/nt/README index a6e5c95..67c6889 100644 --- a/nt/README +++ b/nt/README @@ -1,4 +1,4 @@ - Building and Installing XEmacs on Windows NT +Building and Installing XEmacs on Windows NT -*- mode:outline -*- David Hobley Marc Paquette @@ -8,28 +8,61 @@ The port was made much easier by the groundbreaking work of Geoff Voelker and others who worked on the GNU Emacs port to NT. Their version is available from http://www.cs.washington.edu/homes/voelker/ntemacs.html -To get it working you will need: -1. You will need Visual C++ V4.0 or later to compile everything. Personally we - have tested V4.0, V4.2 and V5.0. - Note that Visual C++ assumes a couple of environment variables INCLUDE and - LIB to be set which specify the location of the includes and libraries. - Your PATH environment variable also needs to include the DevStudio vc\bin - and sharedide\bin directories. +* Required tools and sources +============================ + +1. You will need Visual C++ V4.0 or later to compile everything. Personally + we have tested V4.0, V4.2, V5.0 and v6.0. + + Note that Visual C++ assumes that the environment variables INCLUDE and + LIB are set to specify the location of the includes and libraries. + Your PATH environment variable also needs to include the DevStudio + vc\bin and sharedide\bin directories. + Visual C++ V5.0 installs a batch file called vcvars32.bat in c:\Program Files\DevStudio\VC\bin\ (or wherever you installed it) that you can run before building to set up all of these environment variables. -2. Grab the latest XEmacs source from ftp.xemacs.org if necessary. All Win32 - support is in the nt\ subdirectory. You'll also need the xemacs-base - package from the binary-packages subdirectory and you'll probably also - want at least the edit-utils, text-modes, fsf-compat, cc-mode, - prog-modes and xemacs-devel packages. +2. Grab the latest XEmacs source from ftp.xemacs.org if necessary. + + You'll also need the xemacs-base package from the binary-packages + subdirectory and you'll probably also want at least the edit-utils, + text-modes, fsf-compat, cc-mode, prog-modes and xemacs-devel + packages. + + You'll also need the texinfo package unless you have a copy of + makeinfo.exe on your machine. + Unpack the packages into, say, "c:\Program Files\XEmacs\xemacs-packages". -3. At this point you can select X or Win32 native GUI support. +3. At this point you can choose to build for X and/or for Win32 native GUI. + If you only want to build for the Win32 native GUI then skip the next + section. + + +** Extra tools and sources required for X + +If you want support for X you will also need: + +1. An X server. MI/X is available on the Internet for free; It is + available from: http://www.microimages.com/www/html/freestuf/mixdlfrm.htm + +2. Source for the MIT X11R6.3 libraries, available from: ftp.x.org + +3. You'll need to compile the MIT libraries without multi-thread support. + To do this, there is an example Win32.cf and site.def provided which set + the relevant flags. You will also need to apply the patch in nt/X11.patch + in the xc/lib/X11 directory which will fix the DLL definition file. + + Once compiled and installed, you will need to apply the patch in + nt/Xmd.patch. This is messy and better solutions would be appreciated. + +4. Goto step 2 under 'Optional libraries' below. + -If you want to build for native GUI: +* Optional libraries +==================== 1. If you want XPM image and toolbar support grab the latest version of the xpm sources (xpm-3.4k.tar.gz at time of writing) and unpack them somewhere. @@ -63,10 +96,14 @@ If you want to build for native GUI: directory. cd to that directory and build libcompface with 'nmake -f compface.mak'. -6. cd to the nt subdirectory of the xemacs distribution and build xemacs: + +* Building +========== + +1. cd to the nt subdirectory of the xemacs distribution and build xemacs: `nmake install -f xemacs.mak`, but read on before hitting Enter. -7. If you're building with XPM support, add this to the nmake command line: +2. If you're building with XPM support, add this to the nmake command line: HAVE_XPM=1 XPM_DIR="x:\location\of\your\xpm\sources" and similarly for JPEG and TIFF support. @@ -78,77 +115,79 @@ If you want to build for native GUI: HAVE_GIF=1 If you're building with X-Face support, add this to the nmake command line: - HAVE_XFACE=1 COMPFACE_DIR="x:\location\of\your\compface\sources" + HAVE_XFACE=1 COMPFACE_DIR="x:\location\of\your\compface\sources" + + If you're building for X, add this to the nmake command line: + HAVE_X=1 X11_DIR=x:\root\directory\of\your\X11\installation -8. By default, XEmacs will expect to find its packages in the subdirectories +3. By default, XEmacs will expect to find its packages in the subdirectories "site-packages", "mule-packages" and "xemacs-packages" under the package prefix directory "c:\Program Files\XEmacs". If you want it to look for these subdirectories elsewhere, add this to the nmake command line: PACKAGE_PREFIX="x:\your\package\directory" If you change your mind and want to alter the package prefix directory - after you've built XEmacs, delete the file .\obj\emacs.obj and rebuild with - the new PACKAGE_PREFIX. + after you've built XEmacs, delete the file nt\obj\emacs.obj and rebuild + with the new PACKAGE_PREFIX setting. -9. By default, XEmacs will be installed in directories under the directory - "c:\Program Files\XEmacs\XEmacs-21.0". If you want to install it elsewhere, - add this to the nmake command line: +4. By default, XEmacs will be installed in directories under the directory + "c:\Program Files\XEmacs\XEmacs-21.2". If you want to install it + elsewhere, add this to the nmake command line: INSTALL_DIR="x:\your\installation\directory" -10. Now you can press Enter. nmake will build temacs, the DOC file, update the - elc's, dump xemacs and install the relevant files in the directories under - the installation directory. Unless you set INSTALL_DIR above, the file that - you should run to start XEmacs will be installed as - "c:\Program Files\XEmacs\XEmacs-21.0\i386-pc-win32\runemacs.exe". You may - want to create a shortcut to that file from your Desktop or Start Menu. - -11. The build process always creates debugging and "Source Browser" information - in the source tree for use with MS DevStudio. If you actually want to debug - XEmacs you should run XEmacs from the source directory instead of from the - installation directory. You should probably also build a debug version of - XEmacs; to do this start with a clean source tree and add DEBUG_XEMACS=1 to - the nmake command line. You probably don't want to install your debug build - so you should tell nmake to build the 'all' target instead of the 'install' - target. - - To make use of the debugging and "Source Browser" information, create a new - "console" project in MS DevStudio and, under Project/Settings, set: +5. XEmacs can build its info files more quickly if you have a copy of the + makeinfo program. If you have a copy, add this to the nmake command line: + MAKEINFO="x:\location\of\makeinfo.exe" + If you don't have a copy of makeinfo then you'll need to have installed + the XEmacs texinfo package. + +6. Now you can press Enter. nmake will build temacs, the DOC file, update + the elc's, dump xemacs and install the relevant files in the directories + under the installation directory. + + Unless you set INSTALL_DIR above, the file that you should run to start + XEmacs will be installed as + "c:\Program Files\XEmacs\XEmacs-21.2\i586-pc-win32\runxemacs.exe". + You may want to create a shortcut to that file from your Desktop or + Start Menu. + + +* Debugging under MS Developer Studio +===================================== + +The build process always creates debugging and "Source Browser" information +in the source tree for use with DevStudio. If you actually want to debug +XEmacs you should probably build a debug version of XEmacs: + +1. Delete the directory nt\obj and it's contents. + +2. Add DEBUG_XEMACS=1 to the nmake command line and rebuild. You probably + don't want to install your debug build so you should tell nmake to build + the 'all' target instead of the 'install' target. + +3. To make use of the debugging and "Source Browser" information, create a + new "console" project in DevStudio and, under Project/Settings, set: Debug: executable name = full path of src\xemacs.exe Link: output file name = full path of src\temacs.exe Browse Info: browse info file name = full path of src\temacs.bsc Remember to close the Source Browser file in DevStudio before rebuilding. +4. Start XEmacs from within DevStudio or by running src\xemacs.exe so that + you get a console window which may contain helpful debugging info. -If you want support for X you will need: +5. To display the contents of a lisp variable click Debug/QuickWatch, type + debug_print(variable) and click Recalculate. The output will appear in + the console window. -1. An X server. MI/X is available on the Internet for free; It is - available from: http://www.microimages.com/www/html/freestuf/mixdlfrm.htm - -2. The MIT X11R6.3 libraries available from: ftp.x.org +6. To view lisp variables in the "Watch" window wrap the variable in one of + the helper functions from the file src\console-msw.c. eg type + DSTRING(variable) in the "Watch" window to inspect a lisp string. -3. You'll need to compile the MIT libraries without multi-thread support. - To do this, there is an example Win32.cf and site.def provided which - set the relevant flags. You will also need to apply the patch in - nt/X11.patch in the xc/lib/X11 directory which will fix the DLL definition - file. Once compiled and installed, you will need to apply the following - patch to Xmd.h. This is messy and better solutions would be appreciated. -4. Goto 2 under 'native GUI' above and add this to the nmake command line: - HAVE_X=1 X11_DIR=x:\root\directory\of\your\X11\installation +* Known Problems +================ ---- Xmd.h~ Thu Jun 08 23:20:40 1995 -+++ Xmd.h Sun Mar 16 13:09:10 1997 -@@ -150,8 +150,9 @@ - typedef CARD16 BITS16; - typedef CARD8 BYTE; - -+#ifndef WIN32 - typedef CARD8 BOOL; -- -+#endif - -Known Problems: -Please look at the TODO list for the current list of problems and people -working on them. +Please look at the PROBLEMS file for known problems and at the TODO list for +the current list of problems and people working on them. Any other problems you need clarified, please email us and we will endeavour to provide any assistance we can: diff --git a/nt/config.h b/nt/config.h index 9a155f0..f751412 100644 --- a/nt/config.h +++ b/nt/config.h @@ -154,7 +154,6 @@ Boston, MA 02111-1307, USA. */ #undef HAVE_UTIME_H #undef HAVE_SYS_WAIT_H #undef HAVE_LIBGEN_H -#undef HAVE_LINUX_VERSION_H #undef WORDS_BIGENDIAN #undef TIME_WITH_SYS_TIME diff --git a/src/Makefile.in.in b/src/Makefile.in.in index ba45163..bcc0103 100644 --- a/src/Makefile.in.in +++ b/src/Makefile.in.in @@ -326,17 +326,10 @@ release: temacs ${libsrc}DOC $(mo_file) ${other_files} #ifdef CANNOT_DUMP ln temacs ${PROGNAME} #else -#ifdef HAVE_SHM - -if [ -w ${srcdir}/../lisp ]; then \ - w=`pwd`; cd ${srcdir} && $${w}/temacs -nl -batch -l ${srcdir}/../lisp/inc-vers; \ - else true; fi - -$(DUMPENV) ./temacs -nl -batch -l ${srcdir}/../lisp/loadup.el dump -#else /* ! defined (HAVE_SHM) */ -if [ -w ${srcdir}/../lisp ]; then \ w=`pwd`; cd ${srcdir} && $${w}/temacs -batch -l ${srcdir}/../lisp/inc-vers; \ else true; fi -$(DUMPENV) ./temacs -batch -l ${srcdir}/../lisp/loadup.el dump -#endif /* ! defined (HAVE_SHM) */ touch release #endif /* ! defined (CANNOT_DUMP) */ diff --git a/src/bytecode.c b/src/bytecode.c index fd35a0e..b0ff4e0 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -2410,6 +2410,8 @@ If STACK-DEPTH is incorrect, Emacs may crash. void syms_of_bytecode (void) { + INIT_LRECORD_IMPLEMENTATION (compiled_function); + deferror (&Qinvalid_byte_code, "invalid-byte-code", "Invalid byte code", Qerror); defsymbol (&Qbyte_code, "byte-code"); diff --git a/src/console-tty.c b/src/console-tty.c index c8912fb..9ebfbf3 100644 --- a/src/console-tty.c +++ b/src/console-tty.c @@ -115,7 +115,7 @@ tty_init_console (struct console *con, Lisp_Object props) tty_con->instream = make_filedesc_input_stream (tty_con->infd, 0, -1, 0); tty_con->outstream = make_filedesc_output_stream (tty_con->outfd, 0, -1, 0); -#ifdef MULE +#ifdef FILE_CODING tty_con->instream = make_decoding_input_stream (XLSTREAM (tty_con->instream), Fget_coding_system (Vkeyboard_coding_system)); @@ -123,7 +123,7 @@ tty_init_console (struct console *con, Lisp_Object props) tty_con->outstream = make_encoding_output_stream (XLSTREAM (tty_con->outstream), Fget_coding_system (Vterminal_coding_system)); -#endif /* MULE */ +#endif /* FILE_CODING */ tty_con->terminal_type = terminal_type; tty_con->controlling_process = controlling_process; diff --git a/src/console.c b/src/console.c index 0c7c2ad..068200e 100644 --- a/src/console.c +++ b/src/console.c @@ -1073,6 +1073,8 @@ The elements of this list correspond to the arguments of void syms_of_console (void) { + INIT_LRECORD_IMPLEMENTATION (console); + DEFSUBR (Fvalid_console_type_p); DEFSUBR (Fconsole_type_list); DEFSUBR (Fcdfw_console); @@ -1195,20 +1197,16 @@ One argument, the to-be-deleted console. } /* The docstrings for DEFVAR_* are recorded externally by make-docfile. */ - -/* Declaring this stuff as const produces 'Cannot reinitialize' messages - from SunPro C's fix-and-continue feature (a way neato feature that - makes debugging unbelievably more bearable) */ #define DEFVAR_CONSOLE_LOCAL_1(lname, field_name, forward_type, magicfun) do { \ - static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C = \ + static const struct symbol_value_forward I_hate_C = \ { /* struct symbol_value_forward */ \ { /* struct symbol_value_magic */ \ { /* struct lcrecord_header */ \ { /* struct lrecord_header */ \ - 1, /* type - index into lrecord_implementations_table */ \ - 0, /* mark bit */ \ - 0, /* c_readonly bit */ \ - 0 /* lisp_readonly bit */ \ + lrecord_type_symbol_value_forward, /* lrecord_type_index */ \ + 1, /* mark bit */ \ + 1, /* c_readonly bit */ \ + 1 /* lisp_readonly bit */ \ }, \ 0, /* next */ \ 0, /* uid */ \ diff --git a/src/device-msw.c b/src/device-msw.c index 67d08ad..ded93db 100644 --- a/src/device-msw.c +++ b/src/device-msw.c @@ -34,6 +34,7 @@ Boston, MA 02111-1307, USA. */ #include "console-msw.h" #include "console-stream.h" +#include "objects-msw.h" #include "events.h" #include "faces.h" #include "frame.h" @@ -68,18 +69,7 @@ Lisp_Object Qinit_pre_mswindows_win, Qinit_post_mswindows_win; static Lisp_Object build_syscolor_string (int idx) { - DWORD clr; - char buf[16]; - - if (idx < 0) - return Qnil; - - clr = GetSysColor (idx); - sprintf (buf, "#%02X%02X%02X", - GetRValue (clr), - GetGValue (clr), - GetBValue (clr)); - return build_string (buf); + return (idx < 0 ? Qnil : mswindows_color_to_string (GetSysColor (idx))); } static Lisp_Object @@ -159,7 +149,7 @@ mswindows_init_device (struct device *d, Lisp_Object props) wc.lpszMenuName = NULL; wc.lpszClassName = XEMACS_CLASS; - wc.hIconSm = LoadImage (GetModuleHandle (NULL), XEMACS_CLASS, + wc.hIconSm = (HICON) LoadImage (GetModuleHandle (NULL), XEMACS_CLASS, IMAGE_ICON, 16, 16, 0); RegisterClassEx (&wc); @@ -201,7 +191,10 @@ static void mswindows_delete_device (struct device *d) { #ifdef HAVE_DRAGNDROP - DdeNameService (mswindows_dde_mlid, 0L, 0L, DNS_REGISTER); + DdeNameService (mswindows_dde_mlid, 0L, 0L, DNS_UNREGISTER); + DdeFreeStringHandle (mswindows_dde_mlid, mswindows_dde_item_open); + DdeFreeStringHandle (mswindows_dde_mlid, mswindows_dde_topic_system); + DdeFreeStringHandle (mswindows_dde_mlid, mswindows_dde_service); DdeUninitialize (mswindows_dde_mlid); #endif @@ -243,22 +236,22 @@ mswindows_device_system_metrics (struct device *d, break; /*** Colors ***/ -#define FROB(met, index1, index2) \ +#define FROB(met, fore, back) \ case DM_##met: \ - return build_syscolor_cons (index1, index2); + return build_syscolor_cons (fore, back); - FROB (color_default, COLOR_WINDOW, COLOR_WINDOWTEXT); - FROB (color_select, COLOR_HIGHLIGHT, COLOR_HIGHLIGHTTEXT); - FROB (color_balloon, COLOR_INFOBK, COLOR_INFOTEXT); - FROB (color_3d_face, COLOR_3DFACE, COLOR_BTNTEXT); - FROB (color_3d_light, COLOR_3DLIGHT, COLOR_3DHILIGHT); - FROB (color_3d_dark, COLOR_3DSHADOW, COLOR_3DDKSHADOW); - FROB (color_menu, COLOR_MENU, COLOR_MENUTEXT); - FROB (color_menu_highlight, COLOR_HIGHLIGHT, COLOR_HIGHLIGHTTEXT); - FROB (color_menu_button, COLOR_MENU, COLOR_MENUTEXT); - FROB (color_menu_disabled, COLOR_MENU, COLOR_GRAYTEXT); - FROB (color_toolbar, COLOR_BTNFACE, COLOR_BTNTEXT); - FROB (color_scrollbar, COLOR_SCROLLBAR, COLOR_CAPTIONTEXT); + FROB (color_default, COLOR_WINDOWTEXT, COLOR_WINDOW); + FROB (color_select, COLOR_HIGHLIGHTTEXT, COLOR_HIGHLIGHT); + FROB (color_balloon, COLOR_INFOTEXT, COLOR_INFOBK); + FROB (color_3d_face, COLOR_BTNTEXT, COLOR_BTNFACE); + FROB (color_3d_light, COLOR_3DHILIGHT, COLOR_3DLIGHT); + FROB (color_3d_dark, COLOR_3DDKSHADOW, COLOR_3DSHADOW); + FROB (color_menu, COLOR_MENUTEXT, COLOR_MENU); + FROB (color_menu_highlight, COLOR_HIGHLIGHTTEXT, COLOR_HIGHLIGHT); + FROB (color_menu_button, COLOR_MENUTEXT, COLOR_MENU); + FROB (color_menu_disabled, COLOR_GRAYTEXT, COLOR_MENU); + FROB (color_toolbar, COLOR_BTNTEXT, COLOR_BTNFACE); + FROB (color_scrollbar, COLOR_CAPTIONTEXT, COLOR_SCROLLBAR); FROB (color_desktop, -1, COLOR_DESKTOP); FROB (color_workspace, -1, COLOR_APPWORKSPACE); #undef FROB @@ -358,7 +351,8 @@ msprinter_init_device (struct device *d, Lisp_Object props) if (DEVICE_MSPRINTER_DEVMODE_SIZE(d) <= 0) signal_open_printer_error (d); - DEVICE_MSPRINTER_DEVMODE(d) = xmalloc (DEVICE_MSPRINTER_DEVMODE_SIZE(d)); + DEVICE_MSPRINTER_DEVMODE(d) = + (DEVMODE*) xmalloc (DEVICE_MSPRINTER_DEVMODE_SIZE(d)); DocumentProperties (NULL, DEVICE_MSPRINTER_HPRINTER(d), printer_name, DEVICE_MSPRINTER_DEVMODE(d), NULL, DM_OUT_BUFFER); @@ -459,7 +453,7 @@ msprinter_get_devmode_copy (struct device *d) if (DEVICE_MSPRINTER_DEVMODE_MIRROR(d) == NULL) DEVICE_MSPRINTER_DEVMODE_MIRROR(d) = - xmalloc (DEVICE_MSPRINTER_DEVMODE_SIZE(d)); + (DEVMODE*) xmalloc (DEVICE_MSPRINTER_DEVMODE_SIZE(d)); memcpy (DEVICE_MSPRINTER_DEVMODE_MIRROR(d), DEVICE_MSPRINTER_DEVMODE(d), diff --git a/src/device.c b/src/device.c index 458d617..25aa688 100644 --- a/src/device.c +++ b/src/device.c @@ -1,4 +1,4 @@ - /* Generic device functions. +/* Generic device functions. Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. Copyright (C) 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1995, 1996 Ben Wing @@ -986,7 +986,7 @@ size-icon-small Small icon dimensions. size-device Device screen or paper size in pixels. size-workspace Workspace size in pixels. This can be less than or equal to the above. For diplays, this is the area - available to applications less window manager + available to applications less window manager decorations. For printers, this is the size of printable area. offset-workspace Offset of workspace area from the top left corner @@ -1244,6 +1244,8 @@ call_critical_lisp_code (struct device *d, Lisp_Object function, void syms_of_device (void) { + INIT_LRECORD_IMPLEMENTATION (device); + DEFSUBR (Fvalid_device_class_p); DEFSUBR (Fdevice_class_list); diff --git a/src/editfns.c b/src/editfns.c index 306315e..61ceb1f 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -779,10 +779,10 @@ value of `user-full-name' is returned. /* #### - Stig sez: this should return nil instead of "unknown" when pw==0 */ /* Ben sez: bad idea because it's likely to break something */ #ifndef AMPERSAND_FULL_NAME - p = ((pw) ? USER_FULL_NAME : "unknown"); /* don't gettext */ + p = pw ? USER_FULL_NAME : "unknown"; /* don't gettext */ q = strchr (p, ','); #else - p = ((pw) ? USER_FULL_NAME : "unknown"); /* don't gettext */ + p = pw ? USER_FULL_NAME : "unknown"; /* don't gettext */ q = strchr (p, ','); #endif tem = ((!NILP (user) && !pw) @@ -855,12 +855,12 @@ get_home_directory (void) */ if (initial_directory[0] != '\0') { - cached_home_directory = initial_directory; + cached_home_directory = (Extbyte*) initial_directory; } else { /* This will probably give the wrong value */ - cached_home_directory = getcwd (NULL, 0); + cached_home_directory = (Extbyte*) getcwd (NULL, 0); } # else /* diff --git a/src/eldap.c b/src/eldap.c index 1f8e2c7..99c5d53 100644 --- a/src/eldap.c +++ b/src/eldap.c @@ -54,6 +54,9 @@ static Lisp_Object Qbase, Qonelevel, Qsubtree; static Lisp_Object Qkrbv41, Qkrbv42; /* Deref policy */ static Lisp_Object Qnever, Qalways, Qfind; +/* Modification types (Qdelete is defined in general.c) */ +static Lisp_Object Qadd, Qreplace; + /************************************************************************/ /* Utility Functions */ @@ -316,6 +319,9 @@ the LDAP library XEmacs was compiled with: `simple', `krbv41' and `krbv42'. if ((err = ldap_set_option (ld, LDAP_OPT_REFERRALS, LDAP_OPT_ON)) != LDAP_SUCCESS) signal_ldap_error (ld, NULL, err); + if ((err = ldap_set_option (ld, LDAP_OPT_RESTART, + LDAP_OPT_ON)) != LDAP_SUCCESS) + signal_ldap_error (ld, NULL, err); #else /* not HAVE_LDAP_SET_OPTION */ ld->ld_deref = ldap_deref; ld->ld_timelimit = ldap_timelimit; @@ -325,12 +331,11 @@ the LDAP library XEmacs was compiled with: `simple', `krbv41' and `krbv42'. #else /* not LDAP_REFERRALS */ ld->ld_options = 0; #endif /* not LDAP_REFERRALS */ + /* XEmacs uses interrupts (SIGIO,SIGALRM), LDAP calls need to ignore them */ + ld->ld_options |= LDAP_OPT_RESTART; #endif /* not HAVE_LDAP_SET_OPTION */ - /* ldap_bind_s calls select and may be wedged by SIGIO. */ - slow_down_interrupts (); err = ldap_bind_s (ld, ldap_binddn, ldap_passwd, ldap_auth); - speed_up_interrupts (); if (err != LDAP_SUCCESS) signal_simple_error ("Failed binding to the server", build_string (ldap_err2string (err))); @@ -368,7 +373,6 @@ struct ldap_unwind_struct struct berval **vals; }; - static Lisp_Object ldap_search_unwind (Lisp_Object unwind_obj) { @@ -381,7 +385,12 @@ ldap_search_unwind (Lisp_Object unwind_obj) return Qnil; } -DEFUN ("ldap-search-internal", Fldap_search_internal, 2, 7, 0, /* +/* The following function is called `ldap-search-basic' instead of */ +/* plain `ldap-search' to maintain compatibility with the XEmacs 21.1 */ +/* API where `ldap-search' was the name of the high-level search */ +/* function */ + +DEFUN ("ldap-search-basic", Fldap_search_basic, 2, 8, 0, /* Perform a search on an open LDAP connection. LDAP is an LDAP connection object created with `ldap-open'. FILTER is a filter string for the search as described in RFC 1558. @@ -392,13 +401,14 @@ ATTRS is a list of strings indicating which attributes to retrieve for each matching entry. If nil return all available attributes. If ATTRSONLY is non-nil then only the attributes are retrieved, not the associated values. -If WITHDN is non-nil each entry in the result will be prepennded with +If WITHDN is non-nil each entry in the result will be prepended with its distinguished name DN. +If VERBOSE is non-nil progress messages will be echoed. The function returns a list of matching entries. Each entry is itself an alist of attribute/value pairs optionally preceded by the DN of the entry according to the value of WITHDN. */ - (ldap, filter, base, scope, attrs, attrsonly, withdn)) + (ldap, filter, base, scope, attrs, attrsonly, withdn, verbose)) { /* This function can GC */ @@ -496,10 +506,8 @@ entry according to the value of WITHDN. /* Build the results list */ matches = 0; - /* ldap_result calls select() and can get wedged by EINTR signals */ - slow_down_interrupts (); rc = ldap_result (ld, LDAP_RES_ANY, 0, NULL, &unwind.res); - speed_up_interrupts (); + while (rc == LDAP_RES_SEARCH_ENTRY) { QUIT; @@ -509,7 +517,8 @@ entry according to the value of WITHDN. destroys the current echo area contents, even when invoked from Lisp. It should use echo_area_message() instead, and restore the old echo area contents later. */ - message ("Parsing ldap results... %d", matches); + if (! NILP (verbose)) + message ("Parsing ldap results... %d", matches); entry = Qnil; /* Get the DN if required */ if (! NILP (withdn)) @@ -545,43 +554,242 @@ entry according to the value of WITHDN. ldap_msgfree (unwind.res); unwind.res = NULL; - slow_down_interrupts (); rc = ldap_result (ld, LDAP_RES_ANY, 0, NULL, &(unwind.res)); - speed_up_interrupts (); } - if (rc == -1) - signal_ldap_error (ld, unwind.res, 0); - - if (rc == 0) - signal_ldap_error (ld, NULL, LDAP_TIMELIMIT_EXCEEDED); - #if defined HAVE_LDAP_PARSE_RESULT rc2 = ldap_parse_result (ld, unwind.res, &rc, NULL, NULL, NULL, NULL, 0); if (rc2 != LDAP_SUCCESS) rc = rc2; -#elif defined HAVE_LDAP_RESULT2ERROR +#else + if (rc == 0) + signal_ldap_error (ld, NULL, LDAP_TIMELIMIT_EXCEEDED); + + if (rc == -1) + signal_ldap_error (ld, unwind.res, (unwind.res==NULL) ? ld->ld_errno : 0); + +#if defined HAVE_LDAP_RESULT2ERROR rc = ldap_result2error (ld, unwind.res, 0); #endif - if ((rc != LDAP_SUCCESS) && (rc != LDAP_SIZELIMIT_EXCEEDED)) +#endif + + if (rc != LDAP_SUCCESS) signal_ldap_error (ld, NULL, rc); ldap_msgfree (unwind.res); unwind.res = (LDAPMessage *)NULL; + /* #### See above for calling message(). */ - message ("Parsing ldap results... done"); + if (! NILP (verbose)) + message ("Parsing ldap results... done"); unbind_to (speccount, Qnil); UNGCPRO; return Fnreverse (result); } +DEFUN ("ldap-add", Fldap_add, 3, 3, 0, /* +Add an entry to an LDAP directory. +LDAP is an LDAP connection object created with `ldap-open'. +DN is the distinguished name of the entry to add. +ENTRY is an entry specification, i.e., a list of cons cells +containing attribute/value string pairs. +*/ + (ldap, dn, entry)) +{ + LDAP *ld; + LDAPMod *ldap_mods, **ldap_mods_ptrs; + struct berval *bervals; + int rc; + int i, j; + + Lisp_Object current, values; + struct gcpro gcpro1, gcpro2; + GCPRO2 (current, values); + + /* Do all the parameter checking */ + CHECK_LIVE_LDAP (ldap); + ld = XLDAP (ldap)->ld; + + /* Check the DN */ + CHECK_STRING (dn); + + /* Check the entry */ + CHECK_CONS (entry); + if (NILP (entry)) + signal_simple_error ("Cannot add void entry", entry); + + /* Build the ldap_mods array */ + ldap_mods = alloca_array (LDAPMod, XINT (Flength (entry))); + ldap_mods_ptrs = alloca_array (LDAPMod *, 1 + XINT (Flength (entry))); + i = 0; + EXTERNAL_LIST_LOOP (entry, entry) + { + current = XCAR (entry); + CHECK_CONS (current); + CHECK_STRING (XCAR (current)); + ldap_mods_ptrs[i] = &(ldap_mods[i]); + TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (current), + C_STRING_ALLOCA, ldap_mods[i].mod_type, + Qnative); + ldap_mods[i].mod_op = LDAP_MOD_ADD | LDAP_MOD_BVALUES; + values = XCDR (current); + if (CONSP (values)) + { + bervals = + alloca_array (struct berval, XINT (Flength (values))); + ldap_mods[i].mod_vals.modv_bvals = + alloca_array (struct berval *, 1 + XINT (Flength (values))); + j = 0; + EXTERNAL_LIST_LOOP (values, values) + { + current = XCAR (values); + CHECK_STRING (current); + ldap_mods[i].mod_vals.modv_bvals[j] = &(bervals[j]); + TO_EXTERNAL_FORMAT (LISP_STRING, current, + ALLOCA, (bervals[j].bv_val, + bervals[j].bv_len), + Qnative); + j++; + } + ldap_mods[i].mod_vals.modv_bvals[j] = NULL; + } + else + { + CHECK_STRING (values); + bervals = alloca_array (struct berval, 1); + ldap_mods[i].mod_vals.modv_bvals = alloca_array (struct berval *, 2); + ldap_mods[i].mod_vals.modv_bvals[0] = &(bervals[0]); + TO_EXTERNAL_FORMAT (LISP_STRING, values, + ALLOCA, (bervals[0].bv_val, + bervals[0].bv_len), + Qnative); + ldap_mods[i].mod_vals.modv_bvals[1] = NULL; + } + i++; + } + ldap_mods_ptrs[i] = NULL; + rc = ldap_add_s (ld, (char *) XSTRING_DATA (dn), ldap_mods_ptrs); + if (rc != LDAP_SUCCESS) + signal_ldap_error (ld, NULL, rc); + + UNGCPRO; +} + +DEFUN ("ldap-modify", Fldap_modify, 3, 3, 0, /* +Add an entry to an LDAP directory. +LDAP is an LDAP connection object created with `ldap-open'. +DN is the distinguished name of the entry to modify. +MODS is a list of modifications to apply. +A modification is a list of the form (MOD-OP ATTR VALUE1 VALUE2 ...) +MOD-OP and ATTR are mandatory, VALUEs are optional depending on MOD-OP. +MOD-OP is the type of modification, one of the symbols `add', `delete' +or `replace'. ATTR is the LDAP attribute type to modify +*/ + (ldap, dn, mods)) +{ + LDAP *ld; + LDAPMod *ldap_mods, **ldap_mods_ptrs; + struct berval *bervals; + int i, j, rc; + + Lisp_Object current, mod_op, values; + struct gcpro gcpro1, gcpro2; + + GCPRO2 (current, values); + + /* Do all the parameter checking */ + CHECK_LIVE_LDAP (ldap); + ld = XLDAP (ldap)->ld; + + /* Check the DN */ + CHECK_STRING (dn); + + /* Check the entry */ + CHECK_CONS (mods); + if (NILP (mods)) + return Qnil; + + /* Build the ldap_mods array */ + ldap_mods = alloca_array (LDAPMod, XINT (Flength (mods))); + ldap_mods_ptrs = alloca_array (LDAPMod *, 1 + XINT (Flength (mods))); + i = 0; + EXTERNAL_LIST_LOOP (mods, mods) + { + current = XCAR (mods); + CHECK_CONS (current); + CHECK_SYMBOL (XCAR (current)); + mod_op = XCAR (current); + ldap_mods_ptrs[i] = &(ldap_mods[i]); + ldap_mods[i].mod_op = LDAP_MOD_BVALUES; + if (EQ (mod_op, Qadd)) + ldap_mods[i].mod_op |= LDAP_MOD_ADD; + else if (EQ (mod_op, Qdelete)) + ldap_mods[i].mod_op |= LDAP_MOD_DELETE; + else if (EQ (mod_op, Qreplace)) + ldap_mods[i].mod_op |= LDAP_MOD_REPLACE; + else + signal_simple_error ("Invalid LDAP modification type", mod_op); + current = XCDR (current); + CHECK_STRING (XCAR (current)); + TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (current), + C_STRING_ALLOCA, ldap_mods[i].mod_type, + Qnative); + values = XCDR (current); + bervals = alloca_array (struct berval, XINT (Flength (values))); + ldap_mods[i].mod_vals.modv_bvals = + alloca_array (struct berval *, 1 + XINT (Flength (values))); + j = 0; + EXTERNAL_LIST_LOOP (values, values) + { + current = XCAR (values); + CHECK_STRING (current); + ldap_mods[i].mod_vals.modv_bvals[j] = &(bervals[j]); + TO_EXTERNAL_FORMAT (LISP_STRING, current, + ALLOCA, (bervals[j].bv_val, + bervals[j].bv_len), + Qnative); + j++; + } + ldap_mods[i].mod_vals.modv_bvals[j] = NULL; + i++; + } + ldap_mods_ptrs[i] = NULL; + rc = ldap_modify_s (ld, (char *) XSTRING_DATA (dn), ldap_mods_ptrs); + if (rc != LDAP_SUCCESS) + signal_ldap_error (ld, NULL, rc); + + UNGCPRO; +} + + +DEFUN ("ldap-delete", Fldap_delete, 2, 2, 0, /* +Delete an entry to an LDAP directory. +LDAP is an LDAP connection object created with `ldap-open'. +DN is the distinguished name of the entry to delete. +*/ + (ldap, dn)) +{ + LDAP *ld; + int rc; + + /* Check parameters */ + CHECK_LIVE_LDAP (ldap); + ld = XLDAP (ldap)->ld; + CHECK_STRING (dn); + + rc = ldap_delete_s (ld, (char *) XSTRING_DATA (dn)); + if (rc != LDAP_SUCCESS) + signal_ldap_error (ld, NULL, rc); +} void syms_of_eldap (void) { + INIT_LRECORD_IMPLEMENTATION (ldap); + defsymbol (&Qldapp, "ldapp"); defsymbol (&Qport, "port"); defsymbol (&Qauth, "auth"); @@ -598,13 +806,18 @@ syms_of_eldap (void) defsymbol (&Qnever, "never"); defsymbol (&Qalways, "always"); defsymbol (&Qfind, "find"); + defsymbol (&Qadd, "add"); + defsymbol (&Qreplace, "replace"); DEFSUBR (Fldapp); DEFSUBR (Fldap_host); DEFSUBR (Fldap_status); DEFSUBR (Fldap_open); DEFSUBR (Fldap_close); - DEFSUBR (Fldap_search_internal); + DEFSUBR (Fldap_search_basic); + DEFSUBR (Fldap_add); + DEFSUBR (Fldap_modify); + DEFSUBR (Fldap_delete); } void diff --git a/src/eldap.h b/src/eldap.h index 5d869c3..0ca47b1 100644 --- a/src/eldap.h +++ b/src/eldap.h @@ -62,12 +62,21 @@ Lisp_Object Fldap_status (Lisp_Object ldap); Lisp_Object Fldap_open (Lisp_Object host, Lisp_Object ldap_plist); Lisp_Object Fldap_close (Lisp_Object ldap); -Lisp_Object Fldap_search_internal (Lisp_Object ldap, - Lisp_Object filter, - Lisp_Object base, - Lisp_Object scope, - Lisp_Object attrs, - Lisp_Object attrsonly, - Lisp_Object withdn); +Lisp_Object Fldap_search_basic (Lisp_Object ldap, + Lisp_Object filter, + Lisp_Object base, + Lisp_Object scope, + Lisp_Object attrs, + Lisp_Object attrsonly, + Lisp_Object withdn, + Lisp_Object verbose); +Lisp_Object Fldap_add (Lisp_Object ldap, + Lisp_Object dn, + Lisp_Object entry); +Lisp_Object Fldap_modify (Lisp_Object ldap, + Lisp_Object dn, + Lisp_Object entry); +Lisp_Object Fldap_delete (Lisp_Object ldap, + Lisp_Object dn); #endif /* INCLUDED_eldap_h_ */ diff --git a/src/elhash.c b/src/elhash.c index 251e549..52ba848 100644 --- a/src/elhash.c +++ b/src/elhash.c @@ -1425,6 +1425,8 @@ The value is returned as (HIGH . LOW). void syms_of_elhash (void) { + INIT_LRECORD_IMPLEMENTATION (hash_table); + DEFSUBR (Fhash_table_p); DEFSUBR (Fmake_hash_table); DEFSUBR (Fcopy_hash_table); diff --git a/src/eval.c b/src/eval.c index 50a7d33..426cda1 100644 --- a/src/eval.c +++ b/src/eval.c @@ -300,7 +300,7 @@ static const struct lrecord_description subr_description[] = { }; DEFINE_BASIC_LRECORD_IMPLEMENTATION ("subr", subr, - this_one_is_unmarkable, print_subr, 0, 0, 0, + 0, print_subr, 0, 0, 0, subr_description, Lisp_Subr); @@ -4960,6 +4960,8 @@ warn_when_safe (Lisp_Object class, Lisp_Object level, const char *fmt, ...) void syms_of_eval (void) { + INIT_LRECORD_IMPLEMENTATION (subr); + defsymbol (&Qinhibit_quit, "inhibit-quit"); defsymbol (&Qautoload, "autoload"); defsymbol (&Qdebug_on_error, "debug-on-error"); diff --git a/src/event-msw.c b/src/event-msw.c index 6d37617..e18c1e6 100644 --- a/src/event-msw.c +++ b/src/event-msw.c @@ -118,9 +118,6 @@ int windows_fd; static Lisp_Object mswindows_u_dispatch_event_queue, mswindows_u_dispatch_event_queue_tail; static Lisp_Object mswindows_s_dispatch_event_queue, mswindows_s_dispatch_event_queue_tail; -/* For speed: whether there is a WM_PAINT magic message in the system queue */ -static int mswindows_paint_pending = 0; - /* The number of things we can wait on */ #define MAX_WAITABLE (MAXIMUM_WAIT_OBJECTS - 1) @@ -636,8 +633,8 @@ struct winsock_stream SOCKET s; /* Socket handle (which is a Win32 handle) */ OVERLAPPED ov; /* Overlapped I/O structure */ void* buffer; /* Buffer. Allocated for input stream only */ - unsigned int bufsize; /* Number of bytes last read */ - unsigned int bufpos; /* Position in buffer for next fetch */ + unsigned long bufsize; /* Number of bytes last read */ + unsigned long bufpos; /* Position in buffer for next fetch */ unsigned int error_p :1; /* I/O Error seen */ unsigned int eof_p :1; /* EOF Error seen */ unsigned int pending_p :1; /* There is a pending I/O operation */ @@ -1257,12 +1254,8 @@ mswindows_drain_windows_queue () shouldn't have received a paint message for it here. */ assert (msg.wParam == 0); - if (!mswindows_paint_pending) - { - /* Queue a magic event for handling when safe */ - mswindows_enqueue_magic_event (msg.hwnd, WM_PAINT); - mswindows_paint_pending = 1; - } + /* Queue a magic event for handling when safe */ + mswindows_enqueue_magic_event (msg.hwnd, WM_PAINT); /* Don't dispatch. WM_PAINT is always the last message in the queue so it's OK to just return. */ @@ -1523,7 +1516,7 @@ mswindows_dde_callback (UINT uType, UINT uFmt, HCONV hconv, { mswindows_dde_service, mswindows_dde_topic_system }, { 0, 0 } }; if (!(hszItem || DdeCmpStringHandles (hszItem, mswindows_dde_service)) && - !(hszTopic || DdeCmpStringHandles (hszTopic, mswindows_dde_topic_system))); + !(hszTopic || DdeCmpStringHandles (hszTopic, mswindows_dde_topic_system))) return (DdeCreateDataHandle (mswindows_dde_mlid, (LPBYTE)pairs, sizeof (pairs), 0L, 0, uFmt, 0)); } @@ -1533,7 +1526,7 @@ mswindows_dde_callback (UINT uType, UINT uFmt, HCONV hconv, if (!DdeCmpStringHandles (hszTopic, mswindows_dde_topic_system)) { DWORD len = DdeGetData (hdata, NULL, 0, 0); - char *cmd = alloca (len+1); + LPBYTE cmd = (LPBYTE) alloca (len+1); char *end; char *filename; struct gcpro gcpro1, gcpro2; @@ -2367,7 +2360,7 @@ mswindows_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) GCPRO3 (emacs_event, l_dndlist, l_item); - if (!DragQueryPoint ((HANDLE) wParam, &point)) + if (!DragQueryPoint ((HDROP) wParam, &point)) point.x = point.y = -1; /* outside client area */ event->event_type = misc_user_event; @@ -2379,10 +2372,10 @@ mswindows_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) event->event.misc.y = point.y; event->event.misc.function = Qdragdrop_drop_dispatch; - filecount = DragQueryFile ((HANDLE) wParam, 0xffffffff, NULL, 0); + filecount = DragQueryFile ((HDROP) wParam, 0xffffffff, NULL, 0); for (i=0; i/ part and * because they may contain reserved characters. But that's OK. */ @@ -2396,14 +2389,14 @@ mswindows_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) #else filename = (char *)xmalloc (len+6); strcpy (filename, "file:"); - DragQueryFile ((HANDLE) wParam, i, filename+5, len+1); + DragQueryFile ((HDROP) wParam, i, filename+5, len+1); dostounix_filename (filename+5); #endif l_item = make_string (filename, strlen (filename)); l_dndlist = Fcons (l_item, l_dndlist); xfree (filename); } - DragFinish ((HANDLE) wParam); + DragFinish ((HDROP) wParam); event->event.misc.object = Fcons (Qdragdrop_URL, l_dndlist); mswindows_enqueue_dispatch_event (emacs_event); @@ -2725,7 +2718,6 @@ emacs_mswindows_handle_magic_event (Lisp_Event *emacs_event) case WM_PAINT: mswindows_handle_paint (XFRAME (EVENT_CHANNEL (emacs_event))); - mswindows_paint_pending = 0; break; case WM_SETFOCUS: diff --git a/src/event-stream.c b/src/event-stream.c index 5dccba3..8871609 100644 --- a/src/event-stream.c +++ b/src/event-stream.c @@ -4910,6 +4910,9 @@ If FILE is nil, close any open dribble file. void syms_of_event_stream (void) { + INIT_LRECORD_IMPLEMENTATION (command_builder); + INIT_LRECORD_IMPLEMENTATION (timeout); + defsymbol (&Qdisabled, "disabled"); defsymbol (&Qcommand_event_p, "command-event-p"); diff --git a/src/events.c b/src/events.c index 8d8026d..60002d8 100644 --- a/src/events.c +++ b/src/events.c @@ -2188,6 +2188,8 @@ This is in the form of a property list (alternating keyword/value pairs). void syms_of_events (void) { + INIT_LRECORD_IMPLEMENTATION (event); + DEFSUBR (Fcharacter_to_event); DEFSUBR (Fevent_to_character); diff --git a/src/extents.c b/src/extents.c index 686ce82..14bebe2 100644 --- a/src/extents.c +++ b/src/extents.c @@ -1537,8 +1537,7 @@ extent_endpoint_bytind (EXTENT extent, int endp) assert (EXTENT_LIVE_P (extent)); assert (!extent_detached_p (extent)); { - Memind i = (endp) ? (extent_end (extent)) : - (extent_start (extent)); + Memind i = endp ? extent_end (extent) : extent_start (extent); Lisp_Object obj = extent_object (extent); return buffer_or_string_memind_to_bytind (obj, i); } @@ -1550,8 +1549,7 @@ extent_endpoint_bufpos (EXTENT extent, int endp) assert (EXTENT_LIVE_P (extent)); assert (!extent_detached_p (extent)); { - Memind i = (endp) ? (extent_end (extent)) : - (extent_start (extent)); + Memind i = endp ? extent_end (extent) : extent_start (extent); Lisp_Object obj = extent_object (extent); return buffer_or_string_memind_to_bufpos (obj, i); } @@ -6661,6 +6659,10 @@ compute_buffer_extent_usage (struct buffer *b, struct overhead_stats *ovstats) void syms_of_extents (void) { + INIT_LRECORD_IMPLEMENTATION (extent); + INIT_LRECORD_IMPLEMENTATION (extent_info); + INIT_LRECORD_IMPLEMENTATION (extent_auxiliary); + defsymbol (&Qextentp, "extentp"); defsymbol (&Qextent_live_p, "extent-live-p"); diff --git a/src/fileio.c b/src/fileio.c index 9d1beca..c300003 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -446,8 +446,8 @@ Given a Unix syntax file name, returns a string ending in slash. if (p == beg + 2 && beg[1] == ':') { /* MAXPATHLEN+1 is guaranteed to be enough space for getdefdir. */ - Bufbyte *res = alloca (MAXPATHLEN + 1); - if (getdefdir (toupper (*beg) - 'A' + 1, res)) + Bufbyte *res = (Bufbyte*) alloca (MAXPATHLEN + 1); + if (getdefdir (toupper (*beg) - 'A' + 1, (char *)res)) { char *c=((char *) res) + strlen ((char *) res); if (!IS_DIRECTORY_SEP (*c)) @@ -845,12 +845,12 @@ See also the function `substitute-in-file-name'. #ifdef WINDOWSNT /* We will force directory separators to be either all \ or /, so make a local copy to modify, even if there ends up being no change. */ - nm = strcpy (alloca (strlen (nm) + 1), nm); + nm = strcpy ((char *)alloca (strlen ((char *)nm) + 1), (char *)nm); /* Find and remove drive specifier if present; this makes nm absolute even if the rest of the name appears to be relative. */ { - Bufbyte *colon = strrchr (nm, ':'); + Bufbyte *colon = (Bufbyte *) strrchr ((char *)nm, ':'); if (colon) /* Only recognize colon as part of drive specifier if there is a @@ -1256,10 +1256,6 @@ See also the function `substitute-in-file-name'. return make_string (target, o - target); } -#if 0 /* FSFmacs */ -/* another older version of expand-file-name; */ -#endif - DEFUN ("file-truename", Ffile_truename, 1, 2, 0, /* Return the canonical name of the given FILE. Second arg DEFAULT is directory to start with if FILE is relative @@ -1270,24 +1266,27 @@ No component of the resulting pathname will be a symbolic link, as */ (filename, default_)) { - /* This function can GC. GC checked 1997.04.06. */ + /* This function can GC. */ Lisp_Object expanded_name; - Lisp_Object handler; struct gcpro gcpro1; CHECK_STRING (filename); expanded_name = Fexpand_file_name (filename, default_); + GCPRO1 (expanded_name); + if (!STRINGP (expanded_name)) return Qnil; - GCPRO1 (expanded_name); - handler = Ffind_file_name_handler (expanded_name, Qfile_truename); - UNGCPRO; + { + Lisp_Object handler = + Ffind_file_name_handler (expanded_name, Qfile_truename); - if (!NILP (handler)) - return call2_check_string (handler, Qfile_truename, expanded_name); + if (!NILP (handler)) + RETURN_UNGCPRO + (call2_check_string (handler, Qfile_truename, expanded_name)); + } { char resolved_path[MAXPATHLEN]; @@ -1301,7 +1300,7 @@ No component of the resulting pathname will be a symbolic link, as p = path; if (elen > MAXPATHLEN) goto toolong; - + /* Try doing it all at once. */ /* !! Does realpath() Mule-encapsulate? Answer: Nope! So we do it above */ @@ -1312,14 +1311,25 @@ No component of the resulting pathname will be a symbolic link, as It claims to return a useful value in the "error" case, but since there is no indication provided of how far along the pathname the function went before erring, there is no way to use the - partial result returned. What a piece of junk. */ + partial result returned. What a piece of junk. + + The above comment refers to historical versions of + realpath(). The Unix98 specs state: + + "On successful completion, realpath() returns a + pointer to the resolved name. Otherwise, realpath() + returns a null pointer and sets errno to indicate the + error, and the contents of the buffer pointed to by + resolved_name are undefined." + + Since we depend on undocumented semantics of various system realpath()s, + we just use our own version in realpath.c. */ for (;;) { p = (Extbyte *) memchr (p + 1, '/', elen - (p + 1 - path)); if (p) *p = 0; - /* memset (resolved_path, 0, sizeof (resolved_path)); */ if (xrealpath ((char *) path, resolved_path)) { if (p) @@ -1337,7 +1347,8 @@ No component of the resulting pathname will be a symbolic link, as /* "On failure, it returns NULL, sets errno to indicate the error, and places in resolved_path the absolute pathname of the path component which could not be resolved." */ - if (p) + + if (p) { int plen = elen - (p - path); @@ -1358,17 +1369,20 @@ No component of the resulting pathname will be a symbolic link, as } { + Lisp_Object resolved_name; int rlen = strlen (resolved_path); if (elen > 0 && XSTRING_BYTE (expanded_name, elen - 1) == '/' && !(rlen > 0 && resolved_path[rlen - 1] == '/')) { if (rlen + 1 > countof (resolved_path)) goto toolong; - resolved_path[rlen] = '/'; - resolved_path[rlen + 1] = 0; - rlen = rlen + 1; + resolved_path[rlen++] = '/'; + resolved_path[rlen] = '\0'; } - return make_ext_string ((Bufbyte *) resolved_path, rlen, Qbinary); + TO_INTERNAL_FORMAT (DATA, (resolved_path, rlen), + LISP_STRING, resolved_name, + Qfile_name); + RETURN_UNGCPRO (resolved_name); } toolong: @@ -1377,7 +1391,7 @@ No component of the resulting pathname will be a symbolic link, as lose: report_file_error ("Finding truename", list1 (expanded_name)); } - return Qnil; /* suppress compiler warning */ + RETURN_UNGCPRO (Qnil); } @@ -1874,8 +1888,8 @@ Delete a directory. One argument, a file name or directory name string. } DEFUN ("delete-file", Fdelete_file, 1, 1, "fDelete file: ", /* -Delete specified file. One argument, a file name string. -If file has multiple names, it continues to exist with the other names. +Delete the file named FILENAME (a string). +If FILENAME has multiple names, it continues to exist with the other names. */ (filename)) { @@ -3221,8 +3235,8 @@ to the value of CODESYS. If this is nil, no code conversion occurs. if (desc < 0) { desc = open ((char *) XSTRING_DATA (fn), - (O_WRONLY | O_TRUNC | O_CREAT | OPEN_BINARY), - ((auto_saving) ? auto_save_mode_bits : CREAT_MODE)); + O_WRONLY | O_TRUNC | O_CREAT | OPEN_BINARY, + auto_saving ? auto_save_mode_bits : CREAT_MODE); } if (desc < 0) diff --git a/src/floatfns.c b/src/floatfns.c index a6711fc..337c581 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -988,6 +988,7 @@ init_floatfns_very_early (void) void syms_of_floatfns (void) { + INIT_LRECORD_IMPLEMENTATION (float); /* Trig functions. */ diff --git a/src/glyphs-msw.c b/src/glyphs-msw.c index 8111a47..25c037f 100644 --- a/src/glyphs-msw.c +++ b/src/glyphs-msw.c @@ -298,7 +298,7 @@ init_image_instance_from_dibitmap (Lisp_Image_Instance *ii, struct device *d = XDEVICE (device); struct frame *f; void* bmp_buf=0; - int type = 0; + enum image_instance_type type; HBITMAP bitmap; HDC hdc; @@ -458,13 +458,12 @@ mswindows_initialize_image_instance_mask (Lisp_Image_Instance* image, HBITMAP mask; HGDIOBJ old = NULL; HDC hcdc = FRAME_MSWINDOWS_CDC (f); - unsigned char* dibits; - BITMAPINFO* bmp_info = - xmalloc_and_zero (sizeof(BITMAPINFO) + sizeof(RGBQUAD)); + unsigned char *dibits, *and_bits; + BITMAPINFO *bmp_info = + (BITMAPINFO*) xmalloc_and_zero (sizeof(BITMAPINFO) + sizeof(RGBQUAD)); int i, j; int height = IMAGE_INSTANCE_PIXMAP_HEIGHT (image); - void* and_bits; int maskbpline = BPLINE ((IMAGE_INSTANCE_PIXMAP_WIDTH (image)+7)/8); int bpline = BPLINE (IMAGE_INSTANCE_PIXMAP_WIDTH (image) * 3); @@ -492,7 +491,7 @@ mswindows_initialize_image_instance_mask (Lisp_Image_Instance* image, if (!(mask = CreateDIBSection (hcdc, bmp_info, DIB_RGB_COLORS, - &and_bits, + (void**)&and_bits, 0,0))) { xfree (bmp_info); @@ -513,7 +512,7 @@ mswindows_initialize_image_instance_mask (Lisp_Image_Instance* image, bmp_info->bmiHeader.biClrImportant = 0; bmp_info->bmiHeader.biSizeImage = height * bpline; - dibits = xmalloc_and_zero (bpline * height); + dibits = (unsigned char*) xmalloc_and_zero (bpline * height); if (GetDIBits (hcdc, IMAGE_INSTANCE_MSWINDOWS_BITMAP (image), 0, @@ -528,20 +527,20 @@ mswindows_initialize_image_instance_mask (Lisp_Image_Instance* image, /* now set the colored bits in the mask and transparent ones to black in the original */ - for(i=0; ibitmaps) #define IMAGE_INSTANCE_MSWINDOWS_MASK(i) \ - (HBITMAP)(IMAGE_INSTANCE_PIXMAP_MASK (i)) + (*(HBITMAP*)&(IMAGE_INSTANCE_PIXMAP_MASK (i))) /* Make it lvalue */ #define IMAGE_INSTANCE_MSWINDOWS_ICON(i) \ (MSWINDOWS_IMAGE_INSTANCE_DATA (i)->icon) diff --git a/src/glyphs-widget.c b/src/glyphs-widget.c index 41d1498..ab50d29 100644 --- a/src/glyphs-widget.c +++ b/src/glyphs-widget.c @@ -335,7 +335,7 @@ update_widget (Lisp_Object widget) Lisp_Image_Instance* ii = XIMAGE_INSTANCE (widget); struct image_instantiator_methods* meths; - if (!IMAGE_INSTANCE_TYPE (ii) == IMAGE_WIDGET) + if (IMAGE_INSTANCE_TYPE (ii) != IMAGE_WIDGET) return; /* Device generic methods. We must update the widget's size as it @@ -715,7 +715,7 @@ tab_control_query_geometry (Lisp_Object image_instance, enum image_instance_geometry disp, Lisp_Object domain) { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); - Lisp_Object items = IMAGE_INSTANCE_WIDGET_ITEMS (ii); + Lisp_Object items = XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)); Lisp_Object rest; unsigned int tw = 0, th = 0; @@ -726,7 +726,7 @@ tab_control_query_geometry (Lisp_Object image_instance, query_string_geometry (XGUI_ITEM (XCAR (rest))->name, IMAGE_INSTANCE_WIDGET_FACE (ii), &w, &h, 0, domain); - tw += 2 * WIDGET_BORDER_WIDTH; /* some bias */ + tw += 5 * WIDGET_BORDER_WIDTH; /* some bias */ tw += w; th = max (th, h + 2 * WIDGET_BORDER_HEIGHT); } diff --git a/src/glyphs-x.c b/src/glyphs-x.c index d0f76da..e56a5c4 100644 --- a/src/glyphs-x.c +++ b/src/glyphs-x.c @@ -2180,41 +2180,33 @@ x_update_subwindow (Lisp_Image_Instance *p) static void x_update_widget (Lisp_Image_Instance *p) { + /* This function can GC if IN_REDISPLAY is false. */ #ifdef HAVE_WIDGETS widget_value* wv = 0; - Boolean deep_p = False; - /* Possibly update the size. */ - if (IMAGE_INSTANCE_SIZE_CHANGED (p)) - { - Arg al[2]; - - assert (IMAGE_INSTANCE_X_WIDGET_ID (p) && - IMAGE_INSTANCE_X_CLIPWIDGET (p)) ; - - if ( !XtIsManaged(IMAGE_INSTANCE_X_WIDGET_ID (p)) - || - IMAGE_INSTANCE_X_WIDGET_ID (p)->core.being_destroyed ) - { - Lisp_Object sw; - XSETIMAGE_INSTANCE (sw, p); - signal_simple_error ("XEmacs bug: subwindow is deleted", sw); - } - XtSetArg (al [0], XtNwidth, (Dimension)IMAGE_INSTANCE_WIDTH (p)); - XtSetArg (al [1], XtNheight, (Dimension)IMAGE_INSTANCE_HEIGHT (p)); - XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (p), al, 2); - } - - /* First get the items if they have changed since this is a structural change. */ + /* First get the items if they have changed since this is a + structural change. As such it will nuke all added values so we + need to update most other things after the items have changed.*/ if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p)) { wv = gui_items_to_widget_values (IMAGE_INSTANCE_WIDGET_ITEMS (p)); - deep_p = True; + wv->change = STRUCTURAL_CHANGE; + /* now modify the widget */ + lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p), + wv, True); + free_widget_value_tree (wv); } + /* Now do non structural updates. */ + wv = lw_get_all_values (IMAGE_INSTANCE_X_WIDGET_LWID (p)); + /* Possibly update the colors and font */ - if (IMAGE_INSTANCE_WIDGET_FACE_CHANGED (p)) + if (IMAGE_INSTANCE_WIDGET_FACE_CHANGED (p) + || + XFRAME (IMAGE_INSTANCE_SUBWINDOW_FRAME (p))->faces_changed + || + IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p)) { update_widget_face (wv, p, IMAGE_INSTANCE_SUBWINDOW_FRAME (p)); } @@ -2230,10 +2222,31 @@ x_update_widget (Lisp_Image_Instance *p) wv->value = str; } + /* Possibly update the size. */ + if (IMAGE_INSTANCE_SIZE_CHANGED (p) + || + IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (p)) + { + assert (IMAGE_INSTANCE_X_WIDGET_ID (p) && + IMAGE_INSTANCE_X_CLIPWIDGET (p)) ; + + if (IMAGE_INSTANCE_X_WIDGET_ID (p)->core.being_destroyed + || !XtIsManaged(IMAGE_INSTANCE_X_WIDGET_ID (p))) + { + Lisp_Object sw; + XSETIMAGE_INSTANCE (sw, p); + signal_simple_error ("XEmacs bug: subwindow is deleted", sw); + } + + lw_add_widget_value_arg (wv, XtNwidth, + (Dimension)IMAGE_INSTANCE_WIDTH (p)); + lw_add_widget_value_arg (wv, XtNheight, + (Dimension)IMAGE_INSTANCE_HEIGHT (p)); + } + /* now modify the widget */ lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p), - wv, deep_p); - free_widget_value_tree (wv); + wv, False); #endif } @@ -2432,9 +2445,9 @@ x_widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, lw_add_widget_value_arg (clip_wv, XtNresize, False); lw_add_widget_value_arg (clip_wv, XtNwidth, - (Dimension)IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii)); + (Dimension)IMAGE_INSTANCE_WIDTH (ii)); lw_add_widget_value_arg (clip_wv, XtNheight, - (Dimension)IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii)); + (Dimension)IMAGE_INSTANCE_HEIGHT (ii)); clip_wv->enabled = True; clip_wv->name = xstrdup ("clip-window"); @@ -2470,9 +2483,9 @@ x_widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, /* we cannot allow widgets to resize themselves */ lw_add_widget_value_arg (wv, XtNresize, False); lw_add_widget_value_arg (wv, XtNwidth, - (Dimension)IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii)); + (Dimension)IMAGE_INSTANCE_WIDTH (ii)); lw_add_widget_value_arg (wv, XtNheight, - (Dimension)IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii)); + (Dimension)IMAGE_INSTANCE_HEIGHT (ii)); /* update the font. */ update_widget_face (wv, ii, domain); @@ -2671,14 +2684,17 @@ x_tab_control_update (Lisp_Object image_instance) Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); /* Possibly update the face. */ - if (IMAGE_INSTANCE_WIDGET_FACE_CHANGED (ii)) + if (IMAGE_INSTANCE_WIDGET_FACE_CHANGED (ii) + || + XFRAME (IMAGE_INSTANCE_SUBWINDOW_FRAME (ii))->faces_changed + || + IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii)) { widget_value* wv = lw_get_all_values (IMAGE_INSTANCE_X_WIDGET_LWID (ii)); update_tab_widget_face (wv, ii, IMAGE_INSTANCE_SUBWINDOW_FRAME (ii)); lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (ii), wv, True); - free_widget_value_tree (wv); } } diff --git a/src/gui-msw.c b/src/gui-msw.c index 029d616..07b4a79 100644 --- a/src/gui-msw.c +++ b/src/gui-msw.c @@ -92,9 +92,6 @@ otherwise it is an integer representing a ShowWindow flag: CHECK_STRING (document); - /* Just get the filename if we were given it. */ - document = Ffile_name_nondirectory (document); - if (NILP (current_dir)) current_dir = current_buffer->directory; @@ -118,7 +115,11 @@ otherwise it is an integer representing a ShowWindow flag: TO_EXTERNAL_FORMAT (LISP_STRING, document, C_STRING_ALLOCA, f, Qfile_name); +#ifdef __CYGWIN32__ + CYGWIN_WIN32_PATH (f, doc); +#else doc = f; +#endif } UNGCPRO; diff --git a/src/gui-x.c b/src/gui-x.c index 58fb4f3..467c3ab 100644 --- a/src/gui-x.c +++ b/src/gui-x.c @@ -619,6 +619,8 @@ sanity_check_lwlib (void) void syms_of_gui_x (void) { + INIT_LRECORD_IMPLEMENTATION (popup_data); + defsymbol (&Qmenu_no_selection_hook, "menu-no-selection-hook"); } diff --git a/src/gui.c b/src/gui.c index d00df80..00012a6 100644 --- a/src/gui.c +++ b/src/gui.c @@ -625,6 +625,8 @@ DEFINE_LRECORD_IMPLEMENTATION ("gui-item", gui_item, void syms_of_gui (void) { + INIT_LRECORD_IMPLEMENTATION (gui_item); + defkeyword (&Q_active, ":active"); defkeyword (&Q_suffix, ":suffix"); defkeyword (&Q_keys, ":keys"); diff --git a/src/keymap.c b/src/keymap.c index 49a9fec..046c5e8 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -1069,7 +1069,7 @@ get_keyelt (Lisp_Object object, int accept_default) if (!INTP (XCDR (idx))) return Qnil; indirection.keysym = XCAR (idx); - indirection.modifiers = XINT (XCDR (idx)); + indirection.modifiers = (unsigned char) XINT (XCDR (idx)); } else if (SYMBOLP (idx)) { @@ -4204,6 +4204,8 @@ describe_map (Lisp_Object keymap, Lisp_Object elt_prefix, void syms_of_keymap (void) { + INIT_LRECORD_IMPLEMENTATION (keymap); + defsymbol (&Qminor_mode_map_alist, "minor-mode-map-alist"); defsymbol (&Qkeymapp, "keymapp"); diff --git a/src/lstream.c b/src/lstream.c index ed9849c..801a0c1 100644 --- a/src/lstream.c +++ b/src/lstream.c @@ -1705,5 +1705,7 @@ reinit_vars_of_lstream (void) void vars_of_lstream (void) { + INIT_LRECORD_IMPLEMENTATION (lstream); + reinit_vars_of_lstream (); } diff --git a/src/m/7300.h b/src/m/7300.h index cd77e07..911016d 100644 --- a/src/m/7300.h +++ b/src/m/7300.h @@ -25,10 +25,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="usg5-2-2" */ -/* XINT must explicitly sign-extend */ - -#define EXPLICIT_SIGN_EXTEND - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000 are the ones defined so far. */ diff --git a/src/m/acorn.h b/src/m/acorn.h index efd8664..52dd45d 100644 --- a/src/m/acorn.h +++ b/src/m/acorn.h @@ -20,19 +20,6 @@ Boston, MA 02111-1307, USA. */ /* Synched up with: FSF 19.31. */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#undef WORD_MACHINE - -/* Define how to take a char and sign-extend into an int. - On machines where char is signed, this is a no-op. */ - -/* ARM note - The RISCiX Norcroft C Compiler has ALL - non-32-bit types as unsigned */ - -#define SIGN_EXTEND_CHAR(c) (((int)(c) << 24) >> 24) - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -40,14 +27,6 @@ Boston, MA 02111-1307, USA. */ /* ARM note - this is done by the Norcroft compiler - symbol is `__arm' */ -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - #ifdef LDAV_SYMBOL #undef LDAV_SYMBOL #endif diff --git a/src/m/alliant-2800.h b/src/m/alliant-2800.h index f366ea5..f19db5d 100644 --- a/src/m/alliant-2800.h +++ b/src/m/alliant-2800.h @@ -24,11 +24,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="bsd4-3" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#undef WORD_MACHINE - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO @@ -39,15 +34,6 @@ Boston, MA 02111-1307, USA. */ #define sun /* Use X support for Sun keyboard stuff. */ #define C_OPTIMIZE_SWITCH "-Og" /* No concurrent code allowed here. */ -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ -/* On Alliants, bitfields are unsigned. */ - -#define EXPLICIT_SIGN_EXTEND - /* Concentrix uses a different kernel symbol for load average. */ #undef LDAV_SYMBOL /* Undo definition in s-bsd4-2.h */ diff --git a/src/m/alliant.h b/src/m/alliant.h index f0d2a2f..06921ef 100644 --- a/src/m/alliant.h +++ b/src/m/alliant.h @@ -27,11 +27,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="bsd4-2" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#undef WORD_MACHINE - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO @@ -39,15 +34,6 @@ Boston, MA 02111-1307, USA. */ #define ALLIANT -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ -/* On Alliants, bitfields are unsigned. */ - -#define EXPLICIT_SIGN_EXTEND - /* No load average information available for Alliants. */ #undef LOAD_AVE_TYPE diff --git a/src/m/altos.h b/src/m/altos.h index 40759cf..b4cb895 100644 --- a/src/m/altos.h +++ b/src/m/altos.h @@ -24,8 +24,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="usg5-2" */ -#define EXPLICIT_SIGN_EXTEND - #define LIB_STANDARD "-lc" #ifdef __GNUC__ diff --git a/src/m/amdahl.h b/src/m/amdahl.h index 8abe5b9..4810c1e 100644 --- a/src/m/amdahl.h +++ b/src/m/amdahl.h @@ -32,11 +32,6 @@ This file works with the Amdahl uts native C compiler. The 5.2u370 compiler is so brain damaged that it is not even worth trying to use it. */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#define WORD_MACHINE /* not actually used anywhere yet! */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO @@ -46,14 +41,6 @@ compiler is so brain damaged that it is not even worth trying to use it. /* However for clarity define amdahl_uts */ #define amdahl_uts -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ /* #define LOAD_AVE_TYPE long*/ diff --git a/src/m/arm.h b/src/m/arm.h index 2bf2940..fe9b01b 100644 --- a/src/m/arm.h +++ b/src/m/arm.h @@ -20,11 +20,6 @@ Boston, MA 02111-1307, USA. */ /* Synched up with: FSF 19.31. */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#undef WORD_MACHINE - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -93,10 +88,6 @@ Boston, MA 02111-1307, USA. */ #endif /* USG */ -#ifdef USG5_4 -#define DATA_SEG_BITS 0x08000000 -#endif - #ifdef MSDOS #define NO_REMAP #endif @@ -116,17 +107,6 @@ Boston, MA 02111-1307, USA. */ #define SEGMENT_MASK ((SEGMENT_SIZE)-1) #endif -#if 0 -#ifdef __GNUC__ -/* GCC's alloca() is semi-broken. See lisp.h. - - This brokenness has been confirmed under both Linux and NetBSD. - It may also exist on non-Intel architectures. */ -#define BROKEN_ALLOCA_IN_FUNCTION_CALLS -#endif -#endif - - /* XEmacs change: John Hughes says using vfork under i386-unknown-sysv4.2 makes C-g sometimes cause a SIGSEGV in TTY mode; the problem goes away if you use fork */ diff --git a/src/m/att3b.h b/src/m/att3b.h index 67c3056..896a6cc 100644 --- a/src/m/att3b.h +++ b/src/m/att3b.h @@ -26,23 +26,10 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="usg5-2-2" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically */ #define ATT3B -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ /* #define LOAD_AVE_TYPE long */ diff --git a/src/m/aviion.h b/src/m/aviion.h index 3bb033b..b3cc63a 100644 --- a/src/m/aviion.h +++ b/src/m/aviion.h @@ -20,18 +20,6 @@ Boston, MA 02111-1307, USA. */ /* Synched up with: FSF 19.31. */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#define WORD_MACHINE - -/* Define DATA_SEG_BITS if pointers need to be corrected with - a segment field. */ - -#ifdef FIX_ADDRESS -#define DATA_SEG_BITS 0xef000000 -#endif - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -41,14 +29,6 @@ Boston, MA 02111-1307, USA. */ /*#define m88k*/ /*#endif*/ -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ /* #define LOAD_AVE_TYPE long */ diff --git a/src/m/celerity.h b/src/m/celerity.h index 2b6ea5e..e4dfb82 100644 --- a/src/m/celerity.h +++ b/src/m/celerity.h @@ -24,10 +24,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="bsd4-2" */ -/* XINT must explicitly sign extend */ - -#define EXPLICIT_SIGN_EXTEND - /* celerity preprocessor defines "accel", however the following is clearer */ #define celerity diff --git a/src/m/clipper.h b/src/m/clipper.h index 975945f..f18bc99 100644 --- a/src/m/clipper.h +++ b/src/m/clipper.h @@ -20,11 +20,6 @@ Boston, MA 02111-1307, USA. */ /* Synched up with: FSF 19.31. */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically */ @@ -34,14 +29,6 @@ Boston, MA 02111-1307, USA. */ #define DOT_GLOBAL_START -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -/* #define EXPLICIT_SIGN_EXTEND */ - /* USG systems I know of running on Vaxes do not actually support the load average, so disable it for them. */ diff --git a/src/m/cnvrgnt.h b/src/m/cnvrgnt.h index 5a9e42c..2427a4f 100644 --- a/src/m/cnvrgnt.h +++ b/src/m/cnvrgnt.h @@ -20,24 +20,11 @@ Boston, MA 02111-1307, USA. */ /* Synched up with: FSF 19.31. */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically. */ #define m68000 -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. These are commented out since it is not supported by this machine. */ diff --git a/src/m/convex.h b/src/m/convex.h index dda929b..a618993 100644 --- a/src/m/convex.h +++ b/src/m/convex.h @@ -24,11 +24,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="bsd4-3" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically. */ #ifndef convex /* The compiler doesn't always do this. */ @@ -91,9 +86,6 @@ Boston, MA 02111-1307, USA. */ /* #define NO_REMAP */ -/* Addresses on the Convex have the high bit set. */ -#define DATA_SEG_BITS (1 << (INTBITS-1)) - /* Right shift is logical shift. And the usual way of handling such machines, which involves copying the number into sign_extend_temp, does not work diff --git a/src/m/cydra5.h b/src/m/cydra5.h index 5d3623e..887770b 100644 --- a/src/m/cydra5.h +++ b/src/m/cydra5.h @@ -24,24 +24,11 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="usg5-3" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#undef WORD_MACHINE - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, orion, tahoe, APOLLO and many others */ -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long @@ -75,11 +62,6 @@ Boston, MA 02111-1307, USA. */ #define C_ALLOCA #undef HAVE_ALLOCA -/* The data segment in this machine always starts at address 0x10000000. - An address of data cannot be stored correctly in a Lisp object; - we always lose the high bits. We must tell XPNTR to add them back. */ - -#define DATA_SEG_BITS 0x20000000 #define DATA_START 0x20000000 /* Define NO_REMAP if memory segmentation makes it not work well diff --git a/src/m/delta.h b/src/m/delta.h index eb58f9c..27078f5 100644 --- a/src/m/delta.h +++ b/src/m/delta.h @@ -26,11 +26,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="usg5-3" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -39,14 +34,6 @@ Boston, MA 02111-1307, USA. */ #define m68000 #define MOTOROLA_DELTA -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ /* #define LOAD_AVE_TYPE long */ diff --git a/src/m/delta88k.h b/src/m/delta88k.h index bd559b5..7177af1 100644 --- a/src/m/delta88k.h +++ b/src/m/delta88k.h @@ -24,11 +24,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="usg5-3" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -42,14 +37,6 @@ Boston, MA 02111-1307, USA. */ does not define it automatically. */ -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -/* #define EXPLICIT_SIGN_EXTEND */ - /* Data type of load average, as read out of kmem. */ /* No load average on Motorola machines. */ /* #define LOAD_AVE_TYPE double */ diff --git a/src/m/dpx2.h b/src/m/dpx2.h index 899819b..c19f6ee 100644 --- a/src/m/dpx2.h +++ b/src/m/dpx2.h @@ -33,11 +33,6 @@ Boston, MA 02111-1307, USA. */ /* #define ncl_el /* DPX/2 210,220 etc */ /* #define ncl_mr 1 /* DPX/2 320,340 (and 360,380 ?) */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE /**/ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -45,14 +40,6 @@ Boston, MA 02111-1307, USA. */ /* /bin/cc on ncl_el and ncl_mr define m68k and mc68000 */ -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long diff --git a/src/m/dual.h b/src/m/dual.h index 88a26f8..60b0add 100644 --- a/src/m/dual.h +++ b/src/m/dual.h @@ -36,10 +36,6 @@ Dual running Uniplus (-machine=dual -opsystem=unipl5-2) NOTE-END */ -/* XINT must explicitly sign-extend */ - -#define EXPLICIT_SIGN_EXTEND - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000 are the ones defined so far. */ diff --git a/src/m/elxsi.h b/src/m/elxsi.h index 9b18a41..e62c338 100644 --- a/src/m/elxsi.h +++ b/src/m/elxsi.h @@ -28,11 +28,6 @@ Boston, MA 02111-1307, USA. */ /* This file was modified by Matt Crawford to work under Elxsi's 12.0 release of BSD unix. */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/*#define WORD_MACHINE */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO @@ -42,15 +37,6 @@ Boston, MA 02111-1307, USA. */ #define elxsi #endif -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - - /* Name of kernel load average variable */ #undef LDAV_SYMBOL diff --git a/src/m/ews4800r.h b/src/m/ews4800r.h index 35c6d97..a649ec4 100644 --- a/src/m/ews4800r.h +++ b/src/m/ews4800r.h @@ -20,16 +20,6 @@ Boston, MA 02111-1307, USA. */ /* Synched up with: Mule 2.0. Not in FSF. */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#undef WORD_MACHINE - -/* Define how to take a char and sign-extend into an int. - On machines where char is signed, this is a no-op. */ - -#define SIGN_EXTEND_CHAR(c) ((signed char)(c)) - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -38,14 +28,6 @@ Boston, MA 02111-1307, USA. */ # define mips #endif -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long diff --git a/src/m/gould-np1.h b/src/m/gould-np1.h index 763f16e..155aa61 100644 --- a/src/m/gould-np1.h +++ b/src/m/gould-np1.h @@ -64,12 +64,6 @@ #define C_DEBUG_SWITCH "-g" #define LIBS_DEBUG "-lg" - -/* The data segment in this machine always starts at address 0x1000000 = 16M. - An address of data cannot be stored correctly in a Lisp object; - we always lose the high bits. We must tell XPNTR to add them back. */ - -#define DATA_SEG_BITS 0x1000000 #define DATA_START 0x1000000 /* The text segment always starts at 0. diff --git a/src/m/gould.h b/src/m/gould.h index eaa3c7b..a8174f2 100644 --- a/src/m/gould.h +++ b/src/m/gould.h @@ -46,11 +46,6 @@ Gould Power Node (-machine=gould -opsystem=bsd4-2 or bsd4-3) A site running a pre-release of 2.1 should #define RELEASE2_1 in config.h. NOTE-END */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically */ @@ -62,14 +57,6 @@ NOTE-END */ - it is no longer needed and interferes with a variable in xmenu.c */ #undef sel -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE double diff --git a/src/m/hp300bsd.h b/src/m/hp300bsd.h index 59ccea9..30a68e0 100644 --- a/src/m/hp300bsd.h +++ b/src/m/hp300bsd.h @@ -36,9 +36,5 @@ Boston, MA 02111-1307, USA. */ #define HAVE_ALLOCA -/* XINT must explicitly sign-extend */ - -#define EXPLICIT_SIGN_EXTEND - #define LOAD_AVE_TYPE long #define LOAD_AVE_CVT(x) ((int) (((double) (x)) / 2048.0 * 100.0)) diff --git a/src/m/hp800.h b/src/m/hp800.h index b41a5a1..607b52a 100644 --- a/src/m/hp800.h +++ b/src/m/hp800.h @@ -24,11 +24,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="hpux" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#undef WORD_MACHINE - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -37,13 +32,6 @@ Boston, MA 02111-1307, USA. */ # define hp9000s800 #endif -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND #ifdef __hpux /* Now define a symbol for the cpu type, if your compiler @@ -94,8 +82,6 @@ Boston, MA 02111-1307, USA. */ /* the data segment on this machine always starts at address 0x40000000. */ -#define DATA_SEG_BITS 0x40000000 - #ifdef DATA_START #undef DATA_START #endif diff --git a/src/m/hp9000s300.h b/src/m/hp9000s300.h index d086b42..14383ef 100644 --- a/src/m/hp9000s300.h +++ b/src/m/hp9000s300.h @@ -39,11 +39,6 @@ NOTE-END */ /* #define HPUX_5 */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically. */ @@ -51,14 +46,6 @@ NOTE-END */ #define hp9000s300 #endif -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Define CANNOT_DUMP on machines where unexec does not work. Then the function dump-emacs will not be defined and temacs will do (load "loadup") automatically unless told otherwise. */ diff --git a/src/m/i860.h b/src/m/i860.h index 338902d..79d3f53 100644 --- a/src/m/i860.h +++ b/src/m/i860.h @@ -24,11 +24,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -36,14 +31,6 @@ Boston, MA 02111-1307, USA. */ #define INTEL860 -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long diff --git a/src/m/ibmps2-aix.h b/src/m/ibmps2-aix.h index 4a7afac..73d14e3 100644 --- a/src/m/ibmps2-aix.h +++ b/src/m/ibmps2-aix.h @@ -30,11 +30,6 @@ NOTE-START work with certain new X window managers, and may be suboptimal. NOTE-END */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -85,11 +80,6 @@ so disable it for them. */ #define DATA_START 0x00800000 #define DATA_END 0 -/* The data segment in this machine always starts at address 0x00800000. - An address of data cannot be stored correctly in a Lisp object; - we always lose the high bits. We must tell XPNTR to add them back. */ - -#define DATA_SEG_BITS 0x00800000 #endif #if 0 /* I refuse to promulgate a recommendation that would make diff --git a/src/m/ibmrs6000.h b/src/m/ibmrs6000.h index f287ae9..7b2a2e1 100644 --- a/src/m/ibmrs6000.h +++ b/src/m/ibmrs6000.h @@ -51,27 +51,6 @@ Boston, MA 02111-1307, USA. */ #define DATA_END 0 #endif -/* The data segment in this machine always starts at address 0x20000000. - An address of data cannot be stored correctly in a Lisp object; - we always lose the high bits. We must tell XPNTR to add them back. */ - -#ifndef USG5_4 -#define DATA_SEG_BITS 0x20000000 -#else -#define DATA_SEG_BITS 0 -#endif - -#ifdef CANNOT_DUMP -/* Define shared memory segment symbols */ - -#define PURE_SEG_BITS 0x30000000 - -/* Use shared memory. */ -/* This is turned off because it does not always work. See etc/AIX.DUMP. */ -/* #define HAVE_SHM */ -#define SHMKEY 5305035 /* used for shared memory code segments */ -#endif /* CANNOT_DUMP */ - #define N_BADMAG(x) BADMAG(x) #define N_TXTOFF(x) A_TEXTPOS(x) #define N_SYMOFF(x) A_SYMPOS(x) diff --git a/src/m/ibmrt-aix.h b/src/m/ibmrt-aix.h index 3ab6bb8..21e3058 100644 --- a/src/m/ibmrt-aix.h +++ b/src/m/ibmrt-aix.h @@ -50,12 +50,6 @@ Boston, MA 02111-1307, USA. */ #define DATA_START 0x20000000 #define DATA_END 0 -/* The data segment in this machine always starts at address 0x20000000. - An address of data cannot be stored correctly in a Lisp object; - we always lose the high bits. We must tell XPNTR to add them back. */ - -#define DATA_SEG_BITS 0x20000000 - #define N_BADMAG(x) BADMAG(x) #define N_TXTOFF(x) A_TEXTPOS(x) #define N_SYMOFF(x) A_SYMPOS(x) diff --git a/src/m/ibmrt.h b/src/m/ibmrt.h index d8ee343..61f5246 100644 --- a/src/m/ibmrt.h +++ b/src/m/ibmrt.h @@ -24,11 +24,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="bsd4-2" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#define WORD_MACHINE - /* Now define a symbol for the cpu type, if your compiler does not define it automatically. */ @@ -40,14 +35,6 @@ Boston, MA 02111-1307, USA. */ #define romp /* unfortunately old include files are hanging around. */ #endif -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE double /* For AIS (sysV) */ @@ -80,11 +67,6 @@ Boston, MA 02111-1307, USA. */ #define HAVE_ALLOCA -/* The data segment in this machine starts at a fixed address. - An address of data cannot be stored correctly in a Lisp object; - we always lose the high bits. We must tell XPNTR to add them back. */ - -#define DATA_SEG_BITS 0x10000000 #define DATA_START 0x10000000 /* The text segment always starts at a fixed address. diff --git a/src/m/intel386.h b/src/m/intel386.h index c81c6b0..481fade 100644 --- a/src/m/intel386.h +++ b/src/m/intel386.h @@ -50,11 +50,6 @@ Prime EXL (-machine=intel386 -opsystem=usg5-3) Minor changes merged in 19.1. NOTE-END */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -152,18 +147,11 @@ NOTE-END */ #ifdef USG -#if 0 /* ALLOCA is now autodetected */ -#define HAVE_ALLOCA -#endif #define NO_REMAP #define TEXT_START 0 #endif /* USG */ #endif /* not XENIX */ -#ifdef USG5_4 -#define DATA_SEG_BITS 0x08000000 -#endif - #ifdef MSDOS #define NO_REMAP #endif diff --git a/src/m/iris4d.h b/src/m/iris4d.h index 62b56b0..5e207d2 100644 --- a/src/m/iris4d.h +++ b/src/m/iris4d.h @@ -20,11 +20,6 @@ Boston, MA 02111-1307, USA. */ /* Synched up with: FSF 19.31. */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#undef WORD_MACHINE - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -38,14 +33,6 @@ Boston, MA 02111-1307, USA. */ #define IRIS_4D #endif -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* jg@genmagic.genmagic.com (John Giannandrea) says this is unnecessary. */ #if 0 /* Data type of load average, as read out of kmem. */ @@ -105,15 +92,7 @@ Boston, MA 02111-1307, USA. */ #endif #define TEXT_START 0x400000 - -/* - * DATA_SEG_BITS forces extra bits to be or'd in with any pointers which - * were stored in a Lisp_Object (as Emacs uses fewer than 32 bits for - * the value field of a LISP_OBJECT). - */ - #define DATA_START 0x10000000 -#define DATA_SEG_BITS 0x10000000 #undef LIBS_MACHINE /* -lsun in case using Yellow Pages for passwords. */ diff --git a/src/m/iris5d.h b/src/m/iris5d.h index 05a03c0..37106d7 100644 --- a/src/m/iris5d.h +++ b/src/m/iris5d.h @@ -24,11 +24,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="irix3-3" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#undef WORD_MACHINE - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -42,14 +37,6 @@ Boston, MA 02111-1307, USA. */ #define IRIS_4D #endif -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long /* This doesn't quite work on the 4D */ @@ -105,14 +92,7 @@ Boston, MA 02111-1307, USA. */ #define TEXT_START 0x400000 -/* - * DATA_SEG_BITS forces extra bits to be or'd in with any pointers which - * were stored in a Lisp_Object (as Emacs uses fewer than 32 bits for - * the value field of a LISP_OBJECT). - */ - #define DATA_START 0x10000000 -#define DATA_SEG_BITS 0x10000000 #undef LIBS_MACHINE /* -lsun in case using Yellow Pages for passwords. */ diff --git a/src/m/irist.h b/src/m/irist.h index 496a7ec..fcb7600 100644 --- a/src/m/irist.h +++ b/src/m/irist.h @@ -58,11 +58,6 @@ NOTE-END */ (copy-file), it would say that it is non-critical... #endif /* 0 */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -72,14 +67,6 @@ NOTE-END */ #define m68000 #endif -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long diff --git a/src/m/isi-ov.h b/src/m/isi-ov.h index 5240b8a..c32dc88 100644 --- a/src/m/isi-ov.h +++ b/src/m/isi-ov.h @@ -34,10 +34,6 @@ NOTE-END */ #define m68000 -/* XINT must explicitly sign-extend */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #ifdef BSD4_3 diff --git a/src/m/luna88k.h b/src/m/luna88k.h index c2a96e6..90ed16e 100644 --- a/src/m/luna88k.h +++ b/src/m/luna88k.h @@ -31,15 +31,6 @@ and this notice must be preserved on all copies. */ /* Synched up with: Mule 2.0. Not in FSF. */ -/* Define how to take a char and sign-extend into an int. - On machines where char is signed, this is a no-op. */ - -#define SIGN_EXTEND_CHAR(c) (c) - -/* XINT must explicitly sign-extend */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long diff --git a/src/m/m68k.h b/src/m/m68k.h index f8cfb5b..e4cdd5e 100644 --- a/src/m/m68k.h +++ b/src/m/m68k.h @@ -20,14 +20,6 @@ Boston, MA 02111-1307, USA. */ /* Synched up with: FSF 19.31. */ -/* The following symbol gives information on - the size of various data types. */ - -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically. */ @@ -35,14 +27,6 @@ Boston, MA 02111-1307, USA. */ #define m68k #endif -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the 24-bit bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Define CANNOT_DUMP on machines where unexec does not work. Then the function dump-emacs will not be defined and temacs will do (load "loadup") automatically unless told otherwise. */ @@ -59,9 +43,6 @@ Boston, MA 02111-1307, USA. */ /* #define VIRT_ADDR_VARIES */ #ifdef linux -#ifdef __ELF__ -#define DATA_SEG_BITS 0x80000000 -#endif #define NO_REMAP #define TEXT_START 0 diff --git a/src/m/masscomp.h b/src/m/masscomp.h index 3480a13..3db18b8 100644 --- a/src/m/masscomp.h +++ b/src/m/masscomp.h @@ -24,11 +24,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="rtu" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#undef WORD_MACHINE - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO @@ -36,14 +31,6 @@ Boston, MA 02111-1307, USA. */ /* Masscomp predefines mc68000. */ #define m68000 mc68000 -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#undef EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE double diff --git a/src/m/mega68.h b/src/m/mega68.h index 81cfab9..4961423 100644 --- a/src/m/mega68.h +++ b/src/m/mega68.h @@ -24,10 +24,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="bsd4-2" */ -/* XINT must explicitly sign-extend */ - -#define EXPLICIT_SIGN_EXTEND - /* Say this machine is a 68000 */ #define m68000 diff --git a/src/m/mg1.h b/src/m/mg1.h index f7ef70a..6163ad6 100644 --- a/src/m/mg1.h +++ b/src/m/mg1.h @@ -34,11 +34,6 @@ own configuration files, please let the Free Software Foundation in on your work; we'd like to distribute this information. NOTE-END */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ -/* ns16000 addresses are byte addresses */ -#undef WORD_MACHINE - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO @@ -47,14 +42,6 @@ NOTE-END */ #define ns16000 #define mg1 -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ /* mg1 its an unsigned long */ #define LOAD_AVE_TYPE unsigned long diff --git a/src/m/mips-nec.h b/src/m/mips-nec.h index 15fefcc..a86c443 100644 --- a/src/m/mips-nec.h +++ b/src/m/mips-nec.h @@ -36,16 +36,6 @@ This is the m- file for SNI RM*00 machines. Use s- sinix5-4.h file! With this the file mips-siemens.h is obsolete. NOTE-END */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#undef WORD_MACHINE - -/* Define how to take a char and sign-extend into an int. - On machines where char is signed, this is a no-op. */ - -#define SIGN_EXTEND_CHAR(c) ((signed char)(c)) - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -54,14 +44,6 @@ NOTE-END */ # define mips #endif -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the 24-bit bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long @@ -114,10 +96,6 @@ NOTE-END */ /* MARCO ??? */ #define TEXT_START 0x400000 -/* -#define DATA_START 0x10000000 -#define DATA_SEG_BITS 0x10000000 -*/ #undef ORDINARY_LINK diff --git a/src/m/mips-siemens.h b/src/m/mips-siemens.h index 32c798f..e17397c 100644 --- a/src/m/mips-siemens.h +++ b/src/m/mips-siemens.h @@ -36,16 +36,6 @@ This is the m- file for SNI RM*00 machines. Use s- sinix5-4.h file! With this the file mips-siemens.h is obsolete. NOTE-END */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#undef WORD_MACHINE - -/* Define how to take a char and sign-extend into an int. - On machines where char is signed, this is a no-op. */ - -#define SIGN_EXTEND_CHAR(c) ((signed char)(c)) - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -54,14 +44,6 @@ NOTE-END */ # define mips #endif -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the 24-bit bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long @@ -114,10 +96,7 @@ NOTE-END */ /* MARCO ??? */ #define TEXT_START 0x400000 -/* -#define DATA_START 0x10000000 -#define DATA_SEG_BITS 0x10000000 -*/ + #ifdef UNEXEC #undef UNEXEC #endif diff --git a/src/m/mips.h b/src/m/mips.h index a0751cb..dc12e02 100644 --- a/src/m/mips.h +++ b/src/m/mips.h @@ -29,16 +29,6 @@ Use m-mips4.h for RISCOS version 4; use s-bsd4-3.h with the BSD world. Note that the proper m- file for the Decstation is m-pmax.h. NOTE-END */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#undef WORD_MACHINE - -/* Define how to take a char and sign-extend into an int. - On machines where char is signed, this is a no-op. */ - -#define SIGN_EXTEND_CHAR(c) ((signed char)(c)) - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -47,14 +37,6 @@ NOTE-END */ # define mips #endif -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long @@ -116,7 +98,6 @@ NOTE-END */ #ifdef linux #define TEXT_START 0x00400000 #define DATA_START 0x10000000 -#define DATA_SEG_BITS 0x10000000 #else /* !linux */ #define TEXT_START 0x400000 #define DATA_START 0x800000 diff --git a/src/m/next.h b/src/m/next.h index f2d51b4..b94c659 100644 --- a/src/m/next.h +++ b/src/m/next.h @@ -26,15 +26,6 @@ Boston, MA 02111-1307, USA. */ #define NeXT #endif -/* Define how to take a char and sign-extend into an int. - On machines where char is signed, this is a no-op. */ - -#define SIGN_EXTEND_CHAR(c) (c) - -/* XINT must explicitly sign-extend */ - -#define EXPLICIT_SIGN_EXTEND - /* Say that the text segment of a.out includes the header; the header actually occupies the first few bytes of the text segment and is counted in hdr.a_text. */ diff --git a/src/m/nh3000.h b/src/m/nh3000.h index 5549c8f..89ed532 100644 --- a/src/m/nh3000.h +++ b/src/m/nh3000.h @@ -30,11 +30,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -44,14 +39,6 @@ Boston, MA 02111-1307, USA. */ #define gcx #endif -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -/* #define EXPLICIT_SIGN_EXTEND */ - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long diff --git a/src/m/nh4000.h b/src/m/nh4000.h index 789fe6c..8d9be7f 100644 --- a/src/m/nh4000.h +++ b/src/m/nh4000.h @@ -29,11 +29,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -43,18 +38,6 @@ Boston, MA 02111-1307, USA. */ #define m88000 #endif -#define VALBITS 26 - -#define GCTYPEBITS 5 - -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -/* #define EXPLICIT_SIGN_EXTEND */ - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long diff --git a/src/m/ns32000.h b/src/m/ns32000.h index 5d5967f..c047f12 100644 --- a/src/m/ns32000.h +++ b/src/m/ns32000.h @@ -24,24 +24,11 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="usg5-2" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, orion, tahoe, APOLLO and many others */ -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ /* #define LOAD_AVE_TYPE long */ diff --git a/src/m/nu.h b/src/m/nu.h index 15a5ef0..874bbb3 100644 --- a/src/m/nu.h +++ b/src/m/nu.h @@ -24,10 +24,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="usg5-2" */ -/* XINT must explicitly sign-extend */ - -#define EXPLICIT_SIGN_EXTEND - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000 are the ones defined so far. */ diff --git a/src/m/orion.h b/src/m/orion.h index 368d209..323cf44 100644 --- a/src/m/orion.h +++ b/src/m/orion.h @@ -31,15 +31,6 @@ Boston, MA 02111-1307, USA. */ #define orion #endif -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#define WORD_MACHINE - -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE double diff --git a/src/m/orion105.h b/src/m/orion105.h index 29ee9fe..f558ef4 100644 --- a/src/m/orion105.h +++ b/src/m/orion105.h @@ -25,9 +25,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="bsd4-2" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - /* Data type of load average, as read out of kmem. */ /* This used to be `double'. */ diff --git a/src/m/pfa50.h b/src/m/pfa50.h index 110030d..9161bd8 100644 --- a/src/m/pfa50.h +++ b/src/m/pfa50.h @@ -25,10 +25,6 @@ Boston, MA 02111-1307, USA. */ #define m68000 #define mc68000 1 -/* XINT must explicitly sign-extend */ - -#define EXPLICIT_SIGN_EXTEND - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp @@ -51,17 +47,6 @@ Boston, MA 02111-1307, USA. */ #define LD_SWITCH_MACHINE "-e __start" -#if pfa50 || pfa70 - -/* On A-50/60/70/80, data space has high order byte use. */ -#define VALBITS 26 -#define VALMASK (((1<> VALBITS) & GCTYPEMASK)) */ -#define XTYPE(a) ((enum Lisp_Type) (((a) >> ((VALBITS) + 1)) & GCTYPEMASK)) - -#endif /* pfa50, pfa70 */ - /* SX/A has alloca in the PW library. */ #define LIB_STANDARD "-lPW -lc" diff --git a/src/m/plexus.h b/src/m/plexus.h index 0a80c0f..ec8d956 100644 --- a/src/m/plexus.h +++ b/src/m/plexus.h @@ -24,11 +24,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="usg5-2" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#undef WORD_MACHINE - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO @@ -36,14 +31,6 @@ Boston, MA 02111-1307, USA. */ /* Plexus predefines m68 instead of m68000. */ #define m68000 m68 -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#undef EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #undef LOAD_AVE_TYPE diff --git a/src/m/pmax.h b/src/m/pmax.h index d27722c..3ce797b 100644 --- a/src/m/pmax.h +++ b/src/m/pmax.h @@ -30,7 +30,6 @@ NOTE-END */ #undef LD_SWITCH_MACHINE #undef DATA_START #define DATA_START 0x10000000 -#define DATA_SEG_BITS 0x10000000 #if 0 /* I don't see any such conflict in Ultrix 4.2, 4.2a, or 4.3. And diff --git a/src/m/powerpc.h b/src/m/powerpc.h index f8e2282..7284f6d 100644 --- a/src/m/powerpc.h +++ b/src/m/powerpc.h @@ -43,10 +43,6 @@ Boston, MA 02111-1307, USA. */ # endif #endif -/* XINT must explicitly sign-extend */ - -#define EXPLICIT_SIGN_EXTEND - #ifndef __linux__ /* Data type of load average, as read out of kmem. */ @@ -66,32 +62,12 @@ Boston, MA 02111-1307, USA. */ #define NO_REMAP -#if 0 -#define TEXT_START 0x00001000 -#define TEXT_END 0 -#define DATA_START 0x01000000 -#define DATA_END 0 - -/* The data segment in this machine always starts at address 0x10000000. - An address of data cannot be stored correctly in a Lisp object; - we always lose the high bits. We must tell XPNTR to add them back. */ - -#define DATA_SEG_BITS 0x10000000 -#endif - /* Use type int rather than a union, to represent Lisp_Object */ /* #define NO_UNION_TYPE */ #ifdef CANNOT_DUMP -/* Define shared memory segment symbols */ - -#define PURE_SEG_BITS 0x30000000 -/* Use shared memory. */ -/* This is turned off because it does not always work. See etc/AIX.DUMP. */ -/* #define HAVE_SHM */ -#define SHMKEY 5305035 /* used for shared memory code segments */ #endif /* CANNOT_DUMP */ #define N_BADMAG(x) BADMAG(x) diff --git a/src/m/pyramid.h b/src/m/pyramid.h index 1a88390..7bf7766 100644 --- a/src/m/pyramid.h +++ b/src/m/pyramid.h @@ -24,10 +24,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="bsd4-2" */ -/* XINT must explicitly sign extend */ - -#define EXPLICIT_SIGN_EXTEND - /* pyramid preprocessor defines "pyr", however the following is clearer */ #define pyramid diff --git a/src/m/sequent-ptx.h b/src/m/sequent-ptx.h index 047ba3b..b64851d 100644 --- a/src/m/sequent-ptx.h +++ b/src/m/sequent-ptx.h @@ -26,11 +26,6 @@ Boston, MA 02111-1307, USA. */ #include "intel386.h" -/* Define how to take a char and sign-extend into an int. - On machines where char is signed, this is a no-op. */ -/* CHECK THIS */ -#define SIGN_EXTEND_CHAR(c) (c) - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -45,14 +40,6 @@ Boston, MA 02111-1307, USA. */ #define CRT0_DUMMIES dummy1, dummy2, dummy3, #endif -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the 24-bit bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE unsigned long diff --git a/src/m/sequent.h b/src/m/sequent.h index 4ee869d..e4b7028 100644 --- a/src/m/sequent.h +++ b/src/m/sequent.h @@ -31,11 +31,6 @@ NOTE-END */ /* NOTE: this file works for DYNIX release 2.0 (not tested on 1.3) on NS32000's */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO @@ -54,14 +49,6 @@ NOTE-END */ #define DOT_GLOBAL_START -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE unsigned long diff --git a/src/m/sgi-challenge.h b/src/m/sgi-challenge.h index fda7878..a6900e5 100644 --- a/src/m/sgi-challenge.h +++ b/src/m/sgi-challenge.h @@ -28,11 +28,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="irix3-3" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#undef WORD_MACHINE - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -54,14 +49,6 @@ Boston, MA 02111-1307, USA. */ #undef HAVE_NATIVE_SOUND #endif -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long /* This doesn't quite work on the 4D */ @@ -116,15 +103,7 @@ Boston, MA 02111-1307, USA. */ #define UNEXEC "unexelfsgi.o" #define TEXT_START 0x400000 - -/* - * DATA_SEG_BITS forces that bit to be or'd in with any pointers which - * are trying to access pure strings (as gnu-emacs only allows 24 bits - * for the value field of a LISP_OBJECT). - */ - #define DATA_START 0x10000000 -#define DATA_SEG_BITS 0x10000000 #undef LIBS_MACHINE /* -lsun in case using Yellow Pages for passwords. */ diff --git a/src/m/sparc.h b/src/m/sparc.h index 457e9cd..c1445d0 100644 --- a/src/m/sparc.h +++ b/src/m/sparc.h @@ -42,10 +42,6 @@ NOTE-END */ # endif #endif -/* XINT must explicitly sign-extend */ - -#define EXPLICIT_SIGN_EXTEND - /* Mask for address bits within a memory segment */ #define SEGMENT_MASK (SEGSIZ - 1) diff --git a/src/m/sps7.h b/src/m/sps7.h index 4436e1b..4823ac3 100644 --- a/src/m/sps7.h +++ b/src/m/sps7.h @@ -32,10 +32,6 @@ Boston, MA 02111-1307, USA. */ #define sps7 -/* XINT must explicitly sign-extend */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ /* Suspect there is something weird about this machine, so turn it off. */ diff --git a/src/m/stride.h b/src/m/stride.h index 453e948..def9730 100644 --- a/src/m/stride.h +++ b/src/m/stride.h @@ -24,11 +24,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="usg5-2" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#undef WORD_MACHINE - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe, APOLLO and STRIDE @@ -39,14 +34,6 @@ Boston, MA 02111-1307, USA. */ #define STRIDE #endif -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE double diff --git a/src/m/sun1.h b/src/m/sun1.h index e98ed8a..e5d7483 100644 --- a/src/m/sun1.h +++ b/src/m/sun1.h @@ -47,10 +47,6 @@ NOTE-END */ /* Sun can't write competent compilers */ #define COMPILER_REGISTER_BUG -/* XINT must explicitly sign-extend */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long diff --git a/src/m/sun2.h b/src/m/sun2.h index 3f0c7a8..921f362 100644 --- a/src/m/sun2.h +++ b/src/m/sun2.h @@ -51,10 +51,6 @@ NOTE-END */ /* Sun can't write competent compilers */ #define COMPILER_REGISTER_BUG -/* XINT must explicitly sign-extend */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long diff --git a/src/m/tad68k.h b/src/m/tad68k.h index 363db63..dfc7206 100644 --- a/src/m/tad68k.h +++ b/src/m/tad68k.h @@ -24,22 +24,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="usg5-3" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE */ - -/* Now define a symbol for the cpu type, if your compiler - does not define it automatically */ - -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -/* #define EXPLICIT_SIGN_EXTEND */ - /* Data type of load average, as read out of kmem. */ /* #define LOAD_AVE_TYPE long */ diff --git a/src/m/tahoe.h b/src/m/tahoe.h index 1dde63a..5fc2e48 100644 --- a/src/m/tahoe.h +++ b/src/m/tahoe.h @@ -29,10 +29,6 @@ Use -opsystem=bsd4-2 or -opsystem=bsd4-3, depending on the version of Berkeley you are running. NOTE-END */ -/* XINT must explicitly sign-extend */ - -#define EXPLICIT_SIGN_EXTEND - /* Say this machine is a tahoe */ #ifndef tahoe diff --git a/src/m/targon31.h b/src/m/targon31.h index 1b9d5f0..12c7b82 100644 --- a/src/m/targon31.h +++ b/src/m/targon31.h @@ -24,11 +24,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="usg5-2-2" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#define WORD_MACHINE - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO @@ -37,14 +32,6 @@ Boston, MA 02111-1307, USA. */ /* #define m68k is defined by the Compiler */ /* #define m68000 */ -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ /* #define LOAD_AVE_TYPE double */ diff --git a/src/m/tek4300.h b/src/m/tek4300.h index 4e8a64e..85fc64f 100644 --- a/src/m/tek4300.h +++ b/src/m/tek4300.h @@ -24,11 +24,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="bsd4-3" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#undef WORD_MACHINE - /* Now define a symbol for the cpu type, if your compiler does not define it automatically. */ diff --git a/src/m/tekxd88.h b/src/m/tekxd88.h index 494280b..11b8146 100644 --- a/src/m/tekxd88.h +++ b/src/m/tekxd88.h @@ -22,10 +22,6 @@ Boston, MA 02111-1307, USA. */ /* Synched up with: FSF 19.31. */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ -/* #define WORD_MACHINE */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -34,17 +30,6 @@ Boston, MA 02111-1307, USA. */ #define m88000 #endif -/* Define how to take a char and sign-extend into an int. - On machines where char is signed, this is a no-op. */ -#define SIGN_EXTEND_CHAR(c) (c) - -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ -/* #define EXPLICIT_SIGN_EXTEND */ - /* Data type of load average, as read out of kmem. */ /* #define LOAD_AVE_TYPE double */ /* No load average on XD88. */ /* Convert that into an integer that is 100 for a load average of 1.0 */ diff --git a/src/m/template.h b/src/m/template.h index a6c211f..dc5c9ea 100644 --- a/src/m/template.h +++ b/src/m/template.h @@ -24,24 +24,11 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#define WORD_MACHINE - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, orion, tahoe, APOLLO and many others */ -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long diff --git a/src/m/tower32.h b/src/m/tower32.h index 2e9c891..37413e5 100644 --- a/src/m/tower32.h +++ b/src/m/tower32.h @@ -24,25 +24,12 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="usg5-2-2" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO are the ones defined so far. */ #define m68000 -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ /* #define LOAD_AVE_TYPE long */ diff --git a/src/m/tower32v3.h b/src/m/tower32v3.h index 6cf236f..502e814 100644 --- a/src/m/tower32v3.h +++ b/src/m/tower32v3.h @@ -24,25 +24,12 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="usg5-3" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO are the ones defined so far. */ #define m68000 -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ /* #define LOAD_AVE_TYPE long */ diff --git a/src/m/ustation.h b/src/m/ustation.h index e123232..5e4d2af 100644 --- a/src/m/ustation.h +++ b/src/m/ustation.h @@ -24,11 +24,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="usg5-3" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#undef WORD_MACHINE - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO @@ -37,14 +32,6 @@ Boston, MA 02111-1307, USA. */ #define m68000 mc68000 -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#undef EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE double diff --git a/src/m/wicat.h b/src/m/wicat.h index b05aa36..87d5803 100644 --- a/src/m/wicat.h +++ b/src/m/wicat.h @@ -24,11 +24,6 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="usg5-2" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#undef WORD_MACHINE - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: vax, m68000, ns16000 are the ones defined so far. */ @@ -40,10 +35,6 @@ Boston, MA 02111-1307, USA. */ /* This flag is used only in alloca.s. */ #define WICAT -/* XINT must explicitly sign-extend */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #undef LOAD_AVE_TYPE diff --git a/src/m/windowsnt.h b/src/m/windowsnt.h index cdf6b40..a20bce5 100644 --- a/src/m/windowsnt.h +++ b/src/m/windowsnt.h @@ -30,11 +30,6 @@ Boston, MA 02111-1307, USA. */ #define NO_ARG_ARRAY -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#define WORD_MACHINE - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, @@ -45,14 +40,6 @@ Boston, MA 02111-1307, USA. */ #define NO_UNION_TYPE -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the 24-bit bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long diff --git a/src/m/xps100.h b/src/m/xps100.h index cec6abe..6dfb22d 100644 --- a/src/m/xps100.h +++ b/src/m/xps100.h @@ -26,24 +26,11 @@ Boston, MA 02111-1307, USA. */ operating system this machine is likely to run. USUAL-OPSYS="usg5-2" */ -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE */ - /* Now define a symbol for the cpu type, if your compiler does not define it automatically: Ones defined so far include vax, m68000, ns16000, pyramid, orion, tahoe, APOLLO and many others */ -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ /* #define LOAD_AVE_TYPE long */ diff --git a/src/malloc.c b/src/malloc.c index 9f41290..599110a 100644 --- a/src/malloc.c +++ b/src/malloc.c @@ -201,10 +201,8 @@ extern void *sbrk (); extern char *start_of_data (void); #ifdef BSD -#ifndef DATA_SEG_BITS #define start_of_data() &etext #endif -#endif #ifndef emacs #define start_of_data() &etext diff --git a/src/marker.c b/src/marker.c index 408acc3..0811ac0 100644 --- a/src/marker.c +++ b/src/marker.c @@ -509,6 +509,8 @@ compute_buffer_marker_usage (struct buffer *b, struct overhead_stats *ovstats) void syms_of_marker (void) { + INIT_LRECORD_IMPLEMENTATION (marker); + DEFSUBR (Fmarker_position); DEFSUBR (Fmarker_buffer); DEFSUBR (Fset_marker); diff --git a/src/mem-limits.h b/src/mem-limits.h index fac6732..427a61c 100644 --- a/src/mem-limits.h +++ b/src/mem-limits.h @@ -104,11 +104,9 @@ extern POINTER start_of_data (void); #define EXCEEDS_LISP_PTR(ptr) 0 #ifdef BSD -#ifndef DATA_SEG_BITS extern int etext; #define start_of_data() &etext #endif -#endif #else /* not emacs */ extern char etext; diff --git a/src/menubar-msw.c b/src/menubar-msw.c index d25ccc6..a388c30 100644 --- a/src/menubar-msw.c +++ b/src/menubar-msw.c @@ -136,24 +136,24 @@ displayable_menu_item (Lisp_Object gui_item, int bar_p) /* Escape '&' as '&&' */ ptr = buf; - while ((ptr=memchr (ptr, '&', ll-(ptr-buf))) != NULL) + while ((ptr = (char*) memchr (ptr, '&', ll - (ptr - buf))) != NULL) { - if (ll+2 >= MAX_MENUITEM_LENGTH) + if (ll + 2 >= MAX_MENUITEM_LENGTH) signal_simple_error ("Menu item produces too long displayable string", XGUI_ITEM (gui_item)->name); - memmove (ptr+1, ptr, (ll-(ptr-buf))+1); + memmove (ptr + 1, ptr, (ll - (ptr - buf)) + 1); ll++; - ptr+=2; + ptr += 2; } /* Replace XEmacs accelerator '%_' with Windows accelerator '&' */ ptr = buf; - while ((ptr=memchr (ptr, '%', ll-(ptr-buf))) != NULL) + while ((ptr = (char*) memchr (ptr, '%', ll - (ptr - buf))) != NULL) { - if (*(ptr+1) == '_') + if (*(ptr + 1) == '_') { *ptr = '&'; - memmove (ptr+1, ptr+2, ll-(ptr-buf+2)); + memmove (ptr + 1, ptr + 2, ll - (ptr - buf + 2)); ll--; } ptr++; diff --git a/src/nt.c b/src/nt.c index e745609..4b21a11 100644 --- a/src/nt.c +++ b/src/nt.c @@ -290,7 +290,7 @@ init_user_info () putenv ((GetVersion () & 0x80000000) ? "SHELL=command" : "SHELL=cmd"); /* Set dir and shell from environment variables. */ - strcpy (the_passwd.pw_dir, get_home_directory()); + strcpy (the_passwd.pw_dir, (char *)get_home_directory()); strcpy (the_passwd.pw_shell, getenv ("SHELL")); } @@ -299,9 +299,7 @@ init_user_info () case path name components to lower case. */ static void -normalize_filename (fp, path_sep) - REGISTER char *fp; - char path_sep; +normalize_filename (char *fp, char path_sep) { char sep; char *elem; @@ -357,16 +355,14 @@ normalize_filename (fp, path_sep) /* Destructively turn backslashes into slashes. */ void -dostounix_filename (p) - REGISTER char *p; +dostounix_filename (char *p) { normalize_filename (p, '/'); } /* Destructively turn slashes into backslashes. */ void -unixtodos_filename (p) - REGISTER char *p; +unixtodos_filename (char *p) { normalize_filename (p, '\\'); } @@ -375,10 +371,7 @@ unixtodos_filename (p) (From msdos.c...probably should figure out a way to share it, although this code isn't going to ever change.) */ int -crlf_to_lf (n, buf, lf_count) - REGISTER int n; - REGISTER unsigned char *buf; - REGISTER unsigned *lf_count; +crlf_to_lf (int n, unsigned char *buf, unsigned *lf_count) { unsigned char *np = buf; unsigned char *startp = buf; @@ -555,9 +548,7 @@ request_sigio (void) #define REG_ROOT "SOFTWARE\\GNU\\XEmacs" LPBYTE -nt_get_resource (key, lpdwtype) - char *key; - LPDWORD lpdwtype; +nt_get_resource (char *key, LPDWORD lpdwtype) { LPBYTE lpvalue; HKEY hrootkey = NULL; @@ -1479,7 +1470,7 @@ stat (const char * path, struct stat * buf) len = strlen (name); rootdir = (path >= name + len - 1 && (IS_DIRECTORY_SEP (*path) || *path == 0)); - name = strcpy (alloca (len + 2), name); + name = strcpy ((char *)alloca (len + 2), name); if (rootdir) { @@ -2034,11 +2025,11 @@ open_input_file (file_data *p_file, const char *filename) if (file_base == 0) return FALSE; - p_file->name = (char*)filename; + p_file->name = (char *)filename; p_file->size = size; p_file->file = file; p_file->file_mapping = file_mapping; - p_file->file_base = file_base; + p_file->file_base = (char *)file_base; return TRUE; } diff --git a/src/ntheap.c b/src/ntheap.c index 8e54bc8..704bd32 100644 --- a/src/ntheap.c +++ b/src/ntheap.c @@ -80,7 +80,7 @@ get_data_end (void) return data_region_end; } -static char * +static unsigned char * allocate_heap (void) { /* The base address for our GNU malloc heap is chosen in conjunction @@ -122,7 +122,7 @@ allocate_heap (void) unsigned long base = 0x01B00000; /* 27MB */ /* Temporary hack for the non-starting problem - use 28 (256Mb) rather than VALBITS (1Gb) */ unsigned long end = 1 << 28; /* 256MB */ - void *ptr = NULL; + void *ptr; #define NTHEAP_PROBE_BASE 1 #if NTHEAP_PROBE_BASE /* This is never normally defined */ @@ -144,7 +144,7 @@ allocate_heap (void) PAGE_NOACCESS); #endif - return ptr; + return (unsigned char*) ptr; } @@ -227,7 +227,7 @@ sbrk (unsigned long increment) void recreate_heap (char *executable_path) { - unsigned char *tmp; + void *tmp; /* First reserve the upper part of our heap. (We reserve first because there have been problems in the past where doing the diff --git a/src/ntheap.h b/src/ntheap.h index cb169d2..091cf0c 100644 --- a/src/ntheap.h +++ b/src/ntheap.h @@ -51,7 +51,7 @@ extern int nt_minor_version; /* To prevent zero-initialized variables from being placed into the bss section, use non-zero values to represent an uninitialized state. */ -#define UNINIT_PTR ((void *) 0xF0A0F0A0) +#define UNINIT_PTR ((unsigned char*) 0xF0A0F0A0) #define UNINIT_LONG (0xF0A0F0A0L) /* Emulation of Unix sbrk(). */ @@ -80,11 +80,11 @@ extern unsigned char *round_to_next (unsigned char *address, /* Useful routines for manipulating memory-mapped files. */ typedef struct file_data { - const char *name; - unsigned long size; - HANDLE file; - HANDLE file_mapping; - unsigned char *file_base; + const char *name; + unsigned long size; + HANDLE file; + HANDLE file_mapping; + char *file_base; } file_data; #define OFFSET_TO_RVA(var,section) \ diff --git a/src/ntplay.c b/src/ntplay.c index 8ff0be7..d535fd9 100644 --- a/src/ntplay.c +++ b/src/ntplay.c @@ -51,7 +51,7 @@ void play_sound_file (char *sound_file, int volume) return; size = lseek (ofd, 0, SEEK_END); - data = xmalloc (size); + data = (unsigned char *)xmalloc (size); lseek (ofd, 0, SEEK_SET); if (!data) @@ -90,7 +90,7 @@ static void play_sound_data_1 (unsigned char *data, int length, int volume, if (convert_to_malloc) { - sound_data = xmalloc (length); + sound_data = (unsigned char *)xmalloc (length); memcpy (sound_data, data, length); } else diff --git a/src/ntproc.c b/src/ntproc.c index f15fe99..0b95e43 100644 --- a/src/ntproc.c +++ b/src/ntproc.c @@ -533,7 +533,7 @@ win32_executable_type (const char * filename, int * is_dos_app, int * is_cygnus_ if (exe_header->e_magic != DOSMAGIC) goto unwind; - if ((char *) exe_header->e_lfanew > (char *) executable.size) + if ((char*) exe_header->e_lfanew > (char*) executable.size) { /* Some dos headers (pkunzip) have bogus e_lfanew fields. */ *is_dos_app = TRUE; @@ -550,9 +550,9 @@ win32_executable_type (const char * filename, int * is_dos_app, int * is_cygnus_ if (dos_header->e_magic != IMAGE_DOS_SIGNATURE) goto unwind; - nt_header = (PIMAGE_NT_HEADERS) ((char *) dos_header + dos_header->e_lfanew); + nt_header = (PIMAGE_NT_HEADERS) ((char*) dos_header + dos_header->e_lfanew); - if ((char *) nt_header > (char *) dos_header + executable.size) + if ((char*) nt_header > (char*) dos_header + executable.size) { /* Some dos headers (pkunzip) have bogus e_lfanew fields. */ *is_dos_app = TRUE; @@ -571,11 +571,12 @@ win32_executable_type (const char * filename, int * is_dos_app, int * is_cygnus_ IMAGE_SECTION_HEADER * section; section = rva_to_section (import_dir.VirtualAddress, nt_header); - imports = RVA_TO_PTR (import_dir.VirtualAddress, section, executable); + imports = (IMAGE_IMPORT_DESCRIPTOR *) RVA_TO_PTR (import_dir.VirtualAddress, + section, executable); for ( ; imports->Name; imports++) { - char * dllname = RVA_TO_PTR (imports->Name, section, executable); + char *dllname = (char*) RVA_TO_PTR (imports->Name, section, executable); if (strcmp (dllname, "cygwin.dll") == 0) { @@ -630,7 +631,7 @@ merge_and_sort_env (char **envp1, char **envp2, char **new_envp) *nptr++ = *optr++; num += optr - envp2; - qsort (new_envp, num, sizeof (char *), compare_env); + qsort (new_envp, num, sizeof (char*), compare_env); *nptr = NULL; } @@ -681,7 +682,7 @@ sys_spawnve (int mode, const char *cmdname, } else { - (char*)cmdname = alloca (strlen (argv[0]) + 1); + cmdname = (char*)alloca (strlen (argv[0]) + 1); strcpy ((char*)cmdname, argv[0]); } UNGCPRO; @@ -703,7 +704,7 @@ sys_spawnve (int mode, const char *cmdname, while leaving the real app name as argv[0]. */ if (is_dos_app) { - cmdname = alloca (MAXPATHLEN); + cmdname = (char*) alloca (MAXPATHLEN); if (egetenv ("CMDPROXY")) strcpy ((char*)cmdname, egetenv ("CMDPROXY")); else @@ -802,7 +803,7 @@ sys_spawnve (int mode, const char *cmdname, } arglen += strlen (*targ++) + 1; } - cmdline = alloca (arglen); + cmdline = (char*) alloca (arglen); targ = (char**)argv; parg = cmdline; while (*targ) @@ -884,7 +885,7 @@ sys_spawnve (int mode, const char *cmdname, /* and envp... */ arglen = 1; - targ = (char**)envp; + targ = (char**) envp; numenv = 1; /* for end null */ while (*targ) { @@ -898,11 +899,11 @@ sys_spawnve (int mode, const char *cmdname, numenv++; /* merge env passed in and extra env into one, and sort it. */ - targ = (char **) alloca (numenv * sizeof (char *)); - merge_and_sort_env ((char**)envp, extra_env, targ); + targ = (char **) alloca (numenv * sizeof (char*)); + merge_and_sort_env ((char**) envp, extra_env, targ); /* concatenate env entries. */ - env = alloca (arglen); + env = (char*) alloca (arglen); parg = env; while (*targ) { diff --git a/src/objects-msw.h b/src/objects-msw.h index 71b423b..f01de94 100644 --- a/src/objects-msw.h +++ b/src/objects-msw.h @@ -69,8 +69,10 @@ struct mswindows_font_instance_data /* If font creation during redisplay fails, then the following value is used to prevent future attempts to create this font. Redisplay uses the "main" font when encounters this value */ -#define MSWINDOWS_BAD_HFONT INVALID_HANDLE_VALUE +#define MSWINDOWS_BAD_HFONT ((HFONT)INVALID_HANDLE_VALUE) HFONT mswindows_get_hfont (Lisp_Font_Instance* f, int under, int strike); +Lisp_Object mswindows_color_to_string (COLORREF color); + #endif /* INCLUDED_objects_msw_h_ */ diff --git a/src/objects.c b/src/objects.c index 3cedafd..e91dbed 100644 --- a/src/objects.c +++ b/src/objects.c @@ -1009,6 +1009,9 @@ Valid instantiators for face-boolean specifiers are void syms_of_objects (void) { + INIT_LRECORD_IMPLEMENTATION (color_instance); + INIT_LRECORD_IMPLEMENTATION (font_instance); + DEFSUBR (Fcolor_specifier_p); DEFSUBR (Ffont_specifier_p); DEFSUBR (Fface_boolean_specifier_p); diff --git a/src/opaque.c b/src/opaque.c index 51ea934..1b080e5 100644 --- a/src/opaque.c +++ b/src/opaque.c @@ -173,5 +173,8 @@ reinit_opaque_once_early (void) void init_opaque_once_early (void) { + INIT_LRECORD_IMPLEMENTATION (opaque); + INIT_LRECORD_IMPLEMENTATION (opaque_ptr); + reinit_opaque_once_early (); } diff --git a/src/process-nt.c b/src/process-nt.c index ad56f70..f7ab6a5 100644 --- a/src/process-nt.c +++ b/src/process-nt.c @@ -581,7 +581,7 @@ nt_create_process (Lisp_Process *p, new_space++; /* Allocate space and copy variables into it */ - penv = proc_env = alloca(new_space); + penv = proc_env = (char*) alloca(new_space); for (i = 0; i < new_length; i++) { strcpy(penv, env[i]); diff --git a/src/process.c b/src/process.c index 643e123..f5e5dae 100644 --- a/src/process.c +++ b/src/process.c @@ -1990,6 +1990,8 @@ t or pty (pty) or stream (socket connection). void syms_of_process (void) { + INIT_LRECORD_IMPLEMENTATION (process); + defsymbol (&Qprocessp, "processp"); defsymbol (&Qprocess_live_p, "process-live-p"); defsymbol (&Qrun, "run"); diff --git a/src/ralloc.c b/src/ralloc.c index e091b2f..ea8f8f8 100644 --- a/src/ralloc.c +++ b/src/ralloc.c @@ -1726,7 +1726,7 @@ Addr_Block_initialize (void) addr_chain = (ADDRESS_CHAIN) UNDERLYING_MALLOC( sizeof( ADDRESS_BLOCK )); addr_chain->next = 0; /* Last block in chain */ addr_chain->sz = 0x0c000000; /* Size */ - addr_chain->addr = (POINTER) (0x04000000 | DATA_SEG_BITS); + addr_chain->addr = (POINTER) (0x04000000); addr_chain->flag = empty; } diff --git a/src/rangetab.c b/src/rangetab.c index 12b3bf3..fc29885 100644 --- a/src/rangetab.c +++ b/src/rangetab.c @@ -704,6 +704,8 @@ unified_range_table_get_range (void *unrangetab, int offset, void syms_of_rangetab (void) { + INIT_LRECORD_IMPLEMENTATION (range_table); + defsymbol (&Qrange_tablep, "range-table-p"); defsymbol (&Qrange_table, "range-table"); diff --git a/src/realpath.c b/src/realpath.c index b39257d..08d32d7 100644 --- a/src/realpath.c +++ b/src/realpath.c @@ -28,13 +28,14 @@ Boston, MA 02111-1307, USA. */ #include #include #include +#include + #ifdef HAVE_UNISTD_H #include #endif -#ifdef _POSIX_VERSION -#include /* for PATH_MAX */ -#else -#include /* for MAXPATHLEN */ + +#if defined (HAVE_SYS_PARAM_H) +#include #endif #ifdef WINDOWSNT @@ -74,7 +75,7 @@ xrealpath (const char *path, char resolved_path []) #endif /* Make a copy of the source path since we may need to modify it. */ - strcpy(copy_path, path); + strcpy (copy_path, path); path = copy_path; max_path = copy_path + PATH_MAX - 2; #ifdef WINDOWSNT @@ -153,21 +154,20 @@ xrealpath (const char *path, char resolved_path []) continue; } - if (path[1] == '.') + /* Handle ".." */ + if (path[1] == '.' && + (path[2] == '\0' || path[2] == '/')) { - if (path[2] == '\0' || path[2] == '/') - { - path += 2; - - /* Ignore ".." at root. */ - if (new_path == resolved_path + 1) - continue; - - /* Handle ".." by backing up. */ - while ((--new_path)[-1] != '/') - ; - continue; - } + path += 2; + + /* Ignore ".." at root. */ + if (new_path == resolved_path + 1) + continue; + + /* Handle ".." by backing up. */ + while ((--new_path)[-1] != '/') + ; + continue; } } @@ -185,7 +185,7 @@ xrealpath (const char *path, char resolved_path []) #ifdef S_IFLNK /* See if latest pathname component is a symlink. */ *new_path = '\0'; - n = readlink(resolved_path, link_path, PATH_MAX - 1); + n = readlink (resolved_path, link_path, PATH_MAX - 1); if (n < 0) { diff --git a/src/s/cygwin32.h b/src/s/cygwin32.h index 19562b8..d108923 100644 --- a/src/s/cygwin32.h +++ b/src/s/cygwin32.h @@ -187,19 +187,6 @@ extern long random(); #define NO_ARG_ARRAY -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#define WORD_MACHINE - -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the 24-bit bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long @@ -218,10 +205,6 @@ extern long random(); /* Text does precede data space, but this is never a safe assumption. */ #define VIRT_ADDR_VARIES -/* set this if you have a new version of cygwin -#define DATA_SEG_BITS 0x10000000 -*/ - /* If you are compiling with a non-C calling convention but need to declare vararg routines differently, put it here */ #define _VARARGS_ __cdecl diff --git a/src/s/windowsnt.h b/src/s/windowsnt.h index 45395e2..33d49a4 100644 --- a/src/s/windowsnt.h +++ b/src/s/windowsnt.h @@ -304,3 +304,11 @@ gid_t getegid (void); #define _WIN32_WINNT 0x0400 #endif #endif + +/* MSVC 6.0 has a mechanism to declare functions which never return */ +#if (_MSC_VER >= 1200) +#define DOESNT_RETURN __declspec(noreturn) void +#define DECLARE_DOESNT_RETURN(decl) __declspec(noreturn) extern void decl +#define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \ + __declspec(noreturn) extern void decl PRINTF_ARGS(str,idx) +#endif /* MSVC 6.0 */ diff --git a/src/select-msw.c b/src/select-msw.c index a760eb0..f72a46c 100644 --- a/src/select-msw.c +++ b/src/select-msw.c @@ -71,7 +71,7 @@ Copy STRING to the mswindows clipboard. do { /* copy next line or remaining bytes including '\0' */ - next = memccpy (dst, src, '\n', rawsize); + next = (char*) memccpy (dst, src, '\n', rawsize); if (next) { /* copied one line ending with '\n' */ @@ -141,7 +141,7 @@ Return the contents of the mswindows clipboard. do { /* copy next line or remaining bytes excluding '\0' */ - next = memccpy (dst, src, '\r', rawsize); + next = (char*) memccpy (dst, src, '\r', rawsize); if (next) { /* copied one line ending with '\r' */ diff --git a/src/specifier.c b/src/specifier.c index cdb1cc3..fad2e0f 100644 --- a/src/specifier.c +++ b/src/specifier.c @@ -3114,6 +3114,8 @@ Return non-nil if OBJECT is a display-table specifier. void syms_of_specifier (void) { + INIT_LRECORD_IMPLEMENTATION (specifier); + defsymbol (&Qspecifierp, "specifierp"); defsymbol (&Qconsole_type, "console-type"); diff --git a/src/symeval.h b/src/symeval.h index 41e2324..ac3bec1 100644 --- a/src/symeval.h +++ b/src/symeval.h @@ -75,10 +75,9 @@ struct symbol_value_magic void *value; enum symbol_value_type type; }; -#define SYMBOL_VALUE_MAGIC_P(x) \ - (LRECORDP (x) \ - && (XRECORD_LHEADER_IMPLEMENTATION (x)->printer \ - == print_symbol_value_magic)) +#define SYMBOL_VALUE_MAGIC_P(x) \ +(LRECORDP (x) && \ + XRECORD_LHEADER (x)->type <= lrecord_type_max_symbol_value_magic) #define XSYMBOL_VALUE_MAGIC_TYPE(v) \ (((struct symbol_value_magic *) XPNTR (v))->type) #define XSETSYMBOL_VALUE_MAGIC(s, p) XSETOBJ (s, Lisp_Type_Record, p) @@ -296,15 +295,15 @@ void deferror (Lisp_Object *symbol, const char *name, void defvar_magic (const char *symbol_name, const struct symbol_value_forward *magic); #define DEFVAR_SYMVAL_FWD(lname, c_location, forward_type, magicfun) do { \ - static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C = \ + static const struct symbol_value_forward I_hate_C = \ { /* struct symbol_value_forward */ \ { /* struct symbol_value_magic */ \ { /* struct lcrecord_header */ \ { /* struct lrecord_header */ \ - 1, /* type - index into lrecord_implementations_table */ \ - 0, /* mark bit */ \ - 0, /* c_readonly bit */ \ - 0 /* lisp_readonly bit */ \ + lrecord_type_symbol_value_forward, /* lrecord_type_index */ \ + 1, /* mark bit */ \ + 1, /* c_readonly bit */ \ + 1 /* lisp_readonly bit */ \ }, \ 0, /* next */ \ 0, /* uid */ \ diff --git a/src/sysdep.c b/src/sysdep.c index b875b48..fbf71ac 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -699,7 +699,7 @@ sys_subshell (void) #ifdef WINDOWSNT /* Waits for process completion */ - pid = _spawnlp (_P_WAIT, sh, sh, NULL); + pid = (HANDLE) _spawnlp (_P_WAIT, sh, sh, NULL); if (pid == NULL) write (1, "Can't execute subshell", 22); @@ -2653,6 +2653,8 @@ sys_open (const char *path, int oflag, ...) mode = va_arg (ap, int); va_end (ap); + PATHNAME_CONVERT_OUT (path); + #ifdef WINDOWSNT /* Make all handles non-inheritable */ oflag |= _O_NOINHERIT; diff --git a/src/toolbar-msw.c b/src/toolbar-msw.c index a09610e..c5a0778 100644 --- a/src/toolbar-msw.c +++ b/src/toolbar-msw.c @@ -573,9 +573,10 @@ static void mswindows_free_frame_toolbars (struct frame *f) { HWND twnd=NULL; -#define DELETE_TOOLBAR(pos) \ - mswindows_clear_toolbar(f, 0, pos); \ - if ((twnd=GetDlgItem(FRAME_MSWINDOWS_HANDLE(f), TOOLBAR_ID_BIAS + pos))) \ +#define DELETE_TOOLBAR(pos) \ + mswindows_clear_toolbar(f, pos, 0); \ + if ((twnd=GetDlgItem(FRAME_MSWINDOWS_HANDLE(f), \ + TOOLBAR_ID_BIAS + pos))) \ DestroyWindow(twnd) DELETE_TOOLBAR(TOP_TOOLBAR); diff --git a/src/toolbar.c b/src/toolbar.c index cff25ac..c7221c7 100644 --- a/src/toolbar.c +++ b/src/toolbar.c @@ -722,10 +722,10 @@ set_frame_toolbar (struct frame *f, enum toolbar_pos pos) static void compute_frame_toolbars_data (struct frame *f) { - set_frame_toolbar (f, TOP_TOOLBAR); - set_frame_toolbar (f, BOTTOM_TOOLBAR); - set_frame_toolbar (f, LEFT_TOOLBAR); - set_frame_toolbar (f, RIGHT_TOOLBAR); + set_frame_toolbar (f, TOP_TOOLBAR); + set_frame_toolbar (f, BOTTOM_TOOLBAR); + set_frame_toolbar (f, LEFT_TOOLBAR); + set_frame_toolbar (f, RIGHT_TOOLBAR); } void @@ -737,7 +737,7 @@ update_frame_toolbars (struct frame *f) && (f->toolbar_changed || f->frame_changed || f->clear)) { int pos; - + /* We're not officially "in redisplay", so we still have a chance to re-layout toolbars and windows. This is done here, because toolbar is the only thing which currently might @@ -1272,6 +1272,8 @@ toolbar_buttons_captioned_p_changed (Lisp_Object specifier, struct window *w, void syms_of_toolbar (void) { + INIT_LRECORD_IMPLEMENTATION (toolbar_button); + defsymbol (&Qtoolbar_buttonp, "toolbar-button-p"); defsymbol (&Q2D, "2D"); defsymbol (&Q3D, "3D"); @@ -1633,7 +1635,7 @@ See `default-toolbar-height' for more information. fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_TOOLBAR_HEIGHT)), fb); #endif #ifdef HAVE_MS_WINDOWS - fb = Fcons (Fcons (list1 (Qmswindows), + fb = Fcons (Fcons (list1 (Qmswindows), make_int (MSWINDOWS_DEFAULT_TOOLBAR_HEIGHT)), fb); #endif if (!NILP (fb)) @@ -1647,7 +1649,7 @@ See `default-toolbar-height' for more information. fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_TOOLBAR_WIDTH)), fb); #endif #ifdef HAVE_MS_WINDOWS - fb = Fcons (Fcons (list1 (Qmswindows), + fb = Fcons (Fcons (list1 (Qmswindows), make_int (MSWINDOWS_DEFAULT_TOOLBAR_WIDTH)), fb); #endif if (!NILP (fb)) diff --git a/src/tooltalk.c b/src/tooltalk.c index c3359e0..4a87c3e 100644 --- a/src/tooltalk.c +++ b/src/tooltalk.c @@ -1301,6 +1301,9 @@ Returns t if successful, nil otherwise. void syms_of_tooltalk (void) { + INIT_LRECORD_IMPLEMENTATION (tooltalk_message); + INIT_LRECORD_IMPLEMENTATION (tooltalk_pattern); + defsymbol (&Qtooltalk_messagep, "tooltalk-message-p"); DEFSUBR (Ftooltalk_message_p); defsymbol (&Qtooltalk_patternp, "tooltalk-pattern-p"); diff --git a/src/unexnt.c b/src/unexnt.c index feefef8..53abecf 100644 --- a/src/unexnt.c +++ b/src/unexnt.c @@ -63,9 +63,10 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA /* From IMAGEHLP.H which is not installed by default by MSVC < 5 */ /* The IMAGEHLP.DLL library is not distributed by default with Windows95 */ -PIMAGE_NT_HEADERS -(__stdcall * pfnCheckSumMappedFile) (LPVOID BaseAddress, DWORD FileLength, - LPDWORD HeaderSum, LPDWORD CheckSum); +typedef PIMAGE_NT_HEADERS +(__stdcall * pfnCheckSumMappedFile_t) (LPVOID BaseAddress, DWORD FileLength, + LPDWORD HeaderSum, LPDWORD CheckSum); + #if 0 extern BOOL ctrl_c_handler (unsigned long type); @@ -190,7 +191,7 @@ unexec (char *new_name, char *old_name, void *start_data, void *start_bss, char out_filename[MAX_PATH], in_filename[MAX_PATH]; unsigned long size; char *ptr; - HANDLE hImagehelp; + HINSTANCE hImagehelp; /* Make sure that the input and output filenames have the ".exe" extension...patch them up if they don't. */ @@ -245,21 +246,29 @@ unexec (char *new_name, char *old_name, void *start_data, void *start_bss, { PIMAGE_DOS_HEADER dos_header; PIMAGE_NT_HEADERS nt_header; + DWORD headersum; DWORD checksum; + pfnCheckSumMappedFile_t pfnCheckSumMappedFile; dos_header = (PIMAGE_DOS_HEADER) out_file.file_base; nt_header = (PIMAGE_NT_HEADERS) ((char *) dos_header + dos_header->e_lfanew); nt_header->OptionalHeader.CheckSum = 0; -// nt_header->FileHeader.TimeDateStamp = time (NULL); -// dos_header->e_cp = size / 512; -// nt_header->OptionalHeader.SizeOfImage = size; +#if 0 + nt_header->FileHeader.TimeDateStamp = time (NULL); + dos_header->e_cp = size / 512; + nt_header->OptionalHeader.SizeOfImage = size; +#endif - pfnCheckSumMappedFile = (void *) GetProcAddress (hImagehelp, "CheckSumMappedFile"); + pfnCheckSumMappedFile = + (pfnCheckSumMappedFile_t) GetProcAddress (hImagehelp, + "CheckSumMappedFile"); if (pfnCheckSumMappedFile) { -// nt_header->FileHeader.TimeDateStamp = time (NULL); +#if 0 + nt_header->FileHeader.TimeDateStamp = time (NULL); +#endif pfnCheckSumMappedFile (out_file.file_base, out_file.size, &headersum, @@ -295,14 +304,14 @@ open_output_file (file_data *p_file, const char *filename, unsigned long size) return FALSE; file_base = MapViewOfFile (file_mapping, FILE_MAP_WRITE, 0, 0, size); - if (file_base == 0) + if (file_base == NULL) return FALSE; p_file->name = filename; p_file->size = size; p_file->file = file; p_file->file_mapping = file_mapping; - p_file->file_base = file_base; + p_file->file_base = (char*) file_base; return TRUE; } @@ -486,7 +495,7 @@ copy_executable_and_dump_data_section (file_data *p_infile, DUMP_MSG (("Dumping data section...\n")); DUMP_MSG (("\t0x%08x Address in process.\n", data_va)); DUMP_MSG (("\t0x%08x Offset in output file.\n", - data_file - p_outfile->file_base)); + (char*)data_file - p_outfile->file_base)); DUMP_MSG (("\t0x%08x Size in bytes.\n", size)); memcpy (data_file, data_va, size); diff --git a/src/vm-limit.c b/src/vm-limit.c index 404534e..b6c7dda 100644 --- a/src/vm-limit.c +++ b/src/vm-limit.c @@ -124,7 +124,7 @@ memory_warnings (void *start, void (*warnfun) (const char *)) extern void (* __after_morecore_hook) (void); /* From gmalloc.c */ if (start) - data_space_start = start; + data_space_start = (char*) start; else data_space_start = start_of_data (); diff --git a/src/window.c b/src/window.c index 7a6eb7a..7f84aa0 100644 --- a/src/window.c +++ b/src/window.c @@ -5773,6 +5773,9 @@ debug_print_windows (struct frame *f) void syms_of_window (void) { + INIT_LRECORD_IMPLEMENTATION (window); + INIT_LRECORD_IMPLEMENTATION (window_configuration); + defsymbol (&Qwindowp, "windowp"); defsymbol (&Qwindow_live_p, "window-live-p"); defsymbol (&Qwindow_configurationp, "window-configuration-p"); diff --git a/tests/ChangeLog b/tests/ChangeLog index e3f98c9..9344725 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,11 @@ +2000-02-21 Martin Buchholz + + * XEmacs 21.2.30 is released. + +2000-02-17 Martin Buchholz + + * automated/mule-tests.el: Added some fileio tests. + 2000-02-16 Martin Buchholz * XEmacs 21.2.29 is released. diff --git a/version.sh b/version.sh index 9bdf523..e3759ea 100644 --- a/version.sh +++ b/version.sh @@ -2,8 +2,8 @@ emacs_is_beta=t emacs_major_version=21 emacs_minor_version=2 -emacs_beta_version=29 -xemacs_codename="Hestia" +emacs_beta_version=30 +xemacs_codename="Hygeia" infodock_major_version=4 infodock_minor_version=0 infodock_build_version=8