Adaptive fill mode broken in docstring
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Tái hiện vấn đề trong Clojure mode bằng cách đặt con trỏ trong phần docstring đã được thụt lề và nhấn M-q. Đọc logic fill liên quan đến docstring có sử dụng adaptive-fill-function và fill-paragraph-function, sau đó so sánh với các major mode Lisp khác. Hoàn tất khi adaptive filling đặt văn bản được ngắt dòng ở mức thụt lề chính xác mà không cần workaround đã được báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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)))
- Ngôn ngữ chính
- Emacs Lisp
- Star
- 1k
- Fork
- 249
- Merge trung bình
- 1 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của clojure-emacs/clojure-mode
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
clojure-emacs/clojure-mode#699 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
clojure-emacs/clojure-mode#647 · 1 bình luận ·
-
bug help wanted indentation
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
clojure-emacs/clojure-mode#620 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
clojure-emacs/clojure-mode#613 · 1 reaction ·
-
Indent very slowĐang mởhelp wanted indentation
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
clojure-emacs/clojure-mode#606 · 6 bình luận ·
Tất cả issue của clojure-emacs/clojure-mode
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
clojure-emacs/cider#4235 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Request]: WincCó thể đã có người làm @chenyme đã nhận hôm nay. Đang mởpackage-request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ScoopInstaller/Extras#19476 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
promplate/code-review#158 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày