diff options
| author | Katsumi Yamaoka | 2013-09-17 23:49:48 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2013-09-17 23:49:48 +0000 |
| commit | 9ab16aab6a9ffa2182b5b9d5b730522d775bf7e1 (patch) | |
| tree | 26befa2bface924736b9b3f909ca6ea3f82cb362 | |
| parent | 2b42da98373fd7c1d1b6ce983985e69789f40171 (diff) | |
| download | emacs-9ab16aab6a9ffa2182b5b9d5b730522d775bf7e1.tar.gz emacs-9ab16aab6a9ffa2182b5b9d5b730522d775bf7e1.zip | |
[Gnus] Silence the byte compiler
* 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.
| -rw-r--r-- | lisp/gnus/ChangeLog | 12 | ||||
| -rw-r--r-- | lisp/gnus/gnus-icalendar.el | 17 | ||||
| -rw-r--r-- | lisp/gnus/mm-util.el | 35 |
3 files changed, 40 insertions, 24 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index d673a18cb1d..7805dabc7c8 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2013-09-17 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2 | |||
| 3 | * gnus-icalendar.el (gnus-icalendar-event--find-attendee) | ||
| 4 | (gnus-icalendar-event-from-ical) | ||
| 5 | (gnus-icalendar-event--build-reply-event-body) | ||
| 6 | (gnus-icalendar-event-reply-from-buffer) | ||
| 7 | (gnus-icalendar-find-org-event-file) | ||
| 8 | (gnus-icalendar-event->gnus-calendar, gnus-icalendar-reply) | ||
| 9 | (gnus-icalendar-mm-inline): Use gmm-labels instead of labels or flet. | ||
| 10 | |||
| 11 | * mm-util.el (mm-special-display-p): Isolate XEmacs stuff. | ||
| 12 | |||
| 1 | 2013-09-17 Stefan Monnier <monnier@iro.umontreal.ca> | 13 | 2013-09-17 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 14 | ||
| 3 | * gnus-salt.el (gnus-tree-mode): Use define-derived-mode. | 15 | * gnus-salt.el (gnus-tree-mode): Use define-derived-mode. |
diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el index e4e1ec29ae9..969c868b564 100644 --- a/lisp/gnus/gnus-icalendar.el +++ b/lisp/gnus/gnus-icalendar.el | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | 35 | ||
| 36 | (require 'icalendar) | 36 | (require 'icalendar) |
| 37 | (require 'eieio) | 37 | (require 'eieio) |
| 38 | (require 'gmm-utils) | ||
| 38 | (require 'mm-decode) | 39 | (require 'mm-decode) |
| 39 | (require 'gnus-sum) | 40 | (require 'gnus-sum) |
| 40 | 41 | ||
| @@ -149,7 +150,7 @@ | |||
| 149 | (defun gnus-icalendar-event--find-attendee (ical name-or-email) | 150 | (defun gnus-icalendar-event--find-attendee (ical name-or-email) |
| 150 | (let* ((event (car (icalendar--all-events ical))) | 151 | (let* ((event (car (icalendar--all-events ical))) |
| 151 | (event-props (caddr event))) | 152 | (event-props (caddr event))) |
| 152 | (labels ((attendee-name (att) (plist-get (cadr att) 'CN)) | 153 | (gmm-labels ((attendee-name (att) (plist-get (cadr att) 'CN)) |
| 153 | (attendee-email (att) | 154 | (attendee-email (att) |
| 154 | (replace-regexp-in-string "^.*MAILTO:" "" (caddr att))) | 155 | (replace-regexp-in-string "^.*MAILTO:" "" (caddr att))) |
| 155 | (attendee-prop-matches-p (prop) | 156 | (attendee-prop-matches-p (prop) |
| @@ -189,7 +190,7 @@ | |||
| 189 | ((string= method "REPLY") 'gnus-icalendar-event-reply) | 190 | ((string= method "REPLY") 'gnus-icalendar-event-reply) |
| 190 | (t 'gnus-icalendar-event)))) | 191 | (t 'gnus-icalendar-event)))) |
| 191 | 192 | ||
| 192 | (labels ((map-property (prop) | 193 | (gmm-labels ((map-property (prop) |
| 193 | (let ((value (icalendar--get-event-property event prop))) | 194 | (let ((value (icalendar--get-event-property event prop))) |
| 194 | (when value | 195 | (when value |
| 195 | ;; ugly, but cannot get | 196 | ;; ugly, but cannot get |
| @@ -233,7 +234,7 @@ status will be retrieved from the first matching attendee record." | |||
| 233 | (let ((summary-status (capitalize (symbol-name status))) | 234 | (let ((summary-status (capitalize (symbol-name status))) |
| 234 | (attendee-status (upcase (symbol-name status))) | 235 | (attendee-status (upcase (symbol-name status))) |
| 235 | reply-event-lines) | 236 | reply-event-lines) |
| 236 | (labels ((update-summary (line) | 237 | (gmm-labels ((update-summary (line) |
| 237 | (if (string-match "^[^:]+:" line) | 238 | (if (string-match "^[^:]+:" line) |
| 238 | (replace-match (format "\\&%s: " summary-status) t nil line) | 239 | (replace-match (format "\\&%s: " summary-status) t nil line) |
| 239 | line)) | 240 | line)) |
| @@ -280,7 +281,7 @@ status will be retrieved from the first matching attendee record." | |||
| 280 | The reply will have STATUS (`accepted', `tentative' or `declined'). | 281 | The reply will have STATUS (`accepted', `tentative' or `declined'). |
| 281 | The reply will be composed for attendees matching any entry | 282 | The reply will be composed for attendees matching any entry |
| 282 | on the IDENTITIES list." | 283 | on the IDENTITIES list." |
| 283 | (flet ((extract-block (blockname) | 284 | (gmm-labels ((extract-block (blockname) |
| 284 | (save-excursion | 285 | (save-excursion |
| 285 | (let ((block-start-re (format "^BEGIN:%s" blockname)) | 286 | (let ((block-start-re (format "^BEGIN:%s" blockname)) |
| 286 | (block-end-re (format "^END:%s" blockname)) | 287 | (block-end-re (format "^END:%s" blockname)) |
| @@ -419,7 +420,7 @@ the optional ORG-FILE argument is specified, only that one file | |||
| 419 | is searched." | 420 | is searched." |
| 420 | (let ((uid (gnus-icalendar-event:uid event)) | 421 | (let ((uid (gnus-icalendar-event:uid event)) |
| 421 | (files (or org-file (org-agenda-files t 'ifmode)))) | 422 | (files (or org-file (org-agenda-files t 'ifmode)))) |
| 422 | (flet | 423 | (gmm-labels |
| 423 | ((find-event-in (file) | 424 | ((find-event-in (file) |
| 424 | (org-check-agenda-file file) | 425 | (org-check-agenda-file file) |
| 425 | (with-current-buffer (find-file-noselect file) | 426 | (with-current-buffer (find-file-noselect file) |
| @@ -596,7 +597,7 @@ is searched." | |||
| 596 | ;; TODO: make the template customizable | 597 | ;; TODO: make the template customizable |
| 597 | (defmethod gnus-icalendar-event->gnus-calendar ((event gnus-icalendar-event) &optional reply-status) | 598 | (defmethod gnus-icalendar-event->gnus-calendar ((event gnus-icalendar-event) &optional reply-status) |
| 598 | "Format an overview of EVENT details." | 599 | "Format an overview of EVENT details." |
| 599 | (flet ((format-header (x) | 600 | (gmm-labels ((format-header (x) |
| 600 | (format "%-12s%s" | 601 | (format "%-12s%s" |
| 601 | (propertize (concat (car x) ":") 'face 'bold) | 602 | (propertize (concat (car x) ":") 'face 'bold) |
| 602 | (cadr x)))) | 603 | (cadr x)))) |
| @@ -673,7 +674,7 @@ is searched." | |||
| 673 | (current-buffer) status gnus-icalendar-identities)))) | 674 | (current-buffer) status gnus-icalendar-identities)))) |
| 674 | 675 | ||
| 675 | (when reply | 676 | (when reply |
| 676 | (flet ((fold-icalendar-buffer () | 677 | (gmm-labels ((fold-icalendar-buffer () |
| 677 | (goto-char (point-min)) | 678 | (goto-char (point-min)) |
| 678 | (while (re-search-forward "^\\(.\\{72\\}\\)\\(.+\\)$" nil t) | 679 | (while (re-search-forward "^\\(.\\{72\\}\\)\\(.+\\)$" nil t) |
| 679 | (replace-match "\\1\n \\2") | 680 | (replace-match "\\1\n \\2") |
| @@ -735,7 +736,7 @@ is searched." | |||
| 735 | (setq gnus-icalendar-reply-status nil) | 736 | (setq gnus-icalendar-reply-status nil) |
| 736 | 737 | ||
| 737 | (when event | 738 | (when event |
| 738 | (flet ((insert-button-group (buttons) | 739 | (gmm-labels ((insert-button-group (buttons) |
| 739 | (when buttons | 740 | (when buttons |
| 740 | (mapc (lambda (x) | 741 | (mapc (lambda (x) |
| 741 | (apply 'gnus-icalendar-insert-button x) | 742 | (apply 'gnus-icalendar-insert-button x) |
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el index 9c2f0df5f59..5b0fd6860a0 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el | |||
| @@ -129,22 +129,6 @@ | |||
| 129 | (multibyte-char-to-unibyte . identity) | 129 | (multibyte-char-to-unibyte . identity) |
| 130 | ;; `set-buffer-multibyte' is an Emacs function, not available in XEmacs. | 130 | ;; `set-buffer-multibyte' is an Emacs function, not available in XEmacs. |
| 131 | (set-buffer-multibyte . ignore) | 131 | (set-buffer-multibyte . ignore) |
| 132 | ;; `special-display-p' is an Emacs function, not available in XEmacs. | ||
| 133 | (special-display-p | ||
| 134 | . ,(lambda (buffer-name) | ||
| 135 | "Returns non-nil if a buffer named BUFFER-NAME gets a special frame." | ||
| 136 | (and special-display-function | ||
| 137 | (or (and (member buffer-name special-display-buffer-names) t) | ||
| 138 | (cdr (assoc buffer-name special-display-buffer-names)) | ||
| 139 | (catch 'return | ||
| 140 | (dolist (elem special-display-regexps) | ||
| 141 | (and (stringp elem) | ||
| 142 | (string-match elem buffer-name) | ||
| 143 | (throw 'return t)) | ||
| 144 | (and (consp elem) | ||
| 145 | (stringp (car elem)) | ||
| 146 | (string-match (car elem) buffer-name) | ||
| 147 | (throw 'return (cdr elem))))))))) | ||
| 148 | ;; `substring-no-properties' is available only in Emacs 22.1 or greater. | 132 | ;; `substring-no-properties' is available only in Emacs 22.1 or greater. |
| 149 | (substring-no-properties | 133 | (substring-no-properties |
| 150 | . ,(lambda (string &optional from to) | 134 | . ,(lambda (string &optional from to) |
| @@ -174,6 +158,25 @@ to the contents of the accessible portion of the buffer." | |||
| 174 | (forward-line 0) | 158 | (forward-line 0) |
| 175 | (1+ (count-lines start (point)))))))))) | 159 | (1+ (count-lines start (point)))))))))) |
| 176 | 160 | ||
| 161 | ;; `special-display-p' is an Emacs function, not available in XEmacs. | ||
| 162 | (defalias 'mm-special-display-p | ||
| 163 | (if (featurep 'emacs) | ||
| 164 | 'special-display-p | ||
| 165 | (lambda (buffer-name) | ||
| 166 | "Returns non-nil if a buffer named BUFFER-NAME gets a special frame." | ||
| 167 | (and special-display-function | ||
| 168 | (or (and (member buffer-name special-display-buffer-names) t) | ||
| 169 | (cdr (assoc buffer-name special-display-buffer-names)) | ||
| 170 | (catch 'return | ||
| 171 | (dolist (elem special-display-regexps) | ||
| 172 | (and (stringp elem) | ||
| 173 | (string-match elem buffer-name) | ||
| 174 | (throw 'return t)) | ||
| 175 | (and (consp elem) | ||
| 176 | (stringp (car elem)) | ||
| 177 | (string-match (car elem) buffer-name) | ||
| 178 | (throw 'return (cdr elem)))))))))) | ||
| 179 | |||
| 177 | ;; `decode-coding-string', `encode-coding-string', `decode-coding-region' | 180 | ;; `decode-coding-string', `encode-coding-string', `decode-coding-region' |
| 178 | ;; and `encode-coding-region' are available in Emacs and XEmacs built with | 181 | ;; and `encode-coding-region' are available in Emacs and XEmacs built with |
| 179 | ;; the `file-coding' feature, but the XEmacs versions treat nil, that is | 182 | ;; the `file-coding' feature, but the XEmacs versions treat nil, that is |