commit a2f7b7c803494deb112acc0222e9454c5268de1f (HEAD, refs/remotes/origin/master) Merge: 77bfc5ed7a 34e4eba07e Author: Eli Zaretskii Date: Fri May 27 09:42:39 2022 +0300 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs commit 77bfc5ed7af2ba0f05c53415f7d63107c372a29f Author: समीर सिंह Sameer Singh Date: Thu May 26 11:36:15 2022 +0530 Add support for the Javanese script (bug#55667) * lisp/language/indonesian.el ("Javanese"): New language environment. Add composition rules for Javanese. Add sample text and input method. * lisp/international/fontset.el (script-representative-chars): Support Javanese. * lisp/leim/quail/indonesian.el ("javanese"): New input method. * etc/NEWS: Announce the new language environment and its input method. diff --git a/etc/NEWS b/etc/NEWS index 8f877f40ac..3065fa85d3 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -824,6 +824,7 @@ corresponding language environments are: **** Tagbanwa script and language environment **** Limbu script and language environment **** Balinese script and language environment +**** Javanese 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 a7d7109c8d..6b51125629 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -203,7 +203,7 @@ (han #x5B57) (yi #xA288) (syloti-nagri #xA807 #xA823 #xA82C) - (javanese #xA980) + (javanese #xA98F #xA9B4 #xA9CA) (cham #xAA00) (tai-viet #xAA80) (hangul #xAC00) diff --git a/lisp/language/indonesian.el b/lisp/language/indonesian.el index 9a86135d89..994be2484a 100644 --- a/lisp/language/indonesian.el +++ b/lisp/language/indonesian.el @@ -36,6 +36,15 @@ (documentation . "\ Balinese language and its script are supported in this language environment."))) +(set-language-info-alist + "Javanese" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "javanese") + (sample-text . "Javanese (ꦲꦏ꧀ꦱꦫꦗꦮ) ꦲꦭꦺꦴ") + (documentation . "\ +Javanese language and its script are supported in this language environment."))) + ;; Balinese composition rules (let ((consonant "[\x1B13-\x1B33\x1B45-\x1B4B]") @@ -59,6 +68,27 @@ Balinese language and its script are supported in this language environment."))) vowel "?" modifier-above "?" musical-symbol "?") 1 'font-shape-gstring)))) +;; Javanese composition rules +(let ((consonant "[\xA98F-\xA9B2]") + (independent-vowel "[\xA984-\xA98E]") + (telu "\xA9B3") + (vowel "[\xA9B4-\xA9BC]") + (dependant-consonant "[\xA9BD-\xA9BF]") + (modifier-above "[\xA980-\xA983]") + (pangkon "\xA9C0")) + (set-char-table-range composition-function-table + '(#xA9B3 . #xA9C0) + (list (vector + ;; Consonant based syllables + (concat consonant telu "?" "\\(?:" pangkon consonant + telu "?\\)*\\(?:" pangkon "\\|" vowel "*" telu + "?" modifier-above "?" dependant-consonant "?\\)") + 1 'font-shape-gstring) + (vector + ;; Vowels based syllables + (concat independent-vowel telu "?" pangkon "?" + 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 46dafc89f5..82d0a2c269 100644 --- a/lisp/leim/quail/indonesian.el +++ b/lisp/leim/quail/indonesian.el @@ -173,5 +173,118 @@ ("`m" ?ᬁ) ("`M" ?ᬀ)) +(quail-define-package + "javanese" "Javanese" "ꦄ" t "Javanese 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" ?ꦛ) + ("Q" ?ꦜ) + ("`q" ?꧟) + ("`Q" ?ꧏ) + ("w" ?ꦝ) + ("W" ?ꦞ) + ("`w" ?꧌) + ("`W" ?꧍) + ("e" ?ꦺ) + ("E" ?ꦻ) + ("`e" ?ꦌ) + ("`E" ?ꦍ) + ("r" ?ꦫ) + ("R" ?ꦬ) + ("`r" ?ꦿ) + ("`R" ?ꦂ) + ("t" ?ꦠ) + ("T" ?ꦡ) + ("`t" ?ꦼ) + ("y" ?ꦪ) + ("Y" ?ꦾ) + ("u" ?ꦸ) + ("U" ?ꦹ) + ("`u" ?ꦈ) + ("`U" ?ꦅ) + ("i" ?ꦶ) + ("I" ?ꦷ) + ("`i" ?ꦆ) + ("`I" ?ꦇ) + ("o" ?ꦎ) + ("p" ?ꦥ) + ("P" ?ꦦ) + ("`p" ?ꦉ) + ("a" ?ꦴ) + ("A" ?ꦄ) + ("`a" ?ꦵ) + ("s" ?ꦱ) + ("S" ?ꦯ) + ("d" ?ꦢ) + ("D" ?ꦣ) + ("f" ?꧀) + ("F" ?ꦽ) + ("`f" ?ꦉ) + ("g" ?ꦒ) + ("G" ?ꦓ) + ("h" ?ꦲ) + ("H" ?ꦃ) + ("j" ?ꦗ) + ("J" ?ꦙ) + ("`j" ?ꦘ) + ("k" ?ꦏ) + ("K" ?ꦑ) + ("`k" ?ꦐ) + ("l" ?ꦭ) + ("L" ?ꦊ) + ("`l" ?ꦋ) + ("z" ?ꦚ) + ("Z" ?ꦔ) + ("x" ?ꦰ) + ("X" ?꦳) + ("c" ?ꦕ) + ("C" ?ꦖ) + ("`c" #x200C) ; ZWNJ + ("v" ?ꦮ) + ("V" ?ᭉ) + ("b" ?ꦧ) + ("B" ?ꦨ) + ("n" ?ꦤ) + ("N" ?ꦟ) + ("m" ?ꦩ) + ("M" ?ꦁ) + ("`m" ?ꦀ)) + (provide 'indonesian) ;;; indonesian.el ends here commit 34e4eba07ed491d3c01902023df6f15c968117cf Author: Po Lu Date: Fri May 27 14:38:44 2022 +0800 * etc/PROBLEMS: Document problems with PGTK input methods. diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 4224171298..018efcf302 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -3025,6 +3025,23 @@ GTK_IM_MODULE. GTK does not allow programs to warp the pointer anymore. There is nothing that can be done about this problem. +** Certain keys such as 'C-S-u' are not reported correctly. + +Some keys with modifiers such as Shift and Control might not be +reported correctly due to incorrectly written GTK input method +modules. This is known to happen to 'C-S-u' and 'C->', which are +misreported as 'C-u' and '>'. + +To disable the use of GTK input methods, evaluate: + + (pgtk-use-im-context nil) + +This will also cause system input methods and features such as the +Compose key to stop working. + +On X Windows, users should not use Emacs configured with PGTK, since +this and many other problems do not exist on the regular X builds. + * Build-time problems ** Configuration commit edd11a2c6e4ea37fe8030ca310b1c009d42ed35e Author: Po Lu Date: Fri May 27 14:32:09 2022 +0800 Update comments in some X code * src/xterm.c (x_parse_color): Update comment. (syms_of_xterm): Add new debugging option too. diff --git a/src/xterm.c b/src/xterm.c index 4f264ab2a8..00df7dce34 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -7264,10 +7264,8 @@ x_hash_string_ignore_case (const char *string) /* On frame F, translate the color name to RGB values. Use cached information, if possible. - Note that there is currently no way to clean old entries out of the - cache. However, it is limited to names in the server's database, - and names we've actually looked up; list-colors-display is probably - the most color-intensive case we're likely to hit. */ + If too many entries are placed in the cache, the least recently + used entries are removed. */ Status x_parse_color (struct frame *f, const char *color_name, @@ -7351,13 +7349,15 @@ x_parse_color (struct frame *f, const char *color_name, dpyinfo->color_names[idx] = cache_entry; /* Don't let the color cache become too big. */ - if (dpyinfo->color_names_length[idx] > 128) + if (dpyinfo->color_names_length[idx] > (x_color_cache_bucket_size > 0 + ? x_color_cache_bucket_size : 128)) { i = 0; for (last = dpyinfo->color_names[idx]; last; last = last->next) { - if (++i == 128) + if (++i == (x_color_cache_bucket_size > 0 + ? x_color_cache_bucket_size : 128)) { next = last->next; last->next = NULL; @@ -25941,4 +25941,9 @@ where the drop happened, ACTION is the action that was passed to `x-begin-drag', FRAME is the frame which initiated the drag-and-drop operation, and TIME is the X server time when the drop happened. */); Vx_dnd_unsupported_drop_function = Qnil; + + DEFVAR_INT ("x-color-cache-bucket-size", x_color_cache_bucket_size, + doc: /* Most buckets allowed per display in the internal color cache. +Values less than 1 mean 128. This option is for debugging only. */); + x_color_cache_bucket_size = 128; } commit 7da754015f15642b884e11a9b9abeaec838b0c4a Merge: bb0317442b 9283508fb2 Author: Stefan Kangas Date: Fri May 27 06:30:20 2022 +0200 Merge from origin/emacs-28 9283508fb2 Fix format specifiers in tramp-adb.el a9f17ccce3 ; Fix some doc typos and minor language issues commit bb0317442b4d62108ca40cc396f5ced467c55f25 Author: Po Lu Date: Fri May 27 10:34:04 2022 +0800 Fix XI scroll valuator reset on X Toolkit builds * src/xterm.c (handle_one_xevent): Reset valuators on XI_Leave if leave->event is an edit widget as well. diff --git a/src/xterm.c b/src/xterm.c index 5964a8bb48..4f264ab2a8 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -17841,6 +17841,16 @@ handle_one_xevent (struct x_display_info *dpyinfo, masks are set on the frame widget's window. */ f = x_window_to_frame (dpyinfo, leave->event); + /* Also do this again here, since the test for `any' + above may not have found a frame, as that usually + just looks up a top window on Xt builds. */ + +#ifdef HAVE_XINPUT2_1 + if (leave->detail != XINotifyInferior && f) + xi_reset_scroll_valuators_for_device_id (dpyinfo, + leave->deviceid, false); +#endif + if (!f) f = x_top_window_to_frame (dpyinfo, leave->event); #endif commit c0807daedc22812add26f9f9be8d9b68afac1217 Author: Po Lu Date: Fri May 27 09:40:40 2022 +0800 Improve lookup efficiency of color cache and prevent leaking * src/xterm.c (x_parse_color): Move recently used colors to the start of the cache and free unused entries when there are too many. (x_term_init, x_delete_display): Initialize and free new fields. * src/xterm.h (struct x_display_info): New field `color_names_length'. diff --git a/src/xterm.c b/src/xterm.c index 2c50b50815..5964a8bb48 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -7277,9 +7277,10 @@ x_parse_color (struct frame *f, const char *color_name, Display *dpy; Colormap cmap; struct x_display_info *dpyinfo; - struct color_name_cache_entry *cache_entry; + struct color_name_cache_entry *cache_entry, *last; + struct color_name_cache_entry *next, *color_entry; unsigned int hash, idx; - int rc; + int rc, i; /* Don't pass #RGB strings directly to XParseColor, because that follows the X convention of zero-extending each channel @@ -7306,16 +7307,31 @@ x_parse_color (struct frame *f, const char *color_name, hash = x_hash_string_ignore_case (color_name); idx = hash % dpyinfo->color_names_size; + last = NULL; + for (cache_entry = dpyinfo->color_names[idx]; cache_entry; cache_entry = cache_entry->next) { if (!xstrcasecmp (cache_entry->name, color_name)) { + /* Move recently used entries to the start of the color + cache. */ + + if (last) + { + last->next = cache_entry->next; + cache_entry->next = dpyinfo->color_names[idx]; + + dpyinfo->color_names[idx] = cache_entry; + } + if (cache_entry->valid) *color = cache_entry->rgb; return cache_entry->valid; } + + last = cache_entry; } block_input (); @@ -7323,6 +7339,7 @@ x_parse_color (struct frame *f, const char *color_name, unblock_input (); cache_entry = xzalloc (sizeof *cache_entry); + dpyinfo->color_names_length[idx] += 1; if (rc) cache_entry->rgb = *color; @@ -7333,6 +7350,33 @@ x_parse_color (struct frame *f, const char *color_name, dpyinfo->color_names[idx] = cache_entry; + /* Don't let the color cache become too big. */ + if (dpyinfo->color_names_length[idx] > 128) + { + i = 0; + + for (last = dpyinfo->color_names[idx]; last; last = last->next) + { + if (++i == 128) + { + next = last->next; + last->next = NULL; + + for (color_entry = next; color_entry; color_entry = last) + { + last = color_entry->next; + + xfree (color_entry->name); + xfree (color_entry); + + dpyinfo->color_names_length[idx] -= 1; + } + + return rc; + } + } + } + return rc; } @@ -24511,6 +24555,8 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) dpyinfo->color_names_size = 256; dpyinfo->color_names = xzalloc (dpyinfo->color_names_size * sizeof *dpyinfo->color_names); + dpyinfo->color_names_length = xzalloc (dpyinfo->color_names_size + * sizeof *dpyinfo->color_names_length); /* Set the name of the terminal. */ terminal->name = xlispstrdup (display_name); @@ -25248,6 +25294,7 @@ x_delete_display (struct x_display_info *dpyinfo) } xfree (dpyinfo->color_names); + xfree (dpyinfo->color_names_length); xfree (dpyinfo->x_id_name); xfree (dpyinfo->x_dnd_atoms); xfree (dpyinfo->color_cells); diff --git a/src/xterm.h b/src/xterm.h index daeb1a4575..fbb381d066 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -520,6 +520,9 @@ struct x_display_info /* A cache mapping color names to RGB values. */ struct color_name_cache_entry **color_names; + /* The number of buckets for each hash in that hash table. */ + ptrdiff_t *color_names_length; + /* The size of that hash table. */ int color_names_size; commit 8dcebc96299149845d63e23f27c75a1ecc0b3538 Author: Po Lu Date: Fri May 27 00:24:12 2022 +0000 Handle allocation errors when creating menu items on Haiku * src/haiku_support.cc (class EmacsMenuItem): Don't abort on failed strdup. diff --git a/src/haiku_support.cc b/src/haiku_support.cc index 977728b5e3..c1617c86cc 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -2385,30 +2385,25 @@ class EmacsTitleMenuItem : public BMenuItem class EmacsMenuItem : public BMenuItem { public: - int menu_bar_id = -1; - void *menu_ptr = NULL; - void *wind_ptr = NULL; - char *key = NULL; - char *help = NULL; - - EmacsMenuItem (const char *ky, - const char *str, - const char *help, - BMessage *message = NULL) : BMenuItem (str, message) + int menu_bar_id; + void *menu_ptr; + void *wind_ptr; + char *key; + char *help; + + EmacsMenuItem (const char *key_label, const char *label, + const char *help, BMessage *message = NULL) + : BMenuItem (label, message), + menu_bar_id (-1), + menu_ptr (NULL), + wind_ptr (NULL), + key (NULL), + help (NULL) { - if (ky) - { - key = strdup (ky); - if (!key) - gui_abort ("strdup failed"); - } + if (key_label) + key = strdup (key_label); - if (help) - { - this->help = strdup (help); - if (!this->help) - gui_abort ("strdup failed"); - } + this->help = strdup (help); } ~EmacsMenuItem () commit 061c2d683fae03b63872c08f6c4db37f930bb3b7 Author: Po Lu Date: Fri May 27 08:12:52 2022 +0800 Fix longjmp/siglongjmp mixup * src/xterm.c (xm_drag_window_io_error_handler) (x_dnd_io_error_handler): Use `siglongjmp'. Reported by Ken Brown . diff --git a/src/xterm.c b/src/xterm.c index d949439d18..2c50b50815 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1157,7 +1157,7 @@ static unsigned int x_dnd_keyboard_state; /* jmp_buf that gets us out of the IO error handler if an error occurs terminating DND as part of the display disconnect handler. */ -static jmp_buf x_dnd_disconnect_handler; +static sigjmp_buf x_dnd_disconnect_handler; /* Structure describing a single window that can be the target of drag-and-drop operations. */ @@ -1612,7 +1612,7 @@ xm_drag_window_io_error_handler (Display *dpy) { /* DPY isn't created through GDK, so it doesn't matter if we don't crash here. */ - longjmp (x_dnd_disconnect_handler, 1); + siglongjmp (x_dnd_disconnect_handler, 1); } static Window @@ -2830,7 +2830,7 @@ x_dnd_io_error_handler (Display *display) #ifdef USE_GTK emacs_abort (); #else - longjmp (x_dnd_disconnect_handler, 1); + siglongjmp (x_dnd_disconnect_handler, 1); #endif } commit 2c76cee37cd9e3e275ff1543018e7535038f5cb6 Author: Lars Ingebrigtsen Date: Thu May 26 22:53:03 2022 +0200 Regenerated ldefs-boot.el diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index ed133cd55d..362c3221c6 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -20344,7 +20344,7 @@ KEYS should be a vector or a string that obeys `key-valid-p'. (make-obsolete 'kmacro-lambda-form 'kmacro '"29.1") -(register-definition-prefixes "kmacro" '("kdb-macro-redisplay" "kmacro-")) +(register-definition-prefixes "kmacro" '("kmacro-")) ;;;*** @@ -25336,7 +25336,7 @@ that code in the early init-file. (defun package-activate-all nil "\ Activate all installed packages. -The variable `package-load-list' controls which packages to load." (setq package--activated t) (let* ((elc (concat package-quickstart-file "c")) (qs (if (file-readable-p elc) elc (if (file-readable-p package-quickstart-file) package-quickstart-file)))) (if qs (let ((load-source-file-function nil)) (unless (boundp 'package-activated-list) (setq package-activated-list nil)) (load qs nil 'nomessage)) (require 'package) (package--activate-all)))) +The variable `package-load-list' controls which packages to load." (setq package--activated t) (let* ((elc (concat package-quickstart-file "c")) (qs (if (file-readable-p elc) elc (if (file-readable-p package-quickstart-file) package-quickstart-file)))) (if (and qs (not (bound-and-true-p package-activated-list))) (let ((load-source-file-function nil)) (unless (boundp 'package-activated-list) (setq package-activated-list nil)) (load qs nil 'nomessage)) (require 'package) (package--activate-all)))) (autoload 'package-import-keyring "package" "\ Import keys from FILE. @@ -40484,25 +40484,26 @@ Zone out, completely." t nil) ;;;;;; "language/chinese.el" "language/cyrillic.el" "language/czech.el" ;;;;;; "language/english.el" "language/ethiopic.el" "language/european.el" ;;;;;; "language/georgian.el" "language/greek.el" "language/hebrew.el" -;;;;;; "language/indian.el" "language/japanese.el" "language/khmer.el" -;;;;;; "language/korean.el" "language/lao.el" "language/misc-lang.el" -;;;;;; "language/philippine.el" "language/romanian.el" "language/sinhala.el" -;;;;;; "language/slovak.el" "language/tai-viet.el" "language/thai.el" -;;;;;; "language/tibetan.el" "language/utf-8-lang.el" "language/vietnamese.el" -;;;;;; "ldefs-boot.el" "leim/ja-dic/ja-dic.el" "leim/leim-list.el" -;;;;;; "leim/quail/4Corner.el" "leim/quail/ARRAY30.el" "leim/quail/CCDOSPY.el" -;;;;;; "leim/quail/CTLau-b5.el" "leim/quail/CTLau.el" "leim/quail/ECDICT.el" -;;;;;; "leim/quail/ETZY.el" "leim/quail/PY-b5.el" "leim/quail/PY.el" -;;;;;; "leim/quail/Punct-b5.el" "leim/quail/Punct.el" "leim/quail/QJ-b5.el" -;;;;;; "leim/quail/QJ.el" "leim/quail/SW.el" "leim/quail/TONEPY.el" -;;;;;; "leim/quail/ZIRANMA.el" "leim/quail/ZOZY.el" "leim/quail/arabic.el" -;;;;;; "leim/quail/cham.el" "leim/quail/compose.el" "leim/quail/croatian.el" -;;;;;; "leim/quail/cyril-jis.el" "leim/quail/cyrillic.el" "leim/quail/czech.el" -;;;;;; "leim/quail/emoji.el" "leim/quail/georgian.el" "leim/quail/greek.el" -;;;;;; "leim/quail/hanja-jis.el" "leim/quail/hanja.el" "leim/quail/hanja3.el" -;;;;;; "leim/quail/hebrew.el" "leim/quail/ipa-praat.el" "leim/quail/latin-alt.el" -;;;;;; "leim/quail/latin-ltx.el" "leim/quail/latin-post.el" "leim/quail/latin-pre.el" -;;;;;; "leim/quail/persian.el" "leim/quail/philippine.el" "leim/quail/programmer-dvorak.el" +;;;;;; "language/indian.el" "language/indonesian.el" "language/japanese.el" +;;;;;; "language/khmer.el" "language/korean.el" "language/lao.el" +;;;;;; "language/misc-lang.el" "language/philippine.el" "language/romanian.el" +;;;;;; "language/sinhala.el" "language/slovak.el" "language/tai-viet.el" +;;;;;; "language/thai.el" "language/tibetan.el" "language/utf-8-lang.el" +;;;;;; "language/vietnamese.el" "ldefs-boot.el" "leim/ja-dic/ja-dic.el" +;;;;;; "leim/leim-list.el" "leim/quail/4Corner.el" "leim/quail/ARRAY30.el" +;;;;;; "leim/quail/CCDOSPY.el" "leim/quail/CTLau-b5.el" "leim/quail/CTLau.el" +;;;;;; "leim/quail/ECDICT.el" "leim/quail/ETZY.el" "leim/quail/PY-b5.el" +;;;;;; "leim/quail/PY.el" "leim/quail/Punct-b5.el" "leim/quail/Punct.el" +;;;;;; "leim/quail/QJ-b5.el" "leim/quail/QJ.el" "leim/quail/SW.el" +;;;;;; "leim/quail/TONEPY.el" "leim/quail/ZIRANMA.el" "leim/quail/ZOZY.el" +;;;;;; "leim/quail/arabic.el" "leim/quail/cham.el" "leim/quail/compose.el" +;;;;;; "leim/quail/croatian.el" "leim/quail/cyril-jis.el" "leim/quail/cyrillic.el" +;;;;;; "leim/quail/czech.el" "leim/quail/emoji.el" "leim/quail/georgian.el" +;;;;;; "leim/quail/greek.el" "leim/quail/hanja-jis.el" "leim/quail/hanja.el" +;;;;;; "leim/quail/hanja3.el" "leim/quail/hebrew.el" "leim/quail/indonesian.el" +;;;;;; "leim/quail/ipa-praat.el" "leim/quail/latin-alt.el" "leim/quail/latin-ltx.el" +;;;;;; "leim/quail/latin-post.el" "leim/quail/latin-pre.el" "leim/quail/persian.el" +;;;;;; "leim/quail/philippine.el" "leim/quail/programmer-dvorak.el" ;;;;;; "leim/quail/py-punct.el" "leim/quail/pypunct-b5.el" "leim/quail/quick-b5.el" ;;;;;; "leim/quail/quick-cns.el" "leim/quail/rfc1345.el" "leim/quail/sami.el" ;;;;;; "leim/quail/sgml-input.el" "leim/quail/slovak.el" "leim/quail/symbol-ksc.el" commit 14cbb75455d4ebea0deeb28f8a1501d17af5270d Merge: fbe0d7361f 80ba4c1707 Author: Stefan Monnier Date: Thu May 26 16:46:11 2022 -0400 Merge remote-tracking branch 'origin/scratch/bug-55156' commit fbe0d7361f046e28f021cdce0adf05dfda93fe45 Author: Stefan Monnier Date: Thu May 26 16:40:52 2022 -0400 package-activate-all: Use the quickstart more conservatively * lisp/emacs-lisp/package.el (package-activate-all): Don't use the quickstart file if some packages have already been activated. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 9243869853..f4872a1a52 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1629,7 +1629,9 @@ The variable `package-load-list' controls which packages to load." (qs (if (file-readable-p elc) elc (if (file-readable-p package-quickstart-file) package-quickstart-file)))) - (if qs + ;; The quickstart file presumes that it has a blank slate, + ;; so don't use it if we already activated some packages. + (if (and qs (not (bound-and-true-p package-activated-list))) ;; Skip load-source-file-function which would slow us down by a factor ;; 2 when loading the .el file (this assumes we were careful to ;; save this file so it doesn't need any decoding). commit 3d567a5517ca461071d169635cfce3430630b56f Author: Sam Steingold Date: Thu May 26 16:18:09 2022 -0400 Avoid duplicates in `package-activated-list' * lisp/emacs-lisp/package.el (package-quickstart-refresh): Calling `package-activate-all' twice leads to duplicates in `package-activated-list' - avoid that. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 1cebab36f2..9243869853 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4295,8 +4295,9 @@ activations need to be changed, such as when `package-load-list' is modified." (insert ")\n"))) (pp `(defvar package-activated-list) (current-buffer)) (pp `(setq package-activated-list - (append ',(mapcar #'package-desc-name package--quickstart-pkgs) - package-activated-list)) + (delete-dups + (append ',(mapcar #'package-desc-name package--quickstart-pkgs) + package-activated-list))) (current-buffer)) (let ((info-dirs (butlast Info-directory-list))) (when info-dirs commit 37b3624cd2334e2d593513af39c8f9913e227e64 Author: Juri Linkov Date: Thu May 26 19:26:10 2022 +0300 Test suite for Completions UI (bug#54374) * test/lisp/minibuffer-tests.el (completing-read-with-minibuffer-setup): New macro based on xdisp-tests--in-minibuffer. (completion-auto-help-test, completion-auto-select-test) (completion-auto-wrap-test, completions-header-format-test) (completions-affixation-navigation-test): New tests. diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el index 2a29d5f167..9111b5f4a8 100644 --- a/test/lisp/minibuffer-tests.el +++ b/test/lisp/minibuffer-tests.el @@ -331,5 +331,128 @@ "custgroup" '("customize-group-other-window") nil 9))) 15))) + +(defmacro completing-read-with-minibuffer-setup (collection &rest body) + (declare (indent 1) (debug (collection body))) + `(catch 'result + (minibuffer-with-setup-hook + (lambda () + (let ((redisplay-skip-initial-frame nil) + (executing-kbd-macro nil)) ; Don't skip redisplay + (throw 'result (progn . ,body)))) + (let ((executing-kbd-macro t)) ; Force the real minibuffer + (completing-read "Prompt: " ,collection))))) + +(ert-deftest completion-auto-help-test () + (let (messages) + (cl-letf* (((symbol-function 'minibuffer-message) + (lambda (message &rest args) + (push (apply #'format-message message args) messages)))) + (let ((completion-auto-help nil)) + (completing-read-with-minibuffer-setup + '("a" "ab" "ac") + (execute-kbd-macro (kbd "a TAB TAB")) + (should (equal (car messages) "Complete, but not unique")) + (should-not (get-buffer-window "*Completions*" 0)))) + (let ((completion-auto-help t)) + (completing-read-with-minibuffer-setup + '("a" "ab" "ac") + (execute-kbd-macro (kbd "a TAB TAB")) + (should (get-buffer-window "*Completions*" 0))))))) + +(ert-deftest completion-auto-select-test () + (let ((completion-auto-select t)) + (completing-read-with-minibuffer-setup + '("aa" "ab" "ac") + (execute-kbd-macro (kbd "a TAB")) + (should (and (get-buffer-window "*Completions*" 0) + (eq (current-buffer) (get-buffer "*Completions*")))))) + (let ((completion-auto-select 'second-tab)) + (completing-read-with-minibuffer-setup + '("aa" "ab" "ac") + (execute-kbd-macro (kbd "a TAB")) + (should (and (get-buffer-window "*Completions*" 0) + (not (eq (current-buffer) (get-buffer "*Completions*"))))) + (execute-kbd-macro (kbd "TAB TAB")) + (should (eq (current-buffer) (get-buffer "*Completions*")))))) + +(ert-deftest completion-auto-wrap-test () + (let ((completion-wrap-movement nil)) + (completing-read-with-minibuffer-setup + '("aa" "ab" "ac") + (insert "a") + (minibuffer-completion-help) + (switch-to-completions) + (should (equal "aa" (get-text-property (point) 'completion--string))) + (next-completion 2) + (should (equal "ac" (get-text-property (point) 'completion--string))) + ;; FIXME: bug#54374 + ;; (next-completion 1) + ;; (should (equal "ac" (get-text-property (point) 'completion--string))) + (previous-completion 1) + (should (equal "ab" (get-text-property (point) 'completion--string))))) + (let ((completion-wrap-movement t)) + (completing-read-with-minibuffer-setup + '("aa" "ab" "ac") + (insert "a") + (minibuffer-completion-help) + (switch-to-completions) + (should (equal "aa" (get-text-property (point) 'completion--string))) + (next-completion 2) + (should (equal "ac" (get-text-property (point) 'completion--string))) + (next-completion 1) + (should (equal "aa" (get-text-property (point) 'completion--string))) + (previous-completion 1) + (should (equal "ac" (get-text-property (point) 'completion--string)))))) + +(ert-deftest completions-header-format-test () + (let ((completions-header-format nil) + (completion-show-help nil)) + (completing-read-with-minibuffer-setup + '("aa" "ab" "ac") + (insert "a") + (minibuffer-completion-help) + (switch-to-completions) + ;; FIXME: bug#55430 + ;; (should (equal "aa" (get-text-property (point) 'completion--string))) + ;; FIXME: bug#54374 + ;; (previous-completion 1) + ;; (should (equal "ac" (get-text-property (point) 'completion--string))) + ;; (next-completion 1) + ;; (should (equal "aa" (get-text-property (point) 'completion--string))) + ;; FIXME: bug#55430 + ;; (choose-completion nil t) + ;; (should (equal (minibuffer-contents) "aa")) + ) + (completing-read-with-minibuffer-setup + '("aa" "ab" "ac") + ;; FIXME: bug#55289 + ;; (execute-kbd-macro (kbd "a M- M-")) + ;; (should (equal (minibuffer-contents) "aa")) + ))) + +(ert-deftest completions-affixation-navigation-test () + (let ((completion-extra-properties + '(:affixation-function + (lambda (completions) + (mapcar (lambda (c) + (list c "prefix " " suffix")) + completions))))) + (completing-read-with-minibuffer-setup + '("aa" "ab" "ac") + (insert "a") + (minibuffer-completion-help) + (switch-to-completions) + (should (equal 'highlight (get-text-property (point) 'mouse-face))) + (should (equal "aa" (get-text-property (point) 'completion--string))) + (next-completion 1) + (should (equal 'highlight (get-text-property (point) 'mouse-face))) + (should (equal "ab" (get-text-property (point) 'completion--string))) + (goto-char (1- (point-max))) + ;; FIXME: bug#54374 + ;; (choose-completion nil t) + ;; (should (equal (minibuffer-contents) "ac")) + ))) + (provide 'minibuffer-tests) ;;; minibuffer-tests.el ends here commit 80ba4c170756049a101b4e6692882ac30ba5e1a5 Author: Stefan Monnier Date: Wed May 25 17:53:39 2022 -0400 eval.c: New functions `defvar-1` and `defconst-1` (bug#55156) The bytecode interpreter can't directly call special forms, so the byte-compiler usually converts special forms into some sequence of byte codes (basically, providing a duplicate definition of the special form). There are still two exceptions to this: `defconst` and `defvar`, where the compiler instead generates a convoluted chunk of code like: (funcall '(lambda (x) (defvar x )) ) where the quote makes sure we keep the function non-compiled, so as to end up running the special form at run time. Get rid of this workaround by introducing `defvar-1` and `defconst-1` which provide a *functional* interface to the functionality of the corresponding special form. * src/eval.c (defvar, Fdefvar_1, Fdefconst_1): New functions, extracted from `Fdefvar` and `Fdefconst`. (Fdefvar, Fdefconst): Use them. (syms_of_eval): `defsubr` the new functions. * lisp/emacs-lisp/bytecomp.el (byte-compile-tmp-var): Delete const. (byte-compile-defvar): Simplify using the new functions. * doc/lispref/variables.texi (Defining Variables): Adjust the doc of `defvar` to reflect the actual semantics implemented. diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index f0e3f337a6..c29547d00d 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -527,10 +527,11 @@ If @var{symbol} has a buffer-local binding in the current buffer, rather than the buffer-local binding. It sets the default value if the default value is void. @xref{Buffer-Local Variables}. -If @var{symbol} is already lexically bound (e.g., if the @code{defvar} -form occurs in a @code{let} form with lexical binding enabled), then -@code{defvar} sets the dynamic value. The lexical binding remains in -effect until its binding construct exits. @xref{Variable Scoping}. +If @var{symbol} is already let bound (e.g., if the @code{defvar} +form occurs in a @code{let} form), then @code{defvar} sets the toplevel +default value, like @code{set-default-toplevel-value}. +The let binding remains in effect until its binding construct exits. +@xref{Variable Scoping}. @cindex @code{eval-defun}, and @code{defvar} forms @cindex @code{eval-last-sexp}, and @code{defvar} forms diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index d7140ad9e6..ee530f95d0 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -4943,8 +4943,6 @@ binding slots have been popped." (push (nth 1 (nth 1 form)) byte-compile-global-not-obsolete-vars)) (byte-compile-normal-call form)) -(defconst byte-compile-tmp-var (make-symbol "def-tmp-var")) - (defun byte-compile-defvar (form) ;; This is not used for file-level defvar/consts. (when (and (symbolp (nth 1 form)) @@ -4977,18 +4975,17 @@ binding slots have been popped." string "third arg to `%s %s' is not a string: %s" fun var string)) + ;; Delegate the actual work to the function version of the + ;; special form, named with a "-1" suffix. (byte-compile-form-do-effect - (if (cddr form) ; `value' provided - ;; Quote with `quote' to prevent byte-compiling the body, - ;; which would lead to an inf-loop. - `(funcall '(lambda (,byte-compile-tmp-var) - (,fun ,var ,byte-compile-tmp-var ,@(nthcdr 3 form))) - ,value) - (if (eq fun 'defconst) - ;; This will signal an appropriate error at runtime. - `(eval ',form) - ;; A simple (defvar foo) just returns foo. - `',var))))) + (cond + ((eq fun 'defconst) `(defconst-1 ',var ,@(nthcdr 2 form))) + ((not (cddr form)) `',var) ; A simple (defvar foo) just returns foo. + (t `(defvar-1 ',var + ;; Don't eval `value' if `defvar' wouldn't eval it either. + ,(if (macroexp-const-p value) value + `(if (boundp ',var) nil ,value)) + ,@(nthcdr 3 form))))))) (defun byte-compile-autoload (form) (and (macroexp-const-p (nth 1 form)) diff --git a/src/eval.c b/src/eval.c index 08e2dce61e..c3be1dc12c 100644 --- a/src/eval.c +++ b/src/eval.c @@ -756,6 +756,33 @@ value. */) return Qnil; } +static Lisp_Object +defvar (Lisp_Object sym, Lisp_Object initvalue, Lisp_Object docstring, bool eval) +{ + Lisp_Object tem; + + CHECK_SYMBOL (sym); + + tem = Fdefault_boundp (sym); + + /* Do it before evaluating the initial value, for self-references. */ + Finternal__define_uninitialized_variable (sym, docstring); + + if (NILP (tem)) + Fset_default (sym, eval ? eval_sub (initvalue) : initvalue); + else + { /* Check if there is really a global binding rather than just a let + binding that shadows the global unboundness of the var. */ + union specbinding *binding = default_toplevel_binding (sym); + if (binding && EQ (specpdl_old_value (binding), Qunbound)) + { + set_specpdl_old_value (binding, + eval ? eval_sub (initvalue) : initvalue); + } + } + return sym; +} + DEFUN ("defvar", Fdefvar, Sdefvar, 1, UNEVALLED, 0, doc: /* Define SYMBOL as a variable, and return SYMBOL. You are not required to define a variable in order to use it, but @@ -770,12 +797,10 @@ value. If SYMBOL is buffer-local, its default value is what is set; buffer-local values are not affected. If INITVALUE is missing, SYMBOL's value is not set. -If SYMBOL has a local binding, then this form affects the local -binding. This is usually not what you want. Thus, if you need to -load a file defining variables, with this form or with `defconst' or -`defcustom', you should always load that file _outside_ any bindings -for these variables. (`defconst' and `defcustom' behave similarly in -this respect.) +If SYMBOL is let-bound, then this form does not affect the local let +binding but the toplevel default binding instead, like +`set-toplevel-default-binding`. +(`defcustom' behaves similarly in this respect.) The optional argument DOCSTRING is a documentation string for the variable. @@ -786,7 +811,7 @@ To define a buffer-local variable, use `defvar-local'. usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) (Lisp_Object args) { - Lisp_Object sym, tem, tail; + Lisp_Object sym, tail; sym = XCAR (args); tail = XCDR (args); @@ -798,24 +823,8 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) if (!NILP (XCDR (tail)) && !NILP (XCDR (XCDR (tail)))) error ("Too many arguments"); Lisp_Object exp = XCAR (tail); - - tem = Fdefault_boundp (sym); tail = XCDR (tail); - - /* Do it before evaluating the initial value, for self-references. */ - Finternal__define_uninitialized_variable (sym, CAR (tail)); - - if (NILP (tem)) - Fset_default (sym, eval_sub (exp)); - else - { /* Check if there is really a global binding rather than just a let - binding that shadows the global unboundness of the var. */ - union specbinding *binding = default_toplevel_binding (sym); - if (binding && EQ (specpdl_old_value (binding), Qunbound)) - { - set_specpdl_old_value (binding, eval_sub (exp)); - } - } + return defvar (sym, exp, CAR (tail), true); } else if (!NILP (Vinternal_interpreter_environment) && (SYMBOLP (sym) && !XSYMBOL (sym)->u.s.declared_special)) @@ -834,6 +843,14 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) return sym; } +DEFUN ("defvar-1", Fdefvar_1, Sdefvar_1, 2, 3, 0, + doc: /* Like `defvar' but as a function. +More specifically behaves like (defvar SYM 'INITVALUE DOCSTRING). */) + (Lisp_Object sym, Lisp_Object initvalue, Lisp_Object docstring) +{ + return defvar (sym, initvalue, docstring, false); +} + DEFUN ("defconst", Fdefconst, Sdefconst, 2, UNEVALLED, 0, doc: /* Define SYMBOL as a constant variable. This declares that neither programs nor users should ever change the @@ -863,9 +880,18 @@ usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */) error ("Too many arguments"); docstring = XCAR (XCDR (XCDR (args))); } + tem = eval_sub (XCAR (XCDR (args))); + return Fdefconst_1 (sym, tem, docstring); +} +DEFUN ("defconst-1", Fdefconst_1, Sdefconst_1, 2, 3, 0, + doc: /* Like `defconst' but as a function. +More specifically, behaves like (defconst SYM 'INITVALUE DOCSTRING). */) + (Lisp_Object sym, Lisp_Object initvalue, Lisp_Object docstring) +{ + CHECK_SYMBOL (sym); + Lisp_Object tem = initvalue; Finternal__define_uninitialized_variable (sym, docstring); - tem = eval_sub (XCAR (XCDR (args))); if (!NILP (Vpurify_flag)) tem = Fpurecopy (tem); Fset_default (sym, tem); /* FIXME: set-default-toplevel-value? */ @@ -4333,9 +4359,11 @@ alist of active lexical bindings. */); defsubr (&Sdefault_toplevel_value); defsubr (&Sset_default_toplevel_value); defsubr (&Sdefvar); + defsubr (&Sdefvar_1); defsubr (&Sdefvaralias); DEFSYM (Qdefvaralias, "defvaralias"); defsubr (&Sdefconst); + defsubr (&Sdefconst_1); defsubr (&Sinternal__define_uninitialized_variable); defsubr (&Smake_var_non_special); defsubr (&Slet); commit 77b5840d4ab37c1485745def5ec0c9b9f6cb137f Author: Stefan Monnier Date: Thu May 26 12:16:04 2022 -0400 * test/lisp/files-resources/compile-utf8.el: Use lexical-binding diff --git a/test/lisp/files-resources/compile-utf8.el b/test/lisp/files-resources/compile-utf8.el index ea67626365..1f804dcf8d 100644 --- a/test/lisp/files-resources/compile-utf8.el +++ b/test/lisp/files-resources/compile-utf8.el @@ -1,3 +1,4 @@ +;; -*- lexical-binding: t; -*- (defun zot () "Yes." nil) commit 69cd21222a43ff0144ab7fef51ba23de246209cc Author: Stefan Monnier Date: Thu May 26 12:15:06 2022 -0400 * etc/themes/leuven-dark-theme.el: Use lexical-binding diff --git a/etc/themes/leuven-dark-theme.el b/etc/themes/leuven-dark-theme.el index d85f8f1aa9..3fbb9d6c99 100644 --- a/etc/themes/leuven-dark-theme.el +++ b/etc/themes/leuven-dark-theme.el @@ -1,4 +1,4 @@ -;;; leuven-dark-theme.el --- Awesome Emacs color theme on dark background +;;; leuven-dark-theme.el --- Awesome Emacs color theme on dark background -*- lexical-binding: t; -*- ;; Copyright (C) 2003-2022 Free Software Foundation, Inc. @@ -103,7 +103,7 @@ more...") ;; Leuven generic colors. (cancel '(:slant italic :strike-through t :foreground "#5b5660")) - (clock-line '(:box (:line-width 1 :color "#cfa161") :foreground "#ffffff" :background "#1636ff")) + ;; (clock-line '(:box (:line-width 1 :color "#cfa161") :foreground "#ffffff" :background "#1636ff")) (code-block '(:foreground "#ffff7f" :background "#252046")) (code-inline '(:foreground "#ff9bff" :background "#262031")) (column '(:height 1.0 :weight normal :slant normal :underline nil :strike-through nil :foreground "#1e52b8" :background "#252c48")) @@ -124,10 +124,10 @@ more...") (grep-file-name '(:weight bold :foreground "#d8b76b")) ; Used for grep hits. (grep-line-number '(:weight bold :foreground "#5fca5b")) (highlight-blue '(:background "#3c312a")) - (highlight-blue2 '(:background "#3e2d2f")) + ;; (highlight-blue2 '(:background "#3e2d2f")) (highlight-gray '(:background "#3e3944")) - (highlight-green '(:background "#2f0e3a")) - (highlight-red '(:background "#063741")) + ;; (highlight-green '(:background "#2f0e3a")) + ;; (highlight-red '(:background "#063741")) (highlight-yellow '(:background "#2d2058")) (link '(:weight normal :underline t :foreground "#ff925a")) (link-no-underline '(:weight normal :foreground "#ff925a")) commit 9283508fb282cbd51b9376f17b5347246daf74f2 Author: Hayden Shenk Date: Thu May 26 18:09:56 2022 +0200 Fix format specifiers in tramp-adb.el * lisp/net/tramp-adb.el (tramp-adb-get-device): Fix format specifiers for port. (Bug#55651) Copyright-paperwork-exempt: yes diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index aa0f558a2b..1fe10a560b 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -1112,9 +1112,9 @@ E.g. a host name \"192.168.1.1#5555\" returns \"192.168.1.1:5555\" tramp-prefix-port-format ":" (cond ((member host devices) host) ;; This is the case when the host is connected to the default port. - ((member (format "%s%s%d" host tramp-prefix-port-format port) + ((member (format "%s%s%s" host tramp-prefix-port-format port) devices) - (format "%s:%d" host port)) + (format "%s:%s" host port)) ;; An empty host name shall be mapped as well, when there ;; is exactly one entry in `devices'. ((and (zerop (length host)) (= (length devices) 1)) commit 4677ff436110d3142183017451146b31ac1b46ef Author: समीर सिंह Sameer Singh Date: Thu May 26 05:34:30 2022 +0530 Add support for the Balinese script (bug#55648) * lisp/language/indonesian.el ("Balinese"): New language environment. Add composition rules for Balinese. Add sample text and input method. * lisp/international/fontset.el (script-representative-chars) (setup-default-fontset): Support Balinese. * lisp/leim/quail/indonesian.el ("balinese"): New input method. * lisp/loadup.el: Preload lisp/language/indonesian.el. * etc/HELLO: Add a Balinese greeting. * etc/NEWS: Announce the new language environment and its input method. diff --git a/etc/HELLO b/etc/HELLO index 31f753c73a..248c02b7ab 100644 --- a/etc/HELLO +++ b/etc/HELLO @@ -27,6 +27,7 @@ LANGUAGE (NATIVE NAME) HELLO Amharic (አማርኛ) ሠላም Arabic (العربيّة) السّلام عليكم Armenian (հայերեն) Բարև ձեզ +Balinese (ᬅᬓ᭄ᬱᬭᬩᬮᬶ) ᬒᬁᬲ᭄ᬯᬲ᭄ᬢ᭄ᬬᬲ᭄ᬢᬸ Belarusian (беларуская) Прывітанне Bengali (বাংলা) নমস্কার Brahmi (𑀩𑁆𑀭𑀸𑀳𑁆𑀫𑀻) 𑀦𑀫𑀲𑁆𑀢𑁂 diff --git a/etc/NEWS b/etc/NEWS index 4ebaf6e07a..8f877f40ac 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -823,6 +823,7 @@ corresponding language environments are: **** Buhid script and language environment **** Tagbanwa script and language environment **** Limbu script and language environment +**** Balinese 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 42fbedae1d..a7d7109c8d 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -189,6 +189,7 @@ (khmer #x1780) (mongolian #x1826) (limbu #x1901 #x1920 #x1936) + (balinese #x1B13 #x1B35 #x1B5E) (tai-le #x1950) (tai-lue #x1980) (tai-tham #x1A20 #x1A55 #x1A61 #x1A80) @@ -758,6 +759,7 @@ buhid tagbanwa limbu + balinese symbol braille yi diff --git a/lisp/language/indonesian.el b/lisp/language/indonesian.el new file mode 100644 index 0000000000..9a86135d89 --- /dev/null +++ b/lisp/language/indonesian.el @@ -0,0 +1,64 @@ +;;; indonesian.el --- Indonesian languages support -*- coding: utf-8; lexical-binding: t; -*- + +;; Copyright (C) 2022 Free Software Foundation, Inc. + +;; Author: समीर सिंह Sameer Singh +;; Keywords: multilingual, input method, i18n, Indonesia + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;; This file contains definitions of Indonesia language environments, and +;; setups for displaying the scripts used there. + +;;; Code: + +(set-language-info-alist + "Balinese" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "balinese") + (sample-text . "Balinese (ᬅᬓ᭄ᬱᬭᬩᬮᬶ) ᬒᬁᬲ᭄ᬯᬲ᭄ᬢ᭄ᬬᬲ᭄ᬢᬸ") + (documentation . "\ +Balinese language and its script are supported in this language environment."))) + + +;; Balinese composition rules +(let ((consonant "[\x1B13-\x1B33\x1B45-\x1B4B]") + (independent-vowel "[\x1B05-\x1B12]") + (rerekan "\x1B34") + (vowel "[\x1B35-\x1B43]") + (modifier-above "[\x1B00-\x1B04]") + (adeg-adeg "\x1B44") + (musical-symbol "[\x1B6B-\x1B73]")) + (set-char-table-range composition-function-table + '(#x1B34 . #x1B44) + (list (vector + ;; Consonant based syllables + (concat consonant rerekan "?" "\\(?:" adeg-adeg consonant + rerekan "?\\)*\\(?:" adeg-adeg "\\|" vowel "*" rerekan + "?" modifier-above "?" musical-symbol "?\\)") + 1 'font-shape-gstring) + (vector + ;; Vowels based syllables + (concat independent-vowel rerekan "?" adeg-adeg "?" + vowel "?" modifier-above "?" musical-symbol "?") + 1 'font-shape-gstring)))) + + +(provide 'indonesian) +;;; indonesian.el ends here diff --git a/lisp/leim/quail/indonesian.el b/lisp/leim/quail/indonesian.el new file mode 100644 index 0000000000..46dafc89f5 --- /dev/null +++ b/lisp/leim/quail/indonesian.el @@ -0,0 +1,177 @@ +;;; indonesian.el --- Quail package for inputting Indonesian characters -*- lexical-binding: t; -*- + +;; Copyright (C) 2022 Free Software Foundation, Inc. + +;; Author: समीर सिंह Sameer Singh +;; Keywords: multilingual, input method, i18n, Indonesia + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;; Input methods for Indonesian languages. + +;;; Code: + +(require 'quail) + +;; This input method supports languages like Buginese, Balinese, Sundanese and +;; Javanese. + +(quail-define-package + "balinese" "Balinese" "ᬅ" t "Balinese 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" ?ᬝ) + ("Q" ?ᬞ) + ("`q" ?᭚) + ("`Q" ?᭽) + ("w" ?ᬟ) + ("W" ?ᬠ) + ("`w" ?᭛) + ("`W" ?᭾) + ("e" ?ᬾ) + ("E" ?ᬿ) + ("`e" ?ᬏ) + ("`E" ?ᬐ) + ("r" ?ᬭ) + ("R" ?ᬃ) + ("`r" ?ᬺ) + ("`R" ?ᬋ) + ("t" ?ᬢ) + ("T" ?ᬣ) + ("`t" ?᭜) + ("`T" ?᭝) + ("y" ?ᬬ) + ("Y" ?ᭂ) + ("`y" ?ᭃ) + ("`Y" ?᭴) + ("u" ?ᬸ) + ("U" ?ᬹ) + ("`u" ?ᬉ) + ("`U" ?ᬊ) + ("i" ?ᬶ) + ("I" ?ᬷ) + ("`i" ?ᬇ) + ("`I" ?ᬈ) + ("o" ?ᭀ) + ("O" ?ᭁ) + ("`o" ?ᬑ) + ("`O" ?ᬒ) + ("p" ?ᬧ) + ("P" ?ᬨ) + ("`p" ?ᭈ) + ("`P" ?᭠) + ("a" ?ᬵ) + ("A" ?ᬆ) + ("`a" ?ᬅ) + ("`A" ?᭵) + ("s" ?ᬲ) + ("S" ?ᬰ) + ("`s" ?᭡) + ("`S" ?᭢) + ("d" ?ᬤ) + ("D" ?ᬥ) + ("`d" ?᭣) + ("`D" ?᭤) + ("f" ?᭄) + ("F" ?ᬻ) + ("`f" ?ᬌ) + ("`F" ?᭶) + ("g" ?ᬕ) + ("G" ?ᬖ) + ("`g" ?᭥) + ("`G" ?᭦) + ("h" ?ᬳ) + ("H" ?ᬄ) + ("`h" ?᭧) + ("`H" ?᭨) + ("j" ?ᬚ) + ("J" ?ᬛ) + ("`j" ?ᭌ) + ("`J" ?᭩) + ("k" ?ᬓ) + ("K" ?ᬔ) + ("`k" ?ᭅ) + ("`K" ?ᭆ) + ("l" ?ᬮ) + ("L" ?ᬼ) + ("`l" ?ᬍ) + ("`L" ?᭪) + ("z" ?ᭊ) + ("Z" ?ᬽ) + ("`z" ?ᬎ) + ("`Z" ?᭷) + ("x" ?ᬱ) + ("X" ?᬴) + ("`x" ?᭸) + ("c" ?ᬘ) + ("C" ?ᬙ) + ("`c" #x200C) ; ZWNJ + ("v" ?ᬯ) + ("V" ?ᭉ) + ("`v" ?᭹) + ("`V" ?᭺) + ("b" ?ᬩ) + ("B" ?ᬪ) + ("`b" ?᭻) + ("n" ?ᬦ) + ("N" ?ᬡ) + ("`n" ?ᬗ) + ("`N" ?ᬜ) + ("m" ?ᬫ) + ("M" ?ᬂ) + ("`m" ?ᬁ) + ("`M" ?ᬀ)) + +(provide 'indonesian) +;;; indonesian.el ends here diff --git a/lisp/loadup.el b/lisp/loadup.el index 9f1da4c0f9..aa15a3bbe8 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -246,6 +246,7 @@ (load "language/burmese") (load "language/cham") (load "language/philippine") +(load "language/indonesian") (load "indent") (let ((max-specpdl-size (max max-specpdl-size 1800))) commit e05acb07d337dc35ad6b0c6cffe8e391db447a0c Author: Mattias Engdegård Date: Thu May 26 17:19:45 2022 +0200 Faster and less recursive byte-compile--first-symbol-with-pos * lisp/emacs-lisp/bytecomp.el (byte-compile--first-symbol-with-pos) (byte-compile--warning-source-offset): Remove recursion for cdr-traversal of lists, and optimise (bug#55414). diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 87798288fb..d7140ad9e6 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1181,39 +1181,34 @@ message buffer `default-directory'." (if (< (length f2) (length f1)) f2 f1))) (defun byte-compile--first-symbol-with-pos (form) - "Return the \"first\" symbol with position found in form, or 0 if none. -Here, \"first\" is by a depth first search." - (let (sym) - (cond - ((symbol-with-pos-p form) form) - ((consp form) - (or (and (symbol-with-pos-p (setq sym (byte-compile--first-symbol-with-pos (car form)))) - sym) - (and (symbolp (setq sym (byte-compile--first-symbol-with-pos (cdr form)))) - sym) - 0)) - ((and (or (vectorp form) (recordp form)) - (> (length form) 0)) - (let ((i 0) - (len (length form)) - elt) - (catch 'sym - (while (< i len) - (when (symbol-with-pos-p - (setq elt (byte-compile--first-symbol-with-pos (aref form i)))) - (throw 'sym elt)) - (setq i (1+ i))) - 0))) - (t 0)))) + "Return the first symbol with position in form, or nil if none. +Order is by depth-first search." + (cond + ((symbol-with-pos-p form) form) + ((consp form) + (or (byte-compile--first-symbol-with-pos (car form)) + (let ((sym nil)) + (setq form (cdr form)) + (while (and (consp form) + (not (setq sym (byte-compile--first-symbol-with-pos + (car form))))) + (setq form (cdr form))) + (or sym + (and form (byte-compile--first-symbol-with-pos form)))))) + ((vectorp form) + (let ((len (length form)) + (i 0) + (sym nil)) + (while (and (< i len) + (not (setq sym (byte-compile--first-symbol-with-pos + (aref form i))))) + (setq i (1+ i))) + sym)))) (defun byte-compile--warning-source-offset () - "Return a source offset from `byte-compile-form-stack'. -Return nil if such is not found." - (catch 'offset - (dolist (form byte-compile-form-stack) - (let ((s (byte-compile--first-symbol-with-pos form))) - (if (symbol-with-pos-p s) - (throw 'offset (symbol-with-pos-pos s))))))) + "Return a source offset from `byte-compile-form-stack' or nil if none." + (let ((sym (byte-compile--first-symbol-with-pos byte-compile-form-stack))) + (and sym (symbol-with-pos-pos sym)))) ;; This is used as warning-prefix for the compiler. ;; It is always called with the warnings buffer current. commit e490b80a105b82870e5571eaa3cfa5bc3ad936b0 Author: Po Lu Date: Thu May 26 21:00:17 2022 +0800 Handle alternate actions for Motif drop targets * src/xterm.c (xm_side_effect_from_action): Handle `XdndActionAsk'. (xm_operations_from_actions): New function. (xm_send_top_level_leave_message, x_dnd_cleanup_drag_and_drop) (x_dnd_update_state, handle_one_xevent, x_connection_closed): Use those actions when building a side effect. (x_dnd_begin_drag_and_drop): Keep track of the set of alternative drag-and-drop actions. diff --git a/src/xterm.c b/src/xterm.c index 9826f2fbd8..d949439d18 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1119,6 +1119,14 @@ static Atom x_dnd_action; in `x_dnd_action' upon completion of a drop. */ static Atom x_dnd_wanted_action; +/* The set of optional actions available to a Motif drop target + computed at the start of the drag-and-drop operation. */ +static uint8_t x_dnd_motif_operations; + +/* The preferred optional action out of that set. Only takes effect + if `x_dnd_action' is XdndAsk. */ +static uint8_t x_dnd_first_motif_operation; + /* Array of selection targets available to the drop target. */ static Atom *x_dnd_targets = NULL; @@ -1405,10 +1413,34 @@ xm_side_effect_from_action (struct x_display_info *dpyinfo, Atom action) return XM_DRAG_MOVE; else if (action == dpyinfo->Xatom_XdndActionLink) return XM_DRAG_LINK; + else if (action == dpyinfo->Xatom_XdndActionAsk) + return x_dnd_first_motif_operation; return XM_DRAG_NOOP; } +static uint8_t +xm_operations_from_actions (struct x_display_info *dpyinfo, + Atom *ask_actions, int n_ask_actions) +{ + int i; + uint8_t flags; + + flags = 0; + + for (i = 0; i < n_ask_actions; ++i) + { + if (ask_actions[i] == dpyinfo->Xatom_XdndActionCopy) + flags |= XM_DRAG_COPY; + else if (ask_actions[i] == dpyinfo->Xatom_XdndActionMove) + flags |= XM_DRAG_MOVE; + else if (ask_actions[i] == dpyinfo->Xatom_XdndActionLink) + flags |= XM_DRAG_LINK; + } + + return flags; +} + static int xm_read_targets_table_header (uint8_t *bytes, ptrdiff_t length, xm_targets_table_header *header_return, @@ -2038,7 +2070,7 @@ xm_send_top_level_leave_message (struct x_display_info *dpyinfo, Window source, mmsg.byteorder = XM_BYTE_ORDER_CUR_FIRST; mmsg.side_effects = XM_DRAG_SIDE_EFFECT (xm_side_effect_from_action (dpyinfo, x_dnd_wanted_action), - XM_DROP_SITE_NONE, XM_DRAG_NOOP, + XM_DROP_SITE_NONE, x_dnd_motif_operations, XM_DROP_ACTION_DROP_CANCEL); mmsg.timestamp = dmsg->timestamp; mmsg.x = 65535; @@ -3904,9 +3936,7 @@ x_dnd_cleanup_drag_and_drop (void *frame) dmsg.side_effects = XM_DRAG_SIDE_EFFECT (xm_side_effect_from_action (FRAME_DISPLAY_INFO (f), x_dnd_wanted_action), - XM_DROP_SITE_VALID, - xm_side_effect_from_action (FRAME_DISPLAY_INFO (f), - x_dnd_wanted_action), + XM_DROP_SITE_VALID, x_dnd_motif_operations, XM_DROP_ACTION_DROP_CANCEL); dmsg.x = 0; dmsg.y = 0; @@ -10361,8 +10391,21 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, else x_dnd_selection_timestamp = XFIXNUM (ltimestamp); + x_dnd_motif_operations + = xm_side_effect_from_action (FRAME_DISPLAY_INFO (f), xaction); + + x_dnd_first_motif_operation = XM_DRAG_NOOP; + if (n_ask_actions) { + x_dnd_motif_operations + = xm_operations_from_actions (FRAME_DISPLAY_INFO (f), + ask_action_list, + n_ask_actions); + x_dnd_first_motif_operation + = xm_side_effect_from_action (FRAME_DISPLAY_INFO (f), + ask_action_list[0]); + ask_actions = NULL; end = 0; count = SPECPDL_INDEX (); @@ -10609,9 +10652,7 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, dmsg.side_effects = XM_DRAG_SIDE_EFFECT (xm_side_effect_from_action (FRAME_DISPLAY_INFO (f), x_dnd_wanted_action), - XM_DROP_SITE_VALID, - xm_side_effect_from_action (FRAME_DISPLAY_INFO (f), - x_dnd_wanted_action), + XM_DROP_SITE_VALID, x_dnd_motif_operations, XM_DROP_ACTION_DROP_CANCEL); dmsg.x = 0; dmsg.y = 0; @@ -10683,9 +10724,7 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, dmsg.side_effects = XM_DRAG_SIDE_EFFECT (xm_side_effect_from_action (FRAME_DISPLAY_INFO (f), x_dnd_wanted_action), - XM_DROP_SITE_VALID, - xm_side_effect_from_action (FRAME_DISPLAY_INFO (f), - x_dnd_wanted_action), + XM_DROP_SITE_VALID, x_dnd_motif_operations, XM_DROP_ACTION_DROP_CANCEL); dmsg.x = 0; dmsg.y = 0; @@ -14643,9 +14682,7 @@ x_dnd_update_state (struct x_display_info *dpyinfo, Time timestamp) dmsg.side_effects = XM_DRAG_SIDE_EFFECT (xm_side_effect_from_action (dpyinfo, x_dnd_wanted_action), - XM_DROP_SITE_VALID, - xm_side_effect_from_action (dpyinfo, - x_dnd_wanted_action), + XM_DROP_SITE_VALID, x_dnd_motif_operations, (!x_dnd_xm_use_help ? XM_DROP_ACTION_DROP : XM_DROP_ACTION_DROP_HELP)); @@ -14677,9 +14714,7 @@ x_dnd_update_state (struct x_display_info *dpyinfo, Time timestamp) dsmsg.side_effects = XM_DRAG_SIDE_EFFECT (xm_side_effect_from_action (dpyinfo, x_dnd_wanted_action), - XM_DROP_SITE_VALID, - xm_side_effect_from_action (dpyinfo, - x_dnd_wanted_action), + XM_DROP_SITE_VALID, x_dnd_motif_operations, XM_DROP_ACTION_DROP_CANCEL); dsmsg.x = 0; dsmsg.y = 0; @@ -16579,7 +16614,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, dmsg.byteorder = XM_BYTE_ORDER_CUR_FIRST; dmsg.side_effects = XM_DRAG_SIDE_EFFECT (xm_side_effect_from_action (dpyinfo, x_dnd_wanted_action), - XM_DROP_SITE_NONE, XM_DRAG_NOOP, + XM_DROP_SITE_NONE, x_dnd_motif_operations, XM_DROP_ACTION_DROP_CANCEL); dmsg.timestamp = event->xmotion.time; dmsg.x = event->xmotion.x_root; @@ -16648,9 +16683,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, dmsg.byteorder = XM_BYTE_ORDER_CUR_FIRST; dmsg.side_effects = XM_DRAG_SIDE_EFFECT (xm_side_effect_from_action (dpyinfo, x_dnd_wanted_action), - XM_DROP_SITE_VALID, - xm_side_effect_from_action (dpyinfo, - x_dnd_wanted_action), + XM_DROP_SITE_VALID, x_dnd_motif_operations, (!x_dnd_xm_use_help ? XM_DROP_ACTION_DROP : XM_DROP_ACTION_DROP_HELP)); @@ -17182,9 +17215,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, dmsg.side_effects = XM_DRAG_SIDE_EFFECT (xm_side_effect_from_action (dpyinfo, x_dnd_wanted_action), - XM_DROP_SITE_VALID, - xm_side_effect_from_action (dpyinfo, - x_dnd_wanted_action), + XM_DROP_SITE_VALID, x_dnd_motif_operations, (!x_dnd_xm_use_help ? XM_DROP_ACTION_DROP : XM_DROP_ACTION_DROP_HELP)); @@ -18204,7 +18235,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, dmsg.side_effects = XM_DRAG_SIDE_EFFECT (xm_side_effect_from_action (dpyinfo, x_dnd_wanted_action), - XM_DROP_SITE_NONE, XM_DRAG_NOOP, + XM_DROP_SITE_NONE, x_dnd_motif_operations, XM_DROP_ACTION_DROP_CANCEL); dmsg.timestamp = xev->time; dmsg.x = lrint (xev->root_x); @@ -18287,9 +18318,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, dmsg.side_effects = XM_DRAG_SIDE_EFFECT (xm_side_effect_from_action (dpyinfo, x_dnd_wanted_action), - XM_DROP_SITE_VALID, - xm_side_effect_from_action (dpyinfo, - x_dnd_wanted_action), + XM_DROP_SITE_VALID, x_dnd_motif_operations, (!x_dnd_xm_use_help ? XM_DROP_ACTION_DROP : XM_DROP_ACTION_DROP_HELP)); @@ -18480,9 +18509,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, dmsg.side_effects = XM_DRAG_SIDE_EFFECT (xm_side_effect_from_action (dpyinfo, x_dnd_wanted_action), - XM_DROP_SITE_VALID, - xm_side_effect_from_action (dpyinfo, - x_dnd_wanted_action), + XM_DROP_SITE_VALID, x_dnd_motif_operations, (!x_dnd_xm_use_help ? XM_DROP_ACTION_DROP : XM_DROP_ACTION_DROP_HELP)); @@ -21311,9 +21338,7 @@ x_connection_closed (Display *dpy, const char *error_message, bool ioerror) dmsg.side_effects = XM_DRAG_SIDE_EFFECT (xm_side_effect_from_action (FRAME_DISPLAY_INFO (f), x_dnd_wanted_action), - XM_DROP_SITE_VALID, - xm_side_effect_from_action (FRAME_DISPLAY_INFO (f), - x_dnd_wanted_action), + XM_DROP_SITE_VALID, x_dnd_motif_operations, XM_DROP_ACTION_DROP_CANCEL); dmsg.x = 0; dmsg.y = 0; commit ef6059cb8325dfa2467bb83b2fd2b2d376e360c2 Author: Lars Ingebrigtsen Date: Thu May 26 14:47:16 2022 +0200 Make comp--native-compile delete the temp file it creates * lisp/emacs-lisp/comp.el (comp--native-compile): Delete the temporary files we create (bug#55611). diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index ff4abf3ef1..1d870dcae8 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -4039,48 +4039,59 @@ the deferred compilation mechanism." (comp-ctxt (make-comp-ctxt :output output :with-late-load with-late-load))) (comp-log "\n \n" 1) - (condition-case err - (cl-loop - with report = nil - for t0 = (current-time) - for pass in comp-passes - unless (memq pass comp-disabled-passes) - do - (comp-log (format "(%s) Running pass %s:\n" - function-or-file pass) - 2) - (setf data (funcall pass data)) - (push (cons pass (float-time (time-since t0))) report) - (cl-loop for f in (alist-get pass comp-post-pass-hooks) - do (funcall f data)) - finally - (when comp-log-time-report - (comp-log (format "Done compiling %s" data) 0) - (cl-loop for (pass . time) in (reverse report) - do (comp-log (format "Pass %s took: %fs." pass time) 0)))) - (native-compiler-skip) - (t - (let ((err-val (cdr err))) - ;; If we are doing an async native compilation print the - ;; error in the correct format so is parsable and abort. - (if (and comp-async-compilation - (not (eq (car err) 'native-compiler-error))) - (progn - (message (if err-val - "%s: Error: %s %s" - "%s: Error %s") - function-or-file - (get (car err) 'error-message) - (car-safe err-val)) - (kill-emacs -1)) - ;; Otherwise re-signal it adding the compilation input. - (signal (car err) (if (consp err-val) - (cons function-or-file err-val) - (list function-or-file err-val))))))) - (if (stringp function-or-file) - data - ;; So we return the compiled function. - (native-elisp-load data))))) + (unwind-protect + (progn + (condition-case err + (cl-loop + with report = nil + for t0 = (current-time) + for pass in comp-passes + unless (memq pass comp-disabled-passes) + do + (comp-log (format "(%s) Running pass %s:\n" + function-or-file pass) + 2) + (setf data (funcall pass data)) + (push (cons pass (float-time (time-since t0))) report) + (cl-loop for f in (alist-get pass comp-post-pass-hooks) + do (funcall f data)) + finally + (when comp-log-time-report + (comp-log (format "Done compiling %s" data) 0) + (cl-loop for (pass . time) in (reverse report) + do (comp-log (format "Pass %s took: %fs." + pass time) 0)))) + (native-compiler-skip) + (t + (let ((err-val (cdr err))) + ;; If we are doing an async native compilation print the + ;; error in the correct format so is parsable and abort. + (if (and comp-async-compilation + (not (eq (car err) 'native-compiler-error))) + (progn + (message (if err-val + "%s: Error: %s %s" + "%s: Error %s") + function-or-file + (get (car err) 'error-message) + (car-safe err-val)) + (kill-emacs -1)) + ;; Otherwise re-signal it adding the compilation input. + (signal (car err) (if (consp err-val) + (cons function-or-file err-val) + (list function-or-file err-val))))))) + (if (stringp function-or-file) + data + ;; So we return the compiled function. + (native-elisp-load data))) + ;; We may have created a temporary file when we're being + ;; called with something other than a file as the argument. + ;; Delete it. + (when (and (not (stringp function-or-file)) + comp-ctxt + (comp-ctxt-output comp-ctxt) + (file-exists-p (comp-ctxt-output comp-ctxt))) + (delete-file (comp-ctxt-output comp-ctxt))))))) (defun native-compile-async-skip-p (file load selector) "Return non-nil if FILE's compilation should be skipped. commit 06c79dcfcbc634325b688385be95cd5ed049e208 Author: Lars Ingebrigtsen Date: Thu May 26 13:04:50 2022 +0200 Make memory-report not bug out with symbols with positions * lisp/emacs-lisp/memory-report.el (memory-report--object-size-1): Don't bug out when there are symbols with positions. diff --git a/lisp/emacs-lisp/memory-report.el b/lisp/emacs-lisp/memory-report.el index 6cb4cb02e0..56b1ea6ed4 100644 --- a/lisp/emacs-lisp/memory-report.el +++ b/lisp/emacs-lisp/memory-report.el @@ -183,6 +183,10 @@ by counted more than once." (cl-defgeneric memory-report--object-size-1 (_counted _value) 0) +;; This shouldn't happen, but there's some leakage. +(cl-defmethod memory-report--object-size-1 (_ (_value symbol-with-pos)) + (memory-report--size 'symbol)) + (cl-defmethod memory-report--object-size-1 (_ (value symbol)) ;; Don't count global symbols -- makes sizes of lists of symbols too ;; heavy. commit 47e0b866110b25343daf025de85d5f22ed829cc1 Author: Štěpán Němec Date: Thu May 26 10:58:22 2022 +0200 ; Fix up doc of recent elisp-eldoc-var-docstring-with-value addition diff --git a/etc/NEWS b/etc/NEWS index 0f59d545e3..4ebaf6e07a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1873,6 +1873,8 @@ functions. --- ** New eldoc function: 'elisp-eldoc-var-docstring-with-value'. +This function includes the current value of the variable in eldoc display +and can be used as a more detailed alternative to 'elisp-eldoc-var-docstring'. ** 'save-some-buffers' can now be extended to save other things. Traditionally, 'save-some-buffers' saved buffers, and also saved diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 84b7938bf0..77bf3f1ed1 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -1775,7 +1775,8 @@ Also see `elisp-eldoc-var-docstring-with-value'." (defun elisp-eldoc-var-docstring-with-value (callback &rest _) "Document variable at point. Intended for `eldoc-documentation-functions' (which see). -Also see `elisp-eldoc-var-docstring-with-value'." +Compared to `elisp-eldoc-var-docstring', this also includes the +current variable value and a bigger chunk of the docstring." (when-let ((cs (elisp--current-symbol))) (when (and (boundp cs) ;; nil and t are boundp! commit a9f17ccce336ad5d384a6271f205a84141980019 Author: Štěpán Němec Date: Fri May 28 11:38:59 2021 +0200 ; Fix some doc typos and minor language issues diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index 29902c1d97..6897ef525a 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi @@ -1908,7 +1908,7 @@ The command @kbd{M-x display-line-numbers-mode} provides a convenient way to turn on display of line numbers. This mode has a globalized variant, @code{global-display-line-numbers-mode}. The user option @code{display-line-numbers-type} controls which sub-mode of -line-number display, described above, will these modes activate. +line-number display, described above, these modes will activate. @noindent Note that line numbers are not displayed in the minibuffer and in the diff --git a/etc/tutorials/TUTORIAL.it b/etc/tutorials/TUTORIAL.it index 32fe710562..c908e36e05 100644 --- a/etc/tutorials/TUTORIAL.it +++ b/etc/tutorials/TUTORIAL.it @@ -1110,7 +1110,7 @@ mentre fai riferimento al testo di aiuto e poi usare un C-x 1. Ecco altre utili opzioni di C-h: - C-h x Descrive un comando. Inserisci il nome della comando. + C-h x Descrive un comando. Inserisci il nome del comando. >> Prova con C-h x previous-line . Questo mostrerà tutte le informazioni che Emacs possiede sulla diff --git a/lisp/emacs-lisp/ert-x.el b/lisp/emacs-lisp/ert-x.el index 17967ae2bf..12534c7c4c 100644 --- a/lisp/emacs-lisp/ert-x.el +++ b/lisp/emacs-lisp/ert-x.el @@ -96,7 +96,7 @@ ERT--THUNK with that buffer as current." To be used in ERT tests. If BODY finishes successfully, the test buffer is killed; if there is an error, the test buffer is kept -around on error for further inspection. Its name is derived from +around for further inspection. Its name is derived from the name of the test and the result of NAME-FORM." (declare (debug ((":name" form) def-body)) (indent 1)) diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el index 9fe41f6786..8646998deb 100644 --- a/lisp/gnus/mm-uu.el +++ b/lisp/gnus/mm-uu.el @@ -214,7 +214,7 @@ This can be either \"inline\" or \"attachment\".") "$" ,#'mm-uu-org-src-code-block-extract)) "A list of specifications for non-MIME attachments. -Each element consist of a `mm-uu-entry'. +Each element consists of a `mm-uu-entry'. The functions in the last 3 slots of this type can make use of the following dynamically-scoped variables: `file-name', `start-point', and `end-point'. diff --git a/lisp/mail/footnote.el b/lisp/mail/footnote.el index 638382dbab..626fc1982d 100644 --- a/lisp/mail/footnote.el +++ b/lisp/mail/footnote.el @@ -41,11 +41,11 @@ ;; + The key sequence 'C-c ! a C-y C-c ! b' should auto-fill the ;; footnote in adaptive fill mode. This does not seem to be a bug in ;; `adaptive-fill' because it behaves that way on all point movements -;; + Handle footmode mode elegantly in all modes, even if that means refuses to +;; + Handle footnote mode elegantly in all modes, even if that means refusing to ;; accept the burden. For example, in a programming language mode, footnotes ;; should be commented. -;; + Manually autofilling the a first footnote should not cause it to -;; wrap into the footnote section tag +;; + Manually autofilling the first footnote should not cause it to +;; wrap into the footnote section tag. ;; + Current solution adds a second newline after the section tag, so it is ;; clearly a separate paragraph. There may be stylistic objections to this. ;; + Footnotes with multiple paragraphs should not have their first diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 03313033dd..966357c097 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1412,7 +1412,7 @@ If FORCE is non-nil and no process found, create one." (pop-to-buffer (process-buffer (sh-shell-process t)))) (defun sh-send-text (text) - "Send the text to the `sh-shell-process'." + "Send TEXT to `sh-shell-process'." (comint-send-string (sh-shell-process t) (concat text "\n"))) (defun sh-cd-here () diff --git a/lisp/textmodes/dns-mode.el b/lisp/textmodes/dns-mode.el index dc26a3c1b7..d4acbe24eb 100644 --- a/lisp/textmodes/dns-mode.el +++ b/lisp/textmodes/dns-mode.el @@ -165,7 +165,7 @@ manually with \\[dns-mode-soa-increment-serial]." ;;;###autoload (define-derived-mode dns-mode text-mode "DNS" "Major mode for viewing and editing DNS master files. -This mode is inherited from text mode. It add syntax +This mode is derived from text mode. It adds syntax highlighting, and some commands for handling DNS master files. Its keymap inherits from `text-mode' and it has the same variables for customizing indentation. It has its own abbrev commit 036b72575a073d43552fd75a435c6388afe95348 Author: Po Lu Date: Thu May 26 14:37:27 2022 +0800 Fix the `x_trace_wire' option * src/xterm.c (x_trace_wire): (x_term_init): Fix debugging code for modern C and Xlib. diff --git a/src/xterm.c b/src/xterm.c index cde98b43b4..9826f2fbd8 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -21236,9 +21236,12 @@ x_fully_uncatch_errors (void) #if false static unsigned int x_wire_count; -x_trace_wire (void) + +static int +x_trace_wire (Display *dpy) { - fprintf (stderr, "Lib call: %d\n", ++x_wire_count); + fprintf (stderr, "Lib call: %u\n", ++x_wire_count); + return 0; } #endif @@ -24488,7 +24491,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) terminal->name = xlispstrdup (display_name); #if false - XSetAfterFunction (x_current_display, x_trace_wire); + XSetAfterFunction (dpyinfo->display, x_trace_wire); #endif Lisp_Object system_name = Fsystem_name (); commit c67c7ab53c0fe4ff03c722c9bac44fcea6ad0699 Author: Po Lu Date: Thu May 26 14:27:32 2022 +0800 Use x_get_atom_name for some more things * src/xterm.c (x_dnd_send_unsupported_drop, x_dnd_send_drop): Use x_get_atom_name instead of XGetAtomName. diff --git a/src/xterm.c b/src/xterm.c index d518ce331a..cde98b43b4 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -3244,13 +3244,13 @@ x_dnd_send_unsupported_drop (struct x_display_info *dpyinfo, Window target_windo XFree (atom_names[i - 1]); } - name = XGetAtomName (dpyinfo->display, - x_dnd_wanted_action); + name = x_get_atom_name (dpyinfo, x_dnd_wanted_action, + false); if (name) { arg = intern (name); - XFree (name); + xfree (name); } else arg = Qnil; @@ -3810,12 +3810,12 @@ x_dnd_send_drop (struct frame *f, Window target, Time timestamp, lval = Qnil; atom_names = alloca (x_dnd_n_targets * sizeof *atom_names); - name = XGetAtomName (dpyinfo->display, x_dnd_wanted_action); + name = x_get_atom_name (dpyinfo, x_dnd_wanted_action, false); if (!XGetAtomNames (dpyinfo->display, x_dnd_targets, x_dnd_n_targets, atom_names)) { - XFree (name); + xfree (name); return false; } @@ -3833,7 +3833,7 @@ x_dnd_send_drop (struct frame *f, Window target, Time timestamp, XSETINT (ie.x, win_x); XSETINT (ie.y, win_y); - XFree (name); + xfree (name); kbd_buffer_store_event (&ie); return false; commit 79d0b1a14c19c7bfcf2af694ec333cc6ac8b054b Author: Po Lu Date: Thu May 26 10:40:54 2022 +0800 * src/xselect.c (Fx_register_dnd_atom): Use x_intern_cached_atom. diff --git a/src/xselect.c b/src/xselect.c index 6cb279f9e8..ae15fecccc 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -2496,13 +2496,13 @@ FRAME is on. If FRAME is nil, the selected frame is used. */) ptrdiff_t i; struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); - if (SYMBOLP (atom)) x_atom = symbol_to_x_atom (dpyinfo, atom); else if (STRINGP (atom)) { block_input (); - x_atom = XInternAtom (FRAME_X_DISPLAY (f), SSDATA (atom), False); + x_atom = x_intern_cached_atom (dpyinfo, SSDATA (atom), + false); unblock_input (); } else commit 974a7e541cc28613cbeed9e0195d945d614d97f4 Author: Po Lu Date: Thu May 26 10:22:24 2022 +0800 Make X error checking more asynchronous This makes some operations (such as x-get-atom-name and x-change-window-property) up to 2600x faster by avoiding calls to XSync when setting up an error handler, and when checking for or uncatching errors if all requests were already processed. * src/xterm.c (X_COMPARE_SERIALS): New macro. (struct x_error_message_stack): Add new field `first_request'. (x_find_error_handler): New function. (x_error_catcher): New parameter `stack'. Use it instead. (x_catch_errors_with_handler): Keep a record of the next protocol request serial inside the stack entry. (x_uncatch_errors, x_check_errors, x_had_errors_p, x_clear_errors) (x_error_handler): Avoid XSync if all requests were processed by the X server and look for the error handler matching the display and request serial when processing errors. diff --git a/src/xterm.c b/src/xterm.c index 1d91055a4a..d518ce331a 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -784,6 +784,11 @@ static int current_finish; static struct input_event *current_hold_quit; #endif +/* Compare two request serials A and B with OP, handling + wraparound. */ +#define X_COMPARE_SERIALS(a, op ,b) \ + (((long) (a) - (long) (b)) op 0) + struct x_atom_ref { /* Atom name. */ @@ -21011,52 +21016,78 @@ x_text_icon (struct frame *f, const char *icon_name) #define X_ERROR_MESSAGE_SIZE 200 -/* If non-nil, this should be a string. - It means catch X errors and store the error message in this string. +/* If non-nil, this should be a string. It means catch X errors and + store the error message in this string. The reason we use a stack is that x_catch_error/x_uncatch_error can - be called from a signal handler. -*/ + be called from a signal handler. */ -struct x_error_message_stack { +struct x_error_message_stack +{ char string[X_ERROR_MESSAGE_SIZE]; Display *dpy; x_special_error_handler handler; void *handler_data; struct x_error_message_stack *prev; + + /* The first request that this error handler applies to. Keeping + track of this allows us to avoid an XSync yet still have errors + for previously made requests be handled correctly. */ + unsigned long first_request; }; + static struct x_error_message_stack *x_error_message; +static struct x_error_message_stack * +x_find_error_handler (Display *dpy, XErrorEvent *event) +{ + struct x_error_message_stack *stack; + + stack = x_error_message; + + while (stack) + { + if (X_COMPARE_SERIALS (event->serial, >=, + stack->first_request) + && dpy == stack->dpy) + return stack; + + stack = stack->prev; + } + + return NULL; +} + /* An X error handler which stores the error message in *x_error_message. This is called from x_error_handler if x_catch_errors is in effect. */ static void -x_error_catcher (Display *display, XErrorEvent *event) +x_error_catcher (Display *display, XErrorEvent *event, + struct x_error_message_stack *stack) { XGetErrorText (display, event->error_code, - x_error_message->string, - X_ERROR_MESSAGE_SIZE); - if (x_error_message->handler) - x_error_message->handler (display, event, x_error_message->string, - x_error_message->handler_data); + stack->string, X_ERROR_MESSAGE_SIZE); + + if (stack->handler) + stack->handler (display, event, stack->string, + stack->handler_data); } -/* Begin trapping X errors for display DPY. Actually we trap X errors - for all displays, but DPY should be the display you are actually - operating on. +/* Begin trapping X errors for display DPY. - After calling this function, X protocol errors no longer cause - Emacs to exit; instead, they are recorded in the string - stored in *x_error_message. + After calling this function, X protocol errors generated on DPY no + longer cause Emacs to exit; instead, they are recorded in the + string stored in *x_error_message. Calling x_check_errors signals an Emacs error if an X error has occurred since the last call to x_catch_errors or x_check_errors. - Calling x_uncatch_errors resumes the normal error handling. - Calling x_uncatch_errors_after_check is similar, but skips an XSync - to the server, and should be used only immediately after - x_had_errors_p or x_check_errors. */ + Calling x_uncatch_errors resumes the normal error handling, + skipping an XSync if the last request made is known to have been + processed. Calling x_uncatch_errors_after_check is similar, but + skips an XSync to the server, and should be used only immediately + after x_had_errors_p or x_check_errors. */ void x_catch_errors_with_handler (Display *dpy, x_special_error_handler handler, @@ -21064,14 +21095,12 @@ x_catch_errors_with_handler (Display *dpy, x_special_error_handler handler, { struct x_error_message_stack *data = xmalloc (sizeof *data); - /* Make sure any errors from previous requests have been dealt with. */ - XSync (dpy, False); - data->dpy = dpy; data->string[0] = 0; data->handler = handler; data->handler_data = handler_data; data->prev = x_error_message; + data->first_request = NextRequest (dpy); x_error_message = data; } @@ -21100,8 +21129,7 @@ x_uncatch_errors_after_check (void) unblock_input (); } -/* Undo the last x_catch_errors call. - DPY should be the display that was passed to x_catch_errors. */ +/* Undo the last x_catch_errors call. */ void x_uncatch_errors (void) @@ -21119,7 +21147,11 @@ x_uncatch_errors (void) /* The display may have been closed before this function is called. Check if it is still open before calling XSync. */ - if (x_display_info_for_display (x_error_message->dpy) != 0) + if (x_display_info_for_display (x_error_message->dpy) != 0 + /* 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)) XSync (x_error_message->dpy, False); tmp = x_error_message; @@ -21135,13 +21167,23 @@ x_uncatch_errors (void) void x_check_errors (Display *dpy, const char *format) { - /* Make sure to catch any errors incurred so far. */ - XSync (dpy, False); + char string[X_ERROR_MESSAGE_SIZE]; + + /* This shouldn't happen, since x_check_errors should be called + immediately inside an x_catch_errors block. */ + if (dpy != x_error_message->dpy) + emacs_abort (); + + /* There is no point in making this extra sync if all requests + are known to have been fully processed. */ + if (LastKnownRequestProcessed (dpy) + != NextRequest (dpy) - 1) + XSync (dpy, False); if (x_error_message->string[0]) { - char string[X_ERROR_MESSAGE_SIZE]; - memcpy (string, x_error_message->string, X_ERROR_MESSAGE_SIZE); + memcpy (string, x_error_message->string, + X_ERROR_MESSAGE_SIZE); x_uncatch_errors (); error (format, string); } @@ -21153,8 +21195,15 @@ x_check_errors (Display *dpy, const char *format) bool x_had_errors_p (Display *dpy) { + /* This shouldn't happen, since x_check_errors should be called + immediately inside an x_catch_errors block. */ + if (dpy != x_error_message->dpy) + emacs_abort (); + /* Make sure to catch any errors incurred so far. */ - XSync (dpy, False); + if (LastKnownRequestProcessed (dpy) + != NextRequest (dpy) - 1) + XSync (dpy, False); return x_error_message->string[0] != 0; } @@ -21164,6 +21213,11 @@ x_had_errors_p (Display *dpy) void x_clear_errors (Display *dpy) { + /* This shouldn't happen, since x_check_errors should be called + immediately inside an x_catch_errors block. */ + if (dpy != x_error_message->dpy) + emacs_abort (); + x_error_message->string[0] = 0; } @@ -21386,6 +21440,7 @@ static void x_error_quitter (Display *, XErrorEvent *); static int x_error_handler (Display *display, XErrorEvent *event) { + struct x_error_message_stack *stack; #ifdef HAVE_XINPUT2 struct x_display_info *dpyinfo; #endif @@ -21416,8 +21471,10 @@ x_error_handler (Display *display, XErrorEvent *event) return 0; #endif - if (x_error_message) - x_error_catcher (display, event); + stack = x_find_error_handler (display, event); + + if (stack) + x_error_catcher (display, event, stack); else x_error_quitter (display, event); return 0; commit c7e4c1a5fa3ecbcb29cba6f01016808f1a524eaf Author: Po Lu Date: Thu May 26 08:13:17 2022 +0800 Improve x_get_atom_name for some predefined atoms * src/xterm.c (x_get_atom_name): Handle XSETTINGS and cm atoms. diff --git a/src/xterm.c b/src/xterm.c index 1997cc77dc..1d91055a4a 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -23674,19 +23674,21 @@ x_intern_cached_atom (struct x_display_info *dpyinfo, return XInternAtom (dpyinfo->display, name, False); } -/* Whether or not a request to the X server happened is placed in - NEED_SYNC. */ +/* Get the name of ATOM, but try not to make a request to the X + server. Whether or not a request to the X server happened is + placed in NEED_SYNC. */ char * x_get_atom_name (struct x_display_info *dpyinfo, Atom atom, bool *need_sync) { - char *dpyinfo_pointer, *name, *value; + char *dpyinfo_pointer, *name, *value, *buffer; int i; Atom ref_atom; dpyinfo_pointer = (char *) dpyinfo; value = NULL; *need_sync = false; + buffer = alloca (45 + INT_STRLEN_BOUND (int)); switch (atom) { @@ -23709,6 +23711,20 @@ x_get_atom_name (struct x_display_info *dpyinfo, Atom atom, return xstrdup ("WINDOW"); default: + if (atom == dpyinfo->Xatom_xsettings_sel) + { + sprintf (buffer, "_XSETTINGS_S%d", + XScreenNumberOfScreen (dpyinfo->screen)); + return xstrdup (buffer); + } + + if (atom == dpyinfo->Xatom_NET_WM_CM_Sn) + { + sprintf (buffer, "_NET_WM_CM_S%d", + XScreenNumberOfScreen (dpyinfo->screen)); + return xstrdup (buffer); + } + for (i = 0; i < ARRAYELTS (x_atom_refs); ++i) { ref_atom = *(Atom *) (dpyinfo_pointer commit 9ab7d98bc6e9fa11951e4500036cafdbea538aff Author: Po Lu Date: Thu May 26 08:11:36 2022 +0800 Fix 32-bit warnings again * src/print.c (struct print_stack_entry): Make u.list.tortoise_idx intmax_t. diff --git a/src/print.c b/src/print.c index 9968c2aef8..a82461653f 100644 --- a/src/print.c +++ b/src/print.c @@ -2040,7 +2040,7 @@ struct print_stack_entry Lisp_Object tortoise; /* slow pointer */ ptrdiff_t n; /* tortoise step countdown */ ptrdiff_t m; /* tortoise step period */ - ptrdiff_t tortoise_idx; /* index of tortoise */ + intmax_t tortoise_idx; /* index of tortoise */ } list; struct commit 20cf35cbdee24540a1dfd99d93039a4051161dcd Author: Eli Zaretskii Date: Wed May 25 21:40:22 2022 +0300 ; Fix documentation of recent additions of Indian scripts * lisp/language/indian.el ("Kannada", "Tirhuta", "Sharada") ("Siddham", "Syloti Nagri", "Modi", "Limbu"): Fix grammar of doc string. (Bug#55621) diff --git a/lisp/language/indian.el b/lisp/language/indian.el index 5082a97f34..4dfad75275 100644 --- a/lisp/language/indian.el +++ b/lisp/language/indian.el @@ -132,7 +132,7 @@ South Indian Language Telugu is supported in this language environment.")) (input-method . "kannada-itrans") (sample-text . "Kannada (ಕನ್ನಡ) ನಮಸ್ಕಾರ") (documentation . "\ -Kannada language and script is supported in this language +Kannada language and script are supported in this language environment.")) '("Indian")) @@ -174,7 +174,7 @@ which used the Kaithi script are supported in this language environment.")) (input-method . "tirhuta") (sample-text . "Tirhuta (𑒞𑒱𑒩𑒯𑒳𑒞𑒰) 𑒣𑓂𑒩𑒢𑒰𑒧 / 𑒮𑒲𑒞𑒰𑒩𑒰𑒧") (documentation . "\ -Maithili language and its script Tirhuta is supported in this +Maithili language and its script Tirhuta are supported in this language environment.")) '("Indian")) @@ -185,7 +185,7 @@ language environment.")) (input-method . "sharada") (sample-text . "Sharada (𑆯𑆳𑆫𑆢𑆳) 𑆤𑆩𑆱𑇀𑆑𑆳𑆫") (documentation . "\ -Kashmiri language and its script Sharada is supported in this +Kashmiri language and its script Sharada are supported in this language environment.")) '("Indian")) @@ -196,7 +196,7 @@ language environment.")) (input-method . "siddham") (sample-text . "Siddham (𑖭𑖰𑖟𑖿𑖠𑖽) 𑖡𑖦𑖭𑖿𑖝𑖸") (documentation . "\ -Sanskrit language and one of its script Siddham is supported +Sanskrit language and one of its script Siddham are supported in this language environment.")) '("Indian")) @@ -207,7 +207,7 @@ in this language environment.")) (input-method . "syloti-nagri") (sample-text . "Syloti Nagri (ꠍꠤꠟꠐꠤ ꠘꠣꠉꠞꠤ) ꠀꠌ꠆ꠍꠣꠟꠣꠝꠥ ꠀꠟꠣꠁꠇꠥꠝ / ꠘꠝꠡ꠆ꠇꠣꠞ") (documentation . "\ -Sylheti language and its script Syloti Nagri is supported +Sylheti language and its script Syloti Nagri are supported in this language environment.")) '("Indian")) @@ -218,7 +218,7 @@ in this language environment.")) (input-method . "modi") (sample-text . "Modi (𑘦𑘻𑘚𑘲) 𑘡𑘦𑘭𑘿𑘎𑘰𑘨") (documentation . "\ -Marathi language and one of its script Modi is supported +Marathi language and one of its script Modi are supported in this language environment.")) '("Indian")) @@ -229,7 +229,7 @@ in this language environment.")) (input-method . "limbu") (sample-text . "Limbu (ᤕᤠᤰᤌᤢᤱ ᤐᤠᤴ) ᤛᤣᤘᤠᤖᤥ") (documentation . "\ -Limbu language and its script is supported in this +Limbu language and its script are supported in this language environment.")) '("Indian")) commit 8d5eff3d8452681d5e801a4c5b2936b0a4ae8da3 Author: समीर सिंह Sameer Singh Date: Wed May 25 07:42:29 2022 +0530 Add support for the Limbu script (bug#55621) * lisp/language/indian.el ("Limbu"): New language environment. Add composition rules for Limbu. Add sample text and input method. * lisp/international/fontset.el (script-representative-chars) (setup-default-fontset): Support Limbu. * lisp/leim/quail/indian.el ("limbu"): New input method. * etc/HELLO: Add a Limbu greeting. * etc/NEWS: Announce the new language environment and its input method. diff --git a/etc/HELLO b/etc/HELLO index a9653a4164..31f753c73a 100644 --- a/etc/HELLO +++ b/etc/HELLO @@ -70,6 +70,7 @@ Kannada (ಕನ್ನಡ) ನಮಸ್ಕಾರ Khmer (ភាសាខ្មែរ) ជំរាបសួរ Lakota (Lakȟotiyapi) Taŋyáŋ yahí! Lao (ພາສາລາວ) ສະບາຍດີ / ຂໍໃຫ້ໂຊກດີ +Limbu (ᤕᤰᤌᤢᤱ ᤐᤠᤴ) ᤛᤣᤘᤠᤖᤥ Malayalam (മലയാളം) നമസ്കാരം Maldivian (ދިވެހި) އައްސަލާމު ޢަލައިކުމް / ކިހިނެހް؟ Maltese (il-Malti) Bonġu / Saħħa diff --git a/etc/NEWS b/etc/NEWS index 92ebe22016..0f59d545e3 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -822,6 +822,7 @@ corresponding language environments are: **** Hanunoo script and language environment **** Buhid script and language environment **** Tagbanwa script and language environment +**** Limbu 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 5967648f36..42fbedae1d 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -188,6 +188,7 @@ (tagbanwa #x1760) (khmer #x1780) (mongolian #x1826) + (limbu #x1901 #x1920 #x1936) (tai-le #x1950) (tai-lue #x1980) (tai-tham #x1A20 #x1A55 #x1A61 #x1A80) @@ -756,6 +757,7 @@ hanunoo buhid tagbanwa + limbu symbol braille yi diff --git a/lisp/language/indian.el b/lisp/language/indian.el index a5563a3ff7..5082a97f34 100644 --- a/lisp/language/indian.el +++ b/lisp/language/indian.el @@ -222,6 +222,17 @@ Marathi language and one of its script Modi is supported in this language environment.")) '("Indian")) +(set-language-info-alist + "Limbu" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "limbu") + (sample-text . "Limbu (ᤕᤠᤰᤌᤢᤱ ᤐᤠᤴ) ᤛᤣᤘᤠᤖᤥ") + (documentation . "\ +Limbu language and its script is supported in this +language environment.")) + '("Indian")) + ;; Replace mnemonic characters in REGEXP according to TABLE. TABLE is ;; an alist of (MNEMONIC-STRING . REPLACEMENT-STRING). @@ -670,5 +681,20 @@ in this language environment.")) nasal "?" visarga "?") 1 'font-shape-gstring)))) +;; Limbu composition rules +(let ((consonant "[\x1900-\x191E]") + (vowel "[\x1920-\x1928]") + (subjoined-letter "[\x1929-\x192B]") + (small-letter "[\x1930-\x1938]") + (other-signs "[\x1939\x193A]") + (sa-i "\x193B")) + (set-char-table-range composition-function-table + '(#x1920 . #x193B) + (list (vector + ;; Consonant based syllables + (concat consonant sa-i "?" subjoined-letter "?" small-letter + "?" vowel "?" other-signs "?") + 1 'font-shape-gstring)))) + (provide 'indian) ;;; indian.el ends here diff --git a/lisp/leim/quail/indian.el b/lisp/leim/quail/indian.el index b76cf9a80d..031c30aabb 100644 --- a/lisp/leim/quail/indian.el +++ b/lisp/leim/quail/indian.el @@ -1565,4 +1565,95 @@ Full key sequences are listed below:") ("`M" ?ଽ) ) +(quail-define-package + "limbu" "Limbu" "ᤕ" t "Limbu 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" ?ᤧ) +("Q" ?ᤨ) +("`q" ?᥀) +("w" ?ᤘ) +("W" ?ᤫ) +("e" ?ᤣ) +("E" ?ᤤ) +("r" ?ᤖ) +("R" ?ᤷ) +("`r" ?ᤪ) +("t" ?ᤋ) +("T" ?ᤌ) +("`t" ?ᤳ) +("`T" ?ᤞ) +("y" ?ᤕ) +("Y" ?ᤩ) +("u" ?ᤢ) +("i" ?ᤡ) +("o" ?ᤥ) +("O" ?ᤦ) +("p" ?ᤐ) +("P" ?ᤑ) +("`p" ?ᤵ) +("a" ?ᤠ) +("A" ?ᤀ) +("s" ?ᤛ) +("S" ?ᤙ) +("d" ?ᤍ) +("D" ?ᤎ) +("f" ?᤻) +("g" ?ᤃ) +("G" ?ᤄ) +("`g" ?ᤝ) +("h" ?ᤜ) +("j" ?ᤈ) +("J" ?ᤉ) +("k" ?ᤁ) +("K" ?ᤂ) +("`k" ?ᤰ) +("l" ?ᤗ) +("L" ?ᤸ) +("z" ?ᤊ) +("Z" ?ᤅ) +("x" ?ᤚ) +("X" ?᤹) +("c" ?ᤆ) +("C" ?ᤇ) +("`c" #x200C) ; ZWNJ +("v" ?᤺) +("b" ?ᤒ) +("B" ?ᤓ) +("n" ?ᤏ) +("N" ?ᤴ) +("m" ?ᤔ) +("M" ?ᤱ) +("`m" ?ᤲ) +("`?" ?᥅) +) + ;;; indian.el ends here commit e2567521601507ec70d42080ac06f24c9384b081 Merge: 4cfdd6947c 03d6644970 Author: Eli Zaretskii Date: Wed May 25 14:08:01 2022 -0400 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs commit 4cfdd6947c30e989ef7f669968dd06fe4b6597d7 Author: Eli Zaretskii Date: Wed May 25 14:05:09 2022 -0400 ; * etc/NEWS.28: Fix merge of NEWS.28. diff --git a/etc/NEWS.28 b/etc/NEWS.28 index 995de8d317..2efa881b2f 100644 --- a/etc/NEWS.28 +++ b/etc/NEWS.28 @@ -15,6 +15,50 @@ in older Emacs versions. You can narrow news to a specific version by calling 'view-emacs-news' with a prefix argument or by typing 'C-u C-h C-n'. + +* Installation Changes in Emacs 28.2 + + +* Startup Changes in Emacs 28.2 + + +* Changes in Emacs 28.2 + +This is a bug-fix release with no new features. + + +* Editing Changes in Emacs 28.2 + + +* Changes in Specialized Modes and Packages in Emacs 28.2 + +** The command 'kdb-macro-redisplay' was renamed to 'kmacro-redisplay'. +This is to fix an embarrassing typo in the original name. + +** 'desktop-save-mode' now saves the desktop in 'save-buffers-kill-emacs'. +Previously, the desktop was saved in 'kill-emacs' via +'kill-emacs-hook'. However, that violated the convention that +functions in 'kill-emacs-hook' cannot interact with the user, and in +particular didn't play well with ending daemon sessions of Emacs. So +we moved the saving of the desktop to 'save-buffers-kill-emacs', via +'kill-emacs-query-functions'. To make sure the desktop is saved, +terminate Emacs with 'save-buffers-kill-emacs', not with 'kill-emacs'. + +(This change was done in Emacs 28.1, but we didn't announce it in NEWS +back then.) + + +* New Modes and Packages in Emacs 28.2 + + +* Incompatible Lisp Changes in Emacs 28.2 + + +* Lisp Changes in Emacs 28.2 + + +* Changes in Emacs 28.2 on Non-Free Operating Systems + * Installation Changes in Emacs 28.1 commit 97bb31be9f4e06060f2d192b049c3cdb47aca2f5 Merge: 9661c82920 86b49d5865 Author: Eli Zaretskii Date: Wed May 25 13:57:59 2022 -0400 Merge from origin/emacs-28 86b49d5865 ; * etc/NEWS: Announce changes in 'desktop-kill'. (Bug#55... d5ccf2621a ; Fix last change f1c1fd7184 Improve documentation of mail-user-agent. b05d1e9b98 ; * lisp/desktop.el: Update the commentary. (Bug#55560) 139bfa1a08 More fixes in abbrev.el doc strings d80dea6036 Add note about Tramp completion to completion-styles doc s... 9e7c0cf57d Remove mention of removed nnimap-nov-is-evil variable 90aae0bca2 Improve documentation strings and prompts in abbrev.el dfa3e6f424 Restore the Fselect_window call in gui_consider_frame_title. de35e9728f Advise against settings in the MS-Windows system registry 3ffa3d3403 ; Minor addition to make-tarball.txt 7dc026f9ea Fix kmacro-keymap binding after previous change 4f0fd54bc4 Add glossary entries for "interactively" af1c05a3c4 Fix the name of a kmacro command. # Conflicts: # etc/NEWS # lisp/abbrev.el commit 03d6644970e6b9b505ef35ed96c379cc73f25486 Author: Juri Linkov Date: Wed May 25 20:45:49 2022 +0300 * lisp/subr.el (insert-for-yank): Add nil to run-hook-wrapped to keep looping. diff --git a/lisp/subr.el b/lisp/subr.el index 0b415d8b2c..8afba2b341 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4084,7 +4084,7 @@ This function is like `insert', except it honors the variables It also runs the string through `yank-transform-functions'." ;; Allow altering the yank string. (run-hook-wrapped 'yank-transform-functions - (lambda (f) (setq string (funcall f string)))) + (lambda (f) (setq string (funcall f string)) nil)) (let (to) (while (setq to (next-single-property-change 0 'yank-handler string)) (insert-for-yank-1 (substring string 0 to)) commit 9661c82920cf2b75300266bbd9da9e45b9471173 Author: Po Lu Date: Wed May 25 20:29:38 2022 +0800 Lower the roundtrip overhead of x-get-atom-name by 50% for common atoms * src/xselect.c (Fx_get_atom_name): * src/xterm.c (x_dnd_begin_drag_and_drop): Use that instead. Don't sync to handle errors if using `x_get_atom_name' resulted in no protocol request being made. (x_get_atom_name): New function. * src/xterm.h: Update prototypes. diff --git a/src/xselect.c b/src/xselect.c index 3acfcbe94b..6cb279f9e8 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -2458,21 +2458,25 @@ If the value is 0 or the atom is not known, return the empty string. */) char empty[] = ""; Lisp_Object ret = Qnil; Display *dpy = FRAME_X_DISPLAY (f); + struct x_display_info *dpyinfo; Atom atom; - bool had_errors_p; + bool had_errors_p, need_sync; + + dpyinfo = FRAME_DISPLAY_INFO (f); CONS_TO_INTEGER (value, Atom, atom); block_input (); x_catch_errors (dpy); - name = atom ? XGetAtomName (dpy, atom) : empty; - had_errors_p = x_had_errors_p (dpy); + name = (atom ? x_get_atom_name (dpyinfo, atom, + &need_sync) : empty); + had_errors_p = need_sync && x_had_errors_p (dpy); x_uncatch_errors_after_check (); if (!had_errors_p) ret = build_string (name); - if (atom && name) XFree (name); + if (atom && name) xfree (name); if (NILP (ret)) ret = empty_unibyte_string; unblock_input (); diff --git a/src/xterm.c b/src/xterm.c index 3ca0c15897..1997cc77dc 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10238,7 +10238,7 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, XTextProperty prop; xm_drop_start_message dmsg; Lisp_Object frame_object, x, y, frame, local_value; - bool signals_were_pending; + bool signals_were_pending, need_sync; #ifdef HAVE_XKB XkbStateRec keyboard_state; #endif @@ -10800,14 +10800,20 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, { block_input (); x_catch_errors (FRAME_X_DISPLAY (f)); - atom_name = XGetAtomName (FRAME_X_DISPLAY (f), - x_dnd_action); - x_uncatch_errors (); + atom_name = x_get_atom_name (FRAME_DISPLAY_INFO (f), + x_dnd_action, &need_sync); + + if (need_sync) + x_uncatch_errors (); + else + /* No protocol request actually happened, so avoid the extra + sync by calling x_uncatch_errors_after_check instead. */ + x_uncatch_errors_after_check (); if (atom_name) { action = intern (atom_name); - XFree (atom_name); + xfree (atom_name); } else action = Qnil; @@ -23599,8 +23605,10 @@ x_destroy_window (struct frame *f) } /* Intern NAME in DPYINFO, but check to see if the atom was already - interned, and use that instead. If PREDEFINED_ONLY, return None if - the atom was not already interned at connection setup. */ + interned when the X connection was opened, and use that instead. + + If PREDEFINED_ONLY, return None if the atom was not interned during + connection setup or is predefined. */ Atom x_intern_cached_atom (struct x_display_info *dpyinfo, const char *name, bool predefined_only) @@ -23666,6 +23674,65 @@ x_intern_cached_atom (struct x_display_info *dpyinfo, return XInternAtom (dpyinfo->display, name, False); } +/* Whether or not a request to the X server happened is placed in + NEED_SYNC. */ +char * +x_get_atom_name (struct x_display_info *dpyinfo, Atom atom, + bool *need_sync) +{ + char *dpyinfo_pointer, *name, *value; + int i; + Atom ref_atom; + + dpyinfo_pointer = (char *) dpyinfo; + value = NULL; + *need_sync = false; + + switch (atom) + { + case XA_PRIMARY: + return xstrdup ("PRIMARY"); + + case XA_SECONDARY: + return xstrdup ("SECONDARY"); + + case XA_INTEGER: + return xstrdup ("INTEGER"); + + case XA_ATOM: + return xstrdup ("ATOM"); + + case XA_CARDINAL: + return xstrdup ("CARDINAL"); + + case XA_WINDOW: + return xstrdup ("WINDOW"); + + default: + for (i = 0; i < ARRAYELTS (x_atom_refs); ++i) + { + ref_atom = *(Atom *) (dpyinfo_pointer + + x_atom_refs[i].offset); + + if (atom == ref_atom) + return xstrdup (x_atom_refs[i].name); + } + + name = XGetAtomName (dpyinfo->display, atom); + *need_sync = true; + + if (name) + { + value = xstrdup (name); + XFree (name); + } + + break; + } + + return value; +} + /* Setting window manager hints. */ diff --git a/src/xterm.h b/src/xterm.h index fba775d96b..daeb1a4575 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -1538,6 +1538,7 @@ extern void x_set_pending_dnd_time (Time); extern void x_own_selection (Lisp_Object, Lisp_Object, Lisp_Object); extern Atom x_intern_cached_atom (struct x_display_info *, const char *, bool); +extern char *x_get_atom_name (struct x_display_info *, Atom, bool *); #ifdef USE_GTK extern bool xg_set_icon (struct frame *, Lisp_Object); commit ce79fe451d845c09e5502071f9af9845eb930885 Author: Lars Ingebrigtsen Date: Wed May 25 14:23:56 2022 +0200 Make yank-transform-functions into defvar * doc/lispref/text.texi (Yanking): Adjust. * lisp/simple.el (yank-transform-functions): Make into defvar because it's not that useful as a user option. diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 4439bc4865..622f03d2a8 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -1111,7 +1111,7 @@ or specifying key bindings. It takes effect after @code{yank-handled-properties}. @end defopt -@defopt yank-transform-functions +@defvar yank-transform-functions This variable is a list of functions. Each function is called (in order) with the string to be yanked as the argument, and should return a (possibly transformed) string. This variable can be set @@ -1127,7 +1127,7 @@ could say something like: '(string-clean-whitespace))) (call-interactively #'yank))) @end lisp -@end defopt +@end defvar @node Yank Commands @subsection Functions for Yanking diff --git a/etc/NEWS b/etc/NEWS index 857f300384..92ebe22016 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2268,8 +2268,8 @@ This command lets you examine all data in the current selection and the clipboard, and insert it into the buffer. +++ -** New user option 'yank-transform-functions'. -This function allows the user to alter the string to be inserted. +** New variable 'yank-transform-functions'. +This variable allows the user to alter the string to be inserted. --- ** New command 'yank-in-context'. diff --git a/lisp/simple.el b/lisp/simple.el index 3318ac4731..4fd6ea009d 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5946,17 +5946,14 @@ See also `yank-handled-properties'." :group 'killing :version "24.3") -(defcustom yank-transform-functions nil +(defvar yank-transform-functions nil "Hook run on strings to be yanked. Each function in this list will be called (in order) with the string to be yanked as the sole argument, and should return the (possibly) transformed string. The functions will be called with the destination buffer as the current -buffer, and with point at the place where the string is to be inserted." - :type 'hook - :version "29.1" - :group 'killing) +buffer, and with point at the place where the string is to be inserted.") (defvar yank-window-start nil) (defvar yank-undo-function nil commit 0a79e28891ec7394547358207a8213a7c457a592 Author: Jim Porter Date: Tue May 24 18:56:50 2022 -0700 Reset 'eshell-in-pipeline-p' when interpolating commands * lisp/eshell/esh-cmd.el (eshell-subcommand-bindings) (eshell-command-to-value): Set 'eshell-in-pipeline-p' to nil. * test/lisp/eshell/eshell-tests.el (eshell-test/subcommand-reset-in-pipeline) (eshell-test/lisp-reset-in-pipeline): New tests (bug#55620). diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index 73c250632c..775e4c1057 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el @@ -256,6 +256,7 @@ the command." (defcustom eshell-subcommand-bindings '((eshell-in-subcommand-p t) + (eshell-in-pipeline-p nil) (default-directory default-directory) (process-environment (eshell-copy-environment))) "A list of `let' bindings for subcommand environments." @@ -907,7 +908,8 @@ This avoids the need to use `let*'." (defmacro eshell-command-to-value (object) "Run OBJECT synchronously, returning its result as a string. Returns a string comprising the output from the command." - `(let ((value (make-symbol "eshell-temp"))) + `(let ((value (make-symbol "eshell-temp")) + (eshell-in-pipeline-p nil)) (eshell-do-command-to-value ,object))) ;;;_* Iterative evaluation diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index c0affed80a..ab5d73d479 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -130,6 +130,35 @@ e.g. \"{(+ 1 2)} 3\" => 3" (eshell-command-result-p "echo ${*echo hi | *cat} | *cat" "hi"))) +(ert-deftest eshell-test/subcommand-reset-in-pipeline () + "Check that subcommands reset `eshell-in-pipeline-p'." + (skip-unless (executable-find "cat")) + (dolist (template '("echo {%s} | *cat" + "echo ${%s} | *cat" + "*cat $<%s> | *cat")) + (should (equal (eshell-test-command-result + (format template "echo $eshell-in-pipeline-p")) + nil)) + (should (equal (eshell-test-command-result + (format template "echo | echo $eshell-in-pipeline-p")) + "last")) + (should (equal (eshell-test-command-result + (format template "echo $eshell-in-pipeline-p | echo")) + "first")) + (should (equal (eshell-test-command-result + (format template + "echo | echo $eshell-in-pipeline-p | echo")) + "t")))) + +(ert-deftest eshell-test/lisp-reset-in-pipeline () + "Check that interpolated Lisp forms reset `eshell-in-pipeline-p'." + (skip-unless (executable-find "cat")) + (dolist (template '("echo (%s) | *cat" + "echo $(%s) | *cat")) + (should (equal (eshell-test-command-result + (format template "format \"%s\" eshell-in-pipeline-p")) + "nil")))) + (ert-deftest eshell-test/redirect-buffer () "Check that piping to a buffer works" (with-temp-buffer commit b93c22e67dc856cfc15e488774ebff1f5d151e42 Author: Paul W. Rankin Date: Tue May 24 18:19:57 2022 -0400 Change variable which-func-unknown to "n/a" * lisp/progmodes/which-func.el (which-func-unknown): Change string displayed in mode-line from "???" to "n/a"; the former appears to indicate an error whereas the latter is more indicative that the current function is not known. diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el index abe25f2c63..3c8d4f43db 100644 --- a/lisp/progmodes/which-func.el +++ b/lisp/progmodes/which-func.el @@ -64,7 +64,7 @@ ;; Variables for customization ;; --------------------------- ;; -(defvar which-func-unknown "???" +(defvar which-func-unknown "n/a" "String to display in the mode line when current function is unknown.") (defgroup which-func nil commit 25439cb8ed179e79903434161f64a17e5011e81b Author: Po Lu Date: Wed May 25 18:21:33 2022 +0800 Add more predefined atoms for the benefit of DND code * src/xterm.c (x_intern_cached_atom): Handle `CARDINAL' and `WINDOW' as well. diff --git a/src/xterm.c b/src/xterm.c index ae2f4528af..3ca0c15897 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -23629,15 +23629,25 @@ x_intern_cached_atom (struct x_display_info *dpyinfo, /* Now do some common predefined atoms. */ if (!strcmp (name, "PRIMARY")) return XA_PRIMARY; + if (!strcmp (name, "SECONDARY")) return XA_SECONDARY; + if (!strcmp (name, "STRING")) return XA_STRING; + if (!strcmp (name, "INTEGER")) return XA_INTEGER; + if (!strcmp (name, "ATOM")) return XA_ATOM; + if (!strcmp (name, "CARDINAL")) + return XA_CARDINAL; + + if (!strcmp (name, "WINDOW")) + return XA_WINDOW; + for (i = 0; i < ARRAYELTS (x_atom_refs); ++i) { ptr = (char *) dpyinfo; commit f437ddf2e9d8b0e6e04d639343c717a0096f1090 Author: Stefan Kangas Date: Wed May 25 09:43:27 2022 +0200 Prefer defvar-keymap in url/*.el * lisp/url/url-cookie.el (url-cookie-mode-map): * lisp/url/url-dired.el (url-dired-minor-mode-map): Prefer defvar-keymap. diff --git a/lisp/url/url-cookie.el b/lisp/url/url-cookie.el index 6b9ce5da93..42e1fa22fa 100644 --- a/lisp/url/url-cookie.el +++ b/lisp/url/url-cookie.el @@ -494,12 +494,10 @@ Use \\\\[url-cookie-delete] to remove cookies." (url-cookie--generate-buffer) (goto-char point)))) -(defvar url-cookie-mode-map - (let ((map (make-sparse-keymap))) - (define-key map [delete] 'url-cookie-delete) - (define-key map [(control k)] 'url-cookie-delete) - (define-key map [(control _)] 'url-cookie-undo) - map)) +(defvar-keymap url-cookie-mode-map + "" #'url-cookie-delete + "C-k" #'url-cookie-delete + "C-_" #'url-cookie-undo) (define-derived-mode url-cookie-mode special-mode "URL Cookie" "Mode for listing cookies. diff --git a/lisp/url/url-dired.el b/lisp/url/url-dired.el index 1bbd741c1a..e2c23a8b6d 100644 --- a/lisp/url/url-dired.el +++ b/lisp/url/url-dired.el @@ -25,12 +25,10 @@ (autoload 'dired-get-filename "dired") -(defvar url-dired-minor-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "\C-m" 'url-dired-find-file) - (define-key map [mouse-2] 'url-dired-find-file-mouse) - map) - "Keymap used when browsing directories.") +(defvar-keymap url-dired-minor-mode-map + :doc "Keymap used when browsing directories." + "C-m" #'url-dired-find-file + "" #'url-dired-find-file-mouse) (defun url-dired-find-file () "In dired, visit the file or directory named on this line." commit 7749ec6aaa678caa126b5027c93bee1736924939 Author: Stefan Kangas Date: Fri May 20 21:11:48 2022 +0200 Remove some ancient Emacs compat code * lisp/url/url-util.el (url-percentage): Remove Emacs 19 compat code. * lisp/erc/erc-backend.el (erc-server-coding-system): * lisp/gnus/mm-util.el (mm-iso-8859-x-to-15-table): Remove Emacs 19 compat code; coding-system-p is fboundp. * lisp/progmodes/cfengine.el (cfengine-fill-paragraph): Remove Emacs 21 compat code. diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 4c13f4c419..1252a5b4fa 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -315,8 +315,7 @@ This will only be consulted if the coding system in :version "24.1" :type '(repeat coding-system)) -(defcustom erc-server-coding-system (if (and (fboundp 'coding-system-p) - (coding-system-p 'undecided) +(defcustom erc-server-coding-system (if (and (coding-system-p 'undecided) (coding-system-p 'utf-8)) '(utf-8 . undecided) nil) diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el index 31cf92e617..727e3abfff 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el @@ -315,8 +315,7 @@ Valid elements include: "ISO-8859-15 exchangeable coding systems and inconvertible characters.") (defvar mm-iso-8859-x-to-15-table - (and (fboundp 'coding-system-p) - (mm-coding-system-p 'iso-8859-15) + (and (mm-coding-system-p 'iso-8859-15) (mapcar (lambda (cs) (if (mm-coding-system-p (car cs)) diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el index 6fc898d95b..00348ac0bb 100644 --- a/lisp/progmodes/cfengine.el +++ b/lisp/progmodes/cfengine.el @@ -989,13 +989,7 @@ Intended as the value of `indent-line-function'." (defun cfengine-fill-paragraph (&optional justify) "Fill `paragraphs' in Cfengine code." (interactive "P") - (or (if (fboundp 'fill-comment-paragraph) - (fill-comment-paragraph justify) - ;; else do nothing in a comment - (nth 4 (parse-partial-sexp (save-excursion - (beginning-of-defun) - (point)) - (point)))) + (or (fill-comment-paragraph justify) (let ((paragraph-start ;; Include start of parenthesized block. "\f\\|[ \t]*$\\|.*(") diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el index b8b7980e40..fc84d45176 100644 --- a/lisp/url/url-util.el +++ b/lisp/url/url-util.el @@ -1,7 +1,6 @@ ;;; url-util.el --- Miscellaneous helper routines for URL library -*- lexical-binding: t -*- -;; Copyright (C) 1996-1999, 2001, 2004-2022 Free Software Foundation, -;; Inc. +;; Copyright (C) 1996-2022 Free Software Foundation, Inc. ;; Author: Bill Perry ;; Maintainer: emacs-devel@gnu.org @@ -217,9 +216,7 @@ Will not do anything if `url-show-status' is nil." ;;;###autoload (defun url-percentage (x y) - (if (fboundp 'float) - (round (* 100 (/ x (float y)))) - (/ (* x 100) y))) + (round (* 100 (/ x (float y))))) ;;;###autoload (defalias 'url-basepath 'url-file-directory) commit 86b49d58652a8f59a3489bf15b367ec224e17ae7 Author: Eli Zaretskii Date: Mon May 23 14:58:13 2022 +0300 ; * etc/NEWS: Announce changes in 'desktop-kill'. (Bug#55574) diff --git a/etc/NEWS b/etc/NEWS index a8b5cd08ba..770c96b07b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -35,6 +35,18 @@ This is a bug-fix release with no new features. ** The command 'kdb-macro-redisplay' was renamed to 'kmacro-redisplay'. This is to fix an embarrassing typo in the original name. +** 'desktop-save-mode' now saves the desktop in 'save-buffers-kill-emacs'. +Previously, the desktop was saved in 'kill-emacs' via +'kill-emacs-hook'. However, that violated the convention that +functions in 'kill-emacs-hook' cannot interact with the user, and in +particular didn't play well with ending daemon sessions of Emacs. So +we moved the saving of the desktop to 'save-buffers-kill-emacs', via +'kill-emacs-query-functions'. To make sure the desktop is saved, +terminate Emacs with 'save-buffers-kill-emacs', not with 'kill-emacs'. + +(This change was done in Emacs 28.1, but we didn't announce it in NEWS +back then.) + * New Modes and Packages in Emacs 28.2 commit d5ccf2621aa11130d4cf47efc2b8bcde6f6f8be1 Author: Eli Zaretskii Date: Sun May 22 11:17:23 2022 +0300 ; Fix last change * doc/emacs/sending.texi (Mail Methods): Fix indexing and markup. (Bug#55569) diff --git a/doc/emacs/sending.texi b/doc/emacs/sending.texi index acdae8a263..cc54224200 100644 --- a/doc/emacs/sending.texi +++ b/doc/emacs/sending.texi @@ -659,6 +659,7 @@ such as MIME support. Another available mode is MH-E (@pxref{Top,,MH-E,mh-e, The Emacs Interface to MH}). @vindex mail-user-agent +@findex define-mail-user-agent You can choose any of these @dfn{mail user agents} as your preferred method for editing and sending mail. The commands @kbd{C-x m}, @kbd{C-x 4 m} and @kbd{C-x 5 m} use whichever agent you have @@ -669,7 +670,8 @@ values include @code{message-user-agent} (Message mode) @code{sendmail-user-agent} (Mail mode), @code{gnus-user-agent}, and @code{mh-e-user-agent}. Additional options may be available; check in the manual of your mail user agent package for details. You may -also define another mail user agent using `define-mail-user-agent'. +also define another mail user agent using +@code{define-mail-user-agent}. If you select a different mail-composition method, the information in this chapter about the mail buffer and Message mode does not apply; commit f1c1fd718478823b760020ed136345d94f379801 Author: Damien Cassou Date: Sun May 22 08:09:38 2022 +0200 Improve documentation of mail-user-agent. * doc/emacs/sending.texi (Mail Methods): * lisp/simple.el (mail-user-agent): Mention additional options of non-bundled MUA. (Bug#5569) diff --git a/doc/emacs/sending.texi b/doc/emacs/sending.texi index ea87e0a77b..acdae8a263 100644 --- a/doc/emacs/sending.texi +++ b/doc/emacs/sending.texi @@ -667,7 +667,9 @@ the bug reporter (@pxref{Bugs}). To specify a mail user agent, customize the variable @code{mail-user-agent}. Currently, legitimate values include @code{message-user-agent} (Message mode) @code{sendmail-user-agent} (Mail mode), @code{gnus-user-agent}, and -@code{mh-e-user-agent}. +@code{mh-e-user-agent}. Additional options may be available; check +in the manual of your mail user agent package for details. You may +also define another mail user agent using `define-mail-user-agent'. If you select a different mail-composition method, the information in this chapter about the mail buffer and Message mode does not apply; diff --git a/lisp/simple.el b/lisp/simple.el index b9cb957064..d235eb9745 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -8735,9 +8735,10 @@ Valid values include: paraphernalia if Gnus is running, particularly the Gcc: header for archiving. -Additional valid symbols may be available; check with the author of -your package for details. The function should return non-nil if it -succeeds. +Additional valid symbols may be available; check in the manual of +your mail user agent package for details. You may also define +your own symbol to be used as value for this variable using +`define-mail-user-agent'. See also `read-mail-command' concerning reading mail." :type '(radio (function-item :tag "Message package" commit b05d1e9b98673796acaf7defcf7581c1780e996f Author: Eli Zaretskii Date: Sun May 22 08:28:16 2022 +0300 ; * lisp/desktop.el: Update the commentary. (Bug#55560) diff --git a/lisp/desktop.el b/lisp/desktop.el index 51c56faebb..041dbcf7c1 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -44,10 +44,11 @@ ;; (info "(emacs)Saving Emacs Sessions") in the GNU Emacs Manual. ;; When the desktop module is loaded, the function `desktop-kill' is -;; added to the `kill-emacs-hook'. This function is responsible for -;; saving the desktop when Emacs is killed. Furthermore an anonymous -;; function is added to the `after-init-hook'. This function is -;; responsible for loading the desktop when Emacs is started. +;; added to the `kill-emacs-query-functions'. This function is +;; responsible for saving the desktop and deleting the desktop lock +;; file when Emacs is killed. In addition, an anonymous function is +;; added to the `after-init-hook'. This function is responsible for +;; loading the desktop when Emacs is started. ;; Special handling. ;; ----------------- commit 139bfa1a0884dbd2600fc1bd11d11f41d3f9ef94 Author: Eli Zaretskii Date: Sat May 21 21:04:40 2022 +0300 More fixes in abbrev.el doc strings * lisp/abbrev.el (inverse-add-global-abbrev, inverse-add-mode-abbrev): Document the effect of negative ARG. (Bug#55527) diff --git a/lisp/abbrev.el b/lisp/abbrev.el index fd8cb754d1..b7216f5d63 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -349,7 +349,7 @@ Don't use this function in a Lisp program; use `define-abbrev' instead." (defun inverse-add-mode-abbrev (n) "Define the word before point as a mode-specific abbreviation. With prefix argument N, define the Nth word before point as the -abbreviation. +abbreviation. Negative N means use the Nth word after point. If `only-global-abbrevs' is non-nil, this command defines a global (mode-independent) abbrev instead of a mode-specific one. @@ -371,7 +371,7 @@ to define an abbrev by specifying the abbreviation in the minibuffer." (defun inverse-add-global-abbrev (n) "Define the word before point as a global (mode-independent) abbreviation. With prefix argument N, define the Nth word before point as the -abbreviation. +abbreviation. Negative N means use the Nth word after point. This command reads the expansion from the minibuffer, defines the abbrev, and then expands the abbreviation in the current buffer. commit d80dea6036701916c710fde77d1c491dcb804264 Author: Lars Ingebrigtsen Date: Sat May 21 14:46:47 2022 +0200 Add note about Tramp completion to completion-styles doc string * lisp/minibuffer.el (completion-styles): Add note about Tramp completion (bug#37954). diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 2724b5a3e6..0ef846ccd7 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -985,7 +985,11 @@ and DOC describes the way this style of completion works.") The available styles are listed in `completion-styles-alist'. Note that `completion-category-overrides' may override these -styles for specific categories, such as files, buffers, etc." +styles for specific categories, such as files, buffers, etc. + +Note that Tramp host name completion (e.g., \"/ssh:ho\") +currently doesn't work if this list doesn't contain at least one +of `basic', `emacs22' or `emacs21'." :type completion--styles-type :version "23.1") commit 9e7c0cf57d522b50423880f3a846c52c5509fef9 Author: Arash Esbati Date: Sat May 21 13:32:33 2022 +0200 Remove mention of removed nnimap-nov-is-evil variable * doc/misc/gnus.texi (Slow/Expensive Connection): Remove mention of removed nnimap-nov-is-evil variable (bug#55556). diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 628815df5d..d5a550836a 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -29671,10 +29671,9 @@ Gnus not to use @acronym{NOV}. As the variables for the other back ends, there are @code{nndiary-nov-is-evil}, @code{nndir-nov-is-evil}, -@code{nnfolder-nov-is-evil}, @code{nnimap-nov-is-evil}, -@code{nnml-nov-is-evil}, and @code{nnspool-nov-is-evil}. Note that a -non-@code{nil} value for @code{gnus-nov-is-evil} overrides all those -variables. +@code{nnfolder-nov-is-evil}, @code{nnml-nov-is-evil}, and +@code{nnspool-nov-is-evil}. Note that a non-@code{nil} value for +@code{gnus-nov-is-evil} overrides all those variables. @end table commit 90aae0bca2a4d082ec6e452ca8399b75c6c1d633 Author: Eli Zaretskii Date: Sat May 21 10:20:41 2022 +0300 Improve documentation strings and prompts in abbrev.el * lisp/abbrev.el (abbrev-file-name, only-global-abbrevs) (copy-abbrev-table, insert-abbrevs, list-abbrevs) (abbrev-table-name, edit-abbrevs, define-abbrevs) (read-abbrev-file, quietly-read-abbrev-file, write-abbrev-file) (abbrev-edit-save-to-file, abbrev-edit-save-buffer) (add-mode-abbrev, add-global-abbrev, inverse-add-mode-abbrev) (inverse-add-global-abbrev, abbrev-prefix-mark) (expand-region-abbrevs, abbrev-table-get, abbrev-table-put) (abbrev-get, abbrev-minor-mode-table-alist, abbrevs-changed) (abbrev-all-caps, last-abbrev-text, last-abbrev-location) (clear-abbrev-table, define-abbrev, define-global-abbrev) (define-mode-abbrev, abbrev--active-tables, abbrev--symbol) (abbrev-symbol, abbrev-expansion, abbrev-insert) (abbrev-expand-function, abbrev--suggest-above-threshold) (abbrev--suggest-saved-recommendations) (abbrev--suggest-shortest-abbrev, abbrev--suggest-get-totals) (insert-abbrev-table-description, define-abbrev-table) (abbrev-table-menu): Fix doc strings: wording, punctuation, clarity. (add-abbrev, inverse-add-abbrev): Improve the prompt text. (Bug#55527) diff --git a/lisp/abbrev.el b/lisp/abbrev.el index de971eb2bd..fd8cb754d1 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -42,12 +42,12 @@ (defcustom abbrev-file-name (locate-user-emacs-file "abbrev_defs" ".abbrev_defs") - "Default name of file from which to read abbrevs." + "Default name of file from which to read and where to save abbrevs." :initialize 'custom-initialize-delay :type 'file) (defcustom only-global-abbrevs nil - "Non-nil means user plans to use global abbrevs only. + "Non-nil means user plans to use only global abbrevs. This makes the commands that normally define mode-specific abbrevs define global abbrevs instead." :type 'boolean @@ -59,7 +59,8 @@ define global abbrevs instead." In Abbrev mode, inserting an abbreviation causes it to expand and be replaced by its expansion." - ;; It's defined in C, this stops the d-m-m macro defining it again. + ;; It's defined in C, this stops the 'define-minor-mode' macro from + ;; defining it again. :variable abbrev-mode) (put 'abbrev-mode 'safe-local-variable 'booleanp) @@ -83,7 +84,8 @@ be replaced by its expansion." (defun copy-abbrev-table (table) "Make a new abbrev-table with the same abbrevs as TABLE. -Does not copy property lists." +This function does not copy property lists of the abbrevs. +See `define-abbrev' for the documentation of abbrev properties." (let ((new-table (make-abbrev-table))) (obarray-map (lambda (symbol) @@ -95,8 +97,8 @@ Does not copy property lists." new-table)) (defun insert-abbrevs () - "Insert after point a description of all defined abbrevs. -Mark is set after the inserted text." + "Insert the description of all defined abbrevs after point. +Set mark after the inserted text." (interactive) (push-mark (save-excursion @@ -105,15 +107,15 @@ Mark is set after the inserted text." (point)))) (defun list-abbrevs (&optional local) - "Display a list of defined abbrevs. -If LOCAL is non-nil, interactively when invoked with a -prefix arg, display only local, i.e. mode-specific, abbrevs. -Otherwise display all abbrevs." + "Display a list of the defined abbrevs. +If LOCAL is non-nil (interactively, when invoked with a +prefix arg), display only local, i.e. mode-specific, abbrevs. +Otherwise display all the abbrevs." (interactive "P") (display-buffer (prepare-abbrev-list-buffer local))) (defun abbrev-table-name (table) - "Value is the name of abbrev table TABLE." + "Return the name of the specified abbrev TABLE." (let ((tables abbrev-table-name-list) found) (while (and (not found) tables) @@ -137,33 +139,33 @@ Otherwise display all abbrevs." (dolist (table (nreverse empty-tables)) (insert-abbrev-table-description table t))) ;; Note: `list-abbrevs' can display only local abbrevs, in - ;; which case editing could lose abbrevs of other tables. Thus - ;; enter `edit-abbrevs-mode' only if LOCAL is nil. + ;; which case editing could lose abbrevs of other tables. + ;; Thus enter `edit-abbrevs-mode' only if LOCAL is nil. (edit-abbrevs-mode)) (goto-char (point-min)) (set-buffer-modified-p nil) (current-buffer)))) (defun edit-abbrevs () - "Alter abbrev definitions by editing a list of them. -Selects a buffer containing a list of abbrev definitions with -point located in the abbrev table for the current buffer, and -turns on `edit-abbrevs-mode' in that buffer. + "Alter abbrev definitions by editing the list of abbrevs. +This selects a buffer containing the list of abbrev definitions +with point located in the abbrev table for the current buffer, and +turns on `edit-abbrevs-mode' in the buffer with the list of abbrevs. -You can edit them and type \\\\[edit-abbrevs-redefine] \ +You can edit the abbrevs and type \\\\[edit-abbrevs-redefine] \ to redefine abbrevs according to your editing. The abbrevs editing buffer contains a header line for each abbrev table, which is the abbrev table name in parentheses. -This is followed by one line per abbrev in that table: +The header line is followed by one line per abbrev in that table: NAME USECOUNT EXPANSION HOOK where NAME and EXPANSION are strings with quotes, USECOUNT is an integer, and HOOK is any valid function -or may be omitted (it is usually omitted)." +that may be omitted (it is usually omitted)." (interactive) (let ((table-name (abbrev-table-name local-abbrev-table))) (switch-to-buffer (prepare-abbrev-list-buffer)) @@ -184,8 +186,9 @@ or may be omitted (it is usually omitted)." "Define abbrevs according to current visible buffer contents. See documentation of `edit-abbrevs' for info on the format of the text you must have in the buffer. -With argument, eliminate all abbrev definitions except -the ones defined from the buffer now." +If ARG is non-nil (interactively, when invoked with a prefix +argument), eliminate all abbrev definitions except the ones +defined by the current buffer contents." (interactive "P") (if arg (kill-all-abbrevs)) (save-excursion @@ -216,7 +219,8 @@ the ones defined from the buffer now." "Read abbrev definitions from file written with `write-abbrev-file'. Optional argument FILE is the name of the file to read; it defaults to the value of `abbrev-file-name'. -Optional second argument QUIETLY non-nil means don't display a message." +Optional second argument QUIETLY non-nil means don't display a message +about loading the abbrevs." (interactive (list (read-file-name (format-prompt "Read abbrev file" abbrev-file-name) @@ -225,22 +229,22 @@ Optional second argument QUIETLY non-nil means don't display a message." (setq abbrevs-changed nil)) (defun quietly-read-abbrev-file (&optional file) - "Read abbrev definitions from file written with `write-abbrev-file'. + "Quietly read abbrev definitions from file written with `write-abbrev-file'. Optional argument FILE is the name of the file to read; it defaults to the value of `abbrev-file-name'. -Does not display any message." +Do not display any messages about loading the abbrevs." ;(interactive "fRead abbrev file: ") (read-abbrev-file file t)) (defun write-abbrev-file (&optional file verbose) "Write all user-level abbrev definitions to a file of Lisp code. This does not include system abbrevs; it includes only the abbrev tables -listed in listed in `abbrev-table-name-list'. +listed in `abbrev-table-name-list'. The file written can be loaded in another session to define the same abbrevs. -The argument FILE is the file name to write. If omitted or nil, the file -specified in `abbrev-file-name' is used. -If VERBOSE is non-nil, display a message indicating where abbrevs -have been saved." +The argument FILE is the file name to write. If omitted or nil, it defaults +to the value of `abbrev-file-name'. +If VERBOSE is non-nil, display a message indicating the file where the +abbrevs have been saved." (interactive (list (read-file-name "Write abbrev file: " @@ -253,10 +257,10 @@ have been saved." (dolist (table ;; We sort the table in order to ease the automatic ;; merging of different versions of the user's abbrevs - ;; file. This is useful, for example, for when the + ;; file. This is useful, for example, when the ;; user keeps their home directory in a revision - ;; control system, and is therefore keeping multiple - ;; slightly-differing copies loosely synchronized. + ;; control system, and therefore keeps multiple + ;; slightly-differing loosely synchronized copies. (sort (copy-sequence abbrev-table-name-list) (lambda (s1 s2) (string< (symbol-name s1) @@ -270,7 +274,7 @@ have been saved." (write-region nil nil file nil (and (not verbose) 0))))) (defun abbrev-edit-save-to-file (file) - "Save all user-level abbrev definitions in current buffer to FILE." + "Save to FILE all the user-level abbrev definitions in current buffer." (interactive (list (read-file-name "Save abbrevs to file: " (file-name-directory @@ -280,7 +284,7 @@ have been saved." (write-abbrev-file file t)) (defun abbrev-edit-save-buffer () - "Save all user-level abbrev definitions in current buffer. + "Save all the user-level abbrev definitions in current buffer. The saved abbrevs are written to the file specified by `abbrev-file-name'." (interactive) @@ -288,15 +292,16 @@ The saved abbrevs are written to the file specified by (defun add-mode-abbrev (arg) - "Define mode-specific abbrev for last word(s) before point. -Argument is how many words before point form the expansion; -or zero means the region is the expansion. -A negative argument means to undefine the specified abbrev. -Reads the abbreviation in the minibuffer. + "Define a mode-specific abbrev whose expansion is the last word before point. +Prefix argument ARG says how many words before point to use for the expansion; +zero means the entire region is the expansion. +A negative ARG means to undefine the specified abbrev. + +This command reads the abbreviation from the minibuffer. See also `inverse-add-mode-abbrev', which performs the opposite task: -if the abbrev text is already in the buffer, use this command to -define an abbrev by specifying the expansion in the minibuffer. +if the abbreviation is already in the buffer, use that command to define +a mode-specific abbrev by specifying its expansion in the minibuffer. Don't use this function in a Lisp program; use `define-abbrev' instead." (interactive "p") @@ -308,15 +313,16 @@ Don't use this function in a Lisp program; use `define-abbrev' instead." "Mode" arg)) (defun add-global-abbrev (arg) - "Define global (all modes) abbrev for last word(s) before point. -The prefix argument specifies the number of words before point that form the -expansion; or zero means the region is the expansion. -A negative argument means to undefine the specified abbrev. -This command uses the minibuffer to read the abbreviation. + "Define a global (all modes) abbrev whose expansion is last word before point. +Prefix argument ARG says how many words before point to use for the expansion; +zero means the entire region is the expansion. +A negative ARG means to undefine the specified abbrev. + +This command reads the abbreviation from the minibuffer. See also `inverse-add-global-abbrev', which performs the opposite task: -if the abbrev text is already in the buffer, use this command to -define an abbrev by specifying the expansion in the minibuffer. +if the abbreviation is already in the buffer, use that command to define +a global abbrev by specifying its expansion in the minibuffer. Don't use this function in a Lisp program; use `define-abbrev' instead." (interactive "p") @@ -330,25 +336,30 @@ Don't use this function in a Lisp program; use `define-abbrev' instead." (save-excursion (forward-word (- arg)) (point)))))) name) (setq name - (read-string (format (if exp "%s abbrev for \"%s\": " + (read-string (format (if exp "%s abbrev that expands into \"%s\": " "Undefine %s abbrev: ") type exp))) (set-text-properties 0 (length name) nil name) (if (or (null exp) (not (abbrev-expansion name table)) - (y-or-n-p (format "%s expands to \"%s\"; redefine? " + (y-or-n-p (format "%s expands into \"%s\"; redefine? " name (abbrev-expansion name table)))) (define-abbrev table (downcase name) exp)))) (defun inverse-add-mode-abbrev (n) - "Define last word before point as a mode-specific abbrev. -With prefix argument N, defines the Nth word before point. -This command uses the minibuffer to read the expansion. -Expands the abbreviation after defining it. + "Define the word before point as a mode-specific abbreviation. +With prefix argument N, define the Nth word before point as the +abbreviation. + +If `only-global-abbrevs' is non-nil, this command defines a +global (mode-independent) abbrev instead of a mode-specific one. + +This command reads the expansion from the minibuffer, defines the +abbrev, and then expands the abbreviation in the current buffer. See also `add-mode-abbrev', which performs the opposite task: -if the expansion is already in the buffer, use this command -to define an abbrev by specifying the abbrev in the minibuffer." +if the expansion is already in the buffer, use that command +to define an abbrev by specifying the abbreviation in the minibuffer." (interactive "p") (inverse-add-abbrev (if only-global-abbrevs @@ -358,14 +369,16 @@ to define an abbrev by specifying the abbrev in the minibuffer." "Mode" n)) (defun inverse-add-global-abbrev (n) - "Define last word before point as a global (mode-independent) abbrev. -With prefix argument N, defines the Nth word before point. -This command uses the minibuffer to read the expansion. -Expands the abbreviation after defining it. + "Define the word before point as a global (mode-independent) abbreviation. +With prefix argument N, define the Nth word before point as the +abbreviation. + +This command reads the expansion from the minibuffer, defines the +abbrev, and then expands the abbreviation in the current buffer. See also `add-global-abbrev', which performs the opposite task: -if the expansion is already in the buffer, use this command -to define an abbrev by specifying the abbrev in the minibuffer." +if the expansion is already in the buffer, use that command +to define an abbrev by specifying the abbreviation in the minibuffer." (interactive "p") (inverse-add-abbrev global-abbrev-table "Global" n)) @@ -379,10 +392,10 @@ to define an abbrev by specifying the abbrev in the minibuffer." (setq start (point) name (buffer-substring-no-properties start end))) - (setq exp (read-string (format "%s expansion for \"%s\": " type name) + (setq exp (read-string (format "Expansion for %s abbrev \"%s\": " type name) nil nil nil t)) (when (or (not (abbrev-expansion name table)) - (y-or-n-p (format "%s expands to \"%s\"; redefine? " + (y-or-n-p (format "%s expands into \"%s\"; redefine? " name (abbrev-expansion name table)))) (define-abbrev table (downcase name) exp) (save-excursion @@ -390,10 +403,11 @@ to define an abbrev by specifying the abbrev in the minibuffer." (expand-abbrev))))) (defun abbrev-prefix-mark (&optional arg) - "Mark current point as the beginning of an abbrev. -The abbrev to be expanded starts here rather than at beginning of -word. This way, you can expand an abbrev with a prefix: insert -the prefix, use this command, then insert the abbrev. + "Mark point as the beginning of an abbreviation. +The abbrev to be expanded starts at point rather than at the +beginning of a word. This way, you can expand an abbrev with +a prefix: insert the prefix, use this command, then insert the +abbrev. This command inserts a hyphen after the prefix, and if the abbrev is subsequently expanded, this hyphen will be removed. @@ -408,8 +422,8 @@ argument." (insert "-")) (defun expand-region-abbrevs (start end &optional noquery) - "For abbrev occurrence in the region, offer to expand it. -The user is asked to type `y' or `n' for each occurrence. + "For each abbrev occurrence in the region, offer to expand it. +Ask the user to type `y' or `n' for each occurrence. A prefix argument means don't query; expand all abbrevs." (interactive "r\nP") (save-excursion @@ -430,18 +444,19 @@ A prefix argument means don't query; expand all abbrevs." ;;; Abbrev properties. (defun abbrev-table-get (table prop) - "Get the PROP property of abbrev table TABLE." + "Get the property PROP of abbrev table TABLE." (let ((sym (obarray-get table ""))) (if sym (get sym prop)))) (defun abbrev-table-put (table prop val) - "Set the PROP property of abbrev table TABLE to VAL." + "Set the property PROP of abbrev table TABLE to VAL." (let ((sym (obarray-put table ""))) (set sym nil) ; Make sure it won't be confused for an abbrev. (put sym prop val))) (defalias 'abbrev-get 'get "Get the property PROP of abbrev ABBREV +See `define-abbrev' for the effect of some special properties. \(fn ABBREV PROP)") @@ -500,7 +515,8 @@ for any particular abbrev defined in both.") (defvar abbrev-minor-mode-table-alist nil "Alist of abbrev tables to use for minor modes. Each element looks like (VARIABLE . ABBREV-TABLE); -ABBREV-TABLE is active whenever VARIABLE's value is non-nil. +ABBREV-TABLE is active whenever VARIABLE's value is non-nil; +VARIABLE is supposed to be a minor-mode variable. ABBREV-TABLE can also be a list of abbrev tables.") (defvar fundamental-mode-abbrev-table @@ -511,11 +527,11 @@ ABBREV-TABLE can also be a list of abbrev tables.") "The abbrev table of mode-specific abbrevs for Fundamental Mode.") (defvar abbrevs-changed nil - "Set non-nil by defining or altering any word abbrevs. + "Non-nil if any word abbrevs were defined or altered. This causes `save-some-buffers' to offer to save the abbrevs.") (defcustom abbrev-all-caps nil - "Non-nil means expand multi-word abbrevs all caps if abbrev was so." + "Non-nil means expand multi-word abbrevs in all caps if the abbrev was so." :type 'boolean :group 'abbrev-mode) @@ -532,17 +548,17 @@ Trying to expand an abbrev in any other buffer clears `abbrev-start-location'.") "The abbrev-symbol of the last abbrev expanded. See `abbrev-symbol'.") (defvar last-abbrev-text nil - "The exact text of the last abbrev expanded. + "The exact text of the last abbrev that was expanded. It is nil if the abbrev has already been unexpanded.") (defvar last-abbrev-location 0 - "The location of the start of the last abbrev expanded.") + "The location of the start of the last abbrev that was expanded.") ;; (defvar-local local-abbrev-table fundamental-mode-abbrev-table ;; "Local (mode-specific) abbrev table of current buffer.") (defun clear-abbrev-table (table) - "Undefine all abbrevs in abbrev table TABLE, leaving it empty." + "Undefine all abbrevs in abbrev table TABLE, leaving TABLE empty." (setq abbrevs-changed t) (let* ((sym (obarray-get table ""))) (dotimes (i (length table)) @@ -557,9 +573,9 @@ It is nil if the abbrev has already been unexpanded.") ;; For backward compatibility, always return nil. nil) -(defun define-abbrev (table name expansion &optional hook &rest props) - "Define an abbrev in TABLE named NAME, to expand to EXPANSION and call HOOK. -NAME must be a string, and should be lower-case. +(defun define-abbrev (table abbrev expansion &optional hook &rest props) + "Define ABBREV in TABLE, to expand into EXPANSION and optionally call HOOK. +ABBREV must be a string, and should be lower-case. EXPANSION should usually be a string. To undefine an abbrev, define it with EXPANSION = nil. If HOOK is non-nil, it should be a function of no arguments; @@ -583,12 +599,12 @@ PROPS is a property list. The following properties are special: overwrite a non-system abbreviation of the same name. - `:case-fixed': non-nil means that abbreviations are looked up without case-folding, and the expansion is not capitalized/upcased. -- `:enable-function': a function of no argument which returns non-nil if the - abbrev should be used for a particular call of `expand-abbrev'. +- `:enable-function': a function of no arguments which returns non-nil + if the abbrev should be used for a particular call of `expand-abbrev'. An obsolete but still supported calling form is: -\(define-abbrev TABLE NAME EXPANSION &optional HOOK COUNT SYSTEM)." +\(define-abbrev TABLE ABBREV EXPANSION &optional HOOK COUNT SYSTEM)." (when (and (consp props) (or (null (car props)) (numberp (car props)))) ;; Old-style calling convention. (setq props `(:count ,(car props) @@ -598,7 +614,7 @@ An obsolete but still supported calling form is: (setq props (plist-put props :abbrev-table-modiff (abbrev-table-get table :abbrev-table-modiff))) (let ((system-flag (plist-get props :system)) - (sym (obarray-put table name))) + (sym (obarray-put table abbrev))) ;; Don't override a prior user-defined abbrev with a system abbrev, ;; unless system-flag is `force'. (unless (and (not (memq system-flag '(nil force))) @@ -618,7 +634,7 @@ An obsolete but still supported calling form is: (if (eq 'force system-flag) (plist-put props :system t) props)) (abbrev-table-put table :abbrev-table-modiff (1+ (abbrev-table-get table :abbrev-table-modiff)))) - name)) + abbrev)) (defun abbrev--check-chars (abbrev global) "Check if the characters in ABBREV have word syntax in either the @@ -638,7 +654,7 @@ current (if global is nil) or standard syntax table." (if global "in the standard syntax" "in this mode")))))) (defun define-global-abbrev (abbrev expansion) - "Define ABBREV as a global abbreviation for EXPANSION. + "Define ABBREV as a global abbreviation that expands into EXPANSION. The characters in ABBREV must all be word constituents in the standard syntax table." (interactive "sDefine global abbrev: \nsExpansion for %s: ") @@ -646,7 +662,7 @@ syntax table." (define-abbrev global-abbrev-table (downcase abbrev) expansion)) (defun define-mode-abbrev (abbrev expansion) - "Define ABBREV as a mode-specific abbreviation for EXPANSION. + "Define ABBREV as a mode-specific abbreviation that expands into EXPANSION. The characters in ABBREV must all be word-constituents in the current mode." (interactive "sDefine mode abbrev: \nsExpansion for %s: ") (unless local-abbrev-table @@ -655,8 +671,8 @@ The characters in ABBREV must all be word-constituents in the current mode." (define-abbrev local-abbrev-table (downcase abbrev) expansion)) (defun abbrev--active-tables (&optional tables) - "Return the list of abbrev tables currently active. -TABLES if non-nil overrides the usual rules. It can hold + "Return the list of abbrev tables that are currently active. +TABLES, if non-nil, overrides the usual rules. It can hold either a single abbrev table or a list of abbrev tables." ;; We could just remove the `tables' arg and let callers use ;; (or table (abbrev--active-tables)) but then they'd have to be careful @@ -682,7 +698,7 @@ either a single abbrev table or a list of abbrev tables." "Return the symbol representing abbrev named ABBREV in TABLE. This symbol's name is ABBREV, but it is not the canonical symbol of that name; it is interned in the abbrev-table TABLE rather than the normal obarray. -The value is nil if that abbrev is not defined." +The value is nil if such an abbrev is not defined." (let* ((case-fold (not (abbrev-table-get table :case-fixed))) ;; In case the table doesn't set :case-fixed but some of the ;; abbrevs do, we have to be careful. @@ -699,11 +715,11 @@ The value is nil if that abbrev is not defined." sym))) (defun abbrev-symbol (abbrev &optional table) - "Return the symbol representing abbrev named ABBREV. + "Return the symbol representing the abbrev named ABBREV in TABLE. This symbol's name is ABBREV, but it is not the canonical symbol of that name; it is interned in an abbrev-table rather than the normal obarray. -The value is nil if that abbrev is not defined. -Optional second arg TABLE is abbrev table to look it up in. +The value is nil if such an abbrev is not defined. +Optional second arg TABLE is the abbrev table to look it up in. The default is to try buffer's mode-specific abbrev table, then global table." (let ((tables (abbrev--active-tables table)) sym) @@ -716,7 +732,7 @@ The default is to try buffer's mode-specific abbrev table, then global table." (defun abbrev-expansion (abbrev &optional table) "Return the string that ABBREV expands into in the current buffer. -Optionally specify an abbrev table as second arg; +Optionally specify an abbrev TABLE as second arg; then ABBREV is looked up in that table only." (symbol-value (abbrev-symbol abbrev table))) @@ -780,9 +796,9 @@ then ABBREV is looked up in that table only." (defun abbrev-insert (abbrev &optional name wordstart wordend) "Insert abbrev ABBREV at point. If non-nil, NAME is the name by which this abbrev was found. -If non-nil, WORDSTART is the place where to insert the abbrev. -If WORDEND is non-nil, the abbrev replaces the previous text between -WORDSTART and WORDEND. +If non-nil, WORDSTART is the buffer position where to insert the abbrev. +If WORDEND is non-nil, it is a buffer position; the abbrev replaces the +previous text between WORDSTART and WORDEND. Return ABBREV if the expansion should be considered as having taken place. The return value can be influenced by a `no-self-insert' property; see `define-abbrev' for details." @@ -847,7 +863,8 @@ see `define-abbrev' for details." (defvar abbrev-expand-function #'abbrev--default-expand "Function that `expand-abbrev' uses to perform abbrev expansion. -Takes no argument and should return the abbrev symbol if expansion took place.") +Takes no arguments, and should return the abbrev symbol if expansion +took place.") (defcustom abbrev-suggest nil "Non-nil means suggest using abbrevs to save typing. @@ -906,15 +923,17 @@ Expansion is a string of one or more words." (defun abbrev--suggest-above-threshold (expansion) "Return non-nil if the abbrev in EXPANSION provides significant savings. -A significant saving, here, is the difference in length between -the abbrev and the abbrev expansion. EXPANSION is a cons cell -where the car is the expansion and the cdr is the abbrev." +A significant saving, here, means the difference in length between +the abbrev and its expansion is not below the threshold specified +by the value of `abbrev-suggest-hint-threshold'. +EXPANSION is a cons cell where the car is the expansion and the cdr is +the abbrev." (>= (- (length (car expansion)) (length (cdr expansion))) abbrev-suggest-hint-threshold)) (defvar abbrev--suggest-saved-recommendations nil - "Keeps a list of expansions that have abbrevs defined. + "Keeps the list of expansions that have abbrevs defined. The user can show this list by calling `abbrev-suggest-show-report'.") @@ -930,7 +949,7 @@ EXPANSION is a cons cell where the `car' is the expansion and the (push expansion abbrev--suggest-saved-recommendations)) (defun abbrev--suggest-shortest-abbrev (new current) - "Return the shortest abbrev of NEW and CURRENT. + "Return the shortest of the two abbrevs given by NEW and CURRENT. NEW and CURRENT are cons cells where the `car' is the expansion and the `cdr' is the abbrev." (if (not current) @@ -959,8 +978,8 @@ informed about the existing abbrev." (defun abbrev--suggest-get-totals () "Return a list of all expansions and how many times they were used. -Each expansion is a cons cell where the `car' is the expansion -and the `cdr' is the number of times the expansion has been +Each expansion in the returned list is a cons cell where the `car' is the +expansion text and the `cdr' is the number of times the expansion has been typed." (let (total cell) (dolist (expansion abbrev--suggest-saved-recommendations) @@ -1088,11 +1107,11 @@ Presumes that `standard-output' points to `current-buffer'." (defun insert-abbrev-table-description (name &optional readable) "Insert before point a full description of abbrev table named NAME. NAME is a symbol whose value is an abbrev table. -If optional 2nd arg READABLE is non-nil, a human-readable description -is inserted. +If optional 2nd arg READABLE is non-nil, insert a human-readable +description. -If READABLE is nil, an expression is inserted. The expression is -a call to `define-abbrev-table' that when evaluated will define +If READABLE is nil, insert an expression. The expression is +a call to `define-abbrev-table' that, when evaluated, will define the abbrev table NAME exactly as it is currently defined. Abbrevs marked as \"system abbrevs\" are ignored." (let ((symbols (abbrev--table-symbols name readable))) @@ -1139,10 +1158,10 @@ Properties with special meaning: case-folding, and the expansion is not capitalized/upcased. - `:regexp' is a regular expression that specifies how to extract the name of the abbrev before point. The submatch 1 is treated - as the potential name of an abbrev. If :regexp is nil, the default + as the potential name of an abbrev. If `:regexp' is nil, the default behavior uses `backward-word' and `forward-word' to extract the name - of the abbrev, which can therefore only be a single word. -- `:enable-function' can be set to a function of no argument which returns + of the abbrev, which can therefore by default only be a single word. +- `:enable-function' can be set to a function of no arguments which returns non-nil if and only if the abbrevs in this table should be used for this instance of `expand-abbrev'." (declare (doc-string 3)) @@ -1171,7 +1190,7 @@ Properties with special meaning: (defun abbrev-table-menu (table &optional prompt sortfun) "Return a menu that shows all abbrevs in TABLE. -Selecting an entry runs `abbrev-insert'. +Selecting an entry runs `abbrev-insert' for that entry's abbrev. PROMPT is the prompt to use for the keymap. SORTFUN is passed to `sort' to change the default ordering." (unless sortfun (setq sortfun 'string-lessp)) commit dfa3e6f424b20fe27d9041b2ce7d69811df5d8cd Author: Alan Mackenzie Date: Fri May 20 20:18:38 2022 +0000 Restore the Fselect_window call in gui_consider_frame_title. This fixes bug #55412. The call to Fselect_window was removed on 2021-03-21 in the commit "Prevent open minibuffers getting lost when their frame gets deleted". This call is actually needed to determine current elements of the pertinent window and frame when these are used in the frame title. * src/frame.c (do_switch_frame): When the selected window in the target frame is the mini-window, switch away from this window unless there is a valid minibuffer there. * src/frame.h (struct frame): Add an incidental comment about the element selected_window. * src/minibuf.c (move_minibuffers_onto_frame): No longer set the selected window of the source frame. This action is now performed later, on returning to that frame, in do_switch_frame when needed (see above). * src/xdisp.c (gui_consider_frame_title): Replace the Fselect_window call and associated ancillary settings. diff --git a/src/frame.c b/src/frame.c index ccac18d23c..dc8045f41e 100644 --- a/src/frame.c +++ b/src/frame.c @@ -1564,6 +1564,13 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor if (! FRAME_MINIBUF_ONLY_P (XFRAME (selected_frame))) last_nonminibuf_frame = XFRAME (selected_frame); + /* If the selected window in the target frame is its mini-window, we move + 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) + && NILP (Fminibufferp (XWINDOW (f->minibuffer_window)->contents, Qt))) + Fset_frame_selected_window (frame, call1 (Qget_mru_window, frame), Qnil); + Fselect_window (f->selected_window, norecord); /* We want to make sure that the next event generates a frame-switch diff --git a/src/frame.h b/src/frame.h index 0b8cdf62de..cc0dae8f5a 100644 --- a/src/frame.h +++ b/src/frame.h @@ -123,6 +123,7 @@ struct frame /* This frame's selected window. Each frame has its own window hierarchy and one of the windows in it is selected within the frame. + This window may be the mini-window of the frame, if any. The selected window of the selected frame is Emacs's selected window. */ Lisp_Object selected_window; diff --git a/src/minibuf.c b/src/minibuf.c index 847e7be5ad..0fc7f2caa1 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -197,20 +197,12 @@ move_minibuffers_onto_frame (struct frame *of, bool for_deletion) return; if (FRAME_LIVE_P (f) && !EQ (f->minibuffer_window, of->minibuffer_window) - && WINDOW_LIVE_P (f->minibuffer_window) /* F not a tootip frame */ + && WINDOW_LIVE_P (f->minibuffer_window) /* F not a tooltip frame */ && WINDOW_LIVE_P (of->minibuffer_window)) { zip_minibuffer_stacks (f->minibuffer_window, of->minibuffer_window); if (for_deletion && XFRAME (MB_frame) != of) MB_frame = selected_frame; - if (!for_deletion - && MINI_WINDOW_P (XWINDOW (FRAME_SELECTED_WINDOW (of)))) - { - Lisp_Object old_frame; - XSETFRAME (old_frame, of); - Fset_frame_selected_window (old_frame, - Fframe_first_window (old_frame), Qnil); - } } } diff --git a/src/xdisp.c b/src/xdisp.c index 6963935666..9740e6b590 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -12796,8 +12796,9 @@ gui_consider_frame_title (Lisp_Object frame) mode_line_noprop_buf; then display the title. */ record_unwind_protect (unwind_format_mode_line, format_mode_line_unwind_data - (NULL, current_buffer, Qnil, false)); + (f, current_buffer, selected_window, false)); + Fselect_window (f->selected_window, Qt); set_buffer_internal_1 (XBUFFER (XWINDOW (f->selected_window)->contents)); fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format; commit de35e9728f3d821e280b5c97c66f1ba8991cd700 Author: Eli Zaretskii Date: Fri May 20 17:08:34 2022 +0300 Advise against settings in the MS-Windows system registry * doc/emacs/cmdargs.texi (MS-Windows Registry): Advise against setting environment variables in the system registry. (Bug#16429) diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index 797b3eaa4b..ffab2b2213 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi @@ -771,29 +771,45 @@ changing any environment or registry settings. @pindex addpm, MS-Windows installation program @cindex registry, setting environment variables (MS-Windows) -On MS-Windows, the installation program @command{addpm.exe} adds -values for @env{emacs_dir}, @env{EMACSLOADPATH}, @env{EMACSDATA}, -@env{EMACSPATH}, @env{EMACSDOC}, @env{SHELL} and @env{TERM} to the -@file{HKEY_LOCAL_MACHINE} section of the system registry, under -@file{/Software/GNU/Emacs}. It does this because there is no standard -place to set environment variables across different versions of -Windows. Running @command{addpm.exe} is no longer strictly necessary -in recent versions of Emacs, but if you are upgrading from an older -version, running @command{addpm.exe} ensures that you do not have -older registry entries from a previous installation, which may not be -compatible with the latest version of Emacs. - -When Emacs starts, as well as checking the environment, it also checks -the System Registry for those variables and for @env{HOME}, @env{LANG} -and @env{PRELOAD_WINSOCK}. +On MS-Windows, the environment variables @env{emacs_dir}, +@env{EMACSLOADPATH}, @env{EMACSDATA}, @env{EMACSPATH}, @env{EMACSDOC}, +@env{SHELL}, @env{TERM}, @env{HOME}, @env{LANG}, and +@env{PRELOAD_WINSOCK} can also be set in the @file{HKEY_CURRENT_USER} +or the @file{HKEY_LOCAL_MACHINE} section of the system registry, under +the @file{/Software/GNU/Emacs} key. When Emacs starts, as well as +checking the environment, it also checks the system registry for those +variables. To determine the value of those variables, Emacs goes through the -following procedure. First, the environment is checked. If the -variable is not found there, Emacs looks for registry keys by that -name under @file{/Software/GNU/Emacs}; first in the +following procedure. First, it checks the environment. If the +variable is not found there, Emacs looks for a registry key by the +name of the variable under @file{/Software/GNU/Emacs}; first in the @file{HKEY_CURRENT_USER} section of the registry, and if not found there, in the @file{HKEY_LOCAL_MACHINE} section. Finally, if Emacs -still cannot determine the values, compiled-in defaults are used. +still cannot determine the values, it uses the compiled-in defaults. + +Note that the registry settings have global system-wide effect: they +will affect all Emacs sessions run on the system. Thus, if you run +different Emacs versions, or use both installed and un-installed Emacs +executables, or build newer versions of Emacs, the settings in the +registry will cause all of them to use the same directories, which is +probably not what you want. For this reason, @emph{we recommend +against setting these variables in the registry}. If you have such +settings in the registry, we recommend that you remove them. + +If you run the Emacs MS-Windows installation program +@command{addpm.exe}, it will update any existing registry settings of +the @env{emacs_dir}, @env{EMACSLOADPATH}, @env{EMACSDATA}, +@env{EMACSPATH}, @env{EMACSDOC}, @env{SHELL}, and @env{TERM} variables +to have the values suitable for the installed Emacs version with which +@command{addpm.exe} came. Note that @command{addpm.exe} will +@emph{not} create any registry setting that didn't exist, it will only +update existing settings, which are most probably inherited from an +old Emacs installation, so that they are compatible with the newly +installed Emacs version. Running @command{addpm.exe} is no longer +necessary when installing recent versions of Emacs, so we only +recommend doing that if you are upgrading from an older version, and +cannot remove these settings from the registry for some reason. In addition to the environment variables above, you can also add settings to the @file{/Software/GNU/Emacs} registry key to specify X commit 3ffa3d340339eb90e619051711e910d73f84b3a8 Author: Eli Zaretskii Date: Fri May 20 10:12:04 2022 +0300 ; Minor addition to make-tarball.txt * admin/make-tarball.txt (WEB PAGES): Mention the need to update th copyright years of emacs.html. (Bug#55530) diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index c8ee3349cd..02b4f318e2 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt @@ -334,6 +334,9 @@ looks like this: +Also, make sure the copyright years at the bottom of emacs.html are +up-to-date. + The file download.html may need to be updated, for example if the MS-Windows binaries will be signed by a different person/key than those mentioned there. commit 7dc026f9ea1452ed0ca135c6b9062f778c76e6ba Author: Lars Ingebrigtsen Date: Tue May 17 20:02:59 2022 +0200 Fix kmacro-keymap binding after previous change * lisp/kmacro.el (kmacro-keymap): Fix binding after kmacro-redisplay command name change. diff --git a/lisp/kmacro.el b/lisp/kmacro.el index 6e35a6120b..7478e97134 100644 --- a/lisp/kmacro.el +++ b/lisp/kmacro.el @@ -172,7 +172,7 @@ macro to be executed before appending to it." (define-key map "\C-k" #'kmacro-end-or-call-macro-repeat) (define-key map "r" #'apply-macro-to-region-lines) (define-key map "q" #'kbd-macro-query) ;; Like C-x q - (define-key map "d" #'kdb-macro-redisplay) + (define-key map "d" #'kmacro-redisplay) ;; macro ring (define-key map "\C-n" #'kmacro-cycle-ring-next) commit 4f0fd54bc476dc776d15f35a827e437716663030 Author: Lars Ingebrigtsen Date: Tue May 17 19:56:43 2022 +0200 Add glossary entries for "interactively" * doc/emacs/glossary.texi (Glossary): Mention "interactively" and how it relates to the "command" concept (bug#55461). diff --git a/doc/emacs/glossary.texi b/doc/emacs/glossary.texi index 7e0c84d723..a78a2c9e2d 100644 --- a/doc/emacs/glossary.texi +++ b/doc/emacs/glossary.texi @@ -229,9 +229,11 @@ from a variety of coding systems when reading or writing it. @item Command A command is a Lisp function specially defined to be able to serve as a key binding in Emacs or to be invoked by its name -(@pxref{Glossary---Command Name}). When you type a key sequence -(q.v.), its binding (q.v.@:) is looked up in the relevant keymaps -(q.v.@:) to find the command to run. @xref{Commands}. +(@pxref{Glossary---Command Name}). (Another term for @dfn{command} is +@dfn{interactive function}---they are used interchangeably.) When you +type a key sequence (q.v.), its binding (q.v.@:) is looked up in the +relevant keymaps (q.v.@:) to find the command to run. +@xref{Commands}. @item Command History @xref{Glossary---Minibuffer History}. @@ -775,6 +777,14 @@ typing sequences of @acronym{ASCII} characters (q.v.). @xref{Input Methods}. Insertion means adding text into the buffer, either from the keyboard or from some other place in Emacs. +@item Interactive Function +A different term for @dfn{command} (q.v.). + +@item Interactive Invocation +A function can be called from Lisp code, or called as a user level +command (via @kbd{M-x}, a key binding or a menu). In the latter case, +the function is said to be @dfn{called interactively}. + @item Interlocking @xref{Glossary---File Locking}. commit af1c05a3c4a71f57317837d72f38b2ee703eea71 Author: Eli Zaretskii Date: Tue May 17 15:59:59 2022 +0300 Fix the name of a kmacro command. * lisp/kmacro.el (kmacro-redisplay): Rename from 'kdb-macro-redisplay' (which was wrong and included a typo). * etc/NEWS: Announce the change. (Bug#55471) diff --git a/etc/NEWS b/etc/NEWS index 4996029199..a8b5cd08ba 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -24,12 +24,17 @@ with a prefix argument or by typing 'C-u C-h C-n'. * Changes in Emacs 28.2 +This is a bug-fix release with no new features. + * Editing Changes in Emacs 28.2 * Changes in Specialized Modes and Packages in Emacs 28.2 +** The command 'kdb-macro-redisplay' was renamed to 'kmacro-redisplay'. +This is to fix an embarrassing typo in the original name. + * New Modes and Packages in Emacs 28.2 diff --git a/lisp/kmacro.el b/lisp/kmacro.el index 9bbaaa666d..6e35a6120b 100644 --- a/lisp/kmacro.el +++ b/lisp/kmacro.el @@ -1344,12 +1344,12 @@ To customize possible responses, change the \"bindings\" in (kmacro-push-ring) (setq last-kbd-macro kmacro-step-edit-new-macro)))) -(defun kdb-macro-redisplay () - "Force redisplay during kbd macro execution." +(defun kmacro-redisplay () + "Force redisplay during keyboard macro execution." (interactive) (or executing-kbd-macro defining-kbd-macro - (user-error "Not defining or executing kbd macro")) + (user-error "Not defining or executing keyboard macro")) (when executing-kbd-macro (let ((executing-kbd-macro nil)) (redisplay))))