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

Re: terminating form input by `C-c C-c'



Ivan Zakharyaschev <imz@xxxxxxxxxxxx> writes:

> Perhaps displaying a hint in the echo area (like "Press C-c C-c to
> submit this form.") when on a form would help many novice emacs-w3m
> users.

I've wrote a patch to implement this feature.

Regards,
Naohiro
Changes in master
	Modified ChangeLog
diff --git a/ChangeLog b/ChangeLog
index 5e1f929..19984d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-02-09  Naohiro Aota  <naota@xxxxxxxxx>
+
+	* w3m.el (w3m-show-form-hint): New function to display submitting form
+	hint.
+	(w3m-after-cursor-move-hook): Use it.
+
 2011-01-31  Johan Claesson  <johanclaesson@xxxxxxxxxxxx>
 
 	* w3m.el (w3m-content-type-alist): When selecting which external html
	Modified w3m.el
diff --git a/w3m.el b/w3m.el
index 7e4f38f..79a9389 100644
--- a/w3m.el
+++ b/w3m.el
@@ -1038,6 +1038,7 @@ is evaluated by the `w3m-goto-url' function."
 
 (defcustom w3m-after-cursor-move-hook
   '(w3m-highlight-current-anchor
+    w3m-show-form-hint
     w3m-print-this-url
     w3m-auto-show)
   "*Hook run each time after the cursor moves in emacs-w3m buffers.
@@ -10874,6 +10875,13 @@ FROM-COMMAND is defined in `w3m-minor-mode-map' with the same key in
       (when (string-match "^w3m\\(el\\|src\\)" f)
 	(delete-file (expand-file-name f w3m-profile-directory))))))
 
+(defun w3m-show-form-hint ()
+  "Show sending form hint when the cursor is in a form."
+  (let ((keys (where-is-internal 'w3m-submit-form)))
+    (when (and (w3m-submit) keys)
+      (w3m-message "Press %s to send the current form."
+		   (key-description (car keys))))))
+
 (provide 'w3m)
 
 (unless noninteractive

Attachment: pgp7ZEdhTlHXK.pgp
Description: PGP signature