emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-28 ed18d08f6f 1/2: Fix copyright.el comment and add a test


From: Lars Ingebrigtsen
Subject: emacs-28 ed18d08f6f 1/2: Fix copyright.el comment and add a test
Date: Wed, 26 Jan 2022 09:04:26 -0500 (EST)

branch: emacs-28
commit ed18d08f6f3041e6fd1806690c24ca6b31deab2d
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix copyright.el comment and add a test
    
    * lisp/emacs-lisp/copyright.el (copyright-find-copyright): Fix
    comment (bug#7179).
    
    Do not merge to master.
---
 lisp/emacs-lisp/copyright.el            |  2 +-
 test/lisp/emacs-lisp/copyright-tests.el | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el
index 09c6ded295..23b90808d9 100644
--- a/lisp/emacs-lisp/copyright.el
+++ b/lisp/emacs-lisp/copyright.el
@@ -150,7 +150,7 @@ This function sets the match data that 
`copyright-update-year' uses."
       (when (copyright-re-search regexp (copyright-limit) t)
         ;; We may accidentally have landed in the middle of a
         ;; copyright line, so re-perform the search without the
-        ;; search.  (Otherwise we may be inserting the new year in the
+        ;; limit.  (Otherwise we may be inserting the new year in the
         ;; middle of the list of years.)
         (goto-char (match-beginning 0))
         (copyright-re-search regexp nil t)))))
diff --git a/test/lisp/emacs-lisp/copyright-tests.el 
b/test/lisp/emacs-lisp/copyright-tests.el
index dc82974a99..120cd5a6b5 100644
--- a/test/lisp/emacs-lisp/copyright-tests.el
+++ b/test/lisp/emacs-lisp/copyright-tests.el
@@ -50,5 +50,16 @@
   (dolist (test copyright-tests--data)
     (with-copyright-test (car test) (cdr test))))
 
+(ert-deftest test-end-chop ()
+  (should
+   (equal
+    (with-temp-buffer
+      (let ((copyright-query nil))
+        (insert (make-string (- copyright-limit 14) ?x) "\n"
+                "\nCopyright 2006, 2007, 2008 Foo Bar\n\n")
+        (copyright-update)
+        (buffer-substring (- (point-max) 42) (point-max))))
+    "Copyright 2006, 2007, 2008, 2022 Foo Bar\n\n")))
+
 (provide 'copyright-tests)
 ;;; copyright-tests.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]