Smartparens Versions Save

Minor mode for Emacs that deals with parens pairs and tries to be smart about it.

1.11.0

6 years ago

Smartparens turns 5 years old today and to celebrate we've prepared a new release packed with new features and bug fixes!

You can read more on my blog.

As usual, big thanks to all the contributors who helped on this release!

  • Become a patron! Patreon
  • One time donation Paypal logo

Changes since 1.10.1

Bug fixes

  • When deleting over a delimiter, do not jump to previous sexp in strict-mode if the character before point is a potential unclosed delimiter (#744, #584, #709)
  • When smartparens-mode is disabled do not mess with delete-selection-mode handling (#767)
  • Automatic pair deletion only operates on valid pairs (#731)
  • Properly clean up closing delimiters when re-inserting pairs sharing a prefix (e.g. ``' and ```'' in LaTeX)

markdown-mode

  • Fix gfm-mode block insertion (#371)

evil-mode integration

  • Better pair highlighting when the point is inside the sexp (= on the delimiter) (#758)

ESS

  • Fix apostrophe behaviour in ESS comments (#769)

js-mode

  • Fix autoloading of js-mode config (#701)

rust-mode

  • Do not parse > where it is not a valid delimiter (#793)

elixir-mode

  • Do not insert end keyword that would spill out of current context (i.e. out of the comment if point is in comment)

ruby-mode

  • Fix ruby slurp/barf problems related to change of : to prefix class

Features

  • Commands executed with sp-prefix-save-excursion preserve indentation.
  • Inhibit pair insertion in overwrite-mode (#549)
  • Allow inserting closing delimiters for non-autoskip pairs (#712)
  • Do not drag suffix along with transposed sexps. This preserves , in argument lists or ; between statements.
  • Parsing of strings inside generic string fences is now much faster (#752)
  • Add support for defining custom pair configrations (#33, #107, #347)
  • Add sp-backward-delete-symbol (-word) which do not put the removed content to kill-ring (#759)
  • Add support for hungry-delete-mode (#764, #765)
  • Move point to end of symbol for sp-convolute-sexp
  • Remove extra whitespace when calling sp-convolute-sexp
  • New option sp-navigate-interactive-always-progress-point to improve behaviour of sp-next-sexp and sp-previous-sexp (always move in the direction of navigation).
  • Update closing delimiter if opening delimiter is extended via insertion (#741)
  • When sp-autodelete-wrap is on unwrap the last region in strict mode as well (#678)
  • Support insertion of emoticons (such as :)) in text modes in strict mode (#713)
  • Show offscreen paired delimiters with show-smartparens-mode (#346, #788)
  • When jumping out of sexp automatically using sp-skip-closing-pair (e.g. typing closing delimiter in strict mode) re-align the sexps and clean the whitespace (#778)
  • Add sp-change-inner (#115)

python-mode

  • Rewrapping tripple quotes (""" to ''') now works after selecting the single quote for rewrapping (#320)

ML family (tuareg-mode, reason-mode, fsharp-mode)

  • Add comment pairs handling (#753)

typescript-mode

  • Use javascript settings for typescript-mode (#748)

scala-mode

  • Add support for scala-mode (#673)

haskell-mode

  • Add the {--} pair
  • Add setup for ' pair to better treat it when it is used as function/symbol suffix (#710)
  • Add LiquidHaskell pragma (#802)

js2-mode

  • Better reindent behaviour on js2-mode (#696)

text-mode

  • Autoload configuration for text modes

elixir-mode

  • Better slurping and barfing (#777)

rust-mode

  • Allow typing match branches (=>) in strict mode (#789)

markdown-mode

  • Add markdown-mode setup (#141, #804)

org-mdoe

  • Add org-mode setup

API

Bug fixes

  • The regexp returned by sp--get-stringlike-regexp should never match anything if there are no string delimiters (previously returned a regexp which would always match anywhere)
  • sp--strict-regexp-quote returns unmatchable regexp on nil
  • sp-get-thing skips closing delimiter with skip function (#774)
  • Use syntax-class instead of char-syntax to check if we are at string. This accounts for dynamically computed syntax via syntax-table text property
  • When picking first string-like delimiter for parsing always pick a valid one
  • Properly skip over regexp-based prefixes (#699, #813)

Features

  • sp-region-ok-p now works with all smartparens pairs not just syntax-table (#775, #805)
  • Add turn-off-smartparens-strict-mode (#790)
  • Return match data from sp--find-next-stringlike-delimiter
  • Use the p syntax flag to recognize prefixes (#812)
  • Strings can now have prefixes (#811)

Misc

  • Supply limits to looking-back to speed up unsuccessful parsing attempts (#755)
  • Improve performance of delete-selection-pre-hook when no region is active (#794)
  • Remove obsolete variable sp-navigate-consider-stringlike-sexp
  • Add sp-describe-system to generate information when submitting issues to github
  • Properly integrate strict mode and delete-selection-mode (#726, #738)

1.10.1

7 years ago

Changes since 1.10.0

  • Fix Cask and smartparens-pkg.el versions.

1.10.0

7 years ago

The biggest change coming from 1.9.0 is the transition to lexical binding. This allows us to write better and cleaner code as well as makes some operations faster by eliminating unnecessary variable lookup.

Otherwise there is a healthy mix of bug fixes and new features with some additional work on the infrastructure (testing framework, helpers and so on). Some long-standing issues with strings were fixed (#34), we've done some work on wrapping as well as improved the slurp/barf experience by not including unnecessary spaces (this was a thing carried over from lisp syntax to other languages where it caused lots of annoying issues).

As usual, big thanks to all the contributors who helped on this release!

  • Become a patron! Patreon
  • One time donation Paypal logo

Changes since 1.9.0

Bug fixes

  • Fix a bug when testing if a char is escaped picked up any escaped sequence not just the one at point (#669)
  • Do not assume " is always string syntax (this broke auto-escape) (#665)
  • Recognize multi-line comments as context when not on first-line (to allow parsing sexps in comments) (#653)
  • Fix eval-after-load to use symbols instead of strings (#677)
  • Fix killing of whitespace with sp-kill-hybrid-sexp (#452)
  • Do not extend selection over invalid regions (#687)
  • Fix hanging on backward-delete in comint buffers when at the end of last prompt (#694)
  • If a pair has prefix syntax and is allowed in current context, do not consider it a prefix (#664)
  • Only insert spaces when slurping or barfing if not doing so would result in merging of two neighboring expressions (#632, #578)

ruby-mode

  • Fix ruby pre- and post-handlers to process tabs properly (#638)

Features

  • When killing a region in strict mode, check the resulting balance state of the buffer and refuse to kill unbalanced regions (#230)
  • After wrapping, the wrapped region is enclosed between point and mark (between this patch mark was left in undefined position)
  • New command sp-mark-sexp similar to mark-sexp but also for user-defined pairs (#686)
  • When inserting string quote marks in unbalanced buffer, decide whether to escape or not based on the buffer state (#34)
    • This makes the option sp-autoinsert-quote-if-followed-by-closing-pair obsolete
  • Respect kill-whole-line with hybrid kills (#169)
  • Add sp-kill-whole-line. This always kills everything before and after point but preserves the buffer balance (#674)
  • In strict mode, do not insert closing delimiters which would imbalance the buffer (#421)
  • When re-wrapping inside strings you can use unescaped string marks to re-wrap sexps and they are automatically escaped (#667)
  • Add a command to navigate sexps forward and backward staying at the same depth (#623)
  • Add a trigger for wrapping (#663)

rust-mode

  • Support < and > in strict mode

clojure-mode

  • Add autoload for clojure-mode settings (#698)

elixir-mode

  • Add support for elixir-mode (#695, #700, #727)

fsharp-mode

  • Add support for fsharp-mode (#714)

javascript-mode

  • Add support for javascript-mode (#716)

evil-mode

  • Add support for evil-mode registers when killing with sp-kill-sexp (#725)

API

  • Add a test helper sp-buffer-equals

Misc

  • Rename sp-keymap to smartparens-mode-map everywhere to conform to Emacs conventions
  • Extend testing matrix with Emacs 25.1 and trunk
  • ecukes features were removed and migrated to ert
  • Remove provide from test-helper (#708)
  • Add github issue templates (#704)
  • Use lexical-binding (#671, #719, #720)

1.9.0

7 years ago

Mostly a bug-fix release, we concentrated on old issues with quotes and odd behaviors there and some improvements of slurping and barfing. Fixing issues brought in by the return of auto-escaping is a given :)

As usual, big thanks to all the contributors who helped on this release!

Paypal logo

Changes since 1.8.0

Bug fixes

  • Point at end of buffer does not register as "inside symbol" anymore
  • When killing backwards using smartparens functions, the successive kills should be prepended instead of appended (#630)
  • Fixed broken recognition of end-of-sexp in comments if the delimiter was the last character of comment (slurping around the comment did not work) (#634)
  • When calling sp-up-sexp, do not destroy whitespace if inside a string (#616)
  • sp--looking-back match can no longer extend after the point
  • If a string quote is escaped, do not treat it as start of a string sexp (#637)
  • Respect sexp prefix even if it is a symbol (for example _ in clojure) (#621)
  • If a sexp can not be parsed, do not fall back to symbol parsing (this might cause point skipping past the broken delimiter) (#666 \m/)
  • Jump to inside of sexp instead of match when skipping in strict mode (the match can extend further than the sexp bounds) (#617)
  • Fix parsing of nested strings when string fences delimit the strings (#661)

lua-mode

  • Don't autocomplete the lua blocks inside comments (#648)

clojure-mode

  • Match backtick with backtick and not apostrophe

latex-mode

  • Fix whitespace insertion when slurping in LaTeX (#670)

Features

  • More robust checking of breakage when wrapping.
    • If the point is in a sexp and mark in a different sexp, we should refuse to wrap the region as the delimiters would end up in different sexps breaking the structure
    • If the point is inside a sexp and the mark outside, we should refuse to wrap as the string would break that sexp

tuareg-mode (ocaml)

  • Add support for tuareg-mode (#631)

API

  • sp-get-quoted-string-bounds takes an optional point parameter of where the test should be run
  • Add new test sp-char-is-escaped-p to test if the char-at-point is escaped or not (according to sp-escape-char)
  • sp--strict-regexp-opt now returns "" on nil input to be consistent with regexp-opt
  • sp--merge-prop and sp--update-pair had the argument order changed

Misc

  • Removed old unused functions
    • sp--string-empty-p
    • sp-pair-is-stringlike-p
    • sp--split-string
    • sp--reverse-string
    • sp-zap-syntax
  • Tests were made even more quiet to save on nonsensical output
  • Removed sp-nagivate-use-textmode-stringlike-parser alias
  • Tests no longer rely on Makefile, we use .travis.yml only. To run tests locally, use cask exec ert-runner.
  • There is now a release script to manage releases automatically (#662)

1.8.0

7 years ago

This release marks the return of autoescaping---better, faster and smarter :). We can now work with multiple quote types and only escape when necessary, the behaviour at the end of string is consistent across quotes (always jump out) and we can also escape single delimiters which weren't paired---for example because an :unless predicate did not allow it.

Another big feature is the migration of documentation to sphinx and readthedocs. Currently, only the new features are documented there, but the github wiki migration is on the way.

As usual, big thanks to all the contributors who helped on this release!

Paypal logo

Changes since 1.7.1

Bug fixes

  • emacs-lisp prefixes are now handled consistently across Emacs versions (using a custom regexp instead of the ever-changing syntax tables).
  • With strict mode disabled, check if the pair to be deleted really constitutes a sexp (problem with string delimiters).
  • It is no longer possible to slurp into different context (for example from inside a comment to code)
  • Wrapping unbalanced regions is no longer possible. That is, turning [a b |c] d< into [a b "|c] d"< as that would break the [] structure.

python-mode

  • Fix single quotes not autoskipping properly.
  • Add """""" as a proper pair.

latex-mode

  • Do not try to navigate on ' when used as contraction.

rust-mode

  • Fix autoskipping of >.

yasnippet

  • Make the pair overlay priority lower. This allows yasnippet binding to work while entering smartparens pairs

Features

  • Autoescaping (documentation)
  • Better support for string fences. This adds support for such constructions as %w(..) in ruby, where the () is now a string delimiter.
  • Skipping of quote delimiters is now more consistent at the "end of sexp". We now always try to skip whenever possible instead of inserting nested delimiters at the end.
    • However, if the quote is explicitly preceded by an escape character, do not skip.
  • New post handler for sp-rewrap-sexp.
  • Various optimizations on syntax-ppss and case-fold-search.
  • Documentation rewrite using sphinx and http://readthedocs.io

latex-mode

  • Add norm-bar pair

ess (emacs speaks statistics)

  • Add support for ess via smartparens-ess.el

1.7.1

7 years ago

This release updates the version number in the pkg and Cask files and bumps dependencies to the required versions.

1.7

7 years ago

Major changes since last release:

  • The input system has been reworked. Insertion and wrapping now don't use advices but various change hooks. This makes it less aggressive towards modes which rebind insertion keys on their own, like org or auctex.

There has been hundreds of other issues fixed and new features added, unfortunatelly it is too much to track. Starting with this release, we will strictly follow semantic versioning and a bi-monthly release schedule, proper with changelog and all. Given how much the project has grown in the last years, an increased level of "bureaucracy" is required.

Non-technical news

I have set up a patreon account, feel free to chip in. The plan is to drop some job days and pour the time into this (and other Emacs) project(s). Any support is appreciated.