From athas at sigkill.dk Tue Jun 6 23:58:49 2006 From: athas at sigkill.dk (Troels Henriksen) Date: Wed, 07 Jun 2006 01:58:49 +0200 Subject: [climacs-devel] paredit.lisp, regularization of motion commands, and more In-Reply-To: <20060508022636.8A0909800B@pluto.mumble.net> (Taylor R. Campbell's message of "Mon, 8 May 2006 02:26:36 +0000") References: <20060508022636.8A0909800B@pluto.mumble.net> Message-ID: <8764jdygxy.fsf@sigkill.dk> "Taylor R. Campbell" writes: > Any thoughts & comments on any of these ideas? I like these ideas and have begun experimenting with them in my Climacs tree (don't worry, I won't commit anything until it's stable and reviewed here). It seems to work very well and does make it simpler to manage the growing number of commands in Climacs. There is one thing from this proposal that I do not like, though - I do not believe the FORWARD-OBJECT generic function should take a syntax as argument for a number of reasons: * FORWARD-OBJECT is a low-level function that should behave identically across all syntaxes anyway. * FORWARD-OBJECT is part of the buffer protocol, which is used in so many places that changing it would probably cause wide breakage. * FORWARD-OBJECT is used in layers that have no concepts of syntaxes, just buffers. Therefore, FORWARD-OBJECT's interface will be a bit different than the other movement functions, though this should invisible to the user at the command-level. -- \ Troels "Athas" Henriksen /\ - Insert witty signature From athas at sigkill.dk Wed Jun 7 13:25:27 2006 From: athas at sigkill.dk (Troels Henriksen) Date: Wed, 07 Jun 2006 15:25:27 +0200 Subject: [climacs-devel] paredit.lisp, regularization of motion commands, and more In-Reply-To: <8764jdygxy.fsf@sigkill.dk> (Troels Henriksen's message of "Wed, 07 Jun 2006 01:58:49 +0200") References: <20060508022636.8A0909800B@pluto.mumble.net> <8764jdygxy.fsf@sigkill.dk> Message-ID: <87k67tayig.fsf@sigkill.dk> Troels Henriksen writes: > I like these ideas and have begun experimenting with them in my > Climacs tree. It works nicely so far, but I have run into a few issues that seem to require refactoring of some parts of Climacs. Here is my analysis: buffer.lisp implements the buffer protocol which is suitable for our needs. It provides a basic interface to the buffer implementation and has no concept of syntaxes, hence, higher-level facilities (indeed, almost any directly user-oriented functionality) should be implemented elsewhere. base.lisp is built on top of the buffer protocol and currently provides more high-level facilities, such as moving the mark by line, word, and so forth. However, base.lisp does not have the concept of a syntax either, meaning that functions such as FORWARD-WORD can not be (simply) implemented based on what a given syntax considers a word. Also, base.lisp is used be syntax.lisp to implement the syntax facilities, so making base.lisp understand syntaxes would probably be a bit of a kludge. Hence, I propose making base.lisp provide nothing but simple facilities that are not dependent on subjective terms such as "word", but instead rely on final definitions such as "line", "buffer" and "object", all of which are cast in stone by the buffer protocol. Well, almost. I believe that base.lisp should not export any functions that move the mark or change the contents of the buffer, but only functions that can be used to query marks and buffers for information - for example END-OF-LINE-P, DO-BUFFER-REGION, END-OF-BUFFER-P, etc. I suggest moving the functions that move the mark to a file and package ("motion.lisp") that implements Taylor Campbell's framework for defining motion functions, and which understands the concept of a syntax, thereby permitting the implementation of functions such as FORWARD-WORD to use the definition of a word specified by a given syntax. The functions that modify the buffer contents should be moved to a file and package ("editing.lisp") that understands the concept of a syntax, like motion.lisp. editing.lisp should probably be implemented using the facilities defined in motion.lisp. syntax.lisp will also require a bit of modification - the definitions of the FORWARD-FOO functions should be moved to motion.lisp, and a number of generic predicates (WORD-CONSTITUENT-P, WHITESPACEP, etc) should be provided instead; a building block for implementing syntax-aware motion- and editing-functions. Any comments? -- \ Troels "Athas" Henriksen /\ - Insert witty signature From athas at sigkill.dk Sat Jun 10 22:05:09 2006 From: athas at sigkill.dk (Troels Henriksen) Date: Sun, 11 Jun 2006 00:05:09 +0200 Subject: [climacs-devel] paredit.lisp, regularization of motion commands, and more In-Reply-To: <87k67tayig.fsf@sigkill.dk> (Troels Henriksen's message of "Wed, 07 Jun 2006 15:25:27 +0200") References: <20060508022636.8A0909800B@pluto.mumble.net> <8764jdygxy.fsf@sigkill.dk> <87k67tayig.fsf@sigkill.dk> Message-ID: <87r71w1xbe.fsf@sigkill.dk> Troels Henriksen writes: > It works nicely so far, but I have run into a few issues that seem to > require refactoring of some parts of Climacs. Here is my analysis: And now I can present some code. I am not ready to commit to the tree, as I am pretty sure there are still some things that do not work properly (because some functions have changed their signature), but it compiles cleanly and works for the trivial editing tests I have performed (including use of the more advanced commands in Lisp syntax). Also, this patch reworks a number of editing, deletion and killing functions and commands into a framework similar to what Taylor Campbell proposed for the motion functions and commands. I am not quite sure that limit actions are being used properly though. The patch, which should apply to a fresh Climacs tree, can be found at: http://sigkill.dk/code/motion-editing-refactoring.diff Please review and test it, and don't hesitate to criticize the approach taken. -- \ Troels "Athas" Henriksen /\ - Insert witty signature From athas at sigkill.dk Sat Jun 17 22:35:39 2006 From: athas at sigkill.dk (Troels Henriksen) Date: Sun, 18 Jun 2006 00:35:39 +0200 Subject: [climacs-devel] Patch for putting Swine in Climacs Message-ID: <87r71nz9z8.fsf@sigkill.dk> Attached to this post is a work-in-progress patch to Climacs that integrates Swine with the Lisp syntax. I have based this on the Swine from CLIM-desktop, minus the stuff requiring Clouseau or Closure, but with a few cleanups, and a slight change in the informal protocol used to query the Lisp for information: the functions now take an "image" parameter taken from the syntax object. If NIL, the Swine functions will basically not work. The idea is that code added to climacs.asd tries to detect whether or not Swank is available, and if it is, loads lisp-syntax-swank.lisp that sets up Lisp syntax objects to use Swank for evaluating code, jumping to definitions, etc. (stuff that would be broken without Swank). This also opens up the possibility of creating a remote-image-objet for connecting Climacs to a remote Lisp like SLIME is capable of, but this will require a few more modifications of how the Lisp syntax works. This patch is obviously not clean enough to commit yet, but please comment on it if you feel that the approach taken is suboptimal. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: climacs-swine.diff URL: -------------- next part -------------- -- \ Troels "Athas" Henriksen /\ - Insert witty signature From athas at sigkill.dk Thu Jun 29 14:42:19 2006 From: athas at sigkill.dk (Troels Henriksen) Date: Thu, 29 Jun 2006 16:42:19 +0200 Subject: [climacs-devel] Patch for putting Swine in Climacs In-Reply-To: <87r71nz9z8.fsf@sigkill.dk> (Troels Henriksen's message of "Sun, 18 Jun 2006 00:35:39 +0200") References: <87r71nz9z8.fsf@sigkill.dk> Message-ID: <871wt89g6s.fsf@sigkill.dk> I think I have gotten most of the quirks worked out. Unless I hear complaints, I'm going to commit this patch to the Climacs repo in a few days: http://sigkill.dk/code/climacs-swine.diff It's not complete and it's not perfect, but it works as well as the Swine in CLIM-desktop. When this has been committed I'm going to start work on making the Lisp syntax less expectant on being able to work with true Lisp objects, eventually leading to the possibility of developing a remote-Swank-backend like the one in SLIME. -- \ Troels "Athas" Henriksen /\ - Insert witty signature