X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fshr.el;h=e5bd5b0aeb7bbc1244380f4696397e81531bb916;hb=c8b66408c77cef31df1a874a2751d0a025d1c327;hp=8991533a9c44ebbbfb525a2b02a2fe46d7f91c45;hpb=dbd136836b5405cc3028d9d4c4dc1bb071644c04;p=gnus diff --git a/lisp/shr.el b/lisp/shr.el index 8991533a9..e5bd5b0ae 100644 --- a/lisp/shr.el +++ b/lisp/shr.el @@ -56,17 +56,17 @@ fit these criteria." (defcustom shr-table-line ?- "Character used to draw table line." :group 'shr - :type 'char) + :type 'character) (defcustom shr-table-corner ?+ "Character used to draw table corner." :group 'shr - :type 'char) + :type 'character) (defcustom shr-hr-line ?- "Character used to draw hr line." :group 'shr - :type 'char) + :type 'character) (defcustom shr-width fill-column "Frame width to use for rendering." @@ -219,8 +219,8 @@ redirects somewhere else." (unless shr-start (setq shr-start (point))) (insert elem) - (when (> (current-column) shr-width) - (if (not (search-backward " " (line-beginning-position) t)) + (while (> (current-column) shr-width) + (if (not (shr-find-fill-point)) (insert "\n") (delete-char 1) (insert "\n") @@ -235,9 +235,11 @@ redirects somewhere else." (defun shr-find-fill-point () (let ((found nil)) (while (and (not found) - (not (bolp))) - (when (or (eq (preceding-char) ? ) - (aref fill-find-break-point-function-table (preceding-char))) + (> (current-column) shr-indentation)) + (when (and (or (eq (preceding-char) ? ) + (aref fill-find-break-point-function-table + (preceding-char))) + (<= (current-column) shr-width)) (setq found (point))) (backward-char 1)) (or found @@ -377,9 +379,10 @@ Return a string with image data." shr-start) (shr-generic cont) (widget-convert-button - 'link (or shr-start start) (point) - :help-echo url) - (put-text-property (or shr-start start) (point) 'keymap shr-map) + 'url-link (or shr-start start) (point) + :help-echo url + :keymap shr-map + url) (put-text-property (or shr-start start) (point) 'shr-url url))) (defun shr-encode-url (url) @@ -401,14 +404,17 @@ Return a string with image data." (width (string-to-number width))) (when (< width max-width) (let ((align (cdr (assq :align cont)))) - (cond ((string= align "right") - (insert (propertize - " " 'display - `(space . (:align-to ,(list (- max-width width))))))) - ((string= align "center") - (insert (propertize - " " 'display - `(space . (:balign-to ,(list (- (/ max-width 2) width)))))))))))) + (cond + ((string= align "right") + (insert (propertize + " " 'display + `(space . (:align-to + ,(list (- max-width width))))))) + ((string= align "center") + (insert (propertize + " " 'display + `(space . (:balign-to + ,(list (- (/ max-width 2) width)))))))))))) (let ((start (point-marker))) (when (zerop (length alt)) (setq alt "[img]"))