Adaptive fill mode broken in docstring
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Reproduce el problema en Clojure mode colocando el cursor en la sección de docstring indentada y pulsando M-q. Lee la lógica de relleno relacionada con docstring que involucra adaptive-fill-function y fill-paragraph-function, y compárala con otros modos principales de Lisp. Se considera terminado cuando el relleno adaptativo coloca el texto ajustado con la indentación correcta sin requerir el workaround indicado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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)))
- Lenguaje dominante
- Emacs Lisp
- Estrellas
- 1k
- Forks
- 249
- Merge medio
- 1 d 6 h
- PR fusionados (30 d)
- 6
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de clojure-emacs/clojure-mode
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
clojure-emacs/clojure-mode#699 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
clojure-emacs/clojure-mode#647 · 1 comentario ·
-
bug help wanted indentation
Dificultad 3/5 1-2 días Aptitud para principiantes 42/100
clojure-emacs/clojure-mode#620 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
clojure-emacs/clojure-mode#613 · 1 reacción ·
-
Indent very slowAbiertohelp wanted indentation
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
clojure-emacs/clojure-mode#606 · 6 comentarios ·
Todos los issues de clojure-emacs/clojure-mode
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
clojure-emacs/cider#4235 ·
Los mantenedores suelen responder en 1 día
-
[Request]: WincPosiblemente ocupada @chenyme la tomó hoy. Abiertopackage-request
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ScoopInstaller/Extras#19476 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
promplate/code-review#158 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Los mantenedores suelen responder en 1 día