Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* line brake for attachments
@ 2024-02-15 13:28 Dieter Faulbaum
  2024-02-15 14:56 ` Adam Sjøgren
  0 siblings, 1 reply; 2+ messages in thread
From: Dieter Faulbaum @ 2024-02-15 13:28 UTC (permalink / raw)
  To: info-gnus-english


if I attach a file, I always have a newline in the message buffer 
like this:
(the backslashes are only there to not interpret the part (before 
sending))

<\#part ...>
<\#/part>"

for me it would be (much) nicer if this attachment needs only one 
line like this:

<\#part ...><\#/part>"

Is it possible to have a (customizable) variable for this 
behaviour?


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

* Re: line brake for attachments
  2024-02-15 13:28 line brake for attachments Dieter Faulbaum
@ 2024-02-15 14:56 ` Adam Sjøgren
  0 siblings, 0 replies; 2+ messages in thread
From: Adam Sjøgren @ 2024-02-15 14:56 UTC (permalink / raw)
  To: info-gnus-english

Dieter writes:

> <\#part ...>
> <\#/part>"
>
> for me it would be (much) nicer if this attachment needs only one line
> like this:
>
> <\#part ...><\#/part>"
>
> Is it possible to have a (customizable) variable for this behaviour?

Not out of the box, it seems to be "hardcoded" in the last line of
mml-insert-tag:

  (defun mml-insert-tag (name &rest plist)
    "Insert an MML tag described by NAME and PLIST."
    (when (symbolp name)
      (setq name (symbol-name name)))
    (insert "<#" name)
    (while plist
      (let ((key (pop plist))
            (value (pop plist)))
        (when value
          ;; Quote VALUE if it contains suspicious characters.
          (when (string-match "[][\"'\\~/*;()<>= \t\n[:multibyte:]]" value)
            (setq value (with-output-to-string
                          (let (print-escape-nonascii)
                            (prin1 value)))))
          (insert (format " %s=%s" key value)))))
    (insert ">\n"))

which is called by mml-insert-empty-tag, which is in turn called by
mml-attach-file - called by you, I assume.

You could either wrap mml-attach-file in a little code that removes
the linefeed you do not like, and then call that, or (perhaps more
risky) add an advice to mml-insert-tag. Or simply override it with
your own version :-)


  Best regards,

    Adam

-- 
 "Jo, tak som falbyder, det ville da være                   Adam Sjøgren
  prisværdigt."                                        asjo@koldfront.dk



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

end of thread, other threads:[~2024-02-15 14:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-15 13:28 line brake for attachments Dieter Faulbaum
2024-02-15 14:56 ` Adam Sjøgren

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).