Adaptive fill mode broken in docstring
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Riproduci il problema in Clojure mode posizionando il cursore nella sezione di docstring rientrata e premendo M-q. Leggi la logica di riempimento relativa a docstring che coinvolge adaptive-fill-function e fill-paragraph-function, quindi confrontala con quella di altre modalità principali Lisp. Il lavoro è completo quando il riempimento adattivo posiziona il testo mandato a capo con il rientro corretto senza richiedere il workaround segnalato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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)))
- Lingua principale
- Emacs Lisp
- Stelle
- 1k
- Fork
- 249
- Merge medio
- 1g 6h
- PR unite (30g)
- 6
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di clojure-emacs/clojure-mode
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
clojure-emacs/clojure-mode#699 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
clojure-emacs/clojure-mode#647 · 1 commento ·
-
bug help wanted indentation
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
clojure-emacs/clojure-mode#620 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
clojure-emacs/clojure-mode#613 · 1 reazione ·
-
Indent very slowApertahelp wanted indentation
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
clojure-emacs/clojure-mode#606 · 6 commenti ·
Tutte le issue di clojure-emacs/clojure-mode
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
clojure-emacs/cider#4235 ·
I maintainer di solito rispondono entro 1 giorno
-
[Request]: WincForse già presa @chenyme l’ha presa oggi. Apertapackage-request
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ScoopInstaller/Extras#19476 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
promplate/code-review#158 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno