From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0E3A8139694 for ; Thu, 9 Mar 2017 09:51:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2FCBCE0B78; Thu, 9 Mar 2017 09:51:24 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 07326E0B78 for ; Thu, 9 Mar 2017 09:51:23 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B6F22341675 for ; Thu, 9 Mar 2017 09:51:22 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id DEE40620A for ; Thu, 9 Mar 2017 09:51:20 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1489003560.07b103582d883c60c9e547134c6169ea83ac52e0.ulm@gentoo> Subject: [gentoo-commits] proj/emacs-tools:ebuild-mode commit in: / X-VCS-Repository: proj/emacs-tools X-VCS-Files: ChangeLog gentoo-newsitem-mode.el X-VCS-Directories: / X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 07b103582d883c60c9e547134c6169ea83ac52e0 X-VCS-Branch: ebuild-mode Date: Thu, 9 Mar 2017 09:51:20 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: f3b7dbec-8ee3-44d5-9f94-95e1f76c3def X-Archives-Hash: 1a606b991bf5a4cddb53c71e7da788f5 commit: 07b103582d883c60c9e547134c6169ea83ac52e0 Author: Ulrich Müller gentoo org> AuthorDate: Wed Mar 8 20:06:00 2017 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Wed Mar 8 20:06:00 2017 +0000 URL: https://gitweb.gentoo.org/proj/emacs-tools.git/commit/?id=07b10358 Account for news item format 2.0. * gentoo-newsitem-mode.el (gentoo-newsitem-insert-skeleton): Account for news item format 2.0. (gentoo-newsitem-format-list): New variable. ChangeLog | 6 ++++++ gentoo-newsitem-mode.el | 22 ++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e847125..d03f1b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2017-03-08 Ulrich Müller + + * gentoo-newsitem-mode.el (gentoo-newsitem-insert-skeleton): + Account for news item format 2.0. + (gentoo-newsitem-format-list): New variable. + 2017-03-06 Ulrich Müller * Version 1.34 released. diff --git a/gentoo-newsitem-mode.el b/gentoo-newsitem-mode.el index 023fe79..27ce8d1 100644 --- a/gentoo-newsitem-mode.el +++ b/gentoo-newsitem-mode.el @@ -39,6 +39,10 @@ . font-lock-keyword-face))) "Expressions to highlight in Gentoo newsitem mode.") +(defvar gentoo-newsitem-format-list + '("1.0" "2.0") + "List of news item formats defined by GLEP 42.") + ;;;###autoload (define-derived-mode gentoo-newsitem-mode text-mode "Newsitem" "Major mode for Gentoo GLEP 42 news items." @@ -58,12 +62,26 @@ "Author: " str "\n") ((skeleton-read "Translator (null string to terminate): ") "Translator: " str "\n") - "Content-Type: text/plain\n" + ;;@ ; not supported in XEmacs 21.5 + (progn + (setq v2 (point-marker)) + nil) "Posted: " (skeleton-read "Date of posting: " (format-time-string "%Y-%m-%d")) "\n" "Revision: 1\n" - "News-Item-Format: 1.0\n" + "News-Item-Format: " + (setq v1 (completing-read + "News-Item-Format: " + (mapcar 'list gentoo-newsitem-format-list) nil 'confirm + nil nil (car (last gentoo-newsitem-format-list)))) + "\n" + (if (string-equal v1 "1.0") + (save-excursion + ;;(goto-char (car skeleton-positions)) + (goto-char v2) + (insert "Content-Type: text/plain\n") + nil)) ((skeleton-read "Display-If-Installed: (null string to terminate): ") "Display-If-Installed: " str "\n") ((skeleton-read "Display-If-Keyword: (null string to terminate): ")