File:  [CSRG BSD Unix] / 43BSDReno / contrib / emacs-18.55 / dist-1.3 / fi / dot.clinit
Revision 1.1: download - view: text, annotated - select for diffs
Tue Apr 24 16:12:57 2018 UTC (8 years, 1 month ago) by root
CVS tags: MAIN, HEAD
Initial revision

;;				-[Fri Nov 18 19:00:37 1988 by layer]-
;; Sample .clinit.cl file
;;
;; $Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/emacs-18.55/dist-1.3/fi/dot.clinit,v 1.1 2018/04/24 16:12:57 root Exp $

(format t "; Loading home clinit...~%")

(defparameter *emacs-library*
  (let ((emacs-lib (si:getenv "EMACSLIBRARY")))
    (if emacs-lib (format nil "~a/lisp/fi/" emacs-lib))))

(and *emacs-library*
     (find "+ipc" (system:command-line-arguments) :test #'string=)
     (load (merge-pathnames "clinit.cl" *emacs-library*))
     (load-and-start-ipc-package :unix-domain nil))

;; The following emulates the C shell cd, pushd, popd, pwd, and dirs,
;; and allows Emacs to track directory changes:

(defvar *directory-stack*
  (list (namestring
	 (setq *default-pathname-defaults* (current-directory)))))

(tpl:alias ("pushd" :string) (&optional dir)
  (if* (string= "" dir)
     then (let ((old-top (pop *directory-stack*))
		(new-top (pop *directory-stack*)))
	    (push old-top *directory-stack*)
	    (push (chdir new-top) *directory-stack*))
     else (push (chdir dir) *directory-stack*))
  (format t "~a~%" *directory-stack*))

(tpl:alias "popd" ()
  (if (> (length *directory-stack*) 1)
      (pop *directory-stack*)
    (format t "nothing to pop into~%"))
  (chdir (car *directory-stack*))
  (format t "~a~%" *directory-stack*))

(tpl:alias "dirs" ()
  (format t "~a~%" *directory-stack*))

(tpl:alias ("cd" :string) (dir)
  (setf (car *directory-stack*)
    (apply #'chdir
	   (if (string= "" dir) nil (list dir))))
  (format t "~a~%" *directory-stack*))

(tpl:alias "pwd" ()
  (format t "process cwd = ~a~%*default-pathname-defaults* = ~a~%"
	  (namestring (current-directory))
	  (namestring (truename *default-pathname-defaults*))))

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.