aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPo Lu2023-07-22 07:59:17 +0800
committerPo Lu2023-07-22 07:59:17 +0800
commit95db5042d5e636097bfb0f9af42f65cd5ffaa9bb (patch)
tree24991aa08ac7d614b3754a8cef7a440db307d651
parentae174f266d70f2d722545e77d3f85dd7d3f09a68 (diff)
parentca4bc9baf9d2c861ad776da07e56381da8e3722a (diff)
downloademacs-95db5042d5e636097bfb0f9af42f65cd5ffaa9bb.tar.gz
emacs-95db5042d5e636097bfb0f9af42f65cd5ffaa9bb.zip
Merge remote-tracking branch 'origin/master' into feature/android
-rw-r--r--lisp/emacs-lisp/macroexp.el28
-rw-r--r--lisp/proced.el6
-rw-r--r--src/regex-emacs.c2
-rw-r--r--src/search.c11
-rw-r--r--src/xdisp.c4
-rw-r--r--test/lisp/emacs-lisp/macroexp-tests.el16
-rw-r--r--test/src/comp-tests.el2
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."
227(defun macroexp-macroexpand (form env) 227(defun macroexp-macroexpand (form env)
228 "Like `macroexpand' but checking obsolescence." 228 "Like `macroexpand' but checking obsolescence."
229 (let* ((macroexpand-all-environment env) 229 (let* ((macroexpand-all-environment env)
230 (new-form 230 new-form)
231 (macroexpand form env))) 231 (while (not (eq form (setq new-form (macroexpand-1 form env))))
232 (if (and (not (eq form new-form)) ;It was a macro call. 232 (let ((fun (car-safe form)))
233 (car-safe form) 233 (setq form
234 (symbolp (car form)) 234 (if (and fun (symbolp fun)
235 (get (car form) 'byte-obsolete-info)) 235 (get fun 'byte-obsolete-info))
236 (let* ((fun (car form)) 236 (macroexp-warn-and-return
237 (obsolete (get fun 'byte-obsolete-info))) 237 (macroexp--obsolete-warning
238 (macroexp-warn-and-return 238 fun (get fun 'byte-obsolete-info)
239 (macroexp--obsolete-warning 239 (if (symbolp (symbol-function fun)) "alias" "macro"))
240 fun obsolete 240 new-form (list 'obsolete fun) nil fun)
241 (if (symbolp (symbol-function fun)) 241 new-form))))
242 "alias" "macro")) 242 form))
243 new-form (list 'obsolete fun) nil fun))
244 new-form)))
245 243
246(defun macroexp--unfold-lambda (form &optional name) 244(defun macroexp--unfold-lambda (form &optional name)
247 (or name (setq name "anonymous lambda")) 245 (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."
776 (while (string-match "[ \t\n]+" hl pos) 776 (while (string-match "[ \t\n]+" hl pos)
777 (setq pos (match-end 0)) 777 (setq pos (match-end 0))
778 (put-text-property (match-beginning 0) pos 'display 778 (put-text-property (match-beginning 0) pos 'display
779 `(space :align-to ,(+ pos base)) 779 `(space :align-to (,(+ pos base) . width))
780 hl))) 780 hl)))
781 (setq hl (replace-regexp-in-string ;; preserve text properties 781 (setq hl (replace-regexp-in-string ;; preserve text properties
782 "\\(%\\)" "\\1\\1" 782 "\\(%\\)" "\\1\\1"
783 hl))) 783 hl)))
784 (list (propertize " " 'display `(space :align-to ,base)) 784 (list (propertize " " 'display `(space :align-to (,base . width)))
785 hl))) 785 hl)))
786 786
787(defun proced-pid-at-point () 787(defun proced-pid-at-point ()
@@ -894,6 +894,8 @@ normal hook `proced-post-display-hook'.
894 (setq-local font-lock-defaults 894 (setq-local font-lock-defaults
895 '(proced-font-lock-keywords t nil nil beginning-of-line)) 895 '(proced-font-lock-keywords t nil nil beginning-of-line))
896 (setq-local switch-to-buffer-preserve-window-point nil) 896 (setq-local switch-to-buffer-preserve-window-point nil)
897 ;; So that the heading scales together with the body of the table.
898 (setq-local text-scale-remap-header-line t)
897 (if (and (not proced-auto-update-timer) proced-auto-update-interval) 899 (if (and (not proced-auto-update-timer) proced-auto-update-interval)
898 (setq proced-auto-update-timer 900 (setq proced-auto-update-timer
899 (run-at-time t proced-auto-update-interval 901 (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)
554 fprintf (stderr, "/charset [%s", 554 fprintf (stderr, "/charset [%s",
555 (re_opcode_t) *(p - 1) == charset_not ? "^" : ""); 555 (re_opcode_t) *(p - 1) == charset_not ? "^" : "");
556 556
557 if (p + *p >= pend) 557 if (p + (*p & 0x7f) >= pend)
558 fputs (" !extends past end of pattern! ", stderr); 558 fputs (" !extends past end of pattern! ", stderr);
559 559
560 for (c = 0; c < 256; c++) 560 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)
162 /* It's tempting to compare with the syntax-table we've actually changed, 162 /* It's tempting to compare with the syntax-table we've actually changed,
163 but it's not sufficient because char-table inheritance means that 163 but it's not sufficient because char-table inheritance means that
164 modifying one syntax-table can change others at the same time. */ 164 modifying one syntax-table can change others at the same time. */
165 if (!searchbufs[i].busy && !EQ (searchbufs[i].syntax_table, Qt)) 165 if (!searchbufs[i].busy && !BASE_EQ (searchbufs[i].syntax_table, Qt))
166 searchbufs[i].regexp = Qnil; 166 searchbufs[i].regexp = Qnil;
167} 167}
168 168
@@ -214,10 +214,11 @@ compile_pattern (Lisp_Object pattern, struct re_registers *regp,
214 && !cp->busy 214 && !cp->busy
215 && STRING_MULTIBYTE (cp->regexp) == STRING_MULTIBYTE (pattern) 215 && STRING_MULTIBYTE (cp->regexp) == STRING_MULTIBYTE (pattern)
216 && !NILP (Fstring_equal (cp->regexp, pattern)) 216 && !NILP (Fstring_equal (cp->regexp, pattern))
217 && EQ (cp->buf.translate, translate) 217 && BASE_EQ (cp->buf.translate, translate)
218 && cp->posix == posix 218 && cp->posix == posix
219 && (EQ (cp->syntax_table, Qt) 219 && (BASE_EQ (cp->syntax_table, Qt)
220 || EQ (cp->syntax_table, BVAR (current_buffer, syntax_table))) 220 || BASE_EQ (cp->syntax_table,
221 BVAR (current_buffer, syntax_table)))
221 && !NILP (Fequal (cp->f_whitespace_regexp, Vsearch_spaces_regexp)) 222 && !NILP (Fequal (cp->f_whitespace_regexp, Vsearch_spaces_regexp))
222 && cp->buf.charset_unibyte == charset_unibyte) 223 && cp->buf.charset_unibyte == charset_unibyte)
223 break; 224 break;
@@ -2892,7 +2893,7 @@ Return value is undefined if the last search failed. */)
2892 ptrdiff_t start = search_regs.start[i]; 2893 ptrdiff_t start = search_regs.start[i];
2893 if (start >= 0) 2894 if (start >= 0)
2894 { 2895 {
2895 if (EQ (last_thing_searched, Qt) 2896 if (BASE_EQ (last_thing_searched, Qt)
2896 || ! NILP (integers)) 2897 || ! NILP (integers))
2897 { 2898 {
2898 XSETFASTINT (data[2 * i], start); 2899 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,
29268 /* 'width': the width of FONT. */ 29268 /* 'width': the width of FONT. */
29269 if (EQ (prop, Qwidth)) 29269 if (EQ (prop, Qwidth))
29270 return OK_PIXELS (font 29270 return OK_PIXELS (font
29271 ? FONT_WIDTH (font) 29271 ? (font->average_width
29272 ? font->average_width
29273 : font->space_width)
29272 : FRAME_COLUMN_WIDTH (it->f)); 29274 : FRAME_COLUMN_WIDTH (it->f));
29273#else 29275#else
29274 if (EQ (prop, Qheight) || EQ (prop, Qwidth)) 29276 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 @@
124 (dyn dyn dyn dyn) 124 (dyn dyn dyn dyn)
125 (dyn dyn dyn lex)))))) 125 (dyn dyn dyn lex))))))
126 126
127(defmacro macroexp--test-macro1 ()
128 (declare (obsolete "new-replacement" nil))
129 1)
130
131(defmacro macroexp--test-macro2 ()
132 '(macroexp--test-macro1))
133
134(ert-deftest macroexp--test-obsolete-macro ()
135 (should
136 (let ((res
137 (cl-letf (((symbol-function 'message) #'user-error))
138 (condition-case err
139 (macroexpand-all '(macroexp--test-macro2))
140 (user-error (error-message-string err))))))
141 (should (and (stringp res) (string-match "new-replacement" res))))))
142
127;;; macroexp-tests.el ends here 143;;; 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."
1530 (equal (comp-mvar-typeset mvar) 1530 (equal (comp-mvar-typeset mvar)
1531 comp-tests-cond-rw-expected-type)))))))) 1531 comp-tests-cond-rw-expected-type))))))))
1532 1532
1533(ert-deftest comp-tests-result-lambda () 1533(comp-deftest comp-tests-result-lambda ()
1534 (native-compile 'comp-tests-result-lambda) 1534 (native-compile 'comp-tests-result-lambda)
1535 (should (eq (funcall (comp-tests-result-lambda) '(a . b)) 'a))) 1535 (should (eq (funcall (comp-tests-result-lambda) '(a . b)) 'a)))
1536;;; comp-tests.el ends here 1536;;; comp-tests.el ends here