
                      LinuxDoc+Emacs+Ispell-HOWTO 媩
                                       
@̡G Philippe MARTIN ( [1]feloy@wanadoo.fr)
^Ķ̡G Sebastien Blondeel ( [2]Sebastien.Blondeel@lifl.fr)
Ķ̡Gw An-Shan Lee ( [3]anshan@hello.com.tw)

   v0.4, 27 February 1998
     _________________________________________________________________
   
   oDnOѵ Linux HOWTOs @̻PĶ̤ΨLѻP Linux p
   (Linux Documentation Project) ̰ѦҨϥΡCqjaiH@Ǧ
   Emacs P Ispell u㪺ܡC 
     _________________________________________________________________
   
1. e 

     * 1.1 v 
     * 1.2  
     * 1.3  
     * 1.4  
       
2. ² 

     * 2.1 SGML
     * 2.2 LinuxDoc Awq 
     * 2.3 SGML-Tools
       
3. zĤ@ 

     * 3.1 q@¤rɤ}l 
       
4. ]w Emacs

     * 4.1 r (Accented Characters)
     * 4.2 SGML Ҧ (SGML mode)
     * 4.3 PSGML Ҧ (PSGML mode)
     * 4.4 LҦ 
       
5. Ispell

     * 5.1 ܱzw] (default dictionaries)
     * 5.2 Sw]wӧO 
     * 5.3 󪺫rˬd 
     * 5.4 ӤHPӧOɮ (local file dictionary)  
     * 5.5 Jɪrˬd 
       
6. @ǧޥ 

     * 6.1 ۰ʴJ (header)
       
Appendix

7. Insert-sgml-header{d
     _________________________________________________________________
   
1. e

1.1 v

   vݩ Philippe Martin 1998
   unzuĤGΤ᪩ GNU qΤ}v (General Public License)
   AziHsG / קoC
   
1.2 

   SOP Sebastien BlondeelC Sebastien OӫD`oa۪HA
   ڤ@j靈 Emacs w˪DC:-) ]ѩLҰݪDܦNqA~
   گ`F EmacsAñNکҾǨ쪺ѵoXӡAѵjaѦҡC
   
1.3 

   pGzĳiHﵽAФnSݺɧ֪iDڡAڷ|JӪѦұz
   NC
   󦹤ұQDDApGzDܡA]кɧ֪iDڡAڷ|D
   `ַN^zA]zoݩγ\]UڧﵽC
   
     ^Ķ̵Gpja{o󪺭^ܡANǧ½ĶnC
     Ķ̵GpGjao󦳺ðݪܡA٬OǸo^ĶoA]
     ڬOӥL^½ĶLӪC:-P }ApGja{o󤤤½
     nAЦhh][AôѷNڡAHKڧﵽA¡C
     
1.4 

   oPUC:
     * Sgml-tools  0.99A
     * Emacs  19.34A
     * Ispell  3.1A
     * |Ҥ Emacs {wPWC Emacs @_oA
       iso-sgml hP XEmacs @_oA psgml hOW۵o檺{wC
       
2. ²

2.1 SGML

   Standard Generalised Mark-up LanguageAκ٬ SGMLAO@إiHwq
   κAyC
   
   ĴpAziHwqЪ󫬺AAĤ@e{DAĤGЦơA
   ĤTh@B@BܦpMNJ|A@TnݪϵeNi{if
   FC
   
   oNOҿתκAwq (Document Type Definition)CèSwq̫᪺
   ~OˤlAu󪺤ej]AFC
   
   HAzbŪFڳoЪAwq|ҤAzl̴N|zۤv
   СAΪ̱zQOz̳wplҧe{zAaHMӡAL
   ݰ_ӳOPGbڪQ̡AڪGӤObDdlW
   AӥDOb̡AaPNװϤCzOH
   
   h SGML зǩwqAڭ̥iHӨҴѪ榡Pg@AӤ
   ξ̫߳Ū̷|ݤڭ̦bgǤC
   
2.2 LinuxDoc Awq

   pziq쪺AoAAΩg@ Linux C
   
   ؤq`غcpUG󪺶}lODA۬O@̪W١A󪺪
   XPCAӬOKn]oŪ̴NΦbsLg󤧫~DoäO
   L̷Qݪ^AOؿAܤ󵲺cAoˤ@ӨǫQDY@
   SweHNi쨺hŪC
   
   MNO@tC`AqCboAziHJ{Aܦr
   jլYӦrΥylAδJC (lists)AHɤŪ̦ܤ󪺥t@Ū
   ơAC
   
   ngoؤAzuݭnTԲӻ󪺼DA@̡AAA`
   AΤjɱNJY@C (list)A]tO򵥵YiC
   
2.3 SGML-Tools

   SGML-ToolsiHN@󪺯SWഫzҷQn榡CpznN
   sbzӤH{wAziHন PostScript 榡CpznNzL
   P@ɤɡAiNন HTML 榡Cpzb Windows UŪ
   AziH⥦ন RTF 榡AèϥΤѳnŪCΪ̱z]iHNনWz
   Ҧ榡AHKzɭԨϥΡC
   
   ziqo FTP  [4]ftp://ftp.lip6.fr/pub/sgml-tools/ o SGML-ToolsC
   
3. zĤ@

3.1 q@¤rɤ}l

   pznN@¤rɤন SGML HKANনL榡AkpUG
   
    1. A̶}Yɥ[WUCryPҡG
        <!doctype linuxdoc system>
         <article>
          <title>D (Title) </title>
          <author>
           @̡A@̪qllbAC
          </author>
          <date>
           Τ
          </date>

    2. pGznb}YɺKn󪺤eAбNUCҥΩ󦹬qYG
       <abstract> P </abstract>C
    3. ᴡJo <toc> ҡA SGML-Tools ۷|ܤ󪺥ؿ (Table Of
       Contents)C
    4. AӡAbC@ (chapter) }lAHUCryPҨNC@X
       DG
       <sect>o@D (The Title Of The Chapter)

       Ao@[W </sect> ҡC
        G zݩWo@۹︹XA SGML-Tools ۷|z[WC
    5. HۦPkΩ󱵤UӪ` (section)CzRC@`XA
       H <sect1> ҼЩC@`}YDAΦbC@`ФW
       </sect1>C
    6. bC@`Az]iHϥ <sectn> P </sectn> ҡANhhF 4
       ӼhAC@hϥΦP˪ҡA䤤 n=2,3,  4A̦C
    7. AbC@q (paragraph) }lAJ <p> ҡC
    8. bqApGzݭnjլYǳANϥ <it> P </it> ()A
       <bf> P </bf> ()A <tt> P </tt> (r) ҡC
    9. YnJC (list)AШ̤UC覡G
        ҤlGoO@ӥ|檺CG

         - Ĥ@bo
         - ۲ĤG
         - AӲĤT
         - ĥ|C

       ХHUC覡ӼЩWCCG
        oO@ӥ|檺CG
       <itemize>
       <item>Ĥ@bo
       <item>۲ĤG
       <item>AӲĤT
       <item>tĥ|C
       </itemize>

   10. znbqiY{@AΪ̻ݭnYǦaAШ̤UC
       G
        <verb>
        10 REM AѤѡIoOH
        20 REM ڥHoF覭NFI
        30 PRINT "ڦ^...";
        40 PRINT "@ϥ@ɡC"
        50 INPUT "AqoH ",M$
        60 IF M$="b" THEN PRINT "AoC":GOTO PARADISE
        70 ELSE PRINT "MAO̩IIC":GOTO RICHMOND
        </verb>

   11. ثeAzҾǨ쪺 SGML 榡޳Nwg۷ΡCpzQA[jz
       AziHѦ SGML-Tools ϥΫޡA̭ԺɪФF
       LinuxDoc 󫬺AΡC
       
4. ]w Emacs

4.1 r (Accented Characters)

   pzݭnHkΨLڻyӼgAzϥ 8-bit r (8-bit
   characters)A~iܨ䦳rCo˪]m~iHO Emacs o
   rC
   
   8-bit r
  
   nO Emacs  8-bit rAzNUCO[Jz .emacs ɮסG
       (standard-display-european 1)
       (load-library "iso-syntax")

   pzb@Ӥ䴩 8-bit ׺ݾWϥ EmacsAziHϥ iso-ascii {
   w ((load-library "iso-ascii"))A|O Emacs H̬ۦΦ
   oǤrC
   
  8-bit rJ
  
   pzL\zJrANSDAnM]iӤUC覡
   ӸɱϡG
   
  Iso-acc {w
  
   Emacs iso-acc {wiHzϥ 7-bit LJ 8-bit rC
   
   unNUCO[Jz .emacs ɮסG
      (load-library "iso-acc")

   Mbϥ Emacs ɡA}ұzһݭns誺ɮסAJ Meta-x
   iso-accents-modeC
   
   o˱zYnJk cafe  e ܡAzNiHJ ' MAJ eC`
   AzݥJӤrAAJ۹諸r]פjgΤpg^CH
   UO@ǱziHϥΪG
   
     ' : Acute
   
     ` : Grave
   
     ^ : Circumflex
   
     " : Dieresis
   
     ~ : Tilde, cedilla, PLSOҤl (cf iso-acc.el).
   
     / : b@rW[uAC
   
   pGzuݭnoǭŸ@AO۹諸rANbŸJ
   @ťCҦpAnX l'elephantANJ l ' ť ' e l ' e ... YiC
   
   ziHb iso-acc.el ɮפҦzݭnզXC
   
  Meta 
  
   ziHbYǲ׺ݾWϥ Meta ( Alt) J 8-bit rCҦpAzi
   HJ Meta-i ӿX e oӦrC
   
   ONکҪA Emacs N Meta ΩLXAL{wG]ѳo
   حJ覡C
   
   Lڭ٬OiHHUC覡ӸɱϡG
   
      (global-set-key "\ei" '(lambda () (interactive) (insert ?\351)))
                         _                                      ___

   unNWCO[Jz .emacs ɮפAzNiH Meta-i ӿX eCz]
   iHswqznզXAunzαznr (key) N iAΥTsX
   (code) N 351AAt_ӡANiHoznrCziѦ
   ISO-8859-1 character set oznsXC
   
   `NI Y local modes γ\|swqzrզXC
   
  8-bit SGML r
  
   ϥ SGML ɡAziHQΥ (macros) ӿJrCҦpAnJ e N
   i &eacute;Cq`AݭnŪ SGML γn鳣iHŪ 8-bit rA
   ҥH@볣ΤoإCγ\ǳn餴MLkŪ 8-bit rAo
   zNiHQΤWzFC
   
   @ɭԡAbϥ Emacs ɡAziHQ iso-sgml {wӿJrC
   znNɮצsϺЮɡA]|z 8-bit rন SGML 榡AH
   KzŪC
   
   ҥHFoӵ{wAzNiHbϥ Emacs ɡAPJŪ 8-bit 
   rAƦܤ@Ӥ 8-bit rnA]iHŪzsg 8-bit C
   
   zunNUCr[J .emacs ɮפAzNiHϥΤWz{wG
   
      (setq sgml-mode-hook
      '(lambda () "Defaults for SGML mode."
       (load-library "iso-sgml")))

4.2 SGML Ҧ (SGML mode)

   J .sgml ɡA Emacs q`|۰ʶiJ sgml ҦC pS
   AziHJ Meta-x sgml-mode XʥiJ sgml ҦCΪ̱NUCO[
   J .emacs ɮפӳ]w۰ʶiJG
   
      (setq auto-mode-alist
      (append '(("\.sgml$"  . sgml-mode))
                auto-mode-alist))

   b sgml ҦUAziHܭnpX 8-bit rCpAϥ Meta-x
   sgml-name-8bit-mode ]άO涵ؤW SGML/Toggle 8-bit insertion^A
   ziHܪX 8-bit r榡AάOX SGML 榡]Y &...; 
   ^C
   
   bҦUAz]iHϥ Meta-x sgml-tags-invisible]άO涵ؤW
   SGML/Toggle Tag Visibility^ ӿܬO_né SGML ҡC
   
4.3 PSGML Ҧ (PSGML mode)

   PSGML Ҧbϥ Emacs Us SGML ܦUqC
   
   o [5]psgml-linuxdoc Fpw˳oӼҦAΦpNΦb
   LinuxDocC
   
4.4 LҦ

  Auto-fill mode
  
   b@ҦUAz@ӬqAzq`|J Return HKU@A_
   hz峹qN|۳sALkMCzϥ Return HKU@
   Azqkq`OѮtC
   
   pzU@~JrAbYǽs边UAzNLkݨk
   ɥ~rOC
   
   boΤUAauto-fill ҦiHz勵opCzJWLw]Ȫ70
   CɡAboҦUAzN|۰ʴU@C
   
   UCO auto-fill ҦOAåiN@檺e׽վ㬰80CG
   
       (setq sgml-mode-hook
             '(lambda () "Defaults for SGML mode."
                 (auto-fill-mode)
                 (setq fill-column 80)))

5. Ispell

   pGznbϥ Emacs ɧ@rˬdAziHϥ Ispell MΨ Emacs 
   C
   
5.1 ܱzw] (default dictionaries)

   ziH]w EmacsAϤb}lJY@ɡAK۰ʿܩһݪ]zi
   HܦnXӡ^Cw] (main dictionary) YDnAOP Ispell @_
   o檺CziHܱzһݭnyCĤGӧYOzӤH (personal
   dictionary)AziH]wn Ispell NzbDn̩ҧ䤣쪺ro̡C
   
   pznN Ispell ̪k]w]A÷QαzDؿ (home
   directory) U .ispell-dico-perso ɮק@ӤHAiHb .emacs ɮ
   ̥[JUCOG
   
       (setq sgml-mode-hook
       '(lambda () "Defauts for SGML mode."
       (setq ispell-personal-dictionary "~/.ispell-dico-perso")
       (ispell-change-dictionary "francais")
       ))

5.2 Sw]wӧO

   pGzSΦP@yˬd󪺫rAzi|J@ǧxC
   zb½Ķ峹ɡAzܦig`洫ϥΤPyPC
   
   ެO۰ʳ]wάOʪAڨäM Lisp OpܩһݪDM
   HC]pGzDܡAШӫHiDڡI^
   
   LOAbC@ɮתAunNUCO[J@`AziHwz
   {檺ɮ׭nϥέ@C Ispell }lrˬdɧYiΩҫwG
   
      <!-- Local IspellDict: english -->
      <!-- Local IspellPersDict: ~/emacs/.ispell-english -->

   pzb .emacs ɮ׸̤wg]wFw]嬰kAziHNWzO[J
   zҼg^󪺵AHKϥέ^C
   
5.3 󪺫rˬd

   YnˬdAib󤺥@Bϥ Meta-x ispell-buffer OCz]
   iHˬdYǳrG
   
     * Nnˬdr}Y Ctrl-Spc е (mark) (Yҿת
       mark-set-command)A
     * Mе쨺A
     * AJO Meta-x ispell-region.
       
   Emacs N|}l IspellCJ̩ҨSrɡA{|ܳoӦr]
   q`Hϥܡ^AínDzJUCOG
   
     * spc accepts the word, this time only,
     * i accepts the word and inserts it in your personal dictionary,
     * a accepts the word for this session,
     * A accepts the word for this file, and inserts it in the local file
       dictionary
     * r allows you to correct the word by hand
     * R allows you to correct all the occurrences of the misspelled
       word,
     * x stops the checking, and puts the cursor back in place,
     * X stops the checking and leaves the cursor where it is, letting
       you correct your file; you will be able to continue the
       spell-checking later if you type Meta-x ispell-continue,
     * ? gives you online help.
       
   pG Ispell JA|NoǤr{b@pAC@Ӥr
   eXЩAunJznӦrJXA Ispell N|Hzҿ諸r
   NrC
   
5.4 ӤHPӧOɮ (local file dictionary) 

   i ziHbzӤH夺J@ӷsrA A zbӧOɮ夺
   JsrC
   
   ӧOɮO@ɮ׵ҴJ@tCrεסA Ispell Cˬd
   ɮתrɳ|sŪoCpAzNiHJ@ǥuboSwɮ
   ౵rAӨLɮ׫hivTC
   
   bڬݨӡAڻ{ӤH̦nOΨxs@ǥDҨSrAרO
   ݩUyr]OsrŸ hyphenated r^AΤ@ǳqΪSwW
   ]O Linux^AbӤH夺[JӦhOmWr]ӦnA]o
   ǦrN|Q@@rϥΤF]ziHQpGz Tof [JӤH夺A
   Ispell iN|bUCҤl̡AoӿrG
   
     `When the going gets tof, the tof get going.' Tof Ok Christophe
     WrYgC
     
   ^
   
5.5 Jɪrˬd

   zbJrɡAunzbo ispell-minor-mode ҦUA Ispell N|۰
   zˬdrCnҰʩoҦAJoO Meta-x
   ispell-minor-modeCC Ispell d쪺rɡAN|ͤ@nӴzC
   
   pzıoͤ@nܷФHAunJO Meta-x set-variable RET
   visible-bell RET t RET AzNiHοù{{ӴzCz]iHb
   .emacs ɮ׸̥[JUCO Emacs nG
   
       (setq visible-bell t)

6. @ǧޥ

6.1 ۰ʴJ (header)

   b Emacs UAziHNƥ~ (hook) 󪺰ʧ@]O}@ɮסA
   xsAΰ@ӷsҦA^C
   
   z]iHQ autoinsert {wӰ@ǯSOʧ@Gzb Emacs U}s
   ɮ׮ɡAoӵ{wN|ھɮתݩʨӴJ۲ŪзǭC
   
   Nڭ̪ΡAoзǭNOڭ̻󫬺A (LinuxDoc)ADA@̡A
   aC
   
   Uӧڷ|yzӦp󴡤JoحkCziHJ@ӧtT
   ҪO (template) ɮסAΪ̱z]iH]@] elisp {C
   
  ǥѴJ@ɮ
  
   z}Ҥ@ɮ׮ɡAziD Emacs ۰ʴJAMAŪ
   autoinsert {wƨӫŧiڭ̭nܪ auto-insert-alist Co
   wqFPɮ׫AҭnJCw]ȬOnJɮץb
   ~/insert/ ؿUApGznswq auto-insert-directory ]Oi檺
   C
   
   C@z}Ҥ@s SGML ɮ׮ɡAunb .emacs ɮפ[JUCܡAz
   NiHJ ~/emacs/sgml-insert.sgml ɡG
   
      (add-hook 'find-file-hooks 'auto-insert)
      (load-library "autoinsert")
      (setq auto-insert-directory "~/emacs/")
      (setq auto-insert-alist
            (append '((sgml-mode .  "sgml-insert.sgml"))
                    auto-insert-alist))

   zNiHb ~/emacs/sgml-insert.sgml ɼgJzۭqAMAs
    Emacs Ӷ}ҬY@ foobar.sgml ɮסA Emacs |߰ݱzT{o۰ʴJ
   OӴJznC
   
  ǥѰ@ӵ{
  
   okWzjPpAPOz]w auto-insert-alist AiD
   nJO@Ӱ{AӫD@ɮסCunb .emacs ɮפ[JUC
   ܡANiH۰ʰALMzoo{gb@ӥs
   ~/emacs/sgml-header.el ɮ׸̤~iHC]ųo禡i|LAzݭn
   Nb .emacs ɮ׸̡^G
   
      (add-hook 'find-file-hooks 'auto-insert)
      (load-library "autoinsert")
      (add-to-list 'load-path "~/emacs")
      (load-library "sgml-header")
      (setq auto-insert-alist
            (append '(((sgml-mode .  "SGML Mode") . insert-sgml-header))
                    auto-insert-alist))

   ziHѦ [6]̦ Insert-sgml-header {ҤlC
   
Appendix

7. Insert-sgml-header{d

   Ū̦bg@ Linux Documentation Project ɡAiHϥΤUC{ӱ
   ʦ۰ʴJۭqC
   
   zL@ mini-bufferAWz{|nDŪ̴Ѥ@ǩγ\nTC
   
   |߰ݭnXDOAYzSѡAhN|{DCA
   OA@̡A@̪qllbP home page ]̫ⶵiHNJ^C
   
   ۥ|߰½Ķ̪WrCYLAЪJ ReturnCYA{N|۸
   Ķ̪qllb home page ]Pˤ]OHNJ^C
   
   Aӥ|zJsJ current bufferA]AzJT榡AκKn
   MĤ@ҡCᥦ|NоɦVznJKnaC
   
(defun insert-sgml-header ()
  "Inserts the header for a LinuxDoc document"
  (interactive)
  (let (title author email home translator email-translator home-translator dat
e
              starting-point)
    (setq title (read-from-minibuffer "Title: "))
    (if (> (length title) 0)
        (progn
          (setq date (read-from-minibuffer "Date: ")
                author (read-from-minibuffer "Author: ")
                email (read-from-minibuffer "Author e-mail: ")
                home (read-from-minibuffer "Author home page: http://")
                translator (read-from-minibuffer "Translator: "))
          (insert "<!doctype linuxdoc system>\n<article>\n<title>")
          (insert title)
          (insert "</title>\n<author>\nAuthor: ") (insert author) (insert "<new
line>\n")
          (if (> (length email) 0)
              (progn
                (insert "<htmlurl url=\"mailto:")
                (insert email) (insert "\" name=\"") (insert email)
                (insert "\"><newline>\n")))
          (if (> (length home) 0)
              (progn
                (insert "<htmlurl url=\"http://")
                (insert home) (insert "\" name=\"") (insert home)
                (insert "\">\n<newline>")))
          (if (> (length translator) 0)
              (progn
                (setq email-translator (read-from-minibuffer "Translator e-mail
: ")
                      home-translator (read-from-minibuffer "Translator home pa
ge: http://"))
                (insert "Translator : ")
                (insert translator)
                (insert "<newline>\n")
                (if (> (length email-translator) 0)
                    (progn
                      (insert "<htmlurl url=\"mailto:")
                      (insert email-translator) (insert "\" name=\"")
                      (insert email-translator)
                      (insert "\"><newline>\n")))
                (if (> (length home-translator) 0)
                    (progn
                      (insert "<htmlurl url=\"http://")
                      (insert home-translator) (insert "\" name=\"")
                      (insert home-translator)
                      (insert "\"><newline>\n")))))
          (insert "</author>\n<date>\n")
          (insert date)
          (insert "\n</date>\n\n<abstract>\n")
          (setq point-beginning (point))
          (insert "\n</abstract>\n<toc>\n\n<sect>\n<p>\n\n\n</sect>\n\n</articl
e>\n")
          (goto-char point-beginning)
          ))))

References

   1. mailto:feloy@wanadoo.fr
   2. mailto:Sebastien.Blondeel@lifl.fr
   3. mailto:anshan@hello.com.tw
   4. ftp://ftp.lip6.fr/pub/sgml-tools/
   5. http://www.linux-france.com/article/psgml-linuxdoc
   6. file://localhost/tmp/zh-sgmltools.25528/LinuxDoc+Emacs+Ispell-HOWTO.txt.html#insert-sgml-header
