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

Re: automatically filling out WordPress comment fields

jidanni@xxxxxxxxxxx writes:

> KY> I'm not sure it is the right approach but how about this plan?
> KY> Add the following two user options to somewhere in w3m-form.el:
> OK, that maybe is a good plan. But one might want to match on
> <meta name="generator" content="WordPress ...>
> and perhaps some other conditions, to ensure one does not unknowingly
> enter ones credentials into forms one was not intending to.
> Anyway, I am still very curious how I can make a function to help me
> fill in the next three form fields when ever I want to thusly:
> <tab> <return> C-a C-k j i d a n n i <return> <tab> <return> C-a C-k j
> i d a n n i @ j i d a n n i . o r g <return> <tab> <return> C-a C-k h
> t t p : / / j i d a n n i . o r g / <return> <tab>
> Is the only way to make a keyboard macro?
> I can get as far as (w3m-next-anchor) but then I don't know how to
> program typing something into the minibuffer at that point. I looked
> in the source to see how you do it, but
> $ grep TEXT /usr/share/emacs/site-lisp/w3m/*.el
> doesn't find how you prompt with "TEXT:"

That is done by `w3m-form-input'. You might be able to do what you want
like the following.

  (let* ((act (get-text-property (point) 'w3m-action))
	 (form (cadr act))
	 (id (caddr act))
	 (name (cadddr act))
	 (input "foobar"))
    (w3m-form-put form id name input)
    (w3m-form-replace input)))