Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/emacs-tools:ebuild-mode commit in: /
Date: Sun, 05 Mar 2017 17:51:48
Message-Id: 1488665020.f642f71894e5cc98063083713606b1655d2e8434.ulm@gentoo
1 commit: f642f71894e5cc98063083713606b1655d2e8434
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Sat Mar 4 22:03:40 2017 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Sat Mar 4 22:03:40 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/emacs-tools.git/commit/?id=f642f718
7
8 Default to most recent EAPI in ebuild skeleton.
9
10 * ebuild-mode.el (ebuild-mode-eapi-list): New custom variable.
11 (ebuild-mode-insert-skeleton): Use it in a completing-read.
12
13 ChangeLog | 3 +++
14 ebuild-mode.el | 15 ++++++++++++---
15 2 files changed, 15 insertions(+), 3 deletions(-)
16
17 diff --git a/ChangeLog b/ChangeLog
18 index 63838a4..845283e 100644
19 --- a/ChangeLog
20 +++ b/ChangeLog
21 @@ -1,5 +1,8 @@
22 2017-03-04 Ulrich Müller <ulm@g.o>
23
24 + * ebuild-mode.el (ebuild-mode-eapi-list): New custom variable.
25 + (ebuild-mode-insert-skeleton): Use it in a completing-read.
26 +
27 * ebuild-mode.el (ebuild-mode-protocols-homepage)
28 (ebuild-mode-protocols-src_uri): New variables.
29 (ebuild-mode-insert-skeleton): Add https:// to completions
30
31 diff --git a/ebuild-mode.el b/ebuild-mode.el
32 index 3e00080..7b927e6 100644
33 --- a/ebuild-mode.el
34 +++ b/ebuild-mode.el
35 @@ -69,6 +69,13 @@ A formfeed is not considered whitespace by this function."
36 :type 'string
37 :group 'ebuild-mode)
38
39 +(defcustom ebuild-mode-eapi-list
40 + '("5" "6")
41 + "List of supported EAPIs.
42 +The most recent EAPI must be listed last."
43 + :type '(repeat string)
44 + :group 'ebuild-mode)
45 +
46 (defcustom ebuild-mode-fix-whitespace t
47 "If non-nil, fix whitespace before writing a file.
48 Namely, delete trailing whitespace and tabify whitespace at beginning
49 @@ -465,10 +472,12 @@ and `all-completions' for details."
50 "# Copyright 1999-" (format-time-string "%Y") " Gentoo Foundation\n"
51 "# Distributed under the terms of the GNU General Public License v2\n"
52 "\n"
53 - ;; EAPI
54 "EAPI="
55 - (skeleton-read "EAPI: ")
56 - & "\n\n" | -5
57 + (completing-read
58 + "EAPI: " (mapcar 'list ebuild-mode-eapi-list)
59 + nil nil (car (last ebuild-mode-eapi-list))) ; default to most recent EAPI
60 + "\n"
61 + "\n"
62 ;; inherited eclasses
63 "inherit "
64 ((completing-read "Eclass (null string to terminate): "