From 1e8322bb26e4945de460780168732250bbd083d0 Mon Sep 17 00:00:00 2001 From: Jim Porter Date: Fri, 4 Aug 2023 13:01:35 -0700 Subject: [PATCH 1/8] Fix handling of 'byte-compile-ignore-files' when nil Before this fix, when 'byte-compile-ignore-files' was nil, 'byte-recompile-directory' would ignore every file (bug#64985). * lisp/emacs-lisp/bytecomp.el (byte-recompile-directory): Handle case when 'byte-compile-ignore-files' is nil. --- lisp/emacs-lisp/bytecomp.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 65ccb60726f..d093d95a775 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1923,7 +1923,9 @@ also be compiled." (let ((directories (list default-directory)) (default-directory default-directory) (ignore-files-regexp - (mapconcat #'identity byte-compile-ignore-files "\\|")) + (if byte-compile-ignore-files + (mapconcat #'identity byte-compile-ignore-files "\\|") + regexp-unmatchable)) (skip-count 0) (fail-count 0) (file-count 0) From 20df82fd43aa2d02a9613a073e1bc27647b20576 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 6 Aug 2023 12:10:37 +0300 Subject: [PATCH 2/8] ; * admin/notes/unicode (char-width-table): Update instructions. --- admin/notes/unicode | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/admin/notes/unicode b/admin/notes/unicode index 31c850af8fd..b4f23f68def 100644 --- a/admin/notes/unicode +++ b/admin/notes/unicode @@ -72,7 +72,10 @@ characters are those marked with W or F in that file. Zero-width characters are not taken from EastAsianWidth.txt, they are those whose Unicode General Category property is one of Mn, Me, or Cf, and also Hangul jungseong and jongseong characters (a.k.a. "Jamo medial vowels" -and "Jamo final consonants"). +and "Jamo final consonants"). The list of "ambiguous-width +characters" recorded in the ambiguous-width-chars table (around line +1400 of characters.el) should also be checked against the latest +Unicode data in EastAsianWidth.txt. Any new scripts added by UnicodeData.txt will also need updates to script-representative-chars defined in fontset.el, and also the list From 67650c9c11a0afe33e2a27a8669b6925a6606212 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 6 Aug 2023 11:19:27 +0200 Subject: [PATCH 3/8] Mark unused macro defun-gmm obsolete * lisp/gnus/gmm-utils.el (defun-gmm): Mark as obsolete. --- lisp/gnus/gmm-utils.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/gnus/gmm-utils.el b/lisp/gnus/gmm-utils.el index 2fc89681ba5..c0651e3dbfc 100644 --- a/lisp/gnus/gmm-utils.el +++ b/lisp/gnus/gmm-utils.el @@ -200,7 +200,8 @@ DEFAULT-MAP specifies the default key map for ICON-LIST." "Create function NAME. If FUNCTION exists, then NAME becomes an alias for FUNCTION. Otherwise, create function NAME with ARG-LIST and BODY." - (declare (indent defun)) + (declare (obsolete nil "30.1") + (indent defun)) (let ((defined-p (fboundp function))) (if defined-p `(defalias ',name ',function) From 3135007bf16b67943eb0c9ba72b06356c9424f31 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 6 Aug 2023 11:35:02 +0200 Subject: [PATCH 4/8] Mark Emacs 20 color support compat aliases obsolete * lisp/faces.el (x-defined-colors, x-color-defined-p) (x-color-values, x-display-color-p): Make Emacs 20 compat aliases obsolete. Update one caller to use the new names. * doc/lispref/frames.texi (Color Names): Do not document above obsolete aliases. --- doc/lispref/frames.texi | 15 --------------- etc/NEWS | 5 +++++ lisp/emulation/viper-cmd.el | 10 +++++----- lisp/faces.el | 10 ++++------ 4 files changed, 14 insertions(+), 26 deletions(-) diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 368def90d85..42f1a42c73b 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -4461,20 +4461,12 @@ really supports that color. When using X, you can ask for any defined color on any kind of display, and you will get some result---typically, the closest it can do. To determine whether a frame can really display a certain color, use @code{color-supported-p} (see below). - -@findex x-color-defined-p -This function used to be called @code{x-color-defined-p}, -and that name is still supported as an alias. @end defun @defun defined-colors &optional frame This function returns a list of the color names that are defined and supported on frame @var{frame} (default, the selected frame). If @var{frame} does not support colors, the value is @code{nil}. - -@findex x-defined-colors -This function used to be called @code{x-defined-colors}, -and that name is still supported as an alias. @end defun @defun color-supported-p color &optional frame background-p @@ -4526,10 +4518,6 @@ The color values are returned for @var{frame}'s display. If @var{frame} is omitted or @code{nil}, the information is returned for the selected frame's display. If the frame cannot display colors, the value is @code{nil}. - -@findex x-color-values -This function used to be called @code{x-color-values}, -and that name is still supported as an alias. @end defun @defun color-name-to-rgb color &optional frame @@ -4714,10 +4702,7 @@ This function returns @code{t} if @var{display} has a mouse available, @end defun @defun display-color-p &optional display -@findex x-display-color-p This function returns @code{t} if the screen is a color screen. -It used to be called @code{x-display-color-p}, and that name -is still supported as an alias. @end defun @defun display-grayscale-p &optional display diff --git a/etc/NEWS b/etc/NEWS index 0dd663edcc6..9cd672dd1b9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -701,6 +701,11 @@ Instead, the Lisp reader approximates an infinity with the nearest finite value, and a NaN with some other non-numeric object that provokes an error if used numerically. ++++ +** X color support compatibility aliases are now marked obsolete. +The compatibility aliases 'x-defined-colors', 'x-color-defined-p', +'x-color-values', and 'x-display-color-p' are now obsolete. + * Lisp Changes in Emacs 30.1 diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index c0aa9dd7b46..78114db0972 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el @@ -4724,15 +4724,15 @@ Please, specify your level now: ")) (defun viper-submit-report () "Submit bug report on Viper." (interactive) - (defvar x-display-color-p) + (defvar display-color-p) (defvar viper-frame-parameters) (defvar viper-minibuffer-emacs-face) (defvar viper-minibuffer-vi-face) (defvar viper-minibuffer-insert-face) (let ((reporter-prompt-for-summary-p t) - (x-display-color-p (if (viper-window-display-p) - (x-display-color-p) - 'non-x)) + (display-color-p (if (viper-window-display-p) + (display-color-p) + 'non-x)) (viper-frame-parameters (frame-parameters (selected-frame))) (viper-minibuffer-emacs-face (if (viper-has-face-support-p) (facep @@ -4790,7 +4790,7 @@ Please, specify your level now: ")) 'viper-expert-level 'major-mode 'window-system - 'x-display-color-p + 'display-color-p 'viper-frame-parameters 'viper-minibuffer-vi-face 'viper-minibuffer-insert-face diff --git a/lisp/faces.el b/lisp/faces.el index dad16966f48..3ad6fe59557 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1850,7 +1850,6 @@ If there is neither a user setting nor a default for FACE, return nil." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Frame-type independent color support. -;;; We keep the old x-* names as aliases for back-compatibility. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun defined-colors (&optional frame) @@ -1862,7 +1861,6 @@ If FRAME is nil, that stands for the selected frame." (if (display-graphic-p frame) (xw-defined-colors frame) (mapcar 'car (tty-color-alist frame)))) -(defalias 'x-defined-colors 'defined-colors) (defun defined-colors-with-face-attributes (&optional frame foreground) "Return a list of colors supported for a particular FRAME. @@ -1946,7 +1944,6 @@ If FRAME is omitted or nil, use the selected frame." (if (display-graphic-p frame) (xw-color-defined-p color frame) (numberp (tty-color-translate color frame))))) -(defalias 'x-color-defined-p 'color-defined-p) (declare-function xw-color-values "xfns.c" (color &optional frame)) @@ -1974,8 +1971,6 @@ return value is nil." (t (tty-color-values color frame)))) -(defalias 'x-color-values 'color-values) - (declare-function xw-display-color-p "xfns.c" (&optional terminal)) (defun display-color-p (&optional display) @@ -1986,7 +1981,6 @@ If omitted or nil, that stands for the selected frame's display." (if (display-graphic-p display) (xw-display-color-p display) (tty-display-color-p display))) -(defalias 'x-display-color-p 'display-color-p) (declare-function x-display-grayscale-p "xfns.c" (&optional terminal)) @@ -3221,6 +3215,10 @@ also the same size as FACE on FRAME, or fail." (define-obsolete-function-alias 'face-background-pixmap #'face-stipple "29.1") (define-obsolete-function-alias 'set-face-background-pixmap #'set-face-stipple "29.1") +(define-obsolete-function-alias 'x-defined-colors #'defined-colors "30.1") +(define-obsolete-function-alias 'x-color-defined-p #'color-defined-p "30.1") +(define-obsolete-function-alias 'x-color-values #'color-values "30.1") +(define-obsolete-function-alias 'x-display-color-p #'display-color-p "30.1") (provide 'faces) From 5f24ca555383e039d93a852d239d5f2c8781d6c8 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 6 Aug 2023 11:43:48 +0200 Subject: [PATCH 5/8] Suppress some Tramp tests for OpenBSD * test/lisp/net/tramp-tests.el (tramp--test-openbsd-p): New defun. (tramp-test41-special-characters, tramp-test42-utf8): Use it. (Bug#64935) --- test/lisp/net/tramp-tests.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index d97785ee481..a92f047a42e 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -7083,6 +7083,12 @@ This does not support external Emacs calls." (string-equal "mock" (file-remote-p ert-remote-temporary-file-directory 'method))) +(defun tramp--test-openbsd-p () + "Check, whether the remote host runs OpenBSD." + ;; We must refill the cache. `file-truename' does it. + (file-truename ert-remote-temporary-file-directory) + (ignore-errors (tramp-check-remote-uname tramp-test-vec "OpenBSD"))) + (defun tramp--test-out-of-band-p () "Check, whether an out-of-band method is used." (tramp-method-out-of-band-p tramp-test-vec 1)) @@ -7408,6 +7414,7 @@ This requires restrictions of file name syntax." (tramp--test-windows-nt-or-smb-p)) "foo bar baz") ((or (tramp--test-adb-p) + (tramp--test-openbsd-p) (eq system-type 'cygwin)) " foo bar baz ") ((tramp--test-sh-no-ls--dired-p) @@ -7485,7 +7492,8 @@ This requires restrictions of file name syntax." "Автостопом по гала́ктике" ;; Use codepoints without a name. See Bug#31272. ;; Works on some Android systems only. - (unless (tramp--test-adb-p) "™›šbung") + (unless (or (tramp--test-adb-p) (tramp--test-openbsd-p)) + "™›šbung") ;; Use codepoints from Supplementary Multilingual Plane (U+10000 ;; to U+1FFFF). "🌈🍒👋") From 2c04adca4d3c123cc29b4150758a17c23101290c Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 6 Aug 2023 12:14:40 +0200 Subject: [PATCH 6/8] ; Silence byte-compiler * test/src/treesit-tests.el (treesit-pattern-expand): Declare. --- test/src/treesit-tests.el | 1 + 1 file changed, 1 insertion(+) diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el index 34540b463cd..65994ce608f 100644 --- a/test/src/treesit-tests.el +++ b/test/src/treesit-tests.el @@ -34,6 +34,7 @@ (declare-function treesit-parser-buffer "treesit.c") (declare-function treesit-parser-language "treesit.c") +(declare-function treesit-pattern-expand "treesit.c") (declare-function treesit-query-expand "treesit.c") (declare-function treesit-query-compile "treesit.c") (declare-function treesit-query-capture "treesit.c") From 2924541b8f17e31eea58b231d1af7c0c8844deff Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 6 Aug 2023 13:50:11 +0200 Subject: [PATCH 7/8] ; Fix last patch --- test/lisp/net/tramp-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index a92f047a42e..a6c430fb1c0 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -7409,12 +7409,12 @@ This requires restrictions of file name syntax." (cond ((or (tramp--test-ange-ftp-p) (tramp--test-container-p) (tramp--test-gvfs-p) + (tramp--test-openbsd-p) (tramp--test-rclone-p) (tramp--test-sudoedit-p) (tramp--test-windows-nt-or-smb-p)) "foo bar baz") ((or (tramp--test-adb-p) - (tramp--test-openbsd-p) (eq system-type 'cygwin)) " foo bar baz ") ((tramp--test-sh-no-ls--dired-p) From 10a7615b5d45bcd909bb03d67423b337dfe93b1e Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 6 Aug 2023 07:00:22 -0400 Subject: [PATCH 8/8] Separate filename-deletion mechanism from policy. src/fileio.c: (delete-file-internal) Renamed from delete-file, parallel to delete-directory-internal; policy code moved to Lisp. src/files.el: (delete-file) New function, holds policy logic. calls delete-file-internal. This is a pure refactoring step, delete-file's behavior is unchanged. But the C core is a little simpler now. --- lisp/files.el | 20 ++++++++++++++++++++ src/fileio.c | 40 +++++++++------------------------------- 2 files changed, 29 insertions(+), 31 deletions(-) diff --git a/lisp/files.el b/lisp/files.el index f8867432000..84a8c308b09 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -6352,6 +6352,26 @@ non-nil and if FN fails due to a missing file or directory." (apply fn args) (file-missing (or no-such (signal (car err) (cdr err)))))) +(defun delete-file (filename &optional trash) + "Delete file named FILENAME. If it is a symlink, remove the symlink. +If file has multiple names, it continues to exist with the other names.q +TRASH non-nil means to trash the file instead of deleting, provided +`delete-by-moving-to-trash' is non-nil. + +When called interactively, TRASH is t if no prefix argument is given. +With a prefix argument, TRASH is nil." + (interactive (list (read-file-name + (if (and delete-by-moving-to-trash (null current-prefix-arg)) + "Move file to trash: " "Delete file: ") + nil default-directory (confirm-nonexistent-file-or-buffer)) + (null current-prefix-arg))) + (if (and (file-directory-p filename) (not (file-symlink-p filename))) + (signal 'file-error (list "Removing old name: is a directory" filename))) + (let* ((filename (expand-file-name filename)) (handler (find-file-name-handler filename 'delete-file))) + (cond (handler (funcall handler 'delete-file filename trash)) + ((and delete-by-moving-to-trash trash) (move-file-to-trash filename)) + (t (delete-file-internal filename))))) + (defun delete-directory (directory &optional recursive trash) "Delete the directory named DIRECTORY. Does not follow symlinks. If RECURSIVE is non-nil, delete files in DIRECTORY as well, with diff --git a/src/fileio.c b/src/fileio.c index 63f4e698528..e49a4a3836b 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2462,38 +2462,13 @@ DEFUN ("delete-directory-internal", Fdelete_directory_internal, return Qnil; } -DEFUN ("delete-file", Fdelete_file, Sdelete_file, 1, 2, - "(list (read-file-name \ - (if (and delete-by-moving-to-trash (null current-prefix-arg)) \ - \"Move file to trash: \" \"Delete file: \") \ - nil default-directory (confirm-nonexistent-file-or-buffer)) \ - (null current-prefix-arg))", +DEFUN ("delete-file-internal", Fdelete_file_internal, Sdelete_file_internal, 1, 1, 0, doc: /* Delete file named FILENAME. If it is a symlink, remove the symlink. -If file has multiple names, it continues to exist with the other names. -TRASH non-nil means to trash the file instead of deleting, provided -`delete-by-moving-to-trash' is non-nil. - -When called interactively, TRASH is t if no prefix argument is given. -With a prefix argument, TRASH is nil. */) - (Lisp_Object filename, Lisp_Object trash) +If file has multiple names, it continues to exist with the other names. */) + (Lisp_Object filename) { - Lisp_Object handler; Lisp_Object encoded_file; - if (!NILP (Ffile_directory_p (filename)) - && NILP (Ffile_symlink_p (filename))) - xsignal2 (Qfile_error, - build_string ("Removing old name: is a directory"), - filename); - filename = Fexpand_file_name (filename, Qnil); - - handler = Ffind_file_name_handler (filename, Qdelete_file); - if (!NILP (handler)) - return call3 (handler, Qdelete_file, filename, trash); - - if (delete_by_moving_to_trash && !NILP (trash)) - return call1 (Qmove_file_to_trash, filename); - encoded_file = ENCODE_FILE (filename); if (unlink (SSDATA (encoded_file)) != 0 && errno != ENOENT) @@ -2725,7 +2700,7 @@ This is what happens in interactive use with M-x. */) if (dirp) call2 (Qdelete_directory, file, Qt); else - Fdelete_file (file, Qnil); + call2 (Qdelete_file, file, Qnil); return unbind_to (count, Qnil); } @@ -6346,7 +6321,7 @@ syms_of_fileio (void) DEFSYM (Qcopy_file, "copy-file"); DEFSYM (Qmake_directory_internal, "make-directory-internal"); DEFSYM (Qmake_directory, "make-directory"); - DEFSYM (Qdelete_file, "delete-file"); + DEFSYM (Qdelete_file_internal, "delete-file-internal"); DEFSYM (Qfile_name_case_insensitive_p, "file-name-case-insensitive-p"); DEFSYM (Qrename_file, "rename-file"); DEFSYM (Qadd_name_to_file, "add-name-to-file"); @@ -6610,6 +6585,9 @@ This includes interactive calls to `delete-file' and delete_by_moving_to_trash = 0; DEFSYM (Qdelete_by_moving_to_trash, "delete-by-moving-to-trash"); + /* Lisp function for interactive file delete with trashing */ + DEFSYM (Qdelete_file, "delete-file"); + /* Lisp function for moving files to trash. */ DEFSYM (Qmove_file_to_trash, "move-file-to-trash"); @@ -6641,7 +6619,7 @@ This includes interactive calls to `delete-file' and defsubr (&Scopy_file); defsubr (&Smake_directory_internal); defsubr (&Sdelete_directory_internal); - defsubr (&Sdelete_file); + defsubr (&Sdelete_file_internal); defsubr (&Sfile_name_case_insensitive_p); defsubr (&Srename_file); defsubr (&Sadd_name_to_file);