;;; -*-Scheme-*-
;;;
-;;; $Id: basic.scm,v 1.135 2000/02/25 14:28:52 cph Exp $
+;;; $Id: basic.scm,v 1.136 2000/02/28 22:50:14 cph Exp $
;;;
;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology
;;;
(self-insert char n #t))))
(define (self-insert char n allow-auto-fill?)
- (if (> n 0)
- (begin
- (if (and (current-minor-mode? (ref-mode-object abbrev))
- (not (char=? #\w (char-syntax char)))
- (buffer-writable? (selected-buffer))
- (eqv? #\w (char-syntax (extract-left-char))))
- ((ref-command expand-abbrev)))
- (insert-chars char n)
- (if (and allow-auto-fill?
- (or (char=? #\space char)
- (char=? #\newline char))
- (current-minor-mode? (ref-mode-object auto-fill)))
- (auto-fill-break)))))
-
-;;; Placeholders:
-(define-minor-mode abbrev "Abbrev" "")
-(define-command expand-abbrev "" () (lambda () unspecific))
+ (and (> n 0)
+ (let ((point (current-point))
+ (hairy? #f))
+ (if (and (not (group-start? point))
+ (buffer-minor-mode? (mark-buffer point)
+ (ref-mode-object abbrev))
+ (not (char=? #\w (char-syntax char)))
+ (char=? #\w (char-syntax (extract-left-char point))))
+ (let ((t (group-modified-tick (mark-group point))))
+ ((ref-command expand-abbrev) point)
+ (if (not (fix:= t (group-modified-tick (mark-group point))))
+ (set! hairy? #t))))
+ (insert-chars char n)
+ (if (and allow-auto-fill?
+ (or (char=? #\space char)
+ (char=? #\newline char))
+ (current-minor-mode? (ref-mode-object auto-fill)))
+ (let ((t (group-modified-tick (mark-group point))))
+ (auto-fill-break)
+ (if (not (fix:= t (group-modified-tick (mark-group point))))
+ (set! hairy? #t))))
+ hairy?)))
(define (read-quoted-char prompt-string)
(let ((read-ascii-char
;;; -*-Scheme-*-
;;;
-;;; $Id: bufwiu.scm,v 1.31 1999/01/02 06:11:34 cph Exp $
+;;; $Id: bufwiu.scm,v 1.32 2000/02/28 22:50:37 cph Exp $
;;;
-;;; Copyright (c) 1986, 1989-1999 Massachusetts Institute of Technology
+;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology
;;;
;;; This program is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU General Public License as
((%window-debug-trace window) 'window window
'direct-output-insert-char! char))
(let ((mask (set-interrupt-enables! interrupt-mask/gc-ok)))
- (group-insert-char! (%window-group window)
- (%window-point-index window)
- char)
(let ((x-start (inferior-x-start (%window-cursor-inferior window)))
(y-start (inferior-y-start (%window-cursor-inferior window))))
(screen-direct-output-char
;;; -*-Scheme-*-
;;;
-;;; $Id: comred.scm,v 1.115 2000/02/25 14:26:56 cph Exp $
+;;; $Id: comred.scm,v 1.116 2000/02/28 22:50:03 cph Exp $
;;;
;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology
;;;
(cond ((or *executing-keyboard-macro?* *command-argument*)
(normal))
((and (char? *command-key*)
- (or (and (eq? command
- (ref-command-object self-insert-command))
- (not (and (or (char=? #\space *command-key*)
- (char=? #\newline *command-key*))
- (auto-fill-break? point))))
+ (or (eq? command (ref-command-object self-insert-command))
(command-argument-self-insert? command)))
(let ((non-undo-count *non-undo-count*))
(if (or (fix:= non-undo-count 0)
(and (fix:= (string-length image) 1)
(char=? (string-ref image 0) key)))
(fix:< point-x (fix:- (window-x-size window) 1)))
- (window-direct-output-insert-char! window key)
- (region-insert-char! point key))))
+ (if (self-insert key 1 #t)
+ (begin
+ (set! *non-undo-count* 0)
+ (undo-boundary! point))
+ (window-direct-output-insert-char! window key))
+ (normal))))
((eq? command (ref-command-object forward-char))
(if (and (not (window-needs-redisplay? window))
(not (group-end? point))
#| -*-Scheme-*-
-$Id: decls.scm,v 1.67 2000/01/10 04:00:22 cph Exp $
+$Id: decls.scm,v 1.68 2000/02/28 22:51:28 cph Exp $
-Copyright (c) 1989-1999 Massachusetts Institute of Technology
+Copyright (c) 1989-2000 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
(loop (cdr files) (cons (car files) includes)))))
(for-each (lambda (filename)
(apply sf-edwin filename includes))
- '("argred"
+ '("abbrev"
+ "argred"
"artdebug"
"autold"
"autosv"
#| -*-Scheme-*-
-$Id: ed-ffi.scm,v 1.48 1999/10/07 17:00:40 cph Exp $
+$Id: ed-ffi.scm,v 1.49 2000/02/28 22:51:24 cph Exp $
-Copyright (c) 1990-1999 Massachusetts Institute of Technology
+Copyright (c) 1990-2000 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
;; This list must be kept in alphabetical order by filename.
(standard-scheme-find-file-initialization
- '#(("ansi" (edwin screen console-screen)
+ '#(("abbrev" (edwin)
+ edwin-syntax-table)
+ ("ansi" (edwin screen console-screen)
syntax-table/system-internal)
("argred" (edwin command-argument)
edwin-syntax-table)
#| -*-Scheme-*-
-$Id: edwin.ldr,v 1.68 1999/10/07 17:06:20 cph Exp $
+$Id: edwin.ldr,v 1.69 2000/02/28 22:51:21 cph Exp $
-Copyright (c) 1989-1999 Massachusetts Institute of Technology
+Copyright (c) 1989-2000 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
((OS/2) (load "diros2" env))
((NT) (load "dirw32" env))))
+ (load "abbrev" environment)
(load "argred" (->environment '(EDWIN COMMAND-ARGUMENT)))
(load "autold" environment)
(load "autosv" environment)
#| -*-Scheme-*-
-$Id: edwin.pkg,v 1.243 2000/02/25 17:47:08 cph Exp $
+$Id: edwin.pkg,v 1.244 2000/02/28 22:51:15 cph Exp $
Copyright (c) 1989-2000 Massachusetts Institute of Technology
"syntax" ; word and list parsing
"fileio" ; file <-> buffer
+ "abbrev" ; abbrevs
"autold" ; autoloaded definitions
"autosv" ; auto save
"basic" ; basic commands
;;; -*-Scheme-*-
;;;
-;;; $Id: filcom.scm,v 1.207 2000/02/28 20:01:12 cph Exp $
+;;; $Id: filcom.scm,v 1.208 2000/02/28 22:51:09 cph Exp $
;;;
;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology
;;;
(if (and (null? buffers) (not abbrevs-saved?))
(message "(No files need saving)")))))
-;; **** placeholder
-(define (maybe-save-abbrevs no-confirmation?) no-confirmation? #f)
-
(define-variable-per-buffer buffer-offer-save
"True in a buffer means offer to save the buffer on exit
even if the buffer is not visiting a file. Automatically local in
;;; -*-Scheme-*-
;;;
-;;; $Id: modefs.scm,v 1.156 2000/02/24 01:32:14 cph Exp $
+;;; $Id: modefs.scm,v 1.157 2000/02/28 22:51:02 cph Exp $
;;;
;;; Copyright (c) 1985, 1989-2000 Massachusetts Institute of Technology
;;;
(define-key 'fundamental #\m-space 'just-one-space)
(define-key 'fundamental #\m-! 'shell-command)
(define-key 'fundamental #\m-% 'query-replace)
+(define-key 'fundamental #\m-\' 'abbrev-prefix-mark)
(define-key 'fundamental #\m-, 'tags-loop-continue)
(define-key 'fundamental #\m-- 'auto-argument)
(define-key 'fundamental #\m-. 'find-tag)
(define-key 'fundamental '(#\c-h #\v) 'describe-variable)
(define-key 'fundamental '(#\c-h #\w) 'where-is)
\f
+(define-key 'fundamental '(#\c-x #\') 'expand-abbrev)
(define-key 'fundamental '(#\c-x #\c-\[) 'repeat-complex-command)
(define-key 'fundamental '(#\c-x #\c-b) 'list-buffers)
(define-key 'fundamental '(#\c-x #\c-c) 'save-buffers-kill-scheme)
(define-key 'fundamental '(#\c-x #\5 #\f) 'find-file-other-frame)
(define-key 'fundamental '(#\c-x #\5 #\m) 'mail-other-frame)
(define-key 'fundamental '(#\c-x #\5 #\o) 'other-frame)
+\f
(define-key 'fundamental '(#\c-x #\;) 'set-comment-column)
(define-key 'fundamental '(#\c-x #\=) 'what-cursor-position)
(define-key 'fundamental '(#\c-x #\[) 'backward-page)
(define-key 'fundamental '(#\c-x #\]) 'forward-page)
(define-key 'fundamental '(#\c-x #\^) 'enlarge-window)
+(define-prefix-key 'fundamental '(#\c-x #\a))
+(define-key 'fundamental '(#\c-x #\a #\') 'expand-abbrev)
+(define-key 'fundamental '(#\c-x #\a #\+) 'add-mode-abbrev)
+(define-key 'fundamental '(#\c-x #\a #\-) 'inverse-add-global-abbrev)
+(define-key 'fundamental '(#\c-x #\a #\c-a) 'add-mode-abbrev)
+(define-key 'fundamental '(#\c-x #\a #\e) 'expand-abbrev)
+(define-key 'fundamental '(#\c-x #\a #\g) 'add-global-abbrev)
+(define-prefix-key 'fundamental '(#\c-x #\a #\i))
+(define-key 'fundamental '(#\c-x #\a #\i #\g) 'inverse-add-global-abbrev)
+(define-key 'fundamental '(#\c-x #\a #\i #\l) 'inverse-add-mode-abbrev)
+(define-key 'fundamental '(#\c-x #\a #\l) 'add-mode-abbrev)
(define-key 'fundamental '(#\c-x #\b) 'switch-to-buffer)
(define-key 'fundamental '(#\c-x #\c) 'save-buffers-kill-edwin)
(define-key 'fundamental '(#\c-x #\d) 'dired)
;;; -*-Scheme-*-
;;;
-;;;$Id: winout.scm,v 1.13 1999/02/24 21:35:58 cph Exp $
+;;;$Id: winout.scm,v 1.14 2000/02/28 22:50:27 cph Exp $
;;;
-;;; Copyright (c) 1986, 1989-1999 Massachusetts Institute of Technology
+;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology
;;;
;;; This program is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU General Public License as
(char=? (string-ref image 0) char)))
;; above 3 expressions replace (char-graphic? char)
(< (1+ (window-point-x window)) (window-x-size window)))
+ (region-insert-char! point char)
(window-direct-output-insert-char! window char))
(else
(region-insert-char! point char)))