diff options
author | Yuchen Pei <id@ypei.org> | 2023-10-29 19:18:20 +1100 |
---|---|---|
committer | Yuchen Pei <id@ypei.org> | 2023-10-29 19:18:20 +1100 |
commit | 53a3ed523e7e567f853e0238681da5302180c017 (patch) | |
tree | 8c32e234b4d800434e066fba983d76d545bca8c7 | |
parent | b0074e497f3792b5df1249ae68ffb0f9f4b68dc5 (diff) |
untabify tracli-parse
-rw-r--r-- | traclicker.el | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/traclicker.el b/traclicker.el index 9174cc1..f06580f 100644 --- a/traclicker.el +++ b/traclicker.el @@ -146,48 +146,48 @@ Sends a HEAD request." Adapted from `mm-shr'." (let ((shr-width (if shr-use-fonts - nil - fill-column)) - (shr-content-function (lambda (id) - (let ((handle (mm-get-content-id id))) - (when handle - (mm-with-part handle - (buffer-string)))))) - (shr-inhibit-images t) - (shr-blocked-images ".*") - charset coding char) + nil + fill-column)) + (shr-content-function (lambda (id) + (let ((handle (mm-get-content-id id))) + (when handle + (mm-with-part handle + (buffer-string)))))) + (shr-inhibit-images t) + (shr-blocked-images ".*") + charset coding char) (mm-with-part (or handle (setq handle (mm-dissect-buffer t))) (setq case-fold-search t) (or (setq charset - (mail-content-type-get (mm-handle-type handle) 'charset)) - (progn - (goto-char (point-min)) - (and (re-search-forward "\ + (mail-content-type-get (mm-handle-type handle) 'charset)) + (progn + (goto-char (point-min)) + (and (re-search-forward "\ <meta\\s-+http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']?\ text/html;\\s-*charset=\\([^\t\n\r \"'>]+\\)[^>]*>" nil t) - (setq coding (mm-charset-to-coding-system (match-string 1) - nil t)))) - (setq charset mail-parse-charset)) + (setq coding (mm-charset-to-coding-system (match-string 1) + nil t)))) + (setq charset mail-parse-charset)) (when (and (or coding - (setq coding (mm-charset-to-coding-system charset nil t))) - (not (eq coding 'ascii))) - (insert (prog1 - (decode-coding-string (buffer-string) coding) - (erase-buffer) - (set-buffer-multibyte t)))) + (setq coding (mm-charset-to-coding-system charset nil t))) + (not (eq coding 'ascii))) + (insert (prog1 + (decode-coding-string (buffer-string) coding) + (erase-buffer) + (set-buffer-multibyte t)))) (goto-char (point-min)) (while (re-search-forward - "&#\\(?:x\\([89][0-9a-f]\\)\\|\\(1[2-5][0-9]\\)\\);" nil t) - (when (setq char - (cdr (assq (if (match-beginning 1) - (string-to-number (match-string 1) 16) - (string-to-number (match-string 2))) - mm-extra-numeric-entities))) - (replace-match (char-to-string char)))) + "&#\\(?:x\\([89][0-9a-f]\\)\\|\\(1[2-5][0-9]\\)\\);" nil t) + (when (setq char + (cdr (assq (if (match-beginning 1) + (string-to-number (match-string 1) 16) + (string-to-number (match-string 2))) + mm-extra-numeric-entities))) + (replace-match (char-to-string char)))) ;; Remove "soft hyphens". (goto-char (point-min)) (while (search-forward "" nil t) - (replace-match "" t t)) + (replace-match "" t t)) (buffer-substring-no-properties (point-min) (point-max))))) (provide 'traclicker) |