]> git.eshelyaron.com Git - emacs.git/commitdiff
Make 'byte-compile-info*' functions more logical
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 6 Aug 2020 06:12:31 +0000 (08:12 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 6 Aug 2020 06:12:31 +0000 (08:12 +0200)
* lisp/emacs-lisp/byte-run.el (byte-compile-info): New function
that's more flexible that replaces 'byte-compile-info-string' and
'byte-compile-info-message'.
(byte-compile-info-string): Make obsolete.
(byte-compile-info-message): Ditto.

* lisp/international/ja-dic-cnv.el (skkdic-convert-okuri-ari)
(skkdic-convert-postfix, skkdic-convert-prefix)
(skkdic-collect-okuri-nasi, skkdic-set-okuri-nasi):
* lisp/finder.el (finder-compile-keywords):
* lisp/cus-dep.el (custom-make-dependencies): Adjust callers to
use the new function.

lisp/cus-dep.el
lisp/emacs-lisp/byte-run.el
lisp/finder.el
lisp/international/ja-dic-cnv.el

index fd307a5c04e658236178c08ab3ebb921c3193c62..f1061a8621be5c68243981febc08a8a81dbc61b5 100644 (file)
@@ -70,7 +70,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
                                   (directory-files subdir nil
                                                    "\\`[^=.].*\\.el\\'"))))
         (progress (make-progress-reporter
-                    (byte-compile-info-string "Scanning files for custom")
+                    (byte-compile-info "Scanning files for custom")
                     0 (length files) nil 10)))
     (with-temp-buffer
       (dolist (elem files)
@@ -127,8 +127,8 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
                                                      type)))))))))))
                 (error nil)))))))
     (progress-reporter-done progress))
-  (byte-compile-info-message "Generating %s..."
-                             generated-custom-dependencies-file)
+  (byte-compile-info
+   (format "Generating %s..." generated-custom-dependencies-file) t)
   (set-buffer (find-file-noselect generated-custom-dependencies-file))
   (setq buffer-undo-list t)
   (erase-buffer)
@@ -217,8 +217,8 @@ elements the files that have variables or faces that contain that
 version.  These files should be loaded before showing the customization
 buffer that `customize-changed-options' generates.\")\n\n"))
   (save-buffer)
-  (byte-compile-info-message "Generating %s...done"
-                             generated-custom-dependencies-file))
+  (byte-compile-info
+   (format "Generating %s...done" generated-custom-dependencies-file) t))
 
 \f
 (provide 'cus-dep)
index 88e21b73fed54b4b02ffd63f26ab45d3c71657d4..5279a57cd0c136ee5cc401d8f6b8598242ac7429 100644 (file)
@@ -576,13 +576,26 @@ Otherwise, return nil.  For internal use only."
                         (mapconcat (lambda (char) (format "`?\\%c'" char))
                                    sorted ", ")))))
 
+(defun byte-compile-info (string &optional message type)
+  "Format STRING in a way that looks pleasing in the compilation output.
+If MESSAGE, output the message, too.
+
+If TYPE, it should be a string that says what the information
+type is.  This defaults to \"INFO\"."
+  (let ((string (format "  %-9s%s" (or type "INFO") string)))
+    (when message
+      (message "%s" string))
+    string))
+
 (defun byte-compile-info-string (&rest args)
   "Format ARGS in a way that looks pleasing in the compilation output."
-  (format "  %-9s%s" "INFO" (apply #'format args)))
+  (declare (obsolete byte-compile-info "28.1"))
+  (byte-compile-info (apply #'format args)))
 
 (defun byte-compile-info-message (&rest args)
   "Message format ARGS in a way that looks pleasing in the compilation output."
-  (message "%s" (apply #'byte-compile-info-string args)))
+  (declare (obsolete byte-compile-info "28.1"))
+  (byte-compile-info (apply #'format args) t))
 
 \f
 ;; I nuked this because it's not a good idea for users to think of using it.
index f04d73e098ff024da720edcbbb81c4793e38503c..820d6d0a3b92900af70ec1f58fccd7aabe512537 100644 (file)
@@ -197,7 +197,7 @@ from; the default is `load-path'."
                                    (cons d f))
                                  (directory-files d nil el-file-regexp))))
          (progress (make-progress-reporter
-                    (byte-compile-info-string "Scanning files for finder")
+                    (byte-compile-info "Scanning files for finder")
                     0 (length files)))
         package-override base-name ; processed
         summary keywords package version entry desc)
index 45e13462656f80b22fd0dfd4e2c6035727673785..f5e70ce7021094c67e83979238dbec45e989c26c 100644 (file)
@@ -48,7 +48,7 @@
 (defvar ja-dic-filename "ja-dic.el")
 
 (defun skkdic-convert-okuri-ari (skkbuf buf)
-  (byte-compile-info-message "Processing OKURI-ARI entries")
+  (byte-compile-info "Processing OKURI-ARI entries" t)
   (goto-char (point-min))
   (with-current-buffer buf
     (insert ";; Setting okuri-ari entries.\n"
@@ -97,7 +97,7 @@
     ("ゆき" "行")))
 
 (defun skkdic-convert-postfix (skkbuf buf)
-  (byte-compile-info-message "Processing POSTFIX entries")
+  (byte-compile-info "Processing POSTFIX entries" t)
   (goto-char (point-min))
   (with-current-buffer buf
     (insert ";; Setting postfix entries.\n"
 (defconst skkdic-prefix-list '(skkdic-prefix-list))
 
 (defun skkdic-convert-prefix (skkbuf buf)
-  (byte-compile-info-message "Processing PREFIX entries")
+  (byte-compile-info "Processing PREFIX entries" t)
   (goto-char (point-min))
   (with-current-buffer buf
     (insert ";; Setting prefix entries.\n"
 (defun skkdic-collect-okuri-nasi ()
   (save-excursion
     (let ((progress (make-progress-reporter
-                     (byte-compile-info-message "Collecting OKURI-NASI entries")
+                     (byte-compile-info "Collecting OKURI-NASI entries" t)
                      (point) (point-max)
                      nil 10)))
       (while (re-search-forward "^\\(\\cH+\\) \\(/\\cj.*\\)/$"
            "(skkdic-set-okuri-nasi\n")
     (let ((l (nreverse skkdic-okuri-nasi-entries))
           (progress (make-progress-reporter
-                     (byte-compile-info-message "Processing OKURI-NASI entries")
+                     (byte-compile-info "Processing OKURI-NASI entries" t)
                      0 skkdic-okuri-nasi-entries-count
                      nil 10))
           (count 0))
@@ -531,8 +531,7 @@ To get complete usage, invoke:
      ',(let ((l entries)
             (map '(skdic-okuri-nasi))
              (progress (make-progress-reporter
-                        (byte-compile-info-message
-                         "Extracting OKURI-NASI entries")
+                        (byte-compile-info "Extracting OKURI-NASI entries")
                         0 (length entries)))
             (count 0)
             entry)