t

メモ

Modest smartparens

最近 smartparens を使い始めたのだけど、開き括弧を書いたときに問答無用で閉じ括弧を挿入されるのはあまり嬉しくなかった。思案した結果、主に行末にいるときだけ挿入を許すことにしてみた。

(defun sp-autoinsert-inhibitedp (current-opening-pair inside-string-or-comment)
  (and (not (sp--get-active-overlay))
       (or inside-string-or-comment
           (/= (point) (save-excursion (end-of-line) (point))))))

(custom-set-variables
  '(sp-autoinsert-inhibit-functions '(sp-autoinsert-inhibitedp)))

とりあえず思ったように動いているものの sp-autoinsert-inhibit-functions は deprecated であるらしい。どうしてくれようかしらん。