[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/android 95db5042d5e: Merge remote-tracking branch 'origin/master
From: |
Po Lu |
Subject: |
feature/android 95db5042d5e: Merge remote-tracking branch 'origin/master' into feature/android |
Date: |
Fri, 21 Jul 2023 19:59:38 -0400 (EDT) |
branch: feature/android
commit 95db5042d5e636097bfb0f9af42f65cd5ffaa9bb
Merge: ae174f266d7 ca4bc9baf9d
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Merge remote-tracking branch 'origin/master' into feature/android
---
lisp/emacs-lisp/macroexp.el | 28 +++++++++++++---------------
lisp/proced.el | 6 ++++--
src/regex-emacs.c | 2 +-
src/search.c | 11 ++++++-----
src/xdisp.c | 4 +++-
test/lisp/emacs-lisp/macroexp-tests.el | 16 ++++++++++++++++
test/src/comp-tests.el | 2 +-
7 files changed, 44 insertions(+), 25 deletions(-)
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index 290bf1c933a..083a7f58f36 100644
--- a/lisp/emacs-lisp/macroexp.el
+++ b/lisp/emacs-lisp/macroexp.el
@@ -227,21 +227,19 @@ It should normally be a symbol with position and it
defaults to FORM."
(defun macroexp-macroexpand (form env)
"Like `macroexpand' but checking obsolescence."
(let* ((macroexpand-all-environment env)
- (new-form
- (macroexpand form env)))
- (if (and (not (eq form new-form)) ;It was a macro call.
- (car-safe form)
- (symbolp (car form))
- (get (car form) 'byte-obsolete-info))
- (let* ((fun (car form))
- (obsolete (get fun 'byte-obsolete-info)))
- (macroexp-warn-and-return
- (macroexp--obsolete-warning
- fun obsolete
- (if (symbolp (symbol-function fun))
- "alias" "macro"))
- new-form (list 'obsolete fun) nil fun))
- new-form)))
+ new-form)
+ (while (not (eq form (setq new-form (macroexpand-1 form env))))
+ (let ((fun (car-safe form)))
+ (setq form
+ (if (and fun (symbolp fun)
+ (get fun 'byte-obsolete-info))
+ (macroexp-warn-and-return
+ (macroexp--obsolete-warning
+ fun (get fun 'byte-obsolete-info)
+ (if (symbolp (symbol-function fun)) "alias" "macro"))
+ new-form (list 'obsolete fun) nil fun)
+ new-form))))
+ form))
(defun macroexp--unfold-lambda (form &optional name)
(or name (setq name "anonymous lambda"))
diff --git a/lisp/proced.el b/lisp/proced.el
index 03a7f1bebdf..b3d581a49d1 100644
--- a/lisp/proced.el
+++ b/lisp/proced.el
@@ -776,12 +776,12 @@ of the process. A value of nil indicates that there are
no active refinements."
(while (string-match "[ \t\n]+" hl pos)
(setq pos (match-end 0))
(put-text-property (match-beginning 0) pos 'display
- `(space :align-to ,(+ pos base))
+ `(space :align-to (,(+ pos base) . width))
hl)))
(setq hl (replace-regexp-in-string ;; preserve text properties
"\\(%\\)" "\\1\\1"
hl)))
- (list (propertize " " 'display `(space :align-to ,base))
+ (list (propertize " " 'display `(space :align-to (,base . width)))
hl)))
(defun proced-pid-at-point ()
@@ -894,6 +894,8 @@ normal hook `proced-post-display-hook'.
(setq-local font-lock-defaults
'(proced-font-lock-keywords t nil nil beginning-of-line))
(setq-local switch-to-buffer-preserve-window-point nil)
+ ;; So that the heading scales together with the body of the table.
+ (setq-local text-scale-remap-header-line t)
(if (and (not proced-auto-update-timer) proced-auto-update-interval)
(setq proced-auto-update-timer
(run-at-time t proced-auto-update-interval
diff --git a/src/regex-emacs.c b/src/regex-emacs.c
index 9e298b81ebb..51fc2b0558d 100644
--- a/src/regex-emacs.c
+++ b/src/regex-emacs.c
@@ -554,7 +554,7 @@ print_partial_compiled_pattern (re_char *start, re_char
*end)
fprintf (stderr, "/charset [%s",
(re_opcode_t) *(p - 1) == charset_not ? "^" : "");
- if (p + *p >= pend)
+ if (p + (*p & 0x7f) >= pend)
fputs (" !extends past end of pattern! ", stderr);
for (c = 0; c < 256; c++)
diff --git a/src/search.c b/src/search.c
index 122d6166637..3edfc0bc1a8 100644
--- a/src/search.c
+++ b/src/search.c
@@ -162,7 +162,7 @@ clear_regexp_cache (void)
/* It's tempting to compare with the syntax-table we've actually changed,
but it's not sufficient because char-table inheritance means that
modifying one syntax-table can change others at the same time. */
- if (!searchbufs[i].busy && !EQ (searchbufs[i].syntax_table, Qt))
+ if (!searchbufs[i].busy && !BASE_EQ (searchbufs[i].syntax_table, Qt))
searchbufs[i].regexp = Qnil;
}
@@ -214,10 +214,11 @@ compile_pattern (Lisp_Object pattern, struct re_registers
*regp,
&& !cp->busy
&& STRING_MULTIBYTE (cp->regexp) == STRING_MULTIBYTE (pattern)
&& !NILP (Fstring_equal (cp->regexp, pattern))
- && EQ (cp->buf.translate, translate)
+ && BASE_EQ (cp->buf.translate, translate)
&& cp->posix == posix
- && (EQ (cp->syntax_table, Qt)
- || EQ (cp->syntax_table, BVAR (current_buffer, syntax_table)))
+ && (BASE_EQ (cp->syntax_table, Qt)
+ || BASE_EQ (cp->syntax_table,
+ BVAR (current_buffer, syntax_table)))
&& !NILP (Fequal (cp->f_whitespace_regexp, Vsearch_spaces_regexp))
&& cp->buf.charset_unibyte == charset_unibyte)
break;
@@ -2892,7 +2893,7 @@ Return value is undefined if the last search failed. */)
ptrdiff_t start = search_regs.start[i];
if (start >= 0)
{
- if (EQ (last_thing_searched, Qt)
+ if (BASE_EQ (last_thing_searched, Qt)
|| ! NILP (integers))
{
XSETFASTINT (data[2 * i], start);
diff --git a/src/xdisp.c b/src/xdisp.c
index 4e9c5f49e58..5e471cad61e 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -29268,7 +29268,9 @@ calc_pixel_width_or_height (double *res, struct it *it,
Lisp_Object prop,
/* 'width': the width of FONT. */
if (EQ (prop, Qwidth))
return OK_PIXELS (font
- ? FONT_WIDTH (font)
+ ? (font->average_width
+ ? font->average_width
+ : font->space_width)
: FRAME_COLUMN_WIDTH (it->f));
#else
if (EQ (prop, Qheight) || EQ (prop, Qwidth))
diff --git a/test/lisp/emacs-lisp/macroexp-tests.el
b/test/lisp/emacs-lisp/macroexp-tests.el
index 7bb38fe58f7..d0efbfd28c1 100644
--- a/test/lisp/emacs-lisp/macroexp-tests.el
+++ b/test/lisp/emacs-lisp/macroexp-tests.el
@@ -124,4 +124,20 @@
(dyn dyn dyn dyn)
(dyn dyn dyn lex))))))
+(defmacro macroexp--test-macro1 ()
+ (declare (obsolete "new-replacement" nil))
+ 1)
+
+(defmacro macroexp--test-macro2 ()
+ '(macroexp--test-macro1))
+
+(ert-deftest macroexp--test-obsolete-macro ()
+ (should
+ (let ((res
+ (cl-letf (((symbol-function 'message) #'user-error))
+ (condition-case err
+ (macroexpand-all '(macroexp--test-macro2))
+ (user-error (error-message-string err))))))
+ (should (and (stringp res) (string-match "new-replacement" res))))))
+
;;; macroexp-tests.el ends here
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index 30dfd669ded..89b1eefb1dc 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -1530,7 +1530,7 @@ folded."
(equal (comp-mvar-typeset mvar)
comp-tests-cond-rw-expected-type))))))))
-(ert-deftest comp-tests-result-lambda ()
+(comp-deftest comp-tests-result-lambda ()
(native-compile 'comp-tests-result-lambda)
(should (eq (funcall (comp-tests-result-lambda) '(a . b)) 'a)))
;;; comp-tests.el ends here