From athas at sigkill.dk Mon Apr 10 13:37:55 2006 From: athas at sigkill.dk (Troels Henriksen) Date: Mon, 10 Apr 2006 15:37:55 +0200 Subject: [climacs-devel] Question regarding `rest-forms' and associated functions in lisp-syntax.lisp Message-ID: <87r745wnyk.fsf@sigkill.dk> I have a question regarding the functions `rest-forms', `first-form', `nth-form' and the functions built on them. As far as I can see, they are made to make it more convenient to navigate the structure of Lisp forms by stripping away comment-lexemes. They do, however, leave behind lexemes such as `quote-lexeme' and `comma-lexeme'. To me, it would be more logical to make them strip away anything that is not a form, and it would also be much more convenient. Thus, I propose to change these functions to remove anything that is not a form, instead of removing anything that is a comment. Doing this will require trivial changes to the rest of the code, of course, but I'm more concerned about whether I'm missing the point of these functions, as I'm not very familiar with parser theory. Could anyone please enlighten me? -- \ Troels "Athas" Henriksen /\ - Insert witty signature From athas at sigkill.dk Wed Apr 12 12:08:42 2006 From: athas at sigkill.dk (Troels Henriksen) Date: Wed, 12 Apr 2006 14:08:42 +0200 Subject: [climacs-devel] Question regarding `rest-forms' and associated functions in lisp-syntax.lisp In-Reply-To: <87r745wnyk.fsf@sigkill.dk> (Troels Henriksen's message of "Mon, 10 Apr 2006 15:37:55 +0200") References: <87r745wnyk.fsf@sigkill.dk> Message-ID: <87ek03m1x1.fsf@sigkill.dk> Troels Henriksen writes: > Doing this will require trivial changes to the rest of the code I still believe that changing these functions to filter away anything but forms, instead of only comments, is the right thing, but it seems to require slightly more than trivial modifications to the indentation protocol. Before I spend a lot of time on this, I would like to be sure that I have not completely missed what the forms functions are about. -- \ Troels "Athas" Henriksen /\ - Insert witty signature From strandh at labri.fr Tue Apr 18 19:23:54 2006 From: strandh at labri.fr (Robert Strandh) Date: Tue, 18 Apr 2006 21:23:54 +0200 Subject: [climacs-devel] Small patch for buffer info line In-Reply-To: <87vev6dc8s.fsf@debian.Belkin> References: <87vev6dc8s.fsf@debian.Belkin> Message-ID: <17477.15562.737514.977733@serveur5.labri.fr> Edgar Denny writes: > > Attached is a very small patch to correct problem where buffer info line > can show "Top" when point is actually at the bottom of the buffer, > etc. Your patch seems to have some problems. Could you try it again. > Also, I've added line number and column number to the info line. That might be a bad idea at the moment, at least for line number. The reason is that the current buffer implementation requires looping through the entire buffer and counting the newlines each time. I suggest you remove the line number pending a more efficient buffer implementation. -- Robert Strandh --------------------------------------------------------------------- Greenspun's Tenth Rule of Programming: any sufficiently complicated C or Fortran program contains an ad hoc informally-specified bug-ridden slow implementation of half of Common Lisp. --------------------------------------------------------------------- From athas at sigkill.dk Wed Apr 19 13:33:12 2006 From: athas at sigkill.dk (Troels Henriksen) Date: Wed, 19 Apr 2006 15:33:12 +0200 Subject: [climacs-devel] Number recognition in the Lisp syntax module Message-ID: <87slo94rmv.fsf@sigkill.dk> Climacs' Lisp syntax module does not recognize numbers such as "2" or "3.17", though it does recognize them when written as "#2r1" or other complex forms. Instead, the `lex-token' function returns `complete-token-form's, where it should return `number-lexeme'. I think this slightly modified definition of `lex-token' will work: (defun lex-token (scan) ;; May need more work. Can recognize symbols and numbers. (flet ((fo () (forward-object scan))) (let ((could-be-number t) sign-seen dot-seen slash-seen) (flet ((return-token-or-number-lexeme () (return-from lex-token (if could-be-number (make-instance 'number-lexeme) (make-instance 'complete-token-lexeme)))) (this-object () (object-after scan))) (tagbody START (when (end-of-buffer-p scan) (return-token-or-number-lexeme)) (when (constituentp (object-after scan)) (cond ((or (eql (this-object) #\+) (eql (this-object) #\-)) (when sign-seen (setf could-be-number nil)) (setf sign-seen t)) ((eql (this-object) #\.) (when dot-seen (setf could-be-number nil)) (setf dot-seen t)) ((eql (this-object) #\/) (when slash-seen (setf could-be-number nil)) (setf slash-seen t)) ((not (digit-char-p (this-object))) (setf could-be-number nil))) (fo) (go START)) (when (eql (object-after scan) #\\) (fo) (when (end-of-buffer-p scan) (return-from lex-token (make-instance 'incomplete-lexeme))) (fo) (go START)) (when (eql (object-after scan) #\|) (fo) (return-from lex-token (make-instance 'multiple-escape-start-lexeme))) (return-token-or-number-lexeme)))))) I am not very familiar with writing lexers, so I'm going to put it here before committing. It seems to work properly for me, so unless someone points out issues, or I discover any problems, I'll commit it in a day or two. -- \ Troels "Athas" Henriksen /\ - Insert witty signature From splittist at yahoo.com Wed Apr 19 15:56:19 2006 From: splittist at yahoo.com (John Q Splittist) Date: Wed, 19 Apr 2006 15:56:19 +0000 (UTC) Subject: [climacs-devel] Re: Number recognition in the Lisp syntax module References: <87slo94rmv.fsf@sigkill.dk> Message-ID: Troels Henriksen sigkill.dk> writes: > Climacs' Lisp syntax module does not recognize numbers such as "2" or > "3.17", though it does recognize them when written as "#2r1" or other > complex forms. Instead, the `lex-token' function returns > `complete-token-form's, where it should return `number-lexeme'. I punted on this because Climacs cannot know what *READ-BASE* is intended to be when the source file is read, so DIGIT-CHAR-P is only a guess. But, practically speaking, it is probably a good enough guess (and only affects integers and ratios), and if anyone really cares they can implement buffer- local variables and a *buffer-read-base* vrbl (or a Base: entry on the mode- line, like in the good old days) (: JQS From athas at sigkill.dk Wed Apr 19 20:19:59 2006 From: athas at sigkill.dk (Troels Henriksen) Date: Wed, 19 Apr 2006 22:19:59 +0200 Subject: [climacs-devel] Re: Number recognition in the Lisp syntax module In-Reply-To: (John Q. Splittist's message of "Wed, 19 Apr 2006 15:56:19 +0000 (UTC)") References: <87slo94rmv.fsf@sigkill.dk> Message-ID: <87hd4pl3m8.fsf@sigkill.dk> John Q Splittist writes: > (or a Base: entry on the mode-line, like in the good old days) (: I believe Climacs should respect this line and its base settings, if anyone is really crazy enough to want other default bases than 10. I'll write some support for it (if it isn't in there already) and make `lex-token' respect it. -- \ Troels "Athas" Henriksen /\ - Insert witty signature From athas at sigkill.dk Sun Apr 23 14:42:42 2006 From: athas at sigkill.dk (Troels Henriksen) Date: Sun, 23 Apr 2006 16:42:42 +0200 Subject: [climacs-devel] Re: Number recognition in the Lisp syntax module In-Reply-To: <87hd4pl3m8.fsf@sigkill.dk> (Troels Henriksen's message of "Wed, 19 Apr 2006 22:19:59 +0200") References: <87slo94rmv.fsf@sigkill.dk> <87hd4pl3m8.fsf@sigkill.dk> Message-ID: <87ejzos68t.fsf@sigkill.dk> Troels Henriksen writes: > I'll write some support for it (if it isn't in there already) and > make `lex-token' respect it. Well, done. Climacs now supports something like Emacs' local buffer variables, so I'll commit my `lex-token' with support for alternative bases now. I hope nothing breaks. -- \ Troels "Athas" Henriksen /\ - Insert witty signature From athas at sigkill.dk Sun Apr 23 17:03:49 2006 From: athas at sigkill.dk (Troels Henriksen) Date: Sun, 23 Apr 2006 19:03:49 +0200 Subject: [climacs-devel] Progress report Message-ID: <871wvorzpm.fsf@sigkill.dk> (I have been asked to write up a progress report. I'm new to this, so please bear with me.) Dear list-members, Since the last progress report, Climacs has been cleaned up in a number of areas, though not much major functionality has been added. Some of the major improvements are: * Climacs will now be more well-behaved when using execute-frame-command thanks to Christophe Rhodes. This opens up the possibility of integrating CLIM-applications through cross-application scripting. * Thanks to Timothy Moore, Climacs should now run under Allegro Common Lisp CLIM(tm) - including modern mode. * ESA has finally been factored out of the main Climacs module and into its own. This should ease maintenance, as ESA previously had to be maintained in both the Climacs and Gsharp repositories. * Climacs now support local options lists, where a file can specify options for Climacs by putting "-*- {Option-name: Value;}* -*-" in the first line of the file. In Emacs, this feature is known as the local variables list. * The Lisp syntax module has been extended with various new functions for easier navigation of the parse tree (exploitation of this can be seen in the CLIM-desktop repo) as well as conversion of parser tokens to the Lisp objects they represent. A number of bugs have been fixed as well. Of course, there has been the usual bugfixes and new commands (for example an "Indent Expression" command for the Lisp syntax module). Hopefully, the cleanups and gradual maturing of the editor will cause more feature-oriented commits over the next few months. The future of Climacs is as bright as ever, and with the general maturing of the free CLIM universe, integration with other CLIM programs should soon come. The "self-documenting" aspect of Climacs should also receive some attention over the next weeks. -- \ Troels "Athas" Henriksen /\ - Insert witty signature From athas at sigkill.dk Mon Apr 24 18:58:38 2006 From: athas at sigkill.dk (Troels Henriksen) Date: Mon, 24 Apr 2006 20:58:38 +0200 Subject: [climacs-devel] Climacs - self documenting editor? Message-ID: <87lktu94wx.fsf@sigkill.dk> Climacs is severely lacking in the self-documenting aspect of The Emacs Way. ESA has a few functions that can be used to find out about available commands, but that's it. I believe the facilities in ESA should be expanded, but, unfortunately, ESA does not have the concept of a typeout-pane, and the minibuffer is far too small for complete documentation, so these functions will have to present their documentation to a user-provided string. I have attached a file to this post that contains code for an implementation of the C-h f and C-h k help commands from Emacs. My idea is that the functions should go in ESA and the command definitions in the applications themselves. In this case, I've just put everything in the CLIMACS-GUI package though. Please comment on my approach (and start writing docstrings ;-). -------------- next part -------------- A non-text attachment was scrubbed... Name: climacs-help.lisp Type: application/octet-stream Size: 4430 bytes Desc: not available URL: -------------- next part -------------- -- \ Troels "Athas" Henriksen /\ - Insert witty signature From splittist at yahoo.com Tue Apr 25 06:59:35 2006 From: splittist at yahoo.com (John Q Splittist) Date: Tue, 25 Apr 2006 06:59:35 +0000 (UTC) Subject: [climacs-devel] Re: Climacs - self documenting editor? References: <87lktu94wx.fsf@sigkill.dk> Message-ID: Troels Henriksen sigkill.dk> writes: > > Climacs is severely lacking in the self-documenting aspect of The > Emacs Way. True. I present the attached as a start on the other end of the problem, knowing that it is easier to edit than compose (and criticise than edit). Because I have an ancient climacs tree, this is not presented as a diff. I am happy to do the donkey work of moving the strings to the commands once I rejoin teh intarweb. JQS esa.lisp: com-quit "Exit climacs, but first ask if you want modified buffers to be saved. If you decide not to save a modified buffer, you will be asked to confirm your decision to exit." esa.lisp: com-extended-command "Prompt for a command name and its arguments (if any), then run it." esa.lisp: com-describe-key-briefly "Prompt for a key and print the name of the command it invokes." esa.lisp: com-where-is "Prompt for a command name and print the key that invokes it." esa.lisp: com-describe-bindings "Pop up a help window showing which keys invoke which commands. Without a numeric prefix, sorts the list by command name. With a numeric prefix, sorts by key." esa.lisp: com-start-kbd-macro "Start recording keys to define a keyboard macro. Use C-x ) to finish recording the macro, and C-x e to run it." esa.lisp: com-end-kbd-macro "Finish recording keys that define a keyboard macro. Use C-x ( to start recording a macro, and C-x e to run it." esa.lisp: com-call-last-kbd-macro "Run the last keyboard macro that was defined. Use C-x ( to start and C-x ) to finish recording a keyboard macro." file-commands.lisp: com-find-file "Prompt for a filename then edit that file. If a buffer is already visiting that file, switch to that buffer. Does not create a file if the filename given does not name an existing file." file-commands.lisp: com-find-file-read-only "Prompt for a filename then open that file readonly. If a buffer is already visiting that file, switch to that buffer. If the filename given does not name an existing file, signal an error." file-commands.lisp: com-read-only "Toggle the readonly status of the current buffer. When a buffer is readonly, attempts to change the contents of the buffer signal an error." file-commands.lisp: com-set-visited-file-name "Prompt for a filename and set the name of the file visited by the current buffer to that name. The next time the buffer is saved it will be saved to a file with that filename." file-commands.lisp: com-insert-file "Prompt for a filename and insert the contents of that file at point. Leaves mark after the inserted contents." file-commands.lisp: com-revert-buffer "Replace the contents of the current buffer with the visited file. Signals an error if the file does not exist." file-commands.lisp: com-save-buffer "Write the contents of the buffer to a file. If there is filename associated with the buffer, write to that file, replacing its contents. If not, prompt for a filename." file-commands.lisp: com-write-buffer "Prompt for a filename and write the contents of the current buffer to that file. Changes the file visted by the buffer to the given file." gui.lisp: com-full-redisplay "Redisplay the contents of the current window. FIXME: does this really have that effect?" gui.lisp: com-load-file "Prompt for a filename and CL:LOAD that file. Signals and error if the file does not exist." gui.lisp: com-switch-to-buffer "Prompt for a buffer name and switch to that buffer. If the a buffer with that name does not exist, create it. Uses the name of the next buffer (if any) as a default." gui.lisp: com-kill-buffer "Prompt for a buffer name and kill that buffer. If the buffer needs saving, will prompt you to do so before killing it. Uses the current buffer as a default." lisp-syntax-commands.lisp: com-eval-defun "" lisp-syntax-commands.lisp: com-package "Print the name of the package of the current buffer. The package is found by looking for the first CL:IN-PACKAGE form in the buffer. COMMON-LISP is the default." lisp-syntax-commands.lisp: com-fill-paragraph "" misc-commands.lisp: com-overwrite-mode "Toggle overwrite mode for the current mode. When overwrite is on, an object entered on the keyboard will replace the object after the point. When overwrite is off (the default), objects are inserted at point. In both cases point is positioned after the new object." misc-commands.lisp: com-not-modified "Clear the modified flag for the current buffer. The modified flag is automatically set when the contents of the buffer are changed. This flag is consulted, for instance, when deciding whether to prompt you to save the buffer before killing it." misc-commands.lisp: com-set-fill-column "Set the fill column to the specified value. You must supply a numeric argument. The fill column is the column beyond which automatic line-wrapping will occur. The default fill column is 70." misc-commands.lisp: com-self-insert "" misc-commands.lisp: com-beginning-of-line "Move point to the beginning of the current line." misc-commands.lisp: com-end-of-line "Move point to the end of the current line." misc-commands.lisp: com-delete-object "Delete the object after point. With a numeric argument, kill that many objects after (or before, if negative) point." misc-commands.lisp: com-backward-delete-object "Delete the object before point. With a numeric argument, kills that many objects before (or after, if negative) point." misc-commands.lisp: com-zap-to-object "Prompt for an object and kill the objects between point and the next occurence of that object after point. Characters can be entered in #\ format." misc-commands.lisp: com-zap-to-character "Prompt for a character and kill the objects between point and the next occurence of that character after point. FIXME: Accepts a string (that is, zero or more characters) terminated by a #\NEWLINE. If a zero length string signals an error. If a string of length >1, uses the first character of the string." misc-commands.lisp: com-transpose-objects "Transpose the objects before and after point, advancing point. At the end of a line transpose the previous two objects without advancing point. At the beginning of the buffer do nothing. At the beginning of any line other than the first effectively move the first object of that line to the end of the previous line. FIXME: at the end of a single object line at the beginning of the buffer deletes that object." misc-commands.lisp: com-backward-object "Move point backward one object. With a numeric argument, move point backward (or forward, if negative) that number of objects." misc-commands.lisp: com-forward-object "Move point forward one object. With a numeric argument, move point forward (or backward, if negative) that number of objects." misc-commands.lisp: com-transpose-words "Transpose the words around point, leaving point at the end of them. With point in the whitespace between words, transpose the words before and after point. With point inside a word, transpose that word with the next one. With point before the first word of the buffer, transpose the first two words of the buffer. FIXME: with point after the penultimate word of the buffer, or if there are <2 words in the buffer, Strange Things (TM) happen (including breaking Climacs)." misc-commands.lisp: com-transpose-lines "Transpose current line and previous line, leaving point at the end of them. If point is in the first line, transpose the first two lines. If point is in the last line of the buffer and there is no final #\Newline, add one." misc-commands.lisp: com-previous-line "Move point to the previous line. With a numeric argument, move point up (down, if negative) that many lines. Successive line movement commands seek to respect the 'goal column'." misc-commands.lisp: com-next-line "Move point to the next line. With a numeric argument, move point down (up, if negative) that many lines. Successive line movement commands seek to respect the 'goal column'." misc-commands.lisp: com-open-line "Insert a #\Newline and leave point before it. With a numeric argument greater than 1, insert that many #\Newlines." misc-commands.lisp: com-kill-line "Kill the objects on the current line after point. When at the end of a line, kill the #\Newline. With a numeric argument of 0, kill the objects on the current line before point. With a non-zero numeric argument, kill that many lines forward (backward, if negative) from point. Successive kills append to the kill ring." misc-commands.lisp: com-forward-word "Move point to the next word end. With a numeric argument, move point forward (backward, if negative) that many words." misc-commands.lisp: com-backward-word "Move point to the previous word beginning. With a numeric argument, move point backward (forward, if negative) that many words." misc-commands.lisp: com-delete-word "Delete from point until the next word end. With a positive numeric argument, delete that many words forward." misc-commands.lisp: com-kill-word "Kill from point until the next word end. With a numeric argument, kill forward (backward, if negative) that many words. Successive kills append to the kill ring." misc-commands.lisp: com-backward-kill-word "Kill from point until the previous word beginning. With a numeric argument, kill backward (forward, if negative) that many words. Successive kills append to the kill ring." misc-commands.lisp: com-mark-word "Place mark at the next word end. With a positive numeric argument, place mark at the end of that many words forward. With a negative numeric argument, place mark at the beginning of that many words backward. Successive invocations extend the selection." misc-commands.lisp: com-backward-delete-word "Delete from point until the previous word beginning. With a positive numeric argument, delete that many words backward." misc-commands.lisp: com-upcase-region "Convert the region to upper case." misc-commands.lisp: com-downcase-region "Convert the region to lower case." misc-commands.lisp: com-capitalize-region "Capitalize each word in the region." misc-commands.lisp: com-upcase-word "Convert the characters from point until the next word end to upper case. Leave point at the word end." misc-commands.lisp: com-downcase-word "Convert the characters from point until the next word end to lower case. Leave point at the word end." misc-commands.lisp: com-capitalize-word "Capitalize the next word. If point is in a word, convert the next character to upper case and the remaining letters in the word to lower case. If point is before the start of a word, convert the first character of that word to upper case and the rest of the letters to lower case. Leave point at the word end." misc-commands.lisp: com-tabify-region "Replace runs of spaces with tabs in region where possible. Uses TAB-SPACE-COUNT of the STREAM-DEFAULT-VIEW of the pane." misc-commands.lisp: com-untabify-region "Replace tabs with equivalent runs of spaces in the region. Uses TAB-SPACE-COUNT of the STREAM-DEFAULT-VIEW of the pane." misc-commands.lisp: com-indent-line "" misc-commands.lisp: com-newline-and-indent "" misc-commands.lisp: com-delete-indentation "Join current line to previous non-blank line. Leaves a single space between the last non-whitespace object of the previous line and the first non-whitespace object of the current line, and point after that space. If there is no previous non-blank line, deletes all whitespace at the beginning of the buffer at leaves point there." misc-commands.lisp: com-auto-fill-mode "Toggle auto fill mode status. When auto fill mode is on..." misc-commands.lisp: com-fill-paragraph "" misc-commands.lisp: com-beginning-of-buffer "Move point to the beginning of the buffer." misc-commands.lisp: com-page-down "" misc-commands.lisp: com-page-up "" misc-commands.lisp: com-end-of-buffer "Move point to the end of the buffer." misc-commands.lisp: com-mark-whole-buffer "Place point at the beginning and mark at the end of the buffer." misc-commands.lisp: com-back-to-indentation "Move point to the first non-whitespace object on the current line. If there is no non-whitespace object, leaves point at the end of the line." misc-commands.lisp: com-delete-horizontal-space "Delete whitespace around point. With a numeric argument, only delete whitespace before point." misc-commands.lisp: com-just-one-space "Delete whitespace around point, leaving a single space. With a positive numeric argument, leave that many spaces. FIXME: should distinguish between types of whitespace." misc-commands.lisp: com-goto-position "Prompts for an integer, and sets the offset of point to that integer." misc-commands.lisp: com-goto-line "Prompts for a line number, and sets point to the beginning of that line. The first line of the buffer is 1. Giving a number <1 leaves point at the beginning of the buffer. Giving a line number larger than the number of the last line in the buffer leaves point at the beginning of the last line of the buffer." misc-commands.lisp: com-browse-url "" misc-commands.lisp: com-set-mark "Set mark to the current position of point." misc-commands.lisp: com-exchange-point-and-mark "Exchange the positions of point and mark." misc-commands.lisp: com-set-syntax "Prompts for a syntax to set for the current buffer. Setting a syntax will cause the buffer to be reparsed using the new syntax." misc-commands.lisp: com-yank "Insert the objects most recently added to the kill ring at point." misc-commands.lisp: com-kill-region "Kill the objects between point and mark. That is, push them onto the kill ring, and delete them from the buffer." misc-commands.lisp: com-copy-region "Copy the objects between point and mark to the kill ring." misc-commands.lisp: com-rotate-yank "Replace the immediately previously yanked objects with others. Must be given immediately following a Yank or Rotate Yank command. The replacement objects are those before the previously yanked objects in the kill ring." misc-commands.lisp: com-resize-kill-ring "Prompt for a new size for the kill ring. The default is 5. A number less than 5 will be replaced by 5." misc-commands.lisp: com-append-next-kill "Set the kill ring to append the next kill to the previous one." misc-commands.lisp: com-undo "" misc-commands.lisp: com-redo "" misc-commands.lisp: com-dabbrev-expand "Expand word before point dynamically. Search from point (first backward to the beginning of the buffer, then forward) for words for which the word before point is a prefix, inserting each in turn at point as an expansion." misc-commands.lisp: com-backward-paragraph "Move point to the previous paragraph start. With a numeric argument, move point backward (forward, if negative) that many paragraphs." misc-commands.lisp: com-forward-paragraph "Move point to the next paragraph end. With a numeric argument, move point forward (backward, if negative) that many paragraphs." misc-commands.lisp: com-mark-paragraph "Place point and mark around the current paragraph. Put point at the beginning of the current paragraph, and mark at the end. With a positive numeric argument, put mark that many paragraphs forward. With a negative numeric argument, put point at the end of the current paragraph and mark that many paragraphs backward. Successive invocations extend the selection. FIXME: when called with point already at the beginning or end of a paragraph marks 2 paras." misc-commands.lisp: com-backward-sentence "Move point to the previous sentence beginning. With a numeric argument, move point backward (forward if negative) that many sentences." misc-commands.lisp: com-forward-sentence "Move point to the next sentence end. With a numeric argument, move point forward (backward if negative) that many sentences." misc-commands.lisp: com-kill-sentence "Kill the objects from point to the next sentence end. With a numeric argument, kill forward (backward if negative) that many sentences." misc-commands.lisp: com-backward-kill-sentence "Kill the objects from point to the previous sentence beginning. With a numeric argument, kill backward (forward if negative) that many sentences." misc-commands.lisp: com-forward-page "Move point to the beginning of the next page. With a numeric argument, move point forward (backward if negative) that many pages. When no page delimeter is found, leave point at the end of the buffer. A page is delimited by the sequence #\Newline #\Page." misc-commands.lisp: com-backward-page "Move point to the end of the previous page. With a numeric argument, move point backward (forward if negative) that many pages. When no page delimeter is found, leave point at the beginning of the buffer. A page is delimited by the sequence #\Newline #\Page." misc-commands.lisp: com-mark-page "Place point and mark around the current page. With a numeric argument, move point that many pages forward (backward if negative) before marking the surrounding page. When no page delimeters are found, leave point at the beginning and mark at the end of the buffer. A page is delimited by the sequence #\Newline #\Page." misc-commands.lisp: com-count-lines-page "Print the number of lines in the current page. Also prints the number of lines before and after point (as '(b + a)'). FIXME: the count is off by one." misc-commands.lisp: com-count-lines-region "Print the number of lines in the region. Also prints the number of objects (as 'o character[s]'). FIXME: line count is off by one." misc-commands.lisp: com-what-cursor-position "Print information about point. Gives the character after point (name and octal, decimal and hexidecimal charcode), the offset of point, the total objects in the buffer, and the percentage of the buffers objects before point. FIXME: gives no information at end of buffer." misc-commands.lisp: com-eval-expression "Prompt for and evaluate a lisp expression. With a numeric argument inserts the result at point as a string; otherwise prints the result." misc-commands.lisp: com-comment-region "" misc-commands.lisp: com-backward-expression "Move point backward one expression. With a numeric argument, move backward (forward if negative) that many expressions. The meaning of 'expression' is given by the relevant syntax. The Lisp syntax, for example, uses s-expressions. FIXME: I'm not sure it does." misc-commands.lisp: com-forward-expression "Move point forward one expression. With a numeric argument, move forward (backward if negative) that many expressions. The meaning of 'expression' is given by the relevant syntax. The Lisp syntax, for example, uses s-expressions." misc-commands.lisp: com-mark-expression "Place mark at the next expression end. With a numeric argument, place mark forward (backward if negative) that many expressions. Successive invocations extend the selection." misc-commands.lisp: com-kill-expression "Kill objects up to the next expression end. With a numeric argument, kill forward (backward if negative) that many expressions." misc-commands.lisp: com-backward-kill-expression "Kill objects back to the previous expression beginning. With a numeric argument, kill backward (forward if negative) that many expressions." misc-commands.lisp: com-insert-parentheses "Insert a pair of parentheses, leaving point in between. With a numeric argument, enclose that many expressions forward (backward if negative). FIXME: no it doesn't." misc-commands.lisp: com-forward-list "Move point forward across a delimited list. With a numeric argument, move forward (backward if negative) that many lists." misc-commands.lisp: com-backward-list "Move point backward across a delimited list. With a numeric argument, move backward (forward if negative) that many lists." misc-commands.lisp: com-down-list "Move point forward down one level of delimited list. With a numeric argument, move forward (backward if negative) down that many lists." misc-commands.lisp: com-backward-down-list "Move point backward down one level of delimited list. With a numeric argument, move backward (forward if negative) down that many lists." misc-commands.lisp: com-backward-up-list "Move point backward up one level of delimited list. With a numeric argument, move backward (forward if negative) up that many lists." misc-commands.lisp: com-up-list "Move point forward up one level of delimited list. With a numeric argument, move forward (backward if negative) up that many lists." misc-commands.lisp: com-beginning-of-definition "Move point to the previous definition beginning. With a numeric argument, move backward (forward if negative) that many definitions. FIXME: negative arg actually does end-of-definition. FIXME: should take account of CLHS 3.2.3.1 .../HyperSpec/Body/03_bca.htm" misc-commands.lisp: com-end-of-definition "Move point to the following definition end. With a numeric argument, move forward (backward if negative) that many defintions. FIXME: negative arg actually does beginning-of-definition. FIXME: see second FIXME for com-beginning-of-definition." misc-commands.lisp: com-mark-definition "Place point and mark around the current definition. Successive invocations extend the selection." misc-commands.lisp: com-visible-mark "Toggle the visibility of the mark in the current pane. This is particularly (only?) useful for experimenting with marking commands." search-commands.lisp: com-isearch-forward search-commands.lisp: com-isearch-backward search-commands.lisp: com-isearch-append-char search-commands.lisp: com-isearch-delete-char search-commands.lisp: com-isearch-search-forward search-commands.lisp: com-isearch-search-backward search-commands.lisp: com-isearch-exit search-commands.lisp: com-query-replace search-commands.lisp: com-query-replace-replace search-commands.lisp: com-query-replace-skip search-commands.lisp: com-query-replace-exit search-commands.lisp: com-regex-search-forward search-commands.lisp: com-regex-search-backward unicode-commands.lisp: com-insert-charcode window-commands.lisp: com-split-window-vertically window-commands.lisp: com-split-window-horizontally window-commands.lisp: com-other-window window-commands.lisp: com-single-window window-commands.lisp: com-scroll-other-window window-commands.lisp: com-scroll-other-window-up window-commands.lisp: com-delete-window From csr21 at cam.ac.uk Wed Apr 26 09:39:22 2006 From: csr21 at cam.ac.uk (Christophe Rhodes) Date: Wed, 26 Apr 2006 10:39:22 +0100 Subject: [climacs-devel] Climacs - self documenting editor? In-Reply-To: <87lktu94wx.fsf@sigkill.dk> (Troels Henriksen's message of "Mon, 24 Apr 2006 20:58:38 +0200") References: <87lktu94wx.fsf@sigkill.dk> Message-ID: Troels Henriksen writes: > Climacs is severely lacking in the self-documenting aspect of The > Emacs Way. ESA has a few functions that can be used to find out about > available commands, but that's it. I believe the facilities in ESA > should be expanded, but, unfortunately, ESA does not have the concept > of a typeout-pane, and the minibuffer is far too small for complete > documentation, so these functions will have to present their > documentation to a user-provided string. Maybe to a user-provided stream? > I have attached a file to this post that contains code for an > implementation of the C-h f and C-h k help commands from Emacs. My > idea is that the functions should go in ESA and the command > definitions in the applications themselves. In this case, I've just > put everything in the CLIMACS-GUI package though. Please comment on > my approach (and start writing docstrings ;-). So the potential for really large CVS conflicts is looming, because I have just about got to the bottom of the command-parser framework (in as much as it has a bottom) with a view to replacing all the argumentless esa/gsharp/climacs commands with ones that accept arguments (rather than commands which call ACCEPT in their bodies). The idea behind this is to be able to do (execute-frame-command (find-application-frame 'climacs) `(com-find-file "/tmp/foo")) from other applications: at present, this is not possible because COM-FIND-FILE does not take an argument. I've been playing with the command processor because the climacs minibuffer is small: too small to let the ordinary CLIM command processor take over, as it wants to print newlines or go over 80 characters; I presume that this is why the commands were written this way in the first place. Does anyone know of any other reason that this was done? In the context of this thread, one advantage of this refactoring, from (define-command (com-find-file :name t :command-table buffer-table) () (let* ((filepath (accept 'pathname :prompt "Find File" :default (directory-of-buffer (buffer (current-window))) :default-type 'pathname :insert-default t))) (find-file filepath))) to (define-command (com-find-file :name t :command-table buffer-table) ((filepath 'pathname :prompt "Find File: " :prompt-mode :raw :default (directory-of-buffer (buffer (current-window))) :default-type 'pathname :insert-default t)) (find-file filepath)) is that arguments to commands can be documented as well as the commands themselves. To get this working in McCLIM, in addition to real ugliness in the command processor itself (a new function ESA-COMMAND-PARSER that gets bound to CLIM:*COMMAND-PARSER*), there's an unresolved issue with input editing streams that the patch at works around, so none of this is quite ready for prime-time. Cheers, Christophe From csr21 at cam.ac.uk Wed Apr 26 10:22:13 2006 From: csr21 at cam.ac.uk (Christophe Rhodes) Date: Wed, 26 Apr 2006 11:22:13 +0100 Subject: [climacs-devel] Climacs - self documenting editor? In-Reply-To: (Christophe Rhodes's message of "Wed, 26 Apr 2006 10:39:22 +0100") References: <87lktu94wx.fsf@sigkill.dk> Message-ID: Christophe Rhodes writes: > Does anyone know of any other reason that [argumentless commands > calling accept] was done? Shortly after writing this, I found another reason, or at least a consequence: the ability simply to set key sequences to command names, and have the toplevel pretend to do the right thing. My changes will require settings of the form (esa:set-key `(com-find-file ,*unsupplied-argument-marker*) 'buffer-table '((#\x :control) (#\f :control))) for commands with arguments, rather than simply (esa:set-key 'com-find-file 'buffer-table '((#\x :control) (#\f :control))) can people live with that? Cheers, Christophe From splittist at yahoo.com Wed Apr 26 13:40:05 2006 From: splittist at yahoo.com (John Q Splittist) Date: Wed, 26 Apr 2006 13:40:05 +0000 (UTC) Subject: [climacs-devel] Re: Climacs - self documenting editor? References: <87lktu94wx.fsf@sigkill.dk> Message-ID: Christophe Rhodes cam.ac.uk> writes: > Christophe Rhodes cam.ac.uk> writes: > > > Does anyone know of any other reason that [argumentless commands > > calling accept] was done? > > Shortly after writing this, I found another reason... My changes will > require settings of the form > (esa:set-key `(com-find-file ,*unsupplied-argument-marker*) > 'buffer-table > '((#\x :control) (#\f :control))) > can people live with that? FWIW, I can. It is, perhaps, even preferable, since it provides a clear indication in the source for required arguments when invoked from the keyboard. How does *unsupplied-argument-marker* play with *numeric-argument-marker* and friends? JQS From m.retzlaff at gmx.net Wed Apr 26 13:54:42 2006 From: m.retzlaff at gmx.net (Max-Gerd Retzlaff) Date: Wed, 26 Apr 2006 15:54:42 +0200 Subject: [climacs-devel] Climacs - self documenting editor? In-Reply-To: References: <87lktu94wx.fsf@sigkill.dk> Message-ID: <20060426135441.GA2217@mgr.home> Hello On Wed, Apr 26, 2006 at 11:22:13AM +0100, Christophe Rhodes wrote: > Christophe Rhodes writes: > > > Does anyone know of any other reason that [argumentless commands > > calling accept] was done? > > Shortly after writing this, I found another reason, or at least a > consequence: the ability simply to set key sequences to command names, > and have the toplevel pretend to do the right thing. My changes will > require settings of the form > (esa:set-key `(com-find-file ,*unsupplied-argument-marker*) > 'buffer-table > '((#\x :control) (#\f :control))) > for commands with arguments, rather than simply > (esa:set-key 'com-find-file 'buffer-table '((#\x :control) (#\f :control))) > can people live with that? There is CLIMI::PARTIAL-COMMAND-FROM-NAME that might do a better job than manual construction of the forms as it fills in all required arguments. It's not part of the CLIM specification, though. But in my taste the user (of CLIM) should not have to distinguish between partial and non-partial commands. That's something you have to care about by yourself *under some condition* when using McCLIM (e.g. when there is no input context), and that should be changed. In the meantime at least esa:set-key should "expand" the partial commands, so that one can still write the non-expanded command name with the new command parser. Nice (and necessary) work, Christophe! Bye, Max -- Max-Gerd Retzlaff http://blog.matroid.org For your amusement: In the Halls of Justice the only justice is in the halls. -- Lenny Bruce -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: From csr21 at cam.ac.uk Wed Apr 26 14:19:25 2006 From: csr21 at cam.ac.uk (Christophe Rhodes) Date: Wed, 26 Apr 2006 15:19:25 +0100 Subject: [climacs-devel] Re: Climacs - self documenting editor? In-Reply-To: (John Q. Splittist's message of "Wed, 26 Apr 2006 13:40:05 +0000 (UTC)") References: <87lktu94wx.fsf@sigkill.dk> Message-ID: John Q Splittist writes: > Christophe Rhodes cam.ac.uk> writes: > >> Shortly after writing this, I found another reason... My changes will >> require settings of the form >> (esa:set-key `(com-find-file ,*unsupplied-argument-marker*) >> 'buffer-table >> '((#\x :control) (#\f :control))) > >> can people live with that? > > FWIW, I can. It is, perhaps, even preferable, since it provides a > clear indication in the source for required arguments when invoked > from the keyboard. > > How does *unsupplied-argument-marker* play with > *numeric-argument-marker* and friends? At the moment, *numeric-argument-marker* and *numeric-argument-p* are handled first; then if any argument is eq to *unsupplied-argument-marker*, the partial command processor is called. So they're probably orthogonally handled: I don't know if there would be demand to support something like `(com-foo ,(if *numeric-argument-p* *numeric-argument-marker* *unsupplied-argument-marker*)) or indeed whether or not that currently works: it would depend on whether *numeric-argument-p* is bound at keystroke-interpretation time. In any case, this is handled by process-gestures-or-command, which is called from esa-top-level, so we can basically do whatever we want to :-) To make this discussion a little bit more concrete, I attach my patches to esa, implementing this machinery, and to climacs, beginning to use it. In each patch you get a little bit of noise -- the esa patch also includes unbreaking the describe-bindings functionality, and the climacs patch implements the mode line toggling of modified and read-only. The good news is that the changes to climacs (and other application) commands can be made incrementally; the changes to ESA are backwards compatible. (The bad news is that all of this is blocked on a problem in its interaction with goatee in mcclim itself... If you want to play with these patches, add NIL to the call to erase-output-record in the method on climi::finalize in mcclim/Goatee/editing-stream.lisp) -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: esa.diff URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: climacs.diff URL: -------------- next part -------------- Cheers, Christophe From strandh at labri.fr Wed Apr 26 18:36:13 2006 From: strandh at labri.fr (Robert Strandh) Date: Wed, 26 Apr 2006 20:36:13 +0200 Subject: [climacs-devel] Climacs - self documenting editor? In-Reply-To: References: <87lktu94wx.fsf@sigkill.dk> Message-ID: <17487.48541.751840.437022@serveur5.labri.fr> Christophe Rhodes writes: > I've been playing with the command processor because the climacs > minibuffer is small: too small to let the ordinary CLIM command > processor take over, as it wants to print newlines or go over 80 > characters; I presume that this is why the commands were written this > way in the first place. Does anyone know of any other reason that > this was done? The reason was that, when this was done, McCLIM could not even acquire those arguments correctly, so they had to be acquired explicitly by Climacs. Later, McCLIM was improved to do that, but, as you point out, in a way that is not compatible with the Climacs minibuffer. -- Robert Strandh --------------------------------------------------------------------- Greenspun's Tenth Rule of Programming: any sufficiently complicated C or Fortran program contains an ad hoc informally-specified bug-ridden slow implementation of half of Common Lisp. --------------------------------------------------------------------- From strandh at labri.fr Wed Apr 26 18:39:22 2006 From: strandh at labri.fr (Robert Strandh) Date: Wed, 26 Apr 2006 20:39:22 +0200 Subject: [climacs-devel] Climacs - self documenting editor? In-Reply-To: References: <87lktu94wx.fsf@sigkill.dk> Message-ID: <17487.48730.459492.258100@serveur5.labri.fr> Christophe Rhodes writes: > Christophe Rhodes writes: > > Shortly after writing this, I found another reason, or at least a > consequence: the ability simply to set key sequences to command names, > and have the toplevel pretend to do the right thing. My changes will > require settings of the form > (esa:set-key `(com-find-file ,*unsupplied-argument-marker*) > 'buffer-table > '((#\x :control) (#\f :control))) > for commands with arguments, rather than simply > (esa:set-key 'com-find-file 'buffer-table '((#\x :control) (#\f :control))) > can people live with that? While the second form is more convenient, I think the first form is how CLIM seems to want it, so I guess we can live with that. We already do a similar thing for numeric arguments. -- Robert Strandh --------------------------------------------------------------------- Greenspun's Tenth Rule of Programming: any sufficiently complicated C or Fortran program contains an ad hoc informally-specified bug-ridden slow implementation of half of Common Lisp. ---------------------------------------------------------------------