Comments (4)
I'm not familiar with doom-modeline. What happens if you disable it?
It could be as simple as a hard-to-see face setting given your theme and modeline configuration. The highlight is controlled using persp-selected-face
(
Line 500 in cb4083d
from perspective-el.
Hi @gcv, disabling doom-modeline seems to make it work. Modifying the face has no effect when doom-modeline is active. To test that doom-modeline really is an issue, I ran emacs -Q
and put the following config in it:
;; This buffer is for text that is not saved, and for Lisp evaluation.
;; To create a file, visit it with C-x C-f and enter text in its buffer.
(require 'package)
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("elpa" . "https://elpa.gnu.org/packages/")
("melpa-stable" . "https://stable.melpa.org/packages/")))
(add-to-list 'package-pinned-packages '(cider . "melpa-stable") t)
(add-to-list 'package-pinned-packages '(magit . "melpa-stable") t)
(unless (package-installed-p 'use-package)
(package-install 'use-package))
(require 'use-package)
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(setq package-enable-at-startup nil)
(use-package perspective
:straight t
:bind
("C-x k" . persp-kill-buffer*)
("C-x C-b" . persp-list-buffers) ; or use a nicer switcher, see below
:init
(setq persp-state-default-file "/home/zam4abt/my-emacs-stuff/perspectives"
persp-sort 'access
persp-show-modestring t
persp-modestring-short nil
persp-mode-prefix-key (kbd "C-x x"))
(persp-mode)
:hook ((kill-emacs . my-persp-save)
(after-init . my-persp-load)))
(use-package doom-modeline
:straight t
:hook (after-init . doom-modeline-mode)
:init
(setq doom-modeline-minor-modes nil)
;; Prevent flash of unstyled modeline at startup
(unless after-init-time
(setq-default mode-line-format nil))
:bind (:map doom-modeline-mode-map
("C-<f6>" . doom-modeline-hydra/body)))
After the following config was run, I tried to disable doom-modeline and re-enable it but the highlighting still seemed to work with and without doom-modeline.
Perhaps there is a problem with the themes interfering with it because that seems to be a thing I didn't test in emacs -Q
. Do you have any hints for how to approach this problem other than trying to installing the themes and testing it?
from perspective-el.
Since it sounds like everything works with the minimal configuration above, then doom-modeline is not the problem? In that case, yes, I'm inclined to blame some interaction of themes and limitations of persp-selected-face
, since it's just a :foreground "Blue"
setting. Also, the face is used directly in the code, rather than through a variable indirection, so it's more difficult to adjust in conflicting situations.
I'd definitely install the conflicting theme and take it from there. It's tedious but not difficult to examine the faces defined by a theme (using M-x list-faces-display
), and figure out what's going on. The raw mode line is in the mode-line-format
variable, which I like to examine in ielm
mode (pretty-printing is important for something that complicated) — it's usually possible to track down which faces are used where by looking at what it's doing.
If this is the case, then maybe a good fix would be to introduce a layer of indirection for persp-selected-face
, which should make modifying it more theme-friendly:
(defface persp-selected-default-face
'((t (:weight bold :foreground "Blue")))
"The default face used to highlight the current perspective on the modeline.")
(defvar persp-selected-face persp-selected-default-face
;; or better yet: defcustom
"The face actually used to highlight the current perspective on the modeline.")
An even smarter approach is to make the face dynamic, so it automatically adjusts its color to suit the theme. I've done this before for other code, it usually works. A bit more work required, though.
from perspective-el.
Yeah, I think hard coding persp-selected-face
to blue might be causing some interactions with the themes and might need to have an indirection in the case of themes. Besides, I just declared emacs bankruptcy and the themes seemed to have played some part in it or my lack of sufficient knowledge. I have started over with my new config (without perspective.el as of now, but planned in the next few days). So, if the problem reappears, I will report back soon.
from perspective-el.
Related Issues (20)
- Marginalia annotation not working with `persp-switch-to-buffer*` HOT 4
- persp-mode does not get activated during startup HOT 3
- helm mini frame errors saying no such buffer HOT 5
- Recently released Emacs 28.1 uses `C-x x` for buffer actions, thus conflicting with the prefix for perspective-el HOT 10
- [feature request] - Option to not save modes for buffers HOT 1
- Creating pipe: Too many open files HOT 5
- Can't setup perspective layout at startup HOT 4
- Perspective breaks after enable-theme HOT 5
- Perspective hides buffers when running Emacs as server HOT 4
- Display perspective in frame title HOT 7
- `C-x 5 2 ` different behaviour when running perspective with daemon HOT 2
- Perspective.el wipes out perspectives when a emacsclient frame is closed. HOT 2
- `persp-delete-frame` alters windows of other frames when killing frame with dedicated window HOT 1
- Issue with using ediff and perspective [sorted] HOT 6
- Compare to tabspaces? HOT 2
- Support eshell state save and restore
- Would it support different themes per frame? HOT 2
- Loading perspectives upon opening emacs HOT 5
- ibuf-ext.el not loaded HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from perspective-el.