USE flags for emacs
Emacs works well unless using gtk3 and dbus. I have no idea why gtk3 making problem but it is.
So, it's my woking USE flags;
SUNJOONG-DESKTOP ~ # emerge -pv emacs
[ebuild R ] app-editors/emacs-24.5-r3:24::gentoo USE="X gfile gtk inotify libxml2 png ssl svg toolkit-scroll-bars xft xpm zlib -Xaw3d -acl -alsa (-aqua) -athena -dbus -games -gconf -gif -gpm -gsettings -gtk3 -gzip-el -hesiod -imagemagick -jpeg -kerberos -livecd -m17n-lib -motif -pax_kernel (-selinux) -sound -source -tiff -wide-int" 0 KiB
SUNJOONG-DESKTOP ~ #
bash.exe shortcut
There is a shortcut of bash.exe named "Bash on Ubuntu on Windows" in your Start Menu like
"C:\Users\sunjoong\AppData\Roaming\Microsoft\Windows\Start Menu\Programs" directory.
You know, sunjoong is my user name, so do with your username in your case.
Change the shortcut name to "Bash on Gentoo on Windows" for looking good.
The target attribute of that shortcut is
C:\Windows\System32\bash.exe ~
Append "-l" option like this;
C:\Windows\System32\bash.exe ~ -l
Then, ~/.bash_profile file will work.
UPDATE: I heard bash.exe will launch bash login shell starting 16184, microsoft/WSL#2067 (comment) ; so you might not need to append -l
option after then.
~/.bash_profile
This is my ~/.bash_profile;
SUNJOONG-DESKTOP ~ # cat ~/.bash_profile
# This file is sourced by bash for login shells. The following line
# runs your .bashrc and is recommended by the bash info pages.
if [[ -f ~/.bashrc ]] ; then
. ~/.bashrc
fi
~~/mnt/c/Windows/System32/tasklist.exe /fi 'imagename eq vcxsrv.exe' ~~
~~2> /dev/null ~~
| grep 'No tasks are running' > /dev/null
if [ $? -eq 0 ]; then
~~/mnt/c/Program\ Files/VcXsrv/vcxsrv.exe ~~
:0 -multiwindow -clipboard -wgl &> /dev/null &disown
fi
export DISPLAY=:0
SUNJOONG-DESKTOP ~ #
I had installed VcXsrv Windows X Server.
My ~/.bash_profile check whether X server be running and run X server if not running.
runemacs.exe
I'm using a modified runnig emacs wrapper. This is a source - runemacsWSL.zip.
This is a compiled binary - runemacs.zip. It acts like "bash.exe -l -c emacs".
So, I can run emacs by mouse double-clicking with this wrapper and ~/.bash_profile.
UPDATE: #3 (comment)
UPDATE: #3 (comment)
Microsoft Edge as emacs browse-url-browser-function
This is a part of my emacs init file;
(defun browse-url-edge (url &optional new-window)
(shell-command
(concat "/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe "
"start microsoft-edge:'\\\"" url "\\\"'")))
(custom-set-variables
'(browse-url-browser-function 'browse-url-edge)
'(inhibit-startup-screen t))
(setq default-directory "/mnt/c/Users/sunjoong/Desktop")
You could notice browse-url-edge function and browse-url-browser-function .
That makes set external web brower to Microsoft Edge.
The inhibit-startup-screen and default-directory make emacs looking other windows program.
You know, sunjoong is my user name, so do with your username in your case.