在 emacs 的 .emacs 中:
'(browse-url-browser-function (quote browse-url-default-browser))
我将 Opera 设置为默认浏览器后重新启动了系统。当我跑步时:
update-alternatives --config gnome-www-browser
There are 4 choices for the alternative gnome-www-browser (providing /usr/bin/gnome-www-browser).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/google-chrome-stable 200 auto mode
1 /usr/bin/firefox-esr 70 manual mode
2 /usr/bin/google-chrome-stable 200 manual mode
3 /usr/bin/iceweasel 70 manual mode
* 4 /usr/bin/opera 120 manual mode
Press <enter> to keep the current choice[*], or type selection number:
和
update-alternatives --config x-www-browser
There are 6 choices for the alternative x-www-browser (providing/usr/bin/x-www-browser).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/google-chrome-stable 200 auto mode
1 /usr/bin/firefox-esr 70 manual mode
2 /usr/bin/google-chrome-stable 200 manual mode
3 /usr/bin/iceweasel 70 manual mode
4 /usr/bin/konqueror 30 manual mode
* 5 /usr/bin/opera 120 manual mode
6 /usr/bin/qupzilla 80 manual mode
Press <enter> to keep the current choice[*], or type selection number:
当我直接单击 .html 文件时,它会使用 Opera 打开。
cat ~/.local/share/applications/defaults.list
[Default Applications]
application/pdf=FoxitReader.desktop
application/ppdf=FoxitReader.desktop
然而,emacs 坚持使用 firefox 打开文件。这个设置是从哪里来的?
答案1
请尝试:
(setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program "opera")