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 7B8BB139694 for ; Tue, 28 Feb 2017 19:24:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 30D43E0D2C; Tue, 28 Feb 2017 19:23:11 +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 EF9BCE0D2C for ; Tue, 28 Feb 2017 19:23:10 +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 DFC3134162B for ; Tue, 28 Feb 2017 19:23:09 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6A20157D9 for ; Tue, 28 Feb 2017 19:23:06 +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: <1488232687.6d7464806738628ad29b18daa796366e462897f3.ulm@gentoo> Subject: [gentoo-commits] proj/emacs-tools:ebuild-mode commit in: / X-VCS-Repository: proj/emacs-tools X-VCS-Files: ChangeLog ebuild-mode.el X-VCS-Directories: / X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 6d7464806738628ad29b18daa796366e462897f3 X-VCS-Branch: ebuild-mode Date: Tue, 28 Feb 2017 19:23:06 +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: 0c91036c-0c45-435a-a9b2-2733c43d4bc0 X-Archives-Hash: 387597944a719f4af25a0368bf02dd46 commit: 6d7464806738628ad29b18daa796366e462897f3 Author: Ulrich Müller gentoo org> AuthorDate: Mon Feb 27 21:58:07 2017 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Mon Feb 27 21:58:07 2017 +0000 URL: https://gitweb.gentoo.org/proj/emacs-tools.git/commit/?id=6d746480 Make fixing of whitespace before saving conditional. * ebuild-mode.el (ebuild-mode): New customisation group. (ebuild-mode-portdir): Change to custom variable. (ebuild-mode-fix-whitespace): New custom variable, defaults to t. (ebuild-mode-before-save): Make fixing of whitespace conditional. ChangeLog | 5 +++++ ebuild-mode.el | 26 ++++++++++++++++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index fe1ced8..285118d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2017-02-27 Ulrich Müller + * ebuild-mode.el (ebuild-mode): New customisation group. + (ebuild-mode-portdir): Change to custom variable. + (ebuild-mode-fix-whitespace): New custom variable, defaults to t. + (ebuild-mode-before-save): Make fixing of whitespace conditional. + * ebuild-mode.el: * ebuild-mode.texi: Update documentation to use generic terms where possible, instead of being Portage specific. diff --git a/ebuild-mode.el b/ebuild-mode.el index 3f3e0fe..85491f8 100644 --- a/ebuild-mode.el +++ b/ebuild-mode.el @@ -59,6 +59,23 @@ A formfeed is not considered whitespace by this function." ;;; Variables. +(defgroup ebuild-mode nil + "Ebuild mode." + :group 'languages) + +(defcustom ebuild-mode-portdir + "/usr/portage" + "Location of the ebuild repository." + :type 'string + :group 'ebuild-mode) + +(defcustom ebuild-mode-fix-whitespace t + "If non-nil, fix whitespace before writing a file. +Namely, delete trailing whitespace and tabify whitespace at beginning +of lines." + :type 'boolean + :group 'ebuild-mode) + ;; Predicate function for comparison of architecture keywords ;; (needed for variable definitions below) (defun ebuild-mode-arch-lessp (a b) @@ -71,10 +88,6 @@ A formfeed is not considered whitespace by this function." (string-lessp (car as) (car bs)) (string-lessp (cadr as) (cadr bs))))) -(defvar ebuild-mode-portdir - "/usr/portage" - "Location of the ebuild repository.") - (defvar ebuild-mode-arch-list (or (condition-case nil @@ -220,8 +233,9 @@ Optional argument LIMIT restarts collection after that number of elements." (indent-to end-col))))))) (defun ebuild-mode-before-save () - (delete-trailing-whitespace) - (ebuild-mode-tabify) + (when ebuild-mode-fix-whitespace + (delete-trailing-whitespace) + (ebuild-mode-tabify)) ;;(copyright-update) ; doesn't exist in XEmacs ;; return nil, otherwise the file is presumed to be written nil)