unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Paul Chany <csanyipal@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: How to setup w3m-el as a default browser on GNU system?
Date: Fri, 18 Jun 2010 12:37:02 +0200	[thread overview]
Message-ID: <87pqzoocdt.fsf@debian-laptop.localdomain> (raw)
In-Reply-To: 20100618085238.GA13330@Zsdrums

Pedro Insua <pedroinsua@gmail.com> writes:

> On Fri, Jun 18, 2010 at 12:35:42AM +0200, Paul Chany wrote:
>> Pedro Insua <pedroinsua@gmail.com> writes:
>> 
>> > On Thu, Jun 17, 2010 at 11:34:42PM +0200, Paul Chany wrote:
>> >> Pedro Insua <pedroinsua@gmail.com> writes:
>> >> 
>> >> > On Thu, Jun 17, 2010 at 10:56:57PM +0200, Paul Chany wrote:
>> >> >> Pedro Insua <pedroinsua@gmail.com> writes:
>> >> >> 
>> >> >> > On Thu, Jun 17, 2010 at 03:56:38PM +0200, Paul Chany wrote:
>> >> >> >> I need this setup because when in org-mode and want follow a 
>> >> >> >> link to a file://path/some.html then an xterm being started
>> >> >> >> and on it w3m as a default browser. I try to setup Emacs and 
>> >> >> >> org-mode to open this file in Emacs buffer in w3m-el but
>> >> >> >> without any success. What am I missing here? 
>> >> >> >    http://www.emacswiki.org/emacs/BrowseUrl
>> >> >> 
>> >> >> Thanks! I follow advices red here and setup variables:
>> >> >> ‘browse-url-browser-function’
>> >> >> ‘browse-url-generic-program’
>> >> >> 
>> >> >> I have now in my .emacs file:
>> >> >>  '(browse-url-browser-function (quote w3m-browse-url))
>> >> >>  '(browse-url-generic-program "w3m-browse-url")
>> >> >> 
>> >> >> and still when I C-c C-o on a file://path/some.html link, an
>> >> >> xterm appeare and on it w3m with the opened file! :(
>> >> >> 
>> >> >> What am I missing here?
>> >> >
>> >> >  mmm,  I'm Debian user too.. do you have w3m-el package
>> >> >  installed? 
>> >> 
>> >> Yes, and I can open from an org file a http://path/some.html
>> >> within Emacs with w3m-el, but can't open a file
>> >> file://path/some.html in the same way because in the letter case I
>> >> get opened xterm and on it w3m instead to get the file opened
>> >> within Emacs with w3m-el. :( 
>> >> 
>> >   Well.. the 'trick' is in configure: org-file-apps
>> 
>> I was tried to configure it already but without any success.
>> I have now in my .emacs file:
>>  '(org-file-apps 
>>    (quote 
>>     (
>>      (auto-mode . emacs) 
>>      ("\\.x?html?\\'" . default)
>>      ("\\.pdf\\'" . default)
>>     )
>>    )
>>   )
>> 
>> so the default browser is: w3m (not Emacs-w3m).
>> In the org-file-apps customization buffer there is a Value Menu for
>> Exstension: \.x?html?\'. In this menu there are the options:
>> 0 = Visit with Emacs
>> 1 = Use default
>> 2 = Use the system command
>> 3 = Command
>> 4 = Lisp form
>> 
>> When choosed 0 the link file://path/some.html was opened within Emacs
>> buffer for editing and not for viewing.
>> When choosed 1 the abowe mentioned link was opened in an xterm with
>> w3m. 
>> Options 2 and 3 was tried by me but without any success. Say I was
>> tried as Command 'w3m-browse-url' but get the same as with option 1.
>> In the case of option 4 I dont' know how could I configure Emacs to
>> use Emacs-w3m to open such a link.
>> 
>> Any advices?
>
>   Hi again! I think i've get the solution!! :D
>
>   Well, the first, set w3m as default browser of Emacs: 
>
>      '(browse-url-browser-function (quote w3m))
>
>   Then, set org-file-apps to use the default browser: 
>  
>       (add-to-list 'org-file-apps '("\\.x?html?\\'" browse-url file)) 
>
>
>   This work for me... bye!

I have the following setup that works for me:

 '(browse-url-browser-function (quote w3m-browse-url))
 '(browse-url-generic-program nil)
 '(browse-url-new-window-flag t)

 '(org-file-apps 
   (quote (
	   (auto-mode . emacs) 
	   ("\\.x?html?\\'" . (browse-url file))
	   ("\\.pdf\\'" . default)
	  )
   )
  )

Thank you all for support!! :D

-- 
Regards,
Paul Chany
You can freely correct my English.
http://csanyi-pal.info




  reply	other threads:[~2010-06-18 10:37 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-17 13:56 How to setup w3m-el as a default browser on GNU system? Paul Chany
2010-06-17 14:07 ` Thierry Volpiatto
2010-06-17 16:42   ` Paul Chany
     [not found]   ` <mailman.1.1276792958.21170.help-gnu-emacs@gnu.org>
2010-06-17 22:12     ` Tim X
2010-06-17 17:07 ` Pedro Insua
2010-06-17 20:56   ` Paul Chany
2010-06-17 21:28     ` Pedro Insua
2010-06-17 21:34       ` Paul Chany
2010-06-17 22:18         ` Pedro Insua
2010-06-17 22:35           ` Paul Chany
2010-06-18  8:46             ` Štěpán Němec
2010-06-18 10:27               ` Paul Chany
2010-06-18 12:08                 ` Drew Adams
2010-06-18 15:34                   ` How to get Elisp info documentation on Debian Squeeze? Paul Chany
2010-06-18 15:40                     ` Drew Adams
2010-06-18 15:40                     ` Richard Riley
2010-06-18 16:23                       ` Paul Chany
     [not found]                     ` <mailman.3.1276875632.15308.help-gnu-emacs@gnu.org>
2010-06-18 23:49                       ` Tim X
2010-06-18  8:52             ` How to setup w3m-el as a default browser on GNU system? Pedro Insua
2010-06-18 10:37               ` Paul Chany [this message]
     [not found]   ` <mailman.7.1276808235.21170.help-gnu-emacs@gnu.org>
2010-06-17 22:15     ` Tim X

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pqzoocdt.fsf@debian-laptop.localdomain \
    --to=csanyipal@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).