From a4228282401e79ca55d2dd89b5f0e30654364207 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 25 Feb 2000 14:26:56 +0000 Subject: [PATCH] Integrate auto-fill and abbrev into M-x self-insert, as in Emacs. --- v7/src/edwin/basic.scm | 5 +++-- v7/src/edwin/comred.scm | 12 +++++++----- v7/src/edwin/syntax.scm | 7 +++++-- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/v7/src/edwin/basic.scm b/v7/src/edwin/basic.scm index 9072169a5..9afcacdb2 100644 --- a/v7/src/edwin/basic.scm +++ b/v7/src/edwin/basic.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: basic.scm,v 1.133 2000/02/25 14:20:56 cph Exp $ +;;; $Id: basic.scm,v 1.134 2000/02/25 14:23:55 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology ;;; @@ -41,7 +41,8 @@ Whichever character you type to run this command is inserted." (eqv? #\w (char-syntax (extract-left-char)))) ((ref-command expand-abbrev))) (insert-chars char n) - (if (and (or (char=? #\space char) + (if (and allow-auto-fill? + (or (char=? #\space char) (char=? #\newline char)) (current-minor-mode? (ref-mode-object auto-fill))) (auto-fill-break))))) diff --git a/v7/src/edwin/comred.scm b/v7/src/edwin/comred.scm index 75d6ac116..e76d8de90 100644 --- a/v7/src/edwin/comred.scm +++ b/v7/src/edwin/comred.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: comred.scm,v 1.114 1999/01/28 03:59:45 cph Exp $ +;;; $Id: comred.scm,v 1.115 2000/02/25 14:26:56 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 @@ -263,9 +263,11 @@ (cond ((or *executing-keyboard-macro?* *command-argument*) (normal)) ((and (char? *command-key*) - (or (eq? command (ref-command-object self-insert-command)) - (and (eq? command (ref-command-object &auto-fill-space)) - (not (auto-fill-break? point))) + (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)))) (command-argument-self-insert? command))) (let ((non-undo-count *non-undo-count*)) (if (or (fix:= non-undo-count 0) diff --git a/v7/src/edwin/syntax.scm b/v7/src/edwin/syntax.scm index 4557d935f..ba4f0bac7 100644 --- a/v7/src/edwin/syntax.scm +++ b/v7/src/edwin/syntax.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: syntax.scm,v 1.84 1999/05/13 03:06:47 cph Exp $ +;;; $Id: syntax.scm,v 1.85 2000/02/25 14:21:11 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 @@ -33,6 +33,9 @@ (define (group-syntax-table-entries group) (char-syntax-table/entries (group-syntax-table group))) +(define (char-syntax char) + (char->syntax-code (ref-variable syntax-table) char)) + (define-command describe-syntax "Describe the syntax specifications in the syntax table. The descriptions are inserted in a buffer, -- 2.25.1