commit dde576d731cb28846300391cec6ea22c6c96c83f (HEAD, refs/remotes/origin/master) Merge: 1c5140e813d c46e93b1f50 Author: Stefan Kangas Date: Thu Apr 27 06:30:14 2023 +0200 ; Merge from origin/emacs-29 The following commit was skipped: c46e93b1f50 Explain ERC 5.5 regressions in new version 5.5.0.29.1 commit 1c5140e813d852d903aec531c444c7e18647243e Merge: 14d34312536 af43f0a2954 Author: Stefan Kangas Date: Thu Apr 27 06:30:14 2023 +0200 Merge from origin/emacs-29 af43f0a2954 * doc/misc/erc.texi: Elaborate on upgrading via ELPA. 10948948c12 Improve outline-default-state docstring b5ace2eed80 Document problems with /bin/sh on Solaris 10 7b2ad8f199e ; Add missing <> line to ... commit 14d34312536e2b679cac39a06d58cd9bb85bc4bc Author: Eli Zaretskii Date: Wed Apr 26 19:25:23 2023 +0300 ; * lisp/help.el (describe-bindings-outline-rules): Fix :type tags. diff --git a/lisp/help.el b/lisp/help.el index 4c5382ff285..6f55136049b 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -737,7 +737,7 @@ describe-bindings-outline-rules (set :tag "Show section unless" (cons :tag "Heading matches regexp" (const match-regexp) string) - (cons :tag "Custom function returns non-nil" + (cons :tag "Custom function to show/hide sections" (const custom-function) function))) :group 'help :version "30.1") commit 022f50ebe616e04bb34487a26d529ca08954d287 Author: Michael Albinus Date: Wed Apr 26 18:06:39 2023 +0200 New command 'tramp-cleanup-some-buffers' * doc/misc/tramp.texi (Cleanup remote connections): Document tramp-cleanup-some-buffers and tramp-cleanup-some-buffers-hook. * etc/NEWS: New command 'tramp-cleanup-some-buffers'. * lisp/net/tramp.el (tramp-handle-make-process): * lisp/net/tramp-adb.el (tramp-adb-handle-make-process): * lisp/net/tramp-sh.el (tramp-sh-handle-make-process): Use `tramp-taint-remote-process-buffer'. * lisp/net/tramp.el (tramp-post-process-creation): New defun. (tramp-handle-make-process): * lisp/net/tramp-adb.el (tramp-adb-maybe-open-connection): * lisp/net/tramp-crypt.el (tramp-crypt-maybe-open-connection): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-notify-add-watch) (tramp-gvfs-maybe-open-connection): * lisp/net/tramp-rclone.el (tramp-rclone-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-file-notify-add-watch) (tramp-maybe-open-connection): * lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory) (tramp-smb-handle-file-acl, tramp-smb-handle-set-file-acl) (tramp-smb-maybe-open-connection): * lisp/net/tramp-sshfs.el (tramp-sshfs-maybe-open-connection): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-maybe-open-connection) (tramp-sudoedit-send-command): Use it. * lisp/net/tramp-cmds.el (tramp-tainted-remote-process-buffers): New defvar. (tramp-cleanup-dired-buffer-p) (tramp-delete-tainted-remote-process-buffer-function) (kill-buffer-hook, tramp-cleanup-remote-process-p) (tramp-cleanup-some-buffers): New defuns. (tramp-cleanup-some-buffers-hook): New defcustom. Add `buffer-file-name', `tramp-cleanup-dired-buffer-p' and `tramp-cleanup-remote-process-p' to the hook. (kill-buffer-hook): Add `tramp-delete-tainted-remote-process-buffer-function'. (tramp-cleanup-all-buffers): Rework. * lisp/net/tramp-compat.el (tramp-compat-always): New defalias. * test/lisp/net/tramp-tests.el (tramp--test-always): Delete. (tramp-test10-write-region, tramp-test21-file-links) (tramp--test-deftest-direct-async-process) (tramp-test37-make-auto-save-file-name) (tramp-test38-find-backup-file-name) (tramp-test39-make-lock-file-name) (tramp-test39-detect-external-change): Use `tramp-compat-always'. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 247d718b59a..43792c4e9e3 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -4377,7 +4377,6 @@ Cleanup remote connections Flushes all active remote connection objects, the same as in @code{tramp-cleanup-connection}. This command removes also ad-hoc proxy definitions (@pxref{Ad-hoc multi-hops}). - @end deffn @deffn Command tramp-cleanup-all-buffers @@ -4386,6 +4385,20 @@ Cleanup remote connections killing all buffers related to remote connections. @end deffn +@deffn Command tramp-cleanup-some-buffers +Similar to @code{tramp-cleanup-all-buffers}, where all remote +connections and ad-hoc proxy definition are cleaned up. However, +additional buffers are killed only if one of the functions in +@code{tramp-cleanup-some-buffers-hook} returns @code{t}. +@end deffn + +@defopt tramp-cleanup-some-buffers-hook +The functions in this hook determine, whether a remote buffer is +killed when @code{tramp-cleanup-some-buffers} is called. Per default, +remote buffers which are linked to a remote file, remote @code{dired} +buffers, and buffers related to a remote process are cleaned up. +@end defopt + @node Renaming remote files @section Renaming remote files diff --git a/etc/NEWS b/etc/NEWS index d39343b8bd4..87d312596cd 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -222,6 +222,11 @@ The latter suppresses also "ControlMaster" settings in the user's "~/.ssh/config" file, or connection share configuration in PuTTY sessions, respectively. ++++ +*** New command 'tramp-cleanup-some-buffers'. +It allows to kill only selected remote buffers, controlled by user +option 'tramp-cleanup-some-buffers-hook'. + ** EWW +++ @@ -239,7 +244,7 @@ for tab completion. +++ *** 'eww' URL and keyword prompt now completes suggested URIs and bookmarks. The interactive minibuffer prompt when invoking 'eww' now provides -completions from 'eww-suggest-uris'. 'eww-suggest-uris' now includes +completions from 'eww-suggest-uris'. 'eww-suggest-uris' now includes bookmark URIs. ** go-ts-mode diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 3f3fb1ea6b3..5a8044f8a53 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -1000,6 +1000,7 @@ tramp-adb-handle-make-process ;; deleted. (when (bufferp stderr) (ignore-errors + (tramp-taint-remote-process-buffer stderr) (with-current-buffer stderr (insert-file-contents-literally remote-tmpstderr 'visit))) @@ -1237,8 +1238,6 @@ tramp-adb-maybe-open-connection tramp-adb-program args))) (prompt (md5 (concat (prin1-to-string process-environment) (current-time-string))))) - (tramp-message - vec 6 "%s" (string-join (process-command p) " ")) ;; Wait for initial prompt. On some devices, it needs an ;; initial RET, in order to get it. (sleep-for 0.1) @@ -1247,11 +1246,9 @@ tramp-adb-maybe-open-connection (unless (process-live-p p) (tramp-error vec 'file-error "Terminated!")) - ;; Set sentinel and query flag. Initialize variables. + ;; Set sentinel. Initialize variables. (set-process-sentinel p #'tramp-process-sentinel) - (process-put p 'tramp-vector vec) - (process-put p 'adjust-window-size-function #'ignore) - (set-process-query-on-exit-flag p nil) + (tramp-post-process-creation p vec) ;; Set connection-local variables. (tramp-set-connection-local-variables vec) diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index 1a9d8003530..07f449a3a2e 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -207,17 +207,76 @@ tramp-cleanup-all-connections ;; The end. (run-hooks 'tramp-cleanup-all-connections-hook)) +(defcustom tramp-cleanup-some-buffers-hook nil + "Hook for `tramp-cleanup-some-buffers'. +The functions determine which buffers shall be killed. This +happens when at least one of the functions returns non-nil. The +functions are called with `current-buffer' set." + :group 'tramp + :version "30.1" + :type 'hook) + +(add-hook 'tramp-cleanup-some-buffers-hook + #'buffer-file-name) + +(defun tramp-cleanup-dired-buffer-p () + "Return t if current buffer runs `dired-mode'." + (derived-mode-p 'dired-mode)) + +(add-hook 'tramp-cleanup-some-buffers-hook + #'tramp-cleanup-dired-buffer-p) + +(defvar tramp-tainted-remote-process-buffers nil + "List of process buffers to be cleaned up.") + +(defun tramp-delete-tainted-remote-process-buffer-function () + "Delete current buffer from `tramp-tainted-remote-process-buffers'." + (setq tramp-tainted-remote-process-buffers + (delete (current-buffer) tramp-tainted-remote-process-buffers))) + ;;;###tramp-autoload -(defun tramp-cleanup-all-buffers () - "Kill all remote buffers." +(defun tramp-taint-remote-process-buffer (buffer) + "Mark buffer as related to remote processes." + (add-to-list 'tramp-tainted-remote-process-buffers buffer)) + +(add-hook 'kill-buffer-hook + #'tramp-delete-tainted-remote-process-buffer-function) +(add-hook 'tramp-unload-hook + (lambda () + (remove-hook 'kill-buffer-hook + #'tramp-delete-tainted-remote-process-buffer-function))) + +(defun tramp-cleanup-remote-process-p () + "Return t if current buffer belongs to a remote process." + (memq (current-buffer) tramp-tainted-remote-process-buffers)) + +(add-hook 'tramp-cleanup-some-buffers-hook + #'tramp-cleanup-remote-process-p) + +;;;###tramp-autoload +(defun tramp-cleanup-some-buffers () + "Kill some remote buffers. +A buffer is killed when it has a remote `default-directory', and +one of the functions in `tramp-cleanup-some-buffers-hook' returns +non-nil." (interactive) ;; Remove all Tramp related connections. (tramp-cleanup-all-connections) - ;; Remove all buffers with a remote default-directory. + ;; Remove all buffers with a remote default-directory which fit the hook. (dolist (name (tramp-list-remote-buffers)) - (when (bufferp (get-buffer name)) (kill-buffer name)))) + (and (buffer-live-p (get-buffer name)) + (with-current-buffer (get-buffer name) + (run-hook-with-args-until-success 'tramp-cleanup-some-buffers-hook)) + (kill-buffer name)))) + +;;;###tramp-autoload +(defun tramp-cleanup-all-buffers () + "Kill all remote buffers." + (interactive) + (let ((tramp-cleanup-some-buffers-hook '(tramp-compat-always))) + (tramp-cleanup-some-buffers))) (defcustom tramp-default-rename-alist nil "Default target for renaming remote buffer file names. diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 420d6cadb9c..150c3fbf187 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -219,6 +219,16 @@ 'tramp-compat-length= (lambda (sequence length) (= (length sequence) length)))) +;; `always' is introduced with Emacs 28.1. +(defalias 'tramp-compat-always + (if (fboundp 'always) + #'always + (lambda (&rest _arguments) + "Do nothing and return t. +This function accepts any number of ARGUMENTS, but ignores them. +Also see `ignore'." + t))) + ;; `permission-denied' is introduced in Emacs 29.1. (defconst tramp-permission-denied (if (get 'permission-denied 'error-conditions) 'permission-denied 'file-error) diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el index 4d15695ccbf..ea27c704587 100644 --- a/lisp/net/tramp-crypt.el +++ b/lisp/net/tramp-crypt.el @@ -316,8 +316,7 @@ tramp-crypt-maybe-open-connection :name (tramp-get-connection-name vec) :buffer (tramp-get-connection-buffer vec) :server t :host 'local :service t :noquery t))) - (process-put p 'tramp-vector vec) - (set-process-query-on-exit-flag p nil))) + (tramp-post-process-creation p vec))) ;; The following operations must be performed without ;; `tramp-crypt-file-name-handler'. diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index d44fd55b225..ad7b1ff054c 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1498,15 +1498,11 @@ tramp-gvfs-handle-file-notify-add-watch (if (not (processp p)) (tramp-error v 'file-notify-error "Monitoring not supported for `%s'" file-name) - (tramp-message - v 6 "Run `%s', %S" (string-join (process-command p) " ") p) - (process-put p 'tramp-vector v) (process-put p 'tramp-events events) (process-put p 'tramp-watch-name localname) - (process-put p 'adjust-window-size-function #'ignore) - (set-process-query-on-exit-flag p nil) (set-process-filter p #'tramp-gvfs-monitor-process-filter) (set-process-sentinel p #'tramp-file-notify-process-sentinel) + (tramp-post-process-creation p v) ;; There might be an error if the monitor is not supported. ;; Give the filter a chance to read the output. (while (tramp-accept-process-output p)) @@ -2204,8 +2200,7 @@ tramp-gvfs-maybe-open-connection :name (tramp-get-connection-name vec) :buffer (tramp-get-connection-buffer vec) :server t :host 'local :service t :noquery t))) - (process-put p 'tramp-vector vec) - (set-process-query-on-exit-flag p nil) + (tramp-post-process-creation p vec) ;; Set connection-local variables. (tramp-set-connection-local-variables vec))) diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el index ec6a1da684f..74295de4c29 100644 --- a/lisp/net/tramp-rclone.el +++ b/lisp/net/tramp-rclone.el @@ -371,8 +371,7 @@ tramp-rclone-maybe-open-connection :name (tramp-get-connection-name vec) :buffer (tramp-get-connection-buffer vec) :server t :host 'local :service t :noquery t))) - (process-put p 'tramp-vector vec) - (set-process-query-on-exit-flag p nil) + (tramp-post-process-creation p vec) ;; Set connection-local variables. (tramp-set-connection-local-variables vec))) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 2df3006c1d9..0369e19378c 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2426,14 +2426,11 @@ tramp-do-copy-or-rename-file-out-of-band (tramp-get-connection-name v) (tramp-get-connection-buffer v) copy-program copy-args))) - (tramp-message v 6 "%s" (string-join (process-command p) " ")) - (process-put p 'tramp-vector v) ;; This is neded for ssh or PuTTY based processes, and ;; only if the respective options are set. Perhaps, ;; the setting could be more fine-grained. ;; (process-put p 'tramp-shared-socket t) - (process-put p 'adjust-window-size-function #'ignore) - (set-process-query-on-exit-flag p nil) + (tramp-post-process-creation p v) ;; We must adapt `tramp-local-end-of-line' for sending ;; the password. Also, we indicate that perhaps @@ -2934,6 +2931,7 @@ tramp-sh-handle-make-process v 'file-error "Stderr buffer `%s' not supported" stderr)) (with-current-buffer stderr (setq buffer-read-only nil)) + (tramp-taint-remote-process-buffer stderr) ;; Create named pipe. (tramp-send-command v (format (tramp-get-remote-mknod-or-mkfifo v) tmpstderr)) @@ -3759,8 +3757,6 @@ tramp-sh-handle-file-notify-add-watch v 'file-notify-error "`%s' failed to start on remote host" (string-join sequence " ")) - (tramp-message v 6 "Run `%s', %S" (string-join sequence " ") p) - (process-put p 'tramp-vector v) ;; This is neded for ssh or PuTTY based processes, and only if ;; the respective options are set. Perhaps, the setting could ;; be more fine-grained. @@ -3768,9 +3764,9 @@ tramp-sh-handle-file-notify-add-watch ;; Needed for process filter. (process-put p 'tramp-events events) (process-put p 'tramp-watch-name localname) - (set-process-query-on-exit-flag p nil) (set-process-filter p filter) (set-process-sentinel p #'tramp-file-notify-process-sentinel) + (tramp-post-process-creation p v) ;; There might be an error if the monitor is not supported. ;; Give the filter a chance to read the output. (while (tramp-accept-process-output p)) @@ -5130,19 +5126,15 @@ tramp-maybe-open-connection (and tramp-encoding-command-interactive (list tramp-encoding-command-interactive))))))) - ;; Set sentinel and query flag. Initialize variables. - (set-process-sentinel p #'tramp-process-sentinel) - (process-put p 'tramp-vector vec) ;; This is neded for ssh or PuTTY based processes, and ;; only if the respective options are set. Perhaps, ;; the setting could be more fine-grained. ;; (process-put p 'tramp-shared-socket t) - (process-put p 'adjust-window-size-function #'ignore) - (set-process-query-on-exit-flag p nil) + ;; Set sentinel. Initialize variables. + (set-process-sentinel p #'tramp-process-sentinel) + (tramp-post-process-creation p vec) (setq tramp-current-connection (cons vec (current-time))) - (tramp-message vec 6 "%s" (string-join (process-command p) " ")) - ;; Set connection-local variables. (tramp-set-connection-local-variables vec) diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 13d5e17a9ff..9a24403bb18 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -556,13 +556,7 @@ tramp-smb-handle-copy-directory (tramp-get-connection-name v) (tramp-get-connection-buffer v) tramp-smb-program args))) - - (tramp-message - v 6 "%s" (string-join (process-command p) " ")) - (process-put p 'tramp-vector v) - (process-put - p 'adjust-window-size-function #'ignore) - (set-process-query-on-exit-flag p nil) + (tramp-post-process-creation p v) (tramp-process-actions p v nil tramp-smb-actions-with-tar) @@ -816,12 +810,7 @@ tramp-smb-handle-file-acl (tramp-get-connection-name v) (tramp-get-connection-buffer v) tramp-smb-acl-program args))) - - (tramp-message - v 6 "%s" (string-join (process-command p) " ")) - (process-put p 'tramp-vector v) - (process-put p 'adjust-window-size-function #'ignore) - (set-process-query-on-exit-flag p nil) + (tramp-post-process-creation p v) (tramp-process-actions p v nil tramp-smb-actions-get-acl) (when (> (point-max) (point-min)) (substring-no-properties (buffer-string)))))))))))) @@ -1416,12 +1405,7 @@ tramp-smb-handle-set-file-acl (tramp-get-connection-name v) (tramp-get-connection-buffer v) tramp-smb-acl-program args))) - - (tramp-message - v 6 "%s" (string-join (process-command p) " ")) - (process-put p 'tramp-vector v) - (process-put p 'adjust-window-size-function #'ignore) - (set-process-query-on-exit-flag p nil) + (tramp-post-process-creation p v) (tramp-process-actions p v nil tramp-smb-actions-set-acl) ;; This is meant for traces, and returning from ;; the function. No error is propagated outside, @@ -1965,11 +1949,7 @@ tramp-smb-maybe-open-connection (if argument tramp-smb-winexe-program tramp-smb-program) args)))) - - (tramp-message vec 6 "%s" (string-join (process-command p) " ")) - (process-put p 'tramp-vector vec) - (process-put p 'adjust-window-size-function #'ignore) - (set-process-query-on-exit-flag p nil) + (tramp-post-process-creation p vec) ;; Set connection-local variables. (tramp-set-connection-local-variables vec) diff --git a/lisp/net/tramp-sshfs.el b/lisp/net/tramp-sshfs.el index a4f6246ec23..fe126361ac3 100644 --- a/lisp/net/tramp-sshfs.el +++ b/lisp/net/tramp-sshfs.el @@ -399,8 +399,7 @@ tramp-sshfs-maybe-open-connection :name (tramp-get-connection-name vec) :buffer (tramp-get-connection-buffer vec) :server t :host 'local :service t :noquery t))) - (process-put p 'tramp-vector vec) - (set-process-query-on-exit-flag p nil) + (tramp-post-process-creation p vec) ;; Set connection-local variables. (tramp-set-connection-local-variables vec))) diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el index defd4f430bc..941c1e8dd24 100644 --- a/lisp/net/tramp-sudoedit.el +++ b/lisp/net/tramp-sudoedit.el @@ -720,8 +720,7 @@ tramp-sudoedit-maybe-open-connection :name (tramp-get-connection-name vec) :buffer (tramp-get-connection-buffer vec) :server t :host 'local :service t :noquery t))) - (process-put p 'tramp-vector vec) - (set-process-query-on-exit-flag p nil) + (tramp-post-process-creation p vec) ;; Set connection-local variables. (tramp-set-connection-local-variables vec) @@ -755,12 +754,9 @@ tramp-sudoedit-send-command (tramp-cache-read-persistent-data t) ;; We do not want to save the password. auth-source-save-behavior) - (tramp-message vec 6 "%s" (string-join (process-command p) " ")) ;; Avoid process status message in output buffer. (set-process-sentinel p #'ignore) - (process-put p 'tramp-vector vec) - (process-put p 'adjust-window-size-function #'ignore) - (set-process-query-on-exit-flag p nil) + (tramp-post-process-creation p vec) (tramp-set-connection-property p "password-vector" tramp-sudoedit-null-hop) (tramp-process-actions p vec nil tramp-sudoedit-sudo-actions) (tramp-message vec 6 "%s\n%s" (process-exit-status p) (buffer-string)) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 3420bb76d14..81473404f0c 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -4941,6 +4941,16 @@ tramp-expand-args (unless (member "" x) x)) args)))) +(defun tramp-post-process-creation (proc vec) + "Apply actions after creation of process PROC." + (process-put proc 'tramp-vector vec) + (process-put proc 'adjust-window-size-function #'ignore) + (set-process-query-on-exit-flag proc nil) + (tramp-taint-remote-process-buffer (process-buffer proc)) + (tramp-message vec 6 "%s" (string-join (process-command proc) " "))) + +(put #'tramp-post-process-creation 'tramp-suppress-trace t) + (defun tramp-direct-async-process-p (&rest args) "Whether direct async `make-process' can be called." (let ((v (tramp-dissect-file-name default-directory)) @@ -5090,15 +5100,19 @@ tramp-handle-make-process ;; t. See Bug#51177. (when filter (set-process-filter p filter)) - (process-put p 'tramp-vector v) + (tramp-post-process-creation p v) + ;; Query flag is overwritten in `tramp-post-process-creation', + ;; so we reset it. + (set-process-query-on-exit-flag p (null noquery)) ;; This is neded for ssh or PuTTY based processes, and ;; only if the respective options are set. Perhaps, the ;; setting could be more fine-grained. ;; (process-put p 'tramp-shared-socket t) (process-put p 'remote-command orig-command) (tramp-set-connection-property p "remote-command" orig-command) + (when (bufferp stderr) + (tramp-taint-remote-process-buffer stderr)) - (tramp-message v 6 "%s" (string-join (process-command p) " ")) p)))))) (defun tramp-handle-make-symbolic-link diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 9bca6a03754..5fde783087e 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -297,16 +297,6 @@ tramp--test-print-duration (tramp--test-message "%s %f sec" ,message (float-time (time-subtract nil start)))))) -;; `always' is introduced with Emacs 28.1. -(defalias 'tramp--test-always - (if (fboundp 'always) - #'always - (lambda (&rest _arguments) - "Do nothing and return t. -This function accepts any number of ARGUMENTS, but ignores them. -Also see `ignore'." - t))) - (ert-deftest tramp-test00-availability () "Test availability of Tramp functions." :expected-result (if (tramp--test-enabled) :passed :failed) @@ -2563,9 +2553,9 @@ tramp-test10-write-region ;; `tramp-test39-make-lock-file-name'. ;; Do not overwrite if excluded. - (cl-letf (((symbol-function #'y-or-n-p) #'tramp--test-always) + (cl-letf (((symbol-function #'y-or-n-p) #'tramp-compat-always) ;; Ange-FTP. - ((symbol-function 'yes-or-no-p) #'tramp--test-always)) + ((symbol-function 'yes-or-no-p) #'tramp-compat-always)) (write-region "foo" nil tmp-name nil nil nil 'mustbenew)) (should-error (cl-letf (((symbol-function #'y-or-n-p) #'ignore) @@ -3991,7 +3981,7 @@ tramp-test21-file-links (should-error (make-symbolic-link tmp-name1 tmp-name2 0) :type 'file-already-exists))) - (cl-letf (((symbol-function #'yes-or-no-p) #'tramp--test-always)) + (cl-letf (((symbol-function #'yes-or-no-p) #'tramp-compat-always)) (make-symbolic-link tmp-name1 tmp-name2 0) (should (string-equal @@ -4071,7 +4061,7 @@ tramp-test21-file-links (should-error (add-name-to-file tmp-name1 tmp-name2 0) :type 'file-already-exists)) - (cl-letf (((symbol-function #'yes-or-no-p) #'tramp--test-always)) + (cl-letf (((symbol-function #'yes-or-no-p) #'tramp-compat-always)) (add-name-to-file tmp-name1 tmp-name2 0) (should (file-regular-p tmp-name2))) (add-name-to-file tmp-name1 tmp-name2 'ok-if-already-exists) @@ -5202,7 +5192,7 @@ tramp--test-deftest-direct-async-process ;; `file-truename' does it by side-effect. Suppress ;; `tramp--test-enabled', in order to keep the connection. ;; Suppress "Process ... finished" messages. - (cl-letf (((symbol-function #'tramp--test-enabled) #'tramp--test-always) + (cl-letf (((symbol-function #'tramp--test-enabled) #'tramp-compat-always) ((symbol-function #'internal-default-process-sentinel) #'ignore)) (file-truename ert-remote-temporary-file-directory) @@ -6410,7 +6400,7 @@ tramp-test37-make-auto-save-file-name (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password) (cl-letf (((symbol-function #'yes-or-no-p) - #'tramp--test-always)) + #'tramp-compat-always)) (should (stringp (make-auto-save-file-name)))))))) ;; Cleanup. @@ -6556,8 +6546,7 @@ tramp-test38-find-backup-file-name :type 'file-error)) (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password) - (cl-letf (((symbol-function #'yes-or-no-p) - #'tramp--test-always)) + (cl-letf (((symbol-function #'yes-or-no-p) #'tramp-compat-always)) (should (stringp (car (find-backup-file-name tmp-name1))))))) ;; Cleanup. @@ -6712,8 +6701,7 @@ tramp-test39-make-lock-file-name :type 'file-error)) (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password) - (cl-letf (((symbol-function #'yes-or-no-p) - #'tramp--test-always)) + (cl-letf (((symbol-function #'yes-or-no-p) #'tramp-compat-always)) (write-region "foo" nil tmp-name1)))) ;; Cleanup. @@ -6783,7 +6771,8 @@ tramp-test39-detect-external-change (should (file-locked-p tmp-name))))) ;; `save-buffer' removes the file lock. - (cl-letf (((symbol-function 'yes-or-no-p) #'tramp--test-always) + (cl-letf (((symbol-function 'yes-or-no-p) + #'tramp-compat-always) ((symbol-function 'read-char-choice) (lambda (&rest _) ?y))) (should (buffer-modified-p)) commit c46e93b1f50c9a6f7143f347d96a6385bcdf3a05 (refs/remotes/origin/emacs-29) Author: F. Jason Park Date: Fri Apr 21 07:39:05 2023 -0700 Explain ERC 5.5 regressions in new version 5.5.0.29.1 * doc/misc/erc.texi: Bump version to 5.5.0.29.1. * etc/ERC-NEWS: Don't hype bugged option `erc-reconnect-display'. * lisp/erc/erc-dcc.el (erc-dcc-do-GET-command): Add comment explaining parsing bug in ERC 5.5 (bug#62444). * lisp/erc/erc-networks.el (erc-networks-on-MOTD-end): Mention known /MOTD bug in error notice so people don't waste energy reporting it (bug#62151). * lisp/erc/erc.el: Change Version header to 5.5.0.29.1. Don't bother updating the `customize-package-emacs-version-alist' entry because no option defaults are affected. (erc-version): Change version to 5.5.0.29.1. (erc-reconnect-display, erc-query-on-unjoined-chan-privmsg): Add warning to doc strings and `custom-set' functions. It's believed that these bugs degrade the user experience significantly enough to warrant such mentions (bug#62833). (erc-query): Fix erroneous redirect string in deprecation spec. Do not merge to master. diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index ad30546c9d5..7f26b9ed181 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi @@ -2,7 +2,7 @@ @c %**start of header @setfilename ../../info/erc.info @settitle ERC Manual -@set ERCVER 5.5 +@set ERCVER 5.5.0.29.1 @set ERCDIST as distributed with Emacs @value{EMACSVER} @include docstyle.texi @syncodeindex fn cp diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index 434bfab94e9..9672a86345b 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -80,9 +80,7 @@ can now opt for an improved 'window-noselect' instead. It still offers the same pronounced visual cue when connecting and joining but now avoids any hijacking of the active window as well. -Beyond this, additional flexibility is now available for controlling -the behavior of newly created target buffers during reconnection. -See the option 'erc-reconnect-display' for more. +(Edited for ERC 5.5.0.29.1 in Emacs 29.1.) ** Improved handling of multiline prompt input. This means better detection and handling of intervening and trailing diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index 4c557e0e0f9..8fc30fddb46 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el @@ -508,7 +508,11 @@ erc-dcc-do-GET-command "Do a DCC GET command. NICK is the person who is sending the file. FILE is the filename. If FILE is split into multiple arguments, re-join the arguments, separated by a space. -PROC is the server process." +PROC is the server process. + +WARNING: the /DCC GET command is bugged in ERC 5.5 (Emacs 29). +File names containing the string \" -\" are not honored. If you +need a fix immediately, see Info node `(erc) Upgrading'." (let* ((args (seq-group-by (lambda (s) (eq ?- (aref s 0))) (cons nick file))) (flags (prog1 (cdr (assq t args)) (setq args (cdr (assq nil args)) diff --git a/lisp/erc/erc-networks.el b/lisp/erc/erc-networks.el index 95fd8990c99..e2ba59a3c47 100644 --- a/lisp/erc/erc-networks.el +++ b/lisp/erc/erc-networks.el @@ -1494,8 +1494,11 @@ erc-networks-on-MOTD-end (memq (erc--target-symbol erc--target) erc-networks--bouncer-targets))) proc) - (let ((m (concat "Unexpected state detected. Please report via " - (substitute-command-keys "\\[erc-bug]") "."))) + (let ((m (concat "Unexpected state detected. If you've just issued an" + " /MOTD, please know that the command is bugged in ERC" + " 5.5 (Emacs 29) but will be fixed in the next release." + " Otherwise, please report this occurrence via" + (substitute-command-keys " \\[erc-bug].")))) (erc-display-error-notice parsed m)))) ;; For now, retain compatibility with erc-server-NNN-functions. diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 69bdb5d71b1..c7e1645ec26 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -12,7 +12,7 @@ ;; David Edmondson (dme@dme.org) ;; Michael Olson (mwolson@gnu.org) ;; Kelvin White (kwhite@gnu.org) -;; Version: 5.5 +;; Version: 5.5.0.29.1 ;; Package-Requires: ((emacs "27.1") (compat "29.1.3.4")) ;; Keywords: IRC, chat, client, Internet ;; URL: https://www.gnu.org/software/emacs/erc.html @@ -71,7 +71,7 @@ (require 'iso8601) (eval-when-compile (require 'subr-x) (require 'url-parse)) -(defconst erc-version "5.5" +(defconst erc-version "5.5.0.29.1" "This version of ERC.") (defvar erc-official-location @@ -1495,9 +1495,19 @@ erc-reconnect-display This only affects automatic reconnections and is ignored when issuing a /reconnect command or reinvoking `erc-tls' with the same args (assuming success, of course). See `erc-join-buffer' -for a description of possible values." +for a description of possible values. + +WARNING: this option is bugged in ERC 5.5 (Emacs 29). Setting it +to anything other than nil results in the chosen value being +permanently adopted by all other buffer-display options for the +remainder of the ERC session. If you need this fixed +immediately, see Info node `(erc) Upgrading'." :package-version '(ERC . "5.5") :group 'erc-buffers + :set (lambda (sym val) + (when (set sym val) + (lwarn 'erc :warning "Setting `%s' to `%s' is currently bugged; %s" + sym val "see doc string for more information."))) :type '(choice (const :tag "Use value of `erc-join-buffer'" nil) (const :tag "Split window and select" window) (const :tag "Split window, don't select" window-noselect) @@ -4501,7 +4511,7 @@ erc-query "Open a query buffer on TARGET using SERVER-BUFFER. To change how this query window is displayed, use `let' to bind `erc-join-buffer' before calling this." - (declare (obsolete "bind `erc-cmd-query' and call `erc-cmd-QUERY'" "29.1")) + (declare (obsolete "call `erc-open' in a live server buffer" "29.1")) (unless (buffer-live-p server-buffer) (error "Couldn't switch to server buffer")) (with-current-buffer server-buffer @@ -4524,16 +4534,29 @@ erc-auto-query (const :tag "Use current buffer" buffer) (const :tag "Use current buffer" t))) -;; FIXME either retire this or put it to use after determining how -;; it's meant to work. Clearly, the doc string does not describe -;; current behavior. It's currently only used by the obsolete -;; function `erc-auto-query'. (defcustom erc-query-on-unjoined-chan-privmsg t "If non-nil create query buffer on receiving any PRIVMSG at all. This includes PRIVMSGs directed to channels. If you are using an IRC bouncer, such as dircproxy, to keep a log of channels when you are -disconnected, you should set this option to t." +disconnected, you should set this option to t. + +WARNING: this option was mistakenly removed from ERC 5.5's client +code, so setting it to nil is temporarily ineffective. That is, +ERC now always creates a buffer when receiving a PRIVMSG directed +at a channel for which none exists. And despite this option's +name and its doc string's use of \"query\" to refer to any +conversation with a target, it did not previously allow for +opting out of buffer creation for direct messages (at least not +in Emacs 27 and 28). However, such behavior has always been and +will continue to be available by setting `erc-auto-query' to nil. +If needing to restore pre-5.5 functionality immediately, see Info +node `(erc) Upgrading'." :group 'erc-query + :set (lambda (sym val) + (unless (set sym val) + (lwarn 'erc :warning + "Setting `%s' to nil is currently ineffective; %s" + sym "see doc string for details."))) :type 'boolean) (defcustom erc-format-query-as-channel-p t commit af43f0a2954f4a4e735a6e3d159edc3392eaeb6c Author: F. Jason Park Date: Fri Apr 21 07:39:05 2023 -0700 * doc/misc/erc.texi: Elaborate on upgrading via ELPA. diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index b80affbc954..ad30546c9d5 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi @@ -1477,10 +1477,30 @@ Getting Help and Reporting Bugs same network, for more involved questions. @item +@anchor{Upgrading} You can check GNU ELPA between Emacs releases to see if a newer version is available that might contain a fix for your issue: @uref{https://elpa.gnu.org/packages/erc.html}. +To upgrade, run @kbd{M-x list-packages @key{RET}}. In the +@file{*Packages*} (@code{package-menu-mode}) buffer, click the +@samp{erc} package link for the desired version. If unsure, or if the +version column is too narrow to tell, try the bottom-most candidate. +In the resulting @code{help-mode} buffer, confirm the version and +click @samp{Install}. Make sure to restart Emacs before reconnecting +to IRC, and don't forget that you can roll back to the previous +version by running @kbd{M-x package-delete @key{RET}}. +@xref{Packages,,,emacs, the Emacs manual} for more information. + +In the rare instance you need an emergency fix or have volunteered to +test an edge feature between ERC releases, you can try adding +@samp{("devel" . "https://elpa.gnu.org/devel/")} to +@code{package-archives} prior to performing the steps above. For +this, you'll want to instead select a ``snapshot'' version from the +menu. Please be aware that when going this route, the latest changes +may not yet be available and you run the risk of incurring other bugs +and encountering unstable features. + @item To report a bug in ERC, use @kbd{M-x erc-bug}. commit 10948948c12ec8698616c09f96225ee3b4fc32a5 Author: Robert Pluim Date: Wed Apr 26 12:27:30 2023 +0200 Improve outline-default-state docstring * lisp/outline.el (outline-default-state): Explain which functions are available to affect heading visibility. diff --git a/lisp/outline.el b/lisp/outline.el index 0e90c59c285..97a51c9b92a 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -1500,8 +1500,10 @@ outline-default-state visibility of the subtree at that level. If equal to a lambda function or function name, this function is -expected to toggle headings visibility, and will be -called without arguments after the mode is enabled." +expected to toggle headings visibility, and will be called +without arguments after the mode is enabled. Heading visibility +can be changed with functions such as `outline-show-subtree', +`outline-show-entry', `outline-hide-entry' etc." :version "29.1" :type '(choice (const :tag "Disabled" nil) (const :tag "Show all" outline-show-all) commit b5ace2eed8066259b3aaef0c18652e280cdaefec Author: Eli Zaretskii Date: Wed Apr 26 09:39:35 2023 +0300 Document problems with /bin/sh on Solaris 10 * etc/PROBLEMS (Solaris): Document problems with '/bin/sh'. Suggested by Paul Eggert . (Bug#63067) diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 3c75e81b8b9..c0cb5b0d8bb 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -2688,6 +2688,15 @@ Emacs so that it isn't compiled with '-O5'. We list bugs in current versions here. See also the section on legacy systems. +*** On Solaris 10, running 'configure' with "/bin/sh" produces errors. +The "/bin/sh" shell on Solaris is an ancient and non-POSIX shell, so +we recommend not to use it. The Emacs 'configure' script should find +an appropriate shell and re-exec itself with that shell, unless you +force it to use "/bin/sh" by using "CONFIG_SHELL=/bin/sh" on the +'configure' command line. So either don't use CONFIG_SHELL, or, if +you'd rather pick the shell yourself, choose "/bin/bash" or "/bin/ksh" +or "/usr/xpg4/bin/sh" instead. + *** On Solaris 10 sparc, Emacs crashes during the build while saving state. This was observed for Emacs 28.1 on Solaris 10 32-bit sparc, with Oracle Developer Studio 12.6 (Sun C 5.15). The failure was intermittent, commit 7b2ad8f199e52398c226413d515eccc589730ffa Author: Mohsen Banan Date: Tue Apr 25 14:49:28 2023 -0700 ; Add missing <> line to TUTORIAL.fa. diff --git a/etc/tutorials/TUTORIAL.fa b/etc/tutorials/TUTORIAL.fa index 5c9c0e1941a..1333b47cae2 100644 --- a/etc/tutorials/TUTORIAL.fa +++ b/etc/tutorials/TUTORIAL.fa @@ -15,13 +15,8 @@ برای خروج از یک فرمانِ ناکامل، C-g را تایپ کنید. برای توقف آموزش، C-x k و سپس در پاسخ به نشانگر را تایپ کنید. کاراکترهای ">>" در حاشیه سمت راست فرمانهایی را برای شمامشخص می کند. برای مثال: - - - +<<خطهای خالی بعد از خط بعدی توسط help-with-tutorial درج میشود>> [وسط صفحه برای اهداف آموزشی خالی مانده است. ادامه متن در زیر] - - - >> اکنون C-v را تایپ کنید (نمایش صفحه بعدی) تا یک صفحه کامل به پایین بروید. (این کار را با نگه داشتن کلید CONTROL و فشار کلید v انجام دهید). از این پس، لطفاً هر زمان که به انتهای صفحه رسیدید، این کار را انجام دهید. commit d07815a7cc3540201afa06e3c80c061e9f497815 Author: Eli Zaretskii Date: Tue Apr 25 17:39:23 2023 +0300 Allow inserting #x6A58 using chinese-ctlaub IM * leim/MISC-DIC/CTLau-b5.html (CTLau-b5 : Hanzi input by Cantonese transcription (Lau style)): Add #x6A58 to GAT and GWAT. (Bug#62898) diff --git a/leim/MISC-DIC/CTLau-b5.html b/leim/MISC-DIC/CTLau-b5.html index 117a6ee374e..f174e61db2b 100644 --- a/leim/MISC-DIC/CTLau-b5.html +++ b/leim/MISC-DIC/CTLau-b5.html @@ -197,7 +197,7 @@ GAN ڤyԻ GANG ü]ոeC GAP F -GAT N˸ +GAT N˸ GAU s¤Eeh[b\ϩS GEI XOJ޺ߦٰծVvɫHҧTB GENG V @@ -231,7 +231,7 @@ GWAI ducֺktӭyޮ۸QXo GWAN gxuҶvpOa GWANG F -GWAT ] +GWAT ] GWING GWOH LGq GWOK commit fa4eae191c6bbf27639134438fb8bc57c7cac2bd Author: Eli Zaretskii Date: Tue Apr 25 17:31:05 2023 +0300 ; * etc/NEWS: Fix last change. diff --git a/etc/NEWS b/etc/NEWS index 004c8bcc6da..d39343b8bd4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -231,7 +231,7 @@ the new argument NEW-BUFFER non-nil, it will use a new buffer instead. Interactively, invoke 'eww-open-file' with a prefix argument to activate this behavior. -+++ +--- *** 'eww' URL or keyword prompt now has tab completion. The interactive minibuffer prompt when invoking 'eww' now has support for tab completion. commit c7fc4c811923725b961cfbf7e6a2051ae08c1eea Author: Antero Mejr Date: Thu Apr 13 15:59:54 2023 +0000 eww: Provide completions for bookmarks and suggested URIs. * lisp/net/eww.el (eww): Add the result of 'eww-suggest-uris' to the completion collection argument. (eww-bookmark-urls): New procedure. (eww-suggest-uris): Add "eww-bookmark-urls" to the default list. * etc/NEWS (EWW): Add NEWS entry for the change. (Bug#62800) diff --git a/etc/NEWS b/etc/NEWS index 38858a4bc63..004c8bcc6da 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -236,6 +236,12 @@ activate this behavior. The interactive minibuffer prompt when invoking 'eww' now has support for tab completion. ++++ +*** 'eww' URL and keyword prompt now completes suggested URIs and bookmarks. +The interactive minibuffer prompt when invoking 'eww' now provides +completions from 'eww-suggest-uris'. 'eww-suggest-uris' now includes +bookmark URIs. + ** go-ts-mode +++ diff --git a/lisp/net/eww.el b/lisp/net/eww.el index eb123864973..61f0f47373d 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -94,7 +94,8 @@ eww-download-directory (defcustom eww-suggest-uris '(eww-links-at-point thing-at-point-url-at-point - eww-current-url) + eww-current-url + eww-bookmark-urls) "List of functions called to form the list of default URIs for `eww'. Each of the elements is a function returning either a string or a list of strings. The results will be joined into a single list with @@ -104,7 +105,8 @@ eww-suggest-uris :type 'hook :options '(eww-links-at-point thing-at-point-url-at-point - eww-current-url)) + eww-current-url + eww-bookmark-urls)) (defcustom eww-bookmarks-directory user-emacs-directory "Directory where bookmark files will be stored." @@ -387,8 +389,8 @@ eww (minibuffer-local-completion-map eww-minibuffer-url-keymap)) (list (completing-read (format-prompt "Enter URL or keywords" (and uris (car uris))) - eww-prompt-history nil nil nil - 'eww-prompt-history uris) + (seq-uniq (append eww-prompt-history uris)) + nil nil nil 'eww-prompt-history uris) current-prefix-arg))) (setq url (eww--dwim-expand-url url)) (pop-to-buffer-same-window @@ -2235,6 +2237,12 @@ eww-previous-bookmark 'eww-bookmark))) (eww-browse-url (plist-get bookmark :url)))) +(defun eww-bookmark-urls () + "Get the URLs from the current list of bookmarks." + (interactive nil eww-boomark-mode) + (eww-read-bookmarks) + (mapcar (lambda (x) (plist-get x :url)) eww-bookmarks)) + (defvar-keymap eww-bookmark-mode-map "C-k" #'eww-bookmark-kill "C-y" #'eww-bookmark-yank commit df6cc4d33b63880a270297ac321a0ae338274cd7 Author: Antero Mejr Date: Wed Apr 12 17:56:01 2023 +0000 eww: Enable completion in URL/keyword prompt. * lisp/net/eww.el (eww): Use 'completing-read' when prompting for a URL or keywords. (eww-minibuffer-url-keymap): New keymap for use in the URL/keyword prompt. * etc/NEWS (EWW): Add NEWS entry for the change. (Bug#62800) diff --git a/etc/NEWS b/etc/NEWS index 4c5f50e343e..38858a4bc63 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -231,6 +231,11 @@ the new argument NEW-BUFFER non-nil, it will use a new buffer instead. Interactively, invoke 'eww-open-file' with a prefix argument to activate this behavior. ++++ +*** 'eww' URL or keyword prompt now has tab completion. +The interactive minibuffer prompt when invoking 'eww' now has support +for tab completion. + ** go-ts-mode +++ diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 99450356b7c..eb123864973 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -329,6 +329,12 @@ eww-image-link-keymap :parent shr-image-map "RET" #'eww-follow-link) +(defvar-keymap eww-minibuffer-url-keymap + :doc "Keymap used in the minibuffer prompt for URLs or keywords." + :parent minibuffer-local-completion-map + "SPC" #'self-insert-command + "?" #'self-insert-command) + (defun eww-suggested-uris nil "Return the list of URIs to suggest at the `eww' prompt. This list can be customized via `eww-suggest-uris'." @@ -377,10 +383,12 @@ eww For more information, see Info node `(eww) Top'." (interactive - (let ((uris (eww-suggested-uris))) - (list (read-string (format-prompt "Enter URL or keywords" - (and uris (car uris))) - nil 'eww-prompt-history uris) + (let ((uris (eww-suggested-uris)) + (minibuffer-local-completion-map eww-minibuffer-url-keymap)) + (list (completing-read (format-prompt "Enter URL or keywords" + (and uris (car uris))) + eww-prompt-history nil nil nil + 'eww-prompt-history uris) current-prefix-arg))) (setq url (eww--dwim-expand-url url)) (pop-to-buffer-same-window commit 5741583f54a756a4a2a89313c869a9cc78de1787 Author: Eli Zaretskii Date: Tue Apr 25 10:08:34 2023 -0400 ; Auto-commit of loaddefs files. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index acf8a1d2556..ddaa3f83fbb 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -2918,11 +2918,6 @@ "bytecomp" (register-definition-prefixes "semantic/bovine/c" '("semantic")) - -;;; Generated autoloads from progmodes/c-ts-common.el - -(register-definition-prefixes "c-ts-common" '("c-ts-common-")) - ;;; Generated autoloads from progmodes/c-ts-mode.el @@ -2965,6 +2960,10 @@ "c-ts-common" in your configuration. +Since this mode uses a parser, unbalanced brackets might cause +some breakage in indentation/fontification. Therefore, it's +recommended to enable `electric-pair-mode' with this mode. + (fn)" t) (autoload 'c-or-c++-ts-mode "c-ts-mode" "\ Analyze buffer and enable either C or C++ mode. @@ -5129,8 +5128,6 @@ compilation-disable-input The mode's hook is called both when the mode is enabled and when it is disabled. -\\{compilation-shell-minor-mode-map} - (fn &optional ARG)" t) (autoload 'compilation-minor-mode "compile" "\ Toggle Compilation minor mode. @@ -5154,8 +5151,6 @@ compilation-disable-input The mode's hook is called both when the mode is enabled and when it is disabled. -\\{compilation-minor-mode-map} - (fn &optional ARG)" t) (autoload 'compilation-next-error-function "compile" "\ Advance to the next error message and visit the file where the error was. @@ -8618,7 +8613,7 @@ "ebnf2ps" A call with prefix PREFIX reads the symbol to insert from the minibuffer with completion. -(fn PREFIX)" t) +(fn PREFIX)" '("P")) (autoload 'ebrowse-tags-loop-continue "ebrowse" "\ Repeat last operation on files in tree. FIRST-TIME non-nil means this is not a repetition, but the first time. @@ -9230,24 +9225,25 @@ "edt-vt100" ;;; Generated autoloads from progmodes/eglot.el -(push (purecopy '(eglot 1 13)) package--builtin-versions) +(push (purecopy '(eglot 1 14)) package--builtin-versions) (autoload 'eglot "eglot" "\ -Start LSP server in support of PROJECT's buffers under MANAGED-MAJOR-MODE. +Start LSP server for PROJECT's buffers under MANAGED-MAJOR-MODES. -This starts a Language Server Protocol (LSP) server suitable for the -buffers of PROJECT whose `major-mode' is MANAGED-MAJOR-MODE. -CLASS is the class of the LSP server to start and CONTACT specifies -how to connect to the server. +This starts a Language Server Protocol (LSP) server suitable for +the buffers of PROJECT whose `major-mode' is among +MANAGED-MAJOR-MODES. CLASS is the class of the LSP server to +start and CONTACT specifies how to connect to the server. -Interactively, the command attempts to guess MANAGED-MAJOR-MODE -from the current buffer's `major-mode', CLASS and CONTACT from -`eglot-server-programs' looked up by the major mode, and PROJECT from -`project-find-functions'. The search for active projects in this -context binds `eglot-lsp-context' (which see). +Interactively, the command attempts to guess MANAGED-MAJOR-MODES, +CLASS, CONTACT, and LANGUAGE-IDS from `eglot-server-programs', +according to the current buffer's `major-mode'. PROJECT is +guessed from `project-find-functions'. The search for active +projects in this context binds `eglot-lsp-context' (which see). -If it can't guess, it prompts the user for the mode and the server. -With a single \\[universal-argument] prefix arg, it always prompts for COMMAND. -With two \\[universal-argument], it also always prompts for MANAGED-MAJOR-MODE. +If it can't guess, it prompts the user for the mode and the +server. With a single \\[universal-argument] prefix arg, it +always prompts for COMMAND. With two \\[universal-argument], it +also always prompts for MANAGED-MAJOR-MODE. The LSP server of CLASS is started (or contacted) via CONTACT. If this operation is successful, current *and future* file @@ -9265,12 +9261,12 @@ "edt-vt100" keyword-value plist used to initialize CLASS or a plain list as described in `eglot-server-programs', which see. -LANGUAGE-ID is the language ID string to send to the server for -MANAGED-MAJOR-MODE, which matters to a minority of servers. +LANGUAGE-IDS is a list of language ID string to send to the +server for each element in MANAGED-MAJOR-MODES. INTERACTIVE is ignored and provided for backward compatibility. -(fn MANAGED-MAJOR-MODE PROJECT CLASS CONTACT LANGUAGE-ID &optional INTERACTIVE)" t) +(fn MANAGED-MAJOR-MODES PROJECT CLASS CONTACT LANGUAGE-IDS &optional INTERACTIVE)" t) (autoload 'eglot-ensure "eglot" "\ Start Eglot session for current buffer if there isn't one.") (put 'eglot-workspace-configuration 'safe-local-variable 'listp) @@ -9400,7 +9396,7 @@ "semantic/bovine/el" ;;; Generated autoloads from emacs-lisp/eldoc.el -(push (purecopy '(eldoc 1 13 0)) package--builtin-versions) +(push (purecopy '(eldoc 1 14 0)) package--builtin-versions) ;;; Generated autoloads from elec-pair.el @@ -9526,15 +9522,6 @@ "elide-head" (fn &optional REINIT)" t) (register-definition-prefixes "elint" '("elint-")) - -;;; Generated autoloads from progmodes/elixir-ts-mode.el - -(autoload 'elixir-ts-mode "elixir-ts-mode" "\ -Major mode for editing Elixir, powered by tree-sitter. - -(fn)" t) -(register-definition-prefixes "elixir-ts-mode" '("elixir-ts-")) - ;;; Generated autoloads from emacs-lisp/elp.el @@ -9830,6 +9817,8 @@ "emerge" (fn &optional FACTOR)" t) (autoload 'emoji-zoom-decrease "emoji" "\ Decrease the size of the character under point." t) +(autoload 'emoji-zoom-reset "emoji" "\ +Reset the size of the character under point." t) (register-definition-prefixes "emoji" '("emoji-")) @@ -10207,9 +10196,10 @@ "epg-config" ;;; Generated autoloads from erc/erc.el -(push (purecopy '(erc 5 5)) package--builtin-versions) +(push (purecopy '(erc 5 6 -4)) package--builtin-versions) (autoload 'erc-select-read-args "erc" "\ -Prompt the user for values of nick, server, port, and password.") +Prompt the user for values of nick, server, port, and password. +With prefix arg, also prompt for user and full name.") (autoload 'erc "erc" "\ ERC is a powerful, modular, and extensible IRC client. This function is the main entry point for ERC. @@ -10235,7 +10225,7 @@ "epg-config" See `erc-tls' for the meaning of ID. -(fn &key (SERVER (erc-compute-server)) (PORT (erc-compute-port)) (NICK (erc-compute-nick)) (USER (erc-compute-user)) PASSWORD (FULL-NAME (erc-compute-full-name)) ID)" t) +(fn &key SERVER PORT NICK USER PASSWORD FULL-NAME ID)" '((erc-select-read-args))) (defalias 'erc-select #'erc) (autoload 'erc-tls "erc" "\ ERC is a powerful, modular, and extensible IRC client. @@ -10279,11 +10269,11 @@ 'erc-select When present, ID should be a symbol or a string to use for naming the server buffer and identifying the connection unequivocally. -See Info node `(erc) Network Identifier' for details. Like USER -and CLIENT-CERTIFICATE, this parameter cannot be specified +See Info node `(erc) Network Identifier' for details. Like +CLIENT-CERTIFICATE, this parameter cannot be specified interactively. -(fn &key (SERVER (erc-compute-server)) (PORT (erc-compute-port \\='ircs-u)) (NICK (erc-compute-nick)) (USER (erc-compute-user)) PASSWORD (FULL-NAME (erc-compute-full-name)) CLIENT-CERTIFICATE ID)" t) +(fn &key SERVER PORT NICK USER PASSWORD FULL-NAME CLIENT-CERTIFICATE ID)" '((let ((erc-default-port erc-default-port-tls)) (erc-select-read-args)))) (autoload 'erc-handle-irc-url "erc" "\ Use ERC to IRC on HOST:PORT in CHANNEL. If ERC is already connected to HOST:PORT, simply /join CHANNEL. @@ -10363,7 +10353,7 @@ "erc-identd" ;;; Generated autoloads from erc/erc-imenu.el -(register-definition-prefixes "erc-imenu" '("erc-unfill-notice")) +(register-definition-prefixes "erc-imenu" '("erc-")) ;;; Generated autoloads from erc/erc-join.el @@ -10512,9 +10502,7 @@ "erc-xdcc" If NAME is already defined as a test and Emacs is running in batch mode, an error is signaled. -(fn NAME () [DOCSTRING] [:expected-result RESULT-TYPE] [:tags \\='(TAG...)] BODY...)" nil t) -(function-put 'ert-deftest 'doc-string-elt 3) -(function-put 'ert-deftest 'lisp-indent-function 2) +(fn NAME () [DOCSTRING] [:expected-result RESULT-TYPE] [:tags \\='(TAG...)] BODY...)" nil 'macro) (autoload 'ert-run-tests-batch "ert" "\ Run the tests specified by SELECTOR, printing results to the terminal. @@ -10649,9 +10637,10 @@ "esh-var" (fn &optional ARG)" t) (autoload 'eshell-command "eshell" "\ Execute the Eshell command string COMMAND. -With prefix ARG, insert output into the current buffer at point. +If TO-CURRENT-BUFFER is non-nil (interactively, with the prefix +argument), then insert output into the current buffer at point. -(fn &optional COMMAND ARG)" t) +(fn COMMAND &optional TO-CURRENT-BUFFER)" t) (autoload 'eshell-command-result "eshell" "\ Execute the given Eshell COMMAND, and return the result. The result might be any Lisp object. @@ -12352,7 +12341,7 @@ 'ff-find-related-file If non-nil, always attempt to create the other file if it was not found. - `ff-quiet-mode' - If non-nil, traces which directories are being searched. + If non-nil, does not trace which directories are being searched. - `ff-special-constructs' A list of regular expressions specifying how to recognize special @@ -12620,7 +12609,7 @@ "flow-fill" ;;; Generated autoloads from progmodes/flymake.el -(push (purecopy '(flymake 1 2 2)) package--builtin-versions) +(push (purecopy '(flymake 1 3 4)) package--builtin-versions) (autoload 'flymake-log "flymake" "\ Log, at level LEVEL, the message MSG formatted with ARGS. LEVEL is passed to `display-warning', which is used to display @@ -12719,8 +12708,6 @@ "flow-fill" The mode's hook is called both when the mode is enabled and when it is disabled. -\\{flymake-mode-map} - (fn &optional ARG)" t) (autoload 'flymake-mode-on "flymake" "\ Turn Flymake mode on.") @@ -15127,15 +15114,6 @@ "hanoi" (fn &optional ARG)" t) (register-definition-prefixes "hashcash" '("hashcash-")) - -;;; Generated autoloads from progmodes/heex-ts-mode.el - -(autoload 'heex-ts-mode "heex-ts-mode" "\ -Major mode for editing HEEx, powered by tree-sitter. - -(fn)" t) -(register-definition-prefixes "heex-ts-mode" '("heex-ts-")) - ;;; Generated autoloads from help-at-pt.el @@ -16306,15 +16284,6 @@ "holidays" (register-definition-prefixes "semantic/html" '("semantic-")) - -;;; Generated autoloads from textmodes/html-ts-mode.el - -(autoload 'html-ts-mode "html-ts-mode" "\ -Major mode for editing Html, powered by tree-sitter. - -(fn)" t) -(register-definition-prefixes "html-ts-mode" '("html-ts-mode-")) - ;;; Generated autoloads from htmlfontify.el @@ -16388,8 +16357,7 @@ "ibuf-ext" change its definition, you should explicitly call `ibuffer-recompile-formats'. -(fn SYMBOL (&key NAME INLINE PROPS SUMMARIZER) &rest BODY)" nil t) -(function-put 'define-ibuffer-column 'lisp-indent-function 'defun) +(fn SYMBOL (&key NAME INLINE PROPS SUMMARIZER) &rest BODY)" nil 'macro) (autoload 'define-ibuffer-sorter "ibuf-macs" "\ Define a method of sorting named NAME. DOCUMENTATION is the documentation of the function, which will be called @@ -16400,9 +16368,7 @@ "ibuf-ext" buffer object, and `b' bound to another. BODY should return a non-nil value if and only if `a' is \"less than\" `b'. -(fn NAME DOCUMENTATION (&key DESCRIPTION) &rest BODY)" nil t) -(function-put 'define-ibuffer-sorter 'lisp-indent-function 1) -(function-put 'define-ibuffer-sorter 'doc-string-elt 2) +(fn NAME DOCUMENTATION (&key DESCRIPTION) &rest BODY)" nil 'macro) (autoload 'define-ibuffer-op "ibuf-macs" "\ Generate a function which operates on a buffer. OP becomes the name of the function; if it doesn't begin with @@ -16441,9 +16407,7 @@ "ibuf-ext" marked buffer. BODY is evaluated with `buf' bound to the buffer object. -(fn OP ARGS DOCUMENTATION (&key INTERACTIVE MARK MODIFIER-P DANGEROUS OPSTRING ACTIVE-OPSTRING BEFORE AFTER COMPLEX) &rest BODY)" nil t) -(function-put 'define-ibuffer-op 'lisp-indent-function 2) -(function-put 'define-ibuffer-op 'doc-string-elt 3) +(fn OP ARGS DOCUMENTATION (&key INTERACTIVE MARK MODIFIER-P DANGEROUS OPSTRING ACTIVE-OPSTRING BEFORE AFTER COMPLEX) &rest BODY)" nil 'macro) (autoload 'define-ibuffer-filter "ibuf-macs" "\ Define a filter named NAME. DOCUMENTATION is the documentation of the function. @@ -16458,9 +16422,7 @@ "ibuf-ext" will be evaluated with BUF bound to the buffer object, and QUALIFIER bound to the current value of the filter. -(fn NAME DOCUMENTATION (&key READER DESCRIPTION) &rest BODY)" nil t) -(function-put 'define-ibuffer-filter 'lisp-indent-function 2) -(function-put 'define-ibuffer-filter 'doc-string-elt 2) +(fn NAME DOCUMENTATION (&key READER DESCRIPTION) &rest BODY)" nil 'macro) (register-definition-prefixes "ibuf-macs" '("ibuffer-")) @@ -17271,8 +17233,8 @@ "iimage" IMAGE must be an image created with `create-image' or `defimage'. IMAGE is displayed by putting an overlay into the current buffer with a `before-string' STRING that has a `display' property whose value is the -image. STRING is defaulted if you omit it. -The overlay created will have the `put-image' property set to t. +image. STRING defaults to \"x\" if it's nil or omitted. +The overlay created by this function has the `put-image' property set to t. POS may be an integer or marker. AREA is where to display the image. AREA nil or omitted means display it in the text area, a value of `left-margin' means @@ -17406,14 +17368,31 @@ "image-converter" COLOR defaults to the value of `image-cut-color'. Interactively, with prefix argument, prompt for COLOR to use. +This command presents the image with a rectangular area superimposed +on it, and allows moving and resizing the area to define which +part of it to cut. + +While moving/resizing the cutting area, the following key bindings +are available: + +`q': Exit without changing anything. +`RET': Crop/cut the image. +`m': Make mouse movements move the rectangle instead of altering the + rectangle shape. +`s': Same as `m', but make the rectangle into a square first. + +After cutting the image, you can save it by `M-x image-save' or +\\\\[image-save] when point is over the image. + (fn &optional COLOR)" t) (autoload 'image-crop "image-crop" "\ Crop the image under point. -If CUT is non-nil, remove a rectangle from the image instead of -cropping the image. In that case CUT should be the name of a -color to fill the rectangle. +This command presents the image with a rectangular area superimposed +on it, and allows moving and resizing the area to define which +part of it to crop. -While cropping the image, the following key bindings are available: +While moving/resizing the cropping area, the following key bindings +are available: `q': Exit without changing anything. `RET': Crop/cut the image. @@ -17421,9 +17400,13 @@ "image-converter" rectangle shape. `s': Same as `m', but make the rectangle into a square first. -After cropping an image, you can save it by `M-x image-save' or +After cropping the image, you can save it by `M-x image-save' or \\\\[image-save] when point is over the image. +When called from Lisp, if CUT is non-nil, remove a rectangle from +the image instead of cropping the image. In that case, CUT should +be the name of a color to fill the rectangle. + (fn &optional CUT)" t) (register-definition-prefixes "image-crop" '("image-c")) @@ -18534,6 +18517,11 @@ ispell-html-skip-alists Standard ispell choices are then available. +This command uses a word-list file specified +by `ispell-alternate-dictionary' or by `ispell-complete-word-dict'; +if none of those name an existing word-list file, this command +signals an error. + (fn &optional INTERIOR-FRAG)" t) (autoload 'ispell-complete-word-interior-frag "ispell" "\ Completes word matching character sequence inside a word." t) @@ -22466,7 +22454,7 @@ "opascal" ;;; Generated autoloads from org/org.el -(push (purecopy '(org 9 6 2)) package--builtin-versions) +(push (purecopy '(org 9 6 4)) package--builtin-versions) (autoload 'org-babel-do-load-languages "org" "\ Load the languages defined in `org-babel-load-languages'. @@ -23458,8 +23446,7 @@ package-activate-all (autoload 'package-install "package" "\ Install the package PKG. PKG can be a `package-desc' or a symbol naming one of the -available packages in an archive in `package-archives'. When -called interactively, prompt for the package name. +available packages in an archive in `package-archives'. Mark the installed package as selected by adding it to `package-selected-packages'. @@ -23471,6 +23458,10 @@ package-activate-all If PKG is a `package-desc' and it is already installed, don't try to install it but still mark it as selected. +If the command is invoked with a prefix argument, it will allow +upgrading of built-in packages, as if `package-install-upgrade-built-in' +had been enabled. + (fn PKG &optional DONT-SELECT)" t) (autoload 'package-update "package" "\ Update package NAME if a newer version exists. @@ -24433,6 +24424,11 @@ "pgtk-dnd" (defalias 'edit-picture 'picture-mode) (register-definition-prefixes "picture" '("picture-")) + +;;; Generated autoloads from language/pinyin.el + +(register-definition-prefixes "pinyin" '("pinyin-character-map")) + ;;; Generated autoloads from textmodes/pixel-fill.el @@ -26280,8 +26276,6 @@ 'replace-rectangle The mode's hook is called both when the mode is enabled and when it is disabled. -\\{rectangle-mark-mode-map} - (fn &optional ARG)" t) (register-definition-prefixes "rect" '("apply-on-rectangle" "clear-rectangle-line" "delete-" "extract-rectangle-" "killed-rectangle" "ope" "rectangle-" "spaces-string" "string-rectangle-")) @@ -27439,16 +27433,6 @@ "rtree" (dolist (name (list "ruby" "rbx" "jruby" "ruby1.9" "ruby1.8")) (add-to-list 'interpreter-mode-alist (cons (purecopy name) 'ruby-mode))) (register-definition-prefixes "ruby-mode" '("ruby-")) - -;;; Generated autoloads from progmodes/ruby-ts-mode.el - -(push (purecopy '(ruby-ts-mode 0 2)) package--builtin-versions) -(autoload 'ruby-ts-mode "ruby-ts-mode" "\ -Major mode for editing Ruby, powered by tree-sitter. - -(fn)" t) -(register-definition-prefixes "ruby-ts-mode" '("ruby-ts-")) - ;;; Generated autoloads from ruler-mode.el @@ -32922,7 +32906,8 @@ "tree-widget" Interactively, if `treesit-language-source-alist' doesn't already have data for building the grammar for LANG, prompt for its -repository URL and the C/C++ compiler to use. +repository URL and the C/C++ compiler to use. Non-interactively, +signal an error when there's no recipe for LANG. This command requires Git, a C compiler and (sometimes) a C++ compiler, and the linker to be installed and on PATH. It also requires that the @@ -32931,7 +32916,12 @@ "tree-widget" See `exec-path' for the current path where Emacs looks for executable programs, such as the C/C++ compiler and linker. -(fn LANG)" t) +Interactively, prompt for the directory in which to install the +compiled grammar files. Non-interactively, use OUT-DIR; if it's +nil, the grammar is installed to the standard location, the +\"tree-sitter\" directory under `user-emacs-directory'. + +(fn LANG &optional OUT-DIR)" t) (register-definition-prefixes "treesit" '("treesit-")) @@ -33157,7 +33147,15 @@ "type-break" (fn)" t) (autoload 'tsx-ts-mode "typescript-ts-mode" "\ -Major mode for editing TypeScript. +Major mode for editing TSX and JSX documents. + +This major mode defines two additional JSX-specific faces: +`typescript-ts-jsx-attribute-face' and +`typescript-ts-jsx-attribute-face' that are used for HTML tags +and attributes, respectively. + +The JSX-specific faces are used when `treesit-font-lock-level' is +at least 3 (which is the default value). (fn)" t) (register-definition-prefixes "typescript-ts-mode" '("typescript-ts-mode-")) @@ -37163,6 +37161,48 @@ "zeroconf" (fn &optional PGM)" t) (register-definition-prefixes "zone" '("zone-")) + + +;;; Generated autoloads from progmodes/ruby-ts-mode.el + +(push (purecopy '(ruby-ts-mode 0 2)) package--builtin-versions) +(autoload 'ruby-ts-mode "ruby-ts-mode" "\ +Major mode for editing Ruby, powered by tree-sitter. + +(fn)" t) +(register-definition-prefixes "ruby-ts-mode" '("ruby-ts-")) + + +;;; Generated autoloads from textmodes/html-ts-mode.el + +(autoload 'html-ts-mode "html-ts-mode" "\ +Major mode for editing Html, powered by tree-sitter. + +(fn)" t) +(register-definition-prefixes "html-ts-mode" '("html-ts-mode-")) + + +;;; Generated autoloads from progmodes/c-ts-common.el + +(register-definition-prefixes "c-ts-common" '("c-ts-common-")) + + +;;; Generated autoloads from progmodes/elixir-ts-mode.el + +(autoload 'elixir-ts-mode "elixir-ts-mode" "\ +Major mode for editing Elixir, powered by tree-sitter. + +(fn)" t) +(register-definition-prefixes "elixir-ts-mode" '("elixir-ts-")) + + +;;; Generated autoloads from progmodes/heex-ts-mode.el + +(autoload 'heex-ts-mode "heex-ts-mode" "\ +Major mode for editing HEEx, powered by tree-sitter. + +(fn)" t) +(register-definition-prefixes "heex-ts-mode" '("heex-ts-")) ;;; End of scraped data commit 095ec506d03b76155b399fd7b23554279b2cfee0 Merge: f55ac7a7451 524e161a536 Author: Eli Zaretskii Date: Tue Apr 25 09:57:23 2023 -0400 Merge from origin/emacs-29 524e161a536 Followup to addition of TUTORIAL.fa 76f50df1539 Add Farsi/Persian translation of the tutorial 8eacfaea6d8 Add Mongolian language environments fe8efbb8f75 Document the 'end-session' event on MS-Windows d80f959bede Update to Org 9.6.4-9-g8eb209 98c6cfcbe4a Don't support versioned grammar libraries on MS-Windows 8f71c1546df Accept versioned tree-sitter language grammar files 99add09d5e1 tab-bar-new-tab: inhibit side-window checks 087e8181947 * etc/NEWS: Fix outline level. (Bug#63042) d7f38558c4c ; Improve font selection for Traditional Mongolian 965c5e0231c Fix rendering of Traditional Mongolian script 9a0f10b5f88 Fix line-number-at-pos when POSITION is out of narrowing 4e0f4292aaf ; * etc/tutorials/TUTORIAL: Fix punctuation. dec2ac0c657 Fix exiting Emacs after saving a tutorial # Conflicts: # etc/NEWS commit f55ac7a74510d68f02d17a034571350f9876017f Author: Eli Zaretskii Date: Tue Apr 25 16:45:31 2023 +0300 ; Update authors.el * admin/authors.el (authors-aliases): Update per https://lists.gnu.org/archive/html/emacs-devel/2023-04/msg00692.html. diff --git a/admin/authors.el b/admin/authors.el index 147282a99a2..f1c988cc776 100644 --- a/admin/authors.el +++ b/admin/authors.el @@ -182,7 +182,7 @@ authors-aliases ("Philip Kaludercic" "Philip K\\." "Philip K") ("Philipp Stephani" "Philipp .*phst@google") ("Piotr Zieliński" "Piotr Zielinski") - ("Po Lu" "Po Lu Via") ; looks like a mistake + ("Po Lu" "Po Lu Via" "Your Name") ; looks like a mistake ("Przemysław Wojnowski" "Przemyslaw Wojnowski") ("R. Bernstein" "rb@dustyfeet.com") ("Rainer Schöpf" "Rainer Schoepf") commit e6004ed30c10947366f4c0f0722ad053e2904d4c Author: Po Lu Date: Tue Apr 25 20:41:05 2023 +0800 Improve portability of pkg-config tests. * configure.ac: Fix problems found after pkg-config was installed on Solaris 10. diff --git a/configure.ac b/configure.ac index 118f31fae96..dd247e144f4 100644 --- a/configure.ac +++ b/configure.ac @@ -3773,7 +3773,7 @@ AC_DEFUN AC_DEFINE([HAVE_OTF_GET_VARIATION_GLYPHS], [1], [Define to 1 if libotf has OTF_get_variation_glyphs.]) fi - if ! $PKG_CONFIG --atleast-version=0.9.16 libotf; then + if $PKG_CONFIG --atleast-version=0.9.16 libotf; then :; else AC_DEFINE([HAVE_OTF_KANNADA_BUG], [1], [Define to 1 if libotf is affected by https://debbugs.gnu.org/28110.]) fi @@ -3881,7 +3881,7 @@ AC_DEFUN AC_DEFINE([HAVE_OTF_GET_VARIATION_GLYPHS], [1], [Define to 1 if libotf has OTF_get_variation_glyphs.]) fi - if ! $PKG_CONFIG --atleast-version=0.9.16 libotf; then + if $PKG_CONFIG --atleast-version=0.9.16 libotf; then :; else AC_DEFINE([HAVE_OTF_KANNADA_BUG], [1], [Define to 1 if libotf is affected by https://debbugs.gnu.org/28110.]) fi commit b8f94eb0f148e774981ce711a12db604ebd174bc Author: Your Name Date: Tue Apr 25 20:28:38 2023 +0800 Fix configure.ac for some Bourne shells This fixes running configure under /bin/sh on Solaris 10, and some other Unix systems. * configure.ac: Avoid POSIX style command substitutions. (emacs_major_version): Avoid POSIX style pattern substitution. (PORT_PACKAGE, MAC_FLAGS, MAC_LIBS): Avoid POSIX style command substitutions. diff --git a/configure.ac b/configure.ac index 55396bdd6ff..118f31fae96 100644 --- a/configure.ac +++ b/configure.ac @@ -1001,7 +1001,7 @@ AC_DEFUN # however, if there is also a .tarball-version file it is probably # just a release imported into Git for patch management. gl_gcc_warnings=no - if test -e "$srcdir"/.git && test ! -f "$srcdir"/.tarball-version; then + if test -d "$srcdir"/.git && test ! -f "$srcdir"/.tarball-version; then # Clang typically identifies itself as GCC 4.2 or something similar # even if it is recent enough to accept the warnings we enable. AS_IF([test "$emacs_cv_clang" = yes], @@ -2034,31 +2034,23 @@ AC_DEFUN ns_appresdir=${ns_appdir}/Contents/Resources ns_appsrc=Cocoa/Emacs.base ns_fontfile=macfont.o - elif flags=$( (gnustep-config --objc-flags) 2>/dev/null); then + elif flags=`(gnustep-config --objc-flags) 2>/dev/null`; then NS_IMPL_GNUSTEP=yes NS_GNUSTEP_CONFIG=yes GNU_OBJC_CFLAGS="$flags" - LIBS_GNUSTEP=$(gnustep-config --gui-libs) || exit + LIBS_GNUSTEP=`gnustep-config --gui-libs || exit` elif test -f $GNUSTEP_CONFIG_FILE; then NS_IMPL_GNUSTEP=yes dnl FIXME sourcing this several times in subshells seems inefficient. - GNUSTEP_SYSTEM_HEADERS=$( - . $GNUSTEP_CONFIG_FILE - AS_ECHO(["$GNUSTEP_SYSTEM_HEADERS"]) - ) - GNUSTEP_SYSTEM_LIBRARIES=$( - . $GNUSTEP_CONFIG_FILE - AS_ECHO(["$GNUSTEP_SYSTEM_LIBRARIES"]) - ) + GNUSTEP_SYSTEM_HEADERS=`. $GNUSTEP_CONFIG_FILE \ + && AS_ECHO(["$GNUSTEP_SYSTEM_HEADERS"])` + GNUSTEP_SYSTEM_LIBRARIES=` . $GNUSTEP_CONFIG_FILE \ + && AS_ECHO(["$GNUSTEP_SYSTEM_LIBRARIES"])` dnl I seemed to need these as well with GNUstep-startup 0.25. - GNUSTEP_LOCAL_HEADERS=$( - . $GNUSTEP_CONFIG_FILE - AS_ECHO(["$GNUSTEP_LOCAL_HEADERS"]) - ) - GNUSTEP_LOCAL_LIBRARIES=$( - . $GNUSTEP_CONFIG_FILE - AS_ECHO(["$GNUSTEP_LOCAL_LIBRARIES"]) - ) + GNUSTEP_LOCAL_HEADERS=`. $GNUSTEP_CONFIG_FILE \ + && AS_ECHO(["$GNUSTEP_LOCAL_HEADERS"])` + GNUSTEP_LOCAL_LIBRARIES=`. $GNUSTEP_CONFIG_FILE \ + && AS_ECHO(["$GNUSTEP_LOCAL_LIBRARIES"])` test "x${GNUSTEP_LOCAL_HEADERS}" != "x" && \ GNUSTEP_LOCAL_HEADERS="-I${GNUSTEP_LOCAL_HEADERS}" test "x${GNUSTEP_LOCAL_LIBRARIES}" != "x" && \ @@ -4207,7 +4199,7 @@ AC_DEFUN module_env_snippet_28="$srcdir/src/module-env-28.h" module_env_snippet_29="$srcdir/src/module-env-29.h" module_env_snippet_30="$srcdir/src/module-env-30.h" -emacs_major_version="${PACKAGE_VERSION%%.*}" +emacs_major_version=`AS_ECHO([$PACKAGE_VERSION]) | sed 's/[[.]].*//'` AC_SUBST([emacs_major_version]) ### Emacs Lisp native compiler support @@ -4317,14 +4309,16 @@ AC_DEFUN # available. (We filter out the gcc4 packages, because they # don't support jit, and they have names like "gcc49" that # sort later than "gcc11".) - PORT_PACKAGE=$(port installed active | grep '^ *gcc@<:@0-9@:>@* ' | \ + PORT_PACKAGE=`port installed active | grep '^ *gcc@<:@0-9@:>@* ' | \ awk '{ print $1; }' | grep -v 'gcc4@<:@0-9@:>@' | \ - sort -V | tail -n 1) + sort -V | tail -n 1` if test -n "$PORT_PACKAGE"; then - MAC_CFLAGS="-I$(dirname $(port contents $PORT_PACKAGE | \ - grep libgccjit.h))" - MAC_LIBS="-L$(dirname $(port contents $PORT_PACKAGE | \ - grep libgccjit.dylib))" + emacs_val=`port contents $PORT_PACKAGE | grep libgccjit.h` + emacs_val=`dirname $emacs_val` + MAC_CFLAGS="-I$emacs_val" + emacs_val=`port contents $PORT_PACKAGE | grep libgccjit.dylib` + emacs_val=`dirname $emacs_val` + MAC_LIBS="-L$emacs_val" fi fi commit 524e161a536c1c803f453f286430ba1a4e36694e Author: Eli Zaretskii Date: Tue Apr 25 12:26:20 2023 +0300 Followup to addition of TUTORIAL.fa * etc/NEWS: Announce addition of TUTORIAL.fa. * etc/tutorials/TUTORIAL.translators (TUTORIAL.fa): New entry. * lisp/language/misc-lang.el ("Persian"): Add tutorial property. diff --git a/etc/NEWS b/etc/NEWS index d1e4727ca20..0eb5940dbca 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1563,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. diff --git a/etc/tutorials/TUTORIAL.translators b/etc/tutorials/TUTORIAL.translators index 64d71b61e84..222703cdb9f 100644 --- a/etc/tutorials/TUTORIAL.translators +++ b/etc/tutorials/TUTORIAL.translators @@ -30,6 +30,10 @@ Maintainer: Rafael Sepúlveda Author: Protesilaos Stavrou Maintainer: Protesilaos Stavrou +* TUTORIAL.fa: +Author: Mohsen BANAN +Maintainer: Mohsen BANAN + * TUTORIAL.fr: Author: Éric Jacoboni Maintainer: Éric Jacoboni diff --git a/lisp/language/misc-lang.el b/lisp/language/misc-lang.el index 8ec1dcaf22b..792155f1de5 100644 --- a/lisp/language/misc-lang.el +++ b/lisp/language/misc-lang.el @@ -74,7 +74,8 @@ 'cp1256 (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 ZWNJ (Zero-width Non-Joiner) in Arabic text rendering. commit 76f50df15391a20f1889f189627b16e73b5358ce Author: Mohsen Banan Date: Sun Apr 23 21:26:06 2023 -0700 Add Farsi/Persian translation of the tutorial * etc/tutorials/TUTORIAL.fa: New file. * lisp/language/misc-lang.el (arabic-shaper-ZWNJ-handling): Fix typo in doc string. diff --git a/etc/tutorials/TUTORIAL.fa b/etc/tutorials/TUTORIAL.fa new file mode 100644 index 00000000000..5c9c0e1941a --- /dev/null +++ b/etc/tutorials/TUTORIAL.fa @@ -0,0 +1,1169 @@ +آموزش Emacs «ایمکس». برای شرایط کپی به پایان مراجعه کنید. + +فرمانهای Emacs عموماً شامل کلید CONTROL (گاهی اوقات با برچسب CTRL) +یا کلید META (معمولا با برچسب ALT) هستند. به جای هر بار بطور کامل نوشتن، +از خلاصه زیر استفاده خواهیم کرد: + +‏ ‪C-‬ به معنای نگه داشتن کلید CONTROL در حین تایپ کاراکترِ است. + بنابراین، C-f خواهد بود: کلید CONTROL را نگه دارید و f را تایپ کنید. +‏ ‪M-‬ یعنی کلید META یا ALT را هنگام تایپ حرفِ پایین نگه دارید. + اگر کلید META، یا ALT وجود ندارد، به جای آن کلید ESC را فشار + داده و رها کنید، سپس <حرف> را تایپ کنید. + برای کلید ESC می نویسیم . + +نکته مهم: برای پایان دادن به جلسه Emacs، دو حرف C-x C-c را تایپ کنید. +برای خروج از یک فرمانِ ناکامل، C-g را تایپ کنید. +برای توقف آموزش، C-x k و سپس در پاسخ به نشانگر را تایپ کنید. +کاراکترهای ">>" در حاشیه سمت راست فرمانهایی را برای شمامشخص می کند. برای مثال: + + + +[وسط صفحه برای اهداف آموزشی خالی مانده است. ادامه متن در زیر] + + + +>> اکنون C-v را تایپ کنید (نمایش صفحه بعدی) تا یک صفحه کامل به پایین بروید. + (این کار را با نگه داشتن کلید CONTROL و فشار کلید v انجام دهید). + از این پس، لطفاً هر زمان که به انتهای صفحه رسیدید، این کار را انجام دهید. + +توجه داشته باشید که وقتی یک صفحه کامل را اسکرول می کنید، دو خط همپوشانی دارند؛ +این مقداری تداوم را فراهم می کند تا بتوانید به خواندن متن ادامه دهید. + +این یک کپی از متن آموزشی Emacs است که کمی برای شما شخصی سازی شده است. +بعداً به شما آموزش خواهیم داد که فرمانهای مختلفی را برای تغییر این متن استفاده +کنید. اگر قبل از اینکه به شماگفته باشیم، این متن را تغییر داده اید، +نگران نباشید. این کار «ویرایش» نامیده می شود و Emacs برای همین است. + +اولین چیزی که باید بدانید این است که چگونه از یک مکان به اطراف حرکت کنید. +شما از قبل می دانید که با C-v چگونه یک صفحه به جلو حرکت میکند. +برای حرکت یک صفحه به سمت عقب، M-v را تایپ کنید (کلید META را نگه دارید +و v را تایپ کنید، یا اگر کلید META، یا ALT را ندارید، ‪ v‬را تایپ کنید). + +>> چند بار M-v و سپس C-v را تایپ و امتحان کنید. + +شما می توانید این متن را با روش های دیگری که میدانید اسکرول کنید. + +* خلاصه +--------- + +فرمانهای زیر برای مشاهده کل صفحه نمایش مفید هستند: + +‏ C-v یک صفحه نمایش به جلو حرکت کنید. +‏ M-v یک صفحه نمایش به عقب حرکت کنید. +‏ C-l پاک کردن صفحه و نمایش مجدد تمام متن، + جابجایی مکان نما و متن به مرکز صفحه نمایش + (این CONTROL-L است، نه CONTROL-1.) + +>> مکان‌نما را پیدا کنید و توجه داشته باشید که چه متنی در نزدیکی آن است. + سپس C-l را تایپ کنید. دوباره مکان نما را پیدا کنید وتوجه کنید که هنوز + نزدیک همان متن است. اما مکان نما، اکنون در مرکز صفحه است. + اگر دوباره C-l را فشار دهید، این قطعه متن به بالای صفحه منتقل می شود. + مجددا C-l را فشار دهید، صفحه نمایش دوباره به پایین حرکت می کند. + +اگر ترمینال شما کلیدهای PageUp و PageDn را دارد، میتوانید برای جابه‌جایی یک +صفحه کامل از آنها استفاده کنید. +اما در صورت استفاده از C-v و M-v شما می توانید کارآمدتر ویرایش کنید. + +* کنترل مکان نما +---------------------- + +حرکت از یک صفحه نمایش به صفحه نمایش دیگر مفید است، اما چگونه +به مکان خاصی در متنِ روی صفحه حرکت کنید؟ + +چندین راه وجود دارد که می توانید این کار را انجام دهید. می توانید از +کلیدهای جهت دار استفاده کنید، اما کارآمدتر است که دستان خود را در وضعیت +استاندارد نگه دارید. از فرمانهایِ C-p، C-b، C-f و C-n استفاده کنید. این فرمان ها +معادل چهار کلید جهت دار هستند، مانند: + + سطر قبل، C-p + : + : + به عقب، C-b .... موقعیت مکان نما فعلی .... به جلو، C-f + : + : + خط بعدی، C-n + +>> با استفاده از C-n یا C-p مکان نما را به خط وسط نمودار بالا حرکت دهید. + سپس C-l را تایپ کنید تا کل نمودار را در مرکز صفحه نمایش ببینید. + + +به راحتی می توانید این حروف را با کلماتی که مخفف آنها هستند به خاطر بسپارید: +Previous) p) برای قبلی، Next) n) برای بعدی, Backward) b) برای عقب و +Forward) f) برای جلو. شما همیشه از این فرمانهایِ اصلی تعیین موقعیت مکان نما +استفاده خواهید کرد. + +>> برای پایین آوردن مکان نما به این خط، چند C-n انجام دهید. + +>> حرکت به جلو، روی خط با C-f و سپس به بالا با C-p. + ببینید C-p وقتی مکان نما در وسط خط قرار دارد چه می کند. + +هر خط از متن با یک کاراکترِ Newline به پایان می رسد، که +آن را از خط زیر جدا میکند. (به طور معمول،یک فایل در پایان دارای +یک Newline خواهد بود، اما Emacs به آن نیاز ندارد.) + +>> هنگامی که نشانگر در ابتدای خط است، از C-b استفاده کنید. باید به انتهای + خط قبلی حرکت کند. به این دلیل است که این حرکت از سراسر Newline میگذرد. + +فرمان C-f می تواند مانند C-b روی خط جدید حرکت کند. + +>> چند C-b دیگر انجام دهید، بنابراین می توانید نشانگر را در مکان مورد + نظر قرار دهید. سپس C-f را انجام دهید تا به انتهای خط برگردید. + سپس یک C-f دیگر انجام دهید تا به خط زیر بروید. + + +وقتی از بالا یا پایین صفحه عبور می کنید، متن فراتر می رود +لبه روی صفحه نمایش جابجا می شود. به این "پیمایش یا اسکرول" می گویند. این +Emacs را قادر می سازد تا مکان نما را به مکان مشخص شده در متن منتقل کند +بدون اینکه آن را از صفحه نمایش جدا کنید. + +>> سعی کنید مکان نما را از پایین صفحه با C-n حرکت دهید و + ببیند چه اتفاقی می افتد. + +اگر حرکت بر اساس کاراکترها خیلی کند است، می توانید با کلمات حرکت کنید. M-f +(META-f) یک کلمه را جلو می برد و M-b یک کلمه را به عقب می برد. + +>> چند M-f و M-b تایپ کنید. + +وقتی در وسط یک کلمه هستید، M-f به انتهای کلمه می رود. +هنگامی که در فضای خالی بین کلمات قرار دارید، M-f به انتهای کلمه بعدی منتقل +می شود. M-b نیز در جهت مخالف کار می کند. + +>> فرمان M-f و M-b را چند بار با C-f و C-b در هم آمیخته تایپ کنید، + تا عمل M-f و M-b را از انواع مکان های درون و بین کلمات مختلف مشاهده کنید. + + +به موازات بین C-f و C-b از یک طرف و M-f و M-b از طرف دیگر توجه کنید. + +عملیات مربوط به واحدهای تعریف شده توسط زبان (کلمات، جملات، پاراگراف ها) +اغلب با کاراکترهای متا انجام می شود، +در حالی که کاراکترهای Control بر روی واحدهای اصلی، مستقل از آنچه در حال +ویرایش هستید (حروف، خطوط و غیره) عمل می کنند. + +این توازی بین خطوط و جملات اعمال می شود: C-a و C-e حرکت به +ابتدا یا انتهای یک خط، و M-a و M-e به ابتدا یا پایان یک جمله حرکت می کنند. + + +>>دو C-a، و سپس دو C-e را امتحان کنید. + چند M-a و سپس چند M-e را امتحان کنید. + + +ببینید چگونه C-a های تکراری هیچ کاری انجام نمی دهند، اما M-a های تکراری به +حرکت خود ادامه می دهند. اگرچه اینها کاملاً مشابه نیستند، اما هر یک طبیعی +به نظر می رسد. + + +به مکانِ مکان نما در متن "نقطه" نیز می گویند. +به عبارت دیگر، مکان نما روی صفحه نشان می دهد که نقطه در کجای متن قرار دارد. + + +در اینجا خلاصه ای از عملیات ساده حرکت مکان نما، از جمله +فرمانهایِ حرکت کلمه و جمله نشان داده می شود: + +‏ C-f یک کاراکتر را به جلو حرکت دهید +‏ C-b یک کاراکتر را به عقب حرکت دهید + +‏ M-f یک کلمه را به جلو حرکت دهید +‏ M-b یک کلمه را به عقب حرکت دهید + +‏ C-n به خط بعدی بروید +‏ C-p به خط قبلی بروید + +‏ C-a حرکت به ابتدای خط +‏ C-e حرکت به انتهای خط + +‏ M-a به ابتدای جمله برگردید +‏ M-e حرکت به جلو تا پایان جمله + +>> همه این فرمانها را اکنون چند بار برای تمرین امتحان کنید. + این فرمانها بیشترین استفاده را دارند. + +دو فرمان مهم دیگر حرکت مکان نما عبارتند از‪ M-< :‬ (META کمتر از)، +که به ابتدای کل متن حرکت می کند و ‪M->‬ (META بزرگتر از)، +که به انتهای کل متن می رود. + +در اکثر ترمینالها، ">" بالای کاما است، بنابراین باید با استفاده از کلید +shift آن را تایپ کنید. +در این ترمینالها باید از کلید shift برای تایپ >-M نیز استفاده کنید. +بدون کلید shift، شما کاما، M را تایپ می کنید. + +>> اکنون >-M را امتحان کنید تا به ابتدای آموزش بروید. + سپس از C-v مکرراً برای بازگشت به اینجا استفاده کنید. + +>> اکنون <-M را امتحان کنید تا به انتهای آموزش بروید. + سپس از M-v مکرراً برای بازگشت به اینجا استفاده کنید. + +همچنین می توانید مکان نما را با کلیدهای جهت دار حرکت دهید، اگر ترمینال شما +آن را داشته باشد. ما استفاده از C-b، C-f، C-n و C-p را به سه دلیل توصیه میکنیم. + +اول، آنها بر روی انواع ترمینالها کار می کنند. +دوم, هنگامی که مهارت شما در استفاده از Emacs بیشتر شود، متوجه خواهید شد که +تایپ با کنترل کاراکترها، سریعتر از تایپ کلیدهای جهت دار است. +(زیرا احتیاج نیست که شما دستان خود را از موقعیت تایپ لمسی دور کنید). +سوم، وقتی شما عادت به استفاده از فرمانهایِ کاراکتر Control را دارید، می توانید +به راحتی یاد بگیرید که از دیگر فرمانهایِ پیشرفته حرکت مکان نما نیز استفاده کنید. + +اکثر فرمانهایِ Emacs یک آرگومان عددی را می پذیرند. برای اکثر فرمانها، این +به عنوان یک شمارش تکرار عمل می کند. +نحویِ تحویل تعداد تکرار، با تایپ C-u و سپس اعداد قبل از تایپ فرمان است. اگر +شما یک کلید META (یا ALT) دارید، راه جایگزینی دیگری برای وارد کردن +آرگومان عددی وجود دارد: ارقام را در حالی که کلید META را نگه داشته‌اید +تایپ کنید. ما توصیه می کنیم استفاده از C-u را یاد بگیرید زیرا در هر ترمینال +کار می کند. آرگومان عددی "آرگومان پیشوند" نیز نامیده می شود. +زیرا آرگومان را قبل از فرمانی که روی آن اعمال می شود تایپ می کنید. + +به عنوان مثال، C-u 8 C-f هشت کاراکتر به جلو حرکت می کند. + +>> سعی کنید فقط با یک فرمان، C-n یا C-p با آرگومان عددی برای حرکت مکان نما + از خط نزدیک به این خط استفاده کنید. + +اکثر فرمانها از آرگومان عددی به عنوان تعداد تکرار استفاده می کنند، +اما برخی فرمانها از آن به روش دیگری استفاده می کنند. +چندین فرمان که از آن به عنوان یک علامت تعغیر استفاده میشود. +(اما هیچ کدام از فرمانهایِی که تا به حال آموخته اید نیستند.) +وجود یک آرگومان پیشوند، صرف نظر از مقدار آن، فرمان متفاوتی را انجام می دهد. + +‏C-v و M-v استثناهای دیگری هستند. با تحویل آرگومان، +آنها متن را با این تعداد خط به بالا یا پایین اسکرول می کنند نه با یک +صفحه نمایش. برای مثال، C-u 8 C-v هشت خط پیمایش می کند. + +>> اکنون C-u 8 C-v را تایپ کنید. + +این فرمان باید متن را 8 خط به بالا اسکرول کند. اگر مایل باشید +دوباره به پایین برگردید، می توانید یک آرگومان به M-v بدهید. + +اگر از یک سیستم نمایشِ گرافیکی مانند X یا MS-Windows استفاده می کنید، +باید یک ناحیه مستطیل شکل بلند به نام نوار پیمایش در یک طرف پنجره Emacs +وجود داشته باشد. با کلیک کردن بر روی نوار، متن را اسکرول کنید. + +اگر ماوس شما دگمه چرخ دارد، می توانید از آن برای اسکرول نیز استفاده کنید. + + +* اگر EMACS پاسخ نمی دهد. +--------------------------- + +اگر Emacs به فرمانهایِ شما پاسخ نمی دهد، می توانید با خیال راحت با +تایپ کردن C-g آن را متوقف کنید. می توانید از C-g برای متوقف کردن فرمانی که +انجامش طولانی شده است استفاده کنید. + +همچنین می‌توانید از C-g برای حذف یک آرگومان عددی یا ابتدای فرمانی که +نمی خواهید آن را تمام کنید استفاده کنید. + +>> با عمل C-u 100 یک آرگومان عددی 100 بسازید، سپس C-g وبعد از آن + C-f را تایپ کنید. بااین فرمانها فقط یک حرف به جلو حرکت می کنید، زیرا شما + آرگومان را با C-g لغو کرده اید. + +اگر یک را اشتباه تایپ کرده اید، می توانید با یک C-g از شر آن خلاص شوید. + + +* فرمانهایِ غیر فعال +------------------- + +برخی از فرمانهایِ Emacs "غیرفعال" هستند تا کاربران مبتدی نتوانند +از آنها به طور تصادفی استفاده کنند. + +اگر یکی از فرمانهایِ غیرفعال را تایپ کنید، Emacs پیامی را نمایش می دهد +که فرمان چیست و از شما می پرسد که آیامایل به اجرای آن هستید؟ + +اگر واقعاً می خواهید فرمان را اجرا کنید، (نوار فاصله) را در پاسخ به +سوال تایپ کنید. به طور معمول، اگر نمی خواهید آن را اجرا کنید، به سوال با +"n" پاسخ دهید. + +>> عمل C-x C-l (که یک فرمان غیرفعال است) را انجام دهید، + سپس n را در پاسخ به سوال تایپ کنید. + + +* پنجره ها +---------- + +با Emacs می تواند چندین "پنجره" داشته باشد که هر کدام متن خاص خود را نشان +می دهد. ما بعداً در مورد نحوه استفاده از چندین پنجره توضیح خواهیم داد. در +حال حاضر می خواهیم برای نحوه حذف پنجره های اضافی و بازگشت به حالت اولیه +ویرایش یک پنجره توضیح دهیم. این عمل آسان است: + +‏ C-x 1 یک پنجره (یعنی تمام پنجره های دیگر را حذف کنید). + +فرمان C-x 1 پنجره ای تمام صفحه، که حاوی مکان نما است را باز می کند. +این فرمان تمام پنجره های دیگر را حذف میکند. + + +>> مکان نما را به این خط ببرید و C-u 0 C-l را تایپ کنید. +>> C-h k C-f را تایپ کنید. + ببینید چگونه این پنجره کوچک می شود، در حالی که یک پنجره جدید برای نمایش + اطلا عات در فرمان C-f ظاهر می شود. + + +>> با تایپ C-x 1 پنجره فهرست اسناد ناپدید می شود. + +یک سری کامل از فرمانها با CONTROL-x شروع می شوند. بسیاری از +آنها با ویندوز، فایل ها، بافرها و موارد وابسته ارتباط دارند. +این فرمانها دو، سه یا چهار کاراکتر هستند. + + +* درج و حذف +------------ + +اگر می خواهید متن را وارد کنید، فقط متن را تایپ کنید. حروف معمولی، +مانند A، 7، *، و غیره، هنگام تایپ آنها نوشته می شوند. برای انجام نوشتن + خط جدید، را تایپ کنید (این کلید روی صفحه کلید است +که گاهی اوقات با عنوان "Enter" شناخته می شود). + +برای حذف کاراکترِ قبل از مکان نمای فعلی ، را تایپ کنید. این کلید روی +صفحه کلید است که معمولاً با برچسب "Backspace"است −− همان که معمولاً در خارج +از Emacs نیز برای حذف آخرین حرفِ نوشته شده استفاده می کنید. + + +همچنین ممکن است کلید دیگری روی صفحه کلید شما با عنوان وجود داشته +باشد، اما این چیزی نیست که ما در Emacs به آن می گوییم. + +>> اکنون این کار را انجام دهید - چند کاراکتر را تایپ کنید، سپس آنها را حذف + کنید. چند بار را تایپ کنید. نگران این فایل نباشید در حال تغییر؛ + شما آموزش اصلی را تغییر نمی دهید. این کپی شخصی شما از آن است. + +وقتی نوشتن یک خط در متن بیش از حد طولانی می شود، خط بر روی سطر دوم صفحه +"ادامه" می یابد. اگر از یک صفحه نمایش گرافیکی استفاده می کنید برای نشان +دادن جایی که یک خط ادامه یافته است فلش های منحنی کوچکی در فضاهای باریک در +دو طرف ناحیه متن (حاشیه‌های چپ و راست ) ظاهر می شوند. اگر از ترمینال متنی +استفاده می کنید، خطِ ادامه یافته با علامت معکوس ('\') در سمت راست ستون +صفحه نمایش نشان داده می شود. + + +>> به نوشتن متن پس از رسیدن به انتهای خط ادامه دهید. +خواهید دید که یک خطِ ادامه ظاهر می شود. + +>> از برای حذف متن استفاده کنید تا زمانی که نوشته مجدداً روی یک خط + صفحه قرار گیرد. خط ادامه از بین می رود. + +شما می توانید حروف خط جدید را مانند هر حرف دیگری حذف کنید. حذف کاراکتر +Newline بین دو خط آنها را با هم ادغام می کند. اگر خط ترکیبی به دست آمده +بیش از حد طولانی باشد که در آن جا نمی شود، عرض صفحه نمایش، با یک خط ادامه، +نمایش داده می شود. + +>> مکان نما را به ابتدای یک خط ببرید و را تایپ کنید. این فرمان + آن خط را با خط قبلی ادغام می کند. + +>> حالا را تایپ کنید تا خط جدیدی را که حذف کرده اید دوباره وارد کنید. + +کلید ویژه است، زیرا با فشار دادن آن ممکن است بیش از این کار انجام شود. +فقط یک کاراکتر Newline وارد کنید. بسته به متن اطراف، +ممکن است بعد از کاراکتر Newline فضای خالی را وارد کند، به طوری که وقتی +شما شروع به تایپ کردن در خط جدید می کنید، متن با خط قبلی آن ردیف می شود. +ما به این رفتار (که در آن فشار دادن یک +کلید چیزی بیش از وارد کردن کاراکتر مربوطه انجام می دهد) می گوییم "electric". + +>> در اینجا مثالی از الکتریکی بودن آورده شده است. + را در انتهای این خط تایپ کنید. + +باید ببینید که بعد از درج Newline فاصله ها هم درج می شوند، +به طوری که مکان نمابه جای مناسب حرکت می کند. + +به یاد داشته باشید که به اکثر فرمانهایِ Emacs می توان تعداد تکرار، داده شود. +این شامل کاراکترهای متنی نیز است. تکرار درج کاراکتر متنی برای چندین بار. + + +>> اکنون آن را امتحان کنید - ‪ C-u 8 *‬ را برای درج ******** تایپ کنید. + +شما اکنون ابتدایی ترین راه را برای تایپ با Emacs و تصحیح خطاها یاد گرفته اید. +شما می توانید کلمات یا خطوط را نیز حذف کنید. +در اینجا خلاصه ای از عملیات حذف آمده است: + + ‏ کاراکتر را درست قبل از مکان نما حذف می کنید. + ‏ C−d کاراکتر بعدی، بعد از مکان نما را حذف می کنید. + + ‏ و C-d در مقابل واقعاً یک کاراکتر کنترلی نیست، اما +بیایید نگران این نباشیم). C-k و M-k مانند C-e و M-e هستند، به نوعی، در آن +خطوط با جملات جفت می شوند. + +شما همچنین می توانید یک بخش از متن را با یک روش یکسان حذف کنید . به انتهای +یک قسمت حرکت کنید، و سپس کلید نوار Space +است.) سپس مکان نما را به انتهای دیگر متنی که قصد دارید حذف کنید، ببرید. +با انجام این کار، Emacs متن بین مکان نما وموقعیتی که با > مکان نما را در ابتدای پاراگراف قبلی به «ش» حرکت دهید. + +>> با تایپ > در خط دوم ازمتن، مکان نما را به «ی» در "یک"، حرکت دهید. + +‏>> C-w را تایپ کنید. با این کار متنی که از «ش» شروع می شود و درست قبل از +«ی» به پایان می رسد را از بین می برید. + +تفاوت بین "کشتن" و "حذف" در همان متن این است که "کشته" را می توان دوباره +درج کرد (در هر موقعیتی)، در حالی که چیزهای "حذف شده" را نمی توانید به این +روش دوباره درج کنید (اما می توانید حذف را لغو کنید - در زیر ببینید.) درج +مجدد متن کشته شده "yanking" نامیده می شود. ( به عنوان عقب نشینی یا عقب +کشیدن متنی که برداشته شده است به آن فکرکن.) + +به طور کلی، فرمانهایِی که می توانند متن زیادی را حذف کنند، متن را «میکشند». +(آنها به گونه ای تنظیم شده اند که بتوانید متن را باز گردانند)، در حالی که +فرمانهایِی که فقط یک کاراکتر را حذف می کند، یا فقط خطوط و فاصله های خالی را +حذف می کند، حذف را انجام می دهند (بنابراین نمی توانید آن متن را برگرداند). + و C-d در ساده ترین حالت، بدون هیچ آرگومان حذف را انجام می دهند.وقتی +آرگومان به آنها داده می شود درعوض مکشند. + +>> مکان نما را به ابتدای خطی که خالی نیست حرکت دهید. +سپس C-k را تایپ کنید تا متن روی آن خط حذف شود. + +>> بار دوم C-k را تایپ کنید. خواهید دید که Newline را می کشد که بعد از آن + خط است. + +توجه داشته باشید که یک C-k محتویات خط را می کشد و یک C-k ثانوی خود خط را +می کشد و همه خطوط دیگر را به سمت بالا حرکت می دهد. C-kبه طور خاص با یک +آرگومان عددی برخورد می کند: این تعداد خطوط و محتویات آنهارا میکشد. این +صرفا یک تکرار نیست. C-u 2 C-k دو خط و Newline آنها را می کشد. دو بار تایپ +کردن C-k این کار را نمی کند. + +می‌توانید متن کشته‌شده را در همان مکانی که در آن قرار داشت، باز گردانید. +یا در جای دیگری از متنی که در حال ویرایش آن هستید، یا حتی در +یک فایل متفاوت می‌توانید یک متن را چندین بار باز گردانید. که +چندین کپی از آن می سازد. با مراجعه به کتابچه راهنمایِ Emacs در موارد "کشتن" و +انحرافِ "برش" و "چسباندن" میتوانید اطلاعات بیشتری کسب کنید. + + +فرمانِ‪"yank" ,C-y ‬ است. آخرین متن کشته شده را در موقعیت مکان نما فعلی دوباره +درج می کند. + + +>> آن را امتحان کنید. C-y را تایپ کنید تا متن را به عقب برگردانید. + +اگر چندین C-k را پشت سر هم انجام دهید، تمام متن کشته شده ذخیره می شود، + به طوری که یک C-y همه خطوط را به یکباره انحراف می دهد. + +>> اکنون این کار را انجام دهید، C-k را چندین بار تایپ کنید. + +حال برای بازیابی آن متن کشته شده: + +‏>> C-y را تایپ کنید. سپس مکان نما را چند خط پایین ببرید و دوباره C-y را +تایپ کنید اکنون نحوه کپی کردن متن را مشاهده می کنید. + +اگر متنی داشته باشید که می خواهید به عقب برگردید، چه کار می کنید چیز دیگری +می کشید؟ C-y کشتن اخیر را از بین می برد. ولی متن قبلی گم نمی شود می توانید +با استفاده از M-y به آن برگردید فرمان بعد از اینکه C-y را برای دریافت +آخرین kill انجام دادید، تایپ کنید M-y آن متن یاک شده را با kill قبلی +جایگزین می کند. تایپ کردن M-y بارها و بارها کشتارهای قبلی و قبلی را به +ارمغان می آورد. وقتی به متن مورد نظر رسیدید، لازم نیست کاری انجام دهید تا +نگهش دارید. فقط به ویرایش خود ادامه دهید و متن انحرافی را رها کنید. + +اگر تعداد M-y به دفعات کافی داشته باشید، به نقطه شروع باز می گردید +(بیشترین کشتن اخیر). + +>> یک خط را بکشید، در اطراف حرکت کنید، یک خط دیگر را بکشید. + سپس C-y را انجام دهید تا دومین خط کشته شده را برگردانید. + سپس M-y را انجام دهید تا اولین خط کشته شده جایگزین آن شود. + M-y های بیشتری انجام دهید و ببینید چه چیزی به دست می آورید. به انجام + آنها ادامه دهید تا زمانی که خط کشتن دوم برمی گردد، و سپس چند بار دیگر. + اگر دوست دارید، می‌توانید امتحان کنیدو به M-y آرگومانهای مثبت و منفی + بدهید. + + + +* لغو +------ + +اگر تغییری در متن ایجاد کنید و سپس تصمیم به برگرداندن آن تغییر بگیرید، +شما می توانید تغییر را با فرمان ‪(undo) C-/‬ لغو کنید. + +به طور معمول، ‪ C-/‬ تغییرات ایجاد شده توسط یک فرمان را خنثی می کند. +اگر ‪ C-/‬ را چندین بار پشت سر هم، تکرار کنید هر تکرار یک فرمان دیگر +را خنثی می کند. + +اما دو استثنا وجود دارد: فرمانهایِی که متن را تغییر نمی دهند +به حساب نمی آیند (این شامل فرمانهایِ حرکت مکان نما و فرمانهایِ اسکرول می شود.) +و کاراکترهای خود درج معمولاً در گروهای، تا ۲۰ تایی رسیدگی می شوند. +(این برای کاهش تعداد‪ C-/ ‬ هایی است که باید برای لغو درج متن) تایپ کنید. + + +>> این خط را با C-k بکشید، سپس /-C را تایپ کنید تا دوباره ظاهر شود. ـ-C یک + فرمان لغو جایگزین است. دقیقاً مانند‪ C-/ ‬ کار می کند. در برخی از پایانه + های متنی، تایپ‪ C-/ ‬ در واقع _-C را به Emacs ارسال می کند. از طرف + دیگر، C-x u نیز دقیقاً مانند‪ C-/ ‬ کار می کند، اما کمی کمتر است و راحتر + تایپ میشود. + + +یک آرگومان عددی /-C-_ ، C, یا C-x u به عنوان یک تعداد تکرار عمل می کند. + +همانطور که می توانید حذف متن را لغو کنید، می توانید کشتن متن رانیز لغو کنید. +تمایز بین کشتن چیزی و حذف آن در مورد C-y تأثیر می گذارد، برای لغو فرقی نمی کند. + + +* فایل ها +--------- + +برای اینکه متنی را که ویرایش می کنید دائمی کنید، باید آن را در یک فایل +قرار دهید. در غیر این صورت، با خروج از Emacs از بین می رود. برای اینکه متن +خود را در یک فایل قرار دهید، قبل از وارد کردن فایل باید آن را "پیدا کنید". +(به این "بازدید از فایل" نیز گفته می شود.) + +پیدا کردن یک فایل به این معنی است که شما محتویات فایل را در داخل Emacs +می بینید از بسیاری جهات، گویی در حال ویرایش خود فایل هستید. با این حال، +تغییراتی که با استفاده از Emacs ایجاد می کنید دائمی نمی شوند تا زمانی که +فایل را "ذخیره" کنید. این به این دلیل است که شما بتوانید از ذخیره کردن +فایل نیمه کامل اجتناب کنید. حتی هنگامی که فایل را ذخیره کردید Emacs فایل +اصلی را با نام دیگری برایتان نگه میدارد، چون ممکن است بعداً تصمیم بگیرید که +تغییرات شما اشتباه بوده است. + +اگر به پایین صفحه نگاه کنید، خطی را خواهید دید که +با حروف "−" شروع می شود و چیزی مانند: "TUTORIAL ---:-" در آن را نشان می دهد. +این قسمت از صفحه نمایش معمولاً نام فایلی که در حال حاضر از آن بازدید می +کنید را نشان میدهد. شما اکنون در حال بازدید از کپی شخصی آموزش Emacs خود که +"TUTORIAL" نام دارد هستید. وقتی شما یک فایل را با Emacs پیدا کردید، نام آن +فایل بطور دقیق در همان نقطه ظاهر می شود. + +یک مورد خاص در مورد فرمان برای یافتن یک فایل این است که شما باید بگویید چه +نام فایلی را می خواهید. ما می گوییم فرمان "خواندن یک ارگومان" +(در این مورد، آرگومان نام فایل است.)بعد از تایپ فرمان. + + +با C-x C-f یک فایل را پیدا کنید. Emacs از شما می خواهد که نام فایل را تایپ +کنید. نام فایلی که تایپ می کنید در خط پایین صفحه نمایش ظاهر می شود. خط +پایین زمانی که برای این نوع ورودی استفاده می شود، «مینی بافر» نامیده می +شود. شما می توانید ازفرمانهایِ ویرایش معمولی Emacs برای ویرایش نام فایل +استفاده کنید. + +در حالی که نام فایل (یا هر ورودی مینی بافر دیگر) را وارد می کنید، +می توانید با C-g فرمان را لغو کنید. + +>> فرمانِ C-x C-f را تایپ کنید، سپس C-g را تایپ کنید. این فرمانِ مینی بافر + را لغو می کند، و همچنین فرمان C-x C-f را که مینی بافر از آن استفاده می + کرد را لغو می کند، بنابراین شما هیچ فایلی را پیدا نمی کنید. + +وقتی نام فایل را وارد کردید، را تایپ کنید تا +آن را خاتمه دهید. مینی بافر ناپدید می شود و فرمان C-x C-f +برای یافتن فایلی که انتخاب کرده اید اعمال میشود. + +محتویات فایل اکنون روی صفحه ظاهر می شود و می توانید آن را ویرایش کنید. +هنگامی که می خواهید تغییرات خود را دائمی کنید، فرمان + +‏ C-x C-s فایل را ذخیره کنید + +این فرمان متن را در فایل درون Emacs کپی می کند. اولین باری که این +کار را انجام دهید، Emacs نام فایل اصلی را به نام جدید تغییر می دهد بنابر این +گم نمی شود. نام جدید با افزودن "~" به انتهای نام فایل اصلی ساخته می شود. +هنگامی که ذخیره به پایان رسید، Emacs نام فایل نوشته شده را نمایش می دهد. + + +‏>> > اکنون C-x C-b را امتحان کنید. + +ببینید که چگونه هر بافر یک نام دارد و همچنین ممکن است نام فایلی که محتویات +آن را نگه می دارد داشته باشد. هر متنی که در پنجره Emacs می بینید همیشه +بخشی از یک بافر است. + +>> با تایپ C-x 1 میتوانید از شر لیست بافر خلاص شوید. + +هنگامی که چندین بافر دارید، در هر زمان تنها یکی از آنها "جاری" است. آن +بافر همان بافری است که شما ویرایش می کنید. اگر می خواهید بافر دیگری را +ویرایش کنید، باید به آن "سوئیچ" کنید. اگر می خواهید به یک بافر سوئیچ کنید +که مربوط به یک فایل است، می توانید با مراجعه مجدد به آن فایل با C-x C-f +این کار را انجام دهید. اما یک راه ساده تر وجود دارد: از فرمان C-x b +استفاده کنید. در آن فرمان باید نام بافر را تایپ کنید. + +>> با تایپ ‪C-x C-f foo ‬ فایلی به نام "foo" ایجاد کنید. + سپس ‪ C-x b TUTORIAL ‬ را تایپ کنید تا به این آموزش بازگردید. + +اغلب اوقات، نام بافر با نام فایل یکی است(بدون قسمت پوشه فایل). به هر حال، +این همیشه درست نیست. لیست بافری که با C-x C-b ایجاد می کنید، نام هر دو +بافر و نام فایل هر بافر را به شما نشان می دهد. + +برخی از بافرها با فایل ها مطابقت ندارند. بافری با نام "*Buffer List*" که +حاوی لیست بافری است که شما آن را با C-x C-b ساخته اید هیچ فایلی ندارد. این +‪TUTORIAL buffer‬ که در ابتدا انجام شد فایلی ندارد، اما اکنون دارد، زیرا +قبلا شما C-x C-s را تایپ کردید و آن را در یک فایل ذخیره کرده اید. + +بافر ی با نام "*Messages*" نیز با هیچ فایلی مطابقت ندارد. این بافر حاوی +پیام هایی است که در در طول جلسه Emacs شما، در خط پایین ظاهر شده اند. + +>> حالا < C-x b *Messages* > یک خط متن وارد کنید، سپس C-x s را تایپ کنید. + باید از شما بپرسد که آیا بافر با نام TUTORIAL را ذخیره می کنید یا خیر. + با تایپ "y" به سوال پاسخ مثبت دهید. + + +* گسترش مجموعه فرمانها +--------------------------- + +فرمانهایِ Emacs بسیار بسیار بیشتر است از آنچه که امکان قراردادن همه آنها +با کاراکترها ی کنترل و متا باشد. + Emacs با فرمان( X (eXtend این کار را میسر میکند. +دو حالت برای این وجود دارد: + +‏ C-x کاراکتر برای eXtend. بعد از یک کاراکتر. +‏ M-x فرمانی با نام eXtend. بعد از یک نام طولانی. + +اینها فرمانهایی هستند که عموما مفید هستند، اما کمتر ازفرمانهایی که قبلاً در +مورد آنها آموخته اید استفاده می شوند. شما قبلاً چند مورد از انها را +دیده‌اید: برای مثال فرمان فایل C-x C-f را برای یافتن و C-x C-s را برای +ذخیره کردن در نظر بگیرید. مثال دیگر، فرمان C-x C-c فرمان پایان دادن به جلسه +Emacs است. (نگران از دست دادن تغییراتی که ایجاد کرده اید نباشید C-x C-c +پیشنهاد می کند هر فایل تغییر یافته را ذخیره کنید قبل از اتمام جلسه Emacs.) + + +اگر از صفحه نمایش گرافیکی استفاده می کنید، نیازی به فرمان خاصی برای انتقال +از Emacs به برنامه دیگر ندارید. شما می توانید این کار رابا ماوس یا با +فرمانهای مدیر پنجره انجام دهید. با این حال،اگر شمااز ترمینال متنی که می +تواند تنها یک برنامه را در یک زمان نشان دهد، استفاده می کنیدباید Emacs را +"تعلیق" کنید تا به هر برنامه دیگری بروید. + +فرمان C-z خروج *موقت*--- از Emacs است تا بتوانید به همان جلسه Emacs +برگردید. هنگامی که Emacs روی یک ترمینال متنی اجرا می شود، C-z، Emacs را به +حالت تعلیق در می آورد. یعنی به shell برمی گردد اما کار Emacs را از بین نمی +برد. در رایج ترین shell ها، شما می تواند Emacs را با فرمان "fg" یا با‪ +"%emacs"‬ از سر بگیرد. + +زمان استفاده از C-x C-c زمانی است که می خواهید از سیستم خارج شوید. همچنین +برای خروج از Emacs و ویرایش سریع استفاده می شود، همانند یک ابزار مدیریت +ایمیل. + +فرمانهای C-x زیادی وجود دارد. در اینجا لیستی از مواردی که یاد گرفته اید است: + +‏ C-x C-f فایل را پیدا کنید +‏ C-x C-s ذخیره فایل +‏ C-x s برخی از بافرها را ذخیره کنید +‏ C-x C-b لیست بافرها +‏ C-x b سوئیچ بافر +‏ C-x C-c از Emacs خارج شوید +‏ C-x 1 تمام پنجره ها را به جز یک حذف کنید +‏ C-x u لغو فرمان + +فرمانهایی با نام eXtended فرمانهایی هستند که به طور مکرر کمتر مورد استفاده +قرار می گیرند یا فرمانهایی که فقط در حالت های خاصی استفاده می شوند. +به عنوان یک مثال فرمان replace-string است که یک رشته حروف را جایگزین رشته +حروف دیگری در بافر می کند. وقتی M-x را تایپ می‌کنید، Emacs درپایین صفحه با +نشان دادنِ M-x از شما می‌خواهد نام فرمان را تایپ کنید؛ در اینجا یعنی +"replace-string". فقط " کلید Tab است که معمولاً جایگاهش بالای کلید CapsLock یا +Shift نزدیک لبه سمت چپ کیبورد است.) نام کامل شده فرمان را با +ارسال کنید. + +فرمان replace-string به دو آرگومان نیاز دارد -- رشته جایگزین شونده +و رشته ای که جایگزین آن شود.شما باید هر آرگومان رابا پایان دهید. + + +>> مکان نما را به خط خالی دو خط زیر این یکی ببرید. + سپس < M-x repl schangedaltered بازیابی کنید . هنگامی که +تأیید آن را می خواهد،< yes> تایپ کنید < M-x text-mode > مکان نما را به خط زیر این خط ببرید. +>> C-l C-l را تایپ کنید تا این خط به بالای صفحه نمایش داده شود. +>> C-h m را تایپ کنید تا ببینید مدِ Text با مدِ Fundamental چه تفاوتی دارد. +>> C-x 1 را تایپ کنید تا اطلاعات امدادی را از روی صفحه حذف کنید. + +مد ماژور را ماژر می نامند زیرا مد ماینور نیز وجود دارد. مدهای ماینور +جایگزینی برای مدهای ما‍‍‍ژور نیستند، فقط آنها را تغیر و تبدیل می کنند. هر مد +ماینور می تواند خودش مستقلانه روشن یا خاموش گردد، مستقل ازتمام مدهای +ماینور دیگر،و مستقل از مد ماژر فعلی شما. بنابراین می توانید از هیچ مد +ماینور، یک مد ماینور و یاترکیبی از چند مد ماینور استفاده کنید. + + +یک مد ماینور که بسیار مفید است، به خصوص برای ویرایش متن به زبان انسانی +(human-language)، مد ماینورِ خود−پر کن (Auto Fill mode) است. وقتی این مد +روشن است, و شما با نوشتن متن، خطی بوجود می آورد که خیلی طولانی است،Emacs +خط بین کلمات را به طور خودکار می شکند. + + +شما می توانید با انجام >اکنون C-x f را با آرگومان 20 تایپ کنید. (C-u 2 0 C-x f). + سپس مقداری متن را تایپ کنید و سپس ببینید Emacs، خطوط 20 کاراکتری را با + آن پر می کنید. سپس با استفاده از C-x f، دوباره حاشیه را به 70 + برگردانید. + + +اگر در وسط پاراگراف تغییراتی ایجاد کردید، حالت پر کردن خودکار دوباره آن را +برای شماپر نمی کند. برای پر کردن مجدد پاراگراف، M-q (META-q) رابا مکان نما +در داخل آن پاراگراف تایپ کنید. + + +>> مکان نما را به پاراگراف قبلی ببرید و M-q را تایپ کنید. + + +* جستجوکردن +----------- + +با Emacs می توانید رشته ها را جستجو کند («رشته:string » گروهی از +کاراکترهای به هم پیوسته است). جستجو به جلو در متن یا به عقب در متن. +جستجوی برای یک string یک فرمان حرکت مکان نما است. آن مکان نما را به مکان +بعدی که آن رشته ظاهر می شود حرکت می دهد. + +فرمان جستجوی Emacs "افزایشی" است. این بدان معنی است که +جستجو زمانی اتفاق می افتد که رشته مورد نظر را برای جستجو تایپ می کنید. + +فرمان شروع جستجو C-s برای جستجوی جلو و C-r برای جستجوی معکوس است. +اما صبر کنید! اکنون آنها را امتحان نکنید. + +وقتی C-s را تایپ می کنید متوجه خواهید شد که رشته "I-search" به صورت یک +اعلان در ناحیه اکو ظاهر می شود. این به شما می گوید که Emacs مشغول کاری است +که یک جستجوی افزایشی نامیده می شود و در آن حالت منتظر شماست تامورد جستجو +را تایپ کنید. یک جستجو را خاتمه می دهد. + +>> اکنون C-s را برای شروع جستجو تایپ کنید + کلمه"مکان نما" را به آرامی، با تک تک حروف تایپ کنید، پس از تایپ + هر کاراکتر مکث کنید, تا متوجه آنچه برای مکان نما اتفاق می افتد شوید. + اکنون یک بار "مکان نما" را جستجو کرده اید. +>> دوباره تایپ کنید C-s، برای جستجوی رخداد بعدی "مکان نما". +>> اکنون را چهار بار تایپ کنید و ببینید مکان نما چگونه حرکت می کند. +>> برای پایان یافتن جستجو، را تایپ کنید. + +دیدید چه اتفاقی افتاد؟ Emacs، در یک جستجوی افزایشی، سعی می کند +به رخداد رشته ای که تاکنون تایپ کرده اید بروید. +برای رفتن به رخداد بعدی "مکان نما"، فقط C-s را دوباره تایپ کنید. اگر چنین +رخدادی وجود ندارد، Emacs بوق می‌زند و به شما می‌گوید جستجو در حال حاضر +"شکست" خرده است. C-g نیز جستجو را خاتمه می دهد. + +اگر در وسط یک جستجوی افزایشی هستید و را تایپ کنید، +جستجو، "عقب نشینی" به مکان قبلی میکند. اگر برای پیشرفت جستجوی رشته ای بعدی، +بعد از اینکه C-s را تایپ کردید را تایپ کنید، + مکان نما را به یک اتفاق قبلی برمی گرداند. اگر +هیچ مورد قبلی در رشته جستجو وجود نداشته باشد، آخرین کاراکتر را +در رشته جستجوپاک می کند. + برای مثال، فرض کنید "م" را تایپ کرده اید +برای اولین بار "م" را جستجو کنید. حالا اگر "ک" را تایپ کنید، +مکان نما به اولین رخداد "مک" حرکت می کند. حالا را تایپ کنید. +این "ک" را از رشته جستجو پاک می کند و مکان نما به به اولین وقوع "م" در +رشته جستجو به عقب برمی گردد. + +اگر در وسط یک جستجو هستید و کاراکتر کنترل یا متا را تایپ کنید، +شخصیت (به استثنای معدود کاراکتر هایی که در یک جستجو خاص هستند، +مانند C-s و C-r)، جستجو خاتمه می یابد. + +با C-s جستجو را بعد از موقعیت مکان نمای فعلی شروع می کنید و هر رخدادی از رشته +بعد از مکان نما جستجو می شود. اگر می خواهید چیزی در متن قبل از مکان نما جستجو +شود، به جای آن، C-r را تایپ کنید. همه چیزهایی که ما در مورد C-s +گفته ایم برای C-r نیز صدق می کند، با این تفاوت که جهت جستجو معکوس می شود. + + +* پنجره های چندگانه +-------------------- + +یکی از ویژگی های خوب Emacs این است که می توانید در یک زمان بیشتر ازیک +پنجره روی صفحه نمایش نشان دهید. (توجه داشته باشید که Emacs ازاصطلاح +"frames"-- که در بخش بعدی توضیح داده شده است -- برای برخی کاربرد دیگر +"windows" گفته می شود. کتابچه راهنمای Emacs حاوی واژه نامه ای ازشرایط +استفاده Emacs.) + +>> مکان نما را به این خط ببرید و C-l C-l را تایپ کنید. + +>> حالا C-x 2 را تایپ کنید که صفحه را به دو پنجره تقسیم می کند. هر دو + پنجره این آموزش را نمایش می دهند. مکان نمای ویرایش در پنجره بالا باقی + می ماند. + +>> تایپ C-M-v برای رفتن به پایین پنجره . + (اگر کلید META واقعی ندارید، C-v را تایپ کنید.) + +>> تایپ کنید C-x o ("o" برای "other"دیگر ) برای حرکت مکان نما به پنجره پایین. +>> از C-v و M-v در پنجره پایین برای پیمایش استفاده کنید. + به خواندن این فرمانهای عمل، در پنجره بالا ادامه دهید. + +>> دوباره C-x o را تایپ کنید تا مکان نما را به پنجره بالا برگردانید. + مکان نما در پنجره بالا دقیقاً همان جایی است که قبلا بود. + +می توانید از C-x o برای جابجایی بین پنجره ها استفاده کنید. "پنجره انتخاب +شده" جایی که بیشترین ویرایش در آن صورت می گیرد، همان پنجره ای است که مکان +نما برجسته است، و زمانی که تایپ نمی کنید چشمک می زند. پنجره های دیگر +موقعیت مکان نمای خود را دارند. اگر Emacs را به صورت گرافیکی اجرا می کنید، +آن مکان نماها به صورت کادرهای توخالی بدون چشمک‌زن ترسیم می‌شوند. + + +فرمان C-M-v هنگامی که متن را در یک پنجره ویرایش می کنید و از پنجره دیگر +فقط برای مرجع استفاده میکند، بدون ترک پنجره انتخاب شده، بسیار مفید است. +می توانید متن را باC-M-v در پنجره دیگر پیمایش کنید. + +مثال C-M-v نمونه ای از یک کاراکتر CONTROL-META است. اگر یک کلید META +‪(Alt یا)‬ دارید با نگه داشتن هر دو کلید CONTRO و META و تایپ v, +میتوانید C-M-v را تایپ کنید. مهم نیست که CONTROL اول باشد یا META. +زیرا هر دوی این کلیدها با تغییر کاراکترهای شما عمل می کنند. + + +اگر کلید META ندارید و به جای آن از استفاده می کنید، مهم است که +ترتیب را انجام دهید: باید و سپس CONTROL-v را تایپ کنید، زیرا +CONTROL- v کار نخواهد کرد. این به این دلیل است که در نوع خود +یک کاراکتر است، نه یک کلید اصلاح کننده. + +>> با تایپ C-x 1 (در پنجره بالا) از شر پنجره پایین خلاص شوید. + +(اگر C-x 1 را در پنجره پایین تایپ کرده بودید، پنجره بالا خلاص می شد. این +فرمان را به صورت «فقط یک پنجره را -- هم آنکه هم اکنون در آن هستم نگه دار» +در نظر بگیرید. + + +شما مجبور نیستید یک بافر را در هر دو پنجره نمایش دهید. اگر شما از C-x C-f +برای پیدا کردن فایل در یک پنجره استفاده کنید، در پنجره دیگر تغییر ایجاد +نمی شود. شما می توانید یک فایل را در هر پنجره به طور مستقل پیدا کنید. + +در اینجا روش دیگری برای استفاده از دو پنجره برای نمایش دو چیز مختلف وجود دارد: + +>> فرمان C-x 4 C-f و سپس نام یکی از فایل های خود را تایپ کنید. + با خاتمه دهید. ببینید فایل مشخص شده در پایین ظاهر می شود و + پنجره مکان نما نیز به آنجا می رود. + +>> برای بازگشت به پنجره بالا C-x o و برای حذف پنجره پایین C-x 1 را تایپ کنید. + + +*فریم های چندگانه (MULTIPLE FRAMES) +---------------------------------- + +با Emacs همچنین می توانید چندین "فریم" ایجاد کنید. یک فریم، مجموعه ای +ازپنجره ها است که فهرست آن: اسکرول بارها، اکو بار، و غیره است. در +نمایشگرهای گرافیکی، چیزی که Emacs آن را "فریم" می نامد همان چیزی است که +اکثر برنامه های کاربردی دیگر "پنجره" می نامند. فریم های گرافیکی متعدد را +می توان همزمان بر روی صفحه نمایش نشان داد. در یک ترمینال متنی فقط یک فریم +را می توان در یک زمان نشان داد. + +‏ >> C-x 5 2 را تایپ کنید. + مشاهده می کنید که یک فریم جدید روی صفحه نمایش شما ظاهر می شود. + +شما می توانید هر کاری را که در فریم اصلی انجام داده اید در فریم جدید +انجام دهید. هیچ چیز خاصی در فریم اول وجود ندارد. + +‏>> C-x 5 0 را تایپ کنید. + این فریم انتخاب شده را حذف می کند. + +شما همچنین می توانید یک فریم را با استفاده از روش معمولی ارائه شده توسط +سیستم گرافیکی (اغلب با کلیک روی دکمه ای با نشان "X" در گوشه بالای فریم)بردارید. +اگر آخرین فریمِ کار Emacs را به این ترتیب حذف کنید،از Emacs خارج می شود. + + +* سطوح ویرایش بازگشتی +---------------------- + +گاهی اوقات وارد چیزی می شوید که«سطوح ویرایش بازگشتی» نامیده می شود. +این با کروشه های مربع در خط حالت اطراف پرانتزهای نام مد ماژر +نشان داده می شود. برای مثال، ممکن است [(اساسی)] را به جای (اساسی) ببینید. + +برای خارج شدن از سطح ویرایش بازگشتی، را تایپ کنید. +این یک فرمان همه منظوره "برو بیرون" است. همچنین می توانید از آن برای +حذف پنجره های اضافی و خارج شدن از مینی بافر استفاده کنید. + +>> تایپ M-x، تا وارد یک مینی بافر شوید. سپس برای بیرون رفتن +‏ را تایپ کنید. + +شما نمی توانید از C-g برای خارج شدن از یک سطح ویرایش بازگشتی استفاده کنید. +زیرا C-g برای لغو فرمانها و آرگومان ها در داخل سطح ویرایش بازگشتی +استفاده می شود. + + + +* دریافت کمک بیشتر +------------------- + +در این آموزش سعی شده است اطلاعات کافی برای شروع به استفاده از Emacs در +اختیار شما قرار گیرد. اطلاعات موجود در مورد Emacs آنقدر زیاد است که توضیح +همه چیز در اینجا غیرممکن است. با این حال، ممکن است بخواهید اطلاعات بیشتری +در مورد Emacs کسب کنید زیرا Emacs دارای بسیاری از ویژگی های مفید دیگر است. +Emacs فرمانهایی رابرای خواندن اسناد در مورد Emacs ارائه می دهد. فرمانهای +"help" همه با کاراکتر CONTROL-h که " کارکتر Help" نامیده می شود شروع +می شوند. + + +برای استفاده از ویژگی های Help، کاراکتر C-h و سپس کارکتری که می گوید شما +چه نوع کمکی می خواهید را تایپ کنید. اگر شما واقعاً گم شده اید، ? C-h را +تایپ کنید و Emacs به شما خواهد گفت که چه نوع کمکی می تواند ارائه دهد. اگر +C-h را تایپ کرده اید و به این نتیجه رسیده اید که هیچ کمکی نمی خواهید، فقط +برای لغو آن، C-g را تایپ کنید. + +(اگر C-h پیامی در مورد راهنما در پایین صفحه نمایش نمی دهد، +روی صفحه به جای آن کلید F1 یا< M-x help > C-h c C-p را تایپ کنید. + +پیام باید چیزی شبیه این باشد: + +‏ C-p runs the command previous-line + +این "نام فرمان -- function" را به شما می گوید. نام فرمان از بابت کاری که +فرمان انجام می دهد انتخاب می شود. نام فرمان می تواند به عنوان اطلاعات +امدادی بسیار مختصر باشد - برای یادآوری فرمانهایی که شما قبلا یاد گرفته اید. + + +فرمانهایی چند کاراکتری مانند C-x C-s و ESC>v> (به جای M-v،اگر کلید META یا +ALT ندارید) همچنین پس از C-h c نیز مجاز هستند. + + +برای دریافت اطلاعات بیشتر در مورد یک فرمان، به جای C-h c از C-h k استفاده +کنید. + + +‏>> C-h k C-p را تایپ کنید. + +این مستندات تابع و همچنین نام آن را در یک پنجره ایمکس نمایش می دهد. +وقتی خواندن خروجی تمام شد، برای خلاص شدن از شر آن پنجره C-x 1 را تایپ کنید. +شما مجبور نیستید این کار را به سرعت انجام دهید. +می توانید در حین مراجعه به متن راهنما مقداری ویرایش انجام دهید +و سپس C-x 1 را تایپ کنید. + +در اینجا چند گزینه مفید دیگر C-h وجود دارد: + +‏ C-h x یک فرمان را توصیف کنید. شما نام آن فرمان را تایپ می کنید. + + +>> فرمانِ > فرمان > برای پیمایش پنجره راهنما، C-M-v را تایپ کنید. این را چند بار انجام دهید. + +‏>> C-x 1 را تایپ کنید تا پنجره راهنما را حذف کنید. + +‏ C-h i خواندن کتابچه راهنمای همراه (با نام مستعار اطلاعات Info). + این فرمان شما را به یک بافر ویژه به نام "*info*" یا + اطلاعات قرار می دهد که در آن شما می توانید کتابچه + راهنمای بسته های نصب شده روی سیستم خود را بخوانید. برای + خواندن کتابچه راهنما < m emacs. + +لطفاً فایل COPYING را بخوانید و سپس کپی هایی از GNU Emacs را به دوستانتان بدهید. +کمک کنید تا از شر قاعدیِ اشتباهِ کپی رایت غربی راحت شویم. + + + +--- end of TUTORIAL.fa --- + +;;; Local Variables: +;;; coding: utf-8 +;;; bidi-display-reordering: t +;;; sentence-end-double-space: nil +;;; bidi-paragraph-direction: nil +;;; fill-column: 74 +;;; End: diff --git a/lisp/language/misc-lang.el b/lisp/language/misc-lang.el index 887b1dd94c7..8ec1dcaf22b 100644 --- a/lisp/language/misc-lang.el +++ b/lisp/language/misc-lang.el @@ -77,7 +77,7 @@ 'cp1256 (documentation . "Bidirectional editing is supported."))) (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. commit 8eacfaea6d83391e1ddc0921cbbb7ed9de0f4009 Author: Eli Zaretskii Date: Tue Apr 25 11:50:59 2023 +0300 Add Mongolian language environments * lisp/language/misc-lang.el ("Mongolian-traditional"): * lisp/language/cyrillic.el ("Mongolian-cyrillic"): New language environments. * etc/HELLO: Add Mongolian Traditional. * etc/NEWS: Announce the new language environments. (Bug#63028) diff --git a/etc/HELLO b/etc/HELLO index 25a572e5f1f..a589e69bf03 100644 --- a/etc/HELLO +++ b/etc/HELLO @@ -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 (ଓଡ଼ିଆ) ନମସ୍କାର diff --git a/etc/NEWS b/etc/NEWS index 2cb56b4fabc..d1e4727ca20 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -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 @@ -1587,7 +1591,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 diff --git a/lisp/language/cyrillic.el b/lisp/language/cyrillic.el index ffed1c808f7..7af87e65703 100644 --- a/lisp/language/cyrillic.el +++ b/lisp/language/cyrillic.el @@ -256,6 +256,16 @@ 'pt154 \(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 diff --git a/lisp/language/misc-lang.el b/lisp/language/misc-lang.el index 5a7867f14e8..887b1dd94c7 100644 --- a/lisp/language/misc-lang.el +++ b/lisp/language/misc-lang.el @@ -343,6 +343,17 @@ egyptian-shape-grouping ;; 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) @@ -352,7 +363,6 @@ egyptian-shape-grouping (vector "[\u1820-\u18AF\u202F\u180B-\u180F\u1807]+" 0 'font-shape-gstring))) - (provide 'misc-lang) ;;; misc-lang.el ends here commit fe8efbb8f753916b964feef8313077fae45c9f16 Author: Eli Zaretskii Date: Tue Apr 25 09:35:30 2023 +0300 Document the 'end-session' event on MS-Windows * doc/lispref/commands.texi (Misc Events): Document the 'end-session' event. (Bug#63058) diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 30765a7e8f7..cd1745614eb 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -2395,6 +2395,17 @@ Misc Events ;; 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 commit d80f959beded280ed61623ec36ea2a9ac07cc747 Author: Kyle Meyer Date: Mon Apr 24 19:47:12 2023 -0400 Update to Org 9.6.4-9-g8eb209 diff --git a/lisp/org/ob-R.el b/lisp/org/ob-R.el index 4ee091118e4..f2cc069aa5e 100644 --- a/lisp/org/ob-R.el +++ b/lisp/org/ob-R.el @@ -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 @@ org-babel-R-initiate-session (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) diff --git a/lisp/org/ob-js.el b/lisp/org/ob-js.el index 910c1168667..de7ea91317f 100644 --- a/lisp/org/ob-js.el +++ b/lisp/org/ob-js.el @@ -69,7 +69,10 @@ org-babel-js-cmd :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) diff --git a/lisp/org/oc.el b/lisp/org/oc.el index 260a4d3e1a7..8a7b662098a 100644 --- a/lisp/org/oc.el +++ b/lisp/org/oc.el @@ -1232,7 +1232,9 @@ org-cite-activate (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))))))) diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el index aef05bc6ee6..b8e026553b3 100644 --- a/lisp/org/org-macs.el +++ b/lisp/org/org-macs.el @@ -36,7 +36,7 @@ ;;; Org version verification. -(defconst org--built-in-p nil +(defvar org--inhibit-version-check nil "When non-nil, assume that Org is a part of Emacs source. For internal use only. See Emacs bug #62762. This variable is only supposed to be changed by Emacs build scripts.") @@ -49,7 +49,7 @@ org-assert-version ;; `org-assert-version' calls would fail using strict ;; `org-git-version' check because the generated Org version strings ;; will not match. - `(unless (or org--built-in-p (equal (org-release) ,(org-release))) + `(unless (or org--inhibit-version-check (equal (org-release) ,(org-release))) (warn "Org version mismatch. Org loading aborted. This warning usually appears when a built-in Org version is loaded prior to the more recent Org version. diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index 15e4a50877a..b82e915ecd1 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el @@ -11,7 +11,7 @@ org-release (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) diff --git a/lisp/org/org.el b/lisp/org/org.el index f7c2b6d16d1..61862b3d63b 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -3483,13 +3483,17 @@ org-latex-packages-alist :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 @@ org-open-at-point (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) diff --git a/lisp/org/ox-latex.el b/lisp/org/ox-latex.el index 26f8742bec8..768bf402b70 100644 --- a/lisp/org/ox-latex.el +++ b/lisp/org/ox-latex.el @@ -1820,9 +1820,11 @@ org-latex--protect-texttt "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{}") commit 98c6cfcbe4a07191f73e3bb94ff1f047551533e6 Author: Eli Zaretskii Date: Mon Apr 24 21:46:35 2023 +0300 Don't support versioned grammar libraries on MS-Windows * src/treesit.c (treesit_load_language_push_for_each_suffix): Don't append ".0.0" on WINDOWSNT. diff --git a/src/treesit.c b/src/treesit.c index 2d0df10ec44..a2d32770ed8 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -404,7 +404,9 @@ #define ts_tree_root_node fn_ts_tree_root_node 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; @@ -532,15 +534,17 @@ treesit_load_language_push_for_each_suffix (Lisp_Object lib_base_name, FOR_EACH_TAIL (suffixes) { Lisp_Object candidate1 = concat2 (lib_base_name, XCAR (suffixes)); - /* Support libraries named with ABI version numbers. In the - foreseeable future we only need to support version 0.0. See - the thread titled "Versioned Tree-sitter parser libraries" on - emacs-devel. */ +#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); } } @@ -3595,8 +3599,10 @@ syms_of_treesit (void) 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); commit 8f71c1546dfc70ae7e646834c8d8baf23d4b4d90 Author: Yuan Fu Date: Sun Apr 23 23:55:22 2023 -0700 Accept versioned tree-sitter language grammar files By discussion on emacs-devel, titled "Versioned Tree-sitter parser libraries". * src/treesit.c (Vtreesit_str_dot_0): New variable. (treesit_load_language_push_for_each_suffix): Additionally look for lib_base_name.0 and lib_base_name.0.0. (syms_of_treesit): Initialize Vtreesit_str_dot_0. diff --git a/src/treesit.c b/src/treesit.c index 53dbeb68882..2d0df10ec44 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -404,6 +404,7 @@ #define ts_tree_root_node fn_ts_tree_root_node static Lisp_Object Vtreesit_str_libtree_sitter; static Lisp_Object Vtreesit_str_tree_sitter; +static Lisp_Object Vtreesit_str_dot_0; static Lisp_Object Vtreesit_str_dot; static Lisp_Object Vtreesit_str_question_mark; static Lisp_Object Vtreesit_str_star; @@ -529,8 +530,19 @@ 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)); + /* Support libraries named with ABI version numbers. In the + foreseeable future we only need to support version 0.0. See + the thread titled "Versioned Tree-sitter parser libraries" on + emacs-devel. */ + 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); + *path_candidates = Fcons (candidate1, *path_candidates); + } } /* Load the dynamic library of LANGUAGE_SYMBOL and return the pointer @@ -3583,6 +3595,8 @@ syms_of_treesit (void) 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-"); + staticpro (&Vtreesit_str_dot_0); + Vtreesit_str_dot_0 = build_pure_c_string (".0"); staticpro (&Vtreesit_str_dot); Vtreesit_str_dot = build_pure_c_string ("."); staticpro (&Vtreesit_str_question_mark); commit d18c4ef4feaccf7bad67e6c0c5b00cdadd81ba1a Author: Eli Zaretskii Date: Mon Apr 24 19:22:44 2023 +0300 ; Fix last change in help.el * lisp/help.el (describe-bindings-outline-rules): Fix :type. Reported by Robert Pluim . diff --git a/lisp/help.el b/lisp/help.el index 886c6e0acc8..4c5382ff285 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -728,12 +728,17 @@ describe-bindings-show-prefix-commands :version "29.1") (defcustom describe-bindings-outline-rules '((match-regexp . "Key translations")) - "Visibility rules for outlines in the output buffer of `describe-bindings'. + "Visibility rules for outline sections of `describe-bindings'. This is used as the value of `outline-default-rules' in the output buffer of `describe-bindings' when `describe-bindings-outline' is non-nil, otherwise this option doesn't have any effect." - :type 'boolean + :type '(choice (const :tag "Hide unconditionally" nil) + (set :tag "Show section unless" + (cons :tag "Heading matches regexp" + (const match-regexp) string) + (cons :tag "Custom function returns non-nil" + (const custom-function) function))) :group 'help :version "30.1") commit de0b96c4ae745f524d225b7290722aa8e9fef17d Author: Mattias Engdegård Date: Mon Apr 24 16:06:14 2023 +0200 ; * lisp/mail/uudecode.el (uudecode-use-external): Boolean value. diff --git a/lisp/mail/uudecode.el b/lisp/mail/uudecode.el index 7b3bad9e25c..4b9acd922d8 100644 --- a/lisp/mail/uudecode.el +++ b/lisp/mail/uudecode.el @@ -40,7 +40,7 @@ uudecode-decoder-switches :type '(repeat string)) (defcustom uudecode-use-external - (executable-find uudecode-decoder-program) + (not (not (executable-find uudecode-decoder-program))) "Use external uudecode program." :version "22.1" :type 'boolean) commit 613591f3846405d8b9e54b65951aaddd45369b7b Author: Mattias Engdegård Date: Mon Apr 24 16:03:47 2023 +0200 Require custom values of `boolean` type to be nil or t This helps detecting mistakes in types and/or initial values. * lisp/wid-edit.el (boolean): Add :match function. diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 60bd2baa6fb..8b035224c9b 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -4038,6 +4038,7 @@ 'boolean :button-prefix 'widget-push-button-prefix :button-suffix 'widget-push-button-suffix :format "%{%t%}: %[Toggle%] %v\n" + :match (lambda (_widget value) (booleanp value)) :on "on (non-nil)" :off "off (nil)") commit 99add09d5e16a4fef752abedc3ee96989f1b9ae2 Author: Benson Chu Date: Fri Mar 24 15:38:03 2023 -0500 tab-bar-new-tab: inhibit side-window checks Previously, calling 'tab-bar-new-tab-to' only removed the 'window-side' property on the currently selected window, and then a call to 'delete-other-windows' was made to ensure that the selected window was the only window. We can skip this check by shadowing 'window--sides-inhibit-check' to t. * lisp/tab-bar.el (tab-bar-new-tab-to): Inhibit side-window checks. (Bug#62427) Copyright-paperwork-exempt: yes diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index dce6fa735fc..c7983146bf9 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -1552,15 +1552,14 @@ tab-bar-new-tab-to ;; 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 commit 2ef6f943abd41747aa733c0f51e08dfd44ddb82a Author: Eshel Yaron Date: Fri Apr 7 13:09:59 2023 +0300 Add option to control default outlining in 'C-h b' * lisp/help.el (describe-bindings-outline-rules): New user option. (describe-bindings): Use it instead of hardcoding "Key translations". (Bug#62708) diff --git a/etc/NEWS b/etc/NEWS index ca529be7aa1..4c5f50e343e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -30,6 +30,11 @@ applies, and please also update docstrings as needed. * Changes in Emacs 30.1 +--- +** New user option 'describe-bindings-outline-rules'. +This user option controls outline visibility in the output buffer of +'describe-bindings' when 'describe-bindings-outline' in non-nil. + ** X selection requests are now handled much faster and asynchronously. This means it should be less necessary to disable the likes of 'select-active-regions' when Emacs is running over a slow network diff --git a/lisp/help.el b/lisp/help.el index 6eac037df2c..886c6e0acc8 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -727,6 +727,16 @@ describe-bindings-show-prefix-commands :group 'help :version "29.1") +(defcustom describe-bindings-outline-rules '((match-regexp . "Key translations")) + "Visibility rules for outlines in the output buffer of `describe-bindings'. +This is used as the value of `outline-default-rules' in the +output buffer of `describe-bindings' when +`describe-bindings-outline' is non-nil, otherwise this option +doesn't have any effect." + :type 'boolean + :group 'help + :version "30.1") + (declare-function outline-hide-subtree "outline") (defun describe-bindings (&optional prefix buffer) @@ -756,8 +766,7 @@ describe-bindings outline-minor-mode-use-buttons 'insert ;; Hide the longest body. outline-default-state 1 - outline-default-rules - '((match-regexp . "Key translations"))) + outline-default-rules describe-bindings-outline-rules) (outline-minor-mode 1) (save-excursion (goto-char (point-min)) commit 62e4eb8fcf71a852117b372809bd4a7953f9b679 Author: Eli Zaretskii Date: Mon Apr 24 14:16:05 2023 +0300 Fix build when Org's version changes * lisp/org/org-macs.el (org--inhibit-version-check): Rename from 'org--built-in-p' and make it a defvar. All users changed. (Bug#62762) diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 4aa01e77e4e..c90237615c6 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -72,9 +72,10 @@ AUTOGENEL = ${srcdir}/subdirs.el ${srcdir}/eshell/esh-groups.el # Set load-prefer-newer for the benefit of the non-bootstrappers. +# Set org--inhibit-version-check to avoid unnecessarily aborting the build. BYTE_COMPILE_FLAGS = \ --eval "(setq load-prefer-newer t byte-compile-warnings 'all)" \ - --eval "(setq org--built-in-p t)" $(BYTE_COMPILE_EXTRA_FLAGS) + --eval "(setq org--inhibit-version-check t)" $(BYTE_COMPILE_EXTRA_FLAGS) # ... but we must prefer .elc files for those in the early bootstrap. compile-first: BYTE_COMPILE_FLAGS = $(BYTE_COMPILE_EXTRA_FLAGS) diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el index aef05bc6ee6..b8e026553b3 100644 --- a/lisp/org/org-macs.el +++ b/lisp/org/org-macs.el @@ -36,7 +36,7 @@ ;;; Org version verification. -(defconst org--built-in-p nil +(defvar org--inhibit-version-check nil "When non-nil, assume that Org is a part of Emacs source. For internal use only. See Emacs bug #62762. This variable is only supposed to be changed by Emacs build scripts.") @@ -49,7 +49,7 @@ org-assert-version ;; `org-assert-version' calls would fail using strict ;; `org-git-version' check because the generated Org version strings ;; will not match. - `(unless (or org--built-in-p (equal (org-release) ,(org-release))) + `(unless (or org--inhibit-version-check (equal (org-release) ,(org-release))) (warn "Org version mismatch. Org loading aborted. This warning usually appears when a built-in Org version is loaded prior to the more recent Org version. commit 087e8181947d3fbe2abf116b0eecab13cb046d63 Author: Michael Albinus Date: Mon Apr 24 09:40:43 2023 +0200 * etc/NEWS: Fix outline level. (Bug#63042) Fix typos. diff --git a/etc/NEWS b/etc/NEWS index 62d2fdcd3a4..2cb56b4fabc 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -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. @@ -2664,7 +2664,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 +2672,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. commit 65735cee71c0f2a23a8cec254d95e1d2f276a08a Author: Jim Porter Date: Sun Apr 23 12:08:32 2023 -0700 ; Fix last change diff --git a/build-aux/git-hooks/pre-push b/build-aux/git-hooks/pre-push index 03fbede4865..8e8277cba4f 100755 --- a/build-aux/git-hooks/pre-push +++ b/build-aux/git-hooks/pre-push @@ -49,7 +49,7 @@ $awk -v origin_name="$1" ' # Check any lines with a valid local SHA and whose remote ref is # master or an emacs-NN release branch. (We want to avoid checking # feature or scratch branches here.) - $2 ~ /^[a-z0-9]{40}$/ && $3 ~ /^refs/heads/(master|emacs-[0-9]+)$/ { + $2 ~ /^[a-z0-9]{40}$/ && $3 ~ /^refs\/heads\/(master|emacs-[0-9]+)$/ { newref = $2 # If the remote SHA is all zeroes, this is a new object to be # pushed (likely a branch)... commit 3ce462c8fda02c29e79ec80fb389fc44d550142a Author: Jim Porter Date: Sun Apr 23 11:43:07 2023 -0700 When examining merge commits in our Git hooks, only check the first parent This does two things: 1. We can properly validate log entries in merge commits. 2. We don't check commits that were merged in from other branches. * build-aux/git-hooks/commit-msg-files.awk (get_commit_changes): Get the changes compared to the first parent. * build-aux/git-hooks/pre-push: Only get the first parent of merge commits when returning the rev-list, and only check "master" or "emacs-NN" branches. diff --git a/build-aux/git-hooks/commit-msg-files.awk b/build-aux/git-hooks/commit-msg-files.awk index 2117681343f..5c9b70a5de5 100644 --- a/build-aux/git-hooks/commit-msg-files.awk +++ b/build-aux/git-hooks/commit-msg-files.awk @@ -33,7 +33,7 @@ function get_commit_changes(commit_sha, changes, cmd, i, j, len, \ bits, filename) { # Collect all the files touched in the specified commit. - cmd = ("git log -1 --name-status --format= " commit_sha) + cmd = ("git show --name-status --first-parent --format= " commit_sha) while ((cmd | getline) > 0) { for (i = 2; i <= NF; i++) { len = split($i, bits, "/") diff --git a/build-aux/git-hooks/pre-push b/build-aux/git-hooks/pre-push index 65c96bfdec9..03fbede4865 100755 --- a/build-aux/git-hooks/pre-push +++ b/build-aux/git-hooks/pre-push @@ -39,14 +39,17 @@ else fi # Standard input receives lines of the form: -# SP SP SP LF +# SP SP SP LF $awk -v origin_name="$1" ' # If the local SHA is all zeroes, ignore it. $2 ~ /^0{40}$/ { next } - $2 ~ /^[a-z0-9]{40}$/ { + # Check any lines with a valid local SHA and whose remote ref is + # master or an emacs-NN release branch. (We want to avoid checking + # feature or scratch branches here.) + $2 ~ /^[a-z0-9]{40}$/ && $3 ~ /^refs/heads/(master|emacs-[0-9]+)$/ { newref = $2 # If the remote SHA is all zeroes, this is a new object to be # pushed (likely a branch)... @@ -78,6 +81,6 @@ $awk -v origin_name="$1" ' } # Print every SHA after oldref, up to (and including) newref. - system("git rev-list --reverse " oldref ".." newref) + system("git rev-list --first-parent --reverse " oldref ".." newref) } ' | $awk -v reason=pre-push -f .git/hooks/commit-msg-files.awk commit e26dcc0e1441ded286b83eefb358d965748dd6db Author: Jim Porter Date: Sun Apr 23 12:04:34 2023 -0700 ; Fix logic of Git pre-push hook when pushing a new branch * build-aux/git-hooks/pre-push: Update the Git command to run on each iteration. diff --git a/build-aux/git-hooks/pre-push b/build-aux/git-hooks/pre-push index adcf27d4a5d..65c96bfdec9 100755 --- a/build-aux/git-hooks/pre-push +++ b/build-aux/git-hooks/pre-push @@ -49,19 +49,19 @@ $awk -v origin_name="$1" ' $2 ~ /^[a-z0-9]{40}$/ { newref = $2 # If the remote SHA is all zeroes, this is a new object to be - # pushed (likely a branch). Go backwards until we find a SHA on - # an origin branch. + # pushed (likely a branch)... if ($4 ~ /^0{40}$/) { back = 0 - cmd = ("git branch -r -l '\''" origin_name "/*'\'' --contains " \ - newref "~" back) - while ((cmd | getline) == 0) { - - # Only look back at most 1000 commits, just in case... - if (back++ > 1000) + # ... Go backwards until we find a SHA on an origin branch. + # Stop trying after 1000 commits, just in case... + for (back = 0; back < 1000; back++) { + cmd = ("git branch -r -l '\''" origin_name "/*'\''" \ + " --contains " newref "~" back) + rv = (cmd | getline) + close(cmd) + if (rv > 0) break; } - close(cmd) cmd = ("git rev-parse " newref "~" back) cmd | getline oldref commit 9914de503bd39b5a8b55a472d7cee6832a72e61d Author: Jim Porter Date: Fri Apr 21 10:06:49 2023 -0700 Improve the logic of the file entry Git hooks to support more cases In addition to starting with a "*", file entries now need a ":" somewhere in them. This helps reduce false positives with bulleted lists. Also, support multiple files separated by commas after a "*". * build-aux/git-hooks/commit-msg-files.awk (check_commit_msg_files): Accumulate file entries over multiple lines to support the above. diff --git a/build-aux/git-hooks/commit-msg-files.awk b/build-aux/git-hooks/commit-msg-files.awk index 3856e474d3e..2117681343f 100644 --- a/build-aux/git-hooks/commit-msg-files.awk +++ b/build-aux/git-hooks/commit-msg-files.awk @@ -59,15 +59,28 @@ function check_commit_msg_files(commit_sha, verbose, changes, good, \ if (verbose && ! msg) msg = $0 - # Find lines that reference files. We look at any line starting - # with "*" (possibly prefixed by "; ") where the file part starts - # with an alphanumeric character. The file part ends if we - # encounter any of the following characters: [ ( < { : - if (/^(; )?\*[ \t]+[[:alnum:]]/ && match($0, /[[:alnum:]][^[(<{:]*/)) { - # There might be multiple files listed on this line, separated + # Find file entries in the commit message. We look at any line + # starting with "*" (possibly prefixed by "; ") followed by a ":", + # possibly on a different line. If we encounter a blank line + # without seeing a ":", then we don't treat that as a file entry. + + # Accumulate the contents of a (possible) file entry. + if (/^[ \t]*$/) + filenames_str = "" + else if (/^(; )?\*[ \t]+[[:alnum:]]/) + filenames_str = $0 + else if (filenames_str) + filenames_str = (filenames_str $0) + + # We have a file entry; analyze it. + if (filenames_str && /:/) { + # Delete the leading "*" and any trailing information. + sub(/^(; )?\*[ \t]+/, "", filenames_str) + sub(/[ \t]*[[(<:].*$/, "", filenames_str) + + # There might be multiple files listed in this entry, separated # by spaces (and possibly a comma). Iterate over each of them. - split(substr($0, RSTART, RLENGTH), filenames, ",?([[:blank:]]+|$)") - + split(filenames_str, filenames, ",[ \t]+") for (i in filenames) { # Remove trailing slashes from any directory entries. sub(/\/$/, "", filenames[i]) @@ -83,6 +96,8 @@ function check_commit_msg_files(commit_sha, verbose, changes, good, \ good = 0 } } + + filenames_str = "" } } close(cmd) commit d7f38558c4ced94c04c7077af202634d5e239a7d Author: Eli Zaretskii Date: Sun Apr 23 19:11:49 2023 +0300 ; Improve font selection for Traditional Mongolian * lisp/international/fontset.el (setup-default-fontset): Improve the font spec for Traditional Mongolian. (Bug#63028) diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index 84790adf7c1..b72c68d9d59 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -649,7 +649,7 @@ setup-default-fontset (nil . "MuleArabic-2") (nil . "ISO8859-6")) (mongolian ,(font-spec :registry "iso10646-1" - :otf '(mong nil (init medi fina)))) + :otf '(mong nil (init medi fina isol)))) (hebrew ,(font-spec :registry "iso10646-1" :script 'hebrew) (nil . "ISO8859-8")) commit 965c5e0231c859eaa78f372c538a5478f6bd0ad1 Author: Eli Zaretskii Date: Sun Apr 23 17:04:56 2023 +0300 Fix rendering of Traditional Mongolian script * lisp/international/characters.el: Set punctuation syntax for Po characters from the Mongolian block * lisp/international/fontset.el (setup-default-fontset): Add fontset setting for Traditional Mongolic. * lisp/language/misc-lang.el (composition-function-table): Add rules for Traditional Mongolic. (Bug#63028) diff --git a/lisp/international/characters.el b/lisp/international/characters.el index 518436bd961..9aea5e27063 100644 --- a/lisp/international/characters.el +++ b/lisp/international/characters.el @@ -695,6 +695,16 @@ ?L (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 diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index eb1c7f53d36..84790adf7c1 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -648,6 +648,8 @@ setup-default-fontset (nil . "MuleArabic-1") (nil . "MuleArabic-2") (nil . "ISO8859-6")) + (mongolian ,(font-spec :registry "iso10646-1" + :otf '(mong nil (init medi fina)))) (hebrew ,(font-spec :registry "iso10646-1" :script 'hebrew) (nil . "ISO8859-8")) diff --git a/lisp/language/misc-lang.el b/lisp/language/misc-lang.el index fe283e8769c..5a7867f14e8 100644 --- a/lisp/language/misc-lang.el +++ b/lisp/language/misc-lang.el @@ -339,6 +339,20 @@ egyptian-shape-grouping language environment.")) '("Misc")) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Traditional Mongolian +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(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 commit 2e85ac2b270700608776ba28ecf41fc8d184db12 Author: Michael Albinus Date: Sun Apr 23 13:37:39 2023 +0200 Add new Tramp method "flatpak" * doc/misc/tramp.texi (Inline methods): Add flatpak. * etc/NEWS: Add new Tramp method "flatpak". Fix typos. * lisp/net/tramp-container.el (tramp-flatpak-program): New defcustom. (tramp-flatpak-method): New defconst. (tramp-flatpak--completion-function): New defun. Set it for "flatpak". (tramp-methods) : Add. (tramp-container-connection-local-default-flatpak-variables): New defconst. Set respective connection-local variables. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 65892f8621e..247d718b59a 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -938,6 +938,16 @@ Inline methods This method does not support user names. +@item @option{flatpak} +@cindex method @option{flatpak} +@cindex @option{flatpak} method + +Integration of Flatpak sandboxes. The host name may be either an +application ID, a sandbox instance ID, or a PID, as returned by +@samp{flatpak ps}. + +This method does not support user names. + @end table diff --git a/etc/NEWS b/etc/NEWS index 1d5f2b13958..ca529be7aa1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -67,9 +67,10 @@ This is used for displaying the time and date components of 'display-time-mode'. --- -** New icon images for general use -Several symbolic icons are added to etc/images/symbols, including +** New icon images for general use. +Several symbolic icons are added to "etc/images/symbols", including plus, minus, check-mark, start, etc. + * Editing Changes in Emacs 30.1 @@ -104,7 +105,7 @@ If you want to get back the old behavior, set the user option to the value (setopt gdb-locals-table-row-config `((type . 0) (name . 0) (value . ,gdb-locals-value-limit))) -** Compile +** Grep *** New user option 'grep-use-headings'. When non-nil, the output of Grep is split into sections, one for each @@ -203,16 +204,18 @@ point is not in a comment or a string. It is by default bound to ** Tramp +++ -*** New connection method "toolbox". -This allows accessing system containers provided by Toolbox. +*** New connection methods "toolbox" and "flatpak". +They allow accessing system containers provided by Toolbox or +sandboxes provided by Flatpak. +++ -*** Rename 'tramp-use-ssh-controlmaster-options' to 'tramp-use-connection-share. -The old name still exists as defvaralias. This user option controls -now connection sharing for both ssh-based and plink-based methods. It -allows the values t, nil, and 'suppress'. The latter suppresses -also "ControlMaster" settings in the user's "~/.ssh/config" file, -or connection share configuration in PuTTY sessions, respectively. +*** Rename 'tramp-use-ssh-controlmaster-options' to 'tramp-use-connection-share'. +The old name still exists as obsolete variable alias. This user +option controls now connection sharing for both ssh-based and +plink-based methods. It allows the values t, nil, and 'suppress'. +The latter suppresses also "ControlMaster" settings in the user's +"~/.ssh/config" file, or connection share configuration in PuTTY +sessions, respectively. ** EWW @@ -280,7 +283,7 @@ distracting and easily confused with actual code, or a significant early aid that relieves you from moving the buffer or reaching for the mouse to consult an error message. -** Python mode +** Python Mode --- *** New user option 'python-indent-block-paren-deeper'. diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 14c63ba5834..3f3fb1ea6b3 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -1311,6 +1311,7 @@ tramp-adb-maybe-open-connection (tramp-set-connection-property p "connected" t))))))) ;;; Default connection-local variables for Tramp. + (defconst tramp-adb-connection-local-default-shell-variables '((shell-file-name . "/system/bin/sh") (shell-command-switch . "-c")) diff --git a/lisp/net/tramp-container.el b/lisp/net/tramp-container.el index 5ae9ebaefb2..473cb1c54b8 100644 --- a/lisp/net/tramp-container.el +++ b/lisp/net/tramp-container.el @@ -47,9 +47,9 @@ ;; C-x C-f /kubernetes:POD:/path/to/file ;; ;; Where: -;; POD is the pod to connect to. -;; By default, the first container in that pod will be -;; used. +;; POD is the pod to connect to. +;; By default, the first container in that pod will be +;; used. ;; ;; Completion for POD and accessing it operate in the current ;; namespace, use this command to change it: @@ -58,7 +58,7 @@ ;; ;; ;; -;; Open a file on an existing toolbox container via Toolbox: +;; Open a file on an existing Toolbox container: ;; ;; C-x C-f /toolbox:CONTAINER:/path/to/file ;; @@ -67,6 +67,16 @@ ;; ;; If the container is not running, it is started. If no container is ;; specified, the default Toolbox container is used. +;; +;; +;; +;; Open a file on a running Flatpak sandbox: +;; +;; C-x C-f /flatpak:SANDBOX:/path/to/file +;; +;; Where: +;; SANDBOX is the running sandbox to connect to. +;; It could be an application ID, an instance ID, or a PID. ;;; Code: @@ -104,6 +114,14 @@ tramp-toolbox-program :type '(choice (const "toolbox") (string))) +;;;###tramp-autoload +(defcustom tramp-flatpak-program "flatpak" + "Name of the Flatpak client program." + :group 'tramp + :version "30.1" + :type '(choice (const "flatpak") + (string))) + ;;;###tramp-autoload (defconst tramp-docker-method "docker" "Tramp method name to use to connect to Docker containers.") @@ -120,6 +138,10 @@ tramp-kubernetes-method (defconst tramp-toolbox-method "toolbox" "Tramp method name to use to connect to Toolbox containers.") +;;;###tramp-autoload +(defconst tramp-flatpak-method "flatpak" + "Tramp method name to use to connect to Flatpak sandboxes.") + ;;;###tramp-autoload (defun tramp-container--completion-function (program) "List running containers available for connection. @@ -195,6 +217,30 @@ tramp-toolbox--completion-function lines))) (mapcar (lambda (name) (list nil name)) (delq nil names)))) +;;;###tramp-autoload +(defun tramp-flatpak--completion-function (&rest _args) + "List Flatpak sandboxes available for connection. +It returns application IDs or, in case there is no application +ID, instance IDs. + +This function is used by `tramp-set-completion-function', please +see its function help for a description of the format." + (when-let ((default-directory tramp-compat-temporary-file-directory) + (raw-list + (shell-command-to-string + (concat tramp-flatpak-program + " ps --columns=instance,application"))) + (lines (split-string raw-list "\n" 'omit)) + (names (mapcar + (lambda (line) + (when (string-match + (rx bol (* space) (group (+ (not space))) + (? (+ space) (group (+ (not space)))) eol) + line) + (or (match-string 2 line) (match-string 1 line)))) + lines))) + (mapcar (lambda (name) (list nil name)) (delq nil names)))) + ;;;###tramp-autoload (defvar tramp-default-remote-shell) ;; Silence byte compiler. @@ -253,6 +299,17 @@ tramp-default-remote-shell (add-to-list 'tramp-default-host-alist `(,tramp-toolbox-method nil "")) + (add-to-list 'tramp-methods + `(,tramp-flatpak-method + (tramp-login-program ,tramp-flatpak-program) + (tramp-login-args (("enter") + ("%h") + ("%l"))) + (tramp-direct-async (,tramp-default-remote-shell "-c")) + (tramp-remote-shell ,tramp-default-remote-shell) + (tramp-remote-shell-login ("-l")) + (tramp-remote-shell-args ("-c")))) + (tramp-set-completion-function tramp-docker-method `((tramp-container--completion-function @@ -269,7 +326,25 @@ tramp-default-remote-shell (tramp-set-completion-function tramp-toolbox-method - '((tramp-toolbox--completion-function "")))) + '((tramp-toolbox--completion-function ""))) + + (tramp-set-completion-function + tramp-flatpak-method + '((tramp-flatpak--completion-function ""))) + + ;; Default connection-local variables for Tramp. + + (defconst tramp-container-connection-local-default-flatpak-variables + `((tramp-remote-path . ,(cons "/app/bin" tramp-remote-path))) + "Default connection-local variables for remote flatpak connections.") + + (connection-local-set-profile-variables + 'tramp-container-connection-local-default-flatpak-profile + tramp-container-connection-local-default-flatpak-variables) + + (connection-local-set-profiles + `(:application tramp :protocol ,tramp-flatpak-method) + 'tramp-container-connection-local-default-flatpak-profile)) (add-hook 'tramp-unload-hook (lambda () commit 9a0f10b5f88667261bafc65ccdd63bdd9ef80147 Author: Eli Zaretskii Date: Sat Apr 22 19:27:16 2023 +0300 Fix line-number-at-pos when POSITION is out of narrowing * src/fns.c (Fline_number_at_pos): Don't signal an error when ABSOLUTE is nil and POSITION is outside of the narrowing, like the original Lisp implementation did. Minor speedup by using the byte position where it is available from the get-go. (Bug#62857) diff --git a/src/fns.c b/src/fns.c index ff364c65e26..e8cd6211d6d 100644 --- a/src/fns.c +++ b/src/fns.c @@ -6116,29 +6116,40 @@ DEFUN ("line-number-at-pos", Fline_number_at_pos, 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); } commit 4e0f4292aaf1a9bf26ba2ee2983955cefc50beea Author: Eli Zaretskii Date: Sat Apr 22 13:40:57 2023 +0300 ; * etc/tutorials/TUTORIAL: Fix punctuation. diff --git a/etc/tutorials/TUTORIAL b/etc/tutorials/TUTORIAL index e72b972441e..4e6d7b9b287 100644 --- a/etc/tutorials/TUTORIAL +++ b/etc/tutorials/TUTORIAL @@ -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- means hold the CONTROL key while typing the character + C- means hold the CONTROL key while typing the character . Thus, C-f would be: hold the CONTROL key and type f. M- means hold the META or ALT key down while typing . If there is no META or ALT key, instead press and release the commit dec2ac0c657c24ae03f1632508cb3ebbc1fd0b82 Author: Eli Zaretskii Date: Sat Apr 22 13:35:36 2023 +0300 Fix exiting Emacs after saving a tutorial * lisp/tutorial.el (tutorial--starting-point): Make it permanent-local, so that saving the tutorial to some file doesn't kill this buffer-local variable. Otherwise, trying to exit Emacs after saving the tutorial will signal an error, because 'tutorial--starting-point' is void. (Bug#37326) diff --git a/lisp/tutorial.el b/lisp/tutorial.el index 0afe565c80b..eb494be8d4d 100644 --- a/lisp/tutorial.el +++ b/lisp/tutorial.el @@ -650,6 +650,7 @@ tutorial--remove-remarks (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) commit 3badd2358d5f0af71887ee1cc9d39c2f312b6888 Author: kobarity Date: Thu Apr 20 22:55:29 2023 +0900 Improve docstring of python-indent-def-block-scale * lisp/progmodes/python.el (python-indent-def-block-scale): Improve docstring. (Bug#62696) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 9ae95ecfc1c..5bb15c60956 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1265,7 +1265,30 @@ python-indent-trigger-commands :type '(repeat symbol)) (defcustom python-indent-def-block-scale 2 - "Multiplier applied to indentation inside multi-line def blocks." + "Multiplier applied to indentation inside multi-line blocks. +The indentation in parens in the block header will be the current +indentation plus `python-indent-offset' multiplied by this +variable. For example, the arguments are indented as follows if +this variable is 1: + + def do_something( + arg1, + arg2): + print('hello') + +if this variable is 2 (default): + + def do_something( + arg1, + arg2): + print('hello') + +This variable has an effect on all blocks, not just def block. +This variable only works if the opening paren is not followed by +non-whitespace characters on the same line. Modify +`python-indent-block-paren-deeper' to customize the case where +non-whitespace characters follow the opening paren on the same +line." :version "26.1" :type 'integer :safe 'natnump) commit c14a41c24c8e0f37749a5bbd19f09cfeb857b26f Author: Eli Zaretskii Date: Sat Apr 22 12:29:55 2023 +0300 ; * etc/NEWS: Fix last change. (Bug#62696) diff --git a/etc/NEWS b/etc/NEWS index 81a01a63959..1d5f2b13958 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -282,6 +282,7 @@ mouse to consult an error message. ** Python mode +--- *** New user option 'python-indent-block-paren-deeper'. If non-nil, increase the indentation of the lines inside parens in a header of a block when they are indented to the same level as the body commit 711e8bc7178d5dd78f4db5c34b2b23f605521fc4 Author: kobarity Date: Sun Apr 16 22:18:39 2023 +0900 Add a new user option in Python mode to improve the indentation * lisp/progmodes/python.el (python-indent-block-paren-deeper): New user option. (python-indent-context): Add a new context :inside-paren-from-block. (python-indent--calculate-indentation): Modify according to `python-indent-block-paren-deeper' and :inside-paren-from-block. * test/lisp/progmodes/python-tests.el (python-indent-inside-paren-block-1) (python-indent-inside-paren-block-2) (python-indent-inside-paren-block-3) (python-indent-inside-paren-block-4): New tests. (python-indent-inside-paren-5, python-indent-dedenters-8): Modify according to the new context. * etc/NEWS: Document the new user option. (Bug#62696) diff --git a/etc/NEWS b/etc/NEWS index ee0659b95a4..81a01a63959 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -280,6 +280,23 @@ distracting and easily confused with actual code, or a significant early aid that relieves you from moving the buffer or reaching for the mouse to consult an error message. +** Python mode + +*** New user option 'python-indent-block-paren-deeper'. +If non-nil, increase the indentation of the lines inside parens in a +header of a block when they are indented to the same level as the body +of the block: + + if (some_expression + and another_expression): + do_something() + +instead of: + + if (some_expression + and another_expression): + do_something() + * New Modes and Packages in Emacs 30.1 diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index bbabce80b4d..9ae95ecfc1c 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1270,6 +1270,31 @@ python-indent-def-block-scale :type 'integer :safe 'natnump) +(defcustom python-indent-block-paren-deeper nil + "Increase indentation inside parens of a block. +If non-nil, increase the indentation of the lines inside parens +in a header of a block when they are indented to the same level +as the body of the block: + + if (some_expression + and another_expression): + do_something() + +instead of: + + if (some_expression + and another_expression): + do_something() + +This variable only works if the opening paren is followed by +non-whitespace characters on the same line. Modify +`python-indent-def-block-scale' to customize the case where +non-whitespace character does not follow the opening paren on the +same line." + :version "30.1" + :type 'boolean + :safe 'booleanp) + (defvar python-indent-current-level 0 "Deprecated var available for compatibility.") @@ -1367,6 +1392,10 @@ python-indent-context - Point is inside a paren with items starting in their own line from a block start. - START is the position of the open paren. +:inside-paren-from-block + - Point is inside a paren from a block start followed by some + items on the same line. + - START is the first non space char position *after* the open paren. :after-backslash - Fallback case when point is after backslash. @@ -1450,12 +1479,16 @@ python-indent-context (starts-in-newline (cons :inside-paren-newline-start start)) ;; General case. - (t (cons :inside-paren - (save-excursion - (goto-char (1+ start)) - (skip-syntax-forward "(" 1) - (skip-syntax-forward " ") - (point)))))))) + (t (let ((after-start (save-excursion + (goto-char (1+ start)) + (skip-syntax-forward "(" 1) + (skip-syntax-forward " ") + (point)))) + (if (save-excursion + (python-nav-beginning-of-statement) + (python-info-looking-at-beginning-of-block)) + (cons :inside-paren-from-block after-start) + (cons :inside-paren after-start)))))))) ;; After backslash. ((let ((start (when (not (python-syntax-comment-or-string-p ppss)) (python-info-line-ends-backslash-p @@ -1603,7 +1636,17 @@ python-indent--calculate-indentation (`(,(or :inside-paren-newline-start-from-block) . ,start) (goto-char start) (+ (current-indentation) - (* python-indent-offset python-indent-def-block-scale)))))) + (* python-indent-offset python-indent-def-block-scale))) + (`(,:inside-paren-from-block . ,start) + (goto-char start) + (let ((column (current-column))) + (if (and python-indent-block-paren-deeper + (= column (+ (save-excursion + (python-nav-beginning-of-statement) + (current-indentation)) + python-indent-offset))) + (+ column python-indent-offset) + column)))))) (defun python-indent--calculate-levels (indentation) "Calculate levels list given INDENTATION. diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 50153e66da5..60b11d572cf 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -1139,7 +1139,7 @@ python-indent-inside-paren-5 (should (eq (car (python-indent-context)) :no-indent)) (should (= (python-indent-calculate-indentation) 0)) (forward-line 1) - (should (eq (car (python-indent-context)) :inside-paren)) + (should (eq (car (python-indent-context)) :inside-paren-from-block)) (should (= (python-indent-calculate-indentation) 7)) (forward-line 1) (should (eq (car (python-indent-context)) :after-block-start)) @@ -1174,6 +1174,118 @@ python-indent-inside-paren-7 ;; This signals an error if the test fails (should (eq (car (python-indent-context)) :inside-paren-newline-start)))) +(ert-deftest python-indent-inside-paren-block-1 () + "`python-indent-block-paren-deeper' set to nil (default). +See Bug#62696." + (python-tests-with-temp-buffer + " +if ('VALUE' in my_unnecessarily_long_dictionary and + some_other_long_condition_case): + do_something() +elif (some_case or + another_case): + do_another() +" + (python-tests-look-at "if") + (should (eq (car (python-indent-context)) :no-indent)) + (should (= (python-indent-calculate-indentation) 0)) + (forward-line 1) + (should (eq (car (python-indent-context)) :inside-paren-from-block)) + (should (= (python-indent-calculate-indentation) 4)) + (forward-line 1) + (should (eq (car (python-indent-context)) :after-block-start)) + (should (= (python-indent-calculate-indentation) 4)) + (forward-line 1) + (should (eq (car (python-indent-context)) :at-dedenter-block-start)) + (should (= (python-indent-calculate-indentation) 0)) + (forward-line 1) + (should (eq (car (python-indent-context)) :inside-paren-from-block)) + (should (= (python-indent-calculate-indentation) 6)) + (forward-line 1) + (should (eq (car (python-indent-context)) :after-block-start)) + (should (= (python-indent-calculate-indentation) 4)))) + +(ert-deftest python-indent-inside-paren-block-2 () + "`python-indent-block-paren-deeper' set to t. +See Bug#62696." + (python-tests-with-temp-buffer + " +if ('VALUE' in my_unnecessarily_long_dictionary and + some_other_long_condition_case): + do_something() +elif (some_case or + another_case): + do_another() +" + (let ((python-indent-block-paren-deeper t)) + (python-tests-look-at "if") + (should (eq (car (python-indent-context)) :no-indent)) + (should (= (python-indent-calculate-indentation) 0)) + (forward-line 1) + (should (eq (car (python-indent-context)) :inside-paren-from-block)) + (should (= (python-indent-calculate-indentation) 8)) + (forward-line 1) + (should (eq (car (python-indent-context)) :after-block-start)) + (should (= (python-indent-calculate-indentation) 4)) + (forward-line 1) + (should (eq (car (python-indent-context)) :at-dedenter-block-start)) + (should (= (python-indent-calculate-indentation) 0)) + (forward-line 1) + (should (eq (car (python-indent-context)) :inside-paren-from-block)) + (should (= (python-indent-calculate-indentation) 6)) + (forward-line 1) + (should (eq (car (python-indent-context)) :after-block-start)) + (should (= (python-indent-calculate-indentation) 4))))) + +(ert-deftest python-indent-inside-paren-block-3 () + "With backslash. `python-indent-block-paren-deeper' set to nil (default). +See Bug#62696." + (python-tests-with-temp-buffer + " +if 'VALUE' in my_uncessarily_long_dictionary and\\ + (some_other_long_condition_case or + another_case): + do_something() +" + (python-tests-look-at "if") + (should (eq (car (python-indent-context)) :no-indent)) + (should (= (python-indent-calculate-indentation) 0)) + (forward-line 1) + (should (eq (car (python-indent-context)) + :after-backslash-block-continuation)) + (should (= (python-indent-calculate-indentation) 3)) + (forward-line 1) + (should (eq (car (python-indent-context)) :inside-paren-from-block)) + (should (= (python-indent-calculate-indentation) 4)) + (forward-line 1) + (should (eq (car (python-indent-context)) :after-block-start)) + (should (= (python-indent-calculate-indentation) 4)))) + +(ert-deftest python-indent-inside-paren-block-4 () + "With backslash. `python-indent-block-paren-deeper' set to t. +See Bug#62696." + (python-tests-with-temp-buffer + " +if 'VALUE' in my_uncessarily_long_dictionary and\\ + (some_other_long_condition_case or + another_case): + do_something() +" + (let ((python-indent-block-paren-deeper t)) + (python-tests-look-at "if") + (should (eq (car (python-indent-context)) :no-indent)) + (should (= (python-indent-calculate-indentation) 0)) + (forward-line 1) + (should (eq (car (python-indent-context)) + :after-backslash-block-continuation)) + (should (= (python-indent-calculate-indentation) 3)) + (forward-line 1) + (should (eq (car (python-indent-context)) :inside-paren-from-block)) + (should (= (python-indent-calculate-indentation) 8)) + (forward-line 1) + (should (eq (car (python-indent-context)) :after-block-start)) + (should (= (python-indent-calculate-indentation) 4))))) + (ert-deftest python-indent-after-block-1 () "The most simple after-block case that shouldn't fail." (python-tests-with-temp-buffer @@ -1670,7 +1782,7 @@ python-indent-dedenters-8 (should (= (python-indent-calculate-indentation) 0)) (should (= (python-indent-calculate-indentation t) 0)) (python-tests-look-at "a == 4):\n") - (should (eq (car (python-indent-context)) :inside-paren)) + (should (eq (car (python-indent-context)) :inside-paren-from-block)) (should (= (python-indent-calculate-indentation) 6)) (python-indent-line) (should (= (python-indent-calculate-indentation t) 4)) commit 2f013c46f7116d53468de78c00903c87d100bbd9 Merge: e6ca5834a6e 44145bf07e2 Author: Eli Zaretskii Date: Sat Apr 22 04:56:57 2023 -0400 Merge from origin/emacs-29 44145bf07e2 Add indentation style setting for c-ts-mode in .dir-local... e7db6c59cc6 ; * .dir-locals.el (c-ts-mode): Add settings. d041f01b02f ; Minor fix in Emacs Lisp Intro manual commit e6ca5834a6eab91023e9f968b65683d0a74db1e7 Author: Mattias Engdegård Date: Thu Apr 20 15:07:06 2023 +0200 Improved nconc and append compiler optimisations Add the transforms: (nconc) -> nil (nconc X) -> X and for arguments to `nconc`: nil -> (list X...) (list Y...) -> (list X... Y...) (list X) Y -> (cons X Y) * lisp/emacs-lisp/byte-opt.el (byte-optimize-nconc): New. (byte-optimize-append): Fix minor flaws and generalise. diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 2bdd3375728..da997212eef 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1520,6 +1520,35 @@ byte-optimize-list ;; (list) -> nil (and (cdr form) form)) +(put 'nconc 'byte-optimizer #'byte-optimize-nconc) +(defun byte-optimize-nconc (form) + (pcase (cdr form) + ('nil nil) ; (nconc) -> nil + (`(,x) x) ; (nconc X) -> X + (_ (named-let loop ((args (cdr form)) (newargs nil)) + (if args + (let ((arg (car args)) + (prev (car newargs))) + (cond + ;; Elide null args. + ((null arg) (loop (cdr args) newargs)) + ;; Merge consecutive `list' args. + ((and (eq (car-safe arg) 'list) + (eq (car-safe prev) 'list)) + (loop (cons (cons (car prev) (append (cdr prev) (cdr arg))) + (cdr args)) + (cdr newargs))) + ;; (nconc ... (list A) B ...) -> (nconc ... (cons A B) ...) + ((and (eq (car-safe prev) 'list) (cdr prev) (null (cddr prev))) + (loop (cdr args) + (cons (list 'cons (cadr prev) arg) + (cdr newargs)))) + (t (loop (cdr args) (cons arg newargs))))) + (let ((new-form (cons (car form) (nreverse newargs)))) + (if (equal new-form form) + form + new-form))))))) + (put 'append 'byte-optimizer #'byte-optimize-append) (defun byte-optimize-append (form) ;; There is (probably) too much code relying on `append' to return a @@ -1572,11 +1601,9 @@ byte-optimize-append ;; (append X) -> X ((null newargs) arg) - ;; (append (list Xs...) nil) -> (list Xs...) - ((and (null arg) - newargs (null (cdr newargs)) - (consp prev) (eq (car prev) 'list)) - prev) + ;; (append ... (list Xs...) nil) -> (append ... (list Xs...)) + ((and (null arg) (eq (car-safe prev) 'list)) + (cons (car form) (nreverse newargs))) ;; (append '(X) Y) -> (cons 'X Y) ;; (append (list X) Y) -> (cons X Y) @@ -1587,13 +1614,13 @@ byte-optimize-append (= (length (cadr prev)) 1))) ((eq (car prev) 'list) (= (length (cdr prev)) 1)))) - (list 'cons (if (eq (car prev) 'quote) - (macroexp-quote (caadr prev)) - (cadr prev)) - arg)) + `(cons ,(if (eq (car prev) 'quote) + (macroexp-quote (caadr prev)) + (cadr prev)) + ,arg)) (t - (let ((new-form (cons 'append (nreverse (cons arg newargs))))) + (let ((new-form (cons (car form) (nreverse (cons arg newargs))))) (if (equal new-form form) form new-form)))))))) commit 44145bf07e296efe28a29f03edcb685c84afe69a Author: Eli Zaretskii Date: Sat Apr 22 09:41:50 2023 +0300 Add indentation style setting for c-ts-mode in .dir-locals.el * lisp/progmodes/c-ts-mode.el (c-ts-indent-style-safep): New predicate. (c-ts-mode-indent-style): Use it to test the value for being safe. * .dir-locals.el (c-ts-mode): Set 'c-ts-mode-indent-style' to 'gnu'. diff --git a/.dir-locals.el b/.dir-locals.el index 6733b5326a6..0bcded4b5d1 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -21,7 +21,8 @@ (electric-quote-comment . nil) (electric-quote-string . nil) (mode . bug-reference-prog))) - (c-ts-mode . ((indent-tabs-mode . t) + (c-ts-mode . ((c-ts-mode-indent-style . gnu) + (indent-tabs-mode . t) (mode . bug-reference-prog))) (log-edit-mode . ((log-edit-font-lock-gnu-style . t) (log-edit-setup-add-author . t) diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 166399f922d..6100f00e3ba 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -136,6 +136,10 @@ c-ts-mode--indent-style-setter (loop (append res (list buffer)) (cdr buffers)) (loop res (cdr buffers)))))))) +(defun c-ts-indent-style-safep (style) + "Non-nil if STYLE's value is safe for file-local variables." + (and (symbolp style) (not (functionp style)))) + (defcustom c-ts-mode-indent-style 'gnu "Style used for indentation. @@ -150,6 +154,7 @@ c-ts-mode-indent-style (symbol :tag "BSD" bsd) (function :tag "A function for user customized style" ignore)) :set #'c-ts-mode--indent-style-setter + :safe 'c-ts-indent-style-safep :group 'c) (defun c-ts-mode--get-indent-style (mode) commit e7db6c59cc63c28c6be8989968fb1a8b6a7a5ca4 Author: Eli Zaretskii Date: Fri Apr 21 20:54:15 2023 +0300 ; * .dir-locals.el (c-ts-mode): Add settings. diff --git a/.dir-locals.el b/.dir-locals.el index fc89dff87f2..6733b5326a6 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -21,6 +21,8 @@ (electric-quote-comment . nil) (electric-quote-string . nil) (mode . bug-reference-prog))) + (c-ts-mode . ((indent-tabs-mode . t) + (mode . bug-reference-prog))) (log-edit-mode . ((log-edit-font-lock-gnu-style . t) (log-edit-setup-add-author . t) (vc-git-log-edit-summary-target-len . 50))) commit d041f01b02f426f106c0a941a509a21317f2930e Author: Eli Zaretskii Date: Fri Apr 21 19:16:52 2023 +0300 ; Minor fix in Emacs Lisp Intro manual * doc/lispintro/emacs-lisp-intro.texi (what-line): Fix punctuation and wording. Reported by Holger Kienle . (Bug#62998) diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index a2b82d25633..6447ff74bc9 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -6604,10 +6604,11 @@ what-line (@code{describe-function}). The newer version uses a conditional to determine whether the buffer has been narrowed. -(Also, it uses @code{line-number-at-pos}, which among other simple -expressions, such as @code{(goto-char (point-min))}, moves point to -the beginning of the current line with @code{(forward-line 0)} rather -than @code{beginning-of-line}.) +Also, the modern version of @code{what-line} uses +@code{line-number-at-pos}, which among other simple expressions, such +as @code{(goto-char (point-min))}, moves point to the beginning of the +current line with @code{(forward-line 0)} rather than +@code{beginning-of-line}.) The @code{what-line} function as shown here has a documentation line and is interactive, as you would expect. The next two lines use the