home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1130 < prev    next >
Internet Message Format  |  1990-12-28  |  47KB

  1. From: howard@hasse.ericsson.se (Howard Gayle)
  2. Newsgroups: alt.sources
  3. Subject: GNU Emacs 8-bit mods part 03 of 12
  4. Message-ID: <1990Apr5.133416.8693@ericsson.se>
  5. Date: 5 Apr 90 13:34:16 GMT
  6.  
  7. #! /bin/sh
  8. # This is a shell archive.  Remove anything before this line, then feed it
  9. # into a shell via "sh file" or similar.  To overwrite existing files,
  10. # type "sh file -c".
  11. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  12. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  13. # If this archive is complete, you will see the following message at the end:
  14. #        "End of archive 3 (of 4)."
  15. # Contents:  lisp/case-table.el lisp/char-table.el lisp/emphasis.el
  16. #   lisp/iso8859-1-ascii.el lisp/term/fa4440a.el lisp/term/fa4440b.el
  17. #   src/casetab.c src/etctab.h
  18. # Wrapped by howard@hasse on Thu Apr  5 15:28:05 1990
  19. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  20. if test -f 'lisp/case-table.el' -a "${1}" != "-c" ; then 
  21.   echo shar: Will not clobber existing file \"'lisp/case-table.el'\"
  22. else
  23. echo shar: Extracting \"'lisp/case-table.el'\" \(6932 characters\)
  24. sed "s/^X//" >'lisp/case-table.el' <<'END_OF_FILE'
  25. X;; Functions for extending the character set and dealing with case tables.
  26. X;; Copyright (C) 1987, 1990 Free Software Foundation, Inc.
  27. X
  28. X;; This file is part of GNU Emacs.
  29. X
  30. X;; GNU Emacs is distributed in the hope that it will be useful,
  31. X;; but WITHOUT ANY WARRANTY.  No author or distributor
  32. X;; accepts responsibility to anyone for the consequences of using it
  33. X;; or for whether it serves any particular purpose or works at all,
  34. X;; unless he says so in writing.  Refer to the GNU Emacs General Public
  35. X;; License for full details.
  36. X
  37. X;; Everyone is granted permission to copy, modify and redistribute
  38. X;; GNU Emacs, but only under the conditions described in the
  39. X;; GNU Emacs General Public License.   A copy of this license is
  40. X;; supposed to have been given to you along with GNU Emacs so you
  41. X;; can know your rights and responsibilities.  It should be in a
  42. X;; file named COPYING.  Among other things, the copyright notice
  43. X;; and this notice must be preserved on all copies.
  44. X
  45. X
  46. X;; Written by:
  47. X;; Howard Gayle
  48. X;; TN/ETX/TT/HL
  49. X;; Ericsson Telecom AB
  50. X;; S-126 25 Stockholm
  51. X;; Sweden
  52. X;; howard@ericsson.se
  53. X;; uunet!ericsson.se!howard
  54. X;; Phone: +46 8 719 5565
  55. X;; FAX  : +46 8 719 8439
  56. X
  57. X(require 'text-mode)
  58. X
  59. X(defun case-of (ch ct)
  60. X   "Return 'nocase if character CH is marked as caseless in
  61. Xcase table CT, 'lowercase for lower case, and 'uppercase for
  62. Xupper case."
  63. X   (cond
  64. X      ((nocase-p ch ct) 'nocase)
  65. X      ((lower-p  ch ct) 'lowercase)
  66. X      (t                'uppercase)
  67. X   )
  68. X)
  69. X
  70. X(defun describe-buffer-case-table ()
  71. X   "Describe the case table of the current buffer."
  72. X   (interactive)
  73. X   (describe-case-table (case-table))
  74. X)
  75. X
  76. X(defun describe-case-table (ct)
  77. X   "Describe the given case table in a help buffer."
  78. X   (let* (
  79. X           (i 0)                   ; First character in range.
  80. X     (ic (case-of 0 ct)) ; Case of i.
  81. X     (j 0)                   ; Last character in range.
  82. X     (jc ic)              ; Case of j.
  83. X     (k 1)                   ; Current character.
  84. X     kc                      ; Case of k.
  85. X           )
  86. X      (with-output-to-temp-buffer "*Help*"
  87. X     (while (<= k 255)
  88. X        (setq kc (case-of k ct))
  89. X        (if (not (eq jc kc))
  90. X           (progn
  91. X          (describe-character i)
  92. X          (if (not (= i j))
  93. X             (progn
  94. X                 (princ "..")
  95. X            (describe-character j)
  96. X             )
  97. X          )
  98. X          (princ "\t")
  99. X          (princ (symbol-name jc))
  100. X          (princ "\n")
  101. X          (setq i k)
  102. X          (setq ic kc)
  103. X           )
  104. X        )
  105. X        (if (= k 255)
  106. X           (progn
  107. X          (describe-character i)
  108. X          (if (not (= i k))
  109. X             (progn
  110. X                 (princ "..")
  111. X            (describe-character k)
  112. X             )
  113. X          )
  114. X          (princ "\t")
  115. X          (princ (symbol-name kc))
  116. X          (princ "\n")
  117. X           )
  118. X        )
  119. X        (setq j k)
  120. X        (setq jc kc)
  121. X        (setq k (1+ k))
  122. X     )
  123. X     (print-help-return-message)
  124. X      )
  125. X   )
  126. X)
  127. X
  128. X(defun describe-character (c)
  129. X   "Print character C readably."
  130. X   (cond
  131. X      ((= c ?\t) (princ "\\t"))
  132. X      ((= c ?\n) (princ "\\n"))
  133. X      (t (princ (char-to-string c)))
  134. X   )
  135. X)
  136. X
  137. X(defun invert-case ()
  138. X   "Change the case of the character just after point."
  139. X   (interactive "*")
  140. X   (let  (
  141. X           (oc (following-char)) ; Old character.
  142. X           )
  143. X      (cond
  144. X           ((lower-p oc) (replace-char (upcase   oc)))
  145. X           ((upper-p oc) (replace-char (downcase oc)))
  146. X      )
  147. X   )
  148. X   (forward-char)
  149. X)
  150. X
  151. X(defun standard-case-syntax-delims (l r)
  152. X   "Set the entries for characters L and R in standard-case-table,
  153. Xstandard-downcase-table, standard-upcase-table,
  154. Xstandard-syntax-table, and text-mode-syntax-table to indicate
  155. Xleft and right delimiters."
  156. X   (set-case-table-nocase l (standard-case-table))
  157. X   (set-case-table-nocase r (standard-case-table))
  158. X   (set-trans-table-to l l (standard-downcase-table))
  159. X   (set-trans-table-to r r (standard-downcase-table))
  160. X   (set-trans-table-to l l (standard-upcase-table))
  161. X   (set-trans-table-to r r (standard-upcase-table))
  162. X   (modify-syntax-entry l
  163. X      (concat "(" (char-to-string r) "  ") (standard-syntax-table))
  164. X   (modify-syntax-entry l
  165. X      (concat "(" (char-to-string r) "  ") text-mode-syntax-table)
  166. X   (modify-syntax-entry r
  167. X      (concat ")" (char-to-string l) "  ") (standard-syntax-table))
  168. X   (modify-syntax-entry r
  169. X      (concat ")" (char-to-string l) "  ") text-mode-syntax-table)
  170. X)
  171. X
  172. X(defun standard-case-syntax-pair (uc lc)
  173. X   "Set the entries for characters UC and LC in
  174. Xstandard-case-table, standard-downcase-table,
  175. Xstandard-upcase-table, standard-case-fold-table, standard-syntax-table, and
  176. Xtext-mode-syntax-table to indicate an (uppercase, lowercase)
  177. Xpair of letters."
  178. X   (set-case-table-pair lc uc (standard-case-table))
  179. X   (set-trans-table-to lc lc (standard-downcase-table))
  180. X   (set-trans-table-to uc lc (standard-downcase-table))
  181. X   (set-trans-table-to lc uc (standard-upcase-table))
  182. X   (set-trans-table-to uc uc (standard-upcase-table))
  183. X   (modify-syntax-entry lc "w   " (standard-syntax-table))
  184. X   (modify-syntax-entry lc "w   " text-mode-syntax-table)
  185. X   (modify-syntax-entry uc "w   " (standard-syntax-table))
  186. X   (modify-syntax-entry uc "w   " text-mode-syntax-table)
  187. X)
  188. X
  189. X(defun standard-case-syntax-punct (c)
  190. X   "Set the entries for character C in standard-case-table,
  191. Xstandard-downcase-table, standard-upcase-table,
  192. Xstandard-syntax-table, and text-mode-syntax-table to indicate
  193. Xpunctuation."
  194. X   (set-case-table-nocase c (standard-case-table))
  195. X   (set-trans-table-to c c (standard-downcase-table))
  196. X   (set-trans-table-to c c (standard-upcase-table))
  197. X   (modify-syntax-entry c ".   " (standard-syntax-table))
  198. X   (modify-syntax-entry c ".   " text-mode-syntax-table)
  199. X)
  200. X
  201. X(defun standard-case-syntax-symb (c)
  202. X   "Set the entries for character C in standard-case-table,
  203. Xstandard-downcase-table, standard-upcase-table,
  204. Xstandard-syntax-table, and text-mode-syntax-table to indicate a
  205. Xsymbol."
  206. X   (set-case-table-nocase c (standard-case-table))
  207. X   (set-trans-table-to c c (standard-downcase-table))
  208. X   (set-trans-table-to c c (standard-upcase-table))
  209. X   (modify-syntax-entry c "_   " (standard-syntax-table))
  210. X   (modify-syntax-entry c "_   " text-mode-syntax-table)
  211. X)
  212. X
  213. X(defun standard-case-syntax-white (c)
  214. X   "Set the entries for character C in standard-case-table,
  215. Xstandard-downcase-table, standard-upcase-table,
  216. Xstandard-syntax-table, and text-mode-syntax-table to indicate
  217. Xwhite space."
  218. X   (set-case-table-nocase c (standard-case-table))
  219. X   (set-trans-table-to c c (standard-downcase-table))
  220. X   (set-trans-table-to c c (standard-upcase-table))
  221. X   (modify-syntax-entry c "    " (standard-syntax-table))
  222. X   (modify-syntax-entry c "    " text-mode-syntax-table)
  223. X)
  224. X
  225. X(defun standard-case-syntax-word (c)
  226. X   "Set the entries for character C in standard-case-table,
  227. Xstandard-downcase-table, standard-upcase-table,
  228. Xstandard-syntax-table, and text-mode-syntax-table to indicate a
  229. Xword component."
  230. X   (set-case-table-nocase c (standard-case-table))
  231. X   (set-trans-table-to c c (standard-downcase-table))
  232. X   (set-trans-table-to c c (standard-upcase-table))
  233. X   (modify-syntax-entry c "w   " (standard-syntax-table))
  234. X   (modify-syntax-entry c "w   " text-mode-syntax-table)
  235. X)
  236. X
  237. X(provide 'case-table)
  238. END_OF_FILE
  239. if test 6932 -ne `wc -c <'lisp/case-table.el'`; then
  240.     echo shar: \"'lisp/case-table.el'\" unpacked with wrong size!
  241. fi
  242. # end of 'lisp/case-table.el'
  243. fi
  244. if test -f 'lisp/char-table.el' -a "${1}" != "-c" ; then 
  245.   echo shar: Will not clobber existing file \"'lisp/char-table.el'\"
  246. else
  247. echo shar: Extracting \"'lisp/char-table.el'\" \(5206 characters\)
  248. sed "s/^X//" >'lisp/char-table.el' <<'END_OF_FILE'
  249. X;; Functions for dealing with char tables.
  250. X;; Copyright (C) 1987 Free Software Foundation, Inc.
  251. X
  252. X;; This file is part of GNU Emacs.
  253. X
  254. X;; GNU Emacs is distributed in the hope that it will be useful,
  255. X;; but WITHOUT ANY WARRANTY.  No author or distributor
  256. X;; accepts responsibility to anyone for the consequences of using it
  257. X;; or for whether it serves any particular purpose or works at all,
  258. X;; unless he says so in writing.  Refer to the GNU Emacs General Public
  259. X;; License for full details.
  260. X
  261. X;; Everyone is granted permission to copy, modify and redistribute
  262. X;; GNU Emacs, but only under the conditions described in the
  263. X;; GNU Emacs General Public License.   A copy of this license is
  264. X;; supposed to have been given to you along with GNU Emacs so you
  265. X;; can know your rights and responsibilities.  It should be in a
  266. X;; file named COPYING.  Among other things, the copyright notice
  267. X;; and this notice must be preserved on all copies.
  268. X
  269. X
  270. X;; Written by Howard Gayle.  See case-table.el for details.
  271. X
  272. X(require 'case-table)
  273. X
  274. X(defun buffer-ctl-arrow-off ()
  275. X   "Display control characters as \\ number in curent buffer.
  276. XDoes not change existing windows."
  277. X   (interactive)
  278. X   (setq buffer-char-table (backslash-char-table))
  279. X)
  280. X
  281. X(defun buffer-ctl-arrow-on ()
  282. X   "Display control characters as ^ character in curent buffer.
  283. XDoes not change existing windows."
  284. X   (interactive)
  285. X   (setq buffer-char-table (ctl-arrow-char-table))
  286. X)
  287. X
  288. X(defun ctl-arrow-off ()
  289. X   "Display control characters as \\ number in selected window."
  290. X   (interactive)
  291. X   (set-window-char-table (backslash-char-table))
  292. X)
  293. X
  294. X(defun ctl-arrow-on ()
  295. X   "Display control characters as ^ character in selected window."
  296. X   (interactive)
  297. X   (set-window-char-table (ctl-arrow-char-table))
  298. X)
  299. X
  300. X(defun default-ctl-arrow-off ()
  301. X   "By default, display control characters as \\ number."
  302. X   (interactive)
  303. X   (setq-default buffer-char-table (backslash-char-table))
  304. X)
  305. X
  306. X(defun default-ctl-arrow-on ()
  307. X   "By default, display control characters as ^ character."
  308. X   (interactive)
  309. X   (setq-default buffer-char-table (ctl-arrow-char-table))
  310. X)
  311. X
  312. X(defun describe-char-table (ct)
  313. X   "Describe the given char table in a help buffer."
  314. X   (let  (
  315. X           (i 0) ; Current character.
  316. X     j     ; Rope index.
  317. X     r     ; Rope.
  318. X     )
  319. X      (with-output-to-temp-buffer "*Help*"
  320. X     (princ "Frame glyf: ")
  321. X     (prin1 (glyf-to-string (get-char-table-frameg ct)))
  322. X     (princ "\nTruncation glyf: ")
  323. X     (prin1 (glyf-to-string (get-char-table-truncg ct)))
  324. X     (princ "\nWrap glyf: ")
  325. X     (prin1 (glyf-to-string (get-char-table-wrapg ct)))
  326. X           (princ "\nSelective display character: ")
  327. X     (describe-character (get-char-table-invisc ct))
  328. X     (princ "\nSelective display rope: ")
  329. X     (setq r (get-char-table-invisr ct))
  330. X     (setq j 0)
  331. X     (while (< j (length r))
  332. X        (aset r j (glyf-to-string (aref r j)))
  333. X        (setq j (1+ j))
  334. X     )
  335. X     (prin1 r)
  336. X     (princ "\n\nCharacter ropes:\n")
  337. X     (while (<= i 255)
  338. X        (describe-character i)
  339. X        (princ "\t")
  340. X        (setq r (get-char-table-dispr ct i))
  341. X        (setq j 0)
  342. X        (while (< j (length r))
  343. X           (aset r j (glyf-to-string (aref r j)))
  344. X           (setq j (1+ j))
  345. X        )
  346. X        (prin1 r)
  347. X        (princ "\n")
  348. X        (setq i (1+ i))
  349. X     )
  350. X     (print-help-return-message)
  351. X      )
  352. X   )
  353. X)
  354. X
  355. X(defun describe-window-char-table ()
  356. X   "Describe the char table of the selected window."
  357. X   (interactive)
  358. X   (describe-char-table (window-char-table (selected-window)))
  359. X)
  360. X
  361. X(defun standard-chars-8bit (l h)
  362. X   "Display characters in the range [L, H] with their actual
  363. Xvalues in backslash-char-table and ctl-arrow-char-table."
  364. X   (let     (r)
  365. X      (while (<= l h)
  366. X           (setq r (vector (new-glyf (char-to-string l))))
  367. X     (put-char-table-dispr (backslash-char-table) l r)
  368. X     (put-char-table-dispr (ctl-arrow-char-table) l r)
  369. X     (setq l (1+ l))
  370. X      )
  371. X      r
  372. X   )
  373. X)
  374. X
  375. X(defun standard-char-ascii (c s)
  376. X   "Display character C with string S in
  377. X   backslash-char-table and ctl-arrow-char-table."
  378. X   (let     ((r (string-to-rope s)))
  379. X      (put-char-table-dispr (backslash-char-table) c r)
  380. X      (put-char-table-dispr (ctl-arrow-char-table) c r)
  381. X   )
  382. Xc
  383. X)
  384. X
  385. X(defun standard-char-g1 (c sc)
  386. X   "Display character C as G1 character SC in
  387. X   backslash-char-table and ctl-arrow-char-table."
  388. X   (let     ((r (vector (new-glyf (concat "\016" (char-to-string sc) "\017")))))
  389. X      (put-char-table-dispr (backslash-char-table) c r)
  390. X      (put-char-table-dispr (ctl-arrow-char-table) c r)
  391. X      r
  392. X   )
  393. X)
  394. X
  395. X(defun string-to-rope (s)
  396. X   "Convert string S to a rope with 1 glyf for each character."
  397. X   (let* (
  398. X         (l (length s))
  399. X         (r (make-vector l nil)) ; The rope.
  400. X         (i 0)                   ; Index.
  401. X         )
  402. X      (while (/= i l)
  403. X         (aset r i (get-glyf (char-to-string (aref s i))))
  404. X         (setq i (1+ i))
  405. X      )
  406. X      r
  407. X   )
  408. X)
  409. X
  410. X(defun toggle-ctl-arrow ()
  411. X   "Toggle display of control characters in selected window."
  412. X   (interactive)
  413. X   (if (eq (window-char-table) (ctl-arrow-char-table))
  414. X      (ctl-arrow-off)
  415. X      (ctl-arrow-on)
  416. X   )
  417. X)
  418. X
  419. X(defun toggle-default-ctl-arrow ()
  420. X   "Toggle default display of control characters."
  421. X   (interactive)
  422. X   (if (eq (default-value 'buffer-char-table) (ctl-arrow-char-table))
  423. X      (default-ctl-arrow-off)
  424. X      (default-ctl-arrow-on)
  425. X   )
  426. X)
  427. X
  428. X(provide 'char-table)
  429. END_OF_FILE
  430. if test 5206 -ne `wc -c <'lisp/char-table.el'`; then
  431.     echo shar: \"'lisp/char-table.el'\" unpacked with wrong size!
  432. fi
  433. # end of 'lisp/char-table.el'
  434. fi
  435. if test -f 'lisp/emphasis.el' -a "${1}" != "-c" ; then 
  436.   echo shar: Will not clobber existing file \"'lisp/emphasis.el'\"
  437. else
  438. echo shar: Extracting \"'lisp/emphasis.el'\" \(5605 characters\)
  439. sed "s/^X//" >'lisp/emphasis.el' <<'END_OF_FILE'
  440. X;; Display characters with emphasis.
  441. X;; Copyright (C) 1987 Free Software Foundation, Inc.
  442. X
  443. X;; This file is part of GNU Emacs.
  444. X
  445. X;; GNU Emacs is distributed in the hope that it will be useful,
  446. X;; but WITHOUT ANY WARRANTY.  No author or distributor
  447. X;; accepts responsibility to anyone for the consequences of using it
  448. X;; or for whether it serves any particular purpose or works at all,
  449. X;; unless he says so in writing.  Refer to the GNU Emacs General Public
  450. X;; License for full details.
  451. X
  452. X;; Everyone is granted permission to copy, modify and redistribute
  453. X;; GNU Emacs, but only under the conditions described in the
  454. X;; GNU Emacs General Public License.   A copy of this license is
  455. X;; supposed to have been given to you along with GNU Emacs so you
  456. X;; can know your rights and responsibilities.  It should be in a
  457. X;; file named COPYING.  Among other things, the copyright notice
  458. X;; and this notice must be preserved on all copies.
  459. X
  460. X
  461. X;; Written by Howard Gayle.  See case-table.el for details.
  462. X
  463. X;; This file uses the char table stuff to display characters
  464. X;; with emphasis, e.g. underlined.  The high order bit is set for
  465. X;; emphasis.  This implies a 7-bit character set, so this file
  466. X;; will not mix with ISO 8859.
  467. X
  468. X(defvar emphasis-char-table nil "Char table where high bit set for emphasis.")
  469. X
  470. X(defvar deemphasize-trans-table nil "Trans table to set high bit.")
  471. X(if deemphasize-trans-table nil
  472. X   (setq deemphasize-trans-table (make-trans-table))
  473. X   (let     (
  474. X           (i 128)
  475. X     )
  476. X      (while (<= i 255)
  477. X           (set-trans-table-to i (- i 128) deemphasize-trans-table)
  478. X           (setq i (1+ i))
  479. X      )
  480. X   )
  481. X)
  482. X
  483. X(defvar emphasize-trans-table nil "Trans table to set high bit.")
  484. X(if emphasize-trans-table nil
  485. X   (setq emphasize-trans-table (make-trans-table))
  486. X   (let     (
  487. X           (i 32)
  488. X     )
  489. X      (while (<= i 127)
  490. X           (set-trans-table-to i (+ i 128) emphasize-trans-table)
  491. X           (setq i (1+ i))
  492. X      )
  493. X   )
  494. X)
  495. X
  496. X(defvar start-emphasis nil "Bytes to terminal to start emphasis.")
  497. X(defvar stop-emphasis  nil "Bytes to terminal to stop emphasis.")
  498. X
  499. X(defun emphasis-on ()
  500. X   "Use emphasis char table in selected window, if possible."
  501. X   (interactive)
  502. X   (init-emphasis-char-table-maybe)
  503. X   (if emphasis-char-table (set-window-char-table emphasis-char-table))
  504. X)
  505. X
  506. X(defun deemphasize-region (b e)
  507. X   "Emphasize the characters in region."
  508. X   (interactive "*r")
  509. X   (translate-region b e deemphasize-trans-table)
  510. X)
  511. X
  512. X
  513. X(defun emphasize-manual-entry ()
  514. X   "Convert backspace underlining and overstriking to emphasis
  515. Xin the current buffer."
  516. X   (interactive)
  517. X   (let  (
  518. X           (buffer-read-only nil)
  519. X     )
  520. X      (init-emphasis-char-table-maybe)
  521. X      (if (and emphasis-char-table
  522. X                 (underline-to-emphasis-region (point-min) (point-max)))
  523. X           (setq buffer-char-table emphasis-char-table)
  524. X      )
  525. X   )
  526. X)
  527. X
  528. X(setq manual-entry-hook 'emphasize-manual-entry)
  529. X
  530. X(defun emphasize-region (b e)
  531. X   "Emphasize the characters in region."
  532. X   (interactive "*r")
  533. X   (translate-region b e emphasize-trans-table)
  534. X)
  535. X
  536. X(defun init-emphasis-char-table ()
  537. X   "Initialize emphasis char table."
  538. X   (interactive)
  539. X   (setq emphasis-char-table (copy-char-table))
  540. X   (let  (
  541. X     (i 0) ; Current character.
  542. X     j     ; Rope index.
  543. X     r     ; Rope.
  544. X     )
  545. X      (while (<= i 127)
  546. X     (setq r (get-char-table-dispr emphasis-char-table i))
  547. X     (setq j 0)
  548. X     (while (< j (length r))
  549. X        (aset r j (get-glyf (concat start-emphasis
  550. X                    (glyf-to-string (aref r j))
  551. X                    stop-emphasis)))
  552. X        (setq j (1+ j))
  553. X     )
  554. X     (put-char-table-dispr emphasis-char-table (+ i 128) r)
  555. X     (setq i (1+ i))
  556. X      )
  557. X   )
  558. X)
  559. X
  560. X(defun init-emphasis-char-table-maybe ()
  561. X   "Initialize emphasis char table if necessary."
  562. X   (cond
  563. X      (emphasis-char-table)
  564. X      ((or (not (stringp start-emphasis))
  565. X     (not (stringp stop-emphasis)))
  566. X     (message "start-emphasis and stop-emphasis must be set."))
  567. X      (t
  568. X     (message "Making emphasis char table...")
  569. X     (init-emphasis-char-table)
  570. X     (message "Making emphasis char table...done")
  571. X      )
  572. X   )
  573. X)
  574. X
  575. X(defun underline-to-emphasis-buffer ()
  576. X   "Convert backspace underlining and overstriking to emphasis
  577. Xin the current buffer."
  578. X   (interactive)
  579. X   (let  (
  580. X           (buffer-read-only nil)
  581. X     )
  582. X      (if (underline-to-emphasis-region (point-min) (point-max))
  583. X           (emphasis-on)
  584. X      )
  585. X   )
  586. X)
  587. X
  588. X(defun underline-to-emphasis-region (b e)
  589. X   "Convert backspace underlining and overstriking to emphasis
  590. Xin the region.  Returns t iff any changes made."
  591. X   (interactive "*r")
  592. X   (let     (
  593. X           (em (make-marker)) ; End marker.
  594. X     fc                     ; Character following backspace.
  595. X     pc                     ; Character preceding backspace.
  596. X     tmp                    ; Temporary.
  597. X     z                      ; Return.
  598. X           )
  599. X      (if (< e b)
  600. X           (progn
  601. X        (setq tmp b)
  602. X        (setq b e)
  603. X        (setq e tmp)
  604. X     )
  605. X      )
  606. X      (move-marker em e)
  607. X      (save-excursion
  608. X           (goto-char b)
  609. X           (while (search-forward "\b" em t)
  610. X              (setq pc (char-after (- (point) 2)))
  611. X        (setq fc (following-char))
  612. X        (cond
  613. X           ((= pc ?_)
  614. X          (forward-char 1)
  615. X          (delete-char -3)
  616. X          (insert (get-trans-table-to fc emphasize-trans-table))
  617. X          (setq z t)
  618. X           )
  619. X           ((= fc ?_)
  620. X          (forward-char 1)
  621. X          (delete-char -3)
  622. X          (insert (get-trans-table-to pc emphasize-trans-table))
  623. X          (setq z t)
  624. X           )
  625. X           ((= pc fc)
  626. X                 (setq tmp (- (point) 2))
  627. X          (forward-char 1)
  628. X          (while (and (= (following-char) ?\b)
  629. X                  (= (char-after (1+ (point))) pc))
  630. X             (forward-char 2)
  631. X          )
  632. X          (delete-region tmp (point))
  633. X          (insert (get-trans-table-to pc emphasize-trans-table))
  634. X          (setq z t)
  635. X           )
  636. X        )
  637. X     )
  638. X      )
  639. X      z
  640. X   )
  641. X)
  642. X
  643. X(provide 'emphasis)
  644. END_OF_FILE
  645. if test 5605 -ne `wc -c <'lisp/emphasis.el'`; then
  646.     echo shar: \"'lisp/emphasis.el'\" unpacked with wrong size!
  647. fi
  648. # end of 'lisp/emphasis.el'
  649. fi
  650. if test -f 'lisp/iso8859-1-ascii.el' -a "${1}" != "-c" ; then 
  651.   echo shar: Will not clobber existing file \"'lisp/iso8859-1-ascii.el'\"
  652. else
  653. echo shar: Extracting \"'lisp/iso8859-1-ascii.el'\" \(6663 characters\)
  654. sed "s/^X//" >'lisp/iso8859-1-ascii.el' <<'END_OF_FILE'
  655. X;; Set up char tables for ISO 8859/1 character set for ASCII terminals.
  656. X;; Copyright (C) 1987 Free Software Foundation, Inc.
  657. X
  658. X;; This file is part of GNU Emacs.
  659. X
  660. X;; GNU Emacs is distributed in the hope that it will be useful,
  661. X;; but WITHOUT ANY WARRANTY.  No author or distributor
  662. X;; accepts responsibility to anyone for the consequences of using it
  663. X;; or for whether it serves any particular purpose or works at all,
  664. X;; unless he says so in writing.  Refer to the GNU Emacs General Public
  665. X;; License for full details.
  666. X
  667. X;; Everyone is granted permission to copy, modify and redistribute
  668. X;; GNU Emacs, but only under the conditions described in the
  669. X;; GNU Emacs General Public License.   A copy of this license is
  670. X;; supposed to have been given to you along with GNU Emacs so you
  671. X;; can know your rights and responsibilities.  It should be in a
  672. X;; file named COPYING.  Among other things, the copyright notice
  673. X;; and this notice must be preserved on all copies.
  674. X
  675. X
  676. X;; Written by Howard Gayle.  See case-table.el for details.
  677. X
  678. X;; This code sets up backslash-char-table and
  679. X;; ctl-arrow-char-table to display ISO 8859/1 characters on plain
  680. X;; ASCII terminals.  The display strings for the characters are
  681. X;; more-or-less based on TeX.
  682. X
  683. X(require 'char-table)
  684. X
  685. X(standard-char-ascii 160 "{_}")   ; NBSP (no-break space)
  686. X(standard-char-ascii 161 "{!}")   ; inverted exclamation mark
  687. X(standard-char-ascii 162 "{c}")   ; cent sign
  688. X(standard-char-ascii 163 "{GBP}") ; pound sign
  689. X(standard-char-ascii 164 "{$}")   ; general currency sign
  690. X(standard-char-ascii 165 "{JPY}") ; yen sign
  691. X(standard-char-ascii 166 "{|}")   ; broken vertical line
  692. X(standard-char-ascii 167 "{S}")   ; section sign
  693. X(standard-char-ascii 168 "{\"}")  ; diaeresis
  694. X(standard-char-ascii 169 "{C}")   ; copyright sign
  695. X(standard-char-ascii 170 "{_a}")  ; ordinal indicator, feminine
  696. X(standard-char-ascii 171 "{<<}")  ; left angle quotation mark
  697. X(standard-char-ascii 172 "{~}")   ; not sign
  698. X(standard-char-ascii 173 "{-}")   ; soft hyphen
  699. X(standard-char-ascii 174 "{R}")   ; registered sign
  700. X(standard-char-ascii 175 "{=}")   ; macron
  701. X(standard-char-ascii 176 "{o}")   ; degree sign
  702. X(standard-char-ascii 177 "{+-}")  ; plus or minus sign
  703. X(standard-char-ascii 178 "{2}")   ; superscript two
  704. X(standard-char-ascii 179 "{3}")   ; superscript three
  705. X(standard-char-ascii 180 "{'}")   ; acute accent
  706. X(standard-char-ascii 181 "{u}")   ; micro sign
  707. X(standard-char-ascii 182 "{P}")   ; pilcrow
  708. X(standard-char-ascii 183 "{.}")   ; middle dot
  709. X(standard-char-ascii 184 "{,}")   ; cedilla
  710. X(standard-char-ascii 185 "{1}")   ; superscript one
  711. X(standard-char-ascii 186 "{_o}")  ; ordinal indicator, masculine
  712. X(standard-char-ascii 187 "{>>}")  ; right angle quotation mark
  713. X(standard-char-ascii 188 "{1/4}") ; fraction one-quarter
  714. X(standard-char-ascii 189 "{1/2}") ; fraction one-half
  715. X(standard-char-ascii 190 "{3/4}") ; fraction three-quarters
  716. X(standard-char-ascii 191 "{?}")   ; inverted question mark
  717. X(standard-char-ascii 192 "{`A}")  ; A with grave accent
  718. X(standard-char-ascii 193 "{'A}")  ; A with acute accent
  719. X(standard-char-ascii 194 "{^A}")  ; A with circumflex accent
  720. X(standard-char-ascii 195 "{~A}")  ; A with tilde
  721. X(standard-char-ascii 196 "{\"A}") ; A with diaeresis or umlaut mark
  722. X(standard-char-ascii 197 "{AA}")  ; A with ring
  723. X(standard-char-ascii 198 "{AE}")  ; AE diphthong
  724. X(standard-char-ascii 199 "{,C}")  ; C with cedilla
  725. X(standard-char-ascii 200 "{`E}")  ; E with grave accent
  726. X(standard-char-ascii 201 "{'E}")  ; E with acute accent
  727. X(standard-char-ascii 202 "{^E}")  ; E with circumflex accent
  728. X(standard-char-ascii 203 "{\"E}") ; E with diaeresis or umlaut mark
  729. X(standard-char-ascii 204 "{`I}")  ; I with grave accent
  730. X(standard-char-ascii 205 "{'I}")  ; I with acute accent
  731. X(standard-char-ascii 206 "{^I}")  ; I with circumflex accent
  732. X(standard-char-ascii 207 "{\"I}") ; I with diaeresis or umlaut mark
  733. X(standard-char-ascii 208 "{-D}")  ; D with stroke, Icelandic eth
  734. X(standard-char-ascii 209 "{~N}")  ; N with tilde
  735. X(standard-char-ascii 210 "{`O}")  ; O with grave accent
  736. X(standard-char-ascii 211 "{'O}")  ; O with acute accent
  737. X(standard-char-ascii 212 "{^O}")  ; O with circumflex accent
  738. X(standard-char-ascii 213 "{~O}")  ; O with tilde
  739. X(standard-char-ascii 214 "{\"O}") ; O with diaeresis or umlaut mark
  740. X(standard-char-ascii 215 "{x}")   ; multiplication sign
  741. X(standard-char-ascii 216 "{/O}")  ; O with slash
  742. X(standard-char-ascii 217 "{`U}")  ; U with grave accent
  743. X(standard-char-ascii 218 "{'U}")  ; U with acute accent
  744. X(standard-char-ascii 219 "{^U}")  ; U with circumflex accent
  745. X(standard-char-ascii 220 "{\"U}") ; U with diaeresis or umlaut mark
  746. X(standard-char-ascii 221 "{'Y}")  ; Y with acute accent
  747. X(standard-char-ascii 222 "{TH}")  ; capital thorn, Icelandic
  748. X(standard-char-ascii 223 "{ss}")  ; small sharp s, German
  749. X(standard-char-ascii 224 "{`a}")  ; a with grave accent
  750. X(standard-char-ascii 225 "{'a}")  ; a with acute accent
  751. X(standard-char-ascii 226 "{^a}")  ; a with circumflex accent
  752. X(standard-char-ascii 227 "{~a}")  ; a with tilde
  753. X(standard-char-ascii 228 "{\"a}") ; a with diaeresis or umlaut mark
  754. X(standard-char-ascii 229 "{aa}")  ; a with ring
  755. X(standard-char-ascii 230 "{ae}")  ; ae diphthong
  756. X(standard-char-ascii 231 "{,c}")  ; c with cedilla
  757. X(standard-char-ascii 232 "{`e}")  ; e with grave accent
  758. X(standard-char-ascii 233 "{'e}")  ; e with acute accent
  759. X(standard-char-ascii 234 "{^e}")  ; e with circumflex accent
  760. X(standard-char-ascii 235 "{\"e}") ; e with diaeresis or umlaut mark
  761. X(standard-char-ascii 236 "{`i}")  ; i with grave accent
  762. X(standard-char-ascii 237 "{'i}")  ; i with acute accent
  763. X(standard-char-ascii 238 "{^i}")  ; i with circumflex accent
  764. X(standard-char-ascii 239 "{\"i}") ; i with diaeresis or umlaut mark
  765. X(standard-char-ascii 240 "{-d}")  ; d with stroke, Icelandic eth
  766. X(standard-char-ascii 241 "{~n}")  ; n with tilde
  767. X(standard-char-ascii 242 "{`o}")  ; o with grave accent
  768. X(standard-char-ascii 243 "{'o}")  ; o with acute accent
  769. X(standard-char-ascii 244 "{^o}")  ; o with circumflex accent
  770. X(standard-char-ascii 245 "{~o}")  ; o with tilde
  771. X(standard-char-ascii 246 "{\"o}") ; o with diaeresis or umlaut mark
  772. X(standard-char-ascii 247 "{/}")   ; division sign
  773. X(standard-char-ascii 248 "{/o}")  ; o with slash
  774. X(standard-char-ascii 249 "{`u}")  ; u with grave accent
  775. X(standard-char-ascii 250 "{'u}")  ; u with acute accent
  776. X(standard-char-ascii 251 "{^u}")  ; u with circumflex accent
  777. X(standard-char-ascii 252 "{\"u}") ; u with diaeresis or umlaut mark
  778. X(standard-char-ascii 253 "{'y}")  ; y with acute accent
  779. X(standard-char-ascii 254 "{th}")  ; small thorn, Icelandic
  780. X(standard-char-ascii 255 "{\"y}") ; small y with diaeresis or umlaut mark
  781. X
  782. X(provide 'iso8859-1-ascii)
  783. END_OF_FILE
  784. if test 6663 -ne `wc -c <'lisp/iso8859-1-ascii.el'`; then
  785.     echo shar: \"'lisp/iso8859-1-ascii.el'\" unpacked with wrong size!
  786. fi
  787. # end of 'lisp/iso8859-1-ascii.el'
  788. fi
  789. if test -f 'lisp/term/fa4440a.el' -a "${1}" != "-c" ; then 
  790.   echo shar: Will not clobber existing file \"'lisp/term/fa4440a.el'\"
  791. else
  792. echo shar: Extracting \"'lisp/term/fa4440a.el'\" \(4902 characters\)
  793. sed "s/^X//" >'lisp/term/fa4440a.el' <<'END_OF_FILE'
  794. X;;; Set up Facit 4440 (Twist) terminal.
  795. X
  796. X;; Map Twist function key escape sequences
  797. X;; into the standard slots in function-keymap.
  798. X
  799. X(require 'keypad)
  800. X
  801. X(keypad-default "p" 'redraw-screen-72-lines)
  802. X(keypad-default "q" 'redraw-screen-24-lines)
  803. X
  804. X(defvar CSI-map nil
  805. X  "The CSI-map maps the CSI function keys on the Twist keyboard.
  806. XThe CSI keys are the arrow keys.")
  807. X
  808. X(if (not CSI-map)
  809. X    (progn
  810. X     (setq CSI-map (lookup-key global-map "\e["))
  811. X     (if (not (keymapp CSI-map))
  812. X     (setq CSI-map (make-sparse-keymap)))  ;; <ESC>[ commands
  813. X     (setup-terminal-keymap CSI-map '(
  814. X        ("A"   . ?u) ; up arrow
  815. X    ("B"   . ?d) ; down-arrow
  816. X    ("C"   . ?r) ; right-arrow
  817. X    ("D"   . ?l) ; left-arrow
  818. X    ("H"   . ?h) ; home
  819. X    ("J"   . ?C) ; shift-erase = clear screen
  820. X    ("K"   . ?c) ; erase
  821. X    ("L"   . ?A) ; insert line
  822. X    ("M"   . ?L) ; delete line
  823. X    ("P"   . ?D) ; delete character
  824. X    ("U"   . ?N) ; shift-down-arrow = next page
  825. X    ("V"   . ?P) ; shift-up-arrow = previous page
  826. X    ("X"   . ?H) ; shift-home = home-down
  827. X    ("Z"   . ?b) ; tabulation backward
  828. X    ("4h"  . ?I) ; insert character
  829. X    ("?Ln" . ?q) ; landscape mode
  830. X    ("?Pn" . ?p) ; portrait mode
  831. X))))
  832. X
  833. X(defun enable-arrow-keys ()
  834. X  "Enable the use of the Twist arrow keys for cursor motion.
  835. XBecause of the nature of the Twist, this unavoidably breaks
  836. Xthe standard Emacs command ESC [; therefore, it is not done by default,
  837. Xbut only if you give this command."
  838. X  (interactive)
  839. X  (global-set-key "\e[" CSI-map)
  840. X  (send-string-to-terminal "\e[?1n") ; Landscape or portrait?
  841. X)
  842. X
  843. X(defvar SS3a-map nil
  844. X  "SS3a-map maps the SS3 function keys on the Twist keyboard.
  845. XThe SS3 keys are the numeric keypad keys in keypad application mode
  846. X\(DECKPAM).  SS3 is DEC's name for the sequence <ESC>O which is
  847. Xthe common prefix of what these keys transmit.")
  848. X
  849. X(if (not SS3a-map)
  850. X    (progn
  851. X     (setq SS3a-map (lookup-key global-map "\eO"))
  852. X     (if (not (keymapp SS3a-map))
  853. X     (setq SS3a-map (make-keymap)))  ;; <ESC>O commands
  854. X     (setup-terminal-keymap SS3a-map
  855. X        '(("A" . ?u)       ; up arrow
  856. X          ("B" . ?d)       ; down-arrow
  857. X          ("C" . ?r)       ; right-arrow
  858. X          ("D" . ?l)       ; left-arrow
  859. X          ("M" . ?e)       ; Enter
  860. X          ("P" . ?\C-a)       ; PF1
  861. X          ("Q" . ?\C-b)       ; PF2
  862. X          ("R" . ?\C-c)       ; PF3
  863. X          ("S" . ?\C-d)       ; PF4
  864. X          ("l" . ?,)       ; ,
  865. X          ("m" . ?-)       ; -
  866. X          ("n" . ?.)       ; .
  867. X          ("p" . ?0)       ; 0
  868. X          ("q" . ?1)       ; 1
  869. X          ("r" . ?2)       ; 2
  870. X          ("s" . ?3)       ; 3
  871. X          ("t" . ?4)       ; 4
  872. X          ("u" . ?5)       ; 5
  873. X          ("v" . ?6)       ; 6
  874. X          ("w" . ?7)       ; 7
  875. X          ("x" . ?8)       ; 8
  876. X          ("y" . ?9)))))       ; 9
  877. X
  878. X(defun keypad-application-mode ()
  879. X  "Switch on keypad application mode."
  880. X  (interactive)
  881. X  (send-string-to-terminal "\e=")
  882. X  (global-set-key "\eO" SS3a-map))
  883. X
  884. X(defvar SS3n-map nil
  885. X  "SS3n-map maps the SS3 function keys on the Twist keyboard.
  886. XThe SS3 keys are the numeric keypad keys in keypad numeric mode
  887. X\(DECKPAM).  SS3 is DEC's name for the sequence <ESC>O which is
  888. Xthe common prefix of what these keys transmit.")
  889. X
  890. X(if (not SS3n-map)
  891. X    (progn
  892. X     (setq SS3n-map (lookup-key global-map "\eO"))
  893. X     (if (not (keymapp SS3n-map))
  894. X     (setq SS3n-map (make-sparse-keymap)))  ;; <ESC>O commands
  895. X     (setup-terminal-keymap SS3n-map '(
  896. X          ("P" . ?\C-a)       ; PF1
  897. X          ("Q" . ?\C-b)       ; PF2
  898. X          ("R" . ?\C-c)       ; PF3
  899. X          ("S" . ?\C-d)       ; PF4
  900. X     ))
  901. X    (global-set-key "\eO" SS3n-map)
  902. X))
  903. X
  904. X(if (fboundp 'get-glyf)
  905. X   (progn
  906. X      (require 'iso8859-1-swedish)
  907. X      (require 'char-table-vt100)
  908. X      (send-string-to-terminal "\e)B\e)1") ; Select Swedish letters as G1 set.
  909. X      (standard-char-underline 170 ?a) ; ordinal indicator, feminine
  910. X      (standard-char-graphic   176 125); degree sign
  911. X      (standard-char-graphic   177 ?~) ; plus or minus sign
  912. X      (standard-char-graphic   183 ?g) ; middle dot
  913. X      (standard-char-underline 186 ?o) ; ordinal indicator, masculine
  914. X      (standard-frameg-graphic ?x)     ; Vertical bar.
  915. X      (standard-truncg-graphic ?t)     ; Left T.
  916. X      (standard-wrapg-graphic  ?k)     ; Upper right corner.
  917. X   )
  918. X)
  919. X
  920. X(defun redraw-screen-24-lines ()
  921. X   "This function is intended for use with Facit Twist terminals.
  922. XIt should be bound to \"C-[[?Ln\", which is what the terminal transmits
  923. Xwhen it is twisted into landscape mode.  The terminal must also have
  924. Xthe Display Report switch (custom setup 4, group 1, switch 3) set to
  925. XAuto."
  926. X   (interactive)
  927. X   (set-screen-height 24))
  928. X   
  929. X(defun redraw-screen-72-lines ()
  930. X   "This function is intended for use with Facit Twist terminals.
  931. XIt should be bound to \"C-[[?Pn\", which is what the terminal transmits
  932. Xwhen it is twisted into portrait mode.  The terminal must also have
  933. Xthe Display Report switch (custom setup 4, group 1, switch 3) set to
  934. XAuto."
  935. X   (interactive)
  936. X   (send-string-to-terminal "\e[r")
  937. X   (set-screen-height 72))
  938. X
  939. X(setq start-emphasis "\e[4m") ; Underline on.
  940. X(setq stop-emphasis  "\e[m")  ; Underline off.
  941. END_OF_FILE
  942. if test 4902 -ne `wc -c <'lisp/term/fa4440a.el'`; then
  943.     echo shar: \"'lisp/term/fa4440a.el'\" unpacked with wrong size!
  944. fi
  945. # end of 'lisp/term/fa4440a.el'
  946. fi
  947. if test -f 'lisp/term/fa4440b.el' -a "${1}" != "-c" ; then 
  948.   echo shar: Will not clobber existing file \"'lisp/term/fa4440b.el'\"
  949. else
  950. echo shar: Extracting \"'lisp/term/fa4440b.el'\" \(4902 characters\)
  951. sed "s/^X//" >'lisp/term/fa4440b.el' <<'END_OF_FILE'
  952. X;;; Set up Facit 4440 (Twist) terminal.
  953. X
  954. X;; Map Twist function key escape sequences
  955. X;; into the standard slots in function-keymap.
  956. X
  957. X(require 'keypad)
  958. X
  959. X(keypad-default "p" 'redraw-screen-72-lines)
  960. X(keypad-default "q" 'redraw-screen-24-lines)
  961. X
  962. X(defvar CSI-map nil
  963. X  "The CSI-map maps the CSI function keys on the Twist keyboard.
  964. XThe CSI keys are the arrow keys.")
  965. X
  966. X(if (not CSI-map)
  967. X    (progn
  968. X     (setq CSI-map (lookup-key global-map "\e["))
  969. X     (if (not (keymapp CSI-map))
  970. X     (setq CSI-map (make-sparse-keymap)))  ;; <ESC>[ commands
  971. X     (setup-terminal-keymap CSI-map '(
  972. X        ("A"   . ?u) ; up arrow
  973. X    ("B"   . ?d) ; down-arrow
  974. X    ("C"   . ?r) ; right-arrow
  975. X    ("D"   . ?l) ; left-arrow
  976. X    ("H"   . ?h) ; home
  977. X    ("J"   . ?C) ; shift-erase = clear screen
  978. X    ("K"   . ?c) ; erase
  979. X    ("L"   . ?A) ; insert line
  980. X    ("M"   . ?L) ; delete line
  981. X    ("P"   . ?D) ; delete character
  982. X    ("U"   . ?N) ; shift-down-arrow = next page
  983. X    ("V"   . ?P) ; shift-up-arrow = previous page
  984. X    ("X"   . ?H) ; shift-home = home-down
  985. X    ("Z"   . ?b) ; tabulation backward
  986. X    ("4h"  . ?I) ; insert character
  987. X    ("?Ln" . ?q) ; landscape mode
  988. X    ("?Pn" . ?p) ; portrait mode
  989. X))))
  990. X
  991. X(defun enable-arrow-keys ()
  992. X  "Enable the use of the Twist arrow keys for cursor motion.
  993. XBecause of the nature of the Twist, this unavoidably breaks
  994. Xthe standard Emacs command ESC [; therefore, it is not done by default,
  995. Xbut only if you give this command."
  996. X  (interactive)
  997. X  (global-set-key "\e[" CSI-map)
  998. X  (send-string-to-terminal "\e[?1n") ; Landscape or portrait?
  999. X)
  1000. X
  1001. X(defvar SS3a-map nil
  1002. X  "SS3a-map maps the SS3 function keys on the Twist keyboard.
  1003. XThe SS3 keys are the numeric keypad keys in keypad application mode
  1004. X\(DECKPAM).  SS3 is DEC's name for the sequence <ESC>O which is
  1005. Xthe common prefix of what these keys transmit.")
  1006. X
  1007. X(if (not SS3a-map)
  1008. X    (progn
  1009. X     (setq SS3a-map (lookup-key global-map "\eO"))
  1010. X     (if (not (keymapp SS3a-map))
  1011. X     (setq SS3a-map (make-keymap)))  ;; <ESC>O commands
  1012. X     (setup-terminal-keymap SS3a-map
  1013. X        '(("A" . ?u)       ; up arrow
  1014. X          ("B" . ?d)       ; down-arrow
  1015. X          ("C" . ?r)       ; right-arrow
  1016. X          ("D" . ?l)       ; left-arrow
  1017. X          ("M" . ?e)       ; Enter
  1018. X          ("P" . ?\C-a)       ; PF1
  1019. X          ("Q" . ?\C-b)       ; PF2
  1020. X          ("R" . ?\C-c)       ; PF3
  1021. X          ("S" . ?\C-d)       ; PF4
  1022. X          ("l" . ?,)       ; ,
  1023. X          ("m" . ?-)       ; -
  1024. X          ("n" . ?.)       ; .
  1025. X          ("p" . ?0)       ; 0
  1026. X          ("q" . ?1)       ; 1
  1027. X          ("r" . ?2)       ; 2
  1028. X          ("s" . ?3)       ; 3
  1029. X          ("t" . ?4)       ; 4
  1030. X          ("u" . ?5)       ; 5
  1031. X          ("v" . ?6)       ; 6
  1032. X          ("w" . ?7)       ; 7
  1033. X          ("x" . ?8)       ; 8
  1034. X          ("y" . ?9)))))       ; 9
  1035. X
  1036. X(defun keypad-application-mode ()
  1037. X  "Switch on keypad application mode."
  1038. X  (interactive)
  1039. X  (send-string-to-terminal "\e=")
  1040. X  (global-set-key "\eO" SS3a-map))
  1041. X
  1042. X(defvar SS3n-map nil
  1043. X  "SS3n-map maps the SS3 function keys on the Twist keyboard.
  1044. XThe SS3 keys are the numeric keypad keys in keypad numeric mode
  1045. X\(DECKPAM).  SS3 is DEC's name for the sequence <ESC>O which is
  1046. Xthe common prefix of what these keys transmit.")
  1047. X
  1048. X(if (not SS3n-map)
  1049. X    (progn
  1050. X     (setq SS3n-map (lookup-key global-map "\eO"))
  1051. X     (if (not (keymapp SS3n-map))
  1052. X     (setq SS3n-map (make-sparse-keymap)))  ;; <ESC>O commands
  1053. X     (setup-terminal-keymap SS3n-map '(
  1054. X          ("P" . ?\C-a)       ; PF1
  1055. X          ("Q" . ?\C-b)       ; PF2
  1056. X          ("R" . ?\C-c)       ; PF3
  1057. X          ("S" . ?\C-d)       ; PF4
  1058. X     ))
  1059. X    (global-set-key "\eO" SS3n-map)
  1060. X))
  1061. X
  1062. X(if (fboundp 'get-glyf)
  1063. X   (progn
  1064. X      (require 'iso8859-1-swedish)
  1065. X      (require 'char-table-vt100)
  1066. X      (send-string-to-terminal "\e)B\e)1") ; Select Swedish letters as G1 set.
  1067. X      (standard-char-underline 170 ?a) ; ordinal indicator, feminine
  1068. X      (standard-char-graphic   176 125); degree sign
  1069. X      (standard-char-graphic   177 ?~) ; plus or minus sign
  1070. X      (standard-char-graphic   183 ?g) ; middle dot
  1071. X      (standard-char-underline 186 ?o) ; ordinal indicator, masculine
  1072. X      (standard-frameg-graphic ?x)     ; Vertical bar.
  1073. X      (standard-truncg-graphic ?t)     ; Left T.
  1074. X      (standard-wrapg-graphic  ?k)     ; Upper right corner.
  1075. X   )
  1076. X)
  1077. X
  1078. X(defun redraw-screen-24-lines ()
  1079. X   "This function is intended for use with Facit Twist terminals.
  1080. XIt should be bound to \"C-[[?Ln\", which is what the terminal transmits
  1081. Xwhen it is twisted into landscape mode.  The terminal must also have
  1082. Xthe Display Report switch (custom setup 4, group 1, switch 3) set to
  1083. XAuto."
  1084. X   (interactive)
  1085. X   (set-screen-height 24))
  1086. X   
  1087. X(defun redraw-screen-72-lines ()
  1088. X   "This function is intended for use with Facit Twist terminals.
  1089. XIt should be bound to \"C-[[?Pn\", which is what the terminal transmits
  1090. Xwhen it is twisted into portrait mode.  The terminal must also have
  1091. Xthe Display Report switch (custom setup 4, group 1, switch 3) set to
  1092. XAuto."
  1093. X   (interactive)
  1094. X   (send-string-to-terminal "\e[r")
  1095. X   (set-screen-height 72))
  1096. X
  1097. X(setq start-emphasis "\e[4m") ; Underline on.
  1098. X(setq stop-emphasis  "\e[m")  ; Underline off.
  1099. END_OF_FILE
  1100. if test 4902 -ne `wc -c <'lisp/term/fa4440b.el'`; then
  1101.     echo shar: \"'lisp/term/fa4440b.el'\" unpacked with wrong size!
  1102. fi
  1103. # end of 'lisp/term/fa4440b.el'
  1104. fi
  1105. if test -f 'src/casetab.c' -a "${1}" != "-c" ; then 
  1106.   echo shar: Will not clobber existing file \"'src/casetab.c'\"
  1107. else
  1108. echo shar: Extracting \"'src/casetab.c'\" \(5975 characters\)
  1109. sed "s/^X//" >'src/casetab.c' <<'END_OF_FILE'
  1110. X/* GNU Emacs routines to deal with case tables.
  1111. X   Copyright (C) 1987 Free Software Foundation, Inc.
  1112. X
  1113. XThis file is part of GNU Emacs.
  1114. X
  1115. XGNU Emacs is distributed in the hope that it will be useful,
  1116. Xbut WITHOUT ANY WARRANTY.  No author or distributor
  1117. Xaccepts responsibility to anyone for the consequences of using it
  1118. Xor for whether it serves any particular purpose or works at all,
  1119. Xunless he says so in writing.  Refer to the GNU Emacs General Public
  1120. XLicense for full details.
  1121. X
  1122. XEveryone is granted permission to copy, modify and redistribute
  1123. XGNU Emacs, but only under the conditions described in the
  1124. XGNU Emacs General Public License.   A copy of this license is
  1125. Xsupposed to have been given to you along with GNU Emacs so you
  1126. Xcan know your rights and responsibilities.  It should be in a
  1127. Xfile named COPYING.  Among other things, the copyright notice
  1128. Xand this notice must be preserved on all copies.  */
  1129. X
  1130. X/* Written by Howard Gayle.  See chartab.c for details. */
  1131. X
  1132. X#include "config.h"
  1133. X#include "lisp.h"
  1134. X#include "buffer.h"
  1135. X#include "casetab.h"
  1136. X#include "etctab.h"
  1137. X
  1138. XLisp_Object Qcase_table_p;
  1139. XDEFUN ("case-table-p", Fcase_table_p, Scase_table_p, 1, 1, 0,
  1140. X   "Return t iff ARG is a case table.")
  1141. X(obj)
  1142. XLisp_Object obj;
  1143. X{
  1144. Xreturn ((XTYPE (obj) == Lisp_Casetab) ? Qt : Qnil);
  1145. X}
  1146. X
  1147. Xstatic Lisp_Object
  1148. Xcheck_case_table (obj)
  1149. XLisp_Object obj;
  1150. X{
  1151. Xregister Lisp_Object tem;
  1152. X
  1153. Xwhile (tem = Fcase_table_p (obj), NULL (tem))
  1154. X   obj = wrong_type_argument (Qcase_table_p, obj, 0);
  1155. Xreturn (obj);
  1156. X}   
  1157. X
  1158. X/* Convert the given Lisp_Casetab to a Lisp_Object. */
  1159. Xstatic Lisp_Object
  1160. Xenlisp_case_table (sp)
  1161. Xstruct Lisp_Casetab *sp;
  1162. X{
  1163. Xregister Lisp_Object z; /* Return. */
  1164. X
  1165. XXSET (z, Lisp_Casetab, sp);
  1166. Xreturn (z);
  1167. X}
  1168. X
  1169. XDEFUN ("case-table", Fcase_table, Scase_table, 0, 0, 0,
  1170. X   "Return the case table of the current buffer.")
  1171. X()
  1172. X{
  1173. Xreturn (enlisp_case_table (bf_cur->case_table_v));
  1174. X}
  1175. X
  1176. XDEFUN ("standard-case-table", Fstandard_case_table,
  1177. X   Sstandard_case_table, 0, 0, 0,
  1178. X   "Return the standard case table.\n\
  1179. XThis is the one used for new buffers.")
  1180. X()
  1181. X{
  1182. Xreturn (enlisp_case_table (buffer_defaults.case_table_v));
  1183. X}
  1184. X
  1185. X/* Extract the case table from the given Lisp object.  Check for errors. */
  1186. Xstatic struct Lisp_Casetab *
  1187. Xget_case_table_arg (obj)
  1188. Xregister Lisp_Object obj;
  1189. X{
  1190. Xif (NULL (obj)) return (bf_cur->case_table_v);
  1191. Xobj = check_case_table (obj);
  1192. Xreturn (XCASETAB (obj));
  1193. X}
  1194. X
  1195. X/* Store a case table.  Check for errors. */
  1196. Xstatic Lisp_Object
  1197. Xset_case_table (p, t)
  1198. Xstruct Lisp_Casetab **p; /* Points to where to store the case table. */
  1199. Xregister Lisp_Object  t; /* The case table as a Lisp object. */
  1200. X{
  1201. Xt = check_case_table (t);
  1202. X*p = XCASETAB (t);
  1203. Xreturn (t);
  1204. X}
  1205. X
  1206. XDEFUN ("set-case-table", Fset_case_table, Sset_case_table, 1, 1, 0,
  1207. X   "Select a new case table for the current buffer.\n\
  1208. XOne argument, a case table.")
  1209. X(table)
  1210. XLisp_Object table;
  1211. X{
  1212. Xreturn (set_case_table (&bf_cur->case_table_v, table));
  1213. X}
  1214. X
  1215. XDEFUN ("set-standard-case-table",
  1216. X   Fset_standard_case_table, Sset_standard_case_table, 1, 1, 0,
  1217. X   "Select a new standard case table.  This does not change the\n\
  1218. Xcase tables of any existing buffers.  One argument, a case table.")
  1219. X(table)
  1220. XLisp_Object table;
  1221. X{
  1222. Xreturn (set_case_table (&buffer_defaults.case_table_v, table));
  1223. X}
  1224. X
  1225. XDEFUN ("make-case-table", Fmake_case_table, Smake_case_table, 0, 0, 0,
  1226. X   "Make a new case table.  All characters are caseless.")
  1227. X()
  1228. X{
  1229. Xregister struct Lisp_Casetab *nt; /* New case table. */
  1230. Xregister int                      i;
  1231. Xregister Lisp_Object           z;  /* Return. */
  1232. X
  1233. Xz = make_etc_table (sizeof (struct Lisp_Casetab), Lisp_Casetab);
  1234. Xnt = XCASETAB (z);
  1235. Xfor (i = 0; i <= 255; ++i)
  1236. X   nt->cas_case[i] = nocase_e;
  1237. Xreturn (z);
  1238. X}
  1239. X
  1240. XDEFUN ("nocase-p", Fnocase_p, Snocase_p, 1, 2, 0,
  1241. X   "Return t iff character CHAR is caseless, according to case\n\
  1242. Xtable TABLE.")
  1243. X(ch, table)
  1244. XLisp_Object ch;
  1245. XLisp_Object table;
  1246. X{
  1247. Xreturn (CASETAB_ISNOCASE (get_char_arg (ch), get_case_table_arg (table))
  1248. X        ? Qt : Qnil);
  1249. X}
  1250. X
  1251. XDEFUN ("lower-p", Flower_p, Slower_p, 1, 2, 0,
  1252. X   "Return t iff character CHAR is lower case, according to case\n\
  1253. Xtable TABLE (default (case-table)).")
  1254. X(ch, table)
  1255. XLisp_Object ch;
  1256. XLisp_Object table;
  1257. X{
  1258. Xreturn (CASETAB_ISLOWER (get_char_arg (ch), get_case_table_arg (table))
  1259. X        ? Qt : Qnil);
  1260. X}
  1261. X
  1262. XDEFUN ("upper-p", Fupper_p, Supper_p, 1, 2, 0,
  1263. X   "Return t iff character CHAR is upper case, according to case\n\
  1264. Xtable TABLE (default (case-table)).")
  1265. X(ch, table)
  1266. XLisp_Object ch;
  1267. XLisp_Object table;
  1268. X{
  1269. Xreturn (CASETAB_ISUPPER (get_char_arg (ch), get_case_table_arg (table))
  1270. X        ? Qt : Qnil);
  1271. X}
  1272. X
  1273. XDEFUN ("set-case-table-nocase",
  1274. X   Fset_case_table_nocase, Sset_case_table_nocase, 1, 2, 0,
  1275. X   "Mark character CHAR as caseless in case table TABLE\n\
  1276. X(default (case-table)).")
  1277. X(ch, table)
  1278. XLisp_Object ch;
  1279. XLisp_Object table;
  1280. X{
  1281. Xget_case_table_arg (table)->cas_case[get_char_arg (ch)] = nocase_e;
  1282. Xreturn (ch);
  1283. X}
  1284. X
  1285. XDEFUN ("set-case-table-pair",
  1286. X   Fset_case_table_pair, Sset_case_table_pair, 2, 3, 0,
  1287. X   "Mark characters LC and UC as an (upper case, lower case)\n\
  1288. Xpair in case table TABLE (default (case-table)).")
  1289. X(lc, uc, table)
  1290. XLisp_Object lc;
  1291. XLisp_Object uc;
  1292. XLisp_Object table;
  1293. X{
  1294. Xregister struct Lisp_Casetab *cp = get_case_table_arg (table);
  1295. Xregister char_t lch = get_char_arg (lc);
  1296. Xregister char_t uch = get_char_arg (uc);
  1297. X
  1298. Xcp->cas_case[lch] = lowercase_e;
  1299. Xcp->cas_case[uch] = uppercase_e;
  1300. Xreturn (lc);
  1301. X}
  1302. X
  1303. Xinit_case_table_once ()
  1304. X{
  1305. Xregister int i;
  1306. Xregister case_t *p;
  1307. X
  1308. XFset_standard_case_table (Fmake_case_table ());
  1309. Xp = buffer_defaults.case_table_v->cas_case;
  1310. Xfor (i = 'A'; i <= 'Z'; ++i)
  1311. X   p[i] = uppercase_e;
  1312. Xfor (i = 'a'; i <= 'z'; ++i)
  1313. X   p[i] = lowercase_e;
  1314. X}
  1315. X
  1316. Xsyms_of_case_table ()
  1317. X{
  1318. XQcase_table_p = intern ("case-table-p");
  1319. Xstaticpro (&Qcase_table_p);
  1320. X
  1321. Xdefsubr (&Scase_table_p);
  1322. Xdefsubr (&Scase_table);
  1323. Xdefsubr (&Sstandard_case_table);
  1324. Xdefsubr (&Sset_case_table);
  1325. Xdefsubr (&Sset_standard_case_table);
  1326. Xdefsubr (&Smake_case_table);
  1327. Xdefsubr (&Snocase_p);
  1328. Xdefsubr (&Slower_p);
  1329. Xdefsubr (&Supper_p);
  1330. Xdefsubr (&Sset_case_table_nocase);
  1331. Xdefsubr (&Sset_case_table_pair);
  1332. X}
  1333. END_OF_FILE
  1334. if test 5975 -ne `wc -c <'src/casetab.c'`; then
  1335.     echo shar: \"'src/casetab.c'\" unpacked with wrong size!
  1336. fi
  1337. # end of 'src/casetab.c'
  1338. fi
  1339. if test -f 'src/etctab.h' -a "${1}" != "-c" ; then 
  1340.   echo shar: Will not clobber existing file \"'src/etctab.h'\"
  1341. else
  1342. echo shar: Extracting \"'src/etctab.h'\" \(1064 characters\)
  1343. sed "s/^X//" >'src/etctab.h' <<'END_OF_FILE'
  1344. X/* Declarations for miscellaneous Lisp table objects.
  1345. X   Copyright (C) 1987 Free Software Foundation, Inc.
  1346. X
  1347. XThis file is part of GNU Emacs.
  1348. X
  1349. XGNU Emacs is distributed in the hope that it will be useful,
  1350. Xbut WITHOUT ANY WARRANTY.  No author or distributor
  1351. Xaccepts responsibility to anyone for the consequences of using it
  1352. Xor for whether it serves any particular purpose or works at all,
  1353. Xunless he says so in writing.  Refer to the GNU Emacs General Public
  1354. XLicense for full details.
  1355. X
  1356. XEveryone is granted permission to copy, modify and redistribute
  1357. XGNU Emacs, but only under the conditions described in the
  1358. XGNU Emacs General Public License.   A copy of this license is
  1359. Xsupposed to have been given to you along with GNU Emacs so you
  1360. Xcan know your rights and responsibilities.  It should be in a
  1361. Xfile named COPYING.  Among other things, the copyright notice
  1362. Xand this notice must be preserved on all copies.  */
  1363. X
  1364. X/* Written by Howard Gayle.  See chartab.c for details. */
  1365. X
  1366. Xextern struct Lisp_Etctab *all_etc_tables;
  1367. XLisp_Object make_etc_table ();
  1368. Xchar_t get_char_arg ();
  1369. END_OF_FILE
  1370. if test 1064 -ne `wc -c <'src/etctab.h'`; then
  1371.     echo shar: \"'src/etctab.h'\" unpacked with wrong size!
  1372. fi
  1373. # end of 'src/etctab.h'
  1374. fi
  1375. echo shar: End of archive 3 \(of 4\).
  1376. cp /dev/null ark3isdone
  1377. MISSING=""
  1378. for I in 1 2 3 4 ; do
  1379.     if test ! -f ark${I}isdone ; then
  1380.     MISSING="${MISSING} ${I}"
  1381.     fi
  1382. done
  1383. if test "${MISSING}" = "" ; then
  1384.     echo You have unpacked all 4 archives.
  1385.     rm -f ark[1-9]isdone
  1386. else
  1387.     echo You still need to unpack the following archives:
  1388.     echo "        " ${MISSING}
  1389. fi
  1390. ##  End of shell archive.
  1391. exit 0
  1392.