protesilaos / spacious-padding

Increase the padding/spacing of GNU Emacs frames and windows.
GNU General Public License v3.0
59 stars 2 forks source link

emacsclient -c -a "" #9

Closed muello closed 3 months ago

muello commented 3 months ago

Hello,

thanks so much for your work on this and other very beautiful packages (like ef-themes)!

I've notice a small issue on starting up with emacsclient. Steps:

Save the following as .emacs.d/init.el:

(push "~/my/path/to/spacious-padding/" load-path)
(require 'spacious-padding)
(spacious-padding-mode 1)
(define-key global-map (kbd "<f8>") #'spacious-padding-mode)

Call emacsclient -c -a "".

Note the issues in the modeline. Others also become visible on splitting the window with C-x 3.

After we press f8 twice to toggle off and on again, the issues have gone away.

muello commented 3 months ago

The issues are more visible when having loaded a dark theme. Prepend the following to the minimal init.el above:

(push "~/.emacs.d/path/to/ef-themes/" load-path)
(require 'ef-themes)
;; Disable all other themes to avoid awkward blending:
(mapc #'disable-theme custom-enabled-themes)
(load-theme 'ef-night :no-confirm)
bsvh commented 3 months ago

I have an issue where the border used for the padding in the modeline is the wrong color until I reload spacious-padding-mode. I'm not sure if this is the same issue you are having, but here is a workaround I am using;

(defun bs-sp-workaround ()
  "Workaround issues with `spacious-padding-mode' when using emacsclient."
  (when server-mode
    (spacious-padding-mode 1)
    (remove-hook 'server-after-make-frame-hook #'bs-sp-workaround)))
(add-hook 'server-after-make-frame-hook #'bs-sp-workaround)
muello commented 3 months ago

Thanks a lot @bsvh, that's the hook I was looking for!

protesilaos commented 3 months ago

From: bsvh @.***> Date: Sat, 23 Mar 2024 14:57:06 -0700

I have an issue where the border used for the padding in the modeline is the wrong color until I reload spacious-padding-mode. I'm not sure if this is the same issue you are having, but here is a workaround I am using;

(defun bs-sp-workaround ()
  "Workaround issues with `spacious-padding-mode' when using emacsclient."
  (when server-mode
    (spacious-padding-mode 1)
    (remove-hook 'server-after-make-frame-hook #'bs-sp-workaround)))
(add-hook 'server-after-make-frame-hook #'bs-sp-workaround)

Interesting. I am curious why we would even need this sort of arrangement. Perhaps due to how the emacsclient frame parameters are instantiated?

-- Protesilaos Stavrou https://protesilaos.com