Merge from origin/emacs-29

524e161a53 Followup to addition of TUTORIAL.fa
76f50df153 Add Farsi/Persian translation of the tutorial
8eacfaea6d Add Mongolian language environments
fe8efbb8f7 Document the 'end-session' event on MS-Windows
d80f959bed Update to Org 9.6.4-9-g8eb209
98c6cfcbe4 Don't support versioned grammar libraries on MS-Windows
8f71c1546d Accept versioned tree-sitter language grammar files
99add09d5e tab-bar-new-tab: inhibit side-window checks
087e818194 * etc/NEWS: Fix outline level.  (Bug#63042)
d7f38558c4 ; Improve font selection for Traditional Mongolian
965c5e0231 Fix rendering of Traditional Mongolian script
9a0f10b5f8 Fix line-number-at-pos when POSITION is out of narrowing
4e0f4292aa ; * etc/tutorials/TUTORIAL: Fix punctuation.
dec2ac0c65 Fix exiting Emacs after saving a tutorial

# Conflicts:
#	etc/NEWS
This commit is contained in:
Eli Zaretskii 2023-04-25 09:57:23 -04:00
commit 095ec506d0
20 changed files with 1332 additions and 45 deletions

View file

@ -2395,6 +2395,17 @@ as @code{set-language-environment}), use the
;; Get the full localized name of the language
(w32-get-locale-info language-id t)
@end smallexample
@cindex @code{end-session} event
@item end-session
This event is generated on MS-Windows when the operating system
informs Emacs that the user terminated the interactive session, or
that the system is shutting down. The standard definition of this
event is to invoke the @code{kill-emacs} command (@pxref{Killing
Emacs}) so as to shut down Emacs in an orderly fashion; if there are
unsaved changes, this will produce auto-save files
(@pxref{Auto-Saving}) that the user can use after restarting the
session to restore the unsaved edits.
@end table
If one of these events arrives in the middle of a key sequence---that

View file

@ -89,7 +89,9 @@ Mathematics ∀ p ∈ world • hello p □
Meetei Mayek (ꯃꯤꯇꯩ ꯃꯌꯦꯛ) ꯈꯨꯔꯨꯝꯖꯔꯤ
Mende Kikakui (𞠀𞠁𞠂) 𞠛𞠉
Modi (𑘦𑘻𑘚𑘲) 𑘡𑘦𑘭𑘿𑘎𑘰𑘨
Mongolian (монгол хэл) Сайн байна уу?
Mongolian Cyrillic (монгол хэл) Сайн байна уу?
Mongolian Traditional (ᠮᠣᠩᠭᠣᠯ ᠪᠢᠴᠢᠭ᠋) ᠰᠠᠶᠢᠨ ᠪᠠᠶᠢᠨ᠎ᠠ ᠤᠤ?
Northern Thai (ᨣᩣᩴᨾᩮᩬᩥᨦ / ᨽᩣᩈᩣᩃ᩶ᩣ᩠ᨶᨶᩣ) ᩈ᩠ᩅᩢᩔ᩠ᨯᩦᨣᩕᩢ᩠ᨸ
Norwegian (norsk) Hei / God dag
Odia (ଓଡ଼ିଆ) ନମସ୍କାର

View file

@ -857,17 +857,17 @@ This value stands for the value of the corresponding attribute of the
inheriting from other faces.
+++
** New X resource: "borderThickness".
** New X resource "borderThickness".
This controls the thickness of the external borders of the menu bars
and pop-up menus.
+++
** New X resource: "inputStyle".
** New X resource "inputStyle".
This controls the style of the pre-edit and status areas of X input
methods.
+++
** New X resources: "highlightForeground" and "highlightBackground".
** New X resources "highlightForeground" and "highlightBackground".
Only in the Lucid build, this controls colors used for highlighted
menu item widgets.
@ -1546,6 +1546,10 @@ environments are:
Coptic script and language environment
Mongolian-traditional script and language environment
Mongolian-cyrillic language environment
---
*** The "Oriya" language environment was renamed to "Odia".
This is to follow the change in the official name of the script. The
@ -1559,7 +1563,10 @@ Type 'C-u C-h t' to select it in case your language setup does not do
so automatically.
---
*** New Ukrainian translation of the Emacs Tutorial.
*** New Ukrainian translation of the Emacs tutorial.
---
*** New Farsi/Persian translation of the Emacs tutorial.
---
*** New default phonetic input method for the Tamil language environment.
@ -1587,7 +1594,8 @@ script.
---
*** New input method 'cyrillic-mongolian'.
This input method is for typing in the Mongolian language using the
Cyrillic script.
Cyrillic script. It is the default input method for the new
Mongolian-cyrillic language environment, see above.
* Changes in Specialized Modes and Packages in Emacs 29.1
@ -2664,7 +2672,7 @@ The old name was confusing, and is now an obsolete function alias.
** Images
+++
** New commands 'image-crop' and 'image-cut'.
*** New commands 'image-crop' and 'image-cut'.
These commands allow interactively cropping/cutting the image at
point. The commands are bound to keys 'i c' and 'i x' (respectively)
in the local keymap over images. They rely on external programs, by
@ -2672,7 +2680,7 @@ default "convert" from ImageMagick, to do the actual cropping/eliding
of the image file.
+++
*** New commands: 'image-flip-horizontally' and 'image-flip-vertically'.
*** New commands 'image-flip-horizontally' and 'image-flip-vertically'.
These commands horizontally and vertically flip the image under point,
and are bound to 'i h' and 'i v', respectively.

View file

@ -4,7 +4,7 @@ Emacs commands generally involve the CONTROL key (often labeled CTRL)
or the META key (usually labeled ALT). Rather than writing that
in full each time, we'll use the following abbreviations:
C-<chr> means hold the CONTROL key while typing the character <chr>
C-<chr> means hold the CONTROL key while typing the character <chr>.
Thus, C-f would be: hold the CONTROL key and type f.
M-<chr> means hold the META or ALT key down while typing <chr>.
If there is no META or ALT key, instead press and release the

1169
etc/tutorials/TUTORIAL.fa Normal file

File diff suppressed because it is too large Load diff

View file

@ -30,6 +30,10 @@ Maintainer: Rafael Sepúlveda <drs@gnulinux.org.mx>
Author: Protesilaos Stavrou <info@protesilaos.com>
Maintainer: Protesilaos Stavrou <info@protesilaos.com>
* TUTORIAL.fa:
Author: Mohsen BANAN <emacs@mohsen.1.banan.byname.net>
Maintainer: Mohsen BANAN <emacs@mohsen.1.banan.byname.net>
* TUTORIAL.fr:
Author: Éric Jacoboni <jaco@teaser.fr>
Maintainer: Éric Jacoboni <jaco@teaser.fr>

View file

@ -695,6 +695,16 @@ with L, LRE, or LRO Unicode bidi character type.")
(set-case-syntax c "_" tbl)
(setq c (1+ c)))
;; Traditional Mongolian
(setq c #x1800)
(while (<= c #x180A)
(set-case-syntax c "." tbl)
(setq c (1+ c)))
(setq c #x11660)
(while (<= c #x1166C)
(set-case-syntax c "." tbl)
(setq c (1+ c)))
;; Coptic
;; There's no Coptic category. However, Coptic letters that are
;; part of the Greek block above get the Greek category, and those

View file

@ -648,6 +648,8 @@
(nil . "MuleArabic-1")
(nil . "MuleArabic-2")
(nil . "ISO8859-6"))
(mongolian ,(font-spec :registry "iso10646-1"
:otf '(mong nil (init medi fina isol))))
(hebrew ,(font-spec :registry "iso10646-1" :script 'hebrew)
(nil . "ISO8859-8"))

View file

@ -256,6 +256,16 @@ Support for Russian using koi8-r and the russian-computer input method.")
\(The name Belarusian replaced Byelorussian in the early 1990s.)"))
'("Cyrillic"))
;; The Mongolian-traditional language environment is in misc-lang.el.
(set-language-info-alist
"Mongolian-cyrillic" '((coding-system utf-8)
(coding-priority utf-8)
(input-method . "cyrillic-mongolian")
(sample-text . "Mongolian (монгол хэл) Сайн байна уу?")
(documentation
. "Support for Mongolian language with Cyrillic alphabet."))
'("Cyrillic"))
(provide 'cyrillic)
;;; cyrillic.el ends here

View file

@ -74,10 +74,11 @@ and Italian.")))
(coding-priority utf-8 iso-8859-6 windows-1256)
(input-method . "farsi-transliterate-banan")
(sample-text . "Persian فارسی")
(documentation . "Bidirectional editing is supported.")))
(documentation . "Bidirectional editing is supported.")
(tutorial . "TUTORIAL.fa")))
(defcustom arabic-shaper-ZWNJ-handling nil
"How to handle ZWMJ in Arabic text rendering.
"How to handle ZWNJ (Zero-width Non-Joiner) in Arabic text rendering.
This variable controls the way to handle a glyph for ZWNJ
returned by the underling shaping engine.
@ -339,6 +340,30 @@ Coptic language using the Coptic script is supported in this
language environment."))
'("Misc"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Traditional Mongolian
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The Mongolian-cyrillic language environment is in cyrillic.el.
(set-language-info-alist
"Mongolian-traditional" '((coding-system utf-8)
(coding-priority utf-8)
; (input-method . "FIXME")
(sample-text . "Mongolian Traditional (ᠮᠣᠩᠭᠣᠯ ᠪᠢᠴᠢᠭ᠋) ᠰᠠᠶᠢᠨ ᠪᠠᠶᠢᠨ᠎ᠠ ᠤᠤ?")
(documentation
. "Support for Mongolian language with traditional script."))
'("Misc"))
;; Composition rules for Mongolian Traditional script.
(set-char-table-range
composition-function-table
'(#x1820 . #x18AF)
(list (vector "[\u200C\u200D][\u1820-\u18AF][\u200C\u200D]?"
1 'font-shape-gstring)
(vector "[\u1820-\u18AF][\u200C\u200D]" 0 'font-shape-gstring)
(vector "[\u1820-\u18AF\u202F\u180B-\u180F\u1807]+"
0 'font-shape-gstring)))
(provide 'misc-lang)
;;; misc-lang.el ends here

View file

@ -36,7 +36,7 @@
(require 'ob)
(declare-function orgtbl-to-tsv "org-table" (table params))
(declare-function R "ext:essd-r" (&optional start-args))
(declare-function run-ess-r "ext:ess-r-mode" (&optional start-args))
(declare-function inferior-ess-send-input "ext:ess-inf" ())
(declare-function ess-make-buffer-current "ext:ess-inf" ())
(declare-function ess-eval-buffer "ext:ess-inf" (vis))
@ -276,7 +276,8 @@ This function is called by `org-babel-execute-src-block'."
(when (get-buffer session)
;; Session buffer exists, but with dead process
(set-buffer session))
(require 'ess) (R)
(require 'ess-r-mode)
(set-buffer (run-ess-r))
(let ((R-proc (get-process (or ess-local-process-name
ess-current-process-name))))
(while (process-get R-proc 'callbacks)

View file

@ -69,7 +69,10 @@
:safe #'stringp)
(defvar org-babel-js-function-wrapper
"require('process').stdout.write(require('util').inspect(function(){%s}()));"
;; Note that newline after %s - it makes sure that closing
;; parenthesis are not shadowed if the last line of the body is a
;; line comment.
"require('process').stdout.write(require('util').inspect(function(){%s\n}()));"
"Javascript code to print value of body.")
(defun org-babel-execute:js (body params)

View file

@ -1232,7 +1232,9 @@ from the processor set in `org-cite-activate-processor'."
(let ((cite (org-with-point-at (match-beginning 0)
(org-element-citation-parser))))
(when cite
(funcall activate cite)
;; Do not alter match data as font-lock expects us to set it
;; appropriately.
(save-match-data (funcall activate cite))
;; Move after cite object and make sure to return
;; a non-nil value.
(goto-char (org-element-property :end cite)))))))

View file

@ -11,7 +11,7 @@ Inserted by installing Org mode or when a release is made."
(defun org-git-version ()
"The Git version of Org mode.
Inserted by installing Org or when a release is made."
(let ((org-git-version "release_9.6.4-2-g0f6ae7"))
(let ((org-git-version "release_9.6.4-9-g8eb209"))
org-git-version))
(provide 'org-version)

View file

@ -3483,13 +3483,17 @@ Make sure that you only list packages here which:
:group 'org-export-latex
:set 'org-set-packages-alist
:get 'org-get-packages-alist
:type '(repeat
(choice
(list :tag "options/package pair"
(string :tag "options")
(string :tag "package")
(boolean :tag "Snippet"))
(string :tag "A line of LaTeX"))))
:type
'(repeat
(choice
(list :tag "options/package pair"
(string :tag "options")
(string :tag "package")
(boolean :tag "snippet")
(choice
(const :tag "All compilers include this package" nil)
(repeat :tag "Only include from these compilers" string)))
(string :tag "A line of LaTeX"))))
(defgroup org-appearance nil
"Settings for Org mode appearance."
@ -8440,7 +8444,10 @@ a link."
(dolist (link (if (stringp links) (list links) links))
(search-forward link nil links-end)
(goto-char (match-beginning 0))
(org-open-at-point arg)))))))
;; When opening file link, current buffer may be
;; altered.
(save-current-buffer
(org-open-at-point arg))))))))
;; On a footnote reference or at definition's label.
((or (eq type 'footnote-reference)
(and (eq type 'footnote-definition)

View file

@ -1820,9 +1820,11 @@ INFO is a plist used as a communication channel. See
"Protect special chars, then wrap TEXT in \"\\texttt{}\"."
(format "\\texttt{%s}"
(replace-regexp-in-string
"--\\|[\\{}$%&_#~^]"
"--\\|<<\\|>>\\|[\\{}$%&_#~^]"
(lambda (m)
(cond ((equal m "--") "-{}-{}")
((equal m "<<") "<{}<{}")
((equal m ">>") ">{}>{}")
((equal m "\\") "\\textbackslash{}")
((equal m "~") "\\textasciitilde{}")
((equal m "^") "\\textasciicircum{}")

View file

@ -1571,15 +1571,14 @@ After the tab is created, the hooks in
;; Handle the case when it's called in the active minibuffer.
(when (minibuffer-selected-window)
(select-window (minibuffer-selected-window)))
;; Remove window parameters that can cause problems
;; with `delete-other-windows' and `split-window'.
(unless (eq tab-bar-new-tab-choice 'clone)
(set-window-parameter nil 'window-atom nil)
(set-window-parameter nil 'window-side nil))
(let ((ignore-window-parameters t))
(let ((ignore-window-parameters t)
(window--sides-inhibit-check t))
(if (eq tab-bar-new-tab-choice 'clone)
;; Create new unique windows with the same layout
(window-state-put (window-state-get))
;; Remove window parameters that can cause problems
;; with `delete-other-windows' and `split-window'.
(set-window-parameter nil 'window-atom nil)
(delete-other-windows)
(if (eq tab-bar-new-tab-choice 'window)
;; Create new unique window from remaining window

View file

@ -650,6 +650,7 @@ with some explanatory links."
(delete-region prop-start prop-end))))))
(defvar tutorial--starting-point)
(put 'tutorial--starting-point 'permanent-local t)
(defun tutorial--save-on-kill ()
"Query the user about saving the tutorial when killing Emacs."
(when (buffer-live-p tutorial--buffer)

View file

@ -6141,29 +6141,40 @@ second optional argument ABSOLUTE is non-nil, the value counts the lines
from the absolute start of the buffer, disregarding the narrowing. */)
(register Lisp_Object position, Lisp_Object absolute)
{
ptrdiff_t pos, start = BEGV_BYTE;
ptrdiff_t pos_byte, start_byte = BEGV_BYTE;
if (MARKERP (position))
pos = marker_position (position);
{
/* We don't trust the byte position if the marker's buffer is
not the current buffer. */
if (XMARKER (position)->buffer != current_buffer)
pos_byte = CHAR_TO_BYTE (marker_position (position));
else
pos_byte = marker_byte_position (position);
}
else if (NILP (position))
pos = PT;
pos_byte = PT_BYTE;
else
{
CHECK_FIXNUM (position);
pos = XFIXNUM (position);
ptrdiff_t pos = XFIXNUM (position);
/* Check that POSITION is valid. */
if (pos < BEG || pos > Z)
args_out_of_range_3 (position, make_int (BEG), make_int (Z));
pos_byte = CHAR_TO_BYTE (pos);
}
if (!NILP (absolute))
start = BEG_BYTE;
start_byte = BEG_BYTE;
else if (NILP (absolute))
pos_byte = clip_to_bounds (BEGV_BYTE, pos_byte, ZV_BYTE);
/* Check that POSITION is in the accessible range of the buffer, or,
if we're reporting absolute positions, in the buffer. */
if (NILP (absolute) && (pos < BEGV || pos > ZV))
args_out_of_range_3 (make_int (pos), make_int (BEGV), make_int (ZV));
else if (!NILP (absolute) && (pos < 1 || pos > Z))
args_out_of_range_3 (make_int (pos), make_int (1), make_int (Z));
/* Check that POSITION is valid. */
if (pos_byte < BEG_BYTE || pos_byte > Z_BYTE)
args_out_of_range_3 (make_int (BYTE_TO_CHAR (pos_byte)),
make_int (BEG), make_int (Z));
return make_int (count_lines (start, CHAR_TO_BYTE (pos)) + 1);
return make_int (count_lines (start_byte, pos_byte) + 1);
}

View file

@ -404,6 +404,9 @@ init_treesit_functions (void)
static Lisp_Object Vtreesit_str_libtree_sitter;
static Lisp_Object Vtreesit_str_tree_sitter;
#ifndef WINDOWSNT
static Lisp_Object Vtreesit_str_dot_0;
#endif
static Lisp_Object Vtreesit_str_dot;
static Lisp_Object Vtreesit_str_question_mark;
static Lisp_Object Vtreesit_str_star;
@ -543,8 +546,21 @@ treesit_load_language_push_for_each_suffix (Lisp_Object lib_base_name,
suffixes = Vdynamic_library_suffixes;
FOR_EACH_TAIL (suffixes)
*path_candidates = Fcons (concat2 (lib_base_name, XCAR (suffixes)),
*path_candidates);
{
Lisp_Object candidate1 = concat2 (lib_base_name, XCAR (suffixes));
#ifndef WINDOWSNT
/* On Posix hosts, support libraries named with ABI version
numbers. In the foreseeable future we only need to support
version 0.0. For more details, see
https://lists.gnu.org/archive/html/emacs-devel/2023-04/msg00386.html. */
Lisp_Object candidate2 = concat2 (candidate1, Vtreesit_str_dot_0);
Lisp_Object candidate3 = concat2 (candidate2, Vtreesit_str_dot_0);
*path_candidates = Fcons (candidate3, *path_candidates);
*path_candidates = Fcons (candidate2, *path_candidates);
#endif
*path_candidates = Fcons (candidate1, *path_candidates);
}
}
/* Load the dynamic library of LANGUAGE_SYMBOL and return the pointer
@ -3948,6 +3964,10 @@ the symbol of that THING. For example, (or block sexp). */);
Vtreesit_str_libtree_sitter = build_pure_c_string ("libtree-sitter-");
staticpro (&Vtreesit_str_tree_sitter);
Vtreesit_str_tree_sitter = build_pure_c_string ("tree-sitter-");
#ifndef WINDOWSNT
staticpro (&Vtreesit_str_dot_0);
Vtreesit_str_dot_0 = build_pure_c_string (".0");
#endif
staticpro (&Vtreesit_str_dot);
Vtreesit_str_dot = build_pure_c_string (".");
staticpro (&Vtreesit_str_question_mark);