Gnus development mailing list
 help / color / mirror / Atom feed
From: Simon Josefsson <jas@extundo.com>
Subject: Re: ":version" entries in defcustoms
Date: Mon, 20 Sep 2004 19:18:14 +0200	[thread overview]
Message-ID: <iluvfe8svu1.fsf@latte.josefsson.org> (raw)
In-Reply-To: <v94qlsc2tc.fsf@marauder.physik.uni-ulm.de>

Reiner Steib <4.uce.03.r.s@nurfuerspam.de> writes:

> Could someone add the versions in (some of) the news files or better
> write some function to do this semi-automatically.  ;-)

How about this?

;;; versionfix.el --- Add :version cookies to defcustom without them.
;; Copyright (C) 2004 Free Software Foundation, Inc.

;; Author: Simon Josefsson
;; Keywords: custom

;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this file; see the file COPYING.  If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.

;;; Commentary:

;;; Code:

(defun version-fix (version)
  (interactive "sVersion: ")
  (goto-char (point-min))
  (let (a b)
    (while (and (setq a (re-search-forward "^(defcustom" nil t))
		(setq b (progn (goto-char (match-beginning 0))
			       (forward-sexp)
			       (point))))
      (save-restriction
	(narrow-to-region a b)
	(goto-char (point-min))
	(unless (re-search-forward ":version \"[0-9.]+\"" nil t)
	  (goto-char (point-min))
	  (if (re-search-forward ":group" nil t)
	      (goto-char (match-beginning 0))
	    (goto-char (1- (point-max))))
	  (insert (format ":version \"%s\"\n  " version)))))))

;; versionfix.el ends here




      reply	other threads:[~2004-09-20 17:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-19 20:26 Reiner Steib
2004-09-19 22:29 ` Simon Josefsson
2004-09-19 23:02   ` Miles Bader
2004-09-20 16:39     ` Reiner Steib
2004-09-20 17:18       ` Simon Josefsson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=iluvfe8svu1.fsf@latte.josefsson.org \
    --to=jas@extundo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).