branch: externals/sql-indent
commit c3d49c6b643a0d2dbaa88d3aa225babce339d654
Author: Stefan Monnier <[email protected]>
Commit: Stefan Monnier <[email protected]>

    Fix up copyrights for GNU ELPA, plus minor tweaks
    
    * .gitignore: Add -autoloads and -pkg files.
    
    * sql-indent-test.el, sql-indent-left.el: Fix copyright header.
    
    * sql-indent.el: Fix copyright header.  Don't require `align`.
    (sqlind-minor-mode-map): New keymap.
    (sqlind-minor-mode): Don't modify sql-mode's keymap.
    Use kill-local-variable.
---
 .gitignore         |  2 ++
 sql-indent-left.el | 18 ++++++++++++++++--
 sql-indent-test.el | 12 ++++++------
 sql-indent.el      | 44 +++++++++++++++++++++++---------------------
 4 files changed, 47 insertions(+), 29 deletions(-)

diff --git a/.gitignore b/.gitignore
index ebfeb42..66d946e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,6 @@
 # -*- mode: conf -*-
+sql-indent-autoloads.el
+sql-indent-pkg.el
 *.elc
 *~
 \#*\#
diff --git a/sql-indent-left.el b/sql-indent-left.el
index 961fd60..a326964 100644
--- a/sql-indent-left.el
+++ b/sql-indent-left.el
@@ -1,10 +1,11 @@
 ;;; sql-indent-left.el --- configuration options to indent sql -*- 
lexical-binding: t -*-
-;;
+
+;; Copyright (C) 2017  Free Software Foundation, Inc
+
 ;; Filename: sql-indent-left.el
 ;; Description:
 ;; Author: [email protected]
 ;; Maintainer: [email protected]
-;; Copyright (C) 2017, Pierre Téchoueyres all rights reserved.
 ;; Created:
 ;; Version: [email protected]
 ;; Last-Updated:
@@ -17,7 +18,20 @@
 ;; Features that might be required by this library:
 ;;
 ;;   None
+
+;; This program 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 3 of the License, or
+;; (at your option) any later version.
 ;;
+;; This program 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 GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;
 ;;; Commentary:
diff --git a/sql-indent-test.el b/sql-indent-test.el
index 7c4a7ba..6bcc345 100644
--- a/sql-indent-test.el
+++ b/sql-indent-test.el
@@ -1,14 +1,15 @@
 ;;; sql-indent-test.el --- Automated tests for sql-indent.el. -*- 
lexical-binding: t -*-
-;; Copyright (C) 2017 Alex Harsanyi
-;;
+
+;; Copyright (C) 2017  Free Software Foundation, Inc
+
 ;; Author: Alex Harsanyi ([email protected])
 ;; Created: 23 May 2017
 ;; Keywords: languages sql
 ;; Homepage: https://github.com/alex-hhh/emacs-sql-indent
-;;
+
 ;; This program 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 of the License, or
+;; the Free Software Foundation; either version 3 of the License, or
 ;; (at your option) any later version.
 ;;
 ;; This program is distributed in the hope that it will be useful,
@@ -17,8 +18,7 @@
 ;; GNU General Public License for more details.
 ;;
 ;; You should have received a copy of the GNU General Public License
-;; along with this program; if not, write to the Free Software
-;; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
diff --git a/sql-indent.el b/sql-indent.el
index ec5bf3a..172c31b 100644
--- a/sql-indent.el
+++ b/sql-indent.el
@@ -1,6 +1,7 @@
 ;;; sql-indent.el --- Support for indenting code in SQL files. -*- 
lexical-binding: t -*-
-;; Copyright (C) 2015 Alex Harsanyi
-;;
+
+;; Copyright (C) 2015, 2017  Free Software Foundation, Inc
+
 ;; Author: Alex Harsanyi ([email protected])
 ;; Created: 27 Sep 2006
 ;; Version: 1.0
@@ -9,7 +10,7 @@
 ;;
 ;; This program 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 of the License, or
+;; the Free Software Foundation; either version 3 of the License, or
 ;; (at your option) any later version.
 ;;
 ;; This program is distributed in the hope that it will be useful,
@@ -18,8 +19,7 @@
 ;; GNU General Public License for more details.
 ;;
 ;; You should have received a copy of the GNU General Public License
-;; along with this program; if not, write to the Free Software
-;; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 ;;
@@ -40,7 +40,6 @@
 ;;; Code:
 
 (require 'sql)
-(require 'align)
 (require 'cl-lib)
 (eval-when-compile (require 'cc-defs))  ; for c-point
 
@@ -2171,6 +2170,13 @@ See also `align' and `align-rules-list'")
 
 ;;;; sqlind-minor-mode, sqlind-setup
 
+(defvar sqlind-minor-mode-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map [remap beginning-of-defun] 'sqlind-beginning-of-statement)
+    map))
+
+(defvar align-mode-rules-list)
+
 ;;;###autoload
 (define-minor-mode sqlind-minor-mode
     "Toggle SQL syntactic indentation on or off.
@@ -2183,19 +2189,16 @@ Selecting a region of text and typing `M-x align RET` 
will align
 the statements.  This can be used, for example, to align the 'as'
 column aliases in select statements."
   :lighter " sqlind"
-  :group 'sqlind
+  ;; :group 'sqlind  ;;FIXME: There's no such group!
   :global nil
   :init-value nil
-  (make-local-variable 'indent-line-function)
   (if sqlind-minor-mode
       (progn
-        (setq indent-line-function 'sqlind-indent-line)
-        (define-key sql-mode-map [remap beginning-of-defun] 
'sqlind-beginning-of-statement)
-        (setq align-mode-rules-list sqlind-align-rules))
+        (set (make-local-variable 'indent-line-function) #'sqlind-indent-line)
+        (set (make-local-variable 'align-mode-rules-list) sqlind-align-rules))
     (progn
-      (setq indent-line-function (default-value 'indent-line-function))
-      (define-key sql-mode-map [remap beginning-of-defun] 
'sql-beginning-of-statement)
-      (setq align-mode-rules-list nil))))
+      (kill-local-variable 'indent-line-function)
+      (kill-local-variable 'align-mode-rules-list))))
 
 ;;;###autoload
 (defun sqlind-setup ()
@@ -2206,12 +2209,11 @@ This function is deprecated, consider using the function
   (define-key sql-mode-map [remap beginning-of-defun] 
'sqlind-beginning-of-statement)
   (setq align-mode-rules-list sqlind-align-rules))
 
-(provide 'sql-indent)
-
-;;; Local Variables:
-;;; mode: emacs-lisp
-;;; mode: outline-minor
-;;; outline-regexp: ";;;;+"
-;;; End:
+;; Local Variables:
+;; mode: emacs-lisp
+;; mode: outline-minor
+;; outline-regexp: ";;;;+"
+;; End:
 
+(provide 'sql-indent)
 ;;; sql-indent.el ends here

Reply via email to