Gnus development mailing list
 help / color / mirror / Atom feed
* gnus-xmas-format in ~/.newsrc.eld
@ 2003-04-23 13:17 Reiner Steib
  2003-04-23 14:18 ` Simon Josefsson
  0 siblings, 1 reply; 5+ messages in thread
From: Reiner Steib @ 2003-04-23 13:17 UTC (permalink / raw)


Hi,

when using Oort with XEmacs, the following gets written to
~/.newsrc.eld:

,----
| (setq
|  gnus-format-specs
|  '((article-mode "Gnus: %g [%w] %S%m"
| 		 (concat (gnus-xmas-format "Gnus: %s [%s] %s%s" ...)))))
`----

When a user wants to switch back to Gnus 5.8.8 (e.g. to see if some
bug has been introduced in Oort), displaying articles fails, because
`gnus-xmas-format' isn't bound.

Couldn't we (defalias 'gnus-xmas-format 'format) in this case?

--8<---------------cut here---------------start------------->8---
--- lisp/gnus-start.el	5 Apr 2003 05:40:29 -0000	6.72
+++ lisp/gnus-start.el	23 Apr 2003 13:19:12 -0000
@@ -460,6 +460,12 @@
 ;; Byte-compiler warning.
 (defvar gnus-group-line-format)
 
+(defvar gnus-newsrc-gnus-compatibility
+  (concat "(unless (fboundp 'gnus-xmas-format)\n"
+	  "  (defalias 'gnus-xmas-format 'format))\n")
+  "String added to `~/.newsrc.eld' for compatibility.
+Must be a valid lisp expression.")
+
 ;; Suggested by Brian Edmonds <edmonds@cs.ubc.ca>.
 (defvar gnus-init-inhibit nil)
 (defun gnus-read-init-file (&optional inhibit-next)
@@ -2641,6 +2647,8 @@
     (princ "(setq gnus-newsrc-file-version ")
     (princ (gnus-prin1-to-string gnus-version))
     (princ ")\n")
+    (when (stringp gnus-newsrc-gnus-compatibility)
+      (insert gnus-newsrc-gnus-compatibility))
     (let* ((print-quoted t)
            (print-readably t)
            (print-escape-multibyte nil)
--8<---------------cut here---------------end--------------->8---

Is there a better name instead of `gnus-newsrc-gnus-compatibility'?

I'm using `defvar' (and not `defcustom') on purpose, because I don't
think it should be customizable.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-04-23 21:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-23 13:17 gnus-xmas-format in ~/.newsrc.eld Reiner Steib
2003-04-23 14:18 ` Simon Josefsson
2003-04-23 18:06   ` Reiner Steib
2003-04-23 20:10     ` Simon Josefsson
2003-04-23 21:05       ` Reiner Steib

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).