[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/indent-bars d59d94d622 088/431: 2nd attempt defer setup
From: |
ELPA Syncer |
Subject: |
[elpa] externals/indent-bars d59d94d622 088/431: 2nd attempt defer setup when running under daemon |
Date: |
Mon, 16 Sep 2024 12:59:17 -0400 (EDT) |
branch: externals/indent-bars
commit d59d94d6223f775208718c101cab3c959cd54c25
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: JD Smith <93749+jdtsmith@users.noreply.github.com>
2nd attempt defer setup when running under daemon
See dinkonin #10
---
README.md | 8 --------
indent-bars.el | 12 +++++++++++-
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/README.md b/README.md
index 8e7f07aa32..82ca0bb501 100644
--- a/README.md
+++ b/README.md
@@ -46,14 +46,6 @@ To clone with `use-package` and `straight`:
:hook ((python-mode yaml-mode) . indent-bars-mode)) ; or whichever modes you
prefer
```
-## With `--daemon`
-If you open files via emacsclient which start emacs, and for which
`indent-bars` will be enabled using the emacs daemon, you may need to delay
loading until after the server-start, e.g.:
-
-```elisp
- :hook
- (server-after-make-frame-hook . (lambda () (add-hook 'prog-mode-hook
'indent-bars-mode)))
-```
-
## Compatibility
For `indent-bars` to display fancy guide bars, your port and version of emacs
must correctly display the `:stipple` face attribute. **Most do.** It can
also be used *without stipples*, drawing a simple vertical character (like `│`)
instead. It automatically does this in non-graphical displays (terminals), but
can optionally be configured to always do so; see [Non-stipple
Display](#non-stipple-display).
diff --git a/indent-bars.el b/indent-bars.el
index fae08f145b..fa9f56715d 100644
--- a/indent-bars.el
+++ b/indent-bars.el
@@ -982,13 +982,23 @@ Adapted from `highlight-indentation-mode'."
(indent-bars-teardown)
(indent-bars-setup))
+(defun indent-bars-setup-and-remove ()
+ "Setup indent bars and remove from `after-make-frame-functions'."
+ (remove-hook 'after-make-frame-functions #'indent-bars-setup-and-remove)
+ (indent-bars-setup))
+
;;;###autoload
(define-minor-mode indent-bars-mode
"Indicate indentation with configurable bars."
:global nil
:group 'indent-bars
(if indent-bars-mode
- (indent-bars-setup)
+ (if (and (daemonp) (not (frame-parameter nil 'client)))
+ (let ((buf (current-buffer)))
+ (add-hook 'after-make-frame-functions
+ (lambda () (with-current-buffer buf
(indent-bars-setup-and-remove)))
+ nil t))
+ (indent-bars-setup))
(indent-bars-teardown)))
(provide 'indent-bars)
- [elpa] externals/indent-bars a9381135ff 051/431: Update README.md, (continued)
- [elpa] externals/indent-bars a9381135ff 051/431: Update README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 9f03b2183b 055/431: Require compat, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 1cd0c30ba3 049/431: Tweaks to README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 628d42f204 072/431: Defer setup when running under daemon and remove from README, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 568ec43b0e 109/431: Correct quote in docstring to silence compiler, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 90e5616e8b 117/431: Handle tree-sitter configured but not available in buffer, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 57183c26e6 114/431: highlight-current-depth: guard against missing current-depth, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 9d225884fc 104/431: Improve blend commentary for current depth color, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 7e28454459 076/431: include final newline to ensure full blank line regions match, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars c4495d8bf3 099/431: Re-organize stipple, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars d59d94d622 088/431: 2nd attempt defer setup when running under daemon,
ELPA Syncer <=
- [elpa] externals/indent-bars 44621a1a9b 087/431: Revert "Defer setup when running under daemon and remove from README", ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 945418c86d 112/431: current-indentation-depth: fallback to naive indent, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 929a5e2445 129/431: Major re-factoring of bar display: tabs, offset, and invent, more, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 529854ec34 170/431: Relocate :weight spec to indent-bars-stipple face, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars bce0b729cc 130/431: Comment treesit, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars d9459a784e 160/431: treesit improvements: always search from root node, add start-only, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars bbdbbfe4da 159/431: Mention Carbon in versoin for emacs-mac, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 35bade62bd 179/431: do not use derived-mode-class, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 78ddecc3a8 153/431: protect display with save-excursion, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 6f886f89c4 141/431: Support go-mode in addition to go-ts-mode, ELPA Syncer, 2024/09/16