lordpretzel / mu4e-views

GNU General Public License v3.0
107 stars 6 forks source link

Doom Emacs users #8

Open pkazmier opened 3 years ago

pkazmier commented 3 years ago

I just discovered mu4e-views yesterday and I'm loving it! I'm a Doom Emacs user, so I've had to make some tweaks to make it more comfortable in Doom, so I thought I'd share my setup thus far in case any other Doom users find this.

package.el

(package! mu4e-views)

config.el

(use-package! mu4e-views
  :after mu4e
  :config
  (setq mu4e-views-completion-method 'ivy)
  (setq mu4e-views-default-view-method "html")
  (setq mu4e-views-next-previous-message-behaviour 'stick-to-current-window) ;; when pressing n and p stay in the current window
  (setq mu4e-views-mu4e-html-email-header-style
        "<style type=\"text/css\">
.mu4e-mu4e-views-mail-headers { font-family: sans-serif; font-size: 10pt; margin-bottom: 30px; padding-bottom: 10px; border-bottom: 1px solid #ccc; color: #000;}
.mu4e-mu4e-views-header-row { display:block; padding: 1px 0 1px 0; }
.mu4e-mu4e-views-mail-header { display: inline-block; text-transform: capitalize; font-weight: bold; }
.mu4e-mu4e-views-header-content { display: inline-block; padding-right: 8px; }
.mu4e-mu4e-views-email { display: inline-block; padding-right: 8px; }
.mu4e-mu4e-views-attachment { display: inline-block; padding-right: 8px; }
</style>"
        )

  (add-hook! mu4e-headers-mode
    (mu4e-views-mu4e-use-view-msg-method "html")) ;; select the default

  (map! :map mu4e-headers-mode-map
        :n "M-b" #'mu4e-views-cursor-msg-view-window-up
        :n "M-f" #'mu4e-views-cursor-msg-view-window-down
        :localleader
        :desc "Message action"        "a"   #'mu4e-views-mu4e-view-action
        :desc "Scoll message down"    "b"   #'mu4e-views-cursor-msg-view-window-up
        :desc "Scoll message up"      "f"   #'mu4e-views-cursor-msg-view-window-down
        :desc "Open attachment"       "o"   #'mu4e-views-mu4e-view-open-attachment
        :desc "Save attachment"       "s"   #'mu4e-views-mu4e-view-save-attachment
        :desc "Save all attachments"  "S"   #'mu4e-views-mu4e-view-save-all-attachments
        :desc "Set view method"       "v"   #'mu4e-views-mu4e-select-view-msg-method)) ;; select viewing method)

;; Evil bindings for xwidget webkit browsers
(map! :map xwidget-webkit-mode-map
      :n "Z Z" #'quit-window
      :n "gr"  #'xwidget-webkit-reload
      :n "y"   #'xwidget-webkit-copy-selection-as-kill
      :n "s-c" #'xwidget-webkit-copy-selection-as-kill
      :n "t"   #'xwidget-webkit-browse-url
      :n "TAB" #'xwidget-webkit-forward
      :n "C-o" #'xwidget-webkit-back
      :n "G"   #'xwidget-webkit-scroll-bottom
      :n "gg"  #'xwidget-webkit-scroll-top
      :n "C-b" #'xwidget-webkit-scroll-down
      :n "C-f" #'xwidget-webkit-scroll-up
      :n "M-=" #'xwidget-webkit-zoom-in
      :n "M--" #'xwidget-webkit-zoom-out
      :n "k"   #'xwidget-webkit-scroll-down-line
      :n "j"   #'xwidget-webkit-scroll-up-line)
lordpretzel commented 3 years ago

thanks, that's great. I hope I'll find time soon to develop the evil-collections bindings and fix the gnus bug.

awerdx520 commented 3 years ago

After I installed mu4e-views, every time I press a key, it flashes. Especially the +childframe with ivy enabled. Is there any special settings for Xwidgets?

lordpretzel commented 3 years ago

Hi,

I have to admit that I am no expert on xwidgets. Can you let me know a few things so we can figure out whether this is related to mu4e-views or just an xwidgets bug?

awerdx520 commented 3 years ago

OK, I searched some information, it seems to be the problem of xwidget. Xwidgets browser has the same glint problem.

os: manjaro kernel: 5.4.80-2-MANJARO de: gnome

ChauhanT commented 3 years ago

Hi, I can't get mu4e-views to work on doom. I suspect that it might be related to the fact that I use gnome on wayland (Debian Buster). Any comments/suggestions?

lordpretzel commented 3 years ago

what errors are you getting?

smalltimer commented 3 years ago

Hi, thanks for responding! I am on Debian and I think it's because on Debian emacs is not compiled with xwidgets support. Would you happen to know if there is an easy way to do this without compiling from source? Cheers. Note: It's @ChauhanT =.=" I forgot to change usernames.

fuzunspm commented 2 years ago

it crashes emacs on my end, how do i populate error logs to provide more information?

lordpretzel commented 2 years ago

@smalltimer Unfortunatly, there is no lisp way of doing it. This requires integrating emacs with a browser widget, so emacs has to be compiled with support for it. It may be worth to look around whether you can find an apt-source with a recent version that supports this if you do not want to compile from source.

lordpretzel commented 2 years ago

@fuzunspm first thing to check would be see whether this is mu4e-views specific (likely it is not). Can you try to use xwidget-webkit-browse-url directly and see whether this crashes emacs. If yes, then this is an upstream issue that should be reported to the emacs developers. Unfortunately, xwidget support in emacs is shakey, but it sounds like the newest version of emacs with the pgkt-branch merged this may change.