commit 22a3e92dc6e3106fe5a7afdf3c1de95e2b3e1fb7 (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Sun May 29 12:55:54 2022 +0800 Make DND target list lifecycle a little clearer * src/xfns.c (Fx_begin_drag): Pass target atoms and ntargets to x_dnd_begin_drag_and_drop instead. * src/xterm.c (x_set_dnd_targets): Make static. (x_clear_dnd_targets): Delete function. (x_dnd_begin_drag_and_drop): Adjust to set targets here instead. * src/xterm.h: Update prototypes. diff --git a/src/xfns.c b/src/xfns.c index 9f218d2b7f..401ad81695 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -6933,11 +6933,11 @@ that mouse buttons are being held down, such as immediately after a ntargets, False, target_atoms); unblock_input (); - x_set_dnd_targets (target_atoms, ntargets); lval = x_dnd_begin_drag_and_drop (f, FRAME_DISPLAY_INFO (f)->last_user_time, xaction, return_frame, action_list, (const char **) &name_list, nnames, - !NILP (allow_current_frame)); + !NILP (allow_current_frame), target_atoms, + ntargets); SAFE_FREE (); return lval; diff --git a/src/xterm.c b/src/xterm.c index 3e5aaf5d4a..65d3eaf83f 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -3901,7 +3901,7 @@ x_dnd_send_drop (struct frame *f, Window target, Time timestamp, return true; } -void +static void x_set_dnd_targets (Atom *targets, int ntargets) { if (x_dnd_targets) @@ -10292,13 +10292,6 @@ x_next_event_from_any_display (XEvent *event) #endif /* USE_X_TOOLKIT || USE_GTK */ -static void -x_clear_dnd_targets (void) -{ - if (x_dnd_unwind_flag) - x_set_dnd_targets (NULL, 0); -} - /* This function is defined far away from the rest of the XDND code so it can utilize `x_any_window_to_frame'. */ @@ -10306,7 +10299,8 @@ Lisp_Object x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, Lisp_Object return_frame, Atom *ask_action_list, const char **ask_action_names, size_t n_ask_actions, - bool allow_current_frame) + bool allow_current_frame, Atom *target_atoms, + int ntargets) { #ifndef USE_GTK XEvent next_event; @@ -10394,43 +10388,25 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, } if (!FRAME_VISIBLE_P (f)) - { - x_set_dnd_targets (NULL, 0); - error ("Frame is invisible"); - } + error ("Frame must be visible"); XSETFRAME (frame, f); local_value = assq_no_quit (QXdndSelection, FRAME_TERMINAL (f)->Vselection_alist); if (x_dnd_in_progress || x_dnd_waiting_for_finish) - { - x_set_dnd_targets (NULL, 0); - error ("A drag-and-drop session is already in progress"); - } + error ("A drag-and-drop session is already in progress"); if (CONSP (local_value)) - { - ref = SPECPDL_INDEX (); - - record_unwind_protect_void (x_clear_dnd_targets); - x_dnd_unwind_flag = true; - x_own_selection (QXdndSelection, - Fnth (make_fixnum (1), local_value), frame); - x_dnd_unwind_flag = false; - unbind_to (ref, Qnil); - } + x_own_selection (QXdndSelection, + Fnth (make_fixnum (1), local_value), frame); else - { - x_set_dnd_targets (NULL, 0); - error ("No local value for XdndSelection"); - } + error ("No local value for XdndSelection"); if (popup_activated ()) - { - x_set_dnd_targets (NULL, 0); - error ("Trying to drag-and-drop from within a menu-entry"); - } + error ("Trying to drag-and-drop from within a menu-entry"); + + x_set_dnd_targets (target_atoms, ntargets); ltimestamp = x_timestamp_for_selection (FRAME_DISPLAY_INFO (f), QXdndSelection); diff --git a/src/xterm.h b/src/xterm.h index 6c798ea246..bc2e138aa9 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -1451,11 +1451,10 @@ extern void x_scroll_bar_configure (GdkEvent *); extern Lisp_Object x_dnd_begin_drag_and_drop (struct frame *, Time, Atom, Lisp_Object, Atom *, const char **, - size_t, bool); + size_t, bool, Atom *, int); extern void x_dnd_do_unsupported_drop (struct x_display_info *, Lisp_Object, Lisp_Object, Lisp_Object, Window, int, int, Time); -extern void x_set_dnd_targets (Atom *, int); extern int x_display_pixel_height (struct x_display_info *); extern int x_display_pixel_width (struct x_display_info *); commit 6303cb7e9ff06e468d970a51cd87ece21d279b56 Merge: c92d73d271 f9ee83bfb9 Author: Stefan Kangas Date: Sun May 29 06:30:21 2022 +0200 Merge from origin/emacs-28 f9ee83bfb9 do_switch_frame: before leaving mini-window, check other (... 908e2e09d0 Fix commands used to produce on-line HTML docs fff770fb97 Fix a bad cross-reference in elisp.pdf ebea3415b0 Fix documentation of 'string-pad' commit c92d73d271038c93a72c059ed0190bc09b95026d Author: Po Lu Date: Sun May 29 01:05:54 2022 +0000 Fix pending window changes in haiku_set_window_size * src/haikuterm.c (haiku_set_window_size): Wait for FRAME_RESIZED events, then call `do_pending_window_change'. (haiku_read_socket): Allow waiting for FRAME_RESIZED events. diff --git a/src/haikuterm.c b/src/haikuterm.c index a487556218..7f0bc1a8cf 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -2009,9 +2009,17 @@ haiku_set_window_size (struct frame *f, bool change_gravity, if (FRAME_HAIKU_WINDOW (f)) { block_input (); - BWindow_resize (FRAME_HAIKU_WINDOW (f), width, height); + BWindow_resize (FRAME_HAIKU_WINDOW (f), + width, height); + + if (FRAME_VISIBLE_P (f) + && (width != FRAME_PIXEL_WIDTH (f) + || height != FRAME_PIXEL_HEIGHT (f))) + haiku_wait_for_event (f, FRAME_RESIZED); unblock_input (); } + + do_pending_window_change (false); } static void @@ -3138,6 +3146,10 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) int width = lrint (b->px_widthf); int height = lrint (b->px_heightf); + if (FRAME_OUTPUT_DATA (f)->wait_for_event_type + == FRAME_RESIZED) + FRAME_OUTPUT_DATA (f)->wait_for_event_type = -1; + if (FRAME_TOOLTIP_P (f)) { if (FRAME_PIXEL_WIDTH (f) != width @@ -3166,6 +3178,7 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) cancel_mouse_face (f); haiku_clear_under_internal_border (f); } + break; } case FRAME_EXPOSED: commit 28d4952d423a088a53a82c8e02f283fa98b7e20d Author: Po Lu Date: Sun May 29 08:51:17 2022 +0800 Improve error trapping on X * xterm.c (x_uncatch_errors, x_had_errors_p): Don't sync if no request was made since the error trap was installed. diff --git a/src/xterm.c b/src/xterm.c index 5c59113469..3e5aaf5d4a 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -21265,7 +21265,11 @@ x_uncatch_errors (void) /* There is no point in making this extra sync if all requests are known to have been fully processed. */ && (LastKnownRequestProcessed (x_error_message->dpy) - != NextRequest (x_error_message->dpy) - 1)) + != NextRequest (x_error_message->dpy) - 1) + /* Likewise if no request was made since the trap was + installed. */ + && (NextRequest (x_error_message->dpy) + > x_error_message->first_request)) XSync (x_error_message->dpy, False); tmp = x_error_message; @@ -21315,8 +21319,10 @@ x_had_errors_p (Display *dpy) emacs_abort (); /* Make sure to catch any errors incurred so far. */ - if (LastKnownRequestProcessed (dpy) - != NextRequest (dpy) - 1) + if ((LastKnownRequestProcessed (dpy) + != NextRequest (dpy) - 1) + && (NextRequest (dpy) + > x_error_message->first_request)) XSync (dpy, False); return x_error_message->string[0] != 0; commit 1e66c8af402176e9f1b5f3fbdbf5f796fec79079 Author: kobarity Date: Sat May 28 18:51:01 2022 +0200 Fix Python Hideshow problem with backslash escaped newlines * lisp/progmodes/python.el (python-rx) (python-nav-beginning-of-defun-regexp): Allow python-nav-*-defun to handle backslash escaped newlines (bug#55690). diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 9adbb82abf..c2483436fe 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -359,7 +359,8 @@ (defmacro python-rx (&rest regexps) "Python mode specialized rx macro. This variant of `rx' supports common Python named REGEXPS." - `(rx-let ((block-start (seq symbol-start + `(rx-let ((sp-bsnl (or space (and ?\\ ?\n))) + (block-start (seq symbol-start (or "def" "class" "if" "elif" "else" "try" "except" "finally" "for" "while" "with" ;; Python 3.10+ PEP634 @@ -1439,7 +1440,7 @@ marks the next defun after the ones already marked." function)) (defvar python-nav-beginning-of-defun-regexp - (python-rx line-start (* space) defun (+ space) (group symbol-name)) + (python-rx line-start (* space) defun (+ sp-bsnl) (group symbol-name)) "Regexp matching class or function definition. The name of the defun should be grouped so it can be retrieved via `match-string'.") diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 479d68a062..8db0a07170 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -1861,6 +1861,22 @@ class C(object): (beginning-of-line) (point)))))) +(ert-deftest python-nav-beginning-of-defun-4 () + (python-tests-with-temp-buffer + " +def \\ + a(): + return 0 +" + (python-tests-look-at "return 0") + (should (= (save-excursion + (python-nav-beginning-of-defun) + (point)) + (save-excursion + (python-tests-look-at "def \\" -1) + (beginning-of-line) + (point)))))) + (ert-deftest python-nav-end-of-defun-1 () (python-tests-with-temp-buffer " @@ -1964,6 +1980,20 @@ def decoratorFunctionWithArguments(arg1, arg2, arg3): (python-tests-look-at "return wrapped_f") (line-beginning-position)))))) +(ert-deftest python-nav-end-of-defun-3 () + (python-tests-with-temp-buffer + " +def \\ + a(): + return 0 +" + (should (= (save-excursion + (python-tests-look-at "def \\") + (python-nav-end-of-defun) + (point)) + (save-excursion + (point-max)))))) + (ert-deftest python-nav-backward-defun-1 () (python-tests-with-temp-buffer " @@ -2062,6 +2092,18 @@ class A(object): (should (not (python-nav-backward-defun))) (should (= point (point)))))) +(ert-deftest python-nav-backward-defun-4 () + (python-tests-with-temp-buffer + " +def \\ + a(): + return 0 +" + (goto-char (point-max)) + (should (= (save-excursion (python-nav-backward-defun)) + (python-tests-look-at "def \\" -1))) + (should (not (python-nav-backward-defun))))) + (ert-deftest python-nav-forward-defun-1 () (python-tests-with-temp-buffer " @@ -2160,6 +2202,18 @@ class A(object): (should (not (python-nav-forward-defun))) (should (= point (point)))))) +(ert-deftest python-nav-forward-defun-4 () + (python-tests-with-temp-buffer + " +def \\ + a(): + return 0 +" + (goto-char (point-min)) + (should (= (save-excursion (python-nav-forward-defun)) + (python-tests-look-at "():"))) + (should (not (python-nav-forward-defun))))) + (ert-deftest python-nav-beginning-of-statement-1 () (python-tests-with-temp-buffer " commit 5d8b6ba89efdcddfd0189da77dd4099283466a05 Author: Visuwesh Date: Sat May 28 12:54:32 2022 +0200 pp--insert-lisp: Don't bug out on certain forms at beginning of buffer * pp.el (pp--insert): Check if point is in beginning of buffer before calling `looking-back' (bug#55677). diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index 3c849c2d01..a3ff2ecbaa 100644 --- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el @@ -382,7 +382,7 @@ Use the `pp-max-width' variable to control the desired line length." (when (> (current-column) (pp--max-width)) (condition-case () (backward-up-list 1) - (:success (when (looking-back " " 2) + (:success (when (and (not (bobp)) (looking-back " " 2)) (insert "\n"))) (error nil))))))) commit 2301f13a677aa4ea05bfa2372bdc66c458c0ff38 Author: Stefan Monnier Date: Sat May 28 12:02:15 2022 -0400 with-connection-local-variables: Avoid code duplication Move the bulk of the code of `with-connection-local-variables` into a separate function, which both avoids duplicating that code but also avoids duplicating the code passed as the body of a `with-connection-local-variables`. Also makes it easier to debug the code, or change the implementation of `with-connection-local-variables` without having to recompile all the users. * lisp/files-x.el (with-connection-local-variables-1): New function, extracted from `with-connection-local-variables`. (with-connection-local-variables): Use it. diff --git a/lisp/files-x.el b/lisp/files-x.el index 0ae9fb076e..4db6fbd22c 100644 --- a/lisp/files-x.el +++ b/lisp/files-x.el @@ -740,22 +740,28 @@ If APPLICATION is nil, `connection-local-default-application' is used." "Apply connection-local variables according to `default-directory'. Execute BODY, and unwind connection-local variables." (declare (debug t)) - `(if (file-remote-p default-directory) - (let ((enable-connection-local-variables t) - (old-buffer-local-variables (buffer-local-variables)) - connection-local-variables-alist) - (hack-connection-local-variables-apply - (connection-local-criteria-for-default-directory)) - (unwind-protect - (progn ,@body) - ;; Cleanup. - (dolist (variable connection-local-variables-alist) - (let ((elt (assq (car variable) old-buffer-local-variables))) - (if elt - (set (make-local-variable (car elt)) (cdr elt)) - (kill-local-variable (car variable))))))) - ;; No connection-local variables to apply. - ,@body)) + `(with-connection-local-variables-1 (lambda () ,@body))) + +;;;###autoload +(defun with-connection-local-variables-1 (body-fun) + "Apply connection-local variables according to `default-directory'. +Call BODY-FUN with no args, and then unwind connection-local variables." + (if (file-remote-p default-directory) + (let ((enable-connection-local-variables t) + (old-buffer-local-variables (buffer-local-variables)) + connection-local-variables-alist) + (hack-connection-local-variables-apply + (connection-local-criteria-for-default-directory)) + (unwind-protect + (funcall body-fun) + ;; Cleanup. + (dolist (variable connection-local-variables-alist) + (let ((elt (assq (car variable) old-buffer-local-variables))) + (if elt + (set (make-local-variable (car elt)) (cdr elt)) + (kill-local-variable (car variable))))))) + ;; No connection-local variables to apply. + (funcall body-fun))) ;;;###autoload (defun path-separator () commit f9ee83bfb9f09a32ca8c15385f0cd3ec12ebde8c (refs/remotes/origin/emacs-28) Author: Alan Mackenzie Date: Sat May 28 12:55:32 2022 +0000 do_switch_frame: before leaving mini-window, check other (mru) window is live This fixes bug#55684. There, with a minibuffer-only frame at start up, Emacs tried to switch to this frame, whose selected window was the mini-window. There is no other active window in this frame, so the attempt to swith to another window failed. * src/frame.c (do_switch_frame): On switching to a frame whose selected window is as above, before selecting the most recently used window, check this ostensible window is an actual live window. Otherwise leave the mini-window selected. diff --git a/src/frame.c b/src/frame.c index dc8045f41e..0c278259a7 100644 --- a/src/frame.c +++ b/src/frame.c @@ -1568,8 +1568,14 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor to a different window, the most recently used one, unless there is a valid active minibuffer in the mini-window. */ if (EQ (f->selected_window, f->minibuffer_window) + /* The following test might fail if the mini-window contains a + non-active minibuffer. */ && NILP (Fminibufferp (XWINDOW (f->minibuffer_window)->contents, Qt))) - Fset_frame_selected_window (frame, call1 (Qget_mru_window, frame), Qnil); + { + Lisp_Object w = call1 (Qget_mru_window, frame); + if (WINDOW_LIVE_P (w)) /* W can be nil in minibuffer-only frames. */ + Fset_frame_selected_window (frame, w, Qnil); + } Fselect_window (f->selected_window, norecord); commit 908e2e09d08c8058f40295096aec9251944875ca Author: Eli Zaretskii Date: Sat May 28 14:57:55 2022 +0300 Fix commands used to produce on-line HTML docs * admin/admin.el (manual-meta-string): Only include the first line, and move the rest... (manual-links-string): ...to this new string. (manual-html-fix-headers): Don't remove the ', see gnu.org ticket #1840138. diff --git a/admin/admin.el b/admin/admin.el index a6cb33017e..57d5afb23b 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -340,11 +340,13 @@ Optional argument TYPE is type of output (nil means all)." \"https://www.w3.org/TR/html4/loose.dtd\">\n\n") (defconst manual-meta-string - " - + "\n") + +(defconst manual-links-string + " -\n\n") +\n") (defconst manual-style-string "\n") @@ -475,6 +477,12 @@ the @import directive." (delete-region opoint (point)) (search-forward "\n") + (delete-region opoint (point)) + (search-forward "") (goto-char (match-beginning 0)) (delete-region opoint (point)) commit f65536015b143571b81f8eb1f064d73014a86fec Author: Valenoern Date: Sat May 28 12:43:20 2022 +0200 Support html template tag in shr * lisp/net/shr.el: Add shr-tag-template as a dummy tag. Copyright-paperwork-exempt: yes diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 6b05cbcf4f..505a093392 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1326,6 +1326,11 @@ ones, in case fg and bg are nil." (defun shr-tag-comment (_dom) ) +;; Introduced in HTML5. For text browsers, functionally similar to a +;; comment. +(defun shr-tag-template (_dom) + ) + (defun shr-dom-to-xml (dom &optional charset) (with-temp-buffer (shr-dom-print dom) commit 9707613ddb6bc31ed56203728f28978b36e16630 Author: Lars Ingebrigtsen Date: Sat May 28 12:31:52 2022 +0200 Fix native-comp of trampolines after previous change * lisp/emacs-lisp/comp.el (comp--native-compile): Don't delete the explicitly specified output file, just temp files. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 1d870dcae8..53803b3818 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -4088,6 +4088,7 @@ the deferred compilation mechanism." ;; called with something other than a file as the argument. ;; Delete it. (when (and (not (stringp function-or-file)) + (not output) comp-ctxt (comp-ctxt-output comp-ctxt) (file-exists-p (comp-ctxt-output comp-ctxt))) commit b8a204e81e358a873ef7a9652c2d97b1045be2ae Author: Eli Zaretskii Date: Sat May 28 13:16:04 2022 +0300 ; * lisp/leim/quail/indonesian.el ("sundanese"): Fix whitespace. diff --git a/lisp/leim/quail/indonesian.el b/lisp/leim/quail/indonesian.el index dd931e9879..84773b4a8c 100644 --- a/lisp/leim/quail/indonesian.el +++ b/lisp/leim/quail/indonesian.el @@ -337,14 +337,14 @@ ("i" ?ᮤ) ("I" ?ᮄ) ("o" ?ᮧ) - ("O" ?ᮇ) + ("O" ?ᮇ) ("p" ?ᮕ) ("P" ?ᮖ) ("a" ?ᮃ) ("A" ?ᮦ) ("`a" ?ᮆ) ("s" ?ᮞ) - ("S" ?ᮯ) + ("S" ?ᮯ) ("d" ?ᮓ) ("D" ?᳆) ("f" ?᮪) commit fb6484e3d02c6583ed287acee3f4b8b7ae2061eb Author: समीर सिंह Sameer Singh Date: Thu May 26 18:35:00 2022 +0530 Add support for the Sundanese script (bug#55686) * lisp/language/indonesian.el ("Sundanese"): New language environment. Add composition rules for Sundanese. Add sample text and input method. Improve composition rules for Balinese and Javanese. * lisp/international/fontset.el (script-representative-chars) (setup-default-fontset): Support Sundanese. * lisp/leim/quail/indonesian.el ("sundanese"): New input method. * etc/HELLO: Add a Sundanese greeting. * etc/NEWS: Announce the new language environment and its input method. diff --git a/etc/HELLO b/etc/HELLO index 248c02b7ab..4ff066847d 100644 --- a/etc/HELLO +++ b/etc/HELLO @@ -89,6 +89,7 @@ Sinhala (සිංහල) ආයුබෝවන් Slovak (slovenčina) Dobrý deň Slovenian (slovenščina) Pozdravljeni! Spanish (español) ¡Hola! +Sundanese (ᮃᮊ᮪ᮟᮛᮞᮥᮔ᮪ᮓ) ᮞᮙ᮪ᮕᮥᮛᮞᮥᮔ᮪ Swedish (svenska) Hej / Goddag / Hallå Syloti Nagri (ꠍꠤꠟꠐꠤ ꠘꠣꠉꠞꠤ) ꠀꠌ꠆ꠍꠣꠟꠣꠝꠥ ꠀꠟꠣꠁꠇꠥꠝ / ꠘꠝꠡ꠆ꠇꠣꠞ Tamil (தமிழ்) வணக்கம் diff --git a/etc/NEWS b/etc/NEWS index 90d03f8fa8..85a0ee44b9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -832,6 +832,7 @@ corresponding language environments are: **** Limbu script and language environment **** Balinese script and language environment **** Javanese script and language environment +**** Sundanese script and language environment --- *** The "Oriya" language environment was renamed to "Odia". diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index 6b51125629..00ee0cf475 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -190,6 +190,7 @@ (mongolian #x1826) (limbu #x1901 #x1920 #x1936) (balinese #x1B13 #x1B35 #x1B5E) + (sundanese #x1B8A #x1BAB #x1CC4) (tai-le #x1950) (tai-lue #x1980) (tai-tham #x1A20 #x1A55 #x1A61 #x1A80) @@ -760,6 +761,7 @@ tagbanwa limbu balinese + sundanese symbol braille yi diff --git a/lisp/language/indonesian.el b/lisp/language/indonesian.el index 994be2484a..4bdcd0a49c 100644 --- a/lisp/language/indonesian.el +++ b/lisp/language/indonesian.el @@ -45,6 +45,14 @@ Balinese language and its script are supported in this language environment."))) (documentation . "\ Javanese language and its script are supported in this language environment."))) +(set-language-info-alist + "Sundanese" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "sundanese") + (sample-text . "Sundanese (ᮃᮊ᮪ᮞᮛᮞᮥᮔ᮪ᮓ) ᮞᮙ᮪ᮕᮥᮛᮞᮥᮔ᮪") + (documentation . "\ +Sundanese language and its script are supported in this language environment."))) ;; Balinese composition rules (let ((consonant "[\x1B13-\x1B33\x1B45-\x1B4B]") @@ -58,7 +66,7 @@ Javanese language and its script are supported in this language environment."))) '(#x1B34 . #x1B44) (list (vector ;; Consonant based syllables - (concat consonant rerekan "?" "\\(?:" adeg-adeg consonant + (concat consonant rerekan "?\\(?:" adeg-adeg consonant rerekan "?\\)*\\(?:" adeg-adeg "\\|" vowel "*" rerekan "?" modifier-above "?" musical-symbol "?\\)") 1 'font-shape-gstring) @@ -80,7 +88,7 @@ Javanese language and its script are supported in this language environment."))) '(#xA9B3 . #xA9C0) (list (vector ;; Consonant based syllables - (concat consonant telu "?" "\\(?:" pangkon consonant + (concat consonant telu "?\\(?:" pangkon consonant telu "?\\)*\\(?:" pangkon "\\|" vowel "*" telu "?" modifier-above "?" dependant-consonant "?\\)") 1 'font-shape-gstring) @@ -90,5 +98,26 @@ Javanese language and its script are supported in this language environment."))) vowel "?" modifier-above "?" dependant-consonant "?") 1 'font-shape-gstring)))) +;; Sundanese composition rules +(let ((consonant "[\x1B8A-\x1BA0\x1BAE\x1BAF\x1BBB-\x1BBF]") + (independent-vowel "[\x1B83-\x1B89]") + (vowel "[\x1BA4-\x1BA9]") + (dependant-consonant "[\x1BA1-\x1BA3\x1BAC-\x1BAD]") + (modifier-above "[\x1B80-\x1B82]") + (virama "[\x1BAA\x1BAB]")) + (set-char-table-range composition-function-table + '(#x1BA1 . #x1BAD) + (list (vector + ;; Consonant based syllables + (concat consonant "\\(?:" virama consonant + "\\)*\\(?:" virama "\\|" vowel "*" + modifier-above "?" dependant-consonant "?\\)") + 1 'font-shape-gstring) + (vector + ;; Vowels based syllables + (concat independent-vowel virama "?" + vowel "?" modifier-above "?" dependant-consonant "?") + 1 'font-shape-gstring)))) + (provide 'indonesian) ;;; indonesian.el ends here diff --git a/lisp/leim/quail/indonesian.el b/lisp/leim/quail/indonesian.el index 82d0a2c269..dd931e9879 100644 --- a/lisp/leim/quail/indonesian.el +++ b/lisp/leim/quail/indonesian.el @@ -286,5 +286,96 @@ ("M" ?ꦁ) ("`m" ?ꦀ)) +(quail-define-package + "sundanese" "Sundanese" "ᮃ" t "Sundanese phonetic input method. + + `\\=`' is used to switch levels instead of Alt-Gr. +" nil t t t t nil nil nil nil nil t) + +(quail-define-rules + ("1" ?᮱) + ("`1" ?1) + ("`!" ?᳀) + ("2" ?᮲) + ("`2" ?2) + ("`@" ?᳁) + ("3" ?᮳) + ("`3" ?3) + ("`#" ?᳂) + ("4" ?᮴) + ("`4" ?4) + ("`$" ?᳃) + ("5" ?᮵) + ("`5" ?5) + ("6" ?᮶) + ("`6" ?6) + ("7" ?᮷) + ("`7" ?7) + ("8" ?᮸) + ("`8" ?8) + ("9" ?᮹) + ("`9" ?9) + ("0" ?᮰) + ("`0" ?0) + ("`" ?ᮒ) + ("q" ?ᮋ) + ("w" ?ᮝ) + ("W" ?ᮭ) + ("e" ?ᮨ) + ("E" ?ᮩ) + ("`e" ?ᮈ) + ("`E" ?ᮉ) + ("r" ?ᮛ) + ("R" ?ᮢ) + ("`r" ?ᮁ) + ("`R" ?ᮻ) + ("t" ?ᮒ) + ("y" ?ᮚ) + ("Y" ?ᮡ) + ("u" ?ᮥ) + ("U" ?ᮅ) + ("i" ?ᮤ) + ("I" ?ᮄ) + ("o" ?ᮧ) + ("O" ?ᮇ) + ("p" ?ᮕ) + ("P" ?ᮖ) + ("a" ?ᮃ) + ("A" ?ᮦ) + ("`a" ?ᮆ) + ("s" ?ᮞ) + ("S" ?ᮯ) + ("d" ?ᮓ) + ("D" ?᳆) + ("f" ?᮪) + ("F" ?᮫) + ("g" ?ᮌ) + ("h" ?ᮠ) + ("H" ?ᮂ) + ("j" ?ᮏ) + ("k" ?ᮊ) + ("K" ?ᮮ) + ("`k" ?ᮾ) + ("`K" ?᳅) + ("l" ?ᮜ) + ("L" ?ᮣ) + ("`l" ?ᮼ) + ("`L" ?᳄) + ("z" ?ᮐ) + ("x" ?ᮟ) + ("c" ?ᮎ) + ("`c" #x200C) ; ZWNJ + ("b" ?ᮘ) + ("B" ?ᮽ) + ("`b" ?ᮺ) + ("`B" ?᳇) + ("n" ?ᮔ) + ("N" ?ᮍ) + ("`n" ?ᮑ) + ("m" ?ᮙ) + ("M" ?ᮀ) + ("`m" ?ᮿ) + ("`M" ?ᮬ)) + (provide 'indonesian) ;;; indonesian.el ends here commit fff770fb97e8a251b4138ea0ce06f153f8a936ad Author: Eli Zaretskii Date: Sat May 28 11:51:15 2022 +0300 Fix a bad cross-reference in elisp.pdf * doc/lispref/control.texi (pcase Macro): Fix a conditional cross-reference (bug#55689). diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index 92cd67c126..ecf616fc2b 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi @@ -629,7 +629,10 @@ Attempts to match @var{pattern1}, @var{pattern2}, @dots{}, in order, until one of them succeeds. In that case, @code{or} likewise matches, and the rest of the sub-patterns are not tested. -To present a consistent environment (@pxref{Intro Eval}) +To present a consistent environment +@ifnottex +(@pxref{Intro Eval}) +@end ifnottex to @var{body-forms} (thus avoiding an evaluation error on match), the set of variables bound by the pattern is the union of the variables bound by each sub-pattern. If a variable is not bound by commit 6f1d5e59f3649de11555e57e9f629ee9e5b01b1a Author: Po Lu Date: Sat May 28 16:48:49 2022 +0800 Fix dired drag-and-drop for certain Motif programs * lisp/dired.el (dired-mouse-drag): Announce _DT_NETFILE in targets list as well. * lisp/select.el (xselect--encode-string): New arg `prefer-string-to-c-string'. (xselect-convert-to-filename): Convert to TEXT instead of C_STRING, but use STRING if the type would otherwise be C_STRING. (xselect-dt-netfile-available-p, xselect-tt-net-file) (xselect-convert-to-dt-netfile): New functions. (selection-converter-alist): New selection converter. diff --git a/lisp/dired.el b/lisp/dired.el index 6ed4a949e0..3f2e52e629 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1766,7 +1766,7 @@ when Emacs exits or the user drags another file.") #'dired-remove-last-dragged-local-file)) (gui-backend-set-selection 'XdndSelection filename) (x-begin-drag '("text/uri-list" "text/x-dnd-username" - "FILE_NAME" "FILE" "HOST_NAME") + "FILE_NAME" "FILE" "HOST_NAME" "_DT_NETFILE") (if (eq 'dired-mouse-drag-files 'link) 'XdndActionLink 'XdndActionCopy) diff --git a/lisp/select.el b/lisp/select.el index 3646a28b9b..dbe9633517 100644 --- a/lisp/select.el +++ b/lisp/select.el @@ -481,7 +481,8 @@ two markers or an overlay. Otherwise, it is nil." (defun xselect--int-to-cons (n) (cons (ash n -16) (logand n 65535))) -(defun xselect--encode-string (type str &optional can-modify) +(defun xselect--encode-string (type str &optional can-modify + prefer-string-to-c-string) (when str ;; If TYPE is nil, this is a local request; return STR as-is. (if (null type) @@ -574,7 +575,10 @@ two markers or an overlay. Otherwise, it is nil." (setq str (string-replace "\0" "\\0" str)) (setq next-selection-coding-system nil) - (cons type str)))) + (cons (if (and prefer-string-to-c-string + (eq type 'C_STRING)) + 'STRING type) + str)))) (defun xselect-convert-to-string (_selection type value) (let ((str (cond ((stringp value) value) @@ -621,7 +625,8 @@ two markers or an overlay. Otherwise, it is nil." (xselect--encode-string 'TEXT (buffer-file-name (nth 2 value)))) (when (and (stringp value) (file-exists-p value)) - (xselect--encode-string 'C_STRING value)))) + (xselect--encode-string 'TEXT (expand-file-name value) + nil t)))) (defun xselect-convert-to-charpos (_selection _type value) (when (setq value (xselect--selection-bounds value)) @@ -717,6 +722,42 @@ VALUE is the local selection value of SELECTION." (defun xselect-convert-xm-special (_selection _type _value) "") +(defun xselect-dt-netfile-available-p (selection _type value) + "Return whether or not `_DT_NETFILE' is a valid target for SELECTION. +VALUE is SELECTION's local selection value." + (and (eq selection 'XdndSelection) + (stringp value) + (file-exists-p value) + (not (file-remote-p value)))) + +(defun xselect-tt-net-file (file) + "Get the canonical ToolTalk filename for FILE. +FILE must be a local file, or otherwise the conversion will fail. +The string returned has three components: the hostname of the +machine where the file is, the real path, and the local path. +They are encoded into a string of the form +\"HOST=0-X,RPATH=X-Y,LPATH=Y-Z:DATA\", where X, Y, and Z are the +positions of the hostname, rpath and lpath inside DATA." + (let ((hostname (system-name)) + (rpath file) + (lpath file)) + (format "HOST=0-%d,RPATH=%d-%d,LPATH=%d-%d:%s%s%s" + (1- (length hostname)) (length hostname) + (1- (+ (length hostname) (length rpath))) + (+ (length hostname) (length rpath)) + (1- (+ (length hostname) (length rpath) + (length lpath))) + hostname rpath lpath))) + +(defun xselect-convert-to-dt-netfile (selection _type value) + "Convert SELECTION to a ToolTalk filename. +VALUE should be SELECTION's local value." + (when (and (eq selection 'XdndSelection) + (stringp value) + (file-exists-p value) + (not (file-remote-p value))) + (xselect-tt-net-file value))) + (setq selection-converter-alist '((TEXT . xselect-convert-to-string) (COMPOUND_TEXT . xselect-convert-to-string) @@ -724,9 +765,11 @@ VALUE is the local selection value of SELECTION." (UTF8_STRING . xselect-convert-to-string) (text/plain . xselect-convert-to-string) (text/plain\;charset=utf-8 . xselect-convert-to-string) - (text/uri-list . (xselect-uri-list-available-p . xselect-convert-to-text-uri-list)) + (text/uri-list . (xselect-uri-list-available-p + . xselect-convert-to-text-uri-list)) (text/x-xdnd-username . xselect-convert-to-username) - (FILE . (xselect-uri-list-available-p . xselect-convert-to-xm-file)) + (FILE . (xselect-uri-list-available-p + . xselect-convert-to-xm-file)) (TARGETS . xselect-convert-to-targets) (LENGTH . xselect-convert-to-length) (DELETE . xselect-convert-to-delete) @@ -744,7 +787,9 @@ VALUE is the local selection value of SELECTION." (SAVE_TARGETS . xselect-convert-to-save-targets) (_EMACS_INTERNAL . xselect-convert-to-identity) (XmTRANSFER_SUCCESS . xselect-convert-xm-special) - (XmTRANSFER_FAILURE . xselect-convert-xm-special))) + (XmTRANSFER_FAILURE . xselect-convert-xm-special) + (_DT_NETFILE . (xselect-convert-to-dt-netfile + . xselect-dt-netfile-available-p)))) (provide 'select) commit ebea3415b0720e900867356c334e201e531401b5 Author: Eli Zaretskii Date: Sat May 28 10:55:01 2022 +0300 Fix documentation of 'string-pad' * doc/lispref/strings.texi (Creating Strings): Fix description of 'string-pad'. (Bug#55688) diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index 2810f686eb..3d8db985e9 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi @@ -440,12 +440,12 @@ Split @var{string} into a list of strings on newline boundaries. If @end defun @defun string-pad string length &optional padding start -Pad @var{string} to the be of @var{length} using @var{padding} as the -padding character (defaulting to the space character). If -@var{string} is shorter than @var{length}, no padding is done. If -@var{start} is @code{nil} (or not present), the padding is done to the -end of the string, and if it's non-@code{nil}, to the start of the -string. +Pad @var{string} to be of the given @var{length} using @var{padding} +as the padding character. @var{padding} defaults to the space +character. If @var{string} is longer than @var{length}, no padding is +done. If @var{start} is @code{nil} or omitted, the padding is +appended to the characters of @var{string}, and if it's +non-@code{nil}, the padding is prepended to @var{string}'s characters. @end defun @defun string-chop-newline string