[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
better default for search
- From: Samuel Wales <samologist@xxxxxxxxx>
- Date: Wed, 17 Jun 2009 23:15:21 -0700
- X-ml-name: emacs-w3m
- X-mail-count: 10923
In the following code, I replaced 'word with 'sexp and get
much better results. It is much more common that I search
for a word-like-this than one word.
Perhaps w3m can either change this to sexp as I have done
below or allow a variable for it.
(defun w3m-search-read-query (prompt prompt-with-default &optional history)
"Read a query from the minibuffer, prompting with string PROMPT.
When a default value for the query is discovered, prompt with string
PROMPT-WITH-DEFAULT instead of string PROMPT."
(buffer-substring (region-beginning) (region-end))
(unless (and (eq major-mode 'w3m-mode)
(listp (get-text-property (point-at-bol) 'face))
(get-text-property (point-at-bol) 'face)))
==> (thing-at-point 'sexp))))
(set-text-properties 0 (length default) nil default)
(when (or w3m-search-word-at-point (w3m-region-active-p))
(setq initial default
(read-string (if default
(format prompt-with-default default)
initial history default)))
Myalgic encephalomyelitis denialism is causing death and severe suffering,
worse than MS. Conflicts of interest are destroying research. /You/ can
get the disease at any time permanently. Do science and justice matter to