commit b6807a7ddce41e99d320be5f23972f218af004a8 (HEAD, refs/remotes/origin/master) Author: Gerd Möllmann Date: Fri Dec 13 15:54:21 2024 +0100 Improve menu separator display on ttys slightly (bug#74854) * src/xdisp.c (display_tty_menu_separator): New function displaying separators with '-', '=', or ' '. (display_tty_menu_item): Use it. diff --git a/src/xdisp.c b/src/xdisp.c index 7b0e2644078..e5fc4a12263 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -27256,6 +27256,35 @@ deep_copy_glyph_row (struct glyph_row *to, struct glyph_row *from) fill_up_frame_row_with_spaces (to, to_used); } +/* Produce glyphs for a menu separator on a tty. + + FIXME: This is only a "good enough for now" implementation of menu + separators as described in the Elisp info manual. We should probably + ignore menu separators when computing the width of a menu. Secondly, + optionally using Unicode characters via display table entries would + be nice. Patches very welcome. */ + +static void +display_tty_menu_separator (struct it *it, const char *label, int width) +{ + USE_SAFE_ALLOCA; + char c; + if (strcmp (label, "--space") == 0) + c = ' '; + else if (strcmp (label, "--double-line") == 0) + c = '='; + else + c = '-'; + char *sep = SAFE_ALLOCA (width); + memset (sep, c, width - 1); + sep[width - 1] = 0; + display_string (sep, Qnil, Qnil, 0, 0, it, width - 1, width - 1, + FRAME_COLS (it->f) - 1, -1); + display_string (" ", Qnil, Qnil, 0, 0, it, 1, 0, + FRAME_COLS (it->f) - 1, -1); + SAFE_FREE (); +} + /* Display one menu item on a TTY, by overwriting the glyphs in the frame F's desired glyph matrix with glyphs produced from the menu item text. Called from term.c to display TTY drop-down menus one @@ -27330,6 +27359,7 @@ display_tty_menu_item (const char *item_text, int width, int face_id, /* Pad with a space on the left. */ display_string (" ", Qnil, Qnil, 0, 0, &it, 1, 0, FRAME_COLS (f) - 1, -1); width--; + /* Display the menu item, pad with spaces to WIDTH. */ if (submenu) { @@ -27340,20 +27370,13 @@ display_tty_menu_item (const char *item_text, int width, int face_id, display_string (" >", Qnil, Qnil, 0, 0, &it, width, 0, FRAME_COLS (f) - 1, -1); } - else if (menu_separator_name_p (item_text)) + else if (menu_separator_name_p (item_text)) { - /* FIXME: This is only a "good enough for now" implementation of - menu separators as described in the Elisp info manual. We - should probably ignore menu separators when computing the width - of a menu. Secondly, we could draw actual horizontal lines of - different styles on ttys, maybe optionally using Unicode - characters via display table entries. Patches very welcome. */ - display_string ("--", Qnil, Qnil, 0, 0, &it, width, 0, - FRAME_COLS (f) - 1, -1); + display_tty_menu_separator (&it, item_text, width); } else - display_string (item_text, Qnil, Qnil, 0, 0, &it, - width, 0, FRAME_COLS (f) - 1, -1); + display_string (item_text, Qnil, Qnil, 0, 0, &it, width, 0, + FRAME_COLS (f) - 1, -1); row->used[TEXT_AREA] = max (saved_used, row->used[TEXT_AREA]); row->truncated_on_right_p = saved_truncated; commit 71cd290c20dbbd8b14f09818b3c1b58623aea350 Author: kobarity Date: Wed Dec 11 23:21:04 2024 +0900 Fix font-lock of Python f-strings * lisp/progmodes/python.el (python--font-lock-f-strings): Bind 'parse-sexp-ignore-comments' to nil so that we can look for closing braces even if a hash is used in the format specifier. * test/lisp/progmodes/python-tests.el (python-font-lock-f-string-1): New test. (Bug#74738) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 4a1cfc6c072..5729b12573f 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -623,7 +623,9 @@ the {...} holes that appear within f-strings." (forward-char 1) ;Just skip over {{ (let ((beg (match-beginning 0)) (end (condition-case nil - (progn (up-list 1) (min send (point))) + (let ((parse-sexp-ignore-comments)) + (up-list 1) + (min send (point))) (scan-error send)))) (goto-char end) (put-text-property beg end 'face nil)))) diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 4cc4040d0ff..ac17c5b1263 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -709,6 +709,14 @@ y = \"confused\"" (17 . font-lock-operator-face) (18) (19 . font-lock-string-face)))) +(ert-deftest python-font-lock-f-string-1 () + "Test for bug#74738." + (python-tests-assert-faces + "print(f\"{value:#x} is a value\")" + '((1 . font-lock-builtin-face) (6) + (8 . font-lock-string-face) (9) + (19 . font-lock-string-face) (31)))) + ;;; Indentation commit dde5d0a41e2a700f2eb17e93a5e5586195c5780d Author: Stefan Monnier Date: Fri Dec 13 17:47:22 2024 -0500 * lisp/help-fns.el (help-fns-short-filename): Skip relative file names diff --git a/lisp/help-fns.el b/lisp/help-fns.el index c87c86bae84..157ec6b8d61 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1064,22 +1064,30 @@ TYPE indicates the namespace and is `fun' or `var'." rt))) (defun help-fns-short-filename (filename) - (let* ((short (help-fns--filename filename)) - (prefixes (radix-tree-prefixes (help-fns--radix-tree load-path) - (file-name-directory short)))) - (if (not prefixes) - ;; The file is not inside the `load-path'. - ;; FIXME: Here's the old code (too slow, bug#73766), - ;; which used to try and shorten it with "../" as well. - ;; (dolist (dir load-path) - ;; (let ((rel (file-relative-name filename dir))) - ;; (if (< (length rel) (length short)) - ;; (setq short rel))) - ;; (let ((rel (file-relative-name abbrev dir))) - ;; (if (< (length rel) (length short)) - ;; (setq short rel)))) - short - (file-relative-name short (caar prefixes))))) + "Turn a full Elisp file name to one relative to `load-path'." + (if (not (file-name-absolute-p filename)) + ;; This happens when FILENAME is a `src/*.c' returned by + ;; `help-C-file-name', in which case it's not searched through + ;; `load-path' anyway (bug#74504). + ;; Even if it came from elsewhere it's not clear to + ;; which directory it is relative. + filename + (let* ((short (help-fns--filename filename)) + (prefixes (radix-tree-prefixes (help-fns--radix-tree load-path) + (file-name-directory short)))) + (if (not prefixes) + ;; The file is not inside the `load-path'. + ;; FIXME: Here's the old code (too slow, bug#73766), + ;; which used to try and shorten it with "../" as well. + ;; (dolist (dir load-path) + ;; (let ((rel (file-relative-name filename dir))) + ;; (if (< (length rel) (length short)) + ;; (setq short rel))) + ;; (let ((rel (file-relative-name abbrev dir))) + ;; (if (< (length rel) (length short)) + ;; (setq short rel)))) + short + (file-relative-name short (caar prefixes)))))) (defun help-fns--analyze-function (function) ;; FIXME: Document/explain the differences between FUNCTION, commit 5923d8ebef93075e053cf50e17b86d34731fe777 Author: Stefan Monnier Date: Fri Dec 13 16:14:45 2024 -0500 * lisp/org/ox-texinfo.el (org-texinfo-template): Fix direntry format Apparently I was confused and `* FILE. DESCRIPTION` is not a valid format, so always use the longer form. diff --git a/lisp/org/ox-texinfo.el b/lisp/org/ox-texinfo.el index 6adee9fca3f..deceeca8947 100644 --- a/lisp/org/ox-texinfo.el +++ b/lisp/org/ox-texinfo.el @@ -826,9 +826,7 @@ holding export options." ;; `dn' is presumed to be just the DIRNAME part, so generate ;; either `* DIRNAME: (FILENAME).' or `* FILENAME.', whichever ;; is shortest. - ((and dn (not (equal dn file))) - (format "* %s: (%s)." dn (or file dn))) - (t (format "* %s." file))))) + (t (format "* %s: (%s)." dn (or file dn)))))) (concat "@dircategory " dircat "\n" "@direntry\n" (let ((dirdesc commit 69a61f721dda73fb11f2be0ad5c9eaacc82216ab Author: Eli Zaretskii Date: Fri Dec 13 20:52:14 2024 +0200 * nt/inc/netinet/tcp.h: New (empty) file. diff --git a/nt/inc/netinet/tcp.h b/nt/inc/netinet/tcp.h new file mode 100644 index 00000000000..705f1795178 --- /dev/null +++ b/nt/inc/netinet/tcp.h @@ -0,0 +1 @@ +/* null version of - has everything */