Gnus development mailing list
 help / color / mirror / Atom feed
* Smaller Face: wrap margin
@ 2004-06-23 15:39 Andrew A. Raines
  2004-06-23 16:19 ` Reiner Steib
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew A. Raines @ 2004-06-23 15:39 UTC (permalink / raw)


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

OK, nitpick time.

Since recent No Gnus apparently now wrap Face: headers with \n\t
instead of \n__ like it has been since Oort, I think this wrapping
looks much better:

Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEX+2D5BBg
        HgZxmPJxLOSR6pNhrwgCBxFwYcdbd+AAACMklEQVR4nG3TwXIbIQwAUP8C4/
        FwbTGm17Ys5ppgNrk2BY2vydoh17hrl9+vJHadpO0e9UZCaMXClFKeBX+11t
        [.....]

Than (ugly!):

Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEVELCDTj4R/T0S0dGoa
        EQryvK8nnzuJAAACXElEQVR4nF2UzY7bMAyEWa17ryzorojJ3RKRu7HQC6gG3/9VOqMEi+4GMBD7
        M/9mKEsvRcoYMl6/8ywiYmZyhHKWscn2BqHWIkog2ykn3trOBWrT+0ZQ8GQLsgEtoKneh1onEFEm
        foGbdYIqpQDUBQQtSIupDO11RVStqLlYyD6PoZUA3aXKYD6/uc+ywHGK4q2YOvoM5u7XdrLl4wwN
        [.....]

Lines ending in column 68 in the first example look much better
than 84 in the second.  I arrived at 68 after playing around with a
few different values in the 70-75 range -- it would append the last
line to the second-to-last line in those cases.

Anyone willing to commit the attached patch?

-- 
    aaraines@pobox.com (Andrew A. Raines)


[-- Attachment #2: Prettier margin for gnus-face-encode --]
[-- Type: text/plain, Size: 301 bytes --]

Index: gnus-fun.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-fun.el,v
retrieving revision 7.4
diff -r7.4 gnus-fun.el
159c159
<   (let ((step 72))
---
>   (let ((step 62))
169c169
<       (setq step 76))
---
>       (setq step 60))

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

* Re: Smaller Face: wrap margin
  2004-06-23 15:39 Smaller Face: wrap margin Andrew A. Raines
@ 2004-06-23 16:19 ` Reiner Steib
  2004-06-23 17:29   ` Andrew A. Raines
  0 siblings, 1 reply; 4+ messages in thread
From: Reiner Steib @ 2004-06-23 16:19 UTC (permalink / raw)


On Wed, Jun 23 2004, Andrew A. Raines wrote:

> Lines ending in column 68 in the first example look much better
> than 84 in the second.

For some reason, the leading whitespace in your Face header are TABs
rather than SPC.  Normally (insert "Face: " (gnus-face-from-file
"foo.jpg")) produces:

Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEVwbVC1xq5NKydXVTj8
 /faSlnbx8uf8/PtZN2mPAAACbUlEQVR4nG2TTW/bMAyG6QjaOUJi5epJ6N2V4N0LCM5VisHuOmOO
 [...]
 79eIYrImy3oCyr1oxgviNb1ivyu/ZhydOm95No3OBWcXZwFjL3Pbf6vH23hMab+cbTpecZvllNRq
 31LCtbsm4LRemJT+AtYTGXO2veglAAAAAElFTkSuQmCC

(Note the leading SPC.)  The only ugliness is, that the first line is
one char longer than the others.

--- gnus-fun.el.~7.4.~	Thu May 20 17:39:10 2004
+++ gnus-fun.el	Wed Jun 23 18:09:52 2004
@@ -156,7 +156,7 @@
 	nil))))
 
 (defun gnus-face-encode ()
-  (let ((step 72))
+  (let ((step (- 76 (length "Face:"))))
     (base64-encode-region (point-min) (point-max))
     (goto-char (point-min))
     (while (search-forward "\n" nil t)

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




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

* Re: Smaller Face: wrap margin
  2004-06-23 16:19 ` Reiner Steib
@ 2004-06-23 17:29   ` Andrew A. Raines
  2004-06-24  0:56     ` Katsumi Yamaoka
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew A. Raines @ 2004-06-23 17:29 UTC (permalink / raw)


Reiner Steib <4.uce.03.r.s@nurfuerspam.de> writes:

> For some reason, the leading whitespace in your Face header are
> TABs rather than SPC.  Normally (insert "Face: "
> (gnus-face-from-file "foo.jpg")) produces:
>
> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEVwbVC1xq5NKydXVTj8
>  /faSlnbx8uf8/PtZN2mPAAACbUlEQVR4nG2TTW/bMAyG6QjaOUJi5epJ6N2V4N0LCM5VisHuOmOO
>  [...]
>  79eIYrImy3oCyr1oxgviNb1ivyu/ZhydOm95No3OBWcXZwFjL3Pbf6vH23hMab+cbTpecZvllNRq
>  31LCtbsm4LRemJT+AtYTGXO2veglAAAAAElFTkSuQmCC

That's how it was with No Gnus 0.2.  For some reason updating to
HEAD started this behavior.  If I run gnus-face-from-file in
*scratch* with C-j, I see the right output, but for some reason
message-required-*-headers throws that TAB in there.  Any ideas?

There's still the issue of language libraries mucking stuff up too.
For instance, any message parsed with Python's email.parser module
will get its headers reformatted.  So I still think the shorter
margin in Gnus is appropriate.

-- 
    aaraines@pobox.com (Andrew A. Raines)



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

* Re: Smaller Face: wrap margin
  2004-06-23 17:29   ` Andrew A. Raines
@ 2004-06-24  0:56     ` Katsumi Yamaoka
  0 siblings, 0 replies; 4+ messages in thread
From: Katsumi Yamaoka @ 2004-06-24  0:56 UTC (permalink / raw)


>>>>> In <w4vfhip4hf.fsf@mid.packer.its.vanderbilt.edu>
>>>>>	"Andrew A. Raines" <aaraines@pobox.com> wrote:

> If I run gnus-face-from-file in *scratch* with C-j, I see the right
> output, but for some reason message-required-*-headers throws that
> TAB in there.  Any ideas?

message-fill-field does it, can be avoided by the following:

(push '(Face ignore) message-field-fillers)

>>>>> In <v9brjautzo.fsf@marauder.physik.uni-ulm.de>
>>>>>	Reiner Steib <4.uce.03.r.s@nurfuerspam.de> wrote:

> The only ugliness is, that the first line is one char longer than
> the others.

>  (defun gnus-face-encode ()
> -  (let ((step 72))
> +  (let ((step (- 76 (length "Face:"))))
>      (base64-encode-region (point-min) (point-max))

That function seems to become simple by letting b64-e-r not make
line breaking as follows:

(defun gnus-face-encode ()
  (base64-encode-region (point-min) (point-max) t)
  (goto-char (min (+ (point-min) 71) (point-max)))
  (while (not (eobp))
    (insert "\n ")
    (goto-char (min (+ (point) 76) (point-max))))
  (buffer-string))

I think it is possible to enlarge each line length, though.  An
example is in this message header.
-- 
Katsumi Yamaoka <yamaoka@jpl.org>



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

end of thread, other threads:[~2004-06-24  0:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-23 15:39 Smaller Face: wrap margin Andrew A. Raines
2004-06-23 16:19 ` Reiner Steib
2004-06-23 17:29   ` Andrew A. Raines
2004-06-24  0:56     ` Katsumi Yamaoka

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 NNTP newsgroup(s).