nex3 / perspective-el

Perspectives for Emacs.
MIT License
880 stars 71 forks source link

ibuf-ext.el not loaded #202

Closed ehrt74 closed 7 months ago

ehrt74 commented 7 months ago

on my system i've been having trouble getting perspective to work with ibuffer. i have added the following ibuffer hook:

 (add-hook 'ibuffer-hook
        (lambda ()
          (persp-ibuffer-set-filter-groups)
          (unless (eq ibuffer-sorting-mode 'alphabetic)
            (ibuffer-do-sort-by-alphabetic))))

on opening ibuffer the following error occurs:

persp-ibuffer-generate-filter-groups: Symbol’s function definition is void: ibuffer-remove-duplicates

this seems to be because ibuf-ext.el is not loaded (locate-library confirms this).

to fix this problem i've added a (require 'ibuf-ext) to my init.el. maybe this would be better added somewhere in the perspective code?

gcv commented 7 months ago

I tried fixing this in 460311b, but since I don't use ibuffer regularly, I'm not sure how to test the fix correctly. It should be in MELPA now. Could you please check if that works?

ehrt74 commented 7 months ago

perfect! it works on my system :)

my use-package for perspective was this

  (use-package perspective
      :ensure t
      :bind (("C-x k" . persp-kill-buffer*)
       ("s-[" . persp-prev)
       ("s-]" . persp-next))

      :init
      (persp-mode)
      (setq persp-state-default-file (expand-file-name ".persp" user-emacs-directory))
      (add-hook 'ibuffer-hook
        (lambda ()
          (require 'ibuf-ext) ;; <- fusxado por certigi ke 'ibuf-ext estas sxargita
          (persp-ibuffer-set-filter-groups)
          (unless (eq ibuffer-sorting-mode 'alphabetic)
            (ibuffer-do-sort-by-alphabetic))))
      (add-hook 'kill-emacs-hook #'persp-state-save)
      (persp-state-load persp-state-default-file)
      (persp-switch "main")
      :custom
      (persp-mode-prefix-key (kbd "C-x x")))

i commented out (require 'ibuf-ext), ran org-babel-tangle and restarted. ibuffer works!!!

thank-you!