From 5ab144c77cda1d56f0dd62606c316c712a0d2563 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 21 May 2024 15:34:50 +0300 Subject: [PATCH 1/7] ; Improve documentation of backing up files * doc/emacs/files.texi (Backup Copying): Mention that 'backup-by-copying' is safer. Document 'file-precious-flag'. (Bug#71074) --- doc/emacs/files.texi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 393c4728422..01d22564f2e 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -786,6 +786,14 @@ those previous versions. If you want to be able to do that with files hosted by those services when editing them with Emacs, customize @code{backup-by-copying} to a non-@code{nil} value. +@vindex file-precious-flag + Copying the old file for backup is also useful when editing precious +files, because it makes sure the old file keeps its name if something +fails between the backup and the saving of your edits. Alternatively, +you can customize @code{file-precious-flag} to a non-@code{nil} value, +which implies backups by copying and also protects against I/O errors +while saving your edits. + @node Customize Save @subsection Customizing Saving of Files From ccf8dba44a3071d56e54a20276e00a6cdcc4b135 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 21 May 2024 15:40:51 +0300 Subject: [PATCH 2/7] ; * lisp/face-remap.el (text-scale-adjust): Doc fix. --- lisp/face-remap.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/face-remap.el b/lisp/face-remap.el index d269d85301c..b9fdad2be17 100644 --- a/lisp/face-remap.el +++ b/lisp/face-remap.el @@ -387,9 +387,10 @@ this are the `default' and `header-line' faces: they will both be scaled even if they have an explicit `:height' setting. See also the related command `global-text-scale-adjust'. Unlike -that command, which scales the font size with a increment, -`text-scale-adjust' scales the font size with a factor, -`text-scale-mode-step'. With a small `text-scale-mode-step' +that command, which scales the font size with a increment (and can +also optionally resize frames to keep the same number of lines and +characters per line), `text-scale-adjust' scales the font size with +a factor, `text-scale-mode-step'. With a small `text-scale-mode-step' factor, the two commands behave similarly." (interactive "p") (let ((ev last-command-event) From 350ae75f5c1c47a03560e43e8699781c04c9078a Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 22 May 2024 14:10:53 +0300 Subject: [PATCH 3/7] Avoid crashes on MS-Windows due to invalid UNC file names * src/w32.c (parse_root): Avoid crashes due to invalid (too short) UNC names, such as "\\". (Bug#70914) * test/src/fileio-tests.el (fileio-tests-invalid-UNC): New test. --- src/w32.c | 2 +- test/src/fileio-tests.el | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/w32.c b/src/w32.c index d463962b6c3..a78d5569fe6 100644 --- a/src/w32.c +++ b/src/w32.c @@ -2572,7 +2572,7 @@ parse_root (const char * name, const char ** pPath) name += 2; do { - if (IS_DIRECTORY_SEP (*name) && --slashes == 0) + if (!*name || (IS_DIRECTORY_SEP (*name) && --slashes == 0)) break; name++; } diff --git a/test/src/fileio-tests.el b/test/src/fileio-tests.el index 764ae662e15..136d3813a2b 100644 --- a/test/src/fileio-tests.el +++ b/test/src/fileio-tests.el @@ -218,4 +218,10 @@ Also check that an encoding error can appear in a symlink." (should (equal (expand-file-name file nil) file)) (file-name-case-insensitive-p file))) +(ert-deftest fileio-tests-invalid-UNC () + (skip-unless (eq system-type 'windows-nt)) + ;; These should not crash, see bug#70914. + (should-not (file-exists-p "//")) + (should (file-attributes "//"))) + ;;; fileio-tests.el ends here From 3291dea441f25ca14619bebe493ffb694f53cf9d Mon Sep 17 00:00:00 2001 From: Brad Knotwell Date: Fri, 24 May 2024 00:00:37 -0700 Subject: [PATCH 4/7] Fix example in Calc manual * doc/misc/calc.texi (Defining Simple Commands): Fix typo in command names. (Bug#71166) Copyright-paperwork-exempt: yes --- doc/misc/calc.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 75f88efe259..47c34a7e39b 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -32480,9 +32480,9 @@ decreases the precision. (put 'calc-define 'inc-prec '(progn (define-key calc-mode-map (format "Y%sI" inc-prec-base-key) - 'increase-precision) + 'calc-increase-precision) (define-key calc-mode-map (format "Y%sD" inc-prec-base-key) - 'decrease-precision) + 'calc-decrease-precision) (setq calc-Y-help-msgs (cons (format "%s + Inc-prec, Dec-prec" inc-prec-base-key) From 3647645e94856344696768bef590b49a24c7ac52 Mon Sep 17 00:00:00 2001 From: kobarity Date: Fri, 24 May 2024 22:50:12 +0900 Subject: [PATCH 5/7] Fix Python font lock of chained assignment statement * lisp/progmodes/python.el (python-font-lock-keywords-maximum-decoration): Allow chaining of single assignment statements. * test/lisp/progmodes/python-tests.el (python-font-lock-assignment-statement-20): New test. (Bug#71093) --- lisp/progmodes/python.el | 3 +-- test/lisp/progmodes/python-tests.el | 10 ++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 02588d756e9..051f198e192 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -812,8 +812,7 @@ sign in chained assignment." ;; c: Collection = {1, 2, 3} ;; d: Mapping[int, str] = {1: 'bar', 2: 'baz'} (,(python-font-lock-assignment-matcher - (python-rx (or line-start ?\;) (* space) - grouped-assignment-target (* space) + (python-rx grouped-assignment-target (* space) (? ?: (* space) (+ not-simple-operator) (* space)) (group assignment-operator))) (1 font-lock-variable-name-face) diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 95db93dd5cc..06943e22f5b 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -474,6 +474,16 @@ def f(x: CustomInt) -> CustomInt: (136 . font-lock-operator-face) (137) (144 . font-lock-keyword-face) (150)))) +(ert-deftest python-font-lock-assignment-statement-20 () + (python-tests-assert-faces + "a = b = c = 1" + '((1 . font-lock-variable-name-face) (2) + (3 . font-lock-operator-face) (4) + (5 . font-lock-variable-name-face) (6) + (7 . font-lock-operator-face) (8) + (9 . font-lock-variable-name-face) (10) + (11 . font-lock-operator-face) (12)))) + (ert-deftest python-font-lock-escape-sequence-string-newline () (python-tests-assert-faces "'\\n' From 1bf658366220ce1019721f24d96ef8f82bd18cff Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 25 May 2024 13:22:45 +0300 Subject: [PATCH 6/7] Improve documentation of 'no-special-glyphs' frame parameter * doc/lispref/frames.texi (Layout Parameters): Document limitations of support for 'no-special-glyphs' frame parameter. (Bug#71163) * doc/lispref/display.texi (Truncation): Update for when 'fringe-mode' is off. --- doc/lispref/display.texi | 3 ++- doc/lispref/frames.texi | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 869bf15a40a..ef44c8d80f5 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -148,7 +148,8 @@ boundary. @xref{Filling}. On a graphical display, tiny arrow images in the window fringes indicate truncated and continued lines (@pxref{Fringes}). On a text -terminal, a @samp{$} in the rightmost column of the window indicates +terminal, and on a graphical display when @code{fringe-mode} was +turned off, a @samp{$} in the rightmost column of the window indicates truncation; a @samp{\} on the rightmost column indicates a line that wraps. (The display table can specify alternate characters to use for this; @pxref{Display Tables}). diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index edc080153d6..fe5745a85ab 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -1928,10 +1928,16 @@ integer). @xref{Line Height}, for more information. @vindex no-special-glyphs@r{, a frame parameter} @item no-special-glyphs If this is non-@code{nil}, it suppresses the display of any truncation -and continuation glyphs (@pxref{Truncation}) for all buffers displayed -by this frame. This is useful to eliminate such glyphs when fitting a -frame to its buffer via @code{fit-frame-to-buffer} (@pxref{Resizing -Windows}). +(@pxref{Truncation}) and continuation glyphs for all the buffers +displayed by this frame. This is useful to eliminate such glyphs when +fitting a frame to its buffer via @code{fit-frame-to-buffer} +(@pxref{Resizing Windows}). This frame parameter has effect only for +GUI frames shown on graphical displays, and only if the fringes are +disabled. This parameter is intended as a purely-presentation +feature, and in particular should not be used for frames where the +user can interactively insert text, or more generally where the cursor +is shown. A notable example of frames where this is used is tooltip +frames (@pxref{Tooltips}). @end table From 4f0121f8dbe2ca0ec8fe2831353f01782e5e6b9d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 25 May 2024 14:23:43 +0300 Subject: [PATCH 7/7] Avoid assertion violations in displaying under 'outline-minor-mode' * src/xdisp.c (init_from_display_pos): Initialize BYTEPOS correctly, since 'init_iterator' no longer computes it from CHARPOS as needed. This fixes a change made on Mar 13, 2013. (Bug#71194) --- src/xdisp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xdisp.c b/src/xdisp.c index 6e945ed114b..1b198df4076 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -3876,7 +3876,7 @@ init_from_display_pos (struct it *it, struct window *w, struct display_pos *pos) if (in_ellipses_for_invisible_text_p (pos, w)) { --charpos; - bytepos = 0; + bytepos = BYTE_TO_CHAR (charpos); } /* Keep in mind: the call to reseat in init_iterator skips invisible