1 |
commit: 07b103582d883c60c9e547134c6169ea83ac52e0 |
2 |
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Mar 8 20:06:00 2017 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Mar 8 20:06:00 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/emacs-tools.git/commit/?id=07b10358 |
7 |
|
8 |
Account for news item format 2.0. |
9 |
|
10 |
* gentoo-newsitem-mode.el (gentoo-newsitem-insert-skeleton): |
11 |
Account for news item format 2.0. |
12 |
(gentoo-newsitem-format-list): New variable. |
13 |
|
14 |
ChangeLog | 6 ++++++ |
15 |
gentoo-newsitem-mode.el | 22 ++++++++++++++++++++-- |
16 |
2 files changed, 26 insertions(+), 2 deletions(-) |
17 |
|
18 |
diff --git a/ChangeLog b/ChangeLog |
19 |
index e847125..d03f1b4 100644 |
20 |
--- a/ChangeLog |
21 |
+++ b/ChangeLog |
22 |
@@ -1,3 +1,9 @@ |
23 |
+2017-03-08 Ulrich Müller <ulm@g.o> |
24 |
+ |
25 |
+ * gentoo-newsitem-mode.el (gentoo-newsitem-insert-skeleton): |
26 |
+ Account for news item format 2.0. |
27 |
+ (gentoo-newsitem-format-list): New variable. |
28 |
+ |
29 |
2017-03-06 Ulrich Müller <ulm@g.o> |
30 |
|
31 |
* Version 1.34 released. |
32 |
|
33 |
diff --git a/gentoo-newsitem-mode.el b/gentoo-newsitem-mode.el |
34 |
index 023fe79..27ce8d1 100644 |
35 |
--- a/gentoo-newsitem-mode.el |
36 |
+++ b/gentoo-newsitem-mode.el |
37 |
@@ -39,6 +39,10 @@ |
38 |
. font-lock-keyword-face))) |
39 |
"Expressions to highlight in Gentoo newsitem mode.") |
40 |
|
41 |
+(defvar gentoo-newsitem-format-list |
42 |
+ '("1.0" "2.0") |
43 |
+ "List of news item formats defined by GLEP 42.") |
44 |
+ |
45 |
;;;###autoload |
46 |
(define-derived-mode gentoo-newsitem-mode text-mode "Newsitem" |
47 |
"Major mode for Gentoo GLEP 42 news items." |
48 |
@@ -58,12 +62,26 @@ |
49 |
"Author: " str "\n") |
50 |
((skeleton-read "Translator (null string to terminate): ") |
51 |
"Translator: " str "\n") |
52 |
- "Content-Type: text/plain\n" |
53 |
+ ;;@ ; not supported in XEmacs 21.5 |
54 |
+ (progn |
55 |
+ (setq v2 (point-marker)) |
56 |
+ nil) |
57 |
"Posted: " (skeleton-read "Date of posting: " |
58 |
(format-time-string "%Y-%m-%d")) |
59 |
"\n" |
60 |
"Revision: 1\n" |
61 |
- "News-Item-Format: 1.0\n" |
62 |
+ "News-Item-Format: " |
63 |
+ (setq v1 (completing-read |
64 |
+ "News-Item-Format: " |
65 |
+ (mapcar 'list gentoo-newsitem-format-list) nil 'confirm |
66 |
+ nil nil (car (last gentoo-newsitem-format-list)))) |
67 |
+ "\n" |
68 |
+ (if (string-equal v1 "1.0") |
69 |
+ (save-excursion |
70 |
+ ;;(goto-char (car skeleton-positions)) |
71 |
+ (goto-char v2) |
72 |
+ (insert "Content-Type: text/plain\n") |
73 |
+ nil)) |
74 |
((skeleton-read "Display-If-Installed: (null string to terminate): ") |
75 |
"Display-If-Installed: " str "\n") |
76 |
((skeleton-read "Display-If-Keyword: (null string to terminate): ") |