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

space is space not just for lucky guy


I don't use the "Feeling lucky" feature but I'd like to be able to
separate words with a simple <SPACE> key (instead C-q <SPACE>) into the
minibuffer (useful with URI replace).

Below is a patch that enables this with a new custom (sorry I'm not able
to translate the doc to japanese).

BTW, I don't know it there is any use case for <SPACE> that is anything
but a real space into the w3m minibuffer. If there is none it could be
the default binding and we could ditch this custom.
Index: w3m.el
RCS file: /storage/cvsroot/emacs-w3m/w3m.el,v
retrieving revision 1.1606
diff -u -p -r1.1606 w3m.el
--- w3m.el	4 Sep 2013 02:39:48 -0000	1.1606
+++ w3m.el	6 Sep 2013 14:29:35 -0000
@@ -2042,6 +2042,12 @@ In that case, emacs-w3m uses Google to s
   :group 'w3m
   :type 'boolean)
+(defcustom w3m-minibuffer-space-is-space nil
+  "Non-nil enables you to use a real space into the minibuffer
+instead of the default completion function."
+  :group 'w3m
+  :type 'boolean)
 (defconst w3m-entity-table
   (let ((table (make-hash-table :test 'equal)))
     (dolist (entity '(("nbsp" . " ")
@@ -4643,7 +4649,8 @@ http://www.google.com/search?btnI=I%%27m
 				       (if (looking-at "[a-z]+:\\(?:/+\\)?")
 					   (goto-char (match-end 0)))))))
 		      (ofunc (lookup-key minibuffer-local-completion-map " ")))
-		  (when feeling-lucky
+		  (when (or w3m-minibuffer-space-is-space
+                            feeling-lucky)
 		    (define-key minibuffer-local-completion-map " "
Index: doc/emacs-w3m.texi
RCS file: /storage/cvsroot/emacs-w3m/doc/emacs-w3m.texi,v
retrieving revision 1.496
diff -u -p -r1.496 emacs-w3m.texi
--- doc/emacs-w3m.texi	1 May 2012 06:10:05 -0000	1.496
+++ doc/emacs-w3m.texi	6 Sep 2013 14:29:35 -0000
@@ -2023,6 +2023,11 @@ the minibuffer if the ``Feeling Lucky'' 
 default; see @code{w3m-enable-google-feeling-lucky}).  If it's disabled,
 then hit @kbd{C-q} first, i.e. @w{@kbd{C-q @key{SPC}}}.
+If you don't want to use the ``Feeling Lucky'' feature but want to be
+able to use @kbd{@key{SPC}} as a self-inserting key into the minibuffer
+you can also customize @code{w3m-minibuffer-space-is-space} and set it
+to a non-nil.
 The default configuration of emacs-w3m includes several prefixes you can
 use, they are defined in the @code{w3m-uri-replace-alist} variable.
 There's for example ``gg'' for Google, ``ggg'' for Google Groups, ``ya''
Manuel Giraud