Gnus development mailing list
 help / color / mirror / Atom feed
* diffs between Gnus and Emacs
@ 2009-05-27 10:01 Katsumi Yamaoka
  2009-05-28 23:16 ` Katsumi Yamaoka
  0 siblings, 1 reply; 7+ messages in thread
From: Katsumi Yamaoka @ 2009-05-27 10:01 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 1180 bytes --]

Hi,

I compared .el files and .texi files between the Gnus trunk and
the Emacs trunk and found two .el files in Gnus are older than
the ones in Emacs.  The changes concerning them are:

2009-04-20  Stefan Monnier  <monnier@iro.umontreal.ca>

	* rfc2047.el (rfc2047-decode-region): Don't skip past `start', which
	could happen if the text is only composed of spaces and/or tabs.

2006-08-10  Romain Francoise  <romain@orebokech.com>

	* textmodes/dns-mode.el: Alias `zone-mode' to `dns-mode'.
	(dns-mode-soa-auto-increment-serial): New user option.
	(dns-mode-soa-maybe-increment-serial): New function.
	(dns-mode): Add the latter to `write-contents-functions'.

I think those changes in Emacs should be merged to No Gnus.

In addition, for the customization group for the user option
`dns-mode', `data' used in Emacs looks better than `comm' used
in Gnus.

(Emacs)
2005-05-27  Lute Kamstra  <lute@gnu.org>
[...]
	* textmodes/dns-mode.el (dns-mode):
[...]
	Specify customization group.

(No Gnus)
2005-05-17  Katsumi Yamaoka  <yamaoka@jpl.org>
[...]
	* dns-mode.el (dns-mode): Add :group.

So, it is enough to copy those two files from Emacs to No Gnus.
The diffs are as follows:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 377 bytes --]

--- NoGnus/rfc2047.el	2009-01-22 08:09:02 +0000
+++ Emacs/rfc2047.el	2009-04-20 21:42:46 +0000
@@ -1045,7 +1045,7 @@
 		(setq start (point))
 		(setq quoted (eq (char-after) ?\"))
 		(goto-char (point-max))
-		(skip-chars-backward " \t")
+		(skip-chars-backward " \t" start)
 		(if (setq quoted (and quoted
 				      (> (point) (1+ start))
 				      (eq (char-before) ?\")))

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: Type: text/x-patch, Size: 2160 bytes --]

--- NoGnus/dns-mode.el	2009-01-22 08:09:02 +0000
+++ Emacs/dns-mode.el	2009-01-05 03:24:01 +0000
@@ -49,7 +49,7 @@
 
 (defgroup dns-mode nil
   "DNS master file mode configuration."
-  :group 'comm)
+  :group 'data)
 
 (defconst dns-mode-classes '("IN" "CS" "CH" "HS")
   "List of strings with known DNS classes.")
@@ -89,6 +89,18 @@
   :type 'sexp
   :group 'dns-mode)
 
+(defcustom dns-mode-soa-auto-increment-serial t
+  "Whether to increment the SOA serial number automatically.
+
+If this variable is t, the serial number is incremented upon each save of
+the file.  If it is `ask', Emacs asks for confirmation whether it should
+increment the serial upon saving.  If nil, serials must be incremented
+manually with \\[dns-mode-soa-increment-serial]."
+  :type '(choice (const :tag "Always" t)
+		 (const :tag "Ask" ask)
+		 (const :tag "Never" nil))
+  :group 'dns-mode)
+
 ;; Syntax table.
 
 (defvar dns-mode-syntax-table
@@ -134,8 +146,12 @@
   (unless (featurep 'xemacs)
     (set (make-local-variable 'font-lock-defaults)
 	 '(dns-mode-font-lock-keywords nil nil ((?_ . "w")))))
+  (add-hook 'before-save-hook 'dns-mode-soa-maybe-increment-serial
+	    nil t)
   (easy-menu-add dns-mode-menu dns-mode-map))
 
+;;;###autoload (defalias 'zone-mode 'dns-mode)
+
 ;; Tools.
 
 ;;;###autoload
@@ -191,6 +207,21 @@
 	      (message "Replaced old serial %s with %s" serial new))
 	  (error "Cannot locate serial number in SOA record"))))))
 
+(defun dns-mode-soa-maybe-increment-serial ()
+  "Increment SOA serial if needed.
+
+This function is run from `before-save-hook'."
+  (when (and (buffer-modified-p)
+	     dns-mode-soa-auto-increment-serial
+	     (or (eq dns-mode-soa-auto-increment-serial t)
+		 (y-or-n-p "Increment SOA serial? ")))
+    ;; If `dns-mode-soa-increment-serial' signals an error saving will
+    ;; fail but that probably means that the serial should be fixed to
+    ;; comply with the RFC anyway! -rfr
+    (progn (dns-mode-soa-increment-serial)
+	   ;; We return nil in case this is used in write-contents-functions.
+	   nil)))
+
 ;;;###autoload(add-to-list 'auto-mode-alist '("\\.soa\\'" . dns-mode))
 
 (provide 'dns-mode)

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

end of thread, other threads:[~2009-06-04 19:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-27 10:01 diffs between Gnus and Emacs Katsumi Yamaoka
2009-05-28 23:16 ` Katsumi Yamaoka
2009-05-29  6:31   ` Reiner Steib
2009-06-04 10:25     ` Katsumi Yamaoka
2009-06-04 11:11       ` Daiki Ueno
2009-06-04 11:21         ` Katsumi Yamaoka
2009-06-04 19:14         ` 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).