mu4e-views icon indicating copy to clipboard operation
mu4e-views copied to clipboard

Doom Emacs users

Open pkazmier opened this issue 4 years ago • 10 comments

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)

pkazmier avatar Oct 10 '20 23:10 pkazmier

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

lordpretzel avatar Oct 11 '20 20:10 lordpretzel

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?

awerdx520 avatar Dec 29 '20 15:12 awerdx520

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?

  • can you try to browse webpages in xwidgets with a second window open that does something else? Do you get the flickering then
  • what environment are you running on (emacs version, mu version, OS)?

lordpretzel avatar Dec 29 '20 18:12 lordpretzel

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

awerdx520 avatar Dec 30 '20 02:12 awerdx520

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?

ChauhanT avatar Jul 21 '21 10:07 ChauhanT

what errors are you getting?

lordpretzel avatar Jul 30 '21 12:07 lordpretzel

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.

smalltimer avatar Jul 30 '21 13:07 smalltimer

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

fuzunspm avatar Jan 12 '22 13:01 fuzunspm

@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 avatar Feb 14 '22 04:02 lordpretzel

@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.

lordpretzel avatar Feb 14 '22 04:02 lordpretzel