LISTING FOR >spec>install>1136>emacs-buffer-edit COMPILED BY Multics LISP Compiler, Version 2.13c, July 11, 1983 ON 08/20/86 2254.6 mst Wed IN BEHALF OF Martinson.SysMaint.a ;;; *********************************************************** ;;; * * ;;; * Copyright, (C) Honeywell Information Systems Inc., 1982 * ;;; * * ;;; * Copyright (c) 1978 by Massachusetts Institute of * ;;; * Technology and Honeywell Information Systems, Inc. * ;;; * * ;;; *********************************************************** ;;; ;;; ;;; Bufed pro bufonibus. ;;; BSG 4/14/79 ;;; Modified: 4 December 1983 - B. Margolin - fix misspelling in ;;; message printed by bufed-examine. ;;; (%include e-macros) (declare (special bufed-goback-buf bufed-wopt bufed-kill-list known-buflist two-window-mode)) (declare (*expr buffer-kill create-new-window-and-stay-here delete-window get-buffer-state go-to-hpos lruify-current-window lruify-window save-same-file window-adjust-lower window-adjust-upper)) (defun edit-buffers ()(bufed)) (defun bufed () (prog (tbufnam origbuf origmark) (setq origbuf current-buffer) (setq tbufnam 'BUFEDIT) (if numarg (find-buffer-in-window tbufnam) else (go-to-or-create-buffer tbufnam)) (register-local-var 'bufed-goback-buf) (setq bufed-goback-buf origbuf) (register-local-var 'bufed-wopt) (setq bufed-wopt numarg numarg nil) (register-local-var 'bufed-kill-list) (setq bufed-kill-list nil) (bufedit-mode) (go-to-beginning-of-buffer) (setq read-only-flag nil) (do ((bufl (delq tbufnam (subst nil nil known-buflist)) (cdr bufl)) (buf)) ((null bufl)) (setq buf (car bufl)) (or (line-is-blank)(without-saving (kill-to-end-of-line))) (and (eq buf previous-buffer) (setq origmark (set-mark))) (cond ((eq buf bufed-goback-buf)(insert-char ">")) (t (insert-char SPACE))) (cond ((get-buffer-state buf 'buffer-modified-flag) (insert-char "*")) (t (insert-char SPACE))) (do-times 2 (insert-char SPACE)) (insert-string buf) (cond ((get-buffer-state buf 'fpathname) (format-to-col 25.) (insert-string (get-buffer-state buf 'fpathname)))) (if (lastlinep)(new-line) else (next-line))) (backward-char) (without-saving (with-mark m (go-to-end-of-buffer)(wipe-point-mark m))) (go-to-mark origmark) (release-mark origmark) (setq read-only-flag t buffer-modified-flag nil) (select-buffer-window current-buffer 'cursize))) (defun bufedit-mode () (if (empty-buffer-p current-buffer) (setq current-buffer-mode 'Buffer/ Edit) (mapc '(lambda (x)(set-key (car x)(cadr x))) '( (w edit-windows) (W edit-windows) (q bufed-quit) (Q bufed-quit) (e bufed-examine) (E bufed-examine) (d bufed-kill) (D bufed-kill) (k bufed-kill) (K bufed-kill) (g bufed-go) (G bufed-go) (u bufed-undelete) (U bufed-undelete) (p bufed-prev) (P bufed-prev) (n bufed-next) (N bufed-next) (f bufed-find) (F bufed-find) (s bufed-save) (S bufed-save) (^X^Q bufed-quit))))) (defun bufed-prev () (if (firstlinep)(go-to-end-of-buffer) (go-to-beginning-of-line) else (prev-line))) (defun bufed-next () (if (lastlinep)(go-to-beginning-of-buffer) else (next-line))) (defun bufed-validate-target (targ) (if (memq targ bufed-kill-list) (display-error "Buffer " targ " to be deleted. Can't go there.")) (if (not (memq targ known-buflist)) (display-error "Buffer " targ " no longer exists. Choose another."))) (defun bufed-go () (let ((targ (bufed-get-bufnam)) (goback bufed-goback-buf)) ;gonna get switched w bufs (bufed-validate-target targ) (bufed-check-deletions) (set-buffer-self-destruct 'BUFEDIT) (select-buffer-window targ nil) (setq previous-buffer goback))) (defun bufed-find () (let ((buf (bufed-get-bufnam)) (goback bufed-goback-buf)) (bufed-validate-target buf) (bufed-check-deletions) (set-buffer-self-destruct 'BUFEDIT) (find-buffer-in-window buf) (setq previous-buffer goback))) (defun bufed-quit () (bufed-validate-target bufed-goback-buf) (bufed-check-deletions) (set-buffer-self-destruct 'BUFEDIT) (if bufed-wopt (lruify-current-window) (find-buffer-in-window bufed-goback-buf) else (select-buffer-window bufed-goback-buf nil))) (defun bufed-examine () (if two-window-mode (let ((bub current-buffer) (targ (bufed-get-bufnam))) (let ((wf (buffer-on-display-in-window targ))) (if wf (display-error-remark "Buffer " targ " on display in window " (decimal-rep wf)) else (find-buffer-in-window targ) (setq wf (buffer-on-display-in-window targ)) (display-error-remark "Buffer " targ " on display in window " (decimal-rep wf)) (find-buffer-in-window bub) (lruify-window wf)))) else (go-to-buffer (bufed-get-bufnam)) (display-error-noabort "^XB CR to get back to Buffer Edit."))) (defun bufed-kill () (go-to-hpos 2) (if-at 'X (go-to-beginning-of-line) else (without-modifying (delete-char) (insert-char 'X)) (setq bufed-kill-list (cons (bufed-get-bufnam) bufed-kill-list)) (if (lastlinep)(go-to-beginning-of-line) else (next-line)))) (defun bufed-check-deletions () (if bufed-kill-list (init-local-displays) (mapc 'local-display-generator-nnl '("Buffers to Kill:" "----------------" "")) (mapc 'local-display-generator-nnl bufed-kill-list) (end-local-displays) (if (yesp "Go ahead and kill these buffers? ") (mapc 'buffer-kill bufed-kill-list)) (setq bufed-kill-list nil))) (defun bufed-undelete () (go-to-hpos 2) (if-at 'X (without-modifying (delete-char) (insert-string " ")) (setq bufed-kill-list (delq (bufed-get-bufnam) bufed-kill-list)) (if (lastlinep)(go-to-beginning-of-line) else (next-line)))) (defun bufed-get-bufnam () (go-to-hpos 4.) (prog2 0 (make_atom (with-mark b (if (go-to-hpos 25.) (if (forward-search-in-line ">") (backward-char) else (go-to-end-of-line)) (skip-back-whitespace)) (point-mark-to-string b))) (go-to-beginning-of-line))) (defun bufed-save () (save-excursion-buffer (go-to-buffer (bufed-get-bufnam)) (save-same-file)) (go-to-hpos 1) (if-at '* (without-modifying (delete-char) (insert-char SPACE))) (if (lastlinep) (go-to-beginning-of-line) else (next-line))) ;;; ;;; ;;; Window editor BSG 4/14/79 ;;; (declare (special selected-window nuwindows)) (defun edit-windows () (let ((ona numarg)(numarg nil)) (if ona (find-buffer-in-window 'WINDOWSTAT)) (wstat-edit)) (select-buffer-window current-buffer 'cursize)) (defun wstat-edit () (go-to-or-create-buffer 'WINDOWSTAT) (wstat-mode) (select-buffer-window current-buffer (if (buffer-on-display-in-window current-buffer) nuwindows else (1+ nuwindows))) (wstat-create-display) ; (redisplay) (lruify-current-window)) (defun wstat-create-display () (setq read-only-flag nil buffer-modified-flag t) ;suppr modified msg (go-to-beginning-of-buffer) (do i 1 (1+ i)(> i nuwindows) (without-saving (kill-to-end-of-line)) (insert-string (decimal-rep i)) (if (= i selected-window)(insert-string "*")) (format-to-col 4) (let ((info (window-info i))) (insert-string (decimal-rep (cadr info))) ;internal # (format-to-col 10.) (insert-string (decimal-rep (caar info))) ;startline (format-to-col 15.) (insert-string (decimal-rep (cdar info))) ;nlines (format-to-col 20.) (insert-string (caddr info)) ;buffer (format-to-col 40.) (if (null (cadddr info)) (insert-string "<>") else (insert-string (substr (cadddr info) 1 (min 10. (1- (stringlength (cadddr info)))))))) (if (lastlinep)(new-line) else (next-line))) (rubout-char) (without-saving (with-mark m (go-to-end-of-buffer)(wipe-point-mark m))) (setq buffer-modified-flag nil read-only-flag t) (go-to-beginning-of-buffer)) (defun wstat-mode () (if (empty-buffer-p current-buffer) (mapc '(lambda (x)(set-key (car x)(cadr x))) '((b edit-buffers) (c wstat-create-window) (/3 wstat-create-window) (g wstat-go-window) (f wstat-go-window) (^ wstat-push-up-top) (v wstat-push-down-bottom) (u wstat-pull-up-bottom) (a wstat-pull-down-top) (k wstat-kill-window) (d wstat-kill-window) (n wstat-next) (p wstat-prev))) (setq current-buffer-mode 'Window/ Edit))) (defun wstat-create-window () (create-new-window-and-stay-here) (wstat-create-display) (go-to-end-of-buffer) (go-to-beginning-of-line)) (defprop wstat-next t argwants)(defprop wstat-prev t argwants) (defun wstat-next ()(if (lastlinep)(go-to-beginning-of-buffer)else (next-line))) (defun wstat-prev ()(if (firstlinep)(go-to-end-of-buffer)(go-to-beginning-of-line) else (prev-line))) (defun wstat-go-window () (set-buffer-self-destruct 'WINDOWSTAT) (select-window (wstat-collect-wnum))) (defun wstat-kill-window () (delete-window (wstat-collect-wnum)) (save-excursion (wstat-create-display))) (defun wstat-collect-wnum () (prog2 (go-to-beginning-of-line) (let ((ibase 10.)) (readlist (explodec (with-mark m (forward-word) (point-mark-to-string m))))) (go-to-beginning-of-line))) (defun wstat-push-up-top () (let ((howmuch (or numarg 1)) (u (wstat-collect-wnum))) (if (= u 1)(display-error "The top window has no topline!")) (if (< (- (cdar (window-info (1- u))) howmuch) 3) (display-error "Attempt to make upstairs window too small.")) (window-adjust-upper u (- howmuch))) (save-excursion (wstat-create-display))) (defun wstat-push-down-bottom () (let ((howmuch (or numarg 1)) (u (wstat-collect-wnum))) (if (= u nuwindows) (display-error "The bottom window has no bottomline!")) (if (< (- (cdar (window-info (1+ u))) howmuch) 3) (display-error "Attempt to make downstairs window too small.")) (window-adjust-lower u howmuch)) (save-excursion (wstat-create-display))) (defun wstat-pull-down-top () (let ((howmuch (or numarg 1)) (u (wstat-collect-wnum))) (if (= u 1)(display-error "The top window has no topline!")) (if (< (- (cdar (window-info u)) howmuch) 3) (display-error "Attempt to make this window too small.")) (window-adjust-upper u howmuch)) (save-excursion (wstat-create-display))) (defun wstat-pull-up-bottom () (let ((howmuch (or numarg 1)) (u (wstat-collect-wnum))) (if (= u nuwindows) (display-error "The bottom window has no bottomline!")) (if (< (- (cdar (window-info u)) howmuch) 3) (display-error "Attempt to make this window too small.")) (window-adjust-lower u (- howmuch))) (save-excursion (wstat-create-display))) INCLUDE FILE >spec>install>1136>executable>e-macros.incl.lisp ;;; BEGIN INCLUDE FILE e-macros.incl.lisp ;;; Declares for use by Emacs programs and extenstions. Also loads ;;; in e_macros_, which contains macro definitions. ;;; HISTORY COMMENTS: ;;; 1) change(85-01-01,Margolin), approve(86-02-24,MCR7186), ;;; audit(86-08-12,Harvey), install(86-08-20,MR12.0-1136): ;;; Written: New Year's Day 1985, by excerpting the old e-macros.incl.lisp ;;; and leaving out all the definitions and qwerty junk (don't ask). ;;; 2) change(86-02-24,Margolin), approve(86-02-24,MCR7325), ;;; audit(86-08-12,Harvey), install(86-08-20,MR12.0-1136): ;;; Alphabetized declarations, and added more declarations for documented ;;; functions, and also for some undocumented functions. ;;; END HISTORY COMMENTS (%include backquote) (declare ;basic editor stuff (*expr apply-catenate assert-minor-mode backward-char backward-n-chars charlisten charset-member command-abort command-quit copy-region cur-hpos curline-as-string curbuf-as-string curchar curline-as-string delete-char delete-word destroy-buffer-contents dont-notice-modified-buffer e_cline_ e_lap_$reverse-search-string e_lap_$trim empty-buffer-p error_table_ establish-local-var exchange-point-and-mark firstlinep forward-char forward-n-chars forward-regexp-search-in-line forward-search forward-search-in-line get-char get-search-string go-to-beginning-of-buffer go-to-beginning-of-line go-to-buffer go-to-end-of-buffer go-to-end-of-line go-to-hpos go-to-mark go-to-or-create-buffer insert-char insert-string kill-backwards-to-mark kill-forward-to-mark kill-pop kill-to-end-of-line killsave-string lastlinep loadfile looking-at lowercase map-over-emacs-commands mark-on-current-line-p mark-reached merge-kills-forward merge-kills-reverse move-mark minibuf-response minibuffer-clear negate-minor-mode new-line next-line nullstringp pathname_ pathname_$component point-mark-to-string point>markp prev-line printable process-char produce-named-mark-list read-in-file release-mark reverse-search register-local-var reverse-search-in-line search-back-first-charset-line search-back-first-not-charset-line search-failure-annunciator search-for-first-charset-line search-for-first-not-charset-line set-emacs-epilogue-handler set-buffer-self-destruct set-key set-mark-here set-mark set-perm-key set-the-mark set-the-mark-here skip-to-whitespace skip-to-whitespace-in-line wipe-point-mark wipe-region write-out-file trim-minibuf-response yesp yank) (*fexpr define-autoload-lib)) (declare ;redisplay stuff (*expr end-local-displays init-local-displays ring-tty-bell local-display-generator local-display-generator-nnl next-screen prev-screen local-display-current-line find-buffer-in-window select-buffer-window window-info select-buffer-find-window select-other-window select-window buffer-on-display-in-window redisplay full-redisplay)) (declare ;extended stuff (*expr forward-word backward-word skip-over-whitespace skip-back-whitespace skip-over-whitespace-in-line skip-back-whitespace-in-line skip-back-to-whitespace skip-to-whitespace rubout-char date display-buffer-as-printout delete-white-sides lefthand-char format-to-col whitespace-to-hpos line-is-blank decimal-rep register-option minibuffer-clear)) (declare (*lexpr display-error display-com-error display-error-noabort display-error-remark comout-get-output display-com-error-noabort minibuffer-print minibuffer-response trim-minibuffer-response intern-minibuffer-response minibuffer-remark minibuffer-print-noclear report-error report-error-noabort)) (declare (special TAB NL SPACE ESC curpointpos current-buffer dont-stash numarg der-wahrer-mark fpathname fill-column completion-list curlinel BACKSPACE read-only-flag buffer-modified-flag previous-buffer current-buffer-mode env-dir process-dir minibuffer-end-string NLCHARSTRING undo null-pointer)) ;;; Load in macro packages (eval-when (eval compile) (or (status feature e-defcom) (progn (load (catenate (car (namelist (truename infile))) ">e_define_command_")) (sstatus feature e-defcom))) (or (status feature e-macros) (load (catenate (car (namelist (truename infile))) ">e_macros_")))) ;;; END INCLUDE FILE e-macros.incl.lisp INCLUDE FILE >ldd>include>backquote.incl.lisp ;;; ;;; backquote.incl.lisp - BSG 10/9/79 ;;; Loads lisp_backquote_ into either the compiler or interpreter ;;; environment. ;;; ;;; Modified 10/30/82 by Richard Lamson to use eval-when and ;;; (status feature backquote) ;;; (eval-when (eval compile) (or (status feature backquote) (load (catenate (car (namelist (truename infile))) ">lisp_backquote_")))) Functions Defined Name Offset Offset Name bufed 2 0 edit-buffers bufed-check-deletions 716 2 bufed bufed-examine 550 314 bufedit-mode bufed-find 472 353 bufed-prev bufed-get-bufnam 1052 363 bufed-next bufed-go 442 372 bufed-validate-target bufed-kill 655 442 bufed-go bufed-next 363 472 bufed-find bufed-prev 353 520 bufed-quit bufed-quit 520 550 bufed-examine bufed-save 1140 655 bufed-kill bufed-undelete 1005 716 bufed-check-deletions bufed-validate-target 372 1005 bufed-undelete bufedit-mode 314 1052 bufed-get-bufnam edit-buffers 0 1140 bufed-save edit-windows 1222 1222 edit-windows wstat-collect-wnum 1714 1251 wstat-edit wstat-create-display 1303 1303 wstat-create-display wstat-create-window 1615 1560 wstat-mode wstat-edit 1251 1615 wstat-create-window wstat-go-window 1641 1622 wstat-next wstat-kill-window 1652 1631 wstat-prev wstat-mode 1560 1641 wstat-go-window wstat-next 1622 1652 wstat-kill-window wstat-prev 1631 1714 wstat-collect-wnum wstat-pull-down-top 2204 1764 wstat-push-up-top wstat-pull-up-bottom 2310 2074 wstat-push-down-bottom wstat-push-down-bottom 2074 2204 wstat-pull-down-top wstat-push-up-top 1764 2310 wstat-pull-up-bottom Functions Referenced backward-char forward-word prev-line bufed get-buffer-state readlist bufed-check-deletions go-to-beginning-of-buffer register-local-var bufed-get-bufnam go-to-beginning-of-line release-mark bufed-validate-target go-to-buffer rubout-char bufedit-mode go-to-end-of-buffer save-same-file buffer-kill go-to-end-of-line select-buffer-window buffer-on-display-in-window go-to-hpos select-window create-new-window-and-stay-here go-to-mark set-buffer-self-destruct curchar go-to-or-create-buffer set-key decimal-rep init-local-displays set-mark delete-char insert-char skip-back-whitespace delete-window insert-string stringlength delq kill-to-end-of-line subst display-error lastlinep substr display-error line-is-blank window-adjust-lower display-error-noabort local-display-generator-nnl window-adjust-upper display-error-remark lruify-current-window window-info empty-buffer-p lruify-window wipe-point-mark end-local-displays make_atom wstat-collect-wnum explodec min wstat-create-display find-buffer-in-window new-line wstat-edit firstlinep next-line wstat-mode format-to-col point-mark-to-string yesp forward-search-in-line ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved