aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/lisp-mnt.el36
1 files changed, 15 insertions, 21 deletions
diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el
index 127d71ae6ca..5c623a3ab8c 100644
--- a/lisp/emacs-lisp/lisp-mnt.el
+++ b/lisp/emacs-lisp/lisp-mnt.el
@@ -1,4 +1,4 @@
1;;; lisp-mnt.el --- utility functions for Emacs Lisp maintainers 1;;; lisp-mnt.el --- utility functions for Emacs Lisp maintainers -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 1992, 1994, 1997, 2000-2018 Free Software Foundation, 3;; Copyright (C) 1992, 1994, 1997, 2000-2018 Free Software Foundation,
4;; Inc. 4;; Inc.
@@ -137,34 +137,28 @@ in your Lisp package:
137 137
138The @(#) construct is used by unix what(1) and 138The @(#) construct is used by unix what(1) and
139then $identifier: doc string $ is used by GNU ident(1)" 139then $identifier: doc string $ is used by GNU ident(1)"
140 :type 'regexp 140 :type 'regexp)
141 :group 'lisp-mnt)
142 141
143(defcustom lm-copyright-prefix "^\\(;+[ \t]\\)+Copyright (C) " 142(defcustom lm-copyright-prefix "^\\(;+[ \t]\\)+Copyright (C) "
144 "Prefix that is ignored before the dates in a copyright. 143 "Prefix that is ignored before the dates in a copyright.
145Leading comment characters and whitespace should be in regexp group 1." 144Leading comment characters and whitespace should be in regexp group 1."
146 :type 'regexp 145 :type 'regexp)
147 :group 'lisp-mnt)
148 146
149(defcustom lm-comment-column 16 147(defcustom lm-comment-column 16
150 "Column used for placing formatted output." 148 "Column used for placing formatted output."
151 :type 'integer 149 :type 'integer)
152 :group 'lisp-mnt)
153 150
154(defcustom lm-any-header ".*" 151(defcustom lm-any-header ".*"
155 "Regexp which matches start of any section." 152 "Regexp which matches start of any section."
156 :type 'regexp 153 :type 'regexp)
157 :group 'lisp-mnt)
158 154
159(defcustom lm-commentary-header "Commentary\\|Documentation" 155(defcustom lm-commentary-header "Commentary\\|Documentation"
160 "Regexp which matches start of documentation section." 156 "Regexp which matches start of documentation section."
161 :type 'regexp 157 :type 'regexp)
162 :group 'lisp-mnt)
163 158
164(defcustom lm-history-header "Change ?Log\\|History" 159(defcustom lm-history-header "Change ?Log\\|History"
165 "Regexp which matches the start of code log section." 160 "Regexp which matches the start of code log section."
166 :type 'regexp 161 :type 'regexp)
167 :group 'lisp-mnt)
168 162
169;;; Functions: 163;;; Functions:
170 164
@@ -236,26 +230,26 @@ a section."
236 (while (forward-comment 1)) 230 (while (forward-comment 1))
237 (point)))))))) 231 (point))))))))
238 232
239(defsubst lm-code-start () 233(defun lm-code-start ()
240 "Return the buffer location of the `Code' start marker." 234 "Return the buffer location of the `Code' start marker."
241 (lm-section-start "Code")) 235 (lm-section-start "Code"))
242(defalias 'lm-code-mark 'lm-code-start) 236(defalias 'lm-code-mark 'lm-code-start)
243 237
244(defsubst lm-commentary-start () 238(defun lm-commentary-start ()
245 "Return the buffer location of the `Commentary' start marker." 239 "Return the buffer location of the `Commentary' start marker."
246 (lm-section-start lm-commentary-header)) 240 (lm-section-start lm-commentary-header))
247(defalias 'lm-commentary-mark 'lm-commentary-start) 241(defalias 'lm-commentary-mark 'lm-commentary-start)
248 242
249(defsubst lm-commentary-end () 243(defun lm-commentary-end ()
250 "Return the buffer location of the `Commentary' section end." 244 "Return the buffer location of the `Commentary' section end."
251 (lm-section-end lm-commentary-header)) 245 (lm-section-end lm-commentary-header))
252 246
253(defsubst lm-history-start () 247(defun lm-history-start ()
254 "Return the buffer location of the `History' start marker." 248 "Return the buffer location of the `History' start marker."
255 (lm-section-start lm-history-header)) 249 (lm-section-start lm-history-header))
256(defalias 'lm-history-mark 'lm-history-start) 250(defalias 'lm-history-mark 'lm-history-start)
257 251
258(defsubst lm-copyright-mark () 252(defun lm-copyright-mark ()
259 "Return the buffer location of the `Copyright' line." 253 "Return the buffer location of the `Copyright' line."
260 (save-excursion 254 (save-excursion
261 (let ((case-fold-search t)) 255 (let ((case-fold-search t))
@@ -385,7 +379,7 @@ Each element of the list is a cons; the car is the full name,
385the cdr is an email address." 379the cdr is an email address."
386 (lm-with-file file 380 (lm-with-file file
387 (let ((authorlist (lm-header-multiline "author"))) 381 (let ((authorlist (lm-header-multiline "author")))
388 (mapcar 'lm-crack-address authorlist)))) 382 (mapcar #'lm-crack-address authorlist))))
389 383
390(defun lm-maintainer (&optional file) 384(defun lm-maintainer (&optional file)
391 "Return the maintainer of file FILE, or current buffer if FILE is nil. 385 "Return the maintainer of file FILE, or current buffer if FILE is nil.
@@ -453,7 +447,7 @@ each line."
453 (lm-with-file file 447 (lm-with-file file
454 (let ((keywords (lm-header-multiline "keywords"))) 448 (let ((keywords (lm-header-multiline "keywords")))
455 (and keywords 449 (and keywords
456 (mapconcat 'downcase keywords " "))))) 450 (mapconcat #'downcase keywords " ")))))
457 451
458(defun lm-keywords-list (&optional file) 452(defun lm-keywords-list (&optional file)
459 "Return list of keywords given in file FILE." 453 "Return list of keywords given in file FILE."
@@ -507,7 +501,7 @@ absent, return nil."
507 "Insert, at column COL, list of STRINGS." 501 "Insert, at column COL, list of STRINGS."
508 (if (> (current-column) col) (insert "\n")) 502 (if (> (current-column) col) (insert "\n"))
509 (move-to-column col t) 503 (move-to-column col t)
510 (apply 'insert strings)) 504 (apply #'insert strings))
511 505
512(defun lm-verify (&optional file showok verbose non-fsf-ok) 506(defun lm-verify (&optional file showok verbose non-fsf-ok)
513 "Check that the current buffer (or FILE if given) is in proper format. 507 "Check that the current buffer (or FILE if given) is in proper format.