commit eaca6378d2c4b94bc70a7979642502a80bfacd11 (HEAD, refs/remotes/origin/master) Merge: 2a78f06ef4 ecbdb3b0ad Author: Stefan Kangas Date: Tue Sep 6 06:30:27 2022 +0200 Merge from origin/emacs-28 ecbdb3b0ad * lisp/server.el: Improve Commentary. ee5c591249 Explain how the font appearance can be fine-tuned in fbterm. commit 2a78f06ef4d303b383749be3dabd0f9a68547e5e Author: Stefan Monnier Date: Tue Sep 6 00:08:35 2022 -0400 cl-symbol-macrolet: Fix recent regression The recent fix for bug#57397 introduced a regression, breaking the `cl-lib-symbol-macrolet-hide` test. It turned out that the origin of the problem was that `gv.el` uses `macroexpand-1` which does not (can't) use `macroexpand` but `cl-symbol-macrolet` failed to advise `macroexpand-1` the way it advised `macroexpand`. To fix this, we change `cl-symbol-macrolet` so it advises both, and we do that with a new `macroexpand` advice which delegates the bulk of the work to `macroexpand-1`. Along the way, I bumped into another bug in the interaction between `cl-letf` and `cl-symbol-macrolet`, which I tried to fix in `cl-letf`. I hear the war on `cl-symbol-macrolet` was a failure. Maybe ... just say no? * lisp/emacs-lisp/cl-macs.el (cl--sm-macroexpand-1): New function, extracted from `cl--sm-macroexpand`. (cl--sm-macroexpand): Rewrite completely. (cl-symbol-macrolet): Advise both `macroexpand` and `macroexpand-1`. (cl--letf): Don't use the "simple variable" code for symbol macros. * test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-symbol-macrolet-hide): Revert last change because the test was right. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-test--symbol-macrolet): Add a test case. diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 9755c2636d..f8fdc50251 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2261,139 +2261,131 @@ This is like `cl-flet', but for macros instead of functions. (eval `(function (lambda ,@res)) t)) macroexpand-all-environment)))))) -(defun cl--sm-macroexpand (orig-fun exp &optional env) +(defun cl--sm-macroexpand (exp &optional env) + "Special macro expander used inside `cl-symbol-macrolet'." + ;; FIXME: Arguably, this should be the official definition of `macroexpand'. + (while (not (eq exp (setq exp (macroexpand-1 exp env))))) + exp) + +(defun cl--sm-macroexpand-1 (orig-fun exp &optional env) "Special macro expander advice used inside `cl-symbol-macrolet'. -This function extends `macroexpand' during macro expansion +This function extends `macroexpand-1' during macro expansion of `cl-symbol-macrolet' to additionally expand symbol macros." - (let ((macroexpand-all-environment env) + (let ((exp (funcall orig-fun exp env)) (venv (alist-get :cl-symbol-macros env))) - (while - (progn - (setq exp (funcall orig-fun exp env)) - (pcase exp - ((pred symbolp) - ;; Perform symbol-macro expansion. - (let ((symval (assq exp venv))) - (when symval - (setq exp (cadr symval))))) - (`(setq . ,args) - ;; Convert setq to setf if required by symbol-macro expansion. - (let ((convert nil) - (rargs nil)) - (while args - (let ((place (pop args))) - ;; Here, we know `place' should be a symbol. - (while - (let ((symval (assq place venv))) - (when symval - (setq place (cadr symval)) - (if (symbolp place) - t ;Repeat. - (setq convert t) - nil)))) - (push place rargs) - (push (pop args) rargs))) - (setq exp (cons (if convert 'setf 'setq) - (nreverse rargs))) - convert)) - ;; CL's symbol-macrolet used to treat re-bindings as candidates for - ;; expansion (turning the let into a letf if needed), contrary to - ;; Common-Lisp where such re-bindings hide the symbol-macro. - ;; Not sure if there actually is code out there which depends - ;; on this behavior (haven't found any yet). - ;; Such code should explicitly use `cl-letf' instead, I think. - ;; - ;; (`(,(or `let `let*) . ,(or `(,bindings . ,body) pcase--dontcare)) - ;; (let ((letf nil) (found nil) (nbs ())) - ;; (dolist (binding bindings) - ;; (let* ((var (if (symbolp binding) binding (car binding))) - ;; (sm (assq var venv))) - ;; (push (if (not (cdr sm)) - ;; binding - ;; (let ((nexp (cadr sm))) - ;; (setq found t) - ;; (unless (symbolp nexp) (setq letf t)) - ;; (cons nexp (cdr-safe binding)))) - ;; nbs))) - ;; (when found - ;; (setq exp `(,(if letf - ;; (if (eq (car exp) 'let) 'cl-letf 'cl-letf*) - ;; (car exp)) - ;; ,(nreverse nbs) - ;; ,@body))))) - ;; - ;; We implement the Common-Lisp behavior, instead (see bug#26073): - ;; The behavior of CL made sense in a dynamically scoped - ;; language, but nowadays, lexical scoping semantics is more often - ;; expected. - (`(,(or 'let 'let*) . ,(or `(,bindings . ,body) pcase--dontcare)) - (let ((nbs ()) (found nil)) - (dolist (binding bindings) - (let* ((var (if (symbolp binding) binding (car binding))) - (val (and found (consp binding) (eq 'let* (car exp)) - (list (macroexpand-all (cadr binding) - env))))) - (push (if (assq var venv) - ;; This binding should hide "its" surrounding - ;; symbol-macro, but given the way macroexpand-all - ;; works (i.e. the `env' we receive as input will - ;; be (re)applied to the code we return), we can't - ;; prevent application of `env' to the - ;; sub-expressions, so we need to α-rename this - ;; variable instead. - (let ((nvar (make-symbol (symbol-name var)))) - (setq found t) - (push (list var nvar) venv) - (push (cons :cl-symbol-macros venv) env) - (cons nvar (or val (cdr-safe binding)))) - (if val (cons var val) binding)) - nbs))) - (when found - (setq exp `(,(car exp) - ,(nreverse nbs) - ,@(macroexp-unprogn - (macroexpand-all (macroexp-progn body) - env))))) - nil)) - ;; Do the same as for `let' but for variables introduced - ;; via other means, such as `lambda' and `condition-case'. - (`(function (lambda ,args . ,body)) - (let ((nargs ()) (found nil)) - (dolist (var args) - (push (cond - ((memq var '(&optional &rest)) var) - ((assq var venv) - (let ((nvar (make-symbol (symbol-name var)))) - (setq found t) - (push (list var nvar) venv) - (push (cons :cl-symbol-macros venv) env) - nvar)) - (t var)) - nargs)) - (when found - (setq exp `(function - (lambda ,(nreverse nargs) - . ,(mapcar (lambda (exp) - (macroexpand-all exp env)) - body))))) - nil)) - ((and `(condition-case ,var ,exp . ,clauses) - (guard (assq var venv))) - (let ((nvar (make-symbol (symbol-name var)))) - (push (list var nvar) venv) - (push (cons :cl-symbol-macros venv) env) - (setq exp - `(condition-case ,nvar ,(macroexpand-all exp env) - . ,(mapcar - (lambda (clause) - `(,(car clause) - . ,(mapcar (lambda (exp) - (macroexpand-all exp env)) - (cdr clause)))) - clauses))) - nil)) - ))) - exp)) + (pcase exp + ((pred symbolp) + ;; Try symbol-macro expansion. + (let ((symval (assq exp venv))) + (if symval (cadr symval) exp))) + (`(setq . ,args) + ;; Convert setq to setf if required by symbol-macro expansion. + (let ((convert nil)) + (while args + (let* ((place (pop args)) + ;; Here, we know `place' should be a symbol. + (symval (assq place venv))) + (pop args) + (when symval + (setq convert t)))) + (if convert + (cons 'setf (cdr exp)) + exp))) + ;; CL's symbol-macrolet used to treat re-bindings as candidates for + ;; expansion (turning the let into a letf if needed), contrary to + ;; Common-Lisp where such re-bindings hide the symbol-macro. + ;; Not sure if there actually is code out there which depends + ;; on this behavior (haven't found any yet). + ;; Such code should explicitly use `cl-letf' instead, I think. + ;; + ;; (`(,(or `let `let*) . ,(or `(,bindings . ,body) pcase--dontcare)) + ;; (let ((letf nil) (found nil) (nbs ())) + ;; (dolist (binding bindings) + ;; (let* ((var (if (symbolp binding) binding (car binding))) + ;; (sm (assq var venv))) + ;; (push (if (not (cdr sm)) + ;; binding + ;; (let ((nexp (cadr sm))) + ;; (setq found t) + ;; (unless (symbolp nexp) (setq letf t)) + ;; (cons nexp (cdr-safe binding)))) + ;; nbs))) + ;; (when found + ;; (setq exp `(,(if letf + ;; (if (eq (car exp) 'let) 'cl-letf 'cl-letf*) + ;; (car exp)) + ;; ,(nreverse nbs) + ;; ,@body))))) + ;; + ;; We implement the Common-Lisp behavior, instead (see bug#26073): + ;; The behavior of CL made sense in a dynamically scoped + ;; language, but nowadays, lexical scoping semantics is more often + ;; expected. + (`(,(or 'let 'let*) . ,(or `(,bindings . ,body) pcase--dontcare)) + (let ((nbs ()) (found nil)) + (dolist (binding bindings) + (let* ((var (if (symbolp binding) binding (car binding))) + (val (and found (consp binding) (eq 'let* (car exp)) + (list (macroexpand-all (cadr binding) + env))))) + (push (if (assq var venv) + ;; This binding should hide "its" surrounding + ;; symbol-macro, but given the way macroexpand-all + ;; works (i.e. the `env' we receive as input will + ;; be (re)applied to the code we return), we can't + ;; prevent application of `env' to the + ;; sub-expressions, so we need to α-rename this + ;; variable instead. + (let ((nvar (make-symbol (symbol-name var)))) + (setq found t) + (push (list var nvar) venv) + (push (cons :cl-symbol-macros venv) env) + (cons nvar (or val (cdr-safe binding)))) + (if val (cons var val) binding)) + nbs))) + (if found + `(,(car exp) + ,(nreverse nbs) + ,@(macroexp-unprogn + (macroexpand-all (macroexp-progn body) + env))) + exp))) + ;; Do the same as for `let' but for variables introduced + ;; via other means, such as `lambda' and `condition-case'. + (`(function (lambda ,args . ,body)) + (let ((nargs ()) (found nil)) + (dolist (var args) + (push (cond + ((memq var '(&optional &rest)) var) + ((assq var venv) + (let ((nvar (make-symbol (symbol-name var)))) + (setq found t) + (push (list var nvar) venv) + (push (cons :cl-symbol-macros venv) env) + nvar)) + (t var)) + nargs)) + (if found + `(function + (lambda ,(nreverse nargs) + . ,(mapcar (lambda (exp) + (macroexpand-all exp env)) + body))) + exp))) + ((and `(condition-case ,var ,exp . ,clauses) + (guard (assq var venv))) + (let ((nvar (make-symbol (symbol-name var)))) + (push (list var nvar) venv) + (push (cons :cl-symbol-macros venv) env) + `(condition-case ,nvar ,(macroexpand-all exp env) + . ,(mapcar + (lambda (clause) + `(,(car clause) + . ,(mapcar (lambda (exp) + (macroexpand-all exp env)) + (cdr clause)))) + clauses)))) + (_ exp)))) ;;;###autoload (defmacro cl-symbol-macrolet (bindings &rest body) @@ -2412,7 +2404,8 @@ by EXPANSION, and (setq NAME ...) will act like (setf EXPANSION ...). (unwind-protect (progn (unless advised - (advice-add 'macroexpand :around #'cl--sm-macroexpand)) + (advice-add 'macroexpand :override #'cl--sm-macroexpand) + (advice-add 'macroexpand-1 :around #'cl--sm-macroexpand-1)) (let* ((venv (cdr (assq :cl-symbol-macros macroexpand-all-environment))) (expansion @@ -2428,7 +2421,8 @@ by EXPANSION, and (setq NAME ...) will act like (setf EXPANSION ...). expansion nil nil rev-malformed-bindings)) expansion))) (unless advised - (advice-remove 'macroexpand #'cl--sm-macroexpand))))) + (advice-remove 'macroexpand #'cl--sm-macroexpand) + (advice-remove 'macroexpand-1 #'cl--sm-macroexpand-1))))) ;;;###autoload (defmacro cl-with-gensyms (names &rest body) @@ -2765,8 +2759,14 @@ Each PLACE may be a symbol, or any generalized variable allowed by `setf'. (place (car binding))) (gv-letplace (getter setter) place (macroexp-let2 nil vnew (cadr binding) - (if (symbolp place) + (if (and (symbolp place) + ;; `place' could be some symbol-macro. + (eq place getter)) ;; Special-case for simple variables. + ;; FIXME: We currently only use this special case when `place' + ;; is a simple var. Should we also use it when the + ;; macroexpansion of `place' is a simple var (i.e. when + ;; getter+setter is the same as that of a simple var)? (cl--letf (cdr bindings) (cons `(,getter ,(if (cdr binding) vnew getter)) simplebinds) diff --git a/test/lisp/emacs-lisp/cl-lib-tests.el b/test/lisp/emacs-lisp/cl-lib-tests.el index 8d2b187e33..b19494af74 100644 --- a/test/lisp/emacs-lisp/cl-lib-tests.el +++ b/test/lisp/emacs-lisp/cl-lib-tests.el @@ -511,9 +511,6 @@ (ert-deftest cl-lib-symbol-macrolet-hide () - :expected-result :failed - ;; FIXME -- it's unclear what the semantics here should be, but - ;; 2dd1c2ab19f7fb99ecee flipped them. ;; bug#26325, bug#26073 (should (equal (let ((y 5)) (cl-symbol-macrolet ((x y)) diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el b/test/lisp/emacs-lisp/cl-macs-tests.el index 2a647e0830..68898720d9 100644 --- a/test/lisp/emacs-lisp/cl-macs-tests.el +++ b/test/lisp/emacs-lisp/cl-macs-tests.el @@ -552,7 +552,14 @@ collection clause." x) x)) (error err)) - '(1 7 3)))) + '(1 7 3))) + (should (equal + (let ((x (list 42))) + (cl-symbol-macrolet ((m (car x))) + (list m + (cl-letf ((m 5)) m) + m))) + '(42 5 42)))) (ert-deftest cl-macs-loop-conditional-step-clauses () "These tests failed under the initial fixes in #bug#29799." commit 9219e83b3c0ef53df02caf4c8ba38f482937ab50 Author: Sean Whitton Date: Mon Sep 5 17:39:21 2022 -0700 ; Document that a value of any other type means no highlighting * lisp/vc/vc-git.el (vc-git-log-edit-summary-target-len) (vc-git-log-edit-summary-max-len): Document that a value of any other type means no highlighting. diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 573622b71e..9dfdd9e7b1 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -862,6 +862,7 @@ The car of the list is the current branch." "Target length for Git commit summary lines. If a number, characters in Summary: lines beyond this length are displayed in the `vc-git-log-edit-summary-target-warning' face. +A value of any other type means no highlighting. By setting this to an integer around 50, you can improve the compatibility of your commit messages with Git commands that @@ -882,6 +883,7 @@ See `vc-git-log-edit-summary-target-len'.") "Maximum length for Git commit summary lines. If a number, characters in summary lines beyond this length are displayed in the `vc-git-log-edit-summary-max-warning' face. +A value of any other type means no highlighting. It is good practice to avoid writing summary lines longer than this because otherwise the summary line will be truncated in many commit 6a19f2a024b4cede80e2896318696008d1dd1b21 Author: Stefan Kangas Date: Tue Sep 6 02:05:18 2022 +0200 Add new --timeout flag to emacsclient * lib-src/emacsclient.c (DEFAULT_TIMEOUT): New constant. (timeout): New static variable. (longopts, shortopts, decode_options, print_help_and_exit): Add new flag --timeout. (set_socket_timeout, check_socket_timeout): New helper functions. (main): Display a status message or exit after Emacs has not responded for a while, depending on above new --timeout flag. (Bug#50849) * doc/emacs/misc.texi (emacsclient Options): * doc/man/emacsclient.1: Document the above new option. * etc/NEWS: Announce it. diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index df74577592..d8ad0bee34 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -2089,6 +2089,13 @@ all server buffers are finished. You can take as long as you like to edit the server buffers within Emacs, and they are @emph{not} killed when you type @kbd{C-x #} in them. +@item -w +@itemx --timeout=@var{N} +Wait for a response from Emacs for @var{N} seconds before giving up. +If there is no response within that time, @command{emacsclient} will +display a warning and exit. The default is @samp{0}, which means to +wait forever. + @item --parent-id @var{id} Open an @command{emacsclient} frame as a client frame in the parent X window with id @var{id}, via the XEmbed protocol. Currently, this diff --git a/doc/man/emacsclient.1 b/doc/man/emacsclient.1 index e5d1bbe09a..83c8a366f8 100644 --- a/doc/man/emacsclient.1 +++ b/doc/man/emacsclient.1 @@ -1,5 +1,5 @@ .\" See section COPYING for conditions for redistribution. -.TH EMACSCLIENT 1 "2021-11-05" "GNU Emacs" "GNU" +.TH EMACSCLIENT 1 "2022-09-05" "GNU Emacs" "GNU" .\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection .\" other params are allowed: see man(7), man(1) .SH NAME @@ -87,9 +87,12 @@ Use TCP configuration file FILENAME for communication. This can also be specified via the EMACS_SERVER_FILE environment variable. .TP .B \-n, \-\-no-wait -Return -immediately without waiting for you to "finish" the buffer in Emacs. -If combined with --eval, this option is ignored. +Return immediately without waiting for you to "finish" the buffer in +Emacs. If combined with --eval, this option is ignored. +.TP +.B \-w, \-\-timeout=N +How long to wait, in seconds, for Emacs to respond before giving up. +The default is 0, which means to wait forever. .TP .B \-nw, \-t, \-\-tty Open a new Emacs frame on the current terminal. diff --git a/etc/NEWS b/etc/NEWS index e99c2f2198..b61b88d6fb 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1003,10 +1003,15 @@ suspicious and could be malicious. ** Emacs server and client changes +++ -*** New command-line option '-r' for emacsclient. +*** New command-line option '-r'/'--reuse-frame' for emacsclient. With this command-line option, Emacs reuses an existing graphical client frame if one exists; otherwise it creates a new frame. ++++ +*** New command-line option '-w N'/'--timeout=N' for emacsclient. +With this command-line option, emacsclient will exit if Emacs does not +respond within N seconds. The default is to wait forever. + +++ *** 'server-stop-automatically' can be used to automatically stop the server. The Emacs server will be automatically stopped when certain conditions diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 73c8e45a86..15acb4589a 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -1,6 +1,6 @@ /* Client process that communicates with GNU Emacs acting as server. -Copyright (C) 1986-1987, 1994, 1999-2022 Free Software Foundation, Inc. +Copyright (C) 1986-2022 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -55,6 +55,8 @@ char *w32_getenv (const char *); # include # include +# define DEFAULT_TIMEOUT (30) + # define SOCKETS_IN_FILE_SYSTEM # define INVALID_SOCKET (-1) @@ -144,6 +146,9 @@ static char const *socket_name; /* If non-NULL, the filename of the authentication file. */ static char const *server_file; +/* Seconds to wait before timing out (0 means wait forever). */ +static uintmax_t timeout; + /* If non-NULL, the tramp prefix emacs must use to find the files. */ static char const *tramp_prefix; @@ -178,6 +183,7 @@ static struct option const longopts[] = { "server-file", required_argument, NULL, 'f' }, { "display", required_argument, NULL, 'd' }, { "parent-id", required_argument, NULL, 'p' }, + { "timeout", required_argument, NULL, 'w' }, { "tramp", required_argument, NULL, 'T' }, { 0, 0, 0, 0 } }; @@ -185,7 +191,7 @@ static struct option const longopts[] = /* Short options, in the same order as the corresponding long options. There is no '-p' short option. */ static char const shortopts[] = - "nqueHVtca:F:" + "nqueHVtca:F:w:" #ifdef SOCKETS_IN_FILE_SYSTEM "s:" #endif @@ -497,6 +503,7 @@ decode_options (int argc, char **argv) if (opt < 0) break; + char* endptr; switch (opt) { case 0: @@ -530,6 +537,17 @@ decode_options (int argc, char **argv) nowait = true; break; + case 'w': + timeout = strtoumax (optarg, &endptr, 10); + if (timeout <= 0 || + ((timeout == INTMAX_MAX || timeout == INTMAX_MIN) + && errno == ERANGE)) + { + fprintf (stderr, "Invalid timeout: \"%s\"\n", optarg); + exit (EXIT_FAILURE); + } + break; + case 'e': eval = true; break; @@ -671,6 +689,7 @@ The following OPTIONS are accepted:\n\ Set the parameters of a new frame\n\ -e, --eval Evaluate the FILE arguments as ELisp expressions\n\ -n, --no-wait Don't wait for the server to return\n\ +-w, --timeout Seconds to wait before timing out\n\ -q, --quiet Don't display messages on success\n\ -u, --suppress-output Don't display return values from the server\n\ -d DISPLAY, --display=DISPLAY\n\ @@ -1870,6 +1889,33 @@ start_daemon_and_retry_set_socket (void) return emacs_socket; } +static void +set_socket_timeout (HSOCKET socket, int seconds) +{ +#ifndef WINDOWSNT + struct timeval timeout; + timeout.tv_sec = seconds; + timeout.tv_usec = 0; + setsockopt (socket, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof timeout); +#else + DWORD timeout = seconds * 1000; + setsockopt (socket, SOL_SOCKET, SO_RCVTIMEO, (char *) &timeout, sizeof timeout); +#endif +} + +static bool +check_socket_timeout (int rl) +{ +#ifndef WINDOWSNT + return (rl == -1) + && (errno == EAGAIN) + && (errno == EWOULDBLOCK); +#else + return (rl == SOCKET_ERROR) + && (WSAGetLastError() == WSAETIMEDOUT); +#endif +} + int main (int argc, char **argv) { @@ -2086,19 +2132,42 @@ main (int argc, char **argv) } fflush (stdout); + set_socket_timeout (emacs_socket, timeout > 0 ? timeout : DEFAULT_TIMEOUT); + bool saw_response = false; /* Now, wait for an answer and print any messages. */ while (exit_status == EXIT_SUCCESS) { + bool retry = true; + bool msg_showed = quiet; do { act_on_signals (emacs_socket); rl = recv (emacs_socket, string, BUFSIZ, 0); + retry = check_socket_timeout (rl); + if (retry) + { + if (timeout > 0 && !saw_response) + { + /* Don't retry if we were given a --timeout flag. */ + fprintf (stderr, "\nServer not responding; timed out after %lu seconds", + timeout); + retry = false; + } + else if (!msg_showed) + { + msg_showed = true; + fprintf (stderr, "\nServer not responding; use Ctrl+C to break"); + } + } } - while (rl < 0 && errno == EINTR); + while ((rl < 0 && errno == EINTR) || retry); if (rl <= 0) break; + if (msg_showed) + fprintf (stderr, "\nGot response from server"); + saw_response = true; string[rl] = '\0'; /* Loop over all NL-terminated messages. */ commit b648634982bb52be2b21e92d4aeb837621b5ec63 Author: Gregory Heytings Date: Mon Sep 5 22:13:07 2022 +0000 ; * lisp/help-fns.el (help-fns--key-bindings): Fix previous change. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index e223b10ba8..dac4a03cd9 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -516,7 +516,8 @@ the C sources, too." (remapped (command-remapping function))) (unless (memq remapped '(ignore undefined)) (let* ((all-keys - (with-current-buffer describe-function-orig-buffer + (with-current-buffer + (or describe-function-orig-buffer (current-buffer)) (where-is-internal (or remapped function) overriding-local-map nil nil))) (seps (seq-group-by commit 361d3dbc4ec8ba6c47ab96f1d89abce1063883d8 Author: Lars Ingebrigtsen Date: Tue Sep 6 00:06:34 2022 +0200 Disable failing cl-lib-symbol-macrolet-hide test for now * test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-symbol-macrolet-hide): Disable until code is fixed. diff --git a/test/lisp/emacs-lisp/cl-lib-tests.el b/test/lisp/emacs-lisp/cl-lib-tests.el index b19494af74..8d2b187e33 100644 --- a/test/lisp/emacs-lisp/cl-lib-tests.el +++ b/test/lisp/emacs-lisp/cl-lib-tests.el @@ -511,6 +511,9 @@ (ert-deftest cl-lib-symbol-macrolet-hide () + :expected-result :failed + ;; FIXME -- it's unclear what the semantics here should be, but + ;; 2dd1c2ab19f7fb99ecee flipped them. ;; bug#26325, bug#26073 (should (equal (let ((y 5)) (cl-symbol-macrolet ((x y)) commit c641848bce91fd0a67ba564669cc2602bba19791 Author: Gregory Heytings Date: Mon Sep 5 21:28:32 2022 +0000 Simplify describe-function. * lisp/help-fns.el (describe-function-1): Do not pass 'describe-function-orig-buffer' as argument to... (help-fns--key-bindings): but use it directly there instead. This simplifies 1d1158397b. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 6d635ec9ee..e223b10ba8 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -510,13 +510,13 @@ the C sources, too." (src-file (locate-library file-name t nil 'readable))) (and src-file (file-readable-p src-file) src-file)))))) -(defun help-fns--key-bindings (function orig-buffer) +(defun help-fns--key-bindings (function) (when (commandp function) (let ((pt2 (with-current-buffer standard-output (point))) (remapped (command-remapping function))) (unless (memq remapped '(ignore undefined)) (let* ((all-keys - (with-current-buffer (or orig-buffer (current-buffer)) + (with-current-buffer describe-function-orig-buffer (where-is-internal (or remapped function) overriding-local-map nil nil))) (seps (seq-group-by @@ -1131,7 +1131,7 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED REAL-DEF)." (string-match "\\([^\\]=\\|[^=]\\|\\`\\)\\\\[[{<]" doc-raw) (autoload-do-load real-def)) - (help-fns--key-bindings function describe-function-orig-buffer) + (help-fns--key-bindings function) (with-current-buffer standard-output (let ((doc (condition-case nil ;; FIXME: Maybe `help-fns--signature' should return `doc' commit 1763cd4727a4ff38a9ea89e1d532017adff05c1e Author: Juri Linkov Date: Mon Sep 5 20:58:27 2022 +0200 Fit the re-builder window to the buffer * lisp/emacs-lisp/re-builder.el (re-builder): Fit the height to the buffer (bug#56772). diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el index e6e8bb202d..897c35b5b1 100644 --- a/lisp/emacs-lisp/re-builder.el +++ b/lisp/emacs-lisp/re-builder.el @@ -369,7 +369,8 @@ provided in the Commentary section of this library." (get-buffer-create reb-buffer) `((display-buffer-in-direction) (direction . ,dir) - (dedicated . t)))))) + (dedicated . t) + (window-height . fit-window-to-buffer)))))) (font-lock-mode 1) (reb-initialize-buffer))) commit 6a2ee981c3a4a2f7e0864b0394ec47f6522847ee Author: Hugo Heagren Date: Mon Sep 5 20:54:51 2022 +0200 Add new functions for splitting the root window * lisp/window.el (split-window-right): Add optional argument to control which window is split (previously, would only split selected window). Update docstring. * doc/lispref/windows.texi (Splitting Windows): Update docs for `split-window-right'. * lisp/window.el (split-window-below): Add optional argument to control which window is split (previously, would only split selected window). Update docstring. * doc/lispref/windows.texi (Splitting Windows): Update docs for `split-window-below'. * lisp/window.el (ctl-x-map): Bind `split-root-window-right' to 9 in ctl-x-map. This is consistent with binding other window-splitting operations to numbers in this map. * lisp/window.el (ctl-x-map): Bind `split-root-window-below' to 7 in ctl-x-map. This is consistent with binding other window-splitting operations to numbers in this map. * lisp/window.el (split-root-window-right): New function to split whole frame. * doc/lispref/windows.texi (Splitting Windows): Add documentation for `split-root-window-right'. * lisp/window.el (split-root-window-below): New function to split whole frame. * doc/lispref/windows.texi (Splitting Windows): Add documentation for `split-root-window-below' (bug#56791). diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index c7f014e2f3..33d0150a93 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -1472,20 +1472,36 @@ the new root window. For interactive use, Emacs provides two commands which always split the selected window. These call @code{split-window} internally. -@deffn Command split-window-right &optional size -This function splits the selected window into two side-by-side -windows, putting the selected window on the left. If @var{size} is -positive, the left window gets @var{size} columns; if @var{size} is +@deffn Command split-window-right &optional size window-to-split +This function splits the window @var{window-to-split} into two +side-by-side windows, putting @var{window-to-split} on the left. +@var{window-to-split} defaults to the selected window. If @var{size} +is positive, the left window gets @var{size} columns; if @var{size} is negative, the right window gets @minus{}@var{size} columns. @end deffn -@deffn Command split-window-below &optional size -This function splits the selected window into two windows, one above -the other, leaving the upper window selected. If @var{size} is -positive, the upper window gets @var{size} lines; if @var{size} is +@deffn Command split-window-below &optional size window-to-split +This function splits the window @var{window-to-split} into two +windows, one above the other, leaving the upper window selected. +@var{window-to-split} defaults to the selected window. If @var{size} +is positive, the upper window gets @var{size} lines; if @var{size} is negative, the lower window gets @minus{}@var{size} lines. @end deffn +@deffn Command split-root-window-below &optional size +This function splits the whole frame in two. The current window +configuration is retained on the top, and a new window is created +below, taking up the whole width of the frame. @var{size} is treated +as by @code{split-window-below}. +@end deffn + +@deffn Command split-root-window-right &optional size +This function splits the whole frame in two. The current window +configuration is retained on the left, and a new window is created on +the right, taking up the whole height of the frame. @var{size} is treated +as by @code{split-window-right}. +@end deffn + @defopt split-window-keep-point If the value of this variable is non-@code{nil} (the default), @code{split-window-below} behaves as described above. diff --git a/etc/NEWS b/etc/NEWS index 1ee5958bce..e99c2f2198 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -943,6 +943,11 @@ non-nil in 'special-mode' and its derivatives. ** Windows ++++ +*** New commands 'split-root-window-below' and 'split-root-window-right'. +These commands split the root window in to, and are are bound to 'C-x +7' and 'C-x 9' respectively. + +++ *** New user option 'display-buffer-avoid-small-windows'. If non-nil, this should be a window height, a number. Windows smaller diff --git a/lisp/window.el b/lisp/window.el index ec2b0a6930..9ff55dc980 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -5672,9 +5672,9 @@ the original point in both windows." :type 'boolean :group 'windows) -(defun split-window-below (&optional size) - "Split the selected window into two windows, one above the other. -The selected window is above. The newly split-off window is +(defun split-window-below (&optional size window-to-split) + "Split WINDOW-TO-SPLIT into two windows, one above the other. +WINDOW-TO-SPLIT is above. The newly split-off window is below and displays the same buffer. Return the new window. If optional argument SIZE is omitted or nil, both windows get the @@ -5683,22 +5683,22 @@ same height, or close to it. If SIZE is positive, the upper lower (new) window gets -SIZE lines. If the variable `split-window-keep-point' is non-nil, both -windows get the same value of point as the selected window. +windows get the same value of point as the WINDOW-TO-SPLIT. Otherwise, the window starts are chosen so as to minimize the amount of redisplay; this is convenient on slow terminals." - (interactive "P") - (let ((old-window (selected-window)) - (old-point (window-point)) - (size (and size (prefix-numeric-value size))) + (interactive `(,(when current-prefix-arg + (prefix-numeric-value current-prefix-arg)) + ,(selected-window))) + (let ((old-point (window-point)) moved-by-window-height moved new-window bottom) (when (and size (< size 0) (< (- size) window-min-height)) ;; `split-window' would not signal an error here. (error "Size of new window too small")) - (setq new-window (split-window nil size)) + (setq new-window (split-window window-to-split size)) (unless split-window-keep-point - (with-current-buffer (window-buffer) + (with-current-buffer (window-buffer window-to-split) ;; Use `save-excursion' around vertical movements below - ;; (Bug#10971). Note: When the selected window's buffer has a + ;; (Bug#10971). Note: When WINDOW-TO-SPLIT's buffer has a ;; header line, up to two lines of the buffer may not show up ;; in the resulting configuration. (save-excursion @@ -5713,24 +5713,31 @@ amount of redisplay; this is convenient on slow terminals." (setq bottom (point))) (and moved-by-window-height (<= bottom (point)) - (set-window-point old-window (1- bottom))) + (set-window-point window-to-split (1- bottom))) (and moved-by-window-height (<= (window-start new-window) old-point) (set-window-point new-window old-point) (select-window new-window)))) ;; Always copy quit-restore parameter in interactive use. - (let ((quit-restore (window-parameter old-window 'quit-restore))) + (let ((quit-restore (window-parameter window-to-split 'quit-restore))) (when quit-restore (set-window-parameter new-window 'quit-restore quit-restore))) new-window)) (defalias 'split-window-vertically 'split-window-below) -(defun split-window-right (&optional size) - "Split the selected window into two side-by-side windows. -The selected window is on the left. The newly split-off window -is on the right and displays the same buffer. Return the new -window. +(defun split-root-window-below (&optional size) + "Split root window of current frame in two. +The current window configuration is retained in the top window, +the lower window takes up the whole width of the frame. SIZE is +handled as in `split-window-below'." + (interactive "P") + (split-window-below size (frame-root-window))) + +(defun split-window-right (&optional size window-to-split) + "Split WINDOW-TO-SPLIT into two side-by-side windows. +WINDOW-TO-SPLIT is on the left. The newly split-off window is on +the right and displays the same buffer. Return the new window. If optional argument SIZE is omitted or nil, both windows get the same width, or close to it. If SIZE is positive, the left-hand @@ -5739,21 +5746,30 @@ right-hand (new) window gets -SIZE columns. Here, SIZE includes the width of the window's scroll bar; if there are no scroll bars, it includes the width of the divider column to the window's right, if any." - (interactive "P") - (let ((old-window (selected-window)) - (size (and size (prefix-numeric-value size))) - new-window) + (interactive `(,(when current-prefix-arg + (prefix-numeric-value current-prefix-arg)) + ,(selected-window))) + (let (new-window) (when (and size (< size 0) (< (- size) window-min-width)) ;; `split-window' would not signal an error here. (error "Size of new window too small")) - (setq new-window (split-window nil size t)) + (setq new-window (split-window window-to-split size t)) ;; Always copy quit-restore parameter in interactive use. - (let ((quit-restore (window-parameter old-window 'quit-restore))) + (let ((quit-restore (window-parameter window-to-split 'quit-restore))) (when quit-restore (set-window-parameter new-window 'quit-restore quit-restore))) new-window)) (defalias 'split-window-horizontally 'split-window-right) + +(defun split-root-window-right (&optional size) + "Split root window of current frame into two side-by-side windows. +The current window configuration is retained within the left +window, and a new window is created on the right, taking up the +whole height of the frame. SIZE is treated as by +`split-window-right'." + (interactive "P") + (split-window-right size (frame-root-window))) ;;; Balancing windows. @@ -10564,6 +10580,8 @@ displaying that processes's buffer." (define-key ctl-x-map "{" 'shrink-window-horizontally) (define-key ctl-x-map "-" 'shrink-window-if-larger-than-buffer) (define-key ctl-x-map "+" 'balance-windows) +(define-key ctl-x-map "7" 'split-root-window-below) +(define-key ctl-x-map "9" 'split-root-window-right) (define-key ctl-x-4-map "0" 'kill-buffer-and-window) (define-key ctl-x-4-map "1" 'same-window-prefix) (define-key ctl-x-4-map "4" 'other-window-prefix) commit 21c725dfe0c8fc3d4df32edb4995346df1ea9b97 Author: Sean Whitton Date: Sun Sep 4 16:20:15 2022 -0700 Font lock long Git commit summary lines * lisp/vc/vc-git.el (vc-git-log-edit-summary-target-len) (vc-git-log-edit-summary-max-len): New defcustoms. (vc-git-log-edit-summary-target-warning) (vc-git-log-edit-summary-max-warning): New faces. (vc-git--log-edit-summary-check): New function. (vc-git-log-edit-mode): Add vc-git--log-edit-summary-check to log-edit-font-lock-keywords to font lock long Git commit summary lines. * etc/NEWS (VC): Document the change. * .dir-locals.el: Set vc-git-log-edit-summary-target-len. diff --git a/.dir-locals.el b/.dir-locals.el index 7812beb001..1c90ddcf56 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -17,7 +17,8 @@ (electric-quote-string . nil) (mode . bug-reference-prog))) (log-edit-mode . ((log-edit-font-lock-gnu-style . t) - (log-edit-setup-add-author . t))) + (log-edit-setup-add-author . t) + (vc-git-log-edit-summary-target-len . 50))) (change-log-mode . ((add-log-time-zone-rule . t) (fill-column . 74) (mode . bug-reference))) diff --git a/etc/NEWS b/etc/NEWS index 476cd7ba6c..1ee5958bce 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1644,6 +1644,12 @@ directory in "~/foo/bar", using 'C-x v v' on a new, unregistered file in the Git repository in "~/foo/bar". This makes this command consistent with 'vc-responsible-backend'. +--- +*** Log Edit now font locks long Git commit summary lines. +Writing shorter summary lines avoids truncation in contexts in which +Git commands display summary lines. See the two new variables +'vc-git-log-edit-summary-target-len' and 'vc-git-log-edit-summary-max-len'. + ** Message --- diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 7395253745..573622b71e 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -858,6 +858,45 @@ The car of the list is the current branch." ;;; STATE-CHANGING FUNCTIONS +(defcustom vc-git-log-edit-summary-target-len nil + "Target length for Git commit summary lines. +If a number, characters in Summary: lines beyond this length are +displayed in the `vc-git-log-edit-summary-target-warning' face. + +By setting this to an integer around 50, you can improve the +compatibility of your commit messages with Git commands that +print the summary line in width-constrained contexts. However, +many commit summaries will need to exceed this length. + +See also `vc-git-log-edit-summary-max-len'." + :type '(choice (const :tag "No target" nil) + (natnum :tag "Target length")) + :safe (lambda (x) (or (not x) (natnump x)))) + +(defface vc-git-log-edit-summary-target-warning + '((t :inherit warning)) + "Face for Git commit summary lines beyond the target length. +See `vc-git-log-edit-summary-target-len'.") + +(defcustom vc-git-log-edit-summary-max-len 68 + "Maximum length for Git commit summary lines. +If a number, characters in summary lines beyond this length are +displayed in the `vc-git-log-edit-summary-max-warning' face. + +It is good practice to avoid writing summary lines longer than +this because otherwise the summary line will be truncated in many +contexts in which Git commands display summary lines. + +See also `vc-git-log-edit-summary-target-len'." + :type '(choice (const :tag "No target" nil) + (natnum :tag "Target length")) + :safe (lambda (x) (or (not x) (natnump x)))) + +(defface vc-git-log-edit-summary-max-warning + '((t :inherit error)) + "Face for Git commit summary lines beyond the maximum length. +See `vc-git-log-edit-summary-max-len'.") + (defun vc-git-create-repo () "Create a new Git repository." (vc-git-command nil 0 nil "init")) @@ -911,9 +950,32 @@ If toggling on, also insert its message into the buffer." "C-c C-n" #'vc-git-log-edit-toggle-no-verify "C-c C-e" #'vc-git-log-edit-toggle-amend) +(defun vc-git--log-edit-summary-check (limit) + (and (re-search-forward "^Summary: " limit t) + (when-let ((regex + (cond ((and (natnump vc-git-log-edit-summary-max-len) + (natnump vc-git-log-edit-summary-target-len)) + (format ".\\{,%d\\}\\(.\\{,%d\\}\\)\\(.*\\)" + vc-git-log-edit-summary-target-len + (- vc-git-log-edit-summary-max-len + vc-git-log-edit-summary-target-len))) + ((natnump vc-git-log-edit-summary-max-len) + (format ".\\{,%d\\}\\(?2:.*\\)" + vc-git-log-edit-summary-max-len)) + ((natnump vc-git-log-edit-summary-target-len) + (format ".\\{,%d\\}\\(.*\\)" + vc-git-log-edit-summary-target-len))))) + (re-search-forward regex limit t)))) + (define-derived-mode vc-git-log-edit-mode log-edit-mode "Log-Edit/git" "Major mode for editing Git log messages. -It is based on `log-edit-mode', and has Git-specific extensions.") +It is based on `log-edit-mode', and has Git-specific extensions." + (setq-local + log-edit-font-lock-keywords + (append log-edit-font-lock-keywords + '((vc-git--log-edit-summary-check + (1 'vc-git-log-edit-summary-target-warning prepend t) + (2 'vc-git-log-edit-summary-max-warning prepend t)))))) (defvar vc-git-patch-string nil) commit ecbdb3b0adf0515233cac050e5366108ba0e3d03 (refs/remotes/origin/emacs-28) Author: Stefan Kangas Date: Mon Sep 5 15:44:01 2022 +0200 * lisp/server.el: Improve Commentary. diff --git a/lisp/server.el b/lisp/server.el index 65602cd1a1..7542c02d67 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -27,12 +27,12 @@ ;;; Commentary: -;; This Lisp code is run in Emacs when it is to operate as -;; a server for other processes. +;; This library allows Emacs to operate as a server for other +;; processes. -;; Load this library and do M-x server-edit to enable Emacs as a server. +;; Load this library and do `M-x server-start' to enable Emacs as a server. ;; Emacs opens up a socket for communication with clients. If there are no -;; client buffers to edit, server-edit acts like (switch-to-buffer +;; client buffers to edit, `server-edit' acts like (switch-to-buffer ;; (other-buffer)) ;; When some other program runs "the editor" to edit a file, @@ -42,10 +42,10 @@ ;; Note that any number of clients may dispatch files to Emacs to be edited. -;; When you finish editing a Server buffer, again call server-edit +;; When you finish editing a Server buffer, again call `server-edit' ;; to mark that buffer as done for the client and switch to the next ;; Server buffer. When all the buffers for a client have been edited -;; and exited with server-edit, the client "editor" will return +;; and exited with `server-edit', the client "editor" will return ;; to the program that invoked it. ;; Your editing commands and Emacs's display output go to and from @@ -54,25 +54,28 @@ ;; the client. This is possible in four cases: ;; 1. On a window system, where Emacs runs in one window and the -;; program that wants to use "the editor" runs in another. +;; program that wants to use "the editor" runs in another. -;; 2. On a multi-terminal system, where Emacs runs on one terminal and the -;; program that wants to use "the editor" runs on another. +;; 2. On a multi-terminal system, where Emacs runs on one terminal and +;; the program that wants to use "the editor" runs on another. -;; 3. When the program that wants to use "the editor" is running -;; as a subprocess of Emacs. +;; 3. When the program that wants to use "the editor" is running as a +;; subprocess of Emacs. -;; 4. On a system with job control, when Emacs is suspended, the program -;; that wants to use "the editor" will stop and display -;; "Waiting for Emacs...". It can then be suspended, and Emacs can be -;; brought into the foreground for editing. When done editing, Emacs is -;; suspended again, and the client program is brought into the foreground. +;; 4. On a system with job control, when Emacs is suspended, the +;; program that wants to use "the editor" will stop and display +;; "Waiting for Emacs...". It can then be suspended, and Emacs can +;; be brought into the foreground for editing. When done editing, +;; Emacs is suspended again, and the client program is brought into +;; the foreground. -;; The buffer local variable "server-buffer-clients" lists +;; The buffer local variable `server-buffer-clients' lists ;; the clients who are waiting for this buffer to be edited. -;; The global variable "server-clients" lists all the waiting clients, +;; The global variable `server-clients' lists all the waiting clients, ;; and which files are yet to be edited for each. +;;; Code: + ;; Todo: ;; - handle command-line-args-left. @@ -80,8 +83,6 @@ ;; to here. ;; - fix up handling of the client's environment (place it in the terminal?). -;;; Code: - (eval-when-compile (require 'cl-lib)) (defgroup server nil commit 3f1efe33d68b4a09246e0d2d6e5fb0e3def26060 Merge: 0773d1a03a 5c8b76fc87 Author: Eli Zaretskii Date: Mon Sep 5 15:17:49 2022 +0300 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs commit 0773d1a03a181ef0912b1c83720adabf0395d46b Author: Eli Zaretskii Date: Mon Sep 5 15:17:03 2022 +0300 ; * doc/emacs/mark.texi (Mark): Improve wording. diff --git a/doc/emacs/mark.texi b/doc/emacs/mark.texi index b5956cc85b..db96093a17 100644 --- a/doc/emacs/mark.texi +++ b/doc/emacs/mark.texi @@ -38,10 +38,11 @@ the mark; this turns off the highlighting. You can also explicitly deactivate the mark at any time, by typing @kbd{C-g} (@pxref{Quitting}). - Many commands limit what they do to the active region. For -instance, the @kbd{M-%} command (which replaces matching text) -normally works on the entire visible part of the buffer, but if you -have an active region, it'll work on just that region instead. + Many commands limit the text on which they operate to the active +region. For instance, the @kbd{M-%} command (which replaces matching +text) normally works on the entire accessible portion of the buffer, +but if you have an active region, it'll work only on that region +instead. The mark is useful even if it is not active. For example, you can move to previous mark locations using the mark ring. @xref{Mark commit ee5c59124982978c608d7b658c53ba66d1f656d8 Author: Gregory Heytings Date: Mon Sep 5 08:55:10 2022 +0000 Explain how the font appearance can be fine-tuned in fbterm. * doc/misc/efaq.texi (Emacs in a Linux console): Briefly document Xft font specifications with which the font appearance can be fine-tuned. diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index 32fdcb8058..ec0122ce3c 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -3045,6 +3045,19 @@ command, separated by commas: $ fc-list :spacing=mono family | sed 's/ /\\ /g' @end example +@noindent +Note that you can fine-tune the appearance of the fonts by adding +attribute-value pairs, separated by colons, after each font name. For +example, + +@example +font-names=DejaVu\ Sans\ Mono:style=bold:antialias=false +@end example + +@noindent +selects the bold style of the DejaVu Sans Mono font, and disables +anti-aliasing. + You can now start Emacs inside @command{fbterm} with the command @example commit 5c8b76fc873676457810817958c119542ffe16f6 Merge: 21c8a9d944 5713c730f2 Author: Stefan Kangas Date: Mon Sep 5 06:30:32 2022 +0200 Merge from origin/emacs-28 5713c730f2 Update to Org 9.5.5 aad38d6010 * lisp/emacs-lisp/comp.el (comp-run-async-workers): Fail m... commit 5713c730f201675918544dbe40ad308c5d0463c3 Author: Kyle Meyer Date: Sat Sep 3 21:32:20 2022 -0400 Update to Org 9.5.5 diff --git a/etc/refcards/orgcard.tex b/etc/refcards/orgcard.tex index bb4bc5b25d..9462df8574 100644 --- a/etc/refcards/orgcard.tex +++ b/etc/refcards/orgcard.tex @@ -1,5 +1,5 @@ % Reference Card for Org Mode -\def\orgversionnumber{9.5.4} +\def\orgversionnumber{9.5.5} \def\versionyear{2021} % latest update \input emacsver.tex diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index 353d533c06..3273d8707d 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el @@ -5,13 +5,13 @@ (defun org-release () "The release version of Org. Inserted by installing Org mode or when a release is made." - (let ((org-release "9.5.4")) + (let ((org-release "9.5.5")) org-release)) ;;;###autoload (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.5.4-19-g4dff42")) + (let ((org-git-version "release_9.5.5")) org-git-version)) (provide 'org-version) diff --git a/lisp/org/org.el b/lisp/org/org.el index a6155c1382..bc4c83b7d9 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -9,7 +9,7 @@ ;; Homepage: https://orgmode.org ;; Package-Requires: ((emacs "25.1")) -;; Version: 9.5.4 +;; Version: 9.5.5 ;; This file is part of GNU Emacs. ;; commit aad38d6010d9eef07685fa52ce93bcf70512f88b Author: Stefan Monnier Date: Sat Sep 3 11:03:01 2022 -0400 * lisp/emacs-lisp/comp.el (comp-run-async-workers): Fail more gracefully Otherwise Emacs may fail to start if it can't find a writable `~/.emacs.d/eln-cache` directory. Fixes bug#57562. See also Debian's bug #1017739. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 374b39e999..a5ab12ae38 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -3927,8 +3927,11 @@ display a message." when (or native-comp-always-compile load ; Always compile when the compilation is ; commanded for late load. - (file-newer-than-file-p - source-file (comp-el-to-eln-filename source-file))) + ;; Skip compilation if `comp-el-to-eln-filename' fails + ;; to find a writable directory. + (with-demoted-errors "Async compilation :%S" + (file-newer-than-file-p + source-file (comp-el-to-eln-filename source-file)))) do (let* ((expr `((require 'comp) ,(when (boundp 'backtrace-line-length) `(setf backtrace-line-length ,backtrace-line-length))