Adaptive fill mode broken in docstring
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Reproduziere das Problem im Clojure mode, indem du den Cursor im eingerückten docstring-Abschnitt platzierst und M-q drückst. Lies die mit docstring zusammenhängende Fülllogik, die adaptive-fill-function und fill-paragraph-function umfasst, und vergleiche sie mit anderen Lisp-Hauptmodi. Als erledigt gilt die Aufgabe, wenn das adaptive Füllen den umbrochenen Text mit der korrekten Einrückung platziert, ohne den gemeldeten Workaround zu benötigen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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)))
- Vorherrschende Sprache
- Emacs Lisp
- Sterne
- 1k
- Forks
- 249
- Ø Merge
- 1 T. 6 Std.
- Gemergte PRs (30 T.)
- 6
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus clojure-emacs/clojure-mode
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
clojure-emacs/clojure-mode#699 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 35/100
clojure-emacs/clojure-mode#647 · 1 Kommentar ·
-
bug help wanted indentation
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 42/100
clojure-emacs/clojure-mode#620 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
clojure-emacs/clojure-mode#613 · 1 Reaktion ·
-
Indent very slowOffenhelp wanted indentation
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
clojure-emacs/clojure-mode#606 · 6 Kommentare ·
Alle Issues in clojure-emacs/clojure-mode
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
py-econometrics/pyfixest#2114 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Verify the Linux Python quick start from a fresh Ubuntu checkoutEvtl. vergeben @romanv9 hat das heute übernommen. Offendocumentation good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
R0Y00/Xbox2Windows#652 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
documentation good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Haseeb-MernStack/commune#138 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 62/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
clojure-emacs/cider#4235 ·
Maintainer antworten meist innerhalb von 1 Tag