-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FR: Have some indicators (e.g. location) #8
Comments
I just realized this what I'm asking about is A quick function to give a progress bar is:
Then Do you think it's within the scope of |
If I understand correctly, you want something like a more sober version of the nyan-cat progress indicator, which, by the way is inspired by http://www.emacswiki.org/emacs/sml-modeline.el In that case, why not reuse that library and adjust it so that it behaves correctly when added as the sole element of
where So I would start by writing As to "bundling" it with darkroom, it's a little out of scope, but if it's <100 lines, I don't mind. |
Hi João, Sure, but What you talk about it more in line with what I first outlined. As I see it, it boils down to providing a sanitized Rasmus |
Hi Rasmus, Hi don't know if I follow, but perhaps a code example can get us started: (defun joaot/turn-on-nyan-maybe ()
"My personal darkroom-mode addition, just a nyan"
(when darkroom-mode
(setq-local nyan-bar-length (+ (window-width)
(or (car (window-margins)) 0)
(or (cdr (window-margins)) 0)))
(setq-local mode-line-format '(:eval (list (nyan-create))))))
;; add it to `darkroom-mode-hook'. Beware this won't work with `darkroom-tentative-mode`.
(add-hook 'darkroom-mode-hook
'joaot/turn-on-nyan-maybe) |
I also would like some indication of progress, but I progressbar might be considered distracting for some people. Something more discrete like But I also would like an indication if the buffer is modified or not. The usual These are the only useful information I need with darkroom-mode activated. |
Darlan Cavalcante Moreira <[email protected]> writes:
I also would like some indication of progress, but I progressbar might be considered distracting for some people.
Something more discrete like current line | progress% could be nice to have by default.
But I also would like an indication if the buffer is modified or not. The usual * in the modline. It helps when I'm
undoing something.
These are the only useful information I need with darkroom-mode activated.
This shouldn't be terribly hard to do. I guess you'd need to set the
variable mode-line-format to a user-defined minimalist format instead of
the brutal `nil` that it uses when switching on the mode. Something
like this patch should allow to customize this. It still defaults to
`nil` but you can customize the new darkroom-mode-line-format and
darkroom-header-line-format variables to contain the minimalist elements
that you want.
João
diff --git a/darkroom.el b/darkroom.el
index 9e32670..74dfbcf 100644
--- a/darkroom.el
+++ b/darkroom.el
@@ -281,6 +281,16 @@ Alist of (VARIABLE . BEFORE-VALUE)")
;; (defvar darkroom--saved-text-scale-mode-amount nil
;; "Text scale before `darkroom-mode' is turned on.")
+(defcustom darkroom-mode-line-format nil
+ "A minimalist version of `mode-line-format' used by darkroom mode.
+Defaults to `nil', the most minimalist mode-line possible."
+ :type 'sexp)
+
+(defcustom darkroom-header-line-format nil
+ "A minimalist version of `header-line-format' used by darkroom mode.
+Defaults to `nil', the most minimalist header line possible."
+ :type 'sexp)
+
(defun darkroom--enter (&optional just-margins)
"Save current state and enter darkroom for the current buffer.
With optional JUST-MARGINS, just set the margins."
@@ -289,8 +299,8 @@ With optional JUST-MARGINS, just set the margins."
(mapcar #'(lambda (sym)
(cons sym (buffer-local-value sym (current-buffer))))
darkroom--saved-variables))
- (setq mode-line-format nil
- header-line-format nil
+ (setq mode-line-format darkroom-mode-line-format
+ header-line-format darkroom-header-line-format
fringes-outside-margins darkroom-fringes-outside-margins)
(text-scale-increase darkroom-text-scale-increase))
(mapc #'(lambda (w)
|
Hi,
It would be nice to be able to have some indicators somewhere on the screen.
In particular, I'm interseted in having an indicator of my place in the file (e.g. the nyan cat).
Perhaps the easiest way would be to use a stripped down modeline that defaults to the being empty and with the same color as the buffers' background color.
Do you think something like that is possible? I don't knowe much about display related issues with Emacs, but if it's possible it might be a fun weekend project (for me).
Thanks,
Rasmus
The text was updated successfully, but these errors were encountered: