From: Magnus Henoch <mange@freemail.hu>
Subject: s/defmacro/defsubst/ in mm-decode.el
Date: Tue, 25 Jul 2006 23:05:55 +0200 [thread overview]
Message-ID: <87u0559yz0.fsf@freemail.hu> (raw)
[-- Attachment #1: Type: text/plain, Size: 149 bytes --]
The following patch changes some macros in mm-decode.el to inline
functions, thereby making W3 happy, which tries to use them as
functions.
Magnus
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: mm-decode.el.patch --]
[-- Type: text/x-patch, Size: 2737 bytes --]
--- orig/lisp/mm-decode.el
+++ mod/lisp/mm-decode.el
@@ -59,10 +59,10 @@
;;; Convenience macros.
-(defmacro mm-handle-buffer (handle)
- `(nth 0 ,handle))
-(defmacro mm-handle-type (handle)
- `(nth 1 ,handle))
+(defsubst mm-handle-buffer (handle)
+ (nth 0 handle))
+(defsubst mm-handle-type (handle)
+ (nth 1 handle))
(defsubst mm-handle-media-type (handle)
(if (stringp (car handle))
(car handle)
@@ -71,34 +71,34 @@
(car (split-string (mm-handle-media-type handle) "/")))
(defsubst mm-handle-media-subtype (handle)
(cadr (split-string (mm-handle-media-type handle) "/")))
-(defmacro mm-handle-encoding (handle)
- `(nth 2 ,handle))
-(defmacro mm-handle-undisplayer (handle)
- `(nth 3 ,handle))
-(defmacro mm-handle-set-undisplayer (handle function)
- `(setcar (nthcdr 3 ,handle) ,function))
-(defmacro mm-handle-disposition (handle)
- `(nth 4 ,handle))
-(defmacro mm-handle-description (handle)
- `(nth 5 ,handle))
-(defmacro mm-handle-cache (handle)
- `(nth 6 ,handle))
-(defmacro mm-handle-set-cache (handle contents)
- `(setcar (nthcdr 6 ,handle) ,contents))
-(defmacro mm-handle-id (handle)
- `(nth 7 ,handle))
-(defmacro mm-handle-multipart-original-buffer (handle)
- `(get-text-property 0 'buffer (car ,handle)))
-(defmacro mm-handle-multipart-from (handle)
- `(get-text-property 0 'from (car ,handle)))
-(defmacro mm-handle-multipart-ctl-parameter (handle parameter)
- `(get-text-property 0 ,parameter (car ,handle)))
+(defsubst mm-handle-encoding (handle)
+ (nth 2 handle))
+(defsubst mm-handle-undisplayer (handle)
+ (nth 3 handle))
+(defsubst mm-handle-set-undisplayer (handle function)
+ (setcar (nthcdr 3 handle) function))
+(defsubst mm-handle-disposition (handle)
+ (nth 4 handle))
+(defsubst mm-handle-description (handle)
+ (nth 5 handle))
+(defsubst mm-handle-cache (handle)
+ (nth 6 handle))
+(defsubst mm-handle-set-cache (handle contents)
+ (setcar (nthcdr 6 handle) contents))
+(defsubst mm-handle-id (handle)
+ (nth 7 handle))
+(defsubst mm-handle-multipart-original-buffer (handle)
+ (get-text-property 0 'buffer (car handle)))
+(defsubst mm-handle-multipart-from (handle)
+ (get-text-property 0 'from (car handle)))
+(defsubst mm-handle-multipart-ctl-parameter (handle parameter)
+ (get-text-property 0 parameter (car handle)))
-(defmacro mm-make-handle (&optional buffer type encoding undisplayer
+(defsubst mm-make-handle (&optional buffer type encoding undisplayer
disposition description cache
id)
- `(list ,buffer ,type ,encoding ,undisplayer
- ,disposition ,description ,cache ,id))
+ (list buffer type encoding undisplayer
+ disposition description cache id))
(defcustom mm-text-html-renderer
(cond ((locate-library "w3") 'w3)
next reply other threads:[~2006-07-25 21:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-25 21:05 Magnus Henoch [this message]
2006-08-01 11:02 ` Reiner Steib
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=87u0559yz0.fsf@freemail.hu \
--to=mange@freemail.hu \
/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).