Changes committed gnus/lisp (ChangeLog dns-mode.el rfc2047.el)

"Katsumi Yamaoka" <[email protected]> Fri, 29 May 2009 01:16:51 +0200
Newsgroups gmane.emacs.gnus.commits
Message-ID <[email protected]>
Modified: ChangeLog dns-mode.el rfc2047.el

Synch with Emacs trunk.
=======================
2009-04-20  Stefan Monnier  <[email protected]>

	* 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  <[email protected]>

	* 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'.

2005-05-27  Lute Kamstra  <[email protected]>

	* textmodes/dns-mode.el (dns-mode): Specify customization group.


Index: ChangeLog
diff -u gnus/lisp/ChangeLog:7.1993 gnus/lisp/ChangeLog:7.1994
--- ChangeLog:7.1993	Tue Apr 28 19:02:36 2009
+++ ChangeLog	Fri May 29 01:16:51 2009
@@ -3,6 +3,11 @@
 	* spam.el: Use dns-query instead of query-dns.  Was renamed on
 	2008-12-25 in dns.el.
 
+2009-04-20  Stefan Monnier  <[email protected]>
+
+	* rfc2047.el (rfc2047-decode-region): Don't skip past `start', which
+	could happen if the text is only composed of spaces and/or tabs.
+
 2009-03-03  Brian Sniffen  <[email protected]>  (tiny change)
 
 	* gnus-draft.el (gnus-draft-send): Bind gnus-message-setup-hook to nil
@@ -4841,6 +4846,13 @@
 	* mm-extern.el (mm-extern-mail-server): End `y-or-n-p' prompt with a
 	space.
 
+2006-08-10  Romain Francoise  <[email protected]>
+
+	* 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'.
+
 2006-08-09  Katsumi Yamaoka  <[email protected]>
 
 	* compface.el (uncompface): Use binary rather than raw-text-unix.
@@ -8788,6 +8800,10 @@
 	* dgnushack.el: Advise byte-optimize-form-code-walker to avoid the
 	``...called for effect'' warnings for Emacs 21.4 as well as 21.3.
 
+2005-05-27  Lute Kamstra  <[email protected]>
+
+	* textmodes/dns-mode.el (dns-mode): Specify customization group.
+
 2005-05-26  Luc Teirlinck  <[email protected]>
 
 	* gnus-agent.el (gnus-agent-make-mode-line-string):
Index: dns-mode.el
diff -u gnus/lisp/dns-mode.el:7.12 gnus/lisp/dns-mode.el:7.13
--- dns-mode.el:7.12	Thu Jan 22 08:02:15 2009
+++ dns-mode.el	Fri May 29 01:16:51 2009
@@ -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)
Index: rfc2047.el
diff -u gnus/lisp/rfc2047.el:7.74 gnus/lisp/rfc2047.el:7.75
--- rfc2047.el:7.74	Thu Jan 22 08:02:15 2009
+++ rfc2047.el	Fri May 29 01:16:51 2009
@@ -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) ?\")))