From 3e1058cb3b60956f853cc6cb2524ba9c7e968277 Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Mon, 30 Sep 2024 09:39:30 +0300 Subject: [PATCH] Enable lexical binding in all .el files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstream Emacs has made lack of the directive a warning. So enable it explicitly everywhere. It provides various benefits such as better introspection by the compiler into the code and optimizations. Fixes a bunch of warnings: Error: file has no ‘lexical-binding’ directive on its first line --- purescript-align-imports.el | 2 +- purescript-collapse.el | 2 +- purescript-decl-scan.el | 2 +- purescript-font-lock.el | 2 +- purescript-indent.el | 2 +- purescript-indentation.el | 2 +- purescript-mode.el | 2 +- purescript-move-nested.el | 2 +- purescript-navigate-imports.el | 2 +- purescript-presentation-mode.el | 2 +- purescript-show.el | 2 +- purescript-simple-indent.el | 2 +- purescript-sort-imports.el | 2 +- purescript-str.el | 2 +- purescript-string.el | 1 + purescript-unicode-input-method.el | 2 +- purescript-utils.el | 2 +- purescript-yas.el | 2 +- tests/haskell-sort-imports-tests.el | 2 +- 19 files changed, 19 insertions(+), 18 deletions(-) diff --git a/purescript-align-imports.el b/purescript-align-imports.el index 56eabe2..5c36611 100644 --- a/purescript-align-imports.el +++ b/purescript-align-imports.el @@ -1,4 +1,4 @@ -;;; purescript-align-imports.el --- Align the import lines in a PureScript file +;;; purescript-align-imports.el --- Align the import lines in a PureScript file -*- lexical-binding: t -*- ;; Copyright (C) 2010 Chris Done diff --git a/purescript-collapse.el b/purescript-collapse.el index d6ddb92..e090644 100644 --- a/purescript-collapse.el +++ b/purescript-collapse.el @@ -1,4 +1,4 @@ -;;; purescript-collapse.el --- Collapse expressions +;;; purescript-collapse.el --- Collapse expressions -*- lexical-binding: t -*- ;; Copyright (c) 2014 Chris Done. All rights reserved. diff --git a/purescript-decl-scan.el b/purescript-decl-scan.el index f588cba..b3b61ed 100644 --- a/purescript-decl-scan.el +++ b/purescript-decl-scan.el @@ -1,4 +1,4 @@ -;;; purescript-decl-scan.el --- Declaration scanning module for PureScript Mode +;;; purescript-decl-scan.el --- Declaration scanning module for PureScript Mode -*- lexical-binding: t -*- ;; Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. ;; Copyright (C) 1997-1998 Graeme E Moss diff --git a/purescript-font-lock.el b/purescript-font-lock.el index 812f9b1..85d4b7d 100644 --- a/purescript-font-lock.el +++ b/purescript-font-lock.el @@ -1,4 +1,4 @@ -;;; purescript-font-lock.el --- Font locking module for PureScript Mode +;;; purescript-font-lock.el --- Font locking module for PureScript Mode -*- lexical-binding: t -*- ;; Copyright 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. ;; Copyright 1997-1998 Graeme E Moss, and Tommy Thorn diff --git a/purescript-indent.el b/purescript-indent.el index 68119bb..5b087f4 100644 --- a/purescript-indent.el +++ b/purescript-indent.el @@ -1,4 +1,4 @@ -;;; purescript-indent.el --- "semi-intelligent" indentation module for PureScript Mode +;;; purescript-indent.el --- "semi-intelligent" indentation module for PureScript Mode -*- lexical-binding: t -*- ;; Copyright 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. ;; Copyright 1997-1998 Guy Lapalme diff --git a/purescript-indentation.el b/purescript-indentation.el index 5f8cea3..52c849b 100644 --- a/purescript-indentation.el +++ b/purescript-indentation.el @@ -1,4 +1,4 @@ -;;; purescript-indentation.el -- indentation module for PureScript Mode -*- lexical-binding: t -*- +;;; purescript-indentation.el -- indentation module for PureScript Mode -*- lexical-binding: t -*- -*- lexical-binding: t -*- ;; Copyright (C) 2009 Kristof Bastiaensen diff --git a/purescript-mode.el b/purescript-mode.el index 5609810..205c67e 100644 --- a/purescript-mode.el +++ b/purescript-mode.el @@ -1,4 +1,4 @@ -;;; purescript-mode.el --- A PureScript editing mode -*- coding: utf-8 -*- +;;; purescript-mode.el --- A PureScript editing mode -*- coding: utf-8 lexical-binding: t -*- ;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc ;; Copyright (C) 1992, 1997-1998 Simon Marlow, Graeme E Moss, and Tommy Thorn diff --git a/purescript-move-nested.el b/purescript-move-nested.el index dc5e26a..98a2f6d 100644 --- a/purescript-move-nested.el +++ b/purescript-move-nested.el @@ -1,4 +1,4 @@ -;;; purescript-move-nested.el --- Change the column of text nested below a line +;;; purescript-move-nested.el --- Change the column of text nested below a line -*- lexical-binding: t -*- ;; Copyright (C) 2010 Chris Done diff --git a/purescript-navigate-imports.el b/purescript-navigate-imports.el index 0c4c806..749f8ad 100644 --- a/purescript-navigate-imports.el +++ b/purescript-navigate-imports.el @@ -1,4 +1,4 @@ -;;; purescript-navigate-imports.el --- A function for cycling through PureScript import lists +;;; purescript-navigate-imports.el --- A function for cycling through PureScript import lists -*- lexical-binding: t -*- ;; Copyright (C) 2010 Chris Done diff --git a/purescript-presentation-mode.el b/purescript-presentation-mode.el index 54c3c33..1a8fa9b 100644 --- a/purescript-presentation-mode.el +++ b/purescript-presentation-mode.el @@ -1,4 +1,4 @@ -;;; purescript-presentation-mode.el --- Presenting PureScript things +;;; purescript-presentation-mode.el --- Presenting PureScript things -*- lexical-binding: t -*- ;; Copyright (C) 2013 Chris Done diff --git a/purescript-show.el b/purescript-show.el index 63a6d97..f380329 100644 --- a/purescript-show.el +++ b/purescript-show.el @@ -1,4 +1,4 @@ -;;; purescript-show.el --- A pretty printer for PureScript Show values +;;; purescript-show.el --- A pretty printer for PureScript Show values -*- lexical-binding: t -*- ;; Copyright (C) 2011 Chris Done diff --git a/purescript-simple-indent.el b/purescript-simple-indent.el index 2690f0c..5c0cf5e 100644 --- a/purescript-simple-indent.el +++ b/purescript-simple-indent.el @@ -1,4 +1,4 @@ -;;; purescript-simple-indent.el --- Simple indentation module for PureScript Mode +;;; purescript-simple-indent.el --- Simple indentation module for PureScript Mode -*- lexical-binding: t -*- ;; Copyright (C) 1998 Heribert Schuetz, Graeme E Moss diff --git a/purescript-sort-imports.el b/purescript-sort-imports.el index a1374ca..c635ada 100644 --- a/purescript-sort-imports.el +++ b/purescript-sort-imports.el @@ -1,4 +1,4 @@ -;;; purescript-sort-imports.el --- Sort the list of PureScript imports at the point alphabetically +;;; purescript-sort-imports.el --- Sort the list of PureScript imports at the point alphabetically -*- lexical-binding: t -*- ;; Copyright (C) 2010 Chris Done diff --git a/purescript-str.el b/purescript-str.el index 6e960d0..8f6c3a3 100644 --- a/purescript-str.el +++ b/purescript-str.el @@ -1,4 +1,4 @@ -;;; purescript-str.el --- PureScript related string utilities +;;; purescript-str.el --- PureScript related string utilities -*- lexical-binding: t -*- ;; Copyright (C) 2013 Herbert Valerio Riedel diff --git a/purescript-string.el b/purescript-string.el index b8a74af..23af498 100644 --- a/purescript-string.el +++ b/purescript-string.el @@ -1,3 +1,4 @@ +;;; purescript-string.el --- string manipulation utilties -*- lexical-binding: t -*- ;;;###autoload (defun purescript-trim (string) (replace-regexp-in-string diff --git a/purescript-unicode-input-method.el b/purescript-unicode-input-method.el index 15cc7a0..da5f521 100644 --- a/purescript-unicode-input-method.el +++ b/purescript-unicode-input-method.el @@ -1,4 +1,4 @@ -;;; purescript-unicode-input-method.el --- PureScript Unicode helper functions -*- coding: utf-8 -*- +;;; purescript-unicode-input-method.el --- PureScript Unicode helper functions -*- coding: utf-8 lexical-binding: t -*- ;; Copyright (C) 2010-2011 Roel van Dijk diff --git a/purescript-utils.el b/purescript-utils.el index 294dcfb..5651e87 100644 --- a/purescript-utils.el +++ b/purescript-utils.el @@ -1,4 +1,4 @@ -;;; purescript-utils.el --- General utility functions used by purescript-mode modules +;;; purescript-utils.el --- General utility functions used by purescript-mode modules -*- lexical-binding: t -*- ;; Copyright (C) 2013 Herbert Valerio Riedel diff --git a/purescript-yas.el b/purescript-yas.el index 08339ef..a531e73 100644 --- a/purescript-yas.el +++ b/purescript-yas.el @@ -1,4 +1,4 @@ -;;; purescript-yas.el --- Customization support for Luke Hoersten's yasnippets +;;; purescript-yas.el --- Customization support for Luke Hoersten's yasnippets -*- lexical-binding: t -*- ;; Copyright (C) 2013 John Wiegley, Luke Hoersten diff --git a/tests/haskell-sort-imports-tests.el b/tests/haskell-sort-imports-tests.el index 656bdd0..7670fb2 100644 --- a/tests/haskell-sort-imports-tests.el +++ b/tests/haskell-sort-imports-tests.el @@ -1,4 +1,4 @@ -;;; purescript-sort-imports-tests.el --- Unit tests for purescript-sort-imports +;;; purescript-sort-imports-tests.el --- Unit tests for purescript-sort-imports -*- lexical-binding: t -*- ;; Copyright (c) 2014 Chris Done. All rights reserved.