commit 4f3dae2b0d5fc43e5e2effa6d36544b6de2a43d8 (HEAD, refs/remotes/origin/master) Author: Dmitry Gutov Date: Sat Apr 22 02:27:22 2023 +0300 project--read-project-buffer: Fixup default-directory if needed * lisp/progmodes/project.el (project--read-project-buffer): Make sure that when the read buffer is new, its default-directory belongs to the project (bug#62974). diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 04c67710d71..7c51778d5d4 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1327,13 +1327,23 @@ project--read-project-buffer (and (memq (cdr buffer) buffers) (not (project--buffer-check - (cdr buffer) project-ignore-buffer-conditions)))))) - (read-buffer - "Switch to buffer: " - (when (funcall predicate (cons other-name other-buffer)) - other-name) - nil - predicate))) + (cdr buffer) project-ignore-buffer-conditions))))) + (buffer (read-buffer + "Switch to buffer: " + (when (funcall predicate (cons other-name other-buffer)) + other-name) + nil + predicate))) + ;; XXX: This check hardcodes the default buffer-belonging relation + ;; which `project-buffers' is allowed to override. Straighten + ;; this up sometime later. Or not. Since we can add a method + ;; `project-contains-buffer-p', but a separate method to create a + ;; new project buffer seems too much. + (if (or (get-buffer buffer) + (file-in-directory-p default-directory (project-root pr))) + buffer + (let ((default-directory (project-root pr))) + (get-buffer-create buffer))))) ;;;###autoload (defun project-switch-to-buffer (buffer-or-name) commit 42def8422fdeb86054155a7d484db1f56ddf8e87 Author: Yuan Fu Date: Fri Apr 21 13:48:51 2023 -0700 ; * etc/NEWS: Mention the new symbol images. diff --git a/etc/NEWS b/etc/NEWS index b121002b246..ee0659b95a4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -66,6 +66,10 @@ This allows the user to customize the prompt that is appended by 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 +plus, minus, check-mark, start, etc. * Editing Changes in Emacs 30.1 commit f1ce49d148b334a8fb5302c4dd596aceffbb6b57 Merge: 4416262f59f 3899acbb336 Author: Eli Zaretskii Date: Fri Apr 21 07:29:14 2023 -0400 Merge from origin/emacs-29 3899acbb336 ; * src/fringe.c: Fix description of large circle. (Bug#... 2b10e1827d3 sql: add missing postgresql types 9ac12592781 Fix display of menu-bar bindings of commands in *Help* bu... ecdd3a9efac Improve Completion Example section in the Emacs manual 626e1ac62b2 Improve 'message-server-alist' docstring 327986936c3 Add index entry for fallback modes 1c4783c3300 ; * etc/NEWS: Copyedits and grammar fixes. 3d6f7553319 xref-search-program-alist: Fix searching larger file list... 1b8b2cf61bd Fix typo and inaccuracy in the ELisp Reference manual df17682ebf1 ; Support 'dart-ts-mode' in Eglot e0dc60e0780 ; Fix typos in gdb-mi.el 60560cc7adf Fix description of lexical environment's internals 1456adf4248 ; Eglot: fix a typo in a customization type 2f59595f5f4 ; * etc/NEWS: Grammar fixes. 596b780ab71 Update to Org 9.6.4-2-g0f6ae7 a0b04a22479 Documentation copyedits for 'package-install-upgrade-buil... 580d8278c5f Allow upgrading built-in packages with 'package-install' 329304c23fa ; * src/term.c (init_tty): Fix last change. (Bug#62877) 200dbf7d302 Minor changes in c-ts-mode.el's support of DEFUNs 9686b015a0d Fix strike-through attribute support on TTY frames 39035fbfc5f Avoid crashes in 'describe-keymap' due to shadowing # Conflicts: # etc/NEWS # lisp/progmodes/c-ts-mode.el # lisp/progmodes/eglot.el commit 4416262f59f5e74d3991fdf9c06ad776eca50663 Author: Jim Porter Date: Wed Apr 12 23:03:31 2023 -0700 Add Git hooks to check filenames listed in the commit message See . * build-aux/git-hooks/commit-msg-files.awk: * build-aux/git-hooks/post-commit: * build-aux/git-hooks/pre-push: New files... * autogen.sh: ... add them. diff --git a/autogen.sh b/autogen.sh index af4c2ad14df..6127e7b24f4 100755 --- a/autogen.sh +++ b/autogen.sh @@ -340,7 +340,8 @@ hooks= tailored_hooks= sample_hooks= -for hook in commit-msg pre-commit prepare-commit-msg; do +for hook in commit-msg pre-commit prepare-commit-msg post-commit \ + pre-push commit-msg-files.awk; do cmp -- build-aux/git-hooks/$hook "$hooks/$hook" >/dev/null 2>&1 || tailored_hooks="$tailored_hooks $hook" done diff --git a/build-aux/git-hooks/commit-msg-files.awk b/build-aux/git-hooks/commit-msg-files.awk new file mode 100644 index 00000000000..3856e474d3e --- /dev/null +++ b/build-aux/git-hooks/commit-msg-files.awk @@ -0,0 +1,113 @@ +# Check the file list of GNU Emacs change log entries for each commit SHA. + +# Copyright 2023 Free Software Foundation, Inc. + +# This file is part of GNU Emacs. + +# GNU Emacs is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# GNU Emacs is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with GNU Emacs. If not, see . + +### Commentary: + +# This script accepts a list of (unabbreviated) Git commit SHAs, and +# will then iterate over them to check that any files mentioned in the +# commit message are actually present in the commit's diff. If not, +# it will print out the incorrect file names and return 1. + +# You can also pass "-v reason=pre-push", which will add more-verbose +# output, indicating the abbreviated commit SHA and first line of the +# commit message for any improper commits. + +### Code: + +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) + while ((cmd | getline) > 0) { + for (i = 2; i <= NF; i++) { + len = split($i, bits, "/") + for (j = 1; j <= len; j++) { + if (j == 1) + filename = bits[j] + else + filename = filename "/" bits[j] + changes[filename] = 1 + } + } + } + close(cmd) +} + +function check_commit_msg_files(commit_sha, verbose, changes, good, \ + cmd, msg, filenames_str, filenames, i) { + get_commit_changes(commit_sha, changes) + good = 1 + + cmd = ("git log -1 --format=%B " commit_sha) + while ((cmd | getline) > 0) { + 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 + # by spaces (and possibly a comma). Iterate over each of them. + split(substr($0, RSTART, RLENGTH), filenames, ",?([[:blank:]]+|$)") + + for (i in filenames) { + # Remove trailing slashes from any directory entries. + sub(/\/$/, "", filenames[i]) + + if (length(filenames[i]) && ! (filenames[i] in changes)) { + if (good) { + # Print a header describing the error. + if (verbose) + printf("In commit %s \"%s\"...\n", substr(commit_sha, 1, 10), msg) + printf("Files listed in commit message, but not in diff:\n") + } + printf(" %s\n", filenames[i]) + good = 0 + } + } + } + } + close(cmd) + + return good +} + +BEGIN { + if (reason == "pre-push") + verbose = 1 +} + +/^[a-z0-9]{40}$/ { + if (! check_commit_msg_files($0, verbose)) { + status = 1 + } +} + +END { + if (status != 0) { + if (reason == "pre-push") + error_msg = "Push aborted" + else + error_msg = "Bad commit message" + printf("%s; please see the file 'CONTRIBUTE'\n", error_msg) + } + exit status +} diff --git a/build-aux/git-hooks/post-commit b/build-aux/git-hooks/post-commit new file mode 100755 index 00000000000..68d9995d915 --- /dev/null +++ b/build-aux/git-hooks/post-commit @@ -0,0 +1,45 @@ +#!/bin/sh +# Check the file list of GNU Emacs change log entries after committing. + +# Copyright 2023 Free Software Foundation, Inc. + +# This file is part of GNU Emacs. + +# GNU Emacs is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# GNU Emacs is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with GNU Emacs. If not, see . + +### Commentary: + +# This hook runs after a commit is finalized and checks that the files +# mentioned in the commit message match the diff. We perform this in +# the post-commit phase so that we can be sure we properly detect all +# the files in the diff (this is difficult during the commit-msg hook, +# since there's no cross-platform way to detect when a commit is being +# amended). + +# However, since this is a post-commit hook, it's too late to error +# out and abort the commit: it's already done! As a result, this hook +# is purely advisory, and instead we error out when trying to push +# (see "pre-push" in this directory). + +### Code: + +# Prefer gawk if available, as it handles NUL bytes properly. +if type gawk >/dev/null 2>&1; then + awk="gawk" +else + awk="awk" +fi + +git rev-parse HEAD | $awk -v reason=post-commit \ + -f .git/hooks/commit-msg-files.awk diff --git a/build-aux/git-hooks/pre-push b/build-aux/git-hooks/pre-push new file mode 100755 index 00000000000..adcf27d4a5d --- /dev/null +++ b/build-aux/git-hooks/pre-push @@ -0,0 +1,83 @@ +#!/bin/sh +# Check the file list of GNU Emacs change log entries before pushing. + +# Copyright 2023 Free Software Foundation, Inc. + +# This file is part of GNU Emacs. + +# GNU Emacs is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# GNU Emacs is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with GNU Emacs. If not, see . + +### Commentary: + +# This hook runs before pushing a series of commits and checks that +# the files mentioned in each commit message match the diffs. This +# helps ensure that the resulting change logs are correct, which +# should prevent errors when generating etc/AUTHORS. + +# These checks also happen in the "post-commit" hook (which see), but +# that hook can't abort a commit; it just advises the committer to fix +# the commit so that this hook runs without errors. + +### Code: + +# Prefer gawk if available, as it handles NUL bytes properly. +if type gawk >/dev/null 2>&1; then + awk="gawk" +else + awk="awk" +fi + +# Standard input receives lines of the form: +# 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}$/ { + 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. + 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) + break; + } + close(cmd) + + cmd = ("git rev-parse " newref "~" back) + cmd | getline oldref + if (!(oldref ~ /^[a-z0-9]{40}$/)) { + # The SHA is misformatted! Skip this line. + next + } + close(cmd) + } else if ($4 ~ /^[a-z0-9]{40}$/) { + oldref = $4 + } else { + # The SHA is misformatted! Skip this line. + next + } + + # Print every SHA after oldref, up to (and including) newref. + system("git rev-list --reverse " oldref ".." newref) + } +' | $awk -v reason=pre-push -f .git/hooks/commit-msg-files.awk commit c4e038c7be38b2e6cf2d2c7c39264f068f789c02 Author: Stefan Monnier Date: Thu Apr 20 15:51:44 2023 -0400 * lisp/emacs-lisp/gv.el: Silly typo diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index 6c3036da2f2..a5e29dd5e3b 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -641,7 +641,7 @@ gv-deref ;; You'd think noone would write `(setf (error ...) ..)' but it ;; appears naturally as the result of macroexpansion of things like -;; (setf (case-exhaustive ...)). +;; (setf (pcase-exhaustive ...)). ;; We could generalize this to `throw' and `signal', but it seems ;; preferable to wait until there's a concrete need. (gv-define-expander error (lambda (_do &rest args) `(error . ,args))) commit 3899acbb3367984d66c7484a208b40a6851f4cc2 Author: Eli Zaretskii Date: Thu Apr 20 13:06:24 2023 +0300 ; * src/fringe.c: Fix description of large circle. (Bug#62961) diff --git a/src/fringe.c b/src/fringe.c index 5fcb1b27272..ed257c073b9 100644 --- a/src/fringe.c +++ b/src/fringe.c @@ -211,14 +211,14 @@ /* Large circle bitmap. */ /* - ........ ..xxxx.. .xxxxxx. xxxxxxxx xxxxxxxx + xxxxxxxx + xxxxxxxx .xxxxxx. ..xxxx.. - ........ */ static unsigned short large_circle_bits[] = { 0x3c, 0x7e, 0xff, 0xff, 0xff, 0xff, 0x7e, 0x3c}; commit fd4c9246fc8daea4965b868e80e0f2d9d544dc22 Author: Ruijie Yu Date: Mon Mar 6 11:03:32 2023 +0800 Handle modifications in extensionless zip files (bug#61326) * lisp/arc-mode.el (archive-*-write-file-member) (archive-*-expunge): Refactor to correctly modify extensionless zip archives. (archive-expunge): Move implementation to a separate helper function to facilitate testing. (archive--act-files): New helper function to wrap around `call-process' calls. (archive--need-rename-p): New helper function to check whether a temporary rename is necessary. (archive--ensure-extension) (archive--maybe-rename): New helper functions to rename archive if the caller deems it necessary. (archive--with-ensure-extension): New helper function to handle writing an archive while ensuring extensionless archives work correctly by temporarily renaming them. * test/lisp/arc-mode-tests.el (arc-mode-test-zip-ensure-ext): New regression test for bug#61326. diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index 5e696c091b2..0a971799746 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@ -645,6 +645,49 @@ archive-get-descr (if (not noerror) (error "Line does not describe a member of the archive"))))) ;; ------------------------------------------------------------------------- +;;; Section: Helper functions for requiring filename extensions + +(defun archive--act-files (command files) + (lambda (archive) + (apply #'call-process (car command) + nil nil nil (append (cdr command) (cons archive files))))) + +(defun archive--need-rename-p (&optional archive) + (let ((archive + (file-name-nondirectory (or archive buffer-file-name)))) + (cl-case archive-subtype + ((zip) (not (seq-contains-p archive ?. #'eq)))))) + +(defun archive--ensure-extension (archive ensure-extension) + (if ensure-extension + (make-temp-name (expand-file-name (concat archive "_tmp."))) + archive)) + +(defun archive--maybe-rename (newname need-rename-p) + ;; Operating with archive as current buffer, and protect + ;; `default-directory' from being modified in `rename-visited-file'. + (when need-rename-p + (let ((default-directory default-directory)) + (rename-visited-file newname)))) + +(defun archive--with-ensure-extension (archive proc-fn) + (let ((saved default-directory)) + (with-current-buffer (find-buffer-visiting archive) + (let ((ensure-extension (archive--need-rename-p)) + (default-directory saved)) + (unwind-protect + ;; Some archive programs (like zip) expect filenames to + ;; have an extension, so if necessary, temporarily rename + ;; an extensionless file for write accesses. + (let ((archive (archive--ensure-extension + archive ensure-extension))) + (archive--maybe-rename archive ensure-extension) + (let ((exitcode (funcall proc-fn archive))) + (or (zerop exitcode) + (error "Updating was unsuccessful (%S)" exitcode)))) + (progn (archive--maybe-rename archive ensure-extension) + (revert-buffer nil t))))))) +;; ------------------------------------------------------------------------- ;;; Section: the mode definition ;;;###autoload @@ -1378,16 +1421,9 @@ archive-*-write-file-member (setq ename (encode-coding-string ename archive-file-name-coding-system)) (let* ((coding-system-for-write 'no-conversion) - (default-directory (file-name-as-directory archive-tmpdir)) - (exitcode (apply #'call-process - (car command) - nil - nil - nil - (append (cdr command) - (list archive ename))))) - (or (zerop exitcode) - (error "Updating was unsuccessful (%S)" exitcode)))) + (default-directory (file-name-as-directory archive-tmpdir))) + (archive--with-ensure-extension + archive (archive--act-files command (list ename))))) (archive-delete-local tmpfile)))) (defun archive-write-file (&optional file) @@ -1510,9 +1546,7 @@ archive-chgrp-entry (archive-resummarize)) (error "Setting group is not supported for this archive type")))) -(defun archive-expunge () - "Do the flagged deletions." - (interactive) +(defun archive--expunge-maybe-force (force) (let (files) (save-excursion (goto-char archive-file-list-start) @@ -1526,7 +1560,8 @@ archive-expunge (and files (or (not archive-read-only) (error "Archive is read-only")) - (or (yes-or-no-p (format "Really delete %d member%s? " + (or force + (yes-or-no-p (format "Really delete %d member%s? " (length files) (if (null (cdr files)) "" "s"))) (error "Operation aborted")) @@ -1540,13 +1575,14 @@ archive-expunge (archive-resummarize) (revert-buffer)))))) +(defun archive-expunge () + "Do the flagged deletions." + (interactive) + (archive--expunge-maybe-force nil)) + (defun archive-*-expunge (archive files command) - (apply #'call-process - (car command) - nil - nil - nil - (append (cdr command) (cons archive files)))) + (archive--with-ensure-extension + archive (archive--act-files command files))) (defun archive-rename-entry (newname) "Change the name associated with this entry in the archive file." diff --git a/test/lisp/arc-mode-tests.el b/test/lisp/arc-mode-tests.el index 32bce1b71bd..b6e06a563fe 100644 --- a/test/lisp/arc-mode-tests.el +++ b/test/lisp/arc-mode-tests.el @@ -46,6 +46,73 @@ arc-mode-test-zip-extract-gz (when (buffer-live-p zip-buffer) (kill-buffer zip-buffer)) (when (buffer-live-p gz-buffer) (kill-buffer gz-buffer))))) +(ert-deftest arc-mode-test-zip-ensure-ext () + "Regression test for bug#61326." + (skip-unless (executable-find "zip")) + (let* ((default-directory arc-mode-tests-data-directory) + (base-zip-1 "base-1.zip") + (base-zip-2 "base-2.zip") + (content-1 '("1" "2")) + (content-2 '("3" "4")) + (make-file (lambda (name) + (with-temp-buffer + (insert name) + (write-file name)))) + (make-zip + (lambda (zip files) + (delete-file zip nil) + (funcall (archive--act-files '("zip") files) zip))) + (update-fn + (lambda (zip-nonempty) + (with-current-buffer (find-file-noselect zip-nonempty) + (save-excursion + (goto-char archive-file-list-start) + (save-current-buffer + (archive-extract) + (save-excursion + (goto-char (point-max)) + (insert ?a) + (save-buffer)) + (kill-buffer (current-buffer))) + (archive-extract) + ;; [2] must be ?a; [3] must be (eobp) + (should (eq (char-after 2) ?a)) + (should (eq (point-max) 3)))))) + (delete-fn + (lambda (zip-nonempty) + (with-current-buffer (find-file-noselect zip-nonempty) + ;; mark delete and expunge first entry + (save-excursion + (goto-char archive-file-list-start) + (should (length= archive-files 2)) + (archive-flag-deleted 1) + (archive--expunge-maybe-force t) + (should (length= archive-files 1)))))) + (test-modify + (lambda (zip mod-fn) + (let ((zip-base (concat zip ".zip")) + (tag (gensym))) + (copy-file base-zip-1 zip t) + (copy-file base-zip-2 zip-base t) + (file-has-changed-p zip tag) + (file-has-changed-p zip-base tag) + (funcall mod-fn zip) + (should-not (file-has-changed-p zip-base tag)) + (should (file-has-changed-p zip tag)))))) + ;; setup: make two zip files with different contents + (mapc make-file (append content-1 content-2)) + (mapc (lambda (args) (apply make-zip args)) + (list (list base-zip-1 content-1) + (list base-zip-2 content-2))) + ;; test 1: with "test-update" and "test-update.zip", update + ;; "test-update": (1) ensure only "test-update" is modified, (2) + ;; ensure the contents of the new member is expected. + (funcall test-modify "test-update" update-fn) + ;; test 2: with "test-delete" and "test-delete.zip", delete entry + ;; from "test-delete": (1) ensure only "test-delete" is modified, + ;; (2) ensure the file list is reduced as expected. + (funcall test-modify "test-delete" delete-fn))) + (provide 'arc-mode-tests) ;;; arc-mode-tests.el ends here commit e0c8e4f12fb18695f309b1fd5ff26513ac5611e5 Author: Eli Zaretskii Date: Thu Apr 20 11:53:32 2023 +0300 ; Minor fixes for user-facing text in last vc-cvs.el changes * lisp/vc/vc-cvs.el (vc-cvs-repository-hostname) (vc-cvs-parse-root): Fix doc strings, text of messages, and use of "pathname". (Bug#62693) diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index b855591e655..145697d1b06 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el @@ -816,7 +816,7 @@ vc-cvs-stay-local-p (defun vc-cvs-repository-hostname (dirname) "Hostname of the CVS server associated to workarea DIRNAME. -Returns nil if there is no hostname or the hostname could not be +Return nil if there is no hostname, or the hostname could not be determined because the CVS/Root specification is invalid." (let ((rootname (expand-file-name "CVS/Root" dirname))) (when (file-readable-p rootname) @@ -836,31 +836,34 @@ vc-cvs-repository-hostname (cl-defun vc-cvs-parse-root (root) "Split CVS Root specification string into a list of fields. -A CVS Root specification of the form - [:METHOD:][[[USER][:PASSWORD]@]HOSTNAME][:[PORT]]/pathname/to/repository -is converted to a normalized record with the following structure: - \(METHOD USER HOSTNAME PATHNAME). +Convert a CVS Root specification of the form -The default METHOD for a CVS root of the form - /pathname/to/repository -is \"local\". -The default METHOD for a CVS root of the form - [USER@]HOSTNAME:/pathname/to/repository -is \"ext\". + [:METHOD:][[[USER][:PASSWORD]@]HOSTNAME][:[PORT]]/path/to/repository -If METHOD is explicitly \"local\" or \"fork\", then the pathname -starts immediately after the method block. This must be used on -Windows platforms when pathnames start with a drive letter. +to a normalized record with the following structure: + + \(METHOD USER HOSTNAME FILENAME). + +The default METHOD for a CVS root of the form /path/to/repository +is \"local\". The default METHOD for a CVS root of the +form [USER@]HOSTNAME:/path/to/repository is \"ext\". + +If METHOD is explicitly \"local\" or \"fork\", then the repository's +file name starts immediately after the [:METHOD:] part. This must be +used on MS-Windows platforms where absolute file names start with a +drive letter. Note that, except for METHOD, which is defaulted if not present, -other optional fields are returned as nil if not syntactically -present, or as the empty string if delimited but empty. - -Returns nil in case of an unparsable CVS root (including the -empty string) and issues a warning. This function doesn't check -that an explicit method is valid, or that some fields are empty -or nil but should not be for a given method." - (let (method user password hostname port pathname +other optional parts will default to nil if not syntactically +present, or to an empty string if present and delimited, but empty. + +Return nil in case of an unparsable CVS Root (including the +empty string), and issue a warning in that case. + +This function doesn't check that an explicit method is valid, or +that some fields which should not be empty for a given method, +are empty or nil." + (let (method user password hostname port filename ;; IDX set by `next-delim' as a side-effect idx) (cl-labels @@ -869,21 +872,21 @@ vc-cvs-parse-root (concat "vc-cvs-parse-root: Can't parse '%s': " reason) root args) (cl-return-from vc-cvs-parse-root)) - (no-pathname () - (invalid "No pathname")) + (no-filename () + (invalid "No repository file name")) (next-delim (start) ;; Search for a :, @ or /. If none is found, there can be - ;; no path at the end, which is an error. + ;; no file name at the end, which is an error. (setq idx (string-match-p "[:@/]" root start)) - (if idx (aref root idx) (no-pathname))) + (if idx (aref root idx) (no-filename))) (grab-user (start end) (setq user (substring root start end))) (at-hostname-block (start) (let ((cand (next-delim start))) (cl-ecase cand (?: - ;; Could be : before PORT and PATHNAME, or before - ;; PASSWORD. We search for a @ to disambiguate. + ;; Could be : before PORT and /path/to/repository, or + ;; before PASSWORD. We search for a @ to disambiguate. (let ((colon-idx idx) (cand (next-delim (1+ idx)))) (cl-ecase cand @@ -907,7 +910,7 @@ vc-cvs-parse-root (?/ (if (/= idx start) (grab-hostname start idx)) - (at-pathname idx))))) + (at-filename idx))))) (delimited-password (start end) (setq password (substring root start end)) (at-hostname (1+ end))) @@ -923,17 +926,17 @@ vc-cvs-parse-root (invalid "Hostname: Unexpected @ after index %s" start)) (?/ (grab-hostname start idx) - (at-pathname idx))))) + (at-filename idx))))) (delimited-port (start end) (setq port (substring root start end)) - (at-pathname end)) + (at-filename end)) (at-port (start) (let ((end (string-match-p "/" root start))) - (if end (delimited-port start end) (no-pathname)))) - (at-pathname (start) - (setq pathname (substring root start)))) + (if end (delimited-port start end) (no-filename)))) + (at-filename (start) + (setq filename (substring root start)))) (when (string= root "") - (invalid "Empty string")) + (invalid "Empty Root string")) ;; Check for a starting ":" (if (= (aref root 0) ?:) ;; 3 possible cases: @@ -948,7 +951,7 @@ vc-cvs-parse-root (setq method (substring root 1 idx)) ;; Continue (if (member method '("local" "fork")) - (at-pathname (1+ idx)) + (at-filename (1+ idx)) (at-hostname-block (1+ idx)))) (?@ ;; :PASSWORD@HOSTNAME case @@ -962,7 +965,7 @@ vc-cvs-parse-root ;; Default the method if not specified (setq method (if (or user password hostname port) "ext" "local"))) - (list method user hostname pathname))) + (list method user hostname filename))) ;; XXX: This does not work correctly for subdirectories. "cvs status" ;; information is context sensitive, it contains lines like: commit 2b10e1827d3b200b3b7ff4da53082f428022fe0c Author: Nicolas Martyanoff Date: Sun Apr 16 15:30:47 2023 +0200 sql: add missing postgresql types * lisp/progmodes/sql.el: Add multiple missing PostgreSQL types: bigserial, smallserial, macaddr8, jsonb, jsonpath, built-in range types, object identifier types (oid & co). diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index d8bd6bc2685..c6667c075f6 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -2192,14 +2192,17 @@ sql-mode-postgres-font-lock-keywords ;; Postgres Data Types (sql-font-lock-keywords-builder 'font-lock-type-face nil -"bigint" "bigserial" "bit" "bool" "boolean" "box" "bytea" "char" -"character" "cidr" "circle" "date" "decimal" "double" "float4" -"float8" "inet" "int" "int2" "int4" "int8" "integer" "interval" "line" -"lseg" "macaddr" "money" "name" "numeric" "path" "point" "polygon" -"precision" "real" "serial" "serial4" "serial8" "sequences" "smallint" "text" -"time" "timestamp" "timestamptz" "timetz" "tsquery" "tsvector" -"txid_snapshot" "unknown" "uuid" "varbit" "varchar" "varying" "without" -"xml" "zone" + "bigint" "bigserial" "bit" "bool" "boolean" "box" "bytea" "char" "character" +"cidr" "circle" "date" "daterange" "decimal" "double" "float4" "float8" "inet" +"int" "int2" "int4" "int4range" "int8" "int8range" "integer" "interval" +"jsonb" "jsonpath" "line" "lseg" "macaddr" "macaddr8" "money" "name" "numeric" +"numrange" "oid" "path" "point" "polygon" "precision" "real" "regclass" +"regcollation" "regconfig" "regdictionary" "regnamespace " "regoper" +"regoperator" "regproc" "regprocedure" "regrole" "regtype" "sequences" +"serial" "serial4" "serial8" "smallint" "smallserial" "text" "time" +"timestamp" "timestamptz" "timetz" "tsquery" "tsrange" "tstzrange" "tsvector" +"txid_snapshot" "unknown" "uuid" "varbit" "varchar" "varying" "without" "xml" +"zone" ))) "Postgres SQL keywords used by font-lock. commit cc0f9389b8ebedad6401464ee3a259dba3c7abaf Author: Yuan Fu Date: Wed Apr 19 16:23:25 2023 -0700 Fix treesit-install-language-grammar for non-interactive call A continuation of bug#62704. * lisp/treesit.el (treesit-install-language-grammar): Differentiate between interactive and non-interactive call, and don't prompt when it's called non-interactively. diff --git a/lisp/treesit.el b/lisp/treesit.el index ed7ad280684..b7af64ee8b5 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -2994,37 +2994,48 @@ treesit--install-language-grammar-out-dir-history "History for OUT-DIR for `treesit-install-language-grammar'.") ;;;###autoload -(defun treesit-install-language-grammar (lang) +(defun treesit-install-language-grammar (lang &optional out-dir) "Build and install the tree-sitter language grammar library for LANG. 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 recipe for LANG exists in `treesit-language-source-alist'. See `exec-path' for the current path where Emacs looks for -executable programs, such as the C/C++ compiler and linker." +executable programs, such as the C/C++ compiler and linker. + +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'." (interactive (list (intern (completing-read "Language: " - (mapcar #'car treesit-language-source-alist))))) + (mapcar #'car treesit-language-source-alist))) + 'interactive)) (when-let ((recipe (or (assoc lang treesit-language-source-alist) - (treesit--install-language-grammar-build-recipe - lang))) + (if (eq out-dir 'interactive) + (treesit--install-language-grammar-build-recipe + lang) + (signal 'treesit-error `("Cannot find recipe for this language" ,lang))))) (default-out-dir (or (car treesit--install-language-grammar-out-dir-history) (locate-user-emacs-file "tree-sitter"))) (out-dir - (read-string - (format "Install to (default: %s): " - default-out-dir) - nil - 'treesit--install-language-grammar-out-dir-history - default-out-dir))) + (if (eq out-dir 'interactive) + (read-string + (format "Install to (default: %s): " + default-out-dir) + nil + 'treesit--install-language-grammar-out-dir-history + default-out-dir) + out-dir))) (condition-case err (apply #'treesit--install-language-grammar-1 (cons out-dir recipe)) commit 9ac12592781934bcd934bc0cae71a637311119ec Author: Eli Zaretskii Date: Wed Apr 19 20:46:40 2023 +0300 Fix display of menu-bar bindings of commands in *Help* buffers * lisp/help-fns.el (help-fns--insert-menu-bindings): Propertize with 'help-key-binding' face only the menu items, not the arrows between successive items. This is because 'char-displayable-p' is unreliable when we propertize the character with an arbitrary face: that face could specify a font which doesn't support the character after all, while 'char-displayable-p' assumes there are no restrictions on fonts that can be used for displaying the character. Also, make the code more efficient by avoiding the call to 'char-displayable-p' inside the loop. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index a1fc2267564..be13d40cfa3 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -592,22 +592,22 @@ help-fns--insert-menu-bindings ;; First collect all the printed representations of menus. (dolist (menu menus) (let ((map (lookup-key global-map (seq-take menu 1))) - (string nil)) + (string nil) + (sep (if (char-displayable-p ?→) " → " " => "))) (seq-do-indexed (lambda (entry level) (when (symbolp map) (setq map (symbol-function map))) (when-let ((elem (assq entry (cdr map)))) (when (> level 0) - (push (if (char-displayable-p ?→) - " → " - " => ") - string)) + (push sep string)) (if (eq (nth 1 elem) 'menu-item) (progn - (push (nth 2 elem) string) + (push (propertize (nth 2 elem) 'face 'help-key-binding) + string) (setq map (cadddr elem))) - (push (nth 1 elem) string) + (push (propertize (nth 1 elem) 'face 'help-key-binding) + string) (setq map (cddr elem))))) (cdr (seq-into menu 'list))) (when string @@ -622,8 +622,7 @@ help-fns--insert-menu-bindings (cond ((zerop i) "") ((= i (1- (length menus))) " and ") (t ", ")) - (propertize (string-join (nreverse string)) - 'face 'help-key-binding))) + (string-join (nreverse string)))) strings)))) (defun help-fns--compiler-macro (function) commit a01528c950024faa5ae732c5e2a43f89718175fd Author: Eli Zaretskii Date: Wed Apr 19 19:30:55 2023 +0300 ; * src/fns.c (assq_no_signal): Fix a typo in a comment. diff --git a/src/fns.c b/src/fns.c index 75acb6f4598..02388fa60ed 100644 --- a/src/fns.c +++ b/src/fns.c @@ -1967,7 +1967,7 @@ assq_no_quit (Lisp_Object key, Lisp_Object alist) } /* Assq but doesn't signal. Unlike assq_no_quit, this function still - detect circular lists; like assq_no_quit, this function does not + detects circular lists; like assq_no_quit, this function does not allow quits and never signals. If anything goes wrong, it returns Qnil. */ Lisp_Object commit ecdd3a9efac3e56850ce10260747c158865f9378 Author: Spencer Baugh Date: Tue Apr 18 18:03:36 2023 -0400 Improve Completion Example section in the Emacs manual This can be a useful substitute for full-on fuzzy completion, as provided by other completion styles and completion packages. * doc/emacs/mini.texi (Completion Example): Give an example of completion with point not at end of minibuffer. Also, use @kbd{@key{TAB}} when telling the user to hit TAB. (Bug#62836) diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi index 6fb312ec321..c2e13adb08f 100644 --- a/doc/emacs/mini.texi +++ b/doc/emacs/mini.texi @@ -313,19 +313,27 @@ Completion Example called @code{authorize-me} was defined, Emacs could only complete as far as @samp{aut}.) - If you type @key{TAB} again immediately, it cannot determine the -next character; it could be @samp{-}, @samp{a}, or @samp{c}. So it -does not add any characters; instead, @key{TAB} displays a list of all -possible completions in another window. + If you type @kbd{@key{TAB}} again immediately, it cannot determine +the next character; it could be @samp{-}, @samp{a}, or @samp{c}. So +it does not add any characters; instead, @key{TAB} displays a list of +all possible completions in another window. Next, type @kbd{-f}. The minibuffer now contains @samp{auto-f}, and the only command name that starts with this is @code{auto-fill-mode}. -If you now type @key{TAB}, completion fills in the rest of the +If you now type @kbd{@key{TAB}}, completion fills in the rest of the argument @samp{auto-fill-mode} into the minibuffer. Hence, typing just @kbd{a u @key{TAB} - f @key{TAB}} allows you to enter @samp{auto-fill-mode}. + @key{TAB} also works while point is not at the end of the +minibuffer. In that case, it will fill in text both at point and at +the end of the minibuffer. If you type @kbd{M-x autocm}, then press +@kbd{C-b} to move point before the @samp{m}, you can type +@kbd{@key{TAB}} to insert the text @samp{onf-} at point and @samp{ode} +at the end of the minibuffer, so that the minibuffer contains +@samp{autoconf-mode}. + @node Completion Commands @subsection Completion Commands commit 626e1ac62b213261d80007524e400ac6a0768dae Author: Robert Pluim Date: Wed Apr 19 12:33:18 2023 +0200 Improve 'message-server-alist' docstring * lisp/gnus/message.el (message-server-alist): Fix typo and clarify what happens if there is already an X-Message-SMTP-Method header. diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index f4cfffa2e8a..7a71ac9f58e 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -4359,8 +4359,10 @@ message-server-alist a non-nil value when called in the message buffer without any arguments. If METHOD is nil in this case, the return value of the function will be inserted instead. -If the buffer already has a\"X-Message-SMTP-Method\" header, -it is left unchanged." + +Note: if the buffer already has a \"X-Message-SMTP-Method\" +header, these rules are ignored, and the header is left +unchanged." :type '(alist :key-type (choice (string :tag "From Address") (function :tag "Predicate")) commit 327986936c3476bcfe930314e5d825c2ada55f49 Author: Robert Pluim Date: Wed Apr 19 12:29:57 2023 +0200 Add index entry for fallback modes * doc/emacs/custom.texi (Specifying File Variables): Add index for 'fallback modes'. diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index ee818a74b57..87290734cc9 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -1245,6 +1245,7 @@ Specifying File Variables These four keywords are not really variables; setting them in any other context has no special meaning. +@cindex fallback modes If you're editing a file across Emacs versions, and a new mode has been introduced to handle a file in a newer Emacs version, you can use several @code{mode} entries to use the new mode (called commit c279d65199df4749f649c29aca210419ab85af1a Author: Robert Pluim Date: Wed Apr 19 09:48:02 2023 +0200 ; Double space at end of sentence for vc-cvs.el * lisp/vc/vc-cvs.el (vc-cvs-repository-hostname, vc-cvs-parse-root) (vc-cvs-parse-status, vc-cvs-after-dir-status): Double space at end of sentence. * test/lisp/vc/vc-cvs-tests.el: Double space at end of sentence. diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index c6056c1e5bd..b855591e655 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el @@ -816,7 +816,7 @@ vc-cvs-stay-local-p (defun vc-cvs-repository-hostname (dirname) "Hostname of the CVS server associated to workarea DIRNAME. -Returns nil if there is not hostname or the hostname could not be +Returns nil if there is no hostname or the hostname could not be determined because the CVS/Root specification is invalid." (let ((rootname (expand-file-name "CVS/Root" dirname))) (when (file-readable-p rootname) @@ -849,7 +849,7 @@ vc-cvs-parse-root is \"ext\". If METHOD is explicitly \"local\" or \"fork\", then the pathname -starts immediately after the method block. This must be used on +starts immediately after the method block. This must be used on Windows platforms when pathnames start with a drive letter. Note that, except for METHOD, which is defaulted if not present, @@ -857,9 +857,9 @@ vc-cvs-parse-root present, or as the empty string if delimited but empty. Returns nil in case of an unparsable CVS root (including the -empty string) and issues a warning. This function doesn't check +empty string) and issues a warning. This function doesn't check that an explicit method is valid, or that some fields are empty -or nil but should not for a given method." +or nil but should not be for a given method." (let (method user password hostname port pathname ;; IDX set by `next-delim' as a side-effect idx) @@ -872,7 +872,7 @@ vc-cvs-parse-root (no-pathname () (invalid "No pathname")) (next-delim (start) - ;; Search for a :, @ or /. If none is found, there can be + ;; Search for a :, @ or /. If none is found, there can be ;; no path at the end, which is an error. (setq idx (string-match-p "[:@/]" root start)) (if idx (aref root idx) (no-pathname))) @@ -883,7 +883,7 @@ vc-cvs-parse-root (cl-ecase cand (?: ;; Could be : before PORT and PATHNAME, or before - ;; PASSWORD. We search for a @ to disambiguate. + ;; PASSWORD. We search for a @ to disambiguate. (let ((colon-idx idx) (cand (next-delim (1+ idx)))) (cl-ecase cand @@ -937,9 +937,9 @@ vc-cvs-parse-root ;; Check for a starting ":" (if (= (aref root 0) ?:) ;; 3 possible cases: - ;; - :METHOD: at start. METHOD doesn't have any @. - ;; - :PASSWORD@ at start. Must be followed by HOSTNAME. - ;; - :[PORT] at start. Must be followed immediately by a "/". + ;; - :METHOD: at start. METHOD doesn't have any @. + ;; - :PASSWORD@ at start. Must be followed by HOSTNAME. + ;; - :[PORT] at start. Must be followed immediately by a "/". ;; So, find the next character equal to ":", "@" or "/". (let ((cand (next-delim 1))) (cl-ecase cand @@ -973,7 +973,7 @@ vc-cvs-parse-root (defun vc-cvs-parse-status (&optional full) "Parse output of \"cvs status\" command in the current buffer. Set file properties accordingly. Unless FULL is t, parse only -essential information. Note that this can never set the `ignored' +essential information. Note that this can never set the `ignored' state." (let (file status missing) (goto-char (point-min)) @@ -1034,7 +1034,7 @@ vc-cvs-after-dir-status ;; cvs update: warning: FILENAME was lost ;; U FILENAME ;; with FILENAME in the first line possibly enclosed in - ;; quotes (since CVS 1.12.3). To avoid problems, use the U + ;; quotes (since CVS 1.12.3). To avoid problems, use the U ;; line where name is never quoted. (forward-line 1) (when (looking-at "^U \\(.*\\)$") diff --git a/test/lisp/vc/vc-cvs-tests.el b/test/lisp/vc/vc-cvs-tests.el index 99ac9c8eb96..473ac69e24c 100644 --- a/test/lisp/vc/vc-cvs-tests.el +++ b/test/lisp/vc/vc-cvs-tests.el @@ -76,7 +76,7 @@ vc-cvs-test-parse-root--pserver-user-password-host-port ":pserver:usr:passwd@host:28/home/serv/repo" '("pserver" "usr" "host" "/home/serv/repo"))) -;; Next 3 tests are just to err on the side of caution. It doesn't +;; Next 3 tests are just to err on the side of caution. It doesn't ;; seem that CVS 1.12 can ever produce such lines. (ert-deftest commit 1c4783c3300e32e1405ceb75b5e25700b5025a0f Author: Robert Pluim Date: Tue Apr 18 16:10:10 2023 +0200 ; * etc/NEWS: Copyedits and grammar fixes. diff --git a/etc/NEWS b/etc/NEWS index 1822ff17265..62d2fdcd3a4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -218,13 +218,13 @@ of 'user-emacs-directory'. +++ ** The image commands have changed key bindings. -In previous Emacs versions, images have had the '+', '-' and 'r' keys -bound when point is over an image. In Emacs 29.1, additional commands -were added, and this made it more likely that users would trigger the -image commands by mistake. To avoid this, all image commands have +In previous Emacs versions, the '+', '-' and 'r' keys were bound when +point was over an image. In Emacs 29.1, additional commands have been +added, and this made it more likely that users would trigger the image +commands by mistake. To avoid this, all image commands have been moved to the 'i' prefix keymap, so '+' is now 'i +', '-' is now 'i -', and 'r' is now 'i r'. In addition, these commands are now repeating, -so, for example, you can rotate an image twice by typing 'i r r'. +so you can rotate an image twice by saying 'i r r', for instance. +++ ** Emacs now picks the correct coding-system for X input methods. @@ -380,7 +380,7 @@ this user option to nil to revert back to the old behavior. --- ** Support for old EIEIO functions is not autoloaded any more. You need an explicit '(require 'eieio-compat)' to use 'defmethod' -and 'defgeneric' (which have been made obsolete in Emacs 25.1 with +and 'defgeneric' (which were made obsolete in Emacs 25.1 by 'cl-defmethod' and 'cl-defgeneric'). Similarly you might need to '(require 'eieio-compat)' before loading files that were compiled with an old EIEIO (Emacs<25). @@ -497,7 +497,7 @@ the 'nlinum' package from GNU ELPA instead. The former has better performance, but the latter is closer to a drop-in replacement. 1. To use 'display-line-numbers-mode', add something like this to your - Init file: + init file: (global-display-line-numbers-mode 1) ;; Alternatively, to use it only in programming modes: @@ -517,7 +517,7 @@ performance, but the latter is closer to a drop-in replacement. --- ** The thumbs.el library is now obsolete. -We recommend using command 'image-dired' instead. +We recommend using the 'image-dired' command instead. --- ** The autoarg.el library is now marked obsolete. @@ -577,7 +577,7 @@ encoding, only for decoding. ** New user option 'major-mode-remap-alist' to specify favorite major modes. This user option lets you remap the default modes (e.g. 'perl-mode' or 'latex-mode') to your favorite ones (e.g. 'cperl-mode' or -'LaTeX-mode') without having to use 'defalias', which can have +'LaTeX-mode') instead of having to use 'defalias', which can have undesirable side effects. This applies to all modes specified via 'auto-mode-alist', file-local variables, etc. @@ -587,6 +587,8 @@ variables, etc. --- ** New user option 'electric-quote-replace-consecutive'. +This allows you to disable the default behavior of consecutive single +quotes being replaced with a double quote. --- ** Emacs is now capable of editing files with very long lines. @@ -801,7 +803,7 @@ element: 'set-minibuffer-message', which displays echo-area messages at the end of the minibuffer text when the minibuffer is active. Other useful functions include 'inhibit-message', which allows specifying, via 'inhibit-message-regexps', the list of messages whose -display shall be inhibited; and 'set-multi-message' that accumulates +display should be inhibited; and 'set-multi-message' that accumulates recent messages and displays them stacked together. --- @@ -902,7 +904,7 @@ frame's contents will be hidden, leaving only the title bar on display. --- ** New user option 'x-gtk-use-native-input'. This controls whether or not GTK input methods are used by Emacs, -instead of XIM input methods. +instead of XIM input methods. Defaults to nil. +++ ** New user option 'use-system-tooltips'. @@ -999,17 +1001,17 @@ combinations in a graphical menu system. +++ *** New command 'emoji-search' (bound to 'C-x 8 e s'). -This command lets you search for Emoji based on names. +This command lets you search for and insert an Emoji based on names. +++ *** New command 'emoji-list' (bound to 'C-x 8 e l'). This command lists all Emoji (categorized by themes) in a special -buffer and lets you choose one of them. +buffer and lets you choose one of them to insert. --- *** New command 'emoji-recent' (bound to 'C-x 8 e r'). This command lets you choose among the Emoji you have recently -inserted. +inserted and insert it. +++ *** New command 'emoji-describe' (bound to 'C-x 8 e d'). @@ -1043,7 +1045,7 @@ quotes removed. --- *** 'M-x apropos-variable' output now includes values of variables. -Such apropos buffer is more easily viewed with outlining after +Such an apropos buffer is more easily viewed with outlining after enabling 'outline-minor-mode' in 'apropos-mode'. +++ @@ -1075,7 +1077,7 @@ This has been changed to: +++ *** The 'C-h .' command now accepts a prefix argument. 'C-u C-h .' would previously inhibit displaying a warning message if -there's no local help at point. This has been changed to call +there was no local help at point. This has been changed to call 'button-describe'/'widget-describe' and display button/widget help instead. @@ -1128,7 +1130,7 @@ helpful commands for various tasks. You can toggle the display using 'C-h C-q'. ** Emacs now comes with Org v9.6. -See the file "ORG-NEWS" for user-visible changes in Org. +See the file "etc/ORG-NEWS" for user-visible changes in Org. ** Outline Mode @@ -1191,12 +1193,13 @@ the display of several buffers in a row more amenable. +++ *** New buffer display action alist entry 'lru-frames'. -This allows to specify which frames 'display-buffer' should consider -when using a window that shows another buffer. +This allows specifying which frames 'display-buffer' should consider +when using a window that shows another buffer. It is interpreted as +per the ALL-FRAMES argument of 'get-lru-window'. +++ *** New buffer display action alist entry 'lru-time'. -'display-buffer' will ignore windows with a use time higher than that +'display-buffer' will ignore windows with a use time higher than this when using a window that shows another buffer. +++ @@ -1206,12 +1209,14 @@ making it a less likely candidate for displaying another buffer. +++ *** New buffer display action alist entry 'window-min-width'. -This allows to specify a minimum width of the window used to display a -buffer. +This allows specifying a preferred minimum width of the window used to +display a buffer. --- -*** You can customize on which window 'scroll-other-window' operates. -This is controlled by the new 'other-window-scroll-default' variable. +*** You can specify on which window 'scroll-other-window' operates. +This is controlled by the new 'other-window-scroll-default' variable, +which should be set to a function that returns a window. When this +variable is nil, 'next-window' is used. ** Frames @@ -1274,17 +1279,19 @@ 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 -are met. The conditions are given by the argument, which can be -'empty', 'delete-frame' or 'kill-terminal'. +are met. The conditions are determined by the argument to +'server-stop-automatically', which can be 'empty', 'delete-frame' or +'kill-terminal'. ** Rcirc +++ *** New command 'rcirc-when'. +This shows the reception time of the message at point (if available). +++ *** New user option 'rcirc-cycle-completion-flag'. -Rcirc will use the default 'completion-at-point' mechanism. The +Rcirc now uses the default 'completion-at-point' mechanism. The conventional IRC behavior of completing by cycling through the available options can be restored by enabling this option. @@ -1869,7 +1876,7 @@ packages checked out using 'package-vc-install'. +++ *** New command 'package-report-bug'. This command helps you compose an email for sending bug reports to -package maintainers. +package maintainers, and is bound to 'b' in the "*Packages*" buffer. +++ *** New user option 'package-vc-selected-packages'. @@ -1946,8 +1953,8 @@ displayed in a window. +++ *** New user option 'compilation-hidden-output'. -This can be used to make specific parts of compilation output -invisible. +This regular expression can be used to make specific parts of +compilation output invisible. +++ *** The 'compilation-auto-jump-to-first-error' user option has been extended. @@ -2330,7 +2337,7 @@ EUDC inline expansion result formatting defaulted to ("%s %s <%s>" firstname name email) Since email address specifications need to comply with RFC 5322 in -order to be useful in messages, there was a risk to produce syntax +order to be useful in messages, there was a risk of producing syntax which was standard with RFC 822, but is marked as obsolete syntax by its successor RFC 5322. Also, the first and last name part was never enclosed in double quotes, potentially producing invalid address @@ -2364,8 +2371,8 @@ used to select the entry type in the ecomplete database. +++ *** New back-end for mailabbrev. A new back-end for mailabbrev allows information from that database to -be queried by EUDC, too. The attributes 'email', 'name', and 'firstname' -are supported only. +be queried by EUDC, too. Only the attributes 'email', 'name', and +'firstname' are supported. ** EWW/SHR @@ -2612,14 +2619,14 @@ as opposed to via the command-line. +++ *** New command 'image-transform-fit-to-window'. This command fits the image to the current window by scaling down or -up as necessary. Unlike 'image-transform-fit-both', this does not -only scale the image down, but up as well. It is bound to 's w' in -Image Mode by default. +up as necessary. Unlike 'image-transform-fit-both', this can scale +the image up as well as down. It is bound to 's w' in Image Mode by +default. --- *** New command 'image-mode-wallpaper-set'. This command sets the desktop background to the current image. It is -bound to 'W' by default. +bound to 'W' in Image Mode by default. +++ *** 'image-transform-fit-to-{height,width}' are now obsolete. @@ -2637,14 +2644,14 @@ much (in percent). It is nil by default, which means no limit. --- *** New user option 'image-text-based-formats'. -This controls whether or not to show a message when opening certain -image formats saying how to edit it as text. The default is to show -this message for SVG and XPM. +This controls whether or not to show a message, when opening certain +image formats, explaining how to edit it as text. The default is to +show this message for SVG and XPM. +++ *** New command 'image-transform-set-percent'. -It allows setting the image size to a percentage of its original size, -and is bound to 's p' in Image mode. +It allows resizing the image to a percentage of its original size, and +is bound to 's p' in Image mode. +++ *** 'image-transform-original' renamed to 'image-transform-reset-to-original'. @@ -3936,9 +3943,9 @@ connection-local profile. +++ *** New macro 'with-connection-local-application-variables'. This macro works like 'with-connection-local-variables', but it allows -to use another application but 'tramp'. This is useful when running -code in a buffer where Tramp has already set some connection-local -variables. +using another application instead of 'tramp'. This is useful when +running code in a buffer where Tramp has already set some +connection-local variables. +++ *** New macro 'setq-connection-local'. @@ -4017,8 +4024,8 @@ This returns a list of sub-sequences of the specified sequence. +++ *** New function 'seq-remove-at-position'. -This function returns a copy of the specified sequence where the -element at a given (zero-based) index got removed. +This function returns a copy of the specified sequence with the +element at a given (zero-based) index removed. +++ *** New function 'seq-positions'. @@ -4086,7 +4093,7 @@ that quote character has to be escaped to avoid Emacs displaying it as (setq foo '(1 2 3)) -invalid. Emacs will now warn during byte compilation if it seems +invalid. Emacs will now warn during byte compilation if it sees something like that, and also warn about when using RIGHT/LEFT SINGLE QUOTATION MARK directly. In both these cases, if these characters should really be present in the docstring, they should be quoted with @@ -4146,7 +4153,7 @@ example for benchmarking purposes. ** New function 'string-edit'. This is meant to be used when the user has to edit a (potentially) long string. It pops up a new buffer where you can edit the string, -and a callback is called when the user types 'C-c C-c'. +and the provided callback is called when the user types 'C-c C-c'. +++ ** New function 'read-string-from-buffer'. @@ -4292,7 +4299,7 @@ them towards or away from each other. +++ ** New hook 'x-pre-popup-menu-hook'. -This hook, run before 'x-popup-menu', is about to display a +This hook is run before 'x-popup-menu' is about to display a deck-of-cards menu on screen. --- @@ -4393,8 +4400,8 @@ switch to these new functions. +++ *** 'define-key' now takes an optional REMOVE argument. If non-nil, remove the definition from the keymap. This is subtly -different from setting a definition to nil (when the keymap has a -parent). +different from setting a definition to nil: when the keymap has a +parent such a definition will shadow the parent's definition. +++ *** 'read-multiple-choice' now takes an optional SHOW-HELP argument. commit 3d6f7553319b38bbc9a93d66cf7879926a695da1 Author: Dmitry Gutov Date: Wed Apr 19 01:29:20 2023 +0300 xref-search-program-alist: Fix searching larger file lists on MS Windows * lisp/progmodes/xref.el (xref-search-program-alist): Add '-s 10000' to xargs' options when on Windows or DOS. Apparently the xargs port doesn't currently know how to obey the system-wide limits (https://debbugs.gnu.org/bug=61667#521). diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 1ae60796601..0666b18cba1 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1820,16 +1820,22 @@ xref-matches-in-directory ;; Ripgrep gets jumbled output, though, even with --line-buffered. ;; But Grep seems to be stable. Even without --line-buffered. (defcustom xref-search-program-alist - '((grep - . - ;; '-s' because 'git ls-files' can output broken symlinks. - "xargs -0 grep --null -snHE -e ") - (ripgrep - . - ;; '!*/' is there to filter out dirs (e.g. submodules). - "xargs -0 rg --null -nH --no-heading --no-messages -g '!*/' -e " - ) - (ugrep . "xargs -0 ugrep --null -ns -e ")) + (let ((xargs-max-chars + (and (memq system-type '(windows-nt ms-dos)) + "-s 10000 "))) + `((grep + . + ;; '-s' because 'git ls-files' can output broken symlinks. + ,(concat "xargs -0 " xargs-max-chars "grep --null -snHE -e ")) + (ripgrep + . + ;; '!*/' is there to filter out dirs (e.g. submodules). + ,(concat "xargs -0 " + xargs-max-chars + "rg --null -nH --no-heading --no-messages -g '!*/' -e ")) + (ugrep + . + ,(concat "xargs -0 " xargs-max-chars "ugrep --null -ns -e ")))) "Association list mapping program identifiers to command templates. Program identifier should be a symbol, named after the search program. @@ -1844,7 +1850,7 @@ xref-search-program-alist :type '(repeat (cons (symbol :tag "Program identifier") (string :tag "Command template"))) - :version "28.1" + :version "29.1" :package-version '(xref . "1.0.4")) (defcustom xref-search-program 'grep commit 1b8b2cf61bdc29db098e8c7dd61fd5a7971c3a1e Author: Shynur Date: Mon Apr 17 02:13:32 2023 +0800 Fix typo and inaccuracy in the ELisp Reference manual * doc/lispref/loading.texi (Dynamic Modules): Fix a typo. * doc/lispref/customize.texi (Group Definitions): Faces are also in the 'custom-group' property of a customization group. (Bug#62887) Copyright-paperwork-exempt: yes diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi index 6015c134d21..6d5d9e0a2bc 100644 --- a/doc/lispref/customize.texi +++ b/doc/lispref/customize.texi @@ -264,11 +264,12 @@ Group Definitions @end table @cindex @code{custom-group} property -The variables and subgroups of a group are stored in the +The variables, faces, and subgroups of a group are stored in the @code{custom-group} property of the group's symbol. @xref{Symbol Plists}. The value of that property is a list of pairs whose -@code{car} is the variable or subgroup symbol and the @code{cdr} is -either @code{custom-variable} or @code{custom-group}. +@code{car} is the symbol of the variable or the face or the subgroup, +and the @code{cdr} is one of the corresponding symbols +@code{custom-variable}, @code{custom-face}, or @code{custom-group}. @end defmac @defopt custom-unlispify-remove-prefixes diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi index 5c84ba4b1eb..d6fc4e8d636 100644 --- a/doc/lispref/loading.texi +++ b/doc/lispref/loading.texi @@ -1338,7 +1338,7 @@ Dynamic Modules module. This is the primitive which makes sure the module exports the @code{plugin_is_GPL_compatible} symbol, calls the module's @code{emacs_module_init} function, and signals an error if that -function returns an error indication, or if the use typed @kbd{C-g} +function returns an error indication, or if the user typed @kbd{C-g} during the initialization. If the initialization succeeds, @code{module-load} returns @code{t}. Note that @var{file} must already have the proper file-name extension, as this function doesn't commit df17682ebf15be96aaa8e383df99ffd2eac7e63d Author: Eli Zaretskii Date: Tue Apr 18 14:49:18 2023 +0300 ; Support 'dart-ts-mode' in Eglot * lisp/progmodes/eglot.el (eglot-server-programs): Add 'dart-ts-mode'. Patch by Mou Tong . (Bug#62879) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 9b499b944cd..ed554087084 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -218,8 +218,9 @@ eglot-server-programs ((R-mode ess-r-mode) . ("R" "--slave" "-e" "languageserver::run()")) ((java-mode java-ts-mode) . ("jdtls")) - (dart-mode . ("dart" "language-server" - "--client-id" "emacs.eglot-dart")) + ((dart-mode dart-ts-mode) + . ("dart" "language-server" + "--client-id" "emacs.eglot-dart")) (elixir-mode . ("language_server.sh")) (ada-mode . ("ada_language_server")) (scala-mode . ,(eglot-alternatives commit e0dc60e07803f9859ad0008bae4b22d6452547b2 Author: Eli Zaretskii Date: Tue Apr 18 14:36:28 2023 +0300 ; Fix typos in gdb-mi.el * lisp/progmodes/gdb-mi.el (gdbmi-bnf-result-state-configs): Fix typos introduced while fixing bug#10580. (Bug#62858) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 8db16729163..27f04e07e80 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -2406,7 +2406,7 @@ gdbmi-bnf-result-state-configs ("+" . ()) ("=" . (("thread-created" . (gdb-thread-created . atomic)) ("thread-selected" . (gdb-thread-selected . atomic)) - ("thread-existed" . (gdb-ignored-notification . atomic)) + ("thread-exited" . (gdb-thread-exited . atomic)) ('default . (gdb-ignored-notification . atomic))))) "Alist of alists, mapping the type and class of message to a handler function. Handler functions are all flagged as either `progressive' or `atomic'. commit 60560cc7adfe685ef8c04623a6d019dc659123b1 Author: Eli Zaretskii Date: Tue Apr 18 14:30:28 2023 +0300 Fix description of lexical environment's internals * doc/lispref/variables.texi (Lexical Binding): Update the description of how the lexical environment is represented internally. (Bug#62840) diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 5584cbce9a6..6dd935d8763 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -1183,13 +1183,16 @@ Lexical Binding environment; if the variable is not specified in there, it looks in the symbol's value cell, where the dynamic value is stored. - (Internally, the lexical environment is an alist of symbol-value -pairs, with the final element in the alist being the symbol @code{t} -rather than a cons cell. Such an alist can be passed as the second -argument to the @code{eval} function, in order to specify a lexical -environment in which to evaluate a form. @xref{Eval}. Most Emacs -Lisp programs, however, should not interact directly with lexical -environments in this way; only specialized programs like debuggers.) + (Internally, the lexical environment is a list whose members are +usually cons cells that are symbol-value pairs, but some of its +members can be symbols rather than cons cells. A symbol in the list +means the lexical environment declared that symbol's variable as +locally considered to be dynamically bound. This list can be passed +as the second argument to the @code{eval} function, in order to +specify a lexical environment in which to evaluate a form. +@xref{Eval}. Most Emacs Lisp programs, however, should not interact +directly with lexical environments in this way; only specialized +programs like debuggers.) @cindex closures, example of using Lexical bindings have indefinite extent. Even after a binding commit 1456adf4248117b9889c6fa71f798ada2f45a3a4 Author: Idir Lankri Date: Fri Apr 14 15:52:24 2023 +0200 ; Eglot: fix a typo in a customization type * lisp/progmodes/eglot.el (eglot-ignored-server-capabilities): Fix the value associated with the tag "Go to declaration". (Bug#62849) Copyright-paperwork-exempt: yes diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 4943b44107a..9b499b944cd 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1673,7 +1673,7 @@ eglot-ignored-server-capabilities (const :tag "Go to definition" :definitionProvider) (const :tag "Go to type definition" :typeDefinitionProvider) (const :tag "Go to implementation" :implementationProvider) - (const :tag "Go to declaration" :implementationProvider) + (const :tag "Go to declaration" :declarationProvider) (const :tag "Find references" :referencesProvider) (const :tag "Highlight symbols automatically" :documentHighlightProvider) (const :tag "List symbols in buffer" :documentSymbolProvider) commit 2f59595f5f4e86a791c425a6f9e2c1594d6813e4 Author: Robert Pluim Date: Mon Apr 17 12:24:30 2023 +0200 ; * etc/NEWS: Grammar fixes. diff --git a/etc/NEWS b/etc/NEWS index 0d31fc679da..1822ff17265 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1881,12 +1881,12 @@ install. When enabled, 'package-install' will include in the list of upgradeable packages those built-in packages (like Eglot and use-package, for example) for which a newer version is available in -package archives, and will allow to install those newer versions. By +package archives, and will allow installing those newer versions. By default, this is disabled; however, if 'package-install' is invoked with a prefix argument, it will act as if this new option were enabled. -If you customize this option, we recommend to place its non-default +If you customize this option, we recommend you place its non-default setting in your early-init file. ** Emacs Sessions (Desktop) commit 596b780ab71d6495f866de35c234fe65a8a7914a Author: Kyle Meyer Date: Sun Apr 16 21:13:08 2023 -0400 Update to Org 9.6.4-2-g0f6ae7 diff --git a/doc/misc/org.org b/doc/misc/org.org index 7ff0933de75..ae3fae0623e 100644 --- a/doc/misc/org.org +++ b/doc/misc/org.org @@ -5958,8 +5958,9 @@ the agenda (see [[*Weekly/daily agenda]]). We distinguish: #+findex: org-block For more complex date specifications, Org mode supports using the - special expression diary entries implemented in the Emacs Calendar - package[fn:20]. For example, with optional time: + special expression diary entries implemented in the + [[info:emacs#Special Diary Entries][Emacs Calendar package]][fn:20]. + For example, with optional time: #+begin_example ,* 22:00-23:00 The nerd meeting on every 2nd Thursday of the month diff --git a/etc/refcards/orgcard.tex b/etc/refcards/orgcard.tex index f8894d9dc1c..c5d112dba72 100644 --- a/etc/refcards/orgcard.tex +++ b/etc/refcards/orgcard.tex @@ -1,5 +1,5 @@ % Reference Card for Org Mode -\def\orgversionnumber{9.6.3} +\def\orgversionnumber{9.6.4} \def\versionyear{2023} % latest update \input emacsver.tex diff --git a/lisp/org/ob-tangle.el b/lisp/org/ob-tangle.el index 27443fc2e81..980d4a12054 100644 --- a/lisp/org/ob-tangle.el +++ b/lisp/org/ob-tangle.el @@ -158,9 +158,9 @@ org-babel-process-comment-text :version "24.1" :type 'function) -(defcustom org-babel-tangle-default-file-mode #o544 +(defcustom org-babel-tangle-default-file-mode #o644 "The default mode used for tangled files, as an integer. -The default value 356 correspands to the octal #o544, which is +The default value 420 correspands to the octal #o644, which is read-write permissions for the user, read-only for everyone else." :group 'org-babel-tangle :package-version '(Org . "9.6") @@ -361,9 +361,9 @@ org-babel-interpret-file-mode ;; Match regexp taken from `file-modes-symbolic-to-number'. (file-modes-symbolic-to-number mode org-babel-tangle-default-file-mode)) ((string-match-p "^[r-][w-][xs-][r-][w-][xs-][r-][w-][x-]$" mode) - (file-modes-symbolic-to-number (concat "u=" (substring mode 0 3) - ",g=" (substring mode 3 6) - ",o=" (substring mode 6 9)) + (file-modes-symbolic-to-number (concat "u=" (delete ?- (substring mode 0 3)) + ",g=" (delete ?- (substring mode 3 6)) + ",o=" (delete ?- (substring mode 6 9))) 0)) (t (error "File mode %S not recognized as a valid format. See `org-babel-interpret-file-mode'." mode)))) diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index 2ec2f4c00bc..d3e61643190 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el @@ -7724,8 +7724,7 @@ org-agenda-highlight-todo (unless (string= org-agenda-todo-keyword-format "") ;; Remove `display' property as the icon could leak ;; on the white space. - (org-add-props " " (org-plist-delete (text-properties-at 0 x) - 'display))) + (apply #'propertize " " (org-plist-delete (text-properties-at 0 x) 'display))) (substring x (match-end 3))))))) x))) diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el index 51729b3f33d..517d45b0224 100644 --- a/lisp/org/org-element.el +++ b/lisp/org/org-element.el @@ -5329,7 +5329,7 @@ org-element-cache-sync-break "Duration, as a time value, of the pause between synchronizations. See `org-element-cache-sync-duration' for more information.") -(defvar org-element--cache-self-verify t +(defvar org-element--cache-self-verify nil "Activate extra consistency checks for the cache. This may cause serious performance degradation depending on the value diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el index 8d7b0b034f8..aef05bc6ee6 100644 --- a/lisp/org/org-macs.el +++ b/lisp/org/org-macs.el @@ -36,6 +36,10 @@ ;;; Org version verification. +(defconst org--built-in-p 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.") (defmacro org-assert-version () "Assert compile time and runtime version match." ;; We intentionally use a more permissive `org-release' instead of @@ -45,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 (equal (org-release) ,(org-release)) + `(unless (or org--built-in-p (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-table.el b/lisp/org/org-table.el index 5116b1127f7..83bad3f3a64 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el @@ -5414,12 +5414,10 @@ orgtbl-self-insert-command (self-insert-command N)) (setq org-table-may-need-update t) (let* (orgtbl-mode - a (cmd (or (key-binding (or (and (listp function-key-map) - (setq a (assoc last-input-event function-key-map)) - (cdr a)) - (vector last-input-event))) + (cdr (assoc last-command-event function-key-map))) + (vector last-command-event))) 'self-insert-command))) (call-interactively cmd) (if (and org-self-insert-cluster-for-undo diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index 43fdcb82832..15e4a50877a 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.6.3")) + (let ((org-release "9.6.4")) 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.6.3-2-gf2949d")) + (let ((org-git-version "release_9.6.4-2-g0f6ae7")) org-git-version)) (provide 'org-version) diff --git a/lisp/org/org.el b/lisp/org/org.el index be9d0e32dd0..f7c2b6d16d1 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -9,7 +9,7 @@ ;; URL: https://orgmode.org ;; Package-Requires: ((emacs "26.1")) -;; Version: 9.6.3 +;; Version: 9.6.4 ;; This file is part of GNU Emacs. ;; @@ -9143,7 +9143,8 @@ org-cancel-repeater (replace-match "0" t nil nil 1))))) (defvar org-state) -(defvar org-blocked-by-checkboxes) +;; FIXME: We should refactor this and similar dynamically scoped blocker flags. +(defvar org-blocked-by-checkboxes nil) ; dynamically scoped (defun org-todo (&optional arg) "Change the TODO state of an item. diff --git a/lisp/org/ox-latex.el b/lisp/org/ox-latex.el index 50a0950aa04..26f8742bec8 100644 --- a/lisp/org/ox-latex.el +++ b/lisp/org/ox-latex.el @@ -1822,7 +1822,7 @@ org-latex--protect-texttt (replace-regexp-in-string "--\\|[\\{}$%&_#~^]" (lambda (m) - (cond ((equal m "--") "-{}-") + (cond ((equal m "--") "-{}-{}") ((equal m "\\") "\\textbackslash{}") ((equal m "~") "\\textasciitilde{}") ((equal m "^") "\\textasciicircum{}") diff --git a/lisp/org/ox-odt.el b/lisp/org/ox-odt.el index cf217c9e781..03c909f78ed 100644 --- a/lisp/org/ox-odt.el +++ b/lisp/org/ox-odt.el @@ -2923,17 +2923,23 @@ org-odt-plain-text ;; not be desired in scripts that do not separate words with ;; spaces (for example, Han script). `fill-region' is able to ;; handle such situations. - ;; FIXME: The unnecessary spaced may still remain when a newline + ;; FIXME: The unnecessary spacing may still remain when a newline ;; is at a boundary between Org objects (e.g. italics markup ;; followed by newline). (setq output (with-temp-buffer - (insert output) (save-match-data (let ((leading (and (string-match (rx bos (1+ blank)) output) (match-string 0 output))) (trailing (and (string-match (rx (1+ blank) eos) output) (match-string 0 output)))) + (insert + (substring + output + (length leading) + (pcase (length trailing) + (0 nil) + (n (- n))))) ;; Unfill, retaining leading/trailing space. (let ((fill-column most-positive-fixnum)) (fill-region (point-min) (point-max))) commit a0b04a2247908e4d7d1d9f66886d3c1f21866084 Author: Eli Zaretskii Date: Sun Apr 16 18:11:07 2023 +0300 Documentation copyedits for 'package-install-upgrade-built-in' etc * etc/NEWS: More details about the new option 'package-install-upgrade-built-in'. * lisp/emacs-lisp/package.el (package-install-upgrade-built-in) (package--active-built-in-p, package-install): Doc fixes. (Bug#62720) diff --git a/etc/NEWS b/etc/NEWS index 0789fa49d75..0d31fc679da 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1878,8 +1878,16 @@ install. --- *** New user option 'package-install-upgrade-built-in'. -When enabled, 'package-install' can be used to install -newer versions of built-in packages. +When enabled, 'package-install' will include in the list of +upgradeable packages those built-in packages (like Eglot and +use-package, for example) for which a newer version is available in +package archives, and will allow to install those newer versions. By +default, this is disabled; however, if 'package-install' is invoked +with a prefix argument, it will act as if this new option were +enabled. + +If you customize this option, we recommend to place its non-default +setting in your early-init file. ** Emacs Sessions (Desktop) @@ -3249,6 +3257,10 @@ based on data provided by language servers using the Language Server Protocol (LSP). See the new Info manual "(eglot) Top" for more. Also see "etc/EGLOT-NEWS". +If you want to be able to use 'package-install' to upgrade Eglot to +newer versions released on GNU ELPA, customize the new option +'package-install-upgrade-built-in' to a non-nil value. + +++ ** use-package: Declarative package configuration. use-package is now shipped with Emacs. It provides the 'use-package' @@ -3256,6 +3268,10 @@ macro, which allows you to isolate package configuration in your init file in a way that is declarative, tidy, and performance-oriented. See the new Info manual "(use-package) Top" for more. +If you want to be able to use 'package-install' to upgrade use-package +to newer versions released on GNU ELPA, customize the new option +'package-install-upgrade-built-in' to a non-nil value. + --- ** New package 'wallpaper'. This package provides the command 'wallpaper-set', which sets the diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index c0cc7bebeb2..ffa6272dd1f 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -798,7 +798,7 @@ package-built-in-p (assq package package--builtins)))))) (defun package--active-built-in-p (package) - "Return non-nil if PACKAGE if the built-in version is used. + "Return non-nil if the built-in version of PACKAGE is used. If the built-in version of PACKAGE is used and PACKAGE is also available for installation from an archive, it is an indication that PACKAGE was never upgraded to any newer @@ -2200,7 +2200,7 @@ package--archives-initialize (defcustom package-install-upgrade-built-in nil "Non-nil means that built-in packages can be upgraded via a package archive. If disabled, then `package-install' will not suggest to replace a -built-in package with a version from a package archive." +built-in package with a (possibly newer) version from a package archive." :type 'boolean :version "29.1") @@ -2220,9 +2220,9 @@ package-install 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, the upgrading -of built-in packages will be possible, as if -`package-install-upgrade-built-in' had been enabled." +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." (interactive (progn ;; Initialize the package system to get the list of package commit 580d8278c5f4838c09576798dbbabc8ff51609a9 Author: Philip Kaludercic Date: Thu Apr 13 20:13:59 2023 +0200 Allow upgrading built-in packages with 'package-install' * etc/NEWS: Mention the change * lisp/emacs-lisp/package.el (package--upgradable-built-in-p): Add new predicate. (package-install-upgrade-built-in): Add new user option to enable feature. (package-install): Respect new user option. diff --git a/etc/NEWS b/etc/NEWS index 84dbb94a71a..0789fa49d75 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1876,6 +1876,11 @@ package maintainers. By customizing this user option you can specify specific packages to install. +--- +*** New user option 'package-install-upgrade-built-in'. +When enabled, 'package-install' can be used to install +newer versions of built-in packages. + ** Emacs Sessions (Desktop) +++ diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index f92afe56b76..c0cc7bebeb2 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -797,6 +797,21 @@ package-built-in-p (require 'finder-inf nil t) ; For `package--builtins'. (assq package package--builtins)))))) +(defun package--active-built-in-p (package) + "Return non-nil if PACKAGE if the built-in version is used. +If the built-in version of PACKAGE is used and PACKAGE is +also available for installation from an archive, it is an +indication that PACKAGE was never upgraded to any newer +version from the archive." + (and (not (assq (cond + ((package-desc-p package) + (package-desc-name package)) + ((stringp package) (intern package)) + ((symbolp package) package) + ((error "Unknown package format: %S" package))) + (package--alist))) + (package-built-in-p package))) + (defun package--autoloads-file-name (pkg-desc) "Return the absolute name of the autoloads file, sans extension. PKG-DESC is a `package-desc' object." @@ -2182,12 +2197,18 @@ package--archives-initialize (unless package-archive-contents (package-refresh-contents))) +(defcustom package-install-upgrade-built-in nil + "Non-nil means that built-in packages can be upgraded via a package archive. +If disabled, then `package-install' will not suggest to replace a +built-in package with a version from a package archive." + :type 'boolean + :version "29.1") + ;;;###autoload (defun package-install (pkg &optional dont-select) "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'. @@ -2197,7 +2218,11 @@ package-install `package-selected-packages'. If PKG is a `package-desc' and it is already installed, don't try -to install it but still mark it as selected." +to install it but still mark it as selected. + +If the command is invoked with a prefix argument, the upgrading +of built-in packages will be possible, as if +`package-install-upgrade-built-in' had been enabled." (interactive (progn ;; Initialize the package system to get the list of package @@ -2205,11 +2230,14 @@ package-install (package--archives-initialize) (list (intern (completing-read "Install package: " - (delq nil - (mapcar (lambda (elt) - (unless (package-installed-p (car elt)) - (symbol-name (car elt)))) - package-archive-contents)) + (mapcan + (lambda (elt) + (and (or (and (or current-prefix-arg + package-install-upgrade-built-in) + (package--active-built-in-p (car elt))) + (not (package-installed-p (car elt)))) + (list (symbol-name (car elt))))) + package-archive-contents) nil t)) nil))) (package--archives-initialize) @@ -2220,6 +2248,9 @@ package-install (unless (or dont-select (package--user-selected-p name)) (package--save-selected-packages (cons name package-selected-packages))) + (when (and (or current-prefix-arg package-install-upgrade-built-in) + (package--active-built-in-p pkg)) + (setq pkg (or (cadr (assq name package-archive-contents)) pkg))) (if-let* ((transaction (if (package-desc-p pkg) (unless (package-installed-p pkg) commit 329304c23fa46d5511b8336a8f0eeabedd64620f Author: Eli Zaretskii Date: Sun Apr 16 11:16:45 2023 +0300 ; * src/term.c (init_tty): Fix last change. (Bug#62877) diff --git a/src/term.c b/src/term.c index 8a16ce4e33f..53ba2a231e4 100644 --- a/src/term.c +++ b/src/term.c @@ -4164,7 +4164,7 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed) tty->TS_exit_alt_charset_mode = tgetstr ("ae", address); tty->TS_exit_attribute_mode = tgetstr ("me", address); #ifdef TERMINFO - tty->TS_enter_strike_through_mode = tigetstr ("smxx", address); + tty->TS_enter_strike_through_mode = tigetstr ("smxx"); if (tty->TS_enter_strike_through_mode == (char *) (intptr_t) -1) tty->TS_enter_strike_through_mode = NULL; #else commit 200dbf7d302e659e618f74bde81c7b3ccd795639 Author: Eli Zaretskii Date: Sun Apr 16 11:12:39 2023 +0300 Minor changes in c-ts-mode.el's support of DEFUNs * lisp/progmodes/c-ts-mode.el (c-ts-mode--fontify-DEFUN): Renamed from 'c-ts-mode--fontify-defun'; all callers changed. (c-ts-mode-emacs-sources-support): Renamed from 'c-ts-mode-emacs-devel' and made into a defcustom; all users changed. (c-ts-mode--emacs-defun-p, c-ts-mode--emacs-defun-at-point) (c-ts-mode--emacs-current-defun-name): Doc fixes. (Bug#62825) diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index c2d68086f33..166399f922d 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -193,9 +193,17 @@ c-ts-mode-set-style (c-ts-mode--get-indent-style (if (derived-mode-p 'c-ts-mode) 'c 'cpp)))))) -(defvar c-ts-mode-emacs-devel nil - "If the value is t, enable Emacs source-specific features. -This needs to be set before enabling `c-ts-mode'.") +(defcustom c-ts-mode-emacs-sources-support t + "Whether to enable Emacs source-specific features. +This enables detection of definitions of Lisp function using +the DEFUN macro. +This needs to be set before enabling `c-ts-mode'; if you change +the value after enabling `c-ts-mode', toggle the mode off and on +again." + :version "29.1" + :type 'boolean + :safe 'booleanp + :group 'c) ;;; Syntax table @@ -671,7 +679,7 @@ c-ts-mode--font-lock-settings :override t '(((call_expression (call_expression function: (identifier) @fn) - @c-ts-mode--fontify-defun) + @c-ts-mode--fontify-DEFUN) (:match "^DEFUN$" @fn))))) ;;; Font-lock helpers @@ -735,14 +743,14 @@ c-ts-mode--fontify-variable (treesit-node-start node) (treesit-node-end node) 'font-lock-variable-use-face override start end))) -(defun c-ts-mode--fontify-defun (node override start end &rest _) - "Correctly fontify the DEFUN macro. +(defun c-ts-mode--fontify-DEFUN (node override start end &rest _) + "Correctly fontify calls to the DEFUN macro in Emacs sources. For NODE, OVERRIDE, START, and END, see `treesit-font-lock-rules'. The captured NODE is a -call_expression where DEFUN is the function. +call_expression node, where DEFUN is the function. -This function corrects the fontification on the colon in -\"doc:\", and the parameter list." +This function corrects the fontification of the colon in +\"doc:\", and of the parameter list." (let* ((parent (treesit-node-parent node)) ;; ARG-LIST-1 and 2 are like this: ;; @@ -808,7 +816,7 @@ c-ts-mode--defun-name "union_specifier" "class_specifier" "namespace_definition") (treesit-node-child-by-field-name node "name")) - ;; DEFUNs in Emacs source. + ;; DEFUNs in Emacs sources. ("expression_statement" (let* ((call-exp-1 (treesit-node-child node 0)) (call-exp-2 (treesit-node-child call-exp-1 0)) @@ -885,7 +893,9 @@ c-ts-base--before-indent (list node parent bol))) (defun c-ts-mode--emacs-defun-p (node) - "Return non-nil if NODE is a DEFUN in Emacs source files." + "Return non-nil if NODE is a Lisp function defined using DEFUN. +This function detects Lisp primitives defined in Emacs source +files using the DEFUN macro." (and (equal (treesit-node-type node) "expression_statement") (equal (treesit-node-text (treesit-node-child-by-field-name @@ -896,23 +906,25 @@ c-ts-mode--emacs-defun-p "DEFUN"))) (defun c-ts-mode--emacs-defun-at-point (&optional range) - "Return the current defun node. + "Return the defun node at point. -This function recognizes DEFUNs in Emacs source files. +In addition to regular C functions, this function recognizes +definitions of Lisp primitrives in Emacs source files using DEFUN, +if `c-ts-mode-emacs-sources-support' is non-nil. -Note that for the case of a DEFUN, it is made of two separate -nodes, one for the declaration and one for the body, this +Note that DEFUN is parsed by tree-sitter as two separate +nodes, one for the declaration and one for the body; this function returns the declaration node. If RANGE is non-nil, return (BEG . END) where BEG end END -encloses the whole defun. This solves the problem of only -returning the declaration part for DEFUN." +encloses the whole defun. This is for when the entire defun +is required, not just the declaration part for DEFUN." (or (when-let ((node (treesit-defun-at-point))) (if range (cons (treesit-node-start node) (treesit-node-end node)) node)) - (and c-ts-mode-emacs-devel + (and c-ts-mode-emacs-sources-support (let ((candidate-1 ; For when point is in the DEFUN statement. (treesit-node-prev-sibling (treesit-node-top-level @@ -945,9 +957,10 @@ c-ts-mode-indent-defun (defun c-ts-mode--emacs-current-defun-name () "Return the name of the current defun. -This is used for `add-log-current-defun-function'. This -recognizes DEFUN in Emacs sources, in addition to normal function -definitions." +This is used for `add-log-current-defun-function'. +In addition to regular C functions, this function also recognizes +Emacs primitives defined using DEFUN in Emacs sources, +if `c-ts-mode-emacs-sources-support' is non-nil." (or (treesit-add-log-current-defun) (c-ts-mode--defun-name (c-ts-mode--emacs-defun-at-point)))) @@ -1067,7 +1080,7 @@ c-ts-mode (setq-local treesit-defun-tactic 'top-level) (treesit-major-mode-setup) - (when c-ts-mode-emacs-devel + (when c-ts-mode-emacs-sources-support (setq-local add-log-current-defun-function #'c-ts-mode--emacs-current-defun-name)))) @@ -1106,7 +1119,7 @@ c++-ts-mode (setq-local treesit-font-lock-settings (c-ts-mode--font-lock-settings 'cpp)) (treesit-major-mode-setup) - (when c-ts-mode-emacs-devel + (when c-ts-mode-emacs-sources-support (setq-local add-log-current-defun-function #'c-ts-mode--emacs-current-defun-name)))) commit 9686b015a0d71d08828afb0cfe6e477bbc4909ae Author: Eli Zaretskii Date: Sun Apr 16 09:19:15 2023 +0300 Fix strike-through attribute support on TTY frames * src/term.c (init_tty): Fix setting the strike-through capability with "smxx". (Bug#62265) diff --git a/src/term.c b/src/term.c index d881dee39fe..8a16ce4e33f 100644 --- a/src/term.c +++ b/src/term.c @@ -4163,7 +4163,15 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed) tty->TS_enter_alt_charset_mode = tgetstr ("as", address); tty->TS_exit_alt_charset_mode = tgetstr ("ae", address); tty->TS_exit_attribute_mode = tgetstr ("me", address); +#ifdef TERMINFO + tty->TS_enter_strike_through_mode = tigetstr ("smxx", address); + if (tty->TS_enter_strike_through_mode == (char *) (intptr_t) -1) + tty->TS_enter_strike_through_mode = NULL; +#else + /* FIXME: Is calling tgetstr here for non-terminfo case correct, + even though "smxx" is more than 2 characters? */ tty->TS_enter_strike_through_mode = tgetstr ("smxx", address); +#endif MultiUp (tty) = tgetstr ("UP", address); MultiDown (tty) = tgetstr ("DO", address); commit 39035fbfc5f6dfa66c9ba14f61a8d1c751d847c0 Author: Eli Zaretskii Date: Sun Apr 16 08:51:22 2023 +0300 Avoid crashes in 'describe-keymap' due to shadowing * src/keymap.c (describe_vector): Handle shadowing by something other than a symbol. (Bug#62867) diff --git a/src/keymap.c b/src/keymap.c index efac410d317..7f5777c9251 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -3308,13 +3308,18 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args, if (this_shadowed) { SET_PT (PT - 1); - static char const fmt[] = " (currently shadowed by `%s')"; - USE_SAFE_ALLOCA; - char *buffer = SAFE_ALLOCA (sizeof fmt + - SBYTES (SYMBOL_NAME (shadowed_by))); - esprintf (buffer, fmt, SDATA (SYMBOL_NAME (shadowed_by))); - insert_string (buffer); - SAFE_FREE(); + if (SYMBOLP (shadowed_by)) + { + static char const fmt[] = " (currently shadowed by `%s')"; + USE_SAFE_ALLOCA; + char *buffer = + SAFE_ALLOCA (sizeof fmt + SBYTES (SYMBOL_NAME (shadowed_by))); + esprintf (buffer, fmt, SDATA (SYMBOL_NAME (shadowed_by))); + insert_string (buffer); + SAFE_FREE(); + } + else /* Could be a keymap, a lambda, or a keyboard macro. */ + insert_string (" (currently shadowed)"); SET_PT (PT + 1); } }