unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#16225: 24.3.50; [PATCH] eww: machinery to set character encoding.
@ 2013-12-23 15:38 Kenjiro NAKAYAMA
  2013-12-24  7:52 ` Lars Ingebrigtsen
  2014-11-22 17:36 ` bug#16225: [PATCH]eww: " Kenjiro Nakayama
  0 siblings, 2 replies; 10+ messages in thread
From: Kenjiro NAKAYAMA @ 2013-12-23 15:38 UTC (permalink / raw)
  To: 16225

This report includes a patch to the bug. Please, review and install it
to the official tree if appreciated.

The user can't change encoding type. This patch is to fix it.

Signed-off-by: Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com>

        * net/eww.el (eww-character-encoding): Default value of encoding type.
          (eww-display-html,eww-display-raw): Change to enable to set
          encoding type.
          (eww-mode-map): New key map and easy-menu to set encoding type.
          (eww-set-character-encoding): New funtion to set encoding type.
        
---
 lisp/net/eww.el | 33 +++++++++++++++++++++++++++------
 1 file changed, 27 insertions(+), 6 deletions(-)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 89a7eb9..9353b6e 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -129,6 +129,7 @@ See also `eww-form-checkbox-selected-symbol'."
 (defvar eww-home-url nil)
 (defvar eww-start-url nil)
 (defvar eww-contents-url nil)
+(defvar eww-character-encoding 'utf-8)
 
 (defvar eww-local-regex "localhost"
   "When this regex is found in the URL, it's not a keyword but an address.")
@@ -189,7 +190,7 @@ word(s) will be searched for via `eww-search-prefix'."
 		    (or (cdr (assq 'charset (cdr content-type)))
 			(eww-detect-charset (equal (car content-type)
 						   "text/html"))
-			"utf8"))))
+			"utf-8"))))
 	 (data-buffer (current-buffer)))
     (unwind-protect
 	(progn
@@ -243,9 +244,9 @@ word(s) will be searched for via `eww-search-prefix'."
 (defun eww-display-html (charset url &optional document point)
   (or (fboundp 'libxml-parse-html-region)
       (error "This function requires Emacs to be compiled with libxml2"))
-  (unless (eq charset 'utf8)
+  (unless (eq charset eww-character-encoding)
     (condition-case nil
-	(decode-coding-region (point) (point-max) charset)
+	(decode-coding-region (point) (point-max) eww-character-encoding)
       (coding-system-error nil)))
   (let ((document
 	 (or document
@@ -364,7 +365,12 @@ word(s) will be searched for via `eww-search-prefix'."
   (let ((data (buffer-substring (point) (point-max))))
     (eww-setup-buffer)
     (let ((inhibit-read-only t))
-      (insert data))
+      (insert data)
+      (unless (eq eww-character-encoding 'utf-8)
+	(encode-coding-region (point-min) (1+ (length data)) 'utf-8)
+	(condition-case nil
+	    (decode-coding-region (point-min) (1+ (length data)) eww-character-encoding)
+	  (coding-system-error nil))))
     (goto-char (point-min))))
 
 (defun eww-display-image ()
@@ -417,6 +423,7 @@ word(s) will be searched for via `eww-search-prefix'."
     (define-key map "C" 'url-cookie-list)
     (define-key map "v" 'eww-view-source)
     (define-key map "H" 'eww-list-histories)
+    (define-key map "E" 'eww-set-character-encoding)
 
     (define-key map "b" 'eww-add-bookmark)
     (define-key map "B" 'eww-list-bookmarks)
@@ -439,7 +446,8 @@ word(s) will be searched for via `eww-search-prefix'."
 	["List histories" eww-list-histories t]
 	["Add bookmark" eww-add-bookmark t]
 	["List bookmarks" eww-list-bookmarks t]
-	["List cookies" url-cookie-list t]))
+	["List cookies" url-cookie-list t]
+	["Character Encoding" eww-set-character-encoding]))
     map))
 
 (defvar eww-tool-bar-map
@@ -1029,7 +1037,7 @@ If EXTERNAL, browse the URL using `shr-external-browser'."
      ((and (url-target (url-generic-parse-url url))
 	   (eww-same-page-p url eww-current-url))
       (eww-save-history)
-      (eww-display-html 'utf8 url eww-current-dom))
+      (eww-display-html eww-character-encoding url eww-current-dom))
      (t
       (eww-browse-url url)))))
 
@@ -1080,6 +1088,19 @@ Differences in #targets are ignored."
 	(setq count (1+ count)))
       (expand-file-name file directory)))
 
+(defun eww-set-character-encoding (encode)
+  "Set character encoding."
+  (interactive "sSet Character Encoding (default utf-8): ")
+  (cond ((zerop (length encode))
+	 (setq eww-character-encoding 'utf-8)
+	 (message "The change will take effect next load."))
+	(t
+	 (if (not (coding-system-p (car (read-from-string encode))))
+	     (user-error "Invalid encodeing type.")
+	   (setq eww-character-encoding (car (read-from-string encode)))
+	   (message "The change will take effect next load.")
+	   ))))
+
 ;;; Bookmarks code
 
 (defvar eww-bookmarks nil)
-- 
1.8.3.1





^ permalink raw reply related	[flat|nested] 10+ messages in thread

* bug#16225: 24.3.50; [PATCH] eww: machinery to set character encoding.
  2013-12-23 15:38 bug#16225: 24.3.50; [PATCH] eww: machinery to set character encoding Kenjiro NAKAYAMA
@ 2013-12-24  7:52 ` Lars Ingebrigtsen
  2013-12-25  7:32   ` Kenjiro NAKAYAMA
  2014-11-22 17:36 ` bug#16225: [PATCH]eww: " Kenjiro Nakayama
  1 sibling, 1 reply; 10+ messages in thread
From: Lars Ingebrigtsen @ 2013-12-24  7:52 UTC (permalink / raw)
  To: Kenjiro NAKAYAMA; +Cc: 16225

Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com> writes:

> This report includes a patch to the bug. Please, review and install it
> to the official tree if appreciated.
>
> The user can't change encoding type. This patch is to fix it.

Allowing the user to alter the encoding seems like a good idea.
However, the implementation doesn't seem ideal.  The best way to handle
this would be to have the `E' command prompt for the charset, and then
re-render the page immediately without setting any global variables.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#16225: 24.3.50; [PATCH] eww: machinery to set character encoding.
  2013-12-24  7:52 ` Lars Ingebrigtsen
@ 2013-12-25  7:32   ` Kenjiro NAKAYAMA
  2013-12-25  8:58     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Kenjiro NAKAYAMA @ 2013-12-25  7:32 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Kenjiro NAKAYAMA, 16225

> However, the implementation doesn't seem ideal.  The best way to handle
> this would be to have the `E' command prompt for the charset, and then
> re-render the page immediately without setting any global variables.

Thank you Lars,

I fixed it. Can you please review again? I send the patch again.

Signed-off-by: Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com>

        * net/eww.el (eww-display-html,eww-display-raw): Change to
          enable to set encoding type.
          (eww-mode-map): New key map and easy-menu to set encoding type.
          (eww-set-character-encoding): New funtion to set encoding type.

---
 lisp/net/eww.el | 43 ++++++++++++++++++++++++++++++-------------
 1 file changed, 30 insertions(+), 13 deletions(-)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 02c93a0..8fbf94d 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -172,7 +172,7 @@ word(s) will be searched for via `eww-search-prefix'."
 		    "/")
 	       (expand-file-name file))))
 
-(defun eww-render (status url &optional point)
+(defun eww-render (status url &optional point encode)
   (let ((redirect (plist-get status :redirect)))
     (when redirect
       (setq url redirect)))
@@ -192,7 +192,7 @@ word(s) will be searched for via `eww-search-prefix'."
 		    (or (cdr (assq 'charset (cdr content-type)))
 			(eww-detect-charset (equal (car content-type)
 						   "text/html"))
-			"utf8"))))
+			"utf-8"))))
 	 (data-buffer (current-buffer)))
     (unwind-protect
 	(progn
@@ -203,12 +203,12 @@ word(s) will be searched for via `eww-search-prefix'."
                                  (car content-type)))
             (eww-browse-with-external-browser url))
 	   ((equal (car content-type) "text/html")
-	    (eww-display-html charset url nil point))
+	    (eww-display-html charset url nil point encode))
 	   ((string-match-p "\\`image/" (car content-type))
 	    (eww-display-image)
 	    (eww-update-header-line-format))
 	   (t
-	    (eww-display-raw)
+	    (eww-display-raw encode)
 	    (eww-update-header-line-format)))
 	  (setq eww-current-url url
 		eww-history-position 0))
@@ -243,12 +243,12 @@ word(s) will be searched for via `eww-search-prefix'."
 (declare-function libxml-parse-html-region "xml.c"
 		  (start end &optional base-url))
 
-(defun eww-display-html (charset url &optional document point)
+(defun eww-display-html (charset url &optional document point encode)
   (or (fboundp 'libxml-parse-html-region)
       (error "This function requires Emacs to be compiled with libxml2"))
-  (unless (eq charset 'utf8)
+  (unless (eq charset encode)
     (condition-case nil
-	(decode-coding-region (point) (point-max) charset)
+	(decode-coding-region (point) (point-max) encode)
       (coding-system-error nil)))
   (let ((document
 	 (or document
@@ -363,11 +363,16 @@ word(s) will be searched for via `eww-search-prefix'."
 				  (list :background (car new-colors))
 				  t))))))
 
-(defun eww-display-raw ()
+(defun eww-display-raw (&optional encode)
   (let ((data (buffer-substring (point) (point-max))))
     (eww-setup-buffer)
     (let ((inhibit-read-only t))
-      (insert data))
+      (insert data)
+      (unless (eq encode 'utf-8)
+	(encode-coding-region (point-min) (1+ (length data)) 'utf-8)
+	(condition-case nil
+	    (decode-coding-region (point-min) (1+ (length data)) encode)
+	  (coding-system-error nil))))
     (goto-char (point-min))))
 
 (defun eww-display-image ()
@@ -420,6 +425,7 @@ word(s) will be searched for via `eww-search-prefix'."
     (define-key map "C" 'url-cookie-list)
     (define-key map "v" 'eww-view-source)
     (define-key map "H" 'eww-list-histories)
+    (define-key map "E" 'eww-set-character-encoding)
 
     (define-key map "b" 'eww-add-bookmark)
     (define-key map "B" 'eww-list-bookmarks)
@@ -442,7 +448,8 @@ word(s) will be searched for via `eww-search-prefix'."
 	["List histories" eww-list-histories t]
 	["Add bookmark" eww-add-bookmark t]
 	["List bookmarks" eww-list-bookmarks t]
-	["List cookies" url-cookie-list t]))
+	["List cookies" url-cookie-list t]
+	["Character Encoding" eww-set-character-encoding]))
     map))
 
 (defvar eww-tool-bar-map
@@ -552,11 +559,11 @@ appears in a <link> or <a> tag."
 	(eww-browse-url (shr-expand-url best-url eww-current-url))
       (user-error "No `top' for this page"))))
 
-(defun eww-reload ()
+(defun eww-reload (&optional encode)
   "Reload the current page."
   (interactive)
   (url-retrieve eww-current-url 'eww-render
-		(list eww-current-url (point))))
+		(list eww-current-url (point) encode)))
 
 ;; Form support.
 
@@ -1032,7 +1039,7 @@ If EXTERNAL, browse the URL using `shr-external-browser'."
      ((and (url-target (url-generic-parse-url url))
 	   (eww-same-page-p url eww-current-url))
       (eww-save-history)
-      (eww-display-html 'utf8 url eww-current-dom))
+      (eww-display-html 'utf-8 url eww-current-dom))
      (t
       (eww-browse-url url)))))
 
@@ -1083,6 +1090,16 @@ Differences in #targets are ignored."
 	(setq count (1+ count)))
       (expand-file-name file directory)))
 
+(defun eww-set-character-encoding (encode)
+  "Set character encoding."
+  (interactive "sSet Character Encoding (default utf-8): ")
+  (cond ((zerop (length encode))
+	 (eww-reload 'utf-8))
+	(t
+	 (if (not (coding-system-p (intern encode)))
+	     (user-error "Invalid encodeing type.")
+	   (eww-reload (intern encode))))))
+
 ;;; Bookmarks code
 
 (defvar eww-bookmarks nil)
-- 
1.8.3.1

Regards,

Kenjiro

larsi@gnus.org writes:

> Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com> writes:
>
>> This report includes a patch to the bug. Please, review and install it
>> to the official tree if appreciated.
>>
>> The user can't change encoding type. This patch is to fix it.
>
> Allowing the user to alter the encoding seems like a good idea.
> However, the implementation doesn't seem ideal.  The best way to handle
> this would be to have the `E' command prompt for the charset, and then
> re-render the page immediately without setting any global variables.






^ permalink raw reply related	[flat|nested] 10+ messages in thread

* bug#16225: 24.3.50; [PATCH] eww: machinery to set character encoding.
  2013-12-25  7:32   ` Kenjiro NAKAYAMA
@ 2013-12-25  8:58     ` Lars Ingebrigtsen
  2014-11-10 21:39       ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Lars Ingebrigtsen @ 2013-12-25  8:58 UTC (permalink / raw)
  To: Kenjiro NAKAYAMA; +Cc: 16225

Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com> writes:

> I fixed it. Can you please review again? I send the patch again.

Looks good. It's new functionality, though, so it'll have to wait until
the feature freeze is over to be installed.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#16225: 24.3.50; [PATCH] eww: machinery to set character encoding.
  2013-12-25  8:58     ` Lars Ingebrigtsen
@ 2014-11-10 21:39       ` Lars Magne Ingebrigtsen
  2014-11-22 17:25         ` Nakayama Kenjiro
  0 siblings, 1 reply; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 2014-11-10 21:39 UTC (permalink / raw)
  To: Kenjiro NAKAYAMA; +Cc: 16225

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com> writes:
>
>> I fixed it. Can you please review again? I send the patch again.
>
> Looks good. It's new functionality, though, so it'll have to wait until
> the feature freeze is over to be installed.

Sorry; I forgot to go through these pending patches before I started
fixing bugs that didn't have pending patches.

So this patch doesn't apply any longer.  Could you re-spin it and
resubmit?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#16225: 24.3.50; [PATCH] eww: machinery to set character encoding.
  2014-11-10 21:39       ` Lars Magne Ingebrigtsen
@ 2014-11-22 17:25         ` Nakayama Kenjiro
  0 siblings, 0 replies; 10+ messages in thread
From: Nakayama Kenjiro @ 2014-11-22 17:25 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: 16225

[-- Attachment #1: Type: text/plain, Size: 886 bytes --]

Sure.
I will resubmit this patch soon.

Regards,
Kenjiro

On Tue, Nov 11, 2014 at 6:39 AM, Lars Magne Ingebrigtsen <larsi@gnus.org>
wrote:

> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
> > Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com> writes:
> >
> >> I fixed it. Can you please review again? I send the patch again.
> >
> > Looks good. It's new functionality, though, so it'll have to wait until
> > the feature freeze is over to be installed.
>
> Sorry; I forgot to go through these pending patches before I started
> fixing bugs that didn't have pending patches.
>
> So this patch doesn't apply any longer.  Could you re-spin it and
> resubmit?
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no
>



-- 
Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com>
GPG Key fingerprint = ED8F 049D E67A 727D 9A44  8E25 F44B E208 C946 5EB9

[-- Attachment #2: Type: text/html, Size: 1686 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#16225: [PATCH]eww: machinery to set character encoding
  2013-12-23 15:38 bug#16225: 24.3.50; [PATCH] eww: machinery to set character encoding Kenjiro NAKAYAMA
  2013-12-24  7:52 ` Lars Ingebrigtsen
@ 2014-11-22 17:36 ` Kenjiro Nakayama
  2014-11-23 15:31   ` Lars Magne Ingebrigtsen
  2014-11-23 18:24   ` bug#16225: eww: " Ivan Shmakov
  1 sibling, 2 replies; 10+ messages in thread
From: Kenjiro Nakayama @ 2014-11-22 17:36 UTC (permalink / raw)
  To: 16225; +Cc: larsi, Kenjiro Nakayama

This patch makes users possible to change the encoding on eww.

Signed-off-by: Kenjiro Nakayama <nakayamakenjiro@gmail.com>

        * net/eww.el (eww-display-html,eww-display-raw): Change to
          enable to set encoding type.
          (eww-mode-map): New key map and easy-menu to set encoding type.
          (eww-set-character-encoding): New funtion to set encoding type.

---
 lisp/net/eww.el | 41 +++++++++++++++++++++++++++++------------
 1 file changed, 29 insertions(+), 12 deletions(-)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 6746668..3c1621c 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -241,7 +241,7 @@ See the `eww-search-prefix' variable for the search engine used."
   (interactive "r")
   (eww (buffer-substring beg end)))
 
-(defun eww-render (status url &optional point buffer)
+(defun eww-render (status url &optional point buffer encode)
   (let ((redirect (plist-get status :redirect)))
     (when redirect
       (setq url redirect)))
@@ -255,7 +255,7 @@ See the `eww-search-prefix' variable for the search engine used."
 		    (or (cdr (assq 'charset (cdr content-type)))
 			(eww-detect-charset (equal (car content-type)
 						   "text/html"))
-			"utf8"))))
+			"utf-8"))))
 	 (data-buffer (current-buffer)))
     (unwind-protect
 	(progn
@@ -265,14 +265,14 @@ See the `eww-search-prefix' variable for the search engine used."
                                  (car content-type)))
             (eww-browse-with-external-browser url))
 	   ((equal (car content-type) "text/html")
-	    (eww-display-html charset url nil point buffer))
+	    (eww-display-html charset url nil point buffer encode))
 	   ((equal (car content-type) "application/pdf")
 	    (eww-display-pdf))
 	   ((string-match-p "\\`image/" (car content-type))
 	    (eww-display-image buffer)
 	    (eww-update-header-line-format))
 	   (t
-	    (eww-display-raw buffer)
+	    (eww-display-raw buffer encode)
 	    (eww-update-header-line-format)))
 	  (plist-put eww-data :url url)
 	  (setq eww-history-position 0)
@@ -308,7 +308,7 @@ See the `eww-search-prefix' variable for the search engine used."
 (declare-function libxml-parse-html-region "xml.c"
 		  (start end &optional base-url))
 
-(defun eww-display-html (charset url &optional document point buffer)
+(defun eww-display-html (charset url &optional document point buffer encode)
   (or (fboundp 'libxml-parse-html-region)
       (error "This function requires Emacs to be compiled with libxml2"))
   ;; There should be a better way to abort loading images
@@ -319,9 +319,9 @@ See the `eww-search-prefix' variable for the search engine used."
 	     (list
 	      'base (list (cons 'href url))
 	      (progn
-		(unless (eq charset 'utf-8)
+		(unless (eq charset encode)
 		  (condition-case nil
-		      (decode-coding-region (point) (point-max) charset)
+		      (decode-coding-region (point) (point-max) encode)
 		    (coding-system-error nil)))
 		(libxml-parse-html-region (point) (point-max))))))
 	(source (and (null document)
@@ -429,11 +429,16 @@ See the `eww-search-prefix' variable for the search engine used."
     (shr-generic cont)
     (shr-colorize-region start (point) fgcolor bgcolor)))
 
-(defun eww-display-raw (&optional buffer)
+(defun eww-display-raw (&optional buffer encode)
   (let ((data (buffer-substring (point) (point-max))))
     (eww-setup-buffer buffer)
     (let ((inhibit-read-only t))
-      (insert data))
+      (insert data)
+      (unless (eq encode 'utf-8)
+       (encode-coding-region (point-min) (1+ (length data)) 'utf-8)
+       (condition-case nil
+	   (decode-coding-region (point-min) (1+ (length data)) encode)
+	 (coding-system-error nil))))
     (goto-char (point-min))))
 
 (defun eww-display-image (&optional buffer)
@@ -567,6 +572,7 @@ the like."
     (define-key map "v" 'eww-view-source)
     (define-key map "R" 'eww-readable)
     (define-key map "H" 'eww-list-histories)
+    (define-key map "E" 'eww-set-character-encoding)
 
     (define-key map "b" 'eww-add-bookmark)
     (define-key map "B" 'eww-list-bookmarks)
@@ -589,7 +595,8 @@ the like."
 	["List histories" eww-list-histories t]
 	["Add bookmark" eww-add-bookmark t]
 	["List bookmarks" eww-list-bookmarks t]
-	["List cookies" url-cookie-list t]))
+	["List cookies" url-cookie-list t]
+       ["Character Encoding" eww-set-character-encoding]))
     map))
 
 (defvar eww-tool-bar-map
@@ -700,12 +707,12 @@ appears in a <link> or <a> tag."
 	(eww-browse-url (shr-expand-url best-url (plist-get eww-data :url)))
       (user-error "No `top' for this page"))))
 
-(defun eww-reload ()
+(defun eww-reload (&optional encode)
   "Reload the current page."
   (interactive)
   (let ((url (plist-get eww-data :url)))
     (url-retrieve url 'eww-render
-		  (list url (point) (current-buffer)))))
+		  (list url (point) (current-buffer) encode))))
 
 ;; Form support.
 
@@ -1307,6 +1314,16 @@ Differences in #targets are ignored."
 	(setq count (1+ count)))
       (expand-file-name file directory)))
 
+(defun eww-set-character-encoding (encode)
+  "Set character encoding."
+  (interactive "sSet Character Encoding (default utf-8): ")
+  (cond ((zerop (length encode))
+	(eww-reload 'utf-8))
+       (t
+	(if (not (coding-system-p (intern encode)))
+	    (user-error "Invalid encodeing type.")
+	  (eww-reload (intern encode))))))
+
 ;;; Bookmarks code
 
 (defvar eww-bookmarks nil)
-- 
1.9.3






^ permalink raw reply related	[flat|nested] 10+ messages in thread

* bug#16225: [PATCH]eww: machinery to set character encoding
  2014-11-22 17:36 ` bug#16225: [PATCH]eww: " Kenjiro Nakayama
@ 2014-11-23 15:31   ` Lars Magne Ingebrigtsen
  2014-11-23 18:24   ` bug#16225: eww: " Ivan Shmakov
  1 sibling, 0 replies; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 2014-11-23 15:31 UTC (permalink / raw)
  To: Kenjiro Nakayama; +Cc: 16225

Kenjiro Nakayama <nakayamakenjiro@gmail.com> writes:

> This patch makes users possible to change the encoding on eww.
>
> Signed-off-by: Kenjiro Nakayama <nakayamakenjiro@gmail.com>
>
>         * net/eww.el (eww-display-html,eww-display-raw): Change to
>           enable to set encoding type.
>           (eww-mode-map): New key map and easy-menu to set encoding type.
>           (eww-set-character-encoding): New funtion to set encoding type.

Thanks; applied.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#16225: eww: machinery to set character encoding
  2014-11-22 17:36 ` bug#16225: [PATCH]eww: " Kenjiro Nakayama
  2014-11-23 15:31   ` Lars Magne Ingebrigtsen
@ 2014-11-23 18:24   ` Ivan Shmakov
  2014-11-24 15:59     ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 10+ messages in thread
From: Ivan Shmakov @ 2014-11-23 18:24 UTC (permalink / raw)
  To: 16225, 16225-submitter

>>>>> Kenjiro Nakayama <nakayamakenjiro@gmail.com> writes:

 > @@ -1307,6 +1314,16 @@ Differences in #targets are ignored."
 >  	(setq count (1+ count)))
 >        (expand-file-name file directory)))

 > +(defun eww-set-character-encoding (encode)
 > +  "Set character encoding."
 > +  (interactive "sSet Character Encoding (default utf-8): ")

	Could this please be changed to use read-coding-system, just
	like the rest of Emacs (say, universal-coding-system-argument)?

	TIA.

 > +  (cond ((zerop (length encode))
 > +	(eww-reload 'utf-8))
 > +       (t
 > +	(if (not (coding-system-p (intern encode)))
 > +	    (user-error "Invalid encodeing type.")
 > +	  (eww-reload (intern encode))))))
 > +
 >  ;;; Bookmarks code

 >  (defvar eww-bookmarks nil)

-- 
FSF associate member #7257  http://boycottsystemd.org/  … 3013 B6A0 230E 334A





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#16225: eww: machinery to set character encoding
  2014-11-23 18:24   ` bug#16225: eww: " Ivan Shmakov
@ 2014-11-24 15:59     ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 2014-11-24 15:59 UTC (permalink / raw)
  To: Ivan Shmakov; +Cc: 16225

Ivan Shmakov <ivan@siamics.net> writes:

> 	Could this please be changed to use read-coding-system, just
> 	like the rest of Emacs (say, universal-coding-system-argument)?

Fixed on trunk.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-11-24 15:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-23 15:38 bug#16225: 24.3.50; [PATCH] eww: machinery to set character encoding Kenjiro NAKAYAMA
2013-12-24  7:52 ` Lars Ingebrigtsen
2013-12-25  7:32   ` Kenjiro NAKAYAMA
2013-12-25  8:58     ` Lars Ingebrigtsen
2014-11-10 21:39       ` Lars Magne Ingebrigtsen
2014-11-22 17:25         ` Nakayama Kenjiro
2014-11-22 17:36 ` bug#16225: [PATCH]eww: " Kenjiro Nakayama
2014-11-23 15:31   ` Lars Magne Ingebrigtsen
2014-11-23 18:24   ` bug#16225: eww: " Ivan Shmakov
2014-11-24 15:59     ` Lars Magne Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).