+2003-02-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus-art.el (popup-menu): Compiler macro for Emacs 20.
+ (gnus-article-refer-article): Use gnus-point-at-(b|e)ol instead of
+ point-at-(b|e)ol which aren't available in Emacs 20.
+
+ * gnus-registry.el (puthash): Alias to cl-puthash for Emacs 20.
+
2002-02-23 Kevin Greiner <kgreiner@xpediantsolutions.com>
* gnus-start.el (gnus-activate-group): Re-enabled the catch error
,@(mapcar (lambda (c)
(vector (caddr c) (car c) :enable t)) gnus-mime-button-commands)))
+(eval-when-compile
+ (define-compiler-macro popup-menu (&whole form
+ menu &optional position prefix)
+ (if (and (fboundp 'popup-menu)
+ (not (memq 'popup-menu (assoc "lmenu" load-history))))
+ form
+ ;; Gnus is probably running under Emacs 20.
+ `(let* ((menu (cdr ,menu))
+ (response (x-popup-menu
+ t (list (car menu)
+ (cons "" (mapcar (lambda (c)
+ (cons (caddr c) (car c)))
+ (cdr menu)))))))
+ (if response
+ (call-interactively (nth 3 (assq response menu))))))))
+
(defun gnus-mime-button-menu (event prefix)
"Construct a context-sensitive menu of MIME commands."
(interactive "e\nP")
"Read article specified by message-id around point."
(interactive)
(save-excursion
- (re-search-backward "<?news:\\|<" (point-at-bol) t)
+ (re-search-backward "<?news:\\|<" (gnus-point-at-bol) t)
(cond ((re-search-forward
- gnus-button-mid-or-mail-regexp (point-at-eol) t)
+ gnus-button-mid-or-mail-regexp (gnus-point-at-eol) t)
(let ((msg-id (concat "<" (match-string 0) ">")))
(set-buffer gnus-summary-buffer)
(gnus-summary-refer-article msg-id)))
;; (maphash (lambda (key value) (message "key: %s value: %s" key value)) gnus-registry-hashtb)
;; (clrhash gnus-registry-hashtb)
+;; Function(s) missing in Emacs 20
+(when (memq nil (mapcar 'fboundp '(puthash)))
+ (require 'cl)
+ (unless (fboundp 'puthash)
+ ;; alias puthash is missing from Emacs 20 cl-extra.el
+ (defalias 'puthash 'cl-puthash)))
+
(defun gnus-register-action (action data-header from &optional to method)
(let* ((id (mail-header-id data-header))
(hash-entry (gethash id gnus-registry-hashtb)))