emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/assess 44083d94fe 95/95: Minor adjustments while prepar


From: ELPA Syncer
Subject: [elpa] externals/assess 44083d94fe 95/95: Minor adjustments while preparing for GNU ELPA
Date: Tue, 19 Jul 2022 15:57:37 -0400 (EDT)

branch: externals/assess
commit 44083d94feb45d3636f7ee6c55e0ef6bbb32b938
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    Minor adjustments while preparing for GNU ELPA
    
    * test/assess-test.el: Assume `cl-lib` is available.  Silence warnings.
    (strings-with-unequal-properties): Use `font-lock-ensure` when available.
    
    * test/assess-call-test.el (assess-call-test-capture-fail)
    (assess-call-test-hook-fail): Silence compiler warnings.
    
    * dev-resources/elisp-unindented.eld:
    * dev-resources/elisp-indented.eld: Change extension from `.el`.
    
    * test/local-sandbox.el:
    * test/assess-discover-test.el:
    * dev-resources/elisp-fontified.el: Enable lexical-binding.
    Add copyright notice.
    
    * assess-discover.el:
    * assess-call.el: Adjust copyright.
    
    * assess-robot.el: Adjust copyright.  Silence compiler warnings.
    (assess-robot-copy-and-finish): Simplify a tiny bit.
    
    * assess.el: Adjust copyright.  Assume `advice-add` is available.
    (assess--face-at=-1, assess--file-face-at=-1): Use `font-lock-ensure`
    when available.
    
    * .gitignore: Add ELPA-generated file.
---
 .gitignore                                         |  1 +
 assess-call.el                                     |  2 +-
 assess-discover.el                                 |  4 +--
 assess-robot.el                                    | 15 +++++-----
 assess.el                                          | 32 ++++++++++++----------
 dev-resources/elisp-fontified.el                   |  8 ++++--
 .../{elisp-indented.el => elisp-indented.eld}      |  0
 .../{elisp-unindented.el => elisp-unindented.eld}  |  0
 test/assess-call-test.el                           |  4 +--
 test/assess-discover-test.el                       |  4 +++
 test/assess-test.el                                | 26 ++++++++++--------
 test/local-sandbox.el                              |  4 +++
 12 files changed, 58 insertions(+), 42 deletions(-)

diff --git a/.gitignore b/.gitignore
index c8bf50de28..b6eaa89e2c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,5 +9,6 @@
 *.elc
 /dist
 /assess-pkg.el
+/assess-autoloads.el
 /test/assess-test.org
 /elpa-sandbox/
diff --git a/assess-call.el b/assess-call.el
index 78d61740a7..593c949f10 100644
--- a/assess-call.el
+++ b/assess-call.el
@@ -9,7 +9,7 @@
 
 ;; The contents of this file are subject to the GPL License, Version 3.0.
 
-;; Copyright (C) 2016, Phillip Lord
+;; Copyright (C) 2016-2022  Free Software Foundation, Inc.
 
 ;; 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
diff --git a/assess-discover.el b/assess-discover.el
index 51cabb2bbe..cbaac48d27 100644
--- a/assess-discover.el
+++ b/assess-discover.el
@@ -9,7 +9,7 @@
 
 ;; The contents of this file are subject to the GPL License, Version 3.0.
 
-;; Copyright (C) 2015, 2016, Phillip Lord
+;; Copyright (C) 2015-2022  Free Software Foundation, Inc.
 
 ;; 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
@@ -65,7 +65,7 @@ tests directory."
 
 (defun assess-discover--load-all-tests (directory)
   (mapc
-   'load
+   #'load
    (assess-discover-tests directory)))
 
 (defun assess-discover-load-tests ()
diff --git a/assess-robot.el b/assess-robot.el
index 45ff0e2cba..8bb14f86c5 100644
--- a/assess-robot.el
+++ b/assess-robot.el
@@ -10,7 +10,7 @@
 
 ;; The contents of this file are subject to the GPL License, Version 3.0.
 
-;; Copyright (C) 2016, Phillip Lord
+;; Copyright (C) 2016-2022  Free Software Foundation, Inc.
 
 ;; 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
@@ -85,8 +85,9 @@ In this case, MACRO is the \"long form\" accepted by
      (read-kbd-macro macro))))
 
 (defun assess-robot-copy-and-finish ()
-  "Copy the macro in edmacro to the kill-ring."
+  "Copy the macro in edmacro to the `kill-ring'."
   (interactive)
+  (declare-function edmacro-finish-edit "edmacro" ())
   (save-excursion
     (goto-char (point-min))
     (search-forward "Macro:")
@@ -96,16 +97,14 @@ In this case, MACRO is the \"long form\" accepted by
             (point)
             (point-max))))
       (with-temp-buffer
-        (insert "\"")
-        (insert string)
-        (insert "\"")
+        (insert "\"" string "\"")
         (kill-ring-save (point-min)
                         (point-max))))
     (edmacro-finish-edit)))
 
-(eval-after-load
-    'edmacro
-  '(define-key edmacro-mode-map (kbd "C-c C-k") 'assess-robot-copy-and-finish))
+(with-eval-after-load 'edmacro
+  (defvar edmacro-mode-map)
+  (define-key edmacro-mode-map (kbd "C-c C-k") #'assess-robot-copy-and-finish))
 
 (provide 'assess-robot)
 ;;; assess-robot.el ends here
diff --git a/assess.el b/assess.el
index f1b53f2c90..8ebd27574a 100644
--- a/assess.el
+++ b/assess.el
@@ -11,7 +11,7 @@
 
 ;; The contents of this file are subject to the GPL License, Version 3.0.
 
-;; Copyright (C) 2015, 2016, Phillip Lord
+;; Copyright (C) 2015-2022  Free Software Foundation, Inc.
 
 ;; 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
@@ -77,16 +77,14 @@
 ;; nadvice.el limits this package to Emacs 24.4. Emacs 25 has this fixed.
 
 ;; #+begin_src emacs-lisp
-(when (fboundp 'advice-add)
-
-  (defun assess--ert-pp-with-indentation-and-newline (orig object)
-    (let ((pp-escape-newlines nil))
-      (funcall orig object)))
-
-  (advice-add
-   'ert--pp-with-indentation-and-newline
-   :around
-   #'assess--ert-pp-with-indentation-and-newline))
+(defun assess--ert-pp-with-indentation-and-newline (orig object)
+  (let ((pp-escape-newlines nil))
+    (funcall orig object)))
+
+(advice-add
+ 'ert--pp-with-indentation-and-newline
+ :around
+ #'assess--ert-pp-with-indentation-and-newline)
 ;; #+end_src
 
 ;; ** Deliberate Errors
@@ -280,7 +278,7 @@ string into something that will identified appropriately."
    ((bufferp x) (m-buffer-at-string x))
    (t (error "Type not recognised"))))
 
-(defalias 'assess-buffer 'get-buffer-create
+(defalias 'assess-buffer #'get-buffer-create
   "Create a buffer.
 
 This is now an alias for `get-buffer-create' but used to do
@@ -654,7 +652,7 @@ An example showing all the possibilities:
 If we want to run some code in a directory with an empty file
 \"foo.txt\" present, we call:
 
-  (assess-with-filesystem '(\"foo\")
+  (assess-with-filesystem \\='(\"foo\")
     (code-here)
     (and-some-more-forms))
 
@@ -1068,7 +1066,9 @@ the copy of FILE will be in a different directory."
   (with-temp-buffer
     (insert (assess-ensure-string x))
     (funcall mode)
-    (font-lock-fontify-buffer)
+    (if (fboundp 'font-lock-ensure)
+        (font-lock-ensure)
+      (with-no-warnings (font-lock-fontify-buffer)))
     (assess--face-at= (current-buffer) locations faces property throw-on-nil)))
 
 (defun assess-face-at=
@@ -1119,7 +1119,9 @@ operates over files and takes the mode from that file."
 (defun assess--file-face-at=-1 (file locations faces property throw-on-nil)
   (assess-with-find-file
       (assess-make-related-file file)
-    (font-lock-fontify-buffer)
+    (if (fboundp 'font-lock-ensure)
+        (font-lock-ensure)
+      (with-no-warnings (font-lock-fontify-buffer)))
     (assess--face-at= (current-buffer) locations faces property throw-on-nil)))
 
 (defun assess-file-face-at= (file locations faces &optional property)
diff --git a/dev-resources/elisp-fontified.el b/dev-resources/elisp-fontified.el
index 4dfd1fb010..09a9ab4308 100644
--- a/dev-resources/elisp-fontified.el
+++ b/dev-resources/elisp-fontified.el
@@ -1,5 +1,9 @@
-(defun functionname (args &optional body)
+;; -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2016-2022  Free Software Foundation, Inc.
+
+(defun functionname (_args &optional _body)
   (+ 1 2))
 
-(defun functionname2 (args &optional body)
+(defun functionname2 (_args &optional _body)
   (+ 1 3))
diff --git a/dev-resources/elisp-indented.el b/dev-resources/elisp-indented.eld
similarity index 100%
rename from dev-resources/elisp-indented.el
rename to dev-resources/elisp-indented.eld
diff --git a/dev-resources/elisp-unindented.el 
b/dev-resources/elisp-unindented.eld
similarity index 100%
rename from dev-resources/elisp-unindented.el
rename to dev-resources/elisp-unindented.eld
diff --git a/test/assess-call-test.el b/test/assess-call-test.el
index 10b48e793a..e7afe6df6d 100644
--- a/test/assess-call-test.el
+++ b/test/assess-call-test.el
@@ -101,7 +101,7 @@
               (assess-call-adviced-p 'assess-call-capture-multiply))))
      retn))
   (should-not
-   (condition-case err
+   (condition-case nil
        (assess-call-capture
         'assess-call-capture-multiply
         (lambda ()
@@ -142,7 +142,7 @@
   (should (not assess-call-test-hook))
   ;; and should be nil if we error
   (should
-   (condition-case err
+   (condition-case nil
        (assess-call-capture-hook
         'assess-call-test-hook
         (lambda ()
diff --git a/test/assess-discover-test.el b/test/assess-discover-test.el
index b8bfe6fe34..b78729b638 100644
--- a/test/assess-discover-test.el
+++ b/test/assess-discover-test.el
@@ -1,3 +1,7 @@
+;; -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2016-2022  Free Software Foundation, Inc.
+
 (ert-deftest assess-discover-test-has-this-been-defined ()
   "This test is here so that we can test elsewhere that is has
 actually been defined."
diff --git a/test/assess-test.el b/test/assess-test.el
index 83eb697084..f93e1710df 100644
--- a/test/assess-test.el
+++ b/test/assess-test.el
@@ -27,10 +27,8 @@
 ;; #+begin_src emacs-lisp
 (require 'load-relative)
 (require 'assess)
-(unless (require 'cl-lib nil t)
-  (require 'cl)
-  (defalias 'cl-cdadr 'cdadr)
-  (defalias 'cl-loop 'loop))
+(require 'cl-lib)
+
 ;; #+end_src
 
 ;; ** Always failing test
@@ -229,7 +227,7 @@ This also tests the advice on string=."
   (should
    (=
     (length (buffer-list))
-    (condition-case e
+    (condition-case nil
         (assess-with-preserved-buffer-list
          (generate-new-buffer "preserved-buffer-list")
          (signal 'assess-deliberate-error nil))
@@ -243,7 +241,7 @@ This also tests the advice on string=."
   (should
    (bufferp
     (assess-with-temp-buffers
-        (a (insert "hello"))
+        ((a (insert "hello")))
       a)))
   (should
    (equal
@@ -256,13 +254,13 @@ This also tests the advice on string=."
   (should
    (=
     (+ 2 (length (buffer-list)))
-    (assess-with-temp-buffers (a b)
+    (assess-with-temp-buffers (_a _b)
       (length (buffer-list)))))
   (should
    (=
     (length (buffer-list))
     (progn
-      (assess-with-temp-buffers (a b))
+      (assess-with-temp-buffers (_a _b) nil)
       (length (buffer-list))))))
 
 ;; #+end_src
@@ -390,11 +388,11 @@ This also tests the advice on string=."
 
 (defvar assess-dev-elisp-indented
   (concat assess-dev-resources
-          "elisp-indented.el"))
+          "elisp-indented.eld"))
 
 (defvar assess-dev-elisp-unindented
   (concat assess-dev-resources
-          "elisp-unindented.el"))
+          "elisp-unindented.eld"))
 
 (ert-deftest assess-test-roundtrip-indentation= ()
   (should
@@ -550,8 +548,12 @@ This also tests the advice on string=."
        ((a (insert ";; Commented")
            (emacs-lisp-mode)
            ;; use instead of font-lock-ensure for emacs 24
-           (font-lock-fontify-buffer))
+           (if (fboundp 'font-lock-ensure)
+               (font-lock-ensure)
+             (with-no-warnings (font-lock-fontify-buffer))))
         (b (insert ";; Commented")
-           (font-lock-fontify-buffer)))
+           (if (fboundp 'font-lock-ensure)
+               (font-lock-ensure)
+             (with-no-warnings (font-lock-fontify-buffer)))))
      (assess= a b))))
 ;; #+end_src
diff --git a/test/local-sandbox.el b/test/local-sandbox.el
index 019e0c65e7..2305ed4c52 100644
--- a/test/local-sandbox.el
+++ b/test/local-sandbox.el
@@ -1,3 +1,7 @@
+;; -*- lexical-binding: t; -*-
+
+;; FIXME: Merely loading a file should not cause such drastic changes.
+
 (setq package-user-dir
       (concat
        default-directory



reply via email to

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