summaryrefslogtreecommitdiff
path: root/paredit.el
AgeCommit message (Collapse)Author
2008-09-28Changes for version 20.v20Taylor R Campbell
*** Preliminary Support for XEmacs This version introduces preliminary support for XEmacs. The changes needed were: - `check-parens' is called by the `paredit-mode' initialization only if it is fbound. - The forward and backward deletion keys are specified differently in GNU Emacs and XEmacs. - `paredit-forward' and `paredit-backward' use a "_" interactive specification in XEmacs in order to preserve the mark. - `paredit-region-active-p' is just `region-active-p' in XEmacs. - Some hair was needed to handle S-expression parse error conditions properly, and versions of XEmacs earlier than 21.5 may have obscure problems as a result. *** Style and Bugs - rxvt-specific terminal escape sequences are no longer bound to the commands that the keys those sequences denote are. Set your environment variables correctly and keep your rxvt.el updated. (Aren't terminals fun?) - HTML output is now properly quoted. Some vestigial indirections in the tables have been removed. - Yet *ANOTHER* `paredit-kill' bug is fixed. I do not know what the bug is or why it happened, but it seems to be gone now. - Improved robustness of `paredit-join-sexps' and `paredit-splice-sexp' with respect to their use in the middle of atoms, and made splicing within a string illegal. - Fixed several bugs in the paredit word killing commands. In the process, however, I encountered what seems to be a bug in Emacs's `parse-partial-sexp', which may mean bugs in other things... - Eliminated dependency on `cl' feature. - Fixed a bug in `paredit-backward-kill-word' that would cause deletion of the first double-quote in `(foo "|")'. - Fixed a bug with `paredit-backward-kill-word' at the end of buffer. - Fixed a bug with `paredit-backward-kill-word' before any words in a buffer. *** Altered Behaviour and New Functionality - `paredit-mode' now accepts a prefix argument to mean that it should not check the parentheses in the buffer first. Supply the prefix argument with care; though it is useful for editing small parts of a buffer in Lisp when the rest is random, it might also screw the whole buffer up in unpredictable ways, because most of paredit doesn't even try to handle invalid structure. - Parenthesis blinking is improved somewhat to better respect user customization of `blink-matching-paren'. - The paredit minor mode no longer exchanges C-j & RET; following the GNU Emacs conventions, it now leaves RET alone and binds C-j to `paredit-newline'. Those of you, such as me, who relied on the old exchange will have to update your .emacs files. - C-left and C-right are now bound to paredit-forward-barf-sexp and paredit-forward-slurp-sexp, instead of M-left and M-right, whose word motion bindings are no longer shadowed. - The behaviour of (, ", M-(, and M-" with respect to active regions and prefix arguments has been regularized: . With neither an active region, i.e. an active mark and transient-mark-mode, ( and " will insert a pair of delimiters at the point, and M-( and M-" will wrap the following expression with delimiters. . With an active region and no prefix argument, if and only if the region contains only balanced expressions, all four commands will wrap the region with the respective delimiters. . With a prefix argument N, all four commands will wrap the next N expressions with the commands' respective delimiters. " and M-", of course, escape any characters that need escaping first if they are used to wrap regions. - Implemented slurpage into strings. - Made `M-- M-s' equivalent to `M-- M-1 M-s'. - Changed `paredit-insert-pair' so that it will not skip whitespace before inserting the pair. - `paredit-splice-sexp' with a prefix argument and friends (i.e. `M-s', `M-<up>', and `M-<down>') now always create a new entry on the kill ring. darcs-hash:20080928134307-00fcc-ad5658e27bb367859e56b76b9e376a2a384737d1
2008-09-28Changes for version 19.v19Taylor R Campbell
This version introduces support for delimiters other than round brackets. Previously, if the major mode's syntax table considered square brackets (and curly braces, &c.) to be delimiters, since no paredit commands would insert them balanced, deleting them would be tricky: paredit's DEL & C-d bindings would refuse to delete them because they would be imbalanced unless you manually type the closing delimiter. Now commands are defined for the opening and closing of parentheses (round), brackets (square), braces (curly), and brockets (angled), named `paredit-open-<type>', `paredit-close-<type>-and-newline', and `paredit-close-<type>'; paredit-mode binds the opening and closing square bracket keys to be `paredit-open-bracket' and `paredit-close- bracket', respectively. The rest you can bind yourself; this minimal pair of bindings will, I think, account for accidental insertion, elisp vectors, and (bletch) the equation of square and round brackets as parentheses in some non-standard Scheme extensions. Also now supported in this version is insertion of delimiter pairs around active regions in transient-mark-mode. If you mark a region with transient-mark-mode enabled, you can use any of the delimiter pair insertion keys (like opening round bracket, double-quote, &c.) to insert a pair of delimiters around the region. There are now two ways to parenthesize lists of expressions with visual feedback: using M-( (paredit-wrap-sexp) followed by C-) (paredit-forward-slurp-sexp) until satisfied, and now C-M-SPC (mark-sexp) until you have marked the desired expressions and then any of the delimiter pair insertion keys to insert the delimiters. darcs-hash:20080928134228-00fcc-3ec209344dbaea07e93f2e02cddead13f7e39c6a
2008-09-28Changes for version 18.v18Taylor R Campbell
*** Style and Bugs - Corrected terminal arrow key sequences *again*. M-left and M-right were backwards. - Put the save-excursion back in paredit-recentre-on-sexp. I don't remember why it was taken out in version 13. - Fixed HTML output to stop producing spurious <tr> tags. - Corrected a number of paredit command examples. - Aesthetic changes to the code: . Regularized some aspects of code style. . Repaginated so that all pages are at most 80 lines long, and most are at least 40 lines. . Formatted headings for an outline regexp to match so that outline-minor-mode works nicely on paredit.el. *** Altered Behaviour and New Functionality - Implemented paredit-forward-kill-word & paredit-backward-kill-word, or M-d & M-DEL, which are like kill-word & backward-kill-word, but they will not kill parenthesis, string, or comment delimiters; they will preserve the structure of S-expressions, while the built-in Emacs word killing commands would destroy it. - M-" is now bound to paredit-meta-doublequote, which has the old behaviour of paredit-close-string-and-newline if within a string, but which wraps the following S-expression (or N S-expressions) in double-quotes if without a string; paredit-doublequote does the same, but the default argument is 0, not 1. - M-S (paredit-split-sexp) no longer deletes horizontal space in strings before splitting them into two. The rationale, as suggested by Zbigniew Szadkowski, is that whitespace is usually significant in strings, while not in lists, and you can type M-\ M-S if you really do want the horizontal space deleted anyway. - Reintroduced paredit-join-sexps as M-J. The implementation is now more robust: it ensures that the two S-expressions to join match -- i.e. they are both lists, or they are both strings, or they are both symbols --, and it correctly handles the atom case now as well. - Extended paredit command examples to allow multiple steps in succession of a single example. darcs-hash:20080928134213-00fcc-6ad0986678483423b9db18258e129b7824e33a01
2008-09-28Changes for version 17.v17Taylor R Campbell
*** Style and Bugs - Rewrote all documentation strings to be in the imperative mood, per GNU Emacs's guidelines. Some documentation strings may have been corrected, too, but I can't be bothered to grovel through the diff to pick out all changes to all documentation strings. - Forced parenthesis flashing even with show-paren-mode enabled. - Fixed bug in forward deletion within strings so that the empty string can be deleted. - Simplified determination of whether the point is in a comment. *** Altered Behaviour and New Functionality - Eliminated paredit-terminal-mode. All key bindings it had are now incorporated into paredit-mode's keymap. I may have changed some keybindings, too, but I don't remember what they were if I did. I think I fixed some of the keybindings in the terminal. - Added examples to documentation of all paredit commands, as well as code to generate an HTML file containing the examples in nicely formatted tables (sorry, web purists). - Made paredit-mode refuse to be enabled in a buffer with imbalanced parentheses. - Updated documentary heading. It now explains how to customize keys while still autoloading and how to make paredit's RET work nicely with SLIME's REPL. - Improved semicolon insertion: (a) to accept a numeric prefix argument dictating a number of semicolons to insert, instead of a prefix argument that forces the insertion of a semicolon without a trailing newline, which can be effected with C-q anyway; and (b) to allow insertion of semicolons before existing comments without inserting a superfluous leading newline. To comment out code, you must still use M-; or M-x comment-region. darcs-hash:20080928134133-00fcc-8b43de19c101c35bdc2972ba2d6304468710367f
2008-09-28Changes for version 16.v16Taylor R Campbell
- Introduced M-S (paredit-split-sexp) to split lists or strings from the middle. - Fixed the definition of M-; to use (kbd "M-;") to correctly identify the key sequence meta-semicolon, not "M-;" for M hyphen semicolon. darcs-hash:20080928134120-00fcc-f3d0c5f1318c5cc1c4de78c69666bbc126f305fd
2008-09-28Changes for version 15.v15Taylor R Campbell
- Rewrote comment insertion code. - Implemented M-; (paredit-comment-dwim), which is like comment-dwim but inserts comments more appropriately with respect to paredit. darcs-hash:20080928134053-00fcc-89725dbfcfd855de4a0e07e0ffa1e133229c0482
2008-09-28Changes for version 14, introducing fancy comment handling.v14Taylor R Campbell
- paredit-close-list-and-newline now refuses to move a margin comment to another line; instead it will help to preserve the column of the comment. - The semicolon key is now bound to a command that will automatically move any code following the point onto the next line, so that you do not inadvertently comment out half expressions. You can still use M-; (comment-dwim) to comment out specific regions that are not meant to be code (e.g., old comments that were accidentally uncommented) or whole S-expressions, usually in conjunction with C-M-SPC (mark-sexp). darcs-hash:20080928133903-00fcc-0f07413273679feeca677ed9d8e5464876c7f772
2008-09-28Changes for version 13.v13Taylor R Campbell
- Removed M-\ (paredit-join-sexps), whose key binding conflicts with delete-horizontal-space and whose implementation was inadequate and led to general uselessness of the command. - Improved RET (paredit-newline) so that it does not do anything fancy within strings and first tests whether the point is in a comment before checking whether it is in a character. - Changed paredit-skip-whitespace from skip-syntax-{forward,backward} to skip-chars-{forward,backward}, because in the Lisp syntax table newlines are not considered whitespace -- rather, they are comment ends --, but we want to skip them nevertheless. - Corrected paredit-kill in a way I don't understand. - Minor code improvements, including: . Changed call to previous-line to use forward-line instead. . Removed unnecessary save-excursion in paredit-recentre-on-sexp. . IF indentation changes. darcs-hash:20080928133822-00fcc-703d3e78cd56715f9f46966923349ba2561d8a72
2008-09-28Changes for version 12.v12Taylor R Campbell
- Implemented M-r (paredit-raise-sexp), which raises a single S-expression up the tree, deleting all of its siblings and its enclosing list. - Rearranged some arrow key bindings again. - Made paredit-forward-delete and paredit-backward-delete check for buffer bounds and also matching of the delimiters of empty lists. - Added a buffer bounds check to paredit-kill. - Made backward barfing signal an error, not just a message. darcs-hash:20080928133744-00fcc-b6843f09a351f97bd75c8f768399e66f8e49a697
2008-09-28Changes for version 11.v11Taylor R Campbell
- Changed the key for paredit-splice-sexp from M-/, which is by default the popular dabbrev-expand, to M-s, which I was surprised to find no existing binding for. - Added a prefix argument to paredit-splice-sexp; see the command's documentation for details. M-up is now equivalent to C-u M-s; M-down, to C-u C-u M-s. - Fixed a lot of the terminal key sequences for the arrow key bindings in paredit-terminal-mode. - Modified the behaviour of paredit-forward and paredit-backward to change only one level of nesting depth, not to repeat until there is a sibling S-expression to move across. - Changed a lot of code to use character syntax, instead of exact character comparisons, for better generality. - Rewrote much of paredit-kill, again. darcs-hash:20080928133658-00fcc-6f28a122f0471a40b9f80ce8e60303ebf196f42f
2008-09-28Changes for version 10.v10Taylor R Campbell
- Introduced paredit-forward and paredit-backward, which are like forward-sexp and backward-sexp but which will also go up a nesting level if at the end of a list. - Introduced C-c C-M-l (paredit-recentre-on-sexp), whose name is self-explanatory. - Added support for numeric prefix arguments to paredit-open-list. - Fixed paredit-kill so that it would correctly kill whitespace between parentheses, as in ( ). - Changed suggestion of what to put in your .emacs from require to autoload. darcs-hash:20080928133616-00fcc-1983846a129d64ac4b85e04df49fe9f4b6e36416
2008-09-28Changes for version 9.v9Taylor R Campbell
- Introduced enable-paredit-mode and disable-paredit-mode to better choose which one to enable. - Forced blinkage of matching parentheses in paredit-close-list and paredit-close-list-and-newline, even if show-paren-mode is enabled. darcs-hash:20080928133359-00fcc-e05f09d8e69fcaa6077e1bd3610dccc46a6dc441
2008-09-28Changes for version 8.v8Taylor R Campbell
- Added paredit-terminal-mode, which is like paredit-mode but which provides key bindings that work in terminals, while paredit-mode contains many (such as controlled brackets) that do not work in terminals. Thanks to Jorgen Schaefer for suggesting many of the terminal key bindings. - Exchanged RET and C-j: RET now inserts the fancy newline with auto- indentation, while C-j inserts a literal line feed. While this defies convention, and some people prefer not to do this, I have found that it is more convenient for RET to have the behaviour of the common case, where auto-indentation is desired, and for C-j to insert the uncommon exact, literal line feed. You can always customize the key bindings yourself, of course. - Rearranged arrow key bindings. - Implemented paredit-close-list-and-newline, which is like paredit-close-list followed by RET (paredit-newline); and M-" (paredit-close-string-and-newline), which is similar but for strings. The closing round bracket character now inserts the newline, while the meta modifier inhibits this. - Overhauled paredit-kill. - Extended slurpage and barfage to permit their operation across arbitrary depth changes. - Fixed bizarre bug with backward barfage. I apologize for the alliteration. - Fixed a number of other small bugs. - Prefixed `paredit-' to the remaining functions defined in the file that did not already have the prefix. - Defined backward-down-list, which for some reason is not provided by lisp.el, although up-list, down-list, & backward-up-list all are. (This is the sole exception to the above item. It deserves no prefix because it ought to be defined in lisp.el with this name anyway.) darcs-hash:20080928133248-00fcc-cff6c6ab1db5bb274d4b53bf702b99804dc33ebd
2008-09-28Changes for version 7.v7Taylor R Campbell
- Changed paredit-open-list and paredit-close-list so that they will refuse to insert parentheses inside character literals. - Substituted new code for GNU Emacs's move-past-close-and-reindent. I do not remember why now, and I no longer understand either code well enough to discern differences, other than that Emacs's m-p-c-a-r is probably faster because it incrementally parses each step of the way. All I can see is that paredit.el's code now inserts indentation before the closing parenthesis while Emacs's m-p-c-a-r does not. - Fixed bugs in deletion within character literals and strings. darcs-hash:20080928133142-00fcc-9a9fb3492e906d5e09da1f1ccb68bd1944ab8269
2008-09-28Changes for versions 2--6.v6Taylor R Campbell
- Flushed M-" (paredit-insert-doublequote), which was rather useless and which " (paredit-doublequote) now subsumes the functionality of. - Added instrumented forward deletion as well as backward deletion, which now behave well inside strings. - Flushed unnecessary individual round bracket insertion keys; use C-q instead. - Added C-left & C-right: backward-sexp & forward-sexp, respectively. - Fixed the test of whether the point is in a character literal. - Modified " (paredit-doublequote) to insert escaped double-quote if in the middle of the string, rather than to jump past the string's closing delimiter. - Introduced bogus backslash escaping mechanism. - Introduced new command for breaking the line and indenting, and bound C-j, rather than RET, to it, according to convention. - Improved C-k (paredit-kill), particularly in strings where it will no longer kill the closing delimiter of the string. - Changed the splicage, joinage, slurpage, and barfage commands so that they will reindent only the modified list, not the whole definition. darcs-hash:20080928133010-00fcc-90a9f6931a49b99f633def9bc51157b3bc40a6bf
2008-09-28Initial revision.v1Taylor R Campbell
darcs-hash:20080928131127-00fcc-7af7487ee9835f4f8a88b30a93ef8fe43a60e59c