Skip to content
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

Transfered tweaks #122

Merged
merged 3 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/me-defaults.el
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@ or file path may exist now."
;; Show column numbers (a.k.a. cursor position) in the mode-line
(column-number-mode 1)

;; Display buffer size on mode line
(size-indication-mode 1)

;; Better handling for files with so long lines
(global-so-long-mode 1)

Expand Down
3 changes: 1 addition & 2 deletions core/minemacs-lazy.el
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
(setq minemacs-lazy-hook (append (delq 'gcmh-mode (reverse minemacs-lazy-hook)) '(gcmh-mode)))
(if minemacs-not-lazy
(progn ; If `minemacs-no-lazy' is bound and true, force loading lazy hooks immediately
(+log! "Loading %d lazy packages immediately."
(length minemacs-lazy-hook))
(+log! "Loading %d lazy packages immediately." (length minemacs-lazy-hook))
(run-hooks 'minemacs-lazy-hook))
(+log! "Loading %d lazy packages incrementally." (length minemacs-lazy-hook))
;; Run hooks one by one, as a FIFO.
Expand Down
15 changes: 6 additions & 9 deletions elisp/+minemacs.el
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ If NO-MESSAGE-LOG is non-nil, do not print any message to *Messages* buffer."
delay t
(lambda ()
(when-let (fn (pop fns))
(+log! "Running task %d, calling function `%s'" task-num
(truncate-string-to-width (format "%s" fn) 40 nil nil "…"))
(+log! "Running task %d, calling function `%s'" task-num (truncate-string-to-width (format "%s" fn) 40 nil nil "…"))
(funcall fn))
(unless fns
(cancel-timer (get task-name 'timer))
Expand All @@ -105,15 +104,13 @@ If NO-MESSAGE-LOG is non-nil, do not print any message to *Messages* buffer."
(defmacro +eval-when-idle! (&rest body)
"Evaluate BODY when Emacs becomes idle."
(declare (indent 0))
`(+eval-when-idle ,+eval-when-idle-delay
(lambda () ,@body)))
`(+eval-when-idle ,+eval-when-idle-delay (lambda () ,@body)))

;;;###autoload
(defmacro +eval-when-idle-for! (delay &rest body)
"Evaluate BODY after DELAY seconds from Emacs becoming idle."
(declare (indent 1))
`(+eval-when-idle ,delay
(lambda () ,@body)))
`(+eval-when-idle ,delay (lambda () ,@body)))

;;;###autoload
(defmacro +deferred! (&rest body)
Expand Down Expand Up @@ -175,7 +172,7 @@ If NO-MESSAGE-LOG is non-nil, do not print any message to *Messages* buffer."
The FUNCTION is delayed to be evaluated in SECS once HOOK is
triggered.
DEPTH and LOCAL are passed as is to `add-hook'."
(let* ((f-name (make-symbol (format "%s-on-%s-delayed-%ds-h" (+unquote function) (+unquote hook) secs)))
(let* ((f-name (make-symbol (format "+%s-on-%s-delayed-%.2fs-h" (+unquote function) (+unquote hook) secs)))
(f-doc (format "Call `%s' in %d seconds" (symbol-name (+unquote function)) secs)))
`(eval-when-compile
(defun ,f-name () ,f-doc
Expand Down Expand Up @@ -392,8 +389,8 @@ the the function.

(defvar +shell-command-switch
(pcase shell-file-name
((rx "fish") "-lc")
((rx (or "tsch" "csh")) "-dc")
((rx bol "fish" eol) "-lc")
((rx bol (or "tsch" "csh") eol) "-dc")
(_ "-ilc")))

;; Inspired by: emacs.stackexchange.com/a/21432/37002
Expand Down
Loading