Changeset 10394


Ignore:
Timestamp:
Aug 8, 2008, 4:49:18 AM (11 years ago)
Author:
gb
Message:

Fix help string for --version option.

Be more careful about parsing terminal-encoding option (don't set
lisp variable if unknown encoding.)

In TOPLEVEL-FUNCTION :BEFORE method, just set terminal-encoding
(assume streams initialized earlier in the startup process.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/level-1/l1-application.lisp

    r7487 r10394  
    3939  (make-command-line-argument
    4040   :keyword :version
    41    :help-string "print (LISP-APPLICATION-VERSION) and exit"
     41   :help-string "print (LISP-IMPLEMENTATION-VERSION) and exit"
    4242   :option-char #\V
    4343   :long-name "version"))
     
    150150          (#_ _exit 0))
    151151        (let* ((encoding (assoc :terminal-encoding opts)))
    152           (if encoding
    153             (setq *terminal-character-encoding-name*
    154                   (if (cdr encoding)
     152          (when (cdr encoding)
     153            (let* ((encoding-name
    155154                    (let* ((*package* (find-package "KEYWORD")))
    156                       (ignore-errors (read-from-string (cdr encoding))))))))))
     155                      (ignore-errors (read-from-string (cdr encoding))))))
     156              (when encoding-name
     157                (let* ((character-encoding (lookup-character-encoding encoding-name)))
     158                  (when character-encoding
     159                    (setq *terminal-character-encoding-name*
     160                          (character-encoding-name character-encoding))))))))))
    157161    (%usage-exit
    158162     (format nil
     
    178182    (setq *unprocessed-command-line-arguments* rest-arg)
    179183    (process-application-arguments a error-flag options args)
    180     (initialize-interactive-streams)))
     184    (let* ((encoding (lookup-character-encoding *terminal-character-encoding-name*)))
     185      (when encoding
     186         (set-terminal-encoding (character-encoding-name encoding))))))
    181187
    182188(defmethod application-version-string ((a application))
     
    283289             :class 'tty-listener
    284290             :process initial-listener-process))))
    285   (%set-toplevel #'(lambda ()
    286                      (with-standard-abort-handling nil
    287                        (loop
    288                          (%nanosleep *periodic-task-seconds* *periodic-task-nanoseconds*)
    289                          (housekeeping)))))
     291  (%set-toplevel #'housekeeping-loop)
    290292  (toplevel))
    291293
    292 
     294(defun housekeeping-loop ()
     295  (with-standard-abort-handling nil
     296    (loop
     297      (%nanosleep *periodic-task-seconds* *periodic-task-nanoseconds*)
     298      (housekeeping))))
     299 
    293300
    294301(defmethod application-init-file ((app lisp-development-system))
Note: See TracChangeset for help on using the changeset viewer.