1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-28 16:21:07 -08:00

Merge remote-tracking branch 'origin/master' into feature/android

This commit is contained in:
Po Lu 2023-02-26 07:33:09 +08:00
commit 687f4fadde
2 changed files with 19 additions and 13 deletions

View file

@ -245,10 +245,11 @@ use instead of point."
(insert
(mapconcat
(lambda (x)
(format "%s: %s %s %s" (calendar-date-string (car x))
(lunar-phase-name (nth 2 x))
(cadr x)
(car (last x))))
(let ((eclipse (nth 3 x)))
(concat (calendar-date-string (car x)) ": "
(lunar-phase-name (nth 2 x)) " "
(cadr x) (unless (string-empty-p eclipse) " ")
eclipse)))
(lunar-phase-list m1 y1) "\n")))
(message "Computing phases of the moon...done"))))
@ -283,9 +284,13 @@ use when highlighting the day in the calendar."
(while (calendar-date-compare phase (list date))
(setq index (1+ index)
phase (lunar-phase index)))
(if (calendar-date-equal (car phase) date)
(cons mark (concat (lunar-phase-name (nth 2 phase)) " "
(cadr phase))))))
(and (calendar-date-equal (car phase) date)
(cons mark
(let ((eclipse (nth 3 phase)))
(concat (lunar-phase-name (nth 2 phase)) " "
(cadr phase)
(unless (string-empty-p eclipse) " ")
eclipse))))))
;; For the Chinese calendar the calculations for the new moon need to be more
;; accurate than those above, so we use more terms in the approximation.

View file

@ -886,19 +886,20 @@ byte-compiled. Run with dynamic binding."
;; Should not warn that mt--test2 is not known to be defined.
(should-not (re-search-forward "my--test2" nil t))))
(defmacro bytecomp--with-warning-test (re-warning form)
(defun bytecomp--with-warning-test (re-warning form)
(declare (indent 1))
`(with-current-buffer (get-buffer-create "*Compile-Log*")
`(bytecomp--with-warning-test-1 ,re-warning ,form))
(defun bytecomp--with-warning-test-1 (re-warning form)
(with-current-buffer (get-buffer-create "*Compile-Log*")
(let ((inhibit-read-only t)) (erase-buffer))
(let ((text-quoting-style 'grave)
(macroexp--warned
(make-hash-table :test #'equal :weakness 'key)) ; oh dear
(form ,form))
(macroexp--warned ; oh dear
(make-hash-table :test #'equal :weakness 'key)))
(ert-info ((prin1-to-string form) :prefix "form: ")
(byte-compile form)
(ert-info ((prin1-to-string (buffer-string)) :prefix "buffer: ")
(should (re-search-forward
(string-replace " " "[ \n]+" ,re-warning))))))))
(string-replace " " "[ \n]+" re-warning))))))))
(ert-deftest bytecomp-warn-wrong-args ()
(bytecomp--with-warning-test "remq.*3.*2"