Git Product home page Git Product logo

Comments (4)

gcv avatar gcv commented on July 17, 2024

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 (

(defface persp-selected-face
). What happens if you modify it?

from perspective-el.

mukundzare avatar mukundzare commented on July 17, 2024

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.

gcv avatar gcv commented on July 17, 2024

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.

mukundzare avatar mukundzare commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.