Realign some comments to fit wider fill-column

This commit is contained in:
Daniel Borchmann 2025-09-12 20:20:49 +02:00
parent 1da79e1ac4
commit 1b61d8f2db
No known key found for this signature in database
GPG Key ID: 50EA937BF472ADD1

50
init.el
View File

@ -2800,46 +2800,38 @@ Note that this workaround is incomplete, as explained in this comment."
(add-hook 'eshell-mode-hook (add-hook 'eshell-mode-hook
'with-editor-export-editor) 'with-editor-export-editor)
;; Ignoring case when completing file names seems to have a ;; Ignoring case when completing file names seems to have a bug: when a ~ is
;; bug: when a ~ is encountered, it is implicitly expaned by ;; encountered, it is implicitly expaned by `pcomplete-insert-entry, overwriting the
;; `pcomplete-insert-entry, overwriting the prompt as a side ;; prompt as a side effect. Keeping the case as it is does not seem to have this issue.
;; effect. Keeping the case as it is does not seem to have ;; This problem occurs by default only on Windows systems (in all flavors), because this
;; this issue. This problem occurs by default only on Windows ;; is the only time `pcomplete-ignore-case is non-nil by default.
;; systems (in all flavors), because this is the only time
;; `pcomplete-ignore-case is non-nil by default.
(when on-windows (when on-windows
(add-to-list 'eshell-mode-hook (add-to-list 'eshell-mode-hook
#'(lambda () #'(lambda ()
(setq completion-ignore-case nil)))) (setq completion-ignore-case nil))))
;; Sometimes, when completing path names and immediately ;; Sometimes, when completing path names and immediately hitting RET,
;; hitting RET, `completion-in-region-mode' still seems to be ;; `completion-in-region-mode' still seems to be active; this often happens when calling
;; active; this often happens when calling cd. Then, ;; cd. Then, `post-command-hook' still contains `completion-in-region--postch', which
;; `post-command-hook' still contains ;; calls some `pcomplete' function to determine whether completion mode should exit.
;; `completion-in-region--postch', which calls some `pcomplete' ;; However, after RET (i.e., `eshell-send-input'), we only have an empty prompt, and
;; function to determine whether completion mode should exit. ;; `pcomplete' just computes all possible functions for completion (doesn't show it,
;; However, after RET (i.e., `eshell-send-input'), we only have ;; though). This introduces a noticeable amount of delay, which is annoying.
;; an empty prompt, and `pcomplete' just computes all possible ;; Expliticly disabling `completion-in-region-mode' before sending input seems to
;; functions for completion (doesn't show it, though). This ;; alleviate the problem.
;; introduces a noticeable amount of delay, which is annoying.
;; Expliticly disabling `completion-in-region-mode' before
;; sending input seems to alleviate the problem.
(advice-add 'eshell-send-input (advice-add 'eshell-send-input
:before #'(lambda (&rest _) :before #'(lambda (&rest _)
"Disable completion-in-region-mode before sending input." "Disable completion-in-region-mode before sending input."
(when completion-in-region-mode (when completion-in-region-mode
(completion-in-region-mode -1)))) (completion-in-region-mode -1))))
;; After completing partial inputs, pcomplete wants to add an ;; After completing partial inputs, pcomplete wants to add an extra character stored in
;; extra character stored in `pcomplete-termination-string', ;; `pcomplete-termination-string', which is a space by default. When completing paths,
;; which is a space by default. When completing paths, this ;; this leads to spaces being inserted after every directory within the path, which is
;; leads to spaces being inserted after every directory within ;; annoying. We thus set the value of this variable locally to an empty string, thus
;; the path, which is annoying. We thus set the value of this ;; silencing this bug. A better way to handle this would be to correctly determine
;; variable locally to an empty string, thus silencing this ;; whether the completion is not done yet, by passing `exact' instead of `finished' to
;; bug. A better way to handle this would be to correctly ;; the handlers stored in `completion-extra-properties'.
;; determine whether the completion is not done yet, by passing
;; `exact' instead of `finished' to the handlers stored in
;; `completion-extra-properties'.
(add-hook 'eshell-mode-hook (add-hook 'eshell-mode-hook
#'(lambda () #'(lambda ()
(setq-local pcomplete-termination-string ""))) (setq-local pcomplete-termination-string "")))