unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Add support for Conkeror in browse-url.el
@ 2015-02-12 15:25 vibhavp
  2015-02-14  8:07 ` Vibhav Pant
  0 siblings, 1 reply; 11+ messages in thread
From: vibhavp @ 2015-02-12 15:25 UTC (permalink / raw)
  To: emacs-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 331 bytes --]


Hello,

I have added support for net/browse-url.el for Conkeror[1], a web
browser based on Mozilla's XULRunner, which provides an emacs-like
navigation interface.

The browser treats tabs like "buffers", which can be navigated with C-x
 b, so I have used the term "buffer" instead of "tabs" in the code, to
 maintain consistency. 

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Add support for conkeror --]
[-- Type: text/x-diff, Size: 4960 bytes --]

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ff2755d..908a32e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
+2015-02-12  Vibhav Pant  <vibhavp@gmail.com>
+
+	* net/browse-url.el (browse-url-browser-function): Add "Conkeror".
+	(browse-url-conkeror-program, browse-url-conkeror-arguments)
+	(browse-url-conkeror-new-window-is-buffer): New defcustoms.
+	(browse-url-default-browser): Check for `browse-url-conkeror'
+	and call `browse-url-conkeror-program'.
+	(browse-url-conkeror): New command.
+
 2015-02-12  Oleh Krehel  <ohwoeowho@gmail.com>
 
 	* progmodes/gdb-mi.el (gdb-display-io-nopopup): New defcustom.
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 42fb954..6cbf393 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -42,6 +42,7 @@
 ;; browse-url-netscape                Netscape    1.1b1
 ;; browse-url-mosaic                  XMosaic/mMosaic <= 2.4
 ;; browse-url-cci                     XMosaic     2.5
+;; browse-url-conkeror                Conkeror    Dont know
 ;; browse-url-w3                      w3          0
 ;; browse-url-w3-gnudoit              w3 remotely
 ;; browse-url-text-*	              Any text browser     0
@@ -236,6 +237,7 @@ regexp should probably be \".\" to specify a default browser."
 	  (function-item :tag "Netscape" :value  browse-url-netscape)
 	  (function-item :tag "Mosaic" :value  browse-url-mosaic)
 	  (function-item :tag "Mosaic using CCI" :value  browse-url-cci)
+	  (function-item :tag "Conkeror" :value  browse-url-conkeror)
 	  (function-item :tag "Text browser in an xterm window"
 			 :value browse-url-text-xterm)
 	  (function-item :tag "Text browser in an Emacs window"
@@ -413,6 +415,13 @@ functionality is not available there."
   :type 'boolean
   :group 'browse-url)
 
+(defcustom browse-url-conkeror-new-window-is-buffer nil
+  "Whether to open up new windows in a buffer or a new window.
+If non-nill, then open the URL in a new buffer rather than a new window if
+`browse-url-conkeror' is asked to open it in a new window"
+  :type 'boolean
+  :group 'browse-url)
+
 (defcustom browse-url-galeon-new-window-is-tab nil
   "Whether to open up new windows in a tab or a new window.
 If non-nil, then open the URL in a new tab rather than a new window if
@@ -459,6 +468,17 @@ commands reverses the effect of this variable.  Requires Netscape version
   :type 'string
   :group 'browse-url)
 
+(defcustom browse-url-conkeror-program "conkeror"
+  "The name by which to invoke Conkeror."
+  :type 'string
+  :version "25.1"
+  :group 'browse-url)
+
+(defcustom browse-url-conkeror-arguments nil
+  "A list of strings to pass to Conkeror as arguments."
+  :type '(repeat (string :tag "Argument"))
+  :group 'browse-url)
+
 (defcustom browse-url-filename-alist
   `(("^/\\(ftp@\\|anonymous@\\)?\\([^:]+\\):/*" . "ftp://\\2/")
     ;; The above loses the username to avoid the browser prompting for
@@ -933,6 +953,7 @@ used instead of `browse-url-new-window-flag'."
     ((executable-find browse-url-kde-program) 'browse-url-kde)
     ((executable-find browse-url-netscape-program) 'browse-url-netscape)
     ((executable-find browse-url-mosaic-program) 'browse-url-mosaic)
+    ((executable-find browse-url-conkeror-program) 'browse-url-conkeror)
     ((executable-find browse-url-xterm-program) 'browse-url-text-xterm)
     ((locate-library "w3") 'browse-url-w3)
     (t
@@ -1392,6 +1413,41 @@ used instead of `browse-url-new-window-flag'."
   (process-send-string "browse-url" "disconnect\r\n")
   (delete-process "browse-url"))
 
+;; --- Conkeror ---
+;;;###autoload
+(defun browse-url-conkeror (url &optional new-window)
+  "Ask the Conkeror WWW browser to load URL.
+Default to the URL around or before point. The strings in the variable
+`browse-url-conkeror-arguments' are also passed to Conkeror.
+
+When called interactively, if variable `browse-url-new-window-flag'
+is non-nil, load the document in a new Conkeror window, otherwise use a random
+existing one. A non-nil interactive prefix argument reverses the effect of
+`browse-url-new-window-flag'
+
+If `browse-url-conkeror-new-window-is-buffer' then whenever a document would
+otherwise be loaded in a new window, it is loaded in a new buffer in an existing
+window instead.
+
+When called non-interatively, optional second argument NEW-WINDOW is used instead of
+`browse-url-new-window-flag'"
+  (interactive (browse-url-interactive-arg "URL: "))
+  (setq url (browse-url-encode-url url))
+  (let* ((process-environment (browse-url-process-environment)))
+    (apply 'start-process (format "conkeror %s" url)
+	   nil
+	   browse-url-conkeror-program
+	   (append
+	    browse-url-conkeror-arguments
+	    (list
+	     "-e"
+	     (format "load_url_in_new_%s('%s')"
+		     (if (browse-url-maybe-new-window new-window)
+			 (if browse-url-conkeror-new-window-is-buffer
+			     "buffer"
+			   "window")
+		       "buffer")
+		     url))))))
 ;; --- W3 ---
 
 ;; External.

[-- Attachment #3: Type: text/plain, Size: 29 bytes --]


[1]: http://conkeror.org/
 

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] Add support for Conkeror in browse-url.el
  2015-02-12 15:25 [PATCH] Add support for Conkeror in browse-url.el vibhavp
@ 2015-02-14  8:07 ` Vibhav Pant
  2015-02-14  9:30   ` Jan D.
  0 siblings, 1 reply; 11+ messages in thread
From: Vibhav Pant @ 2015-02-14  8:07 UTC (permalink / raw)
  To: emacs-devel@gnu.org

No reply? Is there anything wnong with the patch?

I have created a bug report for the patch:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19863

On Thu, Feb 12, 2015 at 8:55 PM,  <vibhavp@gmail.com> wrote:
>
> Hello,
>
> I have added support for net/browse-url.el for Conkeror[1], a web
> browser based on Mozilla's XULRunner, which provides an emacs-like
> navigation interface.
>
> The browser treats tabs like "buffers", which can be navigated with C-x
>  b, so I have used the term "buffer" instead of "tabs" in the code, to
>  maintain consistency.
>
> [1]: http://conkeror.org/
>
>



-- 
Vibhav Pant
vibhavp@gmail.com



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Add support for Conkeror in browse-url.el
  2015-02-14  8:07 ` Vibhav Pant
@ 2015-02-14  9:30   ` Jan D.
  2015-02-14 11:22     ` vibhavp
  2015-02-14 11:32     ` Artur Malabarba
  0 siblings, 2 replies; 11+ messages in thread
From: Jan D. @ 2015-02-14  9:30 UTC (permalink / raw)
  To: Vibhav Pant; +Cc: emacs-devel@gnu.org

Hi.

> 14 feb 2015 kl. 09:07 skrev Vibhav Pant <vibhavp@gmail.com>:
> 
> No reply? Is there anything wnong with the patch?

Instead of adding browsers to browse-url.el, we should encourage people to set up their preferred browser as system default, and then use browse-url-xdg-open, browse-url-default-windows-browser or browse-url-default-macosx-browser.

	Jan D.

> 
> I have created a bug report for the patch:
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19863
> 
> On Thu, Feb 12, 2015 at 8:55 PM,  <vibhavp@gmail.com> wrote:
>> 
>> Hello,
>> 
>> I have added support for net/browse-url.el for Conkeror[1], a web
>> browser based on Mozilla's XULRunner, which provides an emacs-like
>> navigation interface.
>> 
>> The browser treats tabs like "buffers", which can be navigated with C-x
>> b, so I have used the term "buffer" instead of "tabs" in the code, to
>> maintain consistency.
>> 
>> [1]: http://conkeror.org/
>> 
>> 
> 
> 
> 
> -- 
> Vibhav Pant
> vibhavp@gmail.com




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Add support for Conkeror in browse-url.el
  2015-02-14  9:30   ` Jan D.
@ 2015-02-14 11:22     ` vibhavp
  2015-02-14 13:51       ` Jan D.
  2015-02-14 11:32     ` Artur Malabarba
  1 sibling, 1 reply; 11+ messages in thread
From: vibhavp @ 2015-02-14 11:22 UTC (permalink / raw)
  To: Jan D.; +Cc: emacs-devel@gnu.org

"Jan D." <jan.h.d@swipnet.se> writes:

> Instead of adding browsers to browse-url.el, we should encourage
> people to set up their preferred browser as system default, and then
> use browse-url-xdg-open, browse-url-default-windows-browser or
> browse-url-default-macosx-browser.

browse-url.el has the ability to load web pages in a new tab, instead of
a new window. Since there is no universal standard for opening web pages
in a browser, every browser does that in its own way (Firefox uses the
-remote/-new-tab arguments, chromium always opens the URL in a new
tab). Since xdg-open's job is just to provide default applications, the
"responsibility" falls on emacs itself.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Add support for Conkeror in browse-url.el
  2015-02-14  9:30   ` Jan D.
  2015-02-14 11:22     ` vibhavp
@ 2015-02-14 11:32     ` Artur Malabarba
  1 sibling, 0 replies; 11+ messages in thread
From: Artur Malabarba @ 2015-02-14 11:32 UTC (permalink / raw)
  To: Jan D.; +Cc: Vibhav Pant, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 392 bytes --]

> Instead of adding browsers to browse-url.el, we should encourage people
to set up their preferred browser as system default, and then use
browse-url-xdg-open, browse-url-default-windows-browser or
browse-url-default-macosx-browser.

I agree with your logic but, FWIW, I've never managed to set conkeror as a
default browser in Windows. So I've had to use something like the proposed
patch.

[-- Attachment #2: Type: text/html, Size: 437 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Add support for Conkeror in browse-url.el
  2015-02-14 11:22     ` vibhavp
@ 2015-02-14 13:51       ` Jan D.
  2015-02-15  5:15         ` vibhavp
  0 siblings, 1 reply; 11+ messages in thread
From: Jan D. @ 2015-02-14 13:51 UTC (permalink / raw)
  To: vibhavp; +Cc: emacs-devel@gnu.org

Hi.

> 14 feb 2015 kl. 12:22 skrev vibhavp@gmail.com:
> 
> "Jan D." <jan.h.d@swipnet.se> writes:
> 
>> Instead of adding browsers to browse-url.el, we should encourage
>> people to set up their preferred browser as system default, and then
>> use browse-url-xdg-open, browse-url-default-windows-browser or
>> browse-url-default-macosx-browser.
> 
> browse-url.el has the ability to load web pages in a new tab, instead of
> a new window. Since there is no universal standard for opening web pages
> in a browser, every browser does that in its own way (Firefox uses the
> -remote/-new-tab arguments, chromium always opens the URL in a new
> tab). Since xdg-open's job is just to provide default applications, the
> "responsibility" falls on emacs itself.

No, it is not for Emacs to say if a link should open in a new tab or window.  That is a setting in the browser.  Most browsers have something like "Open new links in tabs" that you can enable.

	Jan D.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Add support for Conkeror in browse-url.el
  2015-02-14 13:51       ` Jan D.
@ 2015-02-15  5:15         ` vibhavp
  2015-02-15 10:13           ` Jan D.
  0 siblings, 1 reply; 11+ messages in thread
From: vibhavp @ 2015-02-15  5:15 UTC (permalink / raw)
  To: Jan D.; +Cc: emacs-devel@gnu.org

Jan D. <jan.h.d@swipnet.se> writes:

> No, it is not for Emacs to say if a link should open in a new tab or window.  That is a setting in the browser.  Most browsers have something like "Open new links in tabs" that you can enable.

Well, epiphany and chromium open external links in the existing window
(unless the link is opened with the switch --new-window, which is what
browse-url.el does). However Firefox (and maybe other gecko based browsers)
have a setting which you are talking about.

Anyways, can the patch be applied for now? (unless a complete overhaul
is being planed)

--
Vibhav Pant
vibhavp@gmail.com



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Add support for Conkeror in browse-url.el
  2015-02-15  5:15         ` vibhavp
@ 2015-02-15 10:13           ` Jan D.
  2015-02-15 20:30             ` Stefan Monnier
  0 siblings, 1 reply; 11+ messages in thread
From: Jan D. @ 2015-02-15 10:13 UTC (permalink / raw)
  To: vibhavp; +Cc: emacs-devel@gnu.org

Hi.

I think this patch is too big as a tiny change and I can't find any copyright disclamer from you.
But it is really up to Stefan or Glenn to decide.

	Jan D.

> 15 feb 2015 kl. 06:15 skrev vibhavp@gmail.com:
> 
> Jan D. <jan.h.d@swipnet.se> writes:
> 
>> No, it is not for Emacs to say if a link should open in a new tab or window.  That is a setting in the browser.  Most browsers have something like "Open new links in tabs" that you can enable.
> 
> Well, epiphany and chromium open external links in the existing window
> (unless the link is opened with the switch --new-window, which is what
> browse-url.el does). However Firefox (and maybe other gecko based browsers)
> have a setting which you are talking about.
> 
> Anyways, can the patch be applied for now? (unless a complete overhaul
> is being planed)
> 
> --
> Vibhav Pant
> vibhavp@gmail.com




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Add support for Conkeror in browse-url.el
  2015-02-15 10:13           ` Jan D.
@ 2015-02-15 20:30             ` Stefan Monnier
  2015-02-16  2:33               ` vibhavp
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2015-02-15 20:30 UTC (permalink / raw)
  To: Jan D.; +Cc: vibhavp, emacs-devel@gnu.org

> I think this patch is too big as a tiny change and I can't find any
> copyright disclamer from you.  But it is really up to Stefan or Glenn
> to decide.

I'm OK with the change, but of course, we need to clear the copyright
status first.


        Stefan



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Add support for Conkeror in browse-url.el
  2015-02-15 20:30             ` Stefan Monnier
@ 2015-02-16  2:33               ` vibhavp
  2015-03-10 19:52                 ` Vibhav Pant
  0 siblings, 1 reply; 11+ messages in thread
From: vibhavp @ 2015-02-16  2:33 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Jan D., emacs-devel@gnu.org

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

> I'm OK with the change, but of course, we need to clear the copyright
> status first.
Yep, I just completed request-assign.future and sent it to
assign@gnu.org. Will ping this thread as soon as the paperwork is done.

Thanks
-- 
Vibhav Pant
vibhavp@gmail.com



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Add support for Conkeror in browse-url.el
  2015-02-16  2:33               ` vibhavp
@ 2015-03-10 19:52                 ` Vibhav Pant
  0 siblings, 0 replies; 11+ messages in thread
From: Vibhav Pant @ 2015-03-10 19:52 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Jan D., emacs-devel@gnu.org

I just got an email from the FSF saying the copyright assignment
paperwork has been done with. Can the patch now be pushed to master?


On Mon, Feb 16, 2015 at 8:03 AM,  <vibhavp@gmail.com> wrote:
> Stefan Monnier <monnier@IRO.UMontreal.CA> writes:
>
>> I'm OK with the change, but of course, we need to clear the copyright
>> status first.
> Yep, I just completed request-assign.future and sent it to
> assign@gnu.org. Will ping this thread as soon as the paperwork is done.
>
> Thanks
> --
> Vibhav Pant
> vibhavp@gmail.com



-- 
Vibhav Pant
vibhavp@gmail.com



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-03-10 19:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-12 15:25 [PATCH] Add support for Conkeror in browse-url.el vibhavp
2015-02-14  8:07 ` Vibhav Pant
2015-02-14  9:30   ` Jan D.
2015-02-14 11:22     ` vibhavp
2015-02-14 13:51       ` Jan D.
2015-02-15  5:15         ` vibhavp
2015-02-15 10:13           ` Jan D.
2015-02-15 20:30             ` Stefan Monnier
2015-02-16  2:33               ` vibhavp
2015-03-10 19:52                 ` Vibhav Pant
2015-02-14 11:32     ` Artur Malabarba

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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