From: Lloyd Zusman <ljz@asfast.com>
Subject: First patch affecting `mml-parse' (was: Another proposal about `mml-parse'.)
Date: 24 Dec 2000 20:50:06 -0500 [thread overview]
Message-ID: <ltito9clrl.fsf_-_@asfast.com> (raw)
In-Reply-To: <ltitoatum8.fsf@asfast.com>
Here's my first patch affecting `mml-parse'. It's actually just the
first half of what I want to do, since as I mentioned earlier, I want
to enchance `mml-parse' so that I can then use the results of
`mml-parse' to rationalize the results of `mml-secure-part'.
In this patch, I actually just made a minor change to the
`mml-read-tag' function within `mml.el'. This is a helper function
that is called within `mml-parse-1'. In my changed `mml-read-tag',
whenever it generates a `contents' entry, it also generates a
corresponding `tag-location' entry, whose cdr is the location within
the message buffer of the tag in question.
As I mentioned earlier, I intend to rewrite `mml-secure-part' to make
use of the `mml-parse' output that now contains this `tag-location'
entry. I'll now start working on my changes to `mml-secure-part',
and I'll post that patch whenever it's ready.
But for now, this current patch should work just fine, and as far as I
can tell, the new, extra info returned by `mml-parse' will not harm
any existing code.
The patch:
*** mml.el.orig Sun Dec 24 20:28:07 2000
--- mml.el Sun Dec 24 20:37:22 2000
***************
*** 216,222 ****
(defun mml-read-tag ()
"Read a tag and return the contents."
! (let (contents name elem val)
(forward-char 2)
(setq name (buffer-substring-no-properties
(point) (progn (forward-sexp 1) (point))))
--- 216,223 ----
(defun mml-read-tag ()
"Read a tag and return the contents."
! (let ((orig-point (point))
! contents name elem val)
(forward-char 2)
(setq name (buffer-substring-no-properties
(point) (progn (forward-sexp 1) (point))))
***************
*** 234,239 ****
--- 235,242 ----
(goto-char (match-end 0))
;; Don't skip the leading space.
;;(skip-chars-forward " \t\n")
+ ;; Put the tag location into the returned contents
+ (setq contents (append (list (cons 'tag-location orig-point)) contents))
(cons (intern name) (nreverse contents))))
(defun mml-read-part (&optional mml)
--
Lloyd Zusman
ljz@asfast.com
next prev parent reply other threads:[~2000-12-25 1:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-12-23 2:15 Another proposal about `mml-parse' Lloyd Zusman
2000-12-23 15:46 ` Simon Josefsson
2000-12-24 2:34 ` Lloyd Zusman
2000-12-25 1:50 ` Lloyd Zusman [this message]
2000-12-25 2:11 ` First patch affecting `mml-parse' (was: Another proposal about `mml-parse'.) Simon Josefsson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ltito9clrl.fsf_-_@asfast.com \
--to=ljz@asfast.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).