Silence the byte compiler
authorKatsumi Yamaoka <yamaoka@jpl.org>
Tue, 17 Sep 2013 23:48:57 +0000 (23:48 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Tue, 17 Sep 2013 23:48:57 +0000 (23:48 +0000)
* gnus-icalendar.el (gnus-icalendar-event--find-attendee)
(gnus-icalendar-event-from-ical)
(gnus-icalendar-event--build-reply-event-body)
(gnus-icalendar-event-reply-from-buffer)
(gnus-icalendar-find-org-event-file)
(gnus-icalendar-event->gnus-calendar, gnus-icalendar-reply)
(gnus-icalendar-mm-inline): Use gmm-labels instead of labels or flet.

* mm-util.el (mm-special-display-p): Isolate XEmacs stuff.

lisp/ChangeLog
lisp/gnus-icalendar.el
lisp/mm-util.el

index 85137cc..0f86436 100644 (file)
@@ -1,3 +1,15 @@
+2013-09-17  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-icalendar.el (gnus-icalendar-event--find-attendee)
+       (gnus-icalendar-event-from-ical)
+       (gnus-icalendar-event--build-reply-event-body)
+       (gnus-icalendar-event-reply-from-buffer)
+       (gnus-icalendar-find-org-event-file)
+       (gnus-icalendar-event->gnus-calendar, gnus-icalendar-reply)
+       (gnus-icalendar-mm-inline): Use gmm-labels instead of labels or flet.
+
+       * mm-util.el (mm-special-display-p): Isolate XEmacs stuff.
+
 2013-09-17  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * gnus-salt.el (gnus-tree-mode): Use define-derived-mode.
 2013-09-17  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * gnus-salt.el (gnus-tree-mode): Use define-derived-mode.
index e4e1ec2..969c868 100644 (file)
@@ -35,6 +35,7 @@
 
 (require 'icalendar)
 (require 'eieio)
 
 (require 'icalendar)
 (require 'eieio)
+(require 'gmm-utils)
 (require 'mm-decode)
 (require 'gnus-sum)
 
 (require 'mm-decode)
 (require 'gnus-sum)
 
 (defun gnus-icalendar-event--find-attendee (ical name-or-email)
   (let* ((event (car (icalendar--all-events ical)))
          (event-props (caddr event)))
 (defun gnus-icalendar-event--find-attendee (ical name-or-email)
   (let* ((event (car (icalendar--all-events ical)))
          (event-props (caddr event)))
-    (labels ((attendee-name (att) (plist-get (cadr att) 'CN))
+    (gmm-labels ((attendee-name (att) (plist-get (cadr att) 'CN))
                  (attendee-email (att)
                    (replace-regexp-in-string "^.*MAILTO:" "" (caddr att)))
                  (attendee-prop-matches-p (prop)
                  (attendee-email (att)
                    (replace-regexp-in-string "^.*MAILTO:" "" (caddr att)))
                  (attendee-prop-matches-p (prop)
                        ((string= method "REPLY") 'gnus-icalendar-event-reply)
                        (t 'gnus-icalendar-event))))
 
                        ((string= method "REPLY") 'gnus-icalendar-event-reply)
                        (t 'gnus-icalendar-event))))
 
-    (labels ((map-property (prop)
+    (gmm-labels ((map-property (prop)
                    (let ((value (icalendar--get-event-property event prop)))
                      (when value
                        ;; ugly, but cannot get
                    (let ((value (icalendar--get-event-property event prop)))
                      (when value
                        ;; ugly, but cannot get
@@ -233,7 +234,7 @@ status will be retrieved from the first matching attendee record."
   (let ((summary-status (capitalize (symbol-name status)))
         (attendee-status (upcase (symbol-name status)))
         reply-event-lines)
   (let ((summary-status (capitalize (symbol-name status)))
         (attendee-status (upcase (symbol-name status)))
         reply-event-lines)
-    (labels ((update-summary (line)
+    (gmm-labels ((update-summary (line)
                    (if (string-match "^[^:]+:" line)
                        (replace-match (format "\\&%s: " summary-status) t nil line)
                      line))
                    (if (string-match "^[^:]+:" line)
                        (replace-match (format "\\&%s: " summary-status) t nil line)
                      line))
@@ -280,7 +281,7 @@ status will be retrieved from the first matching attendee record."
 The reply will have STATUS (`accepted', `tentative' or  `declined').
 The reply will be composed for attendees matching any entry
 on the IDENTITIES list."
 The reply will have STATUS (`accepted', `tentative' or  `declined').
 The reply will be composed for attendees matching any entry
 on the IDENTITIES list."
-  (flet ((extract-block (blockname)
+  (gmm-labels ((extract-block (blockname)
                (save-excursion
                  (let ((block-start-re (format "^BEGIN:%s" blockname))
                        (block-end-re (format "^END:%s" blockname))
                (save-excursion
                  (let ((block-start-re (format "^BEGIN:%s" blockname))
                        (block-end-re (format "^END:%s" blockname))
@@ -419,7 +420,7 @@ the optional ORG-FILE argument is specified, only that one file
 is searched."
   (let ((uid (gnus-icalendar-event:uid event))
         (files (or org-file (org-agenda-files t 'ifmode))))
 is searched."
   (let ((uid (gnus-icalendar-event:uid event))
         (files (or org-file (org-agenda-files t 'ifmode))))
-    (flet
+    (gmm-labels
         ((find-event-in (file)
            (org-check-agenda-file file)
            (with-current-buffer (find-file-noselect file)
         ((find-event-in (file)
            (org-check-agenda-file file)
            (with-current-buffer (find-file-noselect file)
@@ -596,7 +597,7 @@ is searched."
 ;; TODO: make the template customizable
 (defmethod gnus-icalendar-event->gnus-calendar ((event gnus-icalendar-event) &optional reply-status)
   "Format an overview of EVENT details."
 ;; TODO: make the template customizable
 (defmethod gnus-icalendar-event->gnus-calendar ((event gnus-icalendar-event) &optional reply-status)
   "Format an overview of EVENT details."
-  (flet ((format-header (x)
+  (gmm-labels ((format-header (x)
             (format "%-12s%s"
                     (propertize (concat (car x) ":") 'face 'bold)
                     (cadr x))))
             (format "%-12s%s"
                     (propertize (concat (car x) ":") 'face 'bold)
                     (cadr x))))
@@ -673,7 +674,7 @@ is searched."
                    (current-buffer) status gnus-icalendar-identities))))
 
     (when reply
                    (current-buffer) status gnus-icalendar-identities))))
 
     (when reply
-      (flet ((fold-icalendar-buffer ()
+      (gmm-labels ((fold-icalendar-buffer ()
                (goto-char (point-min))
                (while (re-search-forward "^\\(.\\{72\\}\\)\\(.+\\)$" nil t)
                  (replace-match "\\1\n \\2")
                (goto-char (point-min))
                (while (re-search-forward "^\\(.\\{72\\}\\)\\(.+\\)$" nil t)
                  (replace-match "\\1\n \\2")
@@ -735,7 +736,7 @@ is searched."
     (setq gnus-icalendar-reply-status nil)
 
     (when event
     (setq gnus-icalendar-reply-status nil)
 
     (when event
-      (flet ((insert-button-group (buttons)
+      (gmm-labels ((insert-button-group (buttons)
                 (when buttons
                   (mapc (lambda (x)
                           (apply 'gnus-icalendar-insert-button x)
                 (when buttons
                   (mapc (lambda (x)
                           (apply 'gnus-icalendar-insert-button x)
index 9c2f0df..5b0fd68 100644 (file)
      (multibyte-char-to-unibyte . identity)
      ;; `set-buffer-multibyte' is an Emacs function, not available in XEmacs.
      (set-buffer-multibyte . ignore)
      (multibyte-char-to-unibyte . identity)
      ;; `set-buffer-multibyte' is an Emacs function, not available in XEmacs.
      (set-buffer-multibyte . ignore)
-     ;; `special-display-p' is an Emacs function, not available in XEmacs.
-     (special-display-p
-      . ,(lambda (buffer-name)
-          "Returns non-nil if a buffer named BUFFER-NAME gets a special frame."
-          (and special-display-function
-               (or (and (member buffer-name special-display-buffer-names) t)
-                   (cdr (assoc buffer-name special-display-buffer-names))
-                   (catch 'return
-                     (dolist (elem special-display-regexps)
-                       (and (stringp elem)
-                            (string-match elem buffer-name)
-                            (throw 'return t))
-                       (and (consp elem)
-                            (stringp (car elem))
-                            (string-match (car elem) buffer-name)
-                            (throw 'return (cdr elem)))))))))
      ;; `substring-no-properties' is available only in Emacs 22.1 or greater.
      (substring-no-properties
       . ,(lambda (string &optional from to)
      ;; `substring-no-properties' is available only in Emacs 22.1 or greater.
      (substring-no-properties
       . ,(lambda (string &optional from to)
@@ -174,6 +158,25 @@ to the contents of the accessible portion of the buffer."
               (forward-line 0)
               (1+ (count-lines start (point))))))))))
 
               (forward-line 0)
               (1+ (count-lines start (point))))))))))
 
+;; `special-display-p' is an Emacs function, not available in XEmacs.
+(defalias 'mm-special-display-p
+  (if (featurep 'emacs)
+      'special-display-p
+    (lambda (buffer-name)
+      "Returns non-nil if a buffer named BUFFER-NAME gets a special frame."
+      (and special-display-function
+          (or (and (member buffer-name special-display-buffer-names) t)
+              (cdr (assoc buffer-name special-display-buffer-names))
+              (catch 'return
+                (dolist (elem special-display-regexps)
+                  (and (stringp elem)
+                       (string-match elem buffer-name)
+                       (throw 'return t))
+                  (and (consp elem)
+                       (stringp (car elem))
+                       (string-match (car elem) buffer-name)
+                       (throw 'return (cdr elem))))))))))
+
 ;; `decode-coding-string', `encode-coding-string', `decode-coding-region'
 ;; and `encode-coding-region' are available in Emacs and XEmacs built with
 ;; the `file-coding' feature, but the XEmacs versions treat nil, that is
 ;; `decode-coding-string', `encode-coding-string', `decode-coding-region'
 ;; and `encode-coding-region' are available in Emacs and XEmacs built with
 ;; the `file-coding' feature, but the XEmacs versions treat nil, that is