Adaptive fill mode broken in docstring
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
Direção de pesquisa
Reproduza o problema no Clojure mode posicionando o cursor na seção de docstring indentada e pressionando M-q. Leia a lógica de preenchimento relacionada a docstring que envolve adaptive-fill-function e fill-paragraph-function e compare-a com a de outros modos principais Lisp. A tarefa estará concluída quando o preenchimento adaptativo posicionar o texto quebrado na indentação correta sem exigir o workaround relatado.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
When filling in a docstring, there is no proper adaptive filling and it always seems to fill to the beginning column of the docstring. This problem has annoyed me for more than 5 years, so I stepped a bit through the debugger, but I don't understand Emacs Lisp well enough to provide a proper fix.
An arg - asdfasdfasd sadf as dfas df asdf asdf as df as df asd
fas df asdf asdf asdf as df asd fa sd fa sdf as df asdf as dfa sdf
Put the cursor somewhere into the indented section and press M-q. In Clojure mode, it will ruin the indentation. Proper adaptive filling will cut as dfa sdf and put in on the next line at col 9.
My best solution so far is to set adaptive-fill-function to ignore and fill-paragraph-function to nil. So far, I haven't observed any adverse side effects but sure it breaks something.
In general, there seems to be a bunch of logic implemented around docstrings in Clojure mode, but it is not very well documented and probably not working properly. Probably one could draw inspiration for how docstring indentation is solved in other LISP major modes.
I noticed that in Emacs Lisp for instance, docstrings have no special indentation behavior, and in Clojure there are two spaces prepended to each line. Its a weird convention but it seems to be somehow rooted in Clojure core? Is that what all the logic is about? Maybe getting rid of that is too much to ask for, but it would be nice if you can make adaptive filling work.
;;; Workaround, use at your own risk
(add-hook 'clojure-mode-hook
(lambda ()
(interactive)
(setq-local fill-paragraph-function nil)
(setq-local adaptive-fill-function 'ignore)))
- Linguagem predominante
- Emacs Lisp
- Estrelas
- 1k
- Forks
- 249
- Merge médio
- 1d 6h
- PRs com merge (30d)
- 6
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de clojure-emacs/clojure-mode
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
clojure-emacs/clojure-mode#699 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 35/100
clojure-emacs/clojure-mode#647 · 1 comentário ·
-
bug help wanted indentation
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 42/100
clojure-emacs/clojure-mode#620 ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 45/100
clojure-emacs/clojure-mode#613 · 1 reação ·
-
Indent very slowAbertahelp wanted indentation
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
clojure-emacs/clojure-mode#606 · 6 comentários ·
Todas as issues de clojure-emacs/clojure-mode
Issues semelhantes
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
py-econometrics/pyfixest#2114 ·
Mantenedores costumam responder em até 1 dia
-
Verify the Linux Python quick start from a fresh Ubuntu checkoutTalvez já em andamento @romanv9 assumiu hoje. Abertadocumentation good first issue help wanted
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
R0Y00/Xbox2Windows#652 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
documentation good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Haseeb-MernStack/commune#138 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 62/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
clojure-emacs/cider#4235 ·
Mantenedores costumam responder em até 1 dia