summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/lisp.el
diff options
context:
space:
mode:
authorTheodor Thornhill <theo@thornhill.no>2022-12-09 20:12:51 +0100
committerDmitry Gutov <dgutov@yandex.ru>2022-12-11 22:31:31 +0200
commitb889eced4449555373e53c26c280dffa548dcfc3 (patch)
tree3c3309814bb4a94c872d3cdeef0ad1949009ec93 /lisp/emacs-lisp/lisp.el
parent77d0793787a85c1b0685173c865578cb11fad855 (diff)
downloademacs-b889eced4449555373e53c26c280dffa548dcfc3.tar.gz
emacs-b889eced4449555373e53c26c280dffa548dcfc3.tar.bz2
emacs-b889eced4449555373e53c26c280dffa548dcfc3.zip
Add prog-fill-reindent-defun (bug#59664)
Introduce a new command that aims to reindent code in a defun, or fill a paragraph of text. The command uses treesit.el when available, otherwise falls back to using syntax-ppss and regexps. Treesit.el needs a new variable that is intended to be set by the major modes so that this and other future functions can know what kind of node we are looking at. * doc/emacs/programs.texi: Mention the new command. * etc/NEWS: Mention the new command. * lisp/progmodes/c-ts-mode.el (c++-ts-mode): Add regexp for the new variable. * lisp/progmodes/csharp-mode.el (csharp-ts-mode): Add regexp for the new variable. * lisp/progmodes/java-ts-mode.el (java-ts-mode): Add regexp for the new variable. * lisp/progmodes/js.el (js-ts-mode): Add regexp for the new variable. * list/progmodes/prog-mode.el (prog-mode-map): Bind the new command by default. (prog-fill-reindent-defun): New command. * lisp/progmodes/sh-script.el (bash-ts-mode): Add regexp for the new variable. * lisp/progmodes/typescript-ts-mode.el (typescript-ts-base-mode): Add regexp for the new variable. * lisp/treesit.el (treesit-text-type-regexp): New variable.
Diffstat (limited to 'lisp/emacs-lisp/lisp.el')
0 files changed, 0 insertions, 0 deletions