commit 803041e01474f2a522170c9f388068e8460be2ae (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Tue May 17 03:11:23 2022 +0000 Remove extra EmacsPopUpMenu class * src/haiku_support.cc (class EmacsPopUpMenu): Delete class that does nothing. (BPopUpMenu_new): Use BPopUpMenu directly. (BMenu_add_title): Clean up coding style. diff --git a/src/haiku_support.cc b/src/haiku_support.cc index 6cdc4e31be..c883d86534 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -2383,22 +2383,6 @@ class EmacsMenuItem : public BMenuItem } }; -class EmacsPopUpMenu : public BPopUpMenu -{ -public: - EmacsPopUpMenu (const char *name) : BPopUpMenu (name, 0) - { - - } - - void - FrameResized (float w, float h) - { - Invalidate (); - BPopUpMenu::FrameResized (w, h); - } -}; - class EmacsFontPreviewDialog : public BWindow { BStringView text_view; @@ -3745,7 +3729,8 @@ BView_emacs_delete (void *view) void * BPopUpMenu_new (const char *name) { - BPopUpMenu *menu = new EmacsPopUpMenu (name); + BPopUpMenu *menu = new BPopUpMenu (name); + menu->SetRadioMode (0); return menu; } @@ -3755,9 +3740,11 @@ BPopUpMenu_new (const char *name) void BMenu_add_title (void *menu, const char *text) { - EmacsTitleMenuItem *it = new EmacsTitleMenuItem (text); - BMenu *mn = (BMenu *) menu; - mn->AddItem (it); + BMenu *be_menu = (BMenu *) menu; + EmacsTitleMenuItem *it; + + it = new EmacsTitleMenuItem (text); + be_menu->AddItem (it); } /* Add an item to the menu MENU. */ commit 316fbc8ccb33ad75d276b083dc027a2bb4d0dc66 Author: Po Lu Date: Tue May 17 02:51:42 2022 +0000 Add more cursor bitmaps on Haiku * src/haikufns.c (cursor_bitmaps_for_id): Add vertd, horizd and hand bitmaps. diff --git a/src/haikufns.c b/src/haikufns.c index e783ceec0f..d55cdac44d 100644 --- a/src/haikufns.c +++ b/src/haikufns.c @@ -1882,6 +1882,7 @@ struct user_cursor_bitmap_info cursor_bitmaps_for_id[28] = { NULL, NULL, 0, 0, 0, 0 }, { cross_ptr_bits, cross_ptrmask_bits, 30, 30, 15, 15 }, { NULL, NULL, 0, 0, 0, 0 }, + { hand_ptr_bits, hand_ptrmask_bits, 15, 15, 4, 3 }, { NULL, NULL, 0, 0, 0, 0 }, { NULL, NULL, 0, 0, 0, 0 }, { NULL, NULL, 0, 0, 0, 0 }, @@ -1897,9 +1898,8 @@ struct user_cursor_bitmap_info cursor_bitmaps_for_id[28] = { NULL, NULL, 0, 0, 0, 0 }, { NULL, NULL, 0, 0, 0, 0 }, { NULL, NULL, 0, 0, 0, 0 }, - { NULL, NULL, 0, 0, 0, 0 }, - { NULL, NULL, 0, 0, 0, 0 }, - { NULL, NULL, 0, 0, 0, 0 }, + { horizd_ptr_bits, horizd_ptrmask_bits, 15, 15, 7, 7 }, + { vertd_ptr_bits, vertd_ptrmask_bits, 15, 15, 7, 7 }, { NULL, NULL, 0, 0, 0, 0 }, { NULL, NULL, 0, 0, 0, 0 }, { NULL, NULL, 0, 0, 0, 0 }, commit e52159d0dc45bf0a7f363c8a4cf2a490094e970b Author: Po Lu Date: Tue May 17 09:21:19 2022 +0800 Let XTread_socket read events for all non-DND displays * src/xterm.c (XTread_socket): Allow reading events from displays other than the DND display during drag-and-drop. diff --git a/src/xterm.c b/src/xterm.c index 181b6c2ec3..f81d99ca12 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -20134,8 +20134,14 @@ XTread_socket (struct terminal *terminal, struct input_event *hold_quit) /* Don't allow XTread_socket to do anything if drag-and-drop is in progress. If unblock_input causes XTread_socket to be called and read X events while the drag-and-drop event loop is in progress, - things can go wrong very quick. */ - if (x_dnd_in_progress || x_dnd_waiting_for_finish) + things can go wrong very quick. + + That doesn't matter for events from displays other than the + display of the drag-and-drop operation, though. */ + if ((x_dnd_in_progress + && dpyinfo->display == FRAME_X_DISPLAY (x_dnd_frame)) + || (x_dnd_waiting_for_finish + && dpyinfo->display == x_dnd_finish_display)) return 0; block_input (); commit 164ff4a012d74d6a7b0a7f42ad5f7ad7ac9f207b Author: Po Lu Date: Tue May 17 09:10:46 2022 +0800 Fix byte swapping of some drag-and-drop messages * src/xterm.c (SWAPCARD16, SWAPCARD32): Actually swap the data instead of just calling bswap_32/bswap_16. diff --git a/src/xterm.c b/src/xterm.c index aa6cdc5d6e..181b6c2ec3 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1082,8 +1082,8 @@ typedef enum xm_byte_order } #else -#define SWAPCARD32(l) bswap_32 (l) -#define SWAPCARD16(l) bswap_16 (l) +#define SWAPCARD32(l) ((l) = bswap_32 (l)) +#define SWAPCARD16(l) ((l) = bswap_16 (l)) #endif typedef struct xm_targets_table_header commit 3939a72fcb5230e86cbe2fb9bcfe00be1dc7bfe0 Author: Po Lu Date: Mon May 16 21:46:30 2022 +0800 Fix detection of wheel movement during drag-and-drop * src/xterm.c (x_dnd_send_position): Don't treat Button8 as the mouse wheel. diff --git a/src/xterm.c b/src/xterm.c index 54edefa3c1..aa6cdc5d6e 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -3544,7 +3544,7 @@ x_dnd_send_position (struct frame *f, Window target, int supported, if (supported >= 5) { - if (button >= 4 && button <= 8) + if (button >= 4 && button <= 7) { msg.xclient.data.l[1] |= (1 << 9); msg.xclient.data.l[1] |= (button - 4) << 7; commit c44908c0593a2c3aab6468144643ccd003084afa Author: kobarity Date: Mon May 16 15:40:17 2022 +0200 Fix Python highlighting of some assignment statements * lisp/progmodes/python.el (python-rx): Limit not-simple-operator to a single line (bug#51362). diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index cb4be10f5c..ca744b1cfd 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -394,7 +394,7 @@ This variant of `rx' supports common Python named REGEXPS." (open-paren (or "{" "[" "(")) (close-paren (or "}" "]" ")")) (simple-operator (any ?+ ?- ?/ ?& ?^ ?~ ?| ?* ?< ?> ?= ?%)) - (not-simple-operator (not simple-operator)) + (not-simple-operator (not (or simple-operator ?\n))) (operator (or "==" ">=" "is" "not" "**" "//" "<<" ">>" "<=" "!=" "+" "-" "/" "&" "^" "~" "|" "*" "<" ">" @@ -603,15 +603,15 @@ builtins.") (defun python-font-lock-assignment-matcher (regexp) "Font lock matcher for assignments based on REGEXP. -Return nil if REGEXP matched within a `paren' context (to avoid, -e.g., default values for arguments or passing arguments by name -being treated as assignments) or is followed by an '=' sign (to -avoid '==' being treated as an assignment." +Search for next occurrence if REGEXP matched within a `paren' +context (to avoid, e.g., default values for arguments or passing +arguments by name being treated as assignments) or is followed by +an '=' sign (to avoid '==' being treated as an assignment." (lambda (limit) - (let ((res (re-search-forward regexp limit t))) - (unless (or (python-syntax-context 'paren) - (equal (char-after (point)) ?=)) - res)))) + (cl-loop while (re-search-forward regexp limit t) + unless (or (python-syntax-context 'paren) + (equal (char-after) ?=)) + return t))) (defvar python-font-lock-keywords-maximum-decoration `((python--font-lock-f-strings) diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 01b233cc42..98b55a5f8b 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -95,6 +95,19 @@ STRING, it is skipped so the next STRING occurrence is selected." found-point (and restore-point (goto-char starting-point))))) +(defun python-tests-assert-faces (content faces) + "Assert that font faces for CONTENT are equal to FACES." + (python-tests-with-temp-buffer content + (font-lock-ensure nil nil) + (should (equal faces (python-tests-get-buffer-faces))))) + +(defun python-tests-get-buffer-faces () + "Return a list of (position . face) for each face change positions." + (cl-loop for pos = (point-min) + then (next-single-property-change pos 'face) + while pos + collect (cons pos (get-text-property pos 'face)))) + (defun python-tests-self-insert (char-or-str) "Call `self-insert-command' for chars in CHAR-OR-STR." (let ((chars @@ -201,6 +214,153 @@ aliqua." (should (string= (buffer-string) "\"\"")) (should (null (nth 3 (syntax-ppss)))))) +(ert-deftest python-font-lock-assignment-statement-1 () + (python-tests-assert-faces + "a, b, c = 1, 2, 3" + '((1 . font-lock-variable-name-face) (2) + (4 . font-lock-variable-name-face) (5) + (7 . font-lock-variable-name-face) (8)))) + +(ert-deftest python-font-lock-assignment-statement-2 () + (python-tests-assert-faces + "a, *b, c = 1, 2, 3, 4, 5" + '((1 . font-lock-variable-name-face) (2) + (5 . font-lock-variable-name-face) (6) + (8 . font-lock-variable-name-face) (9)))) + +(ert-deftest python-font-lock-assignment-statement-3 () + (python-tests-assert-faces + "[a, b] = (1, 2)" + '((1) + (2 . font-lock-variable-name-face) (3) + (5 . font-lock-variable-name-face) (6)))) + +(ert-deftest python-font-lock-assignment-statement-4 () + (python-tests-assert-faces + "(l[1], l[2]) = (10, 11)" + '((1) + (2 . font-lock-variable-name-face) (3) + (8 . font-lock-variable-name-face) (9)))) + +(ert-deftest python-font-lock-assignment-statement-5 () + (python-tests-assert-faces + "(a, b, c, *d) = *x, y = 5, 6, 7, 8, 9" + '((1) + (2 . font-lock-variable-name-face) (3) + (5 . font-lock-variable-name-face) (6) + (8 . font-lock-variable-name-face) (9) + (12 . font-lock-variable-name-face) (13) + (18 . font-lock-variable-name-face) (19) + (21 . font-lock-variable-name-face) (22)))) + +(ert-deftest python-font-lock-assignment-statement-6 () + (python-tests-assert-faces + "(a,) = 'foo'," + '((1) + (2 . font-lock-variable-name-face) (3) + (8 . font-lock-string-face) (13)))) + +(ert-deftest python-font-lock-assignment-statement-7 () + (python-tests-assert-faces + "(*a,) = ['foo', 'bar', 'baz']" + '((1) + (3 . font-lock-variable-name-face) (4) + (10 . font-lock-string-face) (15) + (17 . font-lock-string-face) (22) + (24 . font-lock-string-face) (29)))) + +(ert-deftest python-font-lock-assignment-statement-8 () + (python-tests-assert-faces + "d = D('a', ['b'], 'c')" + '((1 . font-lock-variable-name-face) (2) + (7 . font-lock-string-face) (10) + (13 . font-lock-string-face) (16) + (19 . font-lock-string-face) (22)))) + +(ert-deftest python-font-lock-assignment-statement-9 () + (python-tests-assert-faces + "d.x, d.y[0], *d.z = 'a', 'b', 'c', 'd', 'e'" + '((1) + (3 . font-lock-variable-name-face) (4) + (8 . font-lock-variable-name-face) (9) + (17 . font-lock-variable-name-face) (18) + (21 . font-lock-string-face) (24) + (26 . font-lock-string-face) (29) + (31 . font-lock-string-face) (34) + (36 . font-lock-string-face) (39) + (41 . font-lock-string-face)))) + +(ert-deftest python-font-lock-assignment-statement-10 () + (python-tests-assert-faces + "a: int = 5" + '((1 . font-lock-variable-name-face) (2) + (4 . font-lock-builtin-face) (7)))) + +(ert-deftest python-font-lock-assignment-statement-11 () + (python-tests-assert-faces + "b: Tuple[Optional[int], Union[Sequence[str], str]] = (None, 'foo')" + '((1 . font-lock-variable-name-face) (2) + (19 . font-lock-builtin-face) (22) + (40 . font-lock-builtin-face) (43) + (46 . font-lock-builtin-face) (49) + (55 . font-lock-constant-face) (59) + (61 . font-lock-string-face) (66)))) + +(ert-deftest python-font-lock-assignment-statement-12 () + (python-tests-assert-faces + "c: Collection = {1, 2, 3}" + '((1 . font-lock-variable-name-face) (2)))) + +(ert-deftest python-font-lock-assignment-statement-13 () + (python-tests-assert-faces + "d: Mapping[int, str] = {1: 'bar', 2: 'baz'}" + '((1 . font-lock-variable-name-face) (2) + (12 . font-lock-builtin-face) (15) + (17 . font-lock-builtin-face) (20) + (28 . font-lock-string-face) (33) + (38 . font-lock-string-face) (43)))) + +(ert-deftest python-font-lock-assignment-statement-14 () + (python-tests-assert-faces + "(a) = 5; (b) = 6" + '((1) + (2 . font-lock-variable-name-face) (3) + (11 . font-lock-variable-name-face) (12)))) + +(ert-deftest python-font-lock-assignment-statement-15 () + (python-tests-assert-faces + "[a] = 5,; [b] = 6," + '((1) + (2 . font-lock-variable-name-face) (3) + (12 . font-lock-variable-name-face) (13)))) + +(ert-deftest python-font-lock-assignment-statement-16 () + (python-tests-assert-faces + "[*a] = 5, 6; [*b] = 7, 8" + '((1) + (3 . font-lock-variable-name-face) (4) + (16 . font-lock-variable-name-face) (17)))) + +(ert-deftest python-font-lock-assignment-statement-17 () + (python-tests-assert-faces + "CustomInt = int + +def f(x: CustomInt) -> CustomInt: + y = x + 1 + ys: Sequence[CustomInt] = [y, y + 1] + res: CustomInt = sum(ys) + 1 + return res +" + '((1 . font-lock-variable-name-face) (10) + (13 . font-lock-builtin-face) (16) + (18 . font-lock-keyword-face) (21) + (22 . font-lock-function-name-face) (23) + (56 . font-lock-variable-name-face) (57) + (70 . font-lock-variable-name-face) (72) + (111 . font-lock-variable-name-face) (114) + (128 . font-lock-builtin-face) (131) + (144 . font-lock-keyword-face) (150)))) + ;;; Indentation commit ed71839c33f9dad1de4bdf6911dafbe4a571136b Author: Lars Ingebrigtsen Date: Mon May 16 15:30:50 2022 +0200 Add new user option compilation-hidden-output * doc/emacs/building.texi (Compilation Mode): Document it. * lisp/progmodes/compile.el (compilation-hidden-output): New user option. (compilation-filter): Use it. (compilation--hide-output): New function. diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index 8f972de568..b79fa0a755 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi @@ -289,6 +289,19 @@ window so that the current error message is @var{n} lines from the top, whether or not there is a fringe; the default value, @code{nil}, gives the behavior described above. +@vindex compilation-hidden-output + Compilation output can sometimes be very verbose, and much of it isn't +of particular interest to a user. The +@code{compilation-hidden-output} user option should either be a regexp +or a list of regexps, and output that matches will be made invisible. +For instance, to hide the verbose output from recursive makefiles, you +can say something like: + +@lisp +(setq compilation-hidden-output + '("^make[^\n]+\n")) +@end lisp + @vindex compilation-error-regexp-alist @vindex grep-regexp-alist To parse messages from the compiler, Compilation mode uses the diff --git a/etc/NEWS b/etc/NEWS index b5b2395286..630288d431 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -898,6 +898,11 @@ which is a change in behaviour from previous Emacs versions. ** Compile ++++ +*** New user option 'compilation-hidden-output'. +This can be used to make specific parts of compilation output +invisible. + +++ *** The 'compilation-auto-jump-to-first-error' has been extended. It can now have the additional values 'if-location-known' (which will diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 5545b4cd4a..fdcd4a22c0 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -82,6 +82,25 @@ after `call-process' inserts the grep output into the buffer.") "Position of the start of the text inserted by `compilation-filter'. This is bound before running `compilation-filter-hook'.") +(defcustom compilation-hidden-output nil + "Regexp to match output from the compilation that should be hidden. +This can also be a list of regexps. + +The text matched by this variable will be made invisible, which +means that it'll still be present in the buffer, so that +navigation commands (for instance, `next-error') can still make +use of the hidden text to determine the current directory and the +like. + +For instance, to hide the verbose output from recursive +makefiles, you can say something like: + + (setq compilation-hidden-output + \\='(\"^make[^\n]+\n\"))" + :type '(choice regexp + (repeat regexp)) + :version "29.1") + (defvar compilation-first-column 1 "This is how compilers number the first column, usually 1 or 0. If this is buffer-local in the destination buffer, Emacs obeys @@ -2441,8 +2460,8 @@ commands of Compilation major mode are available. See (defun compilation-filter (proc string) "Process filter for compilation buffers. -Just inserts the text, -handles carriage motion (see `comint-inhibit-carriage-motion'), +Just inserts the text, handles carriage motion (see +`comint-inhibit-carriage-motion'), `compilation-hidden-output', and runs `compilation-filter-hook'." (when (buffer-live-p (process-buffer proc)) (with-current-buffer (process-buffer proc) @@ -2467,6 +2486,8 @@ and runs `compilation-filter-hook'." (dolist (line (string-lines string nil t)) (compilation--insert-abbreviated-line line compilation-max-output-line-length))) + (when compilation-hidden-output + (compilation--hide-output compilation-filter-start)) (unless comint-inhibit-carriage-motion (comint-carriage-motion (process-mark proc) (point))) (set-marker (process-mark proc) (point)) @@ -2479,6 +2500,24 @@ and runs `compilation-filter-hook'." (set-marker min nil) (set-marker max nil)))))) +(defun compilation--hide-output (start) + (save-excursion + (goto-char start) + (beginning-of-line) + ;; Apply the match to each line, but wait until we have a complete + ;; line. + (let ((start (point))) + (while (search-forward "\n" nil t) + (save-restriction + (narrow-to-region start (point)) + (dolist (regexp (ensure-list compilation-hidden-output)) + (goto-char start) + (while (re-search-forward regexp nil t) + (add-text-properties (match-beginning 0) (match-end 0) + '( invisible t + rear-nonsticky t)))) + (goto-char (point-max))))))) + (defun compilation--insert-abbreviated-line (string width) (if (and (> (current-column) 0) (get-text-property (1- (point)) 'button)) commit f5ee56c5eae8a42a1bb83e31e0c12e14a2571860 Author: Lars Ingebrigtsen Date: Mon May 16 15:01:08 2022 +0200 Don't expose Vprint_variable_mapping to Lisp * src/print.c: Don't expose Vprint_variable_mapping to the Lisp world, because it really should be immutable. (print_create_variable_mapping): Initialization moved here from syms_of_print. (print_bind_overrides): Call it. (syms_of_print): Protect the mapping variable. diff --git a/src/print.c b/src/print.c index 41c0a18816..55f4c2345a 100644 --- a/src/print.c +++ b/src/print.c @@ -620,10 +620,12 @@ If PRINTCHARFUN is omitted or nil, the value of `standard-output' is used. */) return val; } +static Lisp_Object Vprint_variable_mapping; + static void print_bind_all_defaults (void) { - for (Lisp_Object vars = Vprint__variable_mapping; !NILP (vars); + for (Lisp_Object vars = Vprint_variable_mapping; !NILP (vars); vars = XCDR (vars)) { Lisp_Object elem = XCDR (XCAR (vars)); @@ -631,9 +633,42 @@ print_bind_all_defaults (void) } } +static void +print_create_variable_mapping (void) +{ + Lisp_Object total[] = { + list3 (intern ("length"), intern ("print-length"), Qnil), + list3 (intern ("level"), intern ("print-level"), Qnil), + list3 (intern ("circle"), intern ("print-circle"), Qnil), + list3 (intern ("quoted"), intern ("print-quoted"), Qt), + list3 (intern ("escape-newlines"), intern ("print-escape-newlines"), Qnil), + list3 (intern ("escape-control-characters"), + intern ("print-escape-control-characters"), Qnil), + list3 (intern ("escape-nonascii"), intern ("print-escape-nonascii"), Qnil), + list3 (intern ("escape-multibyte"), + intern ("print-escape-multibyte"), Qnil), + list3 (intern ("charset-text-property"), + intern ("print-charset-text-property"), Qnil), + list3 (intern ("unreadeable-function"), + intern ("print-unreadable-function"), Qnil), + list3 (intern ("gensym"), intern ("print-gensym"), Qnil), + list3 (intern ("continuous-numbering"), + intern ("print-continuous-numbering"), Qnil), + list3 (intern ("number-table"), intern ("print-number-table"), Qnil), + list3 (intern ("float-format"), intern ("float-output-format"), Qnil), + list3 (intern ("integers-as-characters"), + intern ("print-integers-as-characters"), Qnil), + }; + + Vprint_variable_mapping = CALLMANY (Flist, total); +} + static void print_bind_overrides (Lisp_Object overrides) { + if (NILP (Vprint_variable_mapping)) + print_create_variable_mapping (); + if (EQ (overrides, Qt)) print_bind_all_defaults (); else if (!CONSP (overrides)) @@ -651,7 +686,7 @@ print_bind_overrides (Lisp_Object overrides) { Lisp_Object key = XCAR (setting), value = XCDR (setting); - Lisp_Object map = Fassq (key, Vprint__variable_mapping); + Lisp_Object map = Fassq (key, Vprint_variable_mapping); if (NILP (map)) xsignal2 (Qwrong_type_argument, Qsymbolp, map); specbind (XCAR (XCDR (map)), value); @@ -2643,35 +2678,6 @@ be printed. */); defsubr (&Sflush_standard_output); - DEFVAR_LISP ("print--variable-mapping", Vprint__variable_mapping, - doc: /* Mapping for print variables in `prin1'. -Internal use only. -Do not modify this list. */); - Vprint__variable_mapping = Qnil; - Lisp_Object total[] = { - list3 (intern ("length"), intern ("print-length"), Qnil), - list3 (intern ("level"), intern ("print-level"), Qnil), - list3 (intern ("circle"), intern ("print-circle"), Qnil), - list3 (intern ("quoted"), intern ("print-quoted"), Qt), - list3 (intern ("escape-newlines"), intern ("print-escape-newlines"), Qnil), - list3 (intern ("escape-control-characters"), - intern ("print-escape-control-characters"), Qnil), - list3 (intern ("escape-nonascii"), intern ("print-escape-nonascii"), Qnil), - list3 (intern ("escape-multibyte"), - intern ("print-escape-multibyte"), Qnil), - list3 (intern ("charset-text-property"), - intern ("print-charset-text-property"), Qnil), - list3 (intern ("unreadeable-function"), - intern ("print-unreadable-function"), Qnil), - list3 (intern ("gensym"), intern ("print-gensym"), Qnil), - list3 (intern ("continuous-numbering"), - intern ("print-continuous-numbering"), Qnil), - list3 (intern ("number-table"), intern ("print-number-table"), Qnil), - list3 (intern ("float-format"), intern ("float-output-format"), Qnil), - list3 (intern ("integers-as-characters"), - intern ("print-integers-as-characters"), Qnil), - }; - - Vprint__variable_mapping = CALLMANY (Flist, total); - make_symbol_constant (intern_c_string ("print--variable-mapping")); + /* Initialized in print_create_variable_mapping. */ + staticpro (&Vprint_variable_mapping); } commit 5a6e727ddb155e6d4210bc7b7a30cf8933d556c8 Author: Tassilo Horn Date: Mon May 16 14:26:29 2022 +0200 ; Fix Wrong type argument: number-or-marker-p, (4) in cycle-spacing diff --git a/lisp/simple.el b/lisp/simple.el index ccf696901b..71c99a442d 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1295,8 +1295,8 @@ doing any other command before the next \\[cycle-spacing]." ((eq '- arg) '-) (t context-n))) (numeric-n (prefix-numeric-value actual-n)) - (include-newlines (and actual-n - (or (eq actual-n '-) + (include-newlines (or (eq actual-n '-) + (and (integerp actual-n) (< actual-n 0))))) (cond ((eq actual-action 'just-one-space) commit 006fd29ca181e7d136b24ff4ef6c9a1249ebd898 Author: Lars Ingebrigtsen Date: Mon May 16 14:24:41 2022 +0200 Revert "Make TAB work in makefile mode when transient mark mode is on" This reverts commit a4c96147d1875d359db8d7fda3489954046a5db8. This change made hitting RET after an assignment insert a TAB character (bug#55446). diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index 1a1dc3aee9..91307f6c09 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el @@ -889,7 +889,7 @@ Makefile mode can be configured by modifying the following variables: (setq-local comment-start-skip "#+[ \t]*") ;; Make sure TAB really inserts \t. - (setq-local indent-line-function #'insert-tab) + (setq-local indent-line-function 'indent-to-left-margin) ;; Real TABs are important in makefiles (setq indent-tabs-mode t)) commit bf22068aee96c449e1db0f8f7ac9ba04645e0b1c Author: Lars Ingebrigtsen Date: Mon May 16 14:04:08 2022 +0200 Improve newsticker file name handling and printing * lisp/net/newst-backend.el (newsticker--images-dir) (newsticker--icons-dir, newsticker--cache-dir): Don't use concat to construct file names. (newsticker-download-images, newsticker-download-enclosures): Ditto. (newsticker--cache-save-feed): Bind print-level etc when printing. * lisp/net/newst-treeview.el (newsticker-treeview-save): Ditto. This patch was mostly written by mailj2@protonmail.com, but was then rewritten by me, and has some contributions from Xavier Capaldi (which doesn't need copyright assignment). diff --git a/lisp/net/newst-backend.el b/lisp/net/newst-backend.el index a62a7bd8b7..113fbbaddf 100644 --- a/lisp/net/newst-backend.el +++ b/lisp/net/newst-backend.el @@ -1697,11 +1697,11 @@ Checks list of active processes against list of newsticker processes." ;; ====================================================================== (defun newsticker--images-dir () "Return directory where feed images are saved." - (concat newsticker-dir "/images/")) + (expand-file-name "images/" newsticker-dir)) (defun newsticker--icons-dir () "Return directory where feed icons are saved." - (concat newsticker-dir "/icons/")) + (expand-file-name "icons/" newsticker-dir)) (defun newsticker--image-get (feed-name filename directory url) "Get image for FEED-NAME by returning FILENAME from DIRECTORY. @@ -2114,7 +2114,7 @@ FEED is a symbol!" (defun newsticker--cache-dir () "Return directory for saving cache data." - (concat newsticker-dir "/feeds")) + (expand-file-name "feeds/" newsticker-dir)) (defun newsticker--cache-save () "Save cache data for all feeds." @@ -2125,13 +2125,15 @@ FEED is a symbol!" (defun newsticker--cache-save-feed (feed) "Save cache data for FEED." - (let ((dir (concat (newsticker--cache-dir) "/" (symbol-name (car feed))))) + (let ((dir (file-name-as-directory + (expand-file-name (symbol-name (car feed)) + (newsticker--cache-dir))))) (unless (file-directory-p dir) (make-directory dir t)) (let ((coding-system-for-write 'utf-8)) - (with-temp-file (concat dir "/data") + (with-temp-file (expand-file-name "data" dir) (insert ";; -*- coding: utf-8 -*-\n") - (insert (prin1-to-string (cdr feed))))))) + (prin1 (cdr feed) (current-buffer) t))))) (defun newsticker--cache-read () "Read cache data." @@ -2141,7 +2143,9 @@ FEED is a symbol!" (defun newsticker--cache-read-feed (feed-name) "Read cache data for feed named FEED-NAME." - (let ((file-name (concat (newsticker--cache-dir) "/" feed-name "/data")) + (let ((file-name (expand-file-name + "data" (expand-file-name + feed-name (newsticker--cache-dir)))) (coding-system-for-read 'utf-8)) (when (file-exists-p file-name) (with-temp-buffer @@ -2334,14 +2338,19 @@ This function just prints out the values of the FEEDNAME and title of the ITEM." "Download the first image. If FEEDNAME equals \"imagefeed\" download the first image URL found in the description=contents of ITEM to the directory -\"~/tmp/newsticker/FEEDNAME/TITLE\" where TITLE is the title of -the item." +`temporary-file-directory'/newsticker/FEEDNAME/TITLE where TITLE +is the title of the item." (when (string= feedname "imagefeed") (let ((title (newsticker--title item)) (desc (newsticker--desc item))) (when (string-match " Date: Mon May 16 14:50:27 2022 +0300 ; Fix documentation of 'cycle-spacing' * etc/NEWS: * doc/emacs/killing.texi (Deletion): Fix wording and punctuation of the documentation of 'cycle-spacing'. diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi index 30025134eb..4435f6e494 100644 --- a/doc/emacs/killing.texi +++ b/doc/emacs/killing.texi @@ -130,8 +130,8 @@ leaving @minus{}@var{n} spaces before point. @vindex cycle-spacing-actions The command @code{cycle-spacing} (@kbd{M-@key{SPC}}) acts like a more flexible version of @code{just-one-space}. It performs different -space cleanup actions if you call it repeatedly in succession as -defined by @code{cycle-spacing-actions}. +space cleanup actions defined by @code{cycle-spacing-actions}, in a +cyclic manner, if you call it repeatedly in succession. @kbd{C-x C-o} (@code{delete-blank-lines}) deletes all blank lines after the current line. If the current line is blank, it deletes all diff --git a/etc/NEWS b/etc/NEWS index c0874dcd11..b5b2395286 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -684,9 +684,9 @@ recreate it anew next time 'imenu' is invoked. * Editing Changes in Emacs 29.1 +++ -** M-SPC is now bound to 'cycle-spacing' (formerly it was 'just-one-space'). +** M-SPC is now bound to 'cycle-spacing' (formerly it invoked 'just-one-space'). The actions performed by 'cycle-spacing' and their order can now be -customized via 'cycle-spacing-actions'. +customized via the variable 'cycle-spacing-actions'. --- ** 'scroll-other-window' and 'scroll-other-window-down' now respects remapping. commit de26ad23d587c018db4e6a59992bf813e6ff104f Author: Eli Zaretskii Date: Mon May 16 14:37:36 2022 +0300 ; * doc/emacs/frames.texi (Tooltips): Fix punctuation and wording. diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index 0008112b8c..28b4d2d0e4 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi @@ -1656,8 +1656,8 @@ Haiku windowing support, it displays tooltips via the toolkit, using the default appearance of the toolkit's tooltips.@footnote{The foreground and background colors of toolkit-created tooltips on Nextstep can also be customized by setting the @code{foreground} and -@code{background} frame parameters inside -@code{tooltip-frame-parameters}} To disable this, change the variable +@code{background} frame parameters that are part of +@code{tooltip-frame-parameters}.} To disable this, change the variable @code{use-system-tooltips} to @code{nil}. If you do this, or if Emacs is built without the appropriate windowing support, most attributes of the tooltip text are specified by the @code{tooltip} face, and by X commit 1f76f50a049bcbd43ff2c0dbe1e73b6fa5efc8b5 Author: Po Lu Date: Mon May 16 17:28:36 2022 +0800 Document recent tooltip changes on NS * doc/emacs/frames.texi (Tooltips): * etc/NEWS: Announce that non-system tooltips are now available on Nextstep. diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index 7c564a8776..0008112b8c 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi @@ -1651,11 +1651,15 @@ For additional customization options for displaying tooltips, use @kbd{M-x customize-group @key{RET} tooltip @key{RET}}. @vindex use-system-tooltips - If Emacs is built with the GTK+ toolkit or Haiku windowing support, -it displays tooltips via the toolkit, using the default appearance of -the toolkit's tooltips. To disable this, change the variable + If Emacs is built with the GTK+ toolkit, Nextstep windowing, or +Haiku windowing support, it displays tooltips via the toolkit, using +the default appearance of the toolkit's tooltips.@footnote{The +foreground and background colors of toolkit-created tooltips on +Nextstep can also be customized by setting the @code{foreground} and +@code{background} frame parameters inside +@code{tooltip-frame-parameters}} To disable this, change the variable @code{use-system-tooltips} to @code{nil}. If you do this, or if Emacs -is built without GTK+ or Haiku windowing support, most attributes of +is built without the appropriate windowing support, most attributes of the tooltip text are specified by the @code{tooltip} face, and by X resources (@pxref{X Resources}). diff --git a/etc/NEWS b/etc/NEWS index c53b896edd..c0874dcd11 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -391,10 +391,16 @@ instead of XIM input methods. ** New user option 'use-system-tooltips'. This controls whether to use the toolkit tooltips, or Emacs's own native implementation of tooltips as small frames. This option is -only meaningful if Emacs was built with GTK+ or Haiku support, and -defaults to t, which makes Emacs use the toolkit tooltips. The -existing GTK-specific option 'x-gtk-use-system-tooltips' is now an -alias of this new option. +only meaningful if Emacs was built with GTK+, Nextstep, or Haiku +support, and defaults to t, which makes Emacs use the toolkit +tooltips. The existing GTK-specific option +'x-gtk-use-system-tooltips' is now an alias of this new option. + ++++ +** Non-native tooltips are now supported on Nextstep. +This means Emacs built with GNUstep or built on macOS is now able to +display different faces and images inside tooltips when the +'use-system-tooltips' variable is nil. ** Connection-local variables commit e7a8136e340fce082c754f31075420226384d004 Author: Tassilo Horn Date: Mon May 16 10:08:40 2022 +0200 ; cycle-spacing-actions: Add forgotten arg modifier - as customize choice diff --git a/lisp/simple.el b/lisp/simple.el index 6cbc73e942..ccf696901b 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1176,7 +1176,8 @@ ACTION is any action except for `restore' and ARG is either (list :tag "Action with modified arg" (choice ,@actions) (choice (const :tag "Inverted prefix arg" inverted-arg) - (const :tag "Fixed numeric arg" integer))) + (const :tag "Fixed numeric arg" integer) + (const :tag "Negative arg" -))) (const :tag "Restore the original spacing" restore)))) :version "29.1") commit 2ba42e596a2b1c4fbd6c81ff18a43a7151482549 Author: Andrea Corallo Date: Mon May 16 09:54:15 2022 +0200 ; Fix two mail addresses ;* lisp/emacs-lisp/comp.el: Fix author's mail address. ;* lisp/emacs-lisp/comp-cstr.el: Likewise. diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index 9eaf38067f..6451e34c42 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2020-2022 Free Software Foundation, Inc. -;; Author: Andrea Corallo +;; Author: Andrea Corallo ;; Keywords: lisp ;; Package: emacs diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 7c755372bf..9ffb97bd47 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2019-2022 Free Software Foundation, Inc. -;; Author: Andrea Corallo +;; Author: Andrea Corallo ;; Keywords: lisp ;; Package: emacs commit b8cfe8fa754e3a3d197b785a179e0915ba4f53bf Author: Po Lu Date: Mon May 16 07:16:27 2022 +0000 Improve error checking in `haiku-roster-launch' * src/haikuselect.c (Fhaiku_roster_launch): Signal error if FILE-OR-TYPE doesn't exist or ARGS does not apply. diff --git a/src/haikuselect.c b/src/haikuselect.c index f7618aa4db..313b26f6ba 100644 --- a/src/haikuselect.c +++ b/src/haikuselect.c @@ -780,7 +780,11 @@ DEFUN ("haiku-roster-launch", Fhaiku_roster_launch, Shaiku_roster_launch, doc: /* Launch an application associated with FILE-OR-TYPE. Return the process ID of any process created, the symbol `already-running' if ARGS was sent to a program that's already -running, or nil if launching the application failed. +running, or nil if launching the application failed because no +application was found for FILE-OR-TYPE. + +Signal an error if FILE-OR-TYPE is invalid, or if ARGS is a message +but the application doesn't accept messages. FILE-OR-TYPE can either be a string denoting a MIME type, or a list with one argument FILE, denoting a file whose associated application @@ -861,6 +865,9 @@ after it starts. */) make_uint (team_id)); else if (rc == B_ALREADY_RUNNING) return Qalready_running; + else if (rc == B_BAD_VALUE) + signal_error ("Invalid type or bad arguments", + list2 (file_or_type, args)); return SAFE_FREE_UNBIND_TO (depth, Qnil); }