diff options
| author | Simen Heggestøyl | 2020-05-10 16:17:27 +0200 |
|---|---|---|
| committer | Simen Heggestøyl | 2020-05-10 17:18:03 +0200 |
| commit | 8f808be68bfab51fe282e7ee2f6bc8c28bf7a442 (patch) | |
| tree | 8cf425abaf74b14f150186dad8991e03dc65f661 /lisp | |
| parent | 1efaa1d66b9bc51284c7cac4477f45c9bde4fcfb (diff) | |
| download | emacs-8f808be68bfab51fe282e7ee2f6bc8c28bf7a442.tar.gz emacs-8f808be68bfab51fe282e7ee2f6bc8c28bf7a442.zip | |
Use lexical-binding in glasses.el and add tests
* lisp/progmodes/glasses.el: Use lexical-binding.
(glasses-separator, glasses-original-separator, glasses-face)
(glasses-separate-parentheses-p)
(glasses-separate-parentheses-exceptions)
(glasses-separate-capital-groups, glasses-uncapitalize-p)
(glasses-uncapitalize-regexp, glasses-convert-on-write-p): Remove
redundant :group args.
* test/lisp/progmodes/glasses-tests.el: New file with tests for
glasses.el.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/progmodes/glasses.el | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/lisp/progmodes/glasses.el b/lisp/progmodes/glasses.el index cad74f9f63a..ab65a1590c0 100644 --- a/lisp/progmodes/glasses.el +++ b/lisp/progmodes/glasses.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; glasses.el --- make cantReadThis readable | 1 | ;;; glasses.el --- make cantReadThis readable -*- lexical-binding: t; -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1999-2020 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1999-2020 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -66,7 +66,6 @@ defined by `glasses-original-separator'. If you don't want to add missing | |||
| 66 | separators, set `glasses-separator' to an empty string. If you don't want to | 66 | separators, set `glasses-separator' to an empty string. If you don't want to |
| 67 | replace existent separators, set `glasses-original-separator' to an empty | 67 | replace existent separators, set `glasses-original-separator' to an empty |
| 68 | string." | 68 | string." |
| 69 | :group 'glasses | ||
| 70 | :type 'string | 69 | :type 'string |
| 71 | :set 'glasses-custom-set | 70 | :set 'glasses-custom-set |
| 72 | :initialize 'custom-initialize-default) | 71 | :initialize 'custom-initialize-default) |
| @@ -78,7 +77,6 @@ For instance, if you set it to \"_\" and set `glasses-separator' to \"-\", | |||
| 78 | underscore separators are displayed as hyphens. | 77 | underscore separators are displayed as hyphens. |
| 79 | If `glasses-original-separator' is an empty string, no such display change is | 78 | If `glasses-original-separator' is an empty string, no such display change is |
| 80 | performed." | 79 | performed." |
| 81 | :group 'glasses | ||
| 82 | :type 'string | 80 | :type 'string |
| 83 | :set 'glasses-custom-set | 81 | :set 'glasses-custom-set |
| 84 | :initialize 'custom-initialize-default | 82 | :initialize 'custom-initialize-default |
| @@ -92,7 +90,6 @@ If it is nil, no face is placed at the capitalized letter. | |||
| 92 | For example, you can set `glasses-separator' to an empty string and | 90 | For example, you can set `glasses-separator' to an empty string and |
| 93 | `glasses-face' to `bold'. Then unreadable identifiers will have no separators, | 91 | `glasses-face' to `bold'. Then unreadable identifiers will have no separators, |
| 94 | but will have their capitals in bold." | 92 | but will have their capitals in bold." |
| 95 | :group 'glasses | ||
| 96 | :type '(choice (const :tag "None" nil) face) | 93 | :type '(choice (const :tag "None" nil) face) |
| 97 | :set 'glasses-custom-set | 94 | :set 'glasses-custom-set |
| 98 | :initialize 'custom-initialize-default) | 95 | :initialize 'custom-initialize-default) |
| @@ -100,7 +97,6 @@ but will have their capitals in bold." | |||
| 100 | 97 | ||
| 101 | (defcustom glasses-separate-parentheses-p t | 98 | (defcustom glasses-separate-parentheses-p t |
| 102 | "If non-nil, ensure space between an identifier and an opening parenthesis." | 99 | "If non-nil, ensure space between an identifier and an opening parenthesis." |
| 103 | :group 'glasses | ||
| 104 | :type 'boolean) | 100 | :type 'boolean) |
| 105 | 101 | ||
| 106 | (defcustom glasses-separate-parentheses-exceptions | 102 | (defcustom glasses-separate-parentheses-exceptions |
| @@ -108,7 +104,6 @@ but will have their capitals in bold." | |||
| 108 | "List of regexp that are exceptions for `glasses-separate-parentheses-p'. | 104 | "List of regexp that are exceptions for `glasses-separate-parentheses-p'. |
| 109 | They are matched to the current line truncated to the point where the | 105 | They are matched to the current line truncated to the point where the |
| 110 | parenthesis expression starts." | 106 | parenthesis expression starts." |
| 111 | :group 'glasses | ||
| 112 | :type '(repeat regexp)) | 107 | :type '(repeat regexp)) |
| 113 | 108 | ||
| 114 | (defcustom glasses-separate-capital-groups t | 109 | (defcustom glasses-separate-capital-groups t |
| @@ -116,7 +111,6 @@ parenthesis expression starts." | |||
| 116 | When the value is non-nil, HTMLSomething and IPv6 are displayed | 111 | When the value is non-nil, HTMLSomething and IPv6 are displayed |
| 117 | as HTML_Something and I_Pv6 respectively. Set the value to nil | 112 | as HTML_Something and I_Pv6 respectively. Set the value to nil |
| 118 | if you prefer to display them unchanged." | 113 | if you prefer to display them unchanged." |
| 119 | :group 'glasses | ||
| 120 | :type 'boolean | 114 | :type 'boolean |
| 121 | :version "24.1") | 115 | :version "24.1") |
| 122 | 116 | ||
| @@ -124,7 +118,6 @@ if you prefer to display them unchanged." | |||
| 124 | "If non-nil, downcase embedded capital letters in identifiers. | 118 | "If non-nil, downcase embedded capital letters in identifiers. |
| 125 | Only identifiers starting with lower case letters are affected, letters inside | 119 | Only identifiers starting with lower case letters are affected, letters inside |
| 126 | other identifiers are unchanged." | 120 | other identifiers are unchanged." |
| 127 | :group 'glasses | ||
| 128 | :type 'boolean | 121 | :type 'boolean |
| 129 | :set 'glasses-custom-set | 122 | :set 'glasses-custom-set |
| 130 | :initialize 'custom-initialize-default) | 123 | :initialize 'custom-initialize-default) |
| @@ -135,7 +128,6 @@ other identifiers are unchanged." | |||
| 135 | Only words starting with this regexp are uncapitalized. | 128 | Only words starting with this regexp are uncapitalized. |
| 136 | The regexp is case sensitive. | 129 | The regexp is case sensitive. |
| 137 | It has any effect only when `glasses-uncapitalize-p' is non-nil." | 130 | It has any effect only when `glasses-uncapitalize-p' is non-nil." |
| 138 | :group 'glasses | ||
| 139 | :type 'regexp | 131 | :type 'regexp |
| 140 | :set 'glasses-custom-set | 132 | :set 'glasses-custom-set |
| 141 | :initialize 'custom-initialize-default) | 133 | :initialize 'custom-initialize-default) |
| @@ -149,7 +141,6 @@ file write then. | |||
| 149 | 141 | ||
| 150 | Note the removal action does not try to be much clever, so it can remove real | 142 | Note the removal action does not try to be much clever, so it can remove real |
| 151 | separators too." | 143 | separators too." |
| 152 | :group 'glasses | ||
| 153 | :type 'boolean) | 144 | :type 'boolean) |
| 154 | 145 | ||
| 155 | 146 | ||