LISTING FOR >spec>install>1136>emacs-completions COMPILED BY Multics LISP Compiler, Version 2.13c, July 11, 1983 ON 08/20/86 2254.7 mst Wed IN BEHALF OF Martinson.SysMaint.a ;;; *********************************************************** ;;; * * ;;; * Copyright, (C) Honeywell Information Systems Inc., 1982 * ;;; * * ;;; * Copyright (c) 1981 by Massachusetts Institute of * ;;; * Technology and Honeywell Information Systems, Inc. * ;;; * * ;;; *********************************************************** ;;; ;;; Emacs completion command and underpinnings. ;;; ;;; Richard Mark Soley and Barry Margolin, August 1981 ;;; Modified 19 November 1981 RMSoley for trying other completions on ;;; successive ESC-SPACE's, disallow minibuffer, get rid of table. ;;; Modified 3 October 1982 B. Margolin for not depending upon being ;;; bound to ESC-SPACE. ;;; Modified 19 January 1984 B. Margolin to comment out register-option form, ;;; as it was moved to e_option_defaults_. ;;; (declare (special completion-list cmp:worked cmp:mark cmp:last-completion cmp:allow-ambiguous X Y minibufferp previous-command current-command) (*lexpr cmp:get-completion) (*expr DCTL-position-cursor)) (%include e-macros) (eval-when (eval compile) (defun abort-completion macro (form) '(prog2 (ring-tty-bell) (throw 0 nocomplete))) (defun catch-abort macro (form) `(catch ,@(cdr form) nocomplete))) (or (boundp 'completion-list) (setq completion-list nil)) (setq cmp:worked nil cmp:mark nil cmp:last-completion nil) ;;; (register-option 'cmp:allow-ambiguous 'On) ;moved to e_option_defaults_ (defcom complete-command &numeric-argument (&pass) (cond ((not minibufferp) (command-quit)) (numarg (or (eq previous-command current-command) (setq cmp:worked nil)) (cmp:display-completions)) ((cmp:undo-completion?) (without-saving (wipe-point-mark cmp:mark)) (release-mark cmp:mark) (catch-abort (let ((completion-info (cmp:get-completion (cmp:get-word) cmp:last-completion))) (cond (completion-info (setq cmp:worked t cmp:last-completion (car completion-info)) (insert-string (substr (car completion-info) (cdr completion-info))) (insert-string SPACE)) (t (setq cmp:worked nil cmp:mark nil)))))) (t (catch-abort (let ((completion-info (cmp:get-completion (cmp:get-word)))) (cond (completion-info (setq cmp:worked t cmp:last-completion (car completion-info)) (insert-string (substr (car completion-info) (cdr completion-info))) (insert-char SPACE)))))))) (defun cmp:undo-completion? () (and cmp:worked cmp:mark (eq previous-command 'complete-command))) (defun cmp:set-mark () (and cmp:mark (release-mark cmp:mark)) (setq cmp:mark (set-mark))) (defun cmp:get-word () (cmp:set-mark) (with-mark here (go-to-beginning-of-line) (prog1 (point-mark-to-string here) (go-to-mark here)))) (defun cmp:get-completion lexpr (let ((word (arg 1)) (ignore-until (and (> lexpr 1) (arg 2))) (found nil)) (do ((words (cond (ignore-until (cdr (member ignore-until completion-list))) (t completion-list)) (cdr words))) ((null words) (cond (found found) (t (setq cmp:last-completion nil) (abort-completion)))) (let ((cur-word (car words))) (and (= (index cur-word word) 1) (cond (cmp:allow-ambiguous (return (cons cur-word (1+ (stringlength word))))) (found (abort-completion)) (t (setq found (cons cur-word (1+ (stringlength word))))))))))) (defun cmp:display-completions () (or completion-list (display-error "There are no completions in effect.")) (let ((littleX X) (littleY Y)) (init-local-displays) (local-display-generator-nnl "Current Completions in Effect") (local-display-generator-nnl "") (do ((words completion-list (cdr words))) ((null words)) (local-display-generator-nnl (car words))) (end-local-displays) (DCTL-position-cursor littleX littleY))) 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 cmp:display-completions 416 0 complete-command cmp:get-completion 234 150 cmp:undo-completion? cmp:get-word 176 165 cmp:set-mark cmp:set-mark 165 176 cmp:get-word cmp:undo-completion? 150 234 cmp:get-completion complete-command 0 416 cmp:display-completions Functions Referenced DCTL-position-cursor display-error member arg end-local-displays point-mark-to-string cmp:display-completions go-to-beginning-of-line release-mark cmp:get-completion go-to-mark ring-tty-bell cmp:get-completion index set-mark cmp:get-word init-local-displays stringlength cmp:set-mark insert-char substr cmp:undo-completion? insert-string wipe-point-mark command-quit local-display-generator-nnl ----------------------------------------------------------- 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