From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: vibhavp@gmail.com Newsgroups: gmane.emacs.devel Subject: [PATCH] Add support for Conkeror in browse-url.el Date: Thu, 12 Feb 2015 20:55:09 +0530 Message-ID: <87bnkzxicq.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1423754757 25593 80.91.229.3 (12 Feb 2015 15:25:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Feb 2015 15:25:57 +0000 (UTC) To: "emacs-devel\@gnu.org" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 12 16:25:43 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YLveB-00030j-2o for ged-emacs-devel@m.gmane.org; Thu, 12 Feb 2015 16:25:43 +0100 Original-Received: from localhost ([::1]:50745 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLveA-0003Lz-39 for ged-emacs-devel@m.gmane.org; Thu, 12 Feb 2015 10:25:42 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLvdo-0003GP-PL for emacs-devel@gnu.org; Thu, 12 Feb 2015 10:25:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLvdk-0005ft-4y for emacs-devel@gnu.org; Thu, 12 Feb 2015 10:25:20 -0500 Original-Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]:48560) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLvdj-0005fY-QQ for emacs-devel@gnu.org; Thu, 12 Feb 2015 10:25:16 -0500 Original-Received: by mail-pa0-f41.google.com with SMTP id kx10so12125924pab.0 for ; Thu, 12 Feb 2015 07:25:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=lfDjy8yVg2sEQizi4p9bB5hKDl7+qG3z/3j38psMzvs=; b=qPrQd8ZR/2kq/3Fq07/jVM39Gz53mdzogIDpfnwwr8gs5T9cyGAC5LX5A4vaeWHYWm Ilkc/mMbOwhGGBw+Vpf4+z7fzUlu5H5I/fwautRNj/MbXFDFGxvjJbOqfsF9BwQSJ55t w9c66coXElj6PXc12XFNqrc+LtyRyNYdyqPawbXtEzUy5PE42zRaFzYLMVG5K3B2X+Hm h58kGz9f0SNXHalgaLe4vwcQVOC+gl0Mb2SL4xGO2fQdzVNadw476McY77IsnV5BHHoC rRE8QGoSgtK5qT1IZPLBS5ZLiN6QKGZPngF9/GwO3LFV6JamzeRHXwChY81FQ+QfaUXt fOpQ== X-Received: by 10.66.97.68 with SMTP id dy4mr7289681pab.148.1423754714295; Thu, 12 Feb 2015 07:25:14 -0800 (PST) Original-Received: from lenovog410 ([117.201.177.58]) by mx.google.com with ESMTPSA id ly7sm4173443pdb.1.2015.02.12.07.25.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Feb 2015 07:25:13 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::229 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:182955 Archived-At: --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=browse-url-conkeror.patch Content-Description: Add support for conkeror 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 + + * 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 * 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. --=-=-= Content-Type: text/plain [1]: http://conkeror.org/ --=-=-=--