[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: [PATCH] add `w3m-search-new-session'

>>>>> In [emacs-w3m : No.08881] Luca Capello <luca@xxxxxx> wrote:

> 2006-09-26  Luca Capello  <luca@xxxxxx>

> 	* w3m-search.el (w3m-search-new-session): New command.


> 	* w3m.el (autoload): Add w3m-search-new-session.
> 	(w3m-menubar): Add w3m-search-new-session (but missing the
> 	Japanese translation).



> I tested the patch on the latest Debian emacs-snapshot_20060923,
> starting `emacs -q`, adding emacs-w3m to the `load-path' and then
> M-x w3m.  It seems working fine and as expected :-)

> Please consider for inclusion, but before:

> 1) test it, even if I'm growing on lisp, I'm still faulty

> 2) add the Japanese translation for the `w3m-menubar' (I can write
>    only some words)

Thank you for the patch.  It looks mostly perfect, moreover it
makes the source code clean.  I've installed it with slight
modifications.  My changes are:

--- w3m-search.el~	2006-09-26 01:08:14 +0000
+++ w3m-search.el	2006-09-26 01:08:14 +0000
@@ -287,8 +287,8 @@
 		 initial history default)))
-(defun w3m-search-read-variables (search-engine query)
-  "Ask for SEARCH-ENGINE and QUERY if empty and return them as a list."
+(defun w3m-search-read-variables ()
+  "Ask for a search engine and words to query and return them as a list."
   (let* ((search-engine
 	  (if current-prefix-arg
 	      (let ((default (or (car w3m-search-engine-history)
@@ -310,9 +310,8 @@
   (unless (string= query "")
     (let ((info (assoc search-engine w3m-search-engine-alist)))
       (if info
-	  (let ((query-string
-		 (w3m-search-escape-query-string query
-						 (caddr info)))
+	  (let ((query-string (w3m-search-escape-query-string query
+							      (caddr info)))
 		(post-data (cadddr info)))
 	    (funcall w3m-goto-function
 		     (format (cadr info) query-string)
@@ -329,17 +328,13 @@
 If Transient Mark mode, use the region as an initial string of query
 and deactivate the mark."
-  (interactive
-   (let ((search-engine) (query))
-     (w3m-search-read-variables search-engine query)))
+  (interactive (w3m-search-read-variables))
   (w3m-search-do-search 'w3m-goto-url search-engine query))
 (defun w3m-search-new-session (search-engine query)
   "Like `w3m-search', but do the search in a new session."
-  (interactive
-   (let ((search-engine) (query))
-     (w3m-search-read-variables search-engine query)))
+  (interactive (w3m-search-read-variables))
   (w3m-search-do-search 'w3m-goto-url-new-session search-engine query))