emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r115338: Allow customizing the checkboxes in eww


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] trunk r115338: Allow customizing the checkboxes in eww
Date: Sun, 01 Dec 2013 15:52:07 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115338
revision-id: address@hidden
parent: address@hidden
author: Rüdiger Sonderfeld <address@hidden>
committer: Lars Magne Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Sun 2013-12-01 16:52:04 +0100
message:
  Allow customizing the checkboxes in eww
  * net/shr.el (shr-tag-table): Fix comment typo.
  
  * net/eww.el (eww-text-input-types): : New const.
  (eww-process-text-input): Treat input types in
  `eww-text-input-types' as text.
  
  * net/shr.el (shr-tag-video): Display content for video if no
  poster is available.
  (shr-tag-audio): Add support for <audio> tag.
  
  * net/eww.el (eww-use-external-browser-for-content-type): New
  variable.
  (eww-render): Handle `eww-use-external-browser-for-content-type'.
  Use \\` to match beginning of string instead of ^.
  (eww-browse-with-external-browser): Provide optional URL parameter.
  (eww-render): Set `eww-current-title' back to "".
  
  * net/shr.el (shr-prefer-media-type-alist): : New customizable
  variable.
  (shr--get-media-pref): New function.
  (shr--extract-best-source): New function.
  (shr-tag-video, shr-tag-audio):  Use `shr--extract-best-source' when
  no :src tag was specified.
  
  * net/eww.el (eww-form-checkbox-selected-symbol): New
  customizable variable.
  (eww-form-checkbox-symbol): New customizable variable.
  (eww-form-checkbox): Use `eww-form-checkbox-selected-symbol' and
  `eww-form-checkbox-symbol'.
  (eww-toggle-checkbox): Use `eww-form-checkbox-selected-symbol' and
  `eww-form-checkbox-symbol'.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/net/eww.el                eww.el-20130610114603-80ap3gwnw4x4m5ix-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-12-01 15:49:18 +0000
+++ b/lisp/ChangeLog    2013-12-01 15:52:04 +0000
@@ -1,5 +1,13 @@
 2013-12-01  Rüdiger Sonderfeld  <address@hidden>
 
+       * net/eww.el (eww-form-checkbox-selected-symbol): New
+       customizable variable.
+       (eww-form-checkbox-symbol): New customizable variable.
+       (eww-form-checkbox): Use `eww-form-checkbox-selected-symbol' and
+       `eww-form-checkbox-symbol'.
+       (eww-toggle-checkbox): Use `eww-form-checkbox-selected-symbol' and
+       `eww-form-checkbox-symbol'.
+
        * net/shr.el (shr-prefer-media-type-alist): : New customizable
        variable.
        (shr--get-media-pref): New function.

=== modified file 'lisp/net/eww.el'
--- a/lisp/net/eww.el   2013-12-01 15:47:37 +0000
+++ b/lisp/net/eww.el   2013-12-01 15:52:04 +0000
@@ -64,6 +64,25 @@
   :type '(choice (const :tag "Never" nil)
                  regexp))
 
+(defcustom eww-form-checkbox-selected-symbol "[X]"
+  "Symbol used to represent a selected checkbox.
+See also `eww-form-checkbox-symbol'."
+  :version "24.4"
+  :group 'eww
+  :type '(choice (const "[X]")
+                 (const "☒")            ; Unicode BALLOT BOX WITH X
+                 (const "☑")            ; Unicode BALLOT BOX WITH CHECK
+                 string))
+
+(defcustom eww-form-checkbox-symbol "[ ]"
+  "Symbol used to represent a checkbox.
+See also `eww-form-checkbox-selected-symbol'."
+  :version "24.4"
+  :group 'eww
+  :type '(choice (const "[ ]")
+                 (const "☐")            ; Unicode BALLOT BOX
+                 string))
+
 (defface eww-form-submit
   '((((type x w32 ns) (class color))   ; Like default mode line
      :box (:line-width 2 :style released-button)
@@ -614,8 +633,8 @@
 (defun eww-form-checkbox (cont)
   (let ((start (point)))
     (if (cdr (assq :checked cont))
-       (insert "[X]")
-      (insert "[ ]"))
+       (insert eww-form-checkbox-selected-symbol)
+      (insert eww-form-checkbox-symbol))
     (add-face-text-property start (point) 'eww-form-checkbox)
     (put-text-property start (point) 'eww-form
                       (list :eww-form eww-form
@@ -849,9 +868,9 @@
          (if (plist-get input :checked)
              (progn
                (plist-put input :checked nil)
-               (eww-update-field "[ ]"))
+               (eww-update-field eww-form-checkbox-symbol))
            (plist-put input :checked t)
-           (eww-update-field "[X]"))))
+           (eww-update-field eww-form-checkbox-selected-symbol))))
       ;; Radio button.  Switch all other buttons off.
       (let ((name (plist-get input :name)))
        (save-excursion
@@ -861,9 +880,9 @@
              (if (not (eq (cdr elem) input))
                  (progn
                    (plist-put input :checked nil)
-                   (eww-update-field "[ ]"))
+                   (eww-update-field eww-form-checkbox-symbol))
                (plist-put input :checked t)
-               (eww-update-field "[X]")))))
+               (eww-update-field eww-form-checkbox-selected-symbol)))))
        (forward-char 1)))))
 
 (defun eww-inputs (form)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]