/[emacs]/emacs/lisp/terminal.el
ViewVC logotype

Diff of /emacs/lisp/terminal.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.47 by rms, Thu Feb 7 17:42:39 2002 UTC revision 1.48 by rms, Sun Mar 3 21:37:31 2002 UTC
# Line 1264  of the terminal-emulator" Line 1264  of the terminal-emulator"
1264  (defun te-create-terminfo ()  (defun te-create-terminfo ()
1265    "Create and compile a terminfo entry for the virtual terminal. This is kept    "Create and compile a terminfo entry for the virtual terminal. This is kept
1266  in the directory specified by `te-terminfo-directory'."  in the directory specified by `te-terminfo-directory'."
1267    (if (and system-uses-terminfo    (when (and system-uses-terminfo
1268             (not (file-exists-p (concat  te-terminfo-directory               (not (file-exists-p (concat te-terminfo-directory
1269                                          (substring te-terminal-name-prefix 0 1)                                           (substring te-terminal-name-prefix 0 1)
1270                                          "/" te-terminal-name))))                                           "/" te-terminal-name))))
1271      (let ( (terminfo      (let ( (terminfo
1272              (concat              (concat
1273               ;; The first newline avoids trouble with ncurses.               ;; The first newline avoids trouble with ncurses.
# Line 1278  in the directory specified by `te-termin Line 1278  in the directory specified by `te-termin
1278               "dch=^Pd%p1%'\\s'%+%c, dch1=^Pd!, dl=^P^K%p1%'\\s'%+%c,"               "dch=^Pd%p1%'\\s'%+%c, dch1=^Pd!, dl=^P^K%p1%'\\s'%+%c,"
1279               "dl1=^P^K!, ed=^PC, el=^Pc, home=^P=\\s\\s,"               "dl1=^P^K!, ed=^PC, el=^Pc, home=^P=\\s\\s,"
1280               "ich=^P_%p1%'\\s'%+%c, ich1=^P_!, il=^P^O%p1%'\\s'%+%c,"               "ich=^P_%p1%'\\s'%+%c, ich1=^P_!, il=^P^O%p1%'\\s'%+%c,"
1281                 ;; The last newline avoids trouble with ncurses.
1282               "il1=^P^O!, ind=^P\\n, nel=\\n,\n"))               "il1=^P^O!, ind=^P\\n, nel=\\n,\n"))
1283             ;; The last newline avoids trouble with ncurses.             ;; This is the desired name for the source file.
1284             (file-name (concat te-terminfo-directory te-terminal-name ".tif")) )             (file-name (concat te-terminfo-directory te-terminal-name ".tif")) )
1285        (make-directory te-terminfo-directory t)        (make-directory te-terminfo-directory t)
1286        (save-excursion        (let ((temp-file
1287          (set-buffer (create-file-buffer file-name))               (make-temp-file (expand-file-name "tif" te-terminfo-directory))))
1288          (insert terminfo)          ;; Store the source file under a random temp name.
1289          (write-file file-name)          (with-temp-file temp-file
1290          (kill-buffer nil)            (insert terminfo))
1291          )          ;; Rename it to the desired name.
1292        (let ( (process-environment          ;; We use this roundabout approach
1293                (cons (concat "TERMINFO="          ;; to avoid any risk of writing a name that
1294                              (directory-file-name te-terminfo-directory))          ;; was michievouslyt set up as a symlink.
1295                      process-environment)) )          (rename-file temp-file file-name))
1296          ;; Now compile that source to make the binary that the
1297          ;; programs actually use.
1298          (let ((process-environment
1299                 (cons (concat "TERMINFO="
1300                               (directory-file-name te-terminfo-directory))
1301                       process-environment)))
1302          (set-process-sentinel (start-process "tic" nil "tic" file-name)          (set-process-sentinel (start-process "tic" nil "tic" file-name)
1303                                'te-tic-sentinel))))                                'te-tic-sentinel))))
1304      (directory-file-name te-terminfo-directory)      (directory-file-name te-terminfo-directory))
 )  
1305    
1306  (defun te-create-termcap ()  (defun te-create-termcap ()
1307    "Create a termcap entry for the virtual terminal"    "Create a termcap entry for the virtual terminal"

Legend:
Removed from v.1.47  
changed lines
  Added in v.1.48

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26