From thenriksen at common-lisp.net Wed Feb 1 21:57:56 2006 From: thenriksen at common-lisp.net (thenriksen) Date: Wed, 1 Feb 2006 15:57:56 -0600 (CST) Subject: [climacs-cvs] CVS climacs Message-ID: <20060201215756.41A8F10300@common-lisp.net> Update of /project/climacs/cvsroot/climacs In directory common-lisp:/tmp/cvs-serv16117 Modified Files: lisp-syntax.lisp Log Message: Fixed bug that would result in an error when a backward-expression command was invoked on an expression last in the file but with one or more comments following it. --- /project/climacs/cvsroot/climacs/lisp-syntax.lisp 2006/01/11 18:52:45 1.41 +++ /project/climacs/cvsroot/climacs/lisp-syntax.lisp 2006/02/01 21:57:56 1.42 @@ -1457,7 +1457,11 @@ (form-before-in-children (children first) offset)))) ((and (>= offset (end-offset first)) (or (null rest) - (<= offset (start-offset (first-form rest))))) + ;; `first-form' may return NIL if there are nothing but + ;; comments left; in that case, just take a comment + ;; with `first'. + (<= offset (start-offset (or (first-form rest) + (first rest)))))) (return (let ((potential-form (when (typep first 'list-form) (form-before-in-children (children first) offset)))) From thenriksen at common-lisp.net Tue Feb 7 15:21:30 2006 From: thenriksen at common-lisp.net (thenriksen) Date: Tue, 7 Feb 2006 09:21:30 -0600 (CST) Subject: [climacs-cvs] CVS climacs Message-ID: <20060207152130.C31D36000D@common-lisp.net> Update of /project/climacs/cvsroot/climacs In directory common-lisp:/tmp/cvs-serv12315 Modified Files: packages.lisp misc-commands.lisp lisp-syntax.lisp gui.lisp climacs.asd Log Message: Refactored the Lisp syntax module so it is no longer integrated with the global command table and gui.lisp. --- /project/climacs/cvsroot/climacs/packages.lisp 2005/11/12 23:09:34 1.83 +++ /project/climacs/cvsroot/climacs/packages.lisp 2006/02/07 15:21:30 1.84 @@ -161,6 +161,31 @@ #:url #:climacs-textual-view #:+climacs-textual-view+)) +(defpackage :esa + (:use :clim-lisp :clim) + (:export #:minibuffer-pane #:display-message + #:esa-pane-mixin #:previous-command + #:info-pane #:master-pane + #:esa-frame-mixin #:windows #:recordingp #:executingp + #:*numeric-argument-p* #:*current-gesture* + #:esa-top-level #:simple-command-loop + #:global-esa-table #:keyboard-macro-table + #:help-table + #:set-key + #:find-applicable-command-table)) + +(defpackage :climacs-gui + (:use :clim-lisp :clim :climacs-buffer :climacs-base :climacs-abbrev :climacs-syntax + :climacs-kill-ring :climacs-pane :clim-extensions :undo :esa) + ;;(:import-from :lisp-string) + (:export :climacs ; Main entry point. + ;; GUI functions follow. + :current-window + :point + :syntax + :mark + :insert-character)) + (defpackage :climacs-fundamental-syntax (:use :clim-lisp :clim :climacs-buffer :climacs-base :climacs-syntax :flexichain :climacs-pane) @@ -182,24 +207,7 @@ (defpackage :climacs-lisp-syntax (:use :clim-lisp :clim :climacs-buffer :climacs-base - :climacs-syntax :flexichain :climacs-pane) + :climacs-syntax :flexichain :climacs-pane :climacs-gui) (:export :lisp-string)) -(defpackage :esa - (:use :clim-lisp :clim) - (:export #:minibuffer-pane #:display-message - #:esa-pane-mixin #:previous-command - #:info-pane #:master-pane - #:esa-frame-mixin #:windows #:recordingp #:executingp - #:*numeric-argument-p* #:*current-gesture* - #:esa-top-level #:simple-command-loop - #:global-esa-table #:keyboard-macro-table - #:help-table - #:set-key - #:find-applicable-command-table)) -(defpackage :climacs-gui - (:use :clim-lisp :clim :climacs-buffer :climacs-base :climacs-abbrev :climacs-syntax - :climacs-kill-ring :climacs-pane :clim-extensions :undo :esa) - (:import-from :climacs-lisp-syntax :lisp-string) - (:export :climacs)) --- /project/climacs/cvsroot/climacs/misc-commands.lisp 2005/11/12 23:09:34 1.2 +++ /project/climacs/cvsroot/climacs/misc-commands.lisp 2006/02/07 15:21:30 1.3 @@ -1304,16 +1304,6 @@ (loop repeat count do (up-list point syntax)) (loop repeat (- count) do (backward-up-list point syntax))))) -(define-command (com-eval-defun :name t :command-table lisp-table) () - (let* ((pane (current-window)) - (point (point pane)) - (syntax (syntax (buffer pane)))) - (eval-defun point syntax))) - -(set-key 'com-eval-defun - 'lisp-table - '((#\x :control :meta))) - (define-command (com-beginning-of-definition :name t :command-table movement-table) ((count 'integer :prompt "Number of definitions")) (let* ((pane (current-window)) @@ -1354,11 +1344,5 @@ 'marking-table '((#\h :control :meta))) -(define-command (com-package :name t :command-table lisp-table) () - (let* ((pane (current-window)) - (syntax (syntax (buffer pane))) - (package (climacs-lisp-syntax::package-of syntax))) - (display-message (format nil "~s" package)))) - (define-command (com-visible-mark :name t :command-table marking-table) () (setf (mark-visible-p (current-window)) (not (mark-visible-p (current-window))))) --- /project/climacs/cvsroot/climacs/lisp-syntax.lisp 2006/02/01 21:57:56 1.42 +++ /project/climacs/cvsroot/climacs/lisp-syntax.lisp 2006/02/07 15:21:30 1.43 @@ -24,6 +24,14 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; +;;; The command table. + +(make-command-table 'lisp-table + :errorp nil + :inherit-from '(climacs-gui::global-climacs-table)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; ;;; the syntax object (define-syntax lisp-syntax (basic-syntax) @@ -36,7 +44,8 @@ (scan) (package)) (:name "Lisp") - (:pathname-types "lisp" "lsp" "cl")) + (:pathname-types "lisp" "lsp" "cl") + (:command-table lisp-table)) (defmethod initialize-instance :after ((syntax lisp-syntax) &rest args) (declare (ignore args)) --- /project/climacs/cvsroot/climacs/gui.lisp 2006/01/22 13:20:54 1.200 +++ /project/climacs/cvsroot/climacs/gui.lisp 2006/02/07 15:21:30 1.201 @@ -63,6 +63,14 @@ (defparameter *with-scrollbars* t "If T, classic look and feel. If NIL, stripped-down look (:") +;;; Basic command tables follow. The global command table, +;;; `global-climacs-table', inherits from these, so they should not +;;; contain any overly syntax-specific commands. The idea is that it +;;; should be safe for any syntax to inherit its command-table from +;;; `global-climacs-table' (so the usual movement, search and +;;; navigation-commands are available), without risking adding alien +;;; commands that require the buffer to be in a specific syntax. + ;;; Basic functionality (make-command-table 'base-table :errorp nil) ;;; buffers @@ -83,8 +91,6 @@ (make-command-table 'indent-table :errorp nil) ;;; information about the buffer (make-command-table 'info-table :errorp nil) -;;; lisp-related commands -(make-command-table 'lisp-table :errorp nil) ;;; marking things (make-command-table 'marking-table :errorp nil) ;;; moving around @@ -124,7 +130,6 @@ fill-table indent-table info-table - lisp-table marking-table movement-table pane-table --- /project/climacs/cvsroot/climacs/climacs.asd 2005/11/23 17:39:28 1.40 +++ /project/climacs/cvsroot/climacs/climacs.asd 2006/02/07 15:21:30 1.41 @@ -69,7 +69,8 @@ (:file "prolog-syntax" :depends-on ("packages" "base" "syntax" "pane" "buffer")) (:file "prolog2paiprolog" :depends-on ("prolog-syntax")) (:file "ttcn3-syntax" :depends-on ("packages" "buffer" "syntax" "base" "pane")) - (:file "lisp-syntax" :depends-on ("packages" "syntax" "buffer" "base" "pane")) + (:file "lisp-syntax" :depends-on ("packages" "syntax" "buffer" "base" "pane" "gui")) + (:file "lisp-syntax-commands" :depends-on ("lisp-syntax")) (:file "esa" :depends-on ("packages")) (:file "gui" :depends-on ("packages" "syntax" "base" "buffer" "undo" "pane" "esa" "kill-ring" "io" "text-syntax" "abbrev")) From thenriksen at common-lisp.net Tue Feb 7 15:27:50 2006 From: thenriksen at common-lisp.net (thenriksen) Date: Tue, 7 Feb 2006 09:27:50 -0600 (CST) Subject: [climacs-cvs] CVS climacs Message-ID: <20060207152750.BFBB62A037@common-lisp.net> Update of /project/climacs/cvsroot/climacs In directory common-lisp:/tmp/cvs-serv13287 Added Files: lisp-syntax-commands.lisp Log Message: Add file and contents. --- /project/climacs/cvsroot/climacs/lisp-syntax-commands.lisp 2006/02/07 15:27:50 NONE +++ /project/climacs/cvsroot/climacs/lisp-syntax-commands.lisp 2006/02/07 15:27:50 1.1 ;;; -*- Mode: Lisp; Package: CLIMACS-GUI -*- ;;; (c) copyright 2004-2005 by ;;; Robert Strandh (strandh at labri.fr) ;;; (c) copyright 2004-2005 by ;;; Elliott Johnson (ejohnson at fasl.info) ;;; (c) copyright 2005 by ;;; Matthieu Villeneuve (matthieu.villeneuve at free.fr) ;;; (c) copyright 2005 by ;;; Aleksandar Bakic (a_bakic at yahoo.com) ;;; (c) copyright 2006 by ;;; Troels Henriksen (athas at sigkill.dk) ;;; ;;; This library is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU Library General Public ;;; License as published by the Free Software Foundation; either ;;; version 2 of the License, or (at your option) any later version. ;;; ;;; This library is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;; Library General Public License for more details. ;;; ;;; You should have received a copy of the GNU Library General Public ;;; License along with this library; if not, write to the ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;;; Boston, MA 02111-1307 USA. ;;; Commands specific to the Lisp syntax for Climacs. (in-package :climacs-lisp-syntax) (define-command (com-eval-defun :name t :command-table lisp-table) () (let* ((pane (current-window)) (point (point pane)) (syntax (syntax (buffer pane)))) (eval-defun point syntax))) (esa:set-key 'com-eval-defun 'lisp-table '((#\x :control :meta))) (define-command (com-package :name t :command-table lisp-table) () (let* ((pane (current-window)) (syntax (syntax (buffer pane))) (package (climacs-lisp-syntax::package-of syntax))) (display-message (format nil "~s" package)))) (define-command (com-fill-paragraph :name t :command-table lisp-table) () ) (esa:set-key 'com-fill-paragraph 'lisp-table '((#\q :meta))) From rstrandh at common-lisp.net Tue Feb 7 17:51:36 2006 From: rstrandh at common-lisp.net (rstrandh) Date: Tue, 7 Feb 2006 11:51:36 -0600 (CST) Subject: [climacs-cvs] CVS climacs Message-ID: <20060207175136.E05FD2A037@common-lisp.net> Update of /project/climacs/cvsroot/climacs In directory common-lisp:/tmp/cvs-serv8240 Modified Files: lisp-syntax.lisp Log Message: Added indentation for `print-logical-block'. --- /project/climacs/cvsroot/climacs/lisp-syntax.lisp 2006/02/07 15:21:30 1.43 +++ /project/climacs/cvsroot/climacs/lisp-syntax.lisp 2006/02/07 17:51:36 1.44 @@ -1951,6 +1951,7 @@ (define-simple-indentor (defparameter indent-form)) (define-simple-indentor (defconstant indent-form)) (define-simple-indentor (lambda indent-ordinary-lambda-list)) +(define-simple-indentor (pprint-logical-block indent-list)) ;;; non-simple-cases: LOOP, MACROLET, FLET, LABELS From thenriksen at common-lisp.net Thu Feb 9 15:26:08 2006 From: thenriksen at common-lisp.net (thenriksen) Date: Thu, 9 Feb 2006 09:26:08 -0600 (CST) Subject: [climacs-cvs] CVS climacs Message-ID: <20060209152608.392474D00D@common-lisp.net> Update of /project/climacs/cvsroot/climacs In directory common-lisp:/tmp/cvs-serv29045 Modified Files: lisp-syntax.lisp Log Message: Added methods to indent conditional reader forms. --- /project/climacs/cvsroot/climacs/lisp-syntax.lisp 2006/02/07 17:51:36 1.44 +++ /project/climacs/cvsroot/climacs/lisp-syntax.lisp 2006/02/09 15:26:08 1.45 @@ -1825,6 +1825,25 @@ (values (elt-form (children tree) (1- (car path))) 0)) (t (indent-form syntax (elt-form (children tree) (car path)) (cdr path))))) +;; FIXME: The next two methods are basically identical to the above definition, +;; something should be done about this duplication. + +(defmethod indent-form ((syntax lisp-syntax) (tree reader-conditional-positive-form) path) + (cond ((or (null path) + (and (null (cdr path)) (zerop (car path)))) + (values tree 0)) + ((null (cdr path)) + (values (elt-form (children tree) (1- (car path))) 0)) + (t (indent-form syntax (elt-form (children tree) (car path)) (cdr path))))) + +(defmethod indent-form ((syntax lisp-syntax) (tree reader-conditional-negative-form) path) + (cond ((or (null path) + (and (null (cdr path)) (zerop (car path)))) + (values tree 0)) + ((null (cdr path)) + (values (elt-form (children tree) (1- (car path))) 0)) + (t (indent-form syntax (elt-form (children tree) (car path)) (cdr path))))) + (defmethod indent-form ((syntax lisp-syntax) (tree list-form) path) (if (= (car path) 1) ;; before first element From thenriksen at common-lisp.net Sat Feb 25 10:14:30 2006 From: thenriksen at common-lisp.net (thenriksen) Date: Sat, 25 Feb 2006 05:14:30 -0500 (EST) Subject: [climacs-cvs] CVS climacs Message-ID: <20060225101430.0E2B852003@common-lisp.net> Update of /project/climacs/cvsroot/climacs In directory clnet:/tmp/cvs-serv4217 Modified Files: gui.lisp Log Message: Added `reset-esa' restart to break out of deadlocks. --- /project/climacs/cvsroot/climacs/gui.lisp 2006/02/07 15:21:30 1.201 +++ /project/climacs/cvsroot/climacs/gui.lisp 2006/02/25 10:14:29 1.202 @@ -198,13 +198,23 @@ (defun climacs-rv (&key new-process (process-name "Climacs") (width 900) (height 400)) "Starts up a climacs session" - (let ((*bg-color* +black+) - (*fg-color* +white+) - (*info-bg-color* +blue+) - (*info-fg-color* +yellow+) - (*mini-bg-color* +black+) - (*mini-fg-color* +white+)) - (climacs :new-process new-process :process-name process-name :width width :height height))) + (if new-process + (clim-sys:make-process (lambda () + (let ((*bg-color* +black+) + (*fg-color* +white+) + (*info-bg-color* +blue+) + (*info-fg-color* +yellow+) + (*mini-bg-color* +black+) + (*mini-fg-color* +white+)) + (climacs :new-process nil :width width :height height))) + :name process-name) + (let ((*bg-color* +black+) + (*fg-color* +white+) + (*info-bg-color* +blue+) + (*info-fg-color* +yellow+) + (*mini-bg-color* +black+) + (*mini-fg-color* +white+)) + (climacs :new-process new-process :process-name process-name :width width :height height)))) (defun display-info (frame pane) (declare (ignore frame)) From thenriksen at common-lisp.net Sat Feb 25 10:19:10 2006 From: thenriksen at common-lisp.net (thenriksen) Date: Sat, 25 Feb 2006 05:19:10 -0500 (EST) Subject: [climacs-cvs] CVS climacs Message-ID: <20060225101910.11244550CF@common-lisp.net> Update of /project/climacs/cvsroot/climacs In directory clnet:/tmp/cvs-serv5614 Modified Files: gui.lisp Log Message: Make `climacs-rv' with :new-process t work under SBCL, where dynamic bindings are not inherited by child processes. (Sorry, last commit-message was erroneous.) --- /project/climacs/cvsroot/climacs/gui.lisp 2006/02/25 10:14:29 1.202 +++ /project/climacs/cvsroot/climacs/gui.lisp 2006/02/25 10:19:09 1.203 @@ -198,6 +198,8 @@ (defun climacs-rv (&key new-process (process-name "Climacs") (width 900) (height 400)) "Starts up a climacs session" + ;; SBCL doesn't inherit dynamic bindings when starting new + ;; processes, so start a new processes and THEN setup the colors. (if new-process (clim-sys:make-process (lambda () (let ((*bg-color* +black+) From thenriksen at common-lisp.net Sat Feb 25 10:19:24 2006 From: thenriksen at common-lisp.net (thenriksen) Date: Sat, 25 Feb 2006 05:19:24 -0500 (EST) Subject: [climacs-cvs] CVS climacs Message-ID: <20060225101924.97C275B018@common-lisp.net> Update of /project/climacs/cvsroot/climacs In directory clnet:/tmp/cvs-serv5670 Modified Files: esa.lisp Log Message: Added `reset-esa' restart to break out of deadlocks. --- /project/climacs/cvsroot/climacs/esa.lisp 2005/11/14 16:30:13 1.25 +++ /project/climacs/cvsroot/climacs/esa.lisp 2006/02/25 10:19:24 1.26 @@ -294,7 +294,13 @@ (process-gestures-or-command frame command-table)) (abort-gesture () (display-message "Quit"))) (redisplay-frame-panes frame)) - (return-to-esa () nil)))))) + (return-to-esa () nil) + (reset-esa () + ;; This restart is used to jump out of deadlocks where + ;; ESA will otherwise run an error-inducing gesture again + ;; and again. + (setf (remaining-keys *application-frame*) nil) + nil)))))) (defmacro simple-command-loop (command-table loop-condition end-clauses) (let ((gesture (gensym))