seagle0128 / grip-mode

Instant Github-flavored Markdown/Org preview using grip
GNU General Public License v3.0
275 stars 6 forks source link

grip-mode doesn't open an external browser, instead open another buffer #23

Closed sylvesterroos closed 2 years ago

sylvesterroos commented 2 years ago

I was under the impression that the default behavior would be to open an external browser, like the first screenshot. Is there a way to make it open an external browser? I tried setting the default browser like the readme instructed, but that didn't fix it

seagle0128 commented 2 years ago

To be clear,

  1. Are you using emacs with --with-xwidgets?
  2. Did you try (setq grip-preview-use-webkit nil) if you are using xwidget?
sylvesterroos commented 2 years ago

1. Yes. This is the output of emacs -nw -q --batch --eval '(message system-configuration-options)':

!Formatted for readability!

--prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --mandir=/usr/share/man
--with-gameuser=:games --with-sound=alsa --with-modules --with-x-toolkit=gtk3 --with-cairo --with-xwidgets
--with-native-compilation --with-pgtk --without-compress-install --without-gconf --without-gsettings
--without-m17n-flt --enable-autodepend --enable-link-time-optimization ’CFLAGS=-march=x86-64
-mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat
-Werror=format-security 
-fstack-clash-protection -fcf-protection -g -flto’ LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now

I'm using this AUR package because I'm on Wayland. The name xwidgets makes it sound like that might be a problem, but that's just a though from someone who doesn't know much about the deep inner workings of Linux :)

2. I did not, but adding that option fixes it! Would it be possible to add that to the readme? It currently implies that opening the browser is default behaviour, because according to the readme you need to assign the variable to t to make it open the buffer

seagle0128 commented 2 years ago

I believe it has already been in README. You may misunderstand.

;; Use embedded webkit to preview
;; This requires GNU/Emacs version >= 26 and built with the `--with-xwidgets` option.
(setq grip-preview-use-webkit t)