commit c5eafccc9d2a32ef422060e50533b36292bdcc01 (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Mon May 18 17:17:46 2020 -0700 Reject attempts to clear pure strings * src/fns.c (Ffillarray, Fclear_string): Add CHECK_IMPURE here, to be consistent with Faset etc. (Ffillarray): Prefer memset when the fill is a single byte. diff --git a/src/fns.c b/src/fns.c index 301bd59ab9..b2f84b202d 100644 --- a/src/fns.c +++ b/src/fns.c @@ -2508,26 +2508,36 @@ ARRAY is a vector, string, char-table, or bool-vector. */) } else if (STRINGP (array)) { - register unsigned char *p = SDATA (array); - int charval; + unsigned char *p = SDATA (array); CHECK_CHARACTER (item); - charval = XFIXNAT (item); + int charval = XFIXNAT (item); size = SCHARS (array); - if (STRING_MULTIBYTE (array)) + if (size != 0) { + CHECK_IMPURE (array, XSTRING (array)); unsigned char str[MAX_MULTIBYTE_LENGTH]; - int len = CHAR_STRING (charval, str); - ptrdiff_t size_byte = SBYTES (array); - ptrdiff_t product; + int len; + if (STRING_MULTIBYTE (array)) + len = CHAR_STRING (charval, str); + else + { + str[0] = charval; + len = 1; + } - if (INT_MULTIPLY_WRAPV (size, len, &product) || product != size_byte) - error ("Attempt to change byte length of a string"); - for (idx = 0; idx < size_byte; idx++) - *p++ = str[idx % len]; + ptrdiff_t size_byte = SBYTES (array); + if (len == 1 && size == size_byte) + memset (p, str[0], size); + else + { + ptrdiff_t product; + if (INT_MULTIPLY_WRAPV (size, len, &product) + || product != size_byte) + error ("Attempt to change byte length of a string"); + for (idx = 0; idx < size_byte; idx++) + *p++ = str[idx % len]; + } } - else - for (idx = 0; idx < size; idx++) - p[idx] = charval; } else if (BOOL_VECTOR_P (array)) return bool_vector_fill (array, item); @@ -2542,12 +2552,15 @@ DEFUN ("clear-string", Fclear_string, Sclear_string, This makes STRING unibyte and may change its length. */) (Lisp_Object string) { - ptrdiff_t len; CHECK_STRING (string); - len = SBYTES (string); - memset (SDATA (string), 0, len); - STRING_SET_CHARS (string, len); - STRING_SET_UNIBYTE (string); + ptrdiff_t len = SBYTES (string); + if (len != 0 || STRING_MULTIBYTE (string)) + { + CHECK_IMPURE (string, XSTRING (string)); + memset (SDATA (string), 0, len); + STRING_SET_CHARS (string, len); + STRING_SET_UNIBYTE (string); + } return Qnil; } commit 06fe322c8d7123edea0759a7aa12051f4e676376 Author: Stefan Kangas Date: Tue May 19 02:22:02 2020 +0200 Clarify wording in my last commit * lisp/mouse.el (mouse-drag-and-drop-region-show-tooltip): Clarify wording of integer option. Suggested by Eli Zaretskii. diff --git a/lisp/mouse.el b/lisp/mouse.el index f045e5bdce..640f10af4e 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -2580,7 +2580,7 @@ in a tooltip." :type '(choice (const :tag "Do not show tooltips" nil) (const :tag "Show all text" t) - (integer :tag "Show characters (max)" 256)) + (integer :tag "Max number of characters to show" 256)) :version "26.1") (defcustom mouse-drag-and-drop-region-show-cursor t commit b1cd1f0b5aaf8030a7a4c6111cc8b18645f294e2 Author: Paul Eggert Date: Mon May 18 15:42:18 2020 -0700 Improve password-cache-add example in comment * lisp/password-cache.el: Improve comment. See Andreas Schwab in: https://lists.gnu.org/r/emacs-devel/2020-05/msg02422.html diff --git a/lisp/password-cache.el b/lisp/password-cache.el index 86d802f283..f5007579a8 100644 --- a/lisp/password-cache.el +++ b/lisp/password-cache.el @@ -31,7 +31,8 @@ ;; ;; Minibuffer prompt for password. ;; => "foo" ;; -;; (password-cache-add "test" (copy-sequence "foo")) +;; (password-cache-add "test" (read-passwd "Password? ")) +;; ;; Minibuffer prompt from read-passwd, which returns "foo". ;; => nil ;; (password-read "Password? " "test") commit 3d1bcfba5e21b29be8669aa2a8f27b344c9e02fd Author: Paul Eggert Date: Mon May 18 15:19:49 2020 -0700 Redo RCS Id for pdumper * lisp/version.el: Don’t put an RCS Id style string into the executable via purecopy, as this does not work with the pdumper. * src/emacs.c (RCS_Id): New constant, for 'ident'. diff --git a/lisp/version.el b/lisp/version.el index 24da21c731..b247232dcf 100644 --- a/lisp/version.el +++ b/lisp/version.el @@ -163,8 +163,4 @@ correspond to the running Emacs. Optional argument DIR is a directory to use instead of `source-directory'." (emacs-repository-branch-git (or dir source-directory))) -;; We put version info into the executable in the form that `ident' uses. -(purecopy (concat "\n$Id: " (subst-char-in-string ?\n ?\s (emacs-version)) - " $\n")) - ;;; version.el ends here diff --git a/src/emacs.c b/src/emacs.c index ea9c4cd79d..49793fd1e8 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -124,6 +124,11 @@ static const char emacs_version[] = PACKAGE_VERSION; static const char emacs_copyright[] = COPYRIGHT; static const char emacs_bugreport[] = PACKAGE_BUGREPORT; +/* Put version info into the executable in the form that 'ident' uses. */ +char const EXTERNALLY_VISIBLE RCS_Id[] + = "$Id" ": GNU Emacs " PACKAGE_VERSION + " (" EMACS_CONFIGURATION " " EMACS_CONFIG_FEATURES ") $"; + /* Empty lisp strings. To avoid having to build any others. */ Lisp_Object empty_unibyte_string, empty_multibyte_string; commit 018eb31fc0a8e558975be3835b9596408bfc3a0c Author: Dmitry Gutov Date: Tue May 19 00:55:27 2020 +0300 ; Update NEWS diff --git a/etc/NEWS b/etc/NEWS index 303036ece3..2cbb7adb0b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -353,6 +353,10 @@ symbol property to the browsing functions. With a new command 'browse-url-with-browser-kind', an URL can explicitly be browsed with either an internal or external browser. +** Project + +*** New user option 'project-vc-merge-submodules'. + * New Modes and Packages in Emacs 28.1 commit ca7224d5dbfd6f07d537f6159aae8df667a65497 Author: Glenn Morris Date: Mon May 18 13:08:27 2020 -0700 Add test for recent buffer-local-variables change * test/src/buffer-tests.el (buffer-tests-buffer-local-variables-undo): New. diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el index 6e87cb9489..6e9764625a 100644 --- a/test/src/buffer-tests.el +++ b/test/src/buffer-tests.el @@ -1327,4 +1327,10 @@ with parameters from the *Messages* buffer modification." (set-buffer-multibyte t) (buffer-string))))))) +;; https://debbugs.gnu.org/33492 +(ert-deftest buffer-tests-buffer-local-variables-undo () + "Test that `buffer-undo-list' appears in `buffer-local-variables'." + (with-temp-buffer + (should (assq 'buffer-undo-list (buffer-local-variables))))) + ;;; buffer-tests.el ends here commit ceee275431c7eb07b50cd1ecf7b22d2c0b6ed5f7 Author: Alan Mackenzie Date: Mon May 18 18:20:05 2020 +0000 CC Mode: Allow "static" etc. to be placed after a declaration's type name Fixes bug #41284. * lisp/progmodes/cc-langs.el (c-type-decl-prefix-key): include additionally c-modifier-kwds in the set of keywords at the base of this lang-const. diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 1e72352f71..17ffea59ff 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -3412,8 +3412,14 @@ regexp should match \"(\" if parentheses are valid in declarators. The end of the first submatch is taken as the end of the operator. Identifier syntax is in effect when this is matched (see `c-identifier-syntax-table')." - t (if (c-lang-const c-type-modifier-kwds) - (concat (regexp-opt (c-lang-const c-type-modifier-kwds) t) "\\>") + t (if (or (c-lang-const c-type-modifier-kwds) (c-lang-const c-modifier-kwds)) + (concat + (regexp-opt (c--delete-duplicates + (append (c-lang-const c-type-modifier-kwds) + (c-lang-const c-modifier-kwds)) + :test 'string-equal) + t) + "\\>") ;; Default to a regexp that never matches. regexp-unmatchable) ;; Check that there's no "=" afterwards to avoid matching tokens commit 86594a3ddb04c7b086f1d6796d5102da73020ac7 Author: Glenn Morris Date: Mon May 18 10:54:14 2020 -0700 Restore buffer-undo-list to buffer-local-variables It has been missing since 2012-07-03 (Emacs 24.3) "Cleanup basic buffer management", when undo_list was moved to the end of struct buffer. (Bug#33492) * src/buffer.c (buffer_local_variables_1): New function. (Fbuffer_local_variables): Explicitly add buffer-undo-list. diff --git a/src/buffer.c b/src/buffer.c index 53b3bd960c..f1cb4d5041 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -119,6 +119,7 @@ static void free_buffer_text (struct buffer *b); static struct Lisp_Overlay * copy_overlays (struct buffer *, struct Lisp_Overlay *); static void modify_overlay (struct buffer *, ptrdiff_t, ptrdiff_t); static Lisp_Object buffer_lisp_local_variables (struct buffer *, bool); +static Lisp_Object buffer_local_variables_1 (struct buffer *buf, int offset, Lisp_Object sym); static void CHECK_OVERLAY (Lisp_Object x) @@ -1300,6 +1301,25 @@ buffer_lisp_local_variables (struct buffer *buf, bool clone) return result; } + +/* If the variable at position index OFFSET in buffer BUF has a + buffer-local value, return (name . value). If SYM is non-nil, + it replaces name. */ + +static Lisp_Object +buffer_local_variables_1 (struct buffer *buf, int offset, Lisp_Object sym) +{ + int idx = PER_BUFFER_IDX (offset); + if ((idx == -1 || PER_BUFFER_VALUE_P (buf, idx)) + && SYMBOLP (PER_BUFFER_SYMBOL (offset))) + { + sym = NILP (sym) ? PER_BUFFER_SYMBOL (offset) : sym; + Lisp_Object val = per_buffer_value (buf, offset); + return EQ (val, Qunbound) ? sym : Fcons (sym, val); + } + return Qnil; +} + DEFUN ("buffer-local-variables", Fbuffer_local_variables, Sbuffer_local_variables, 0, 1, 0, doc: /* Return an alist of variables that are buffer-local in BUFFER. @@ -1311,25 +1331,25 @@ No argument or nil as argument means use current buffer as BUFFER. */) { struct buffer *buf = decode_buffer (buffer); Lisp_Object result = buffer_lisp_local_variables (buf, 0); + Lisp_Object tem; /* Add on all the variables stored in special slots. */ { - int offset, idx; + int offset; FOR_EACH_PER_BUFFER_OBJECT_AT (offset) { - idx = PER_BUFFER_IDX (offset); - if ((idx == -1 || PER_BUFFER_VALUE_P (buf, idx)) - && SYMBOLP (PER_BUFFER_SYMBOL (offset))) - { - Lisp_Object sym = PER_BUFFER_SYMBOL (offset); - Lisp_Object val = per_buffer_value (buf, offset); - result = Fcons (EQ (val, Qunbound) ? sym : Fcons (sym, val), - result); - } + tem = buffer_local_variables_1 (buf, offset, Qnil); + if (!NILP (tem)) + result = Fcons (tem, result); } } + tem = buffer_local_variables_1 (buf, PER_BUFFER_VAR_OFFSET (undo_list), + intern ("buffer-undo-list")); + if (!NILP (tem)) + result = Fcons (tem, result); + return result; } commit b2e2128745a00e06cb714bb3f47829f036a9caf9 Author: Simen Heggestøyl Date: Mon May 18 17:54:05 2020 +0200 Use lexical-binding in webjump.el and add tests * lisp/net/webjump.el: Use lexical-binding. (webjump-read-url-choice): Remove redundant 'function' around lambda. * test/lisp/net/webjump-tests.el: New file with tests for webjump.el. diff --git a/lisp/net/webjump.el b/lisp/net/webjump.el index 6edd03c39c..8bb156199c 100644 --- a/lisp/net/webjump.el +++ b/lisp/net/webjump.el @@ -1,4 +1,4 @@ -;;; webjump.el --- programmable Web hotlist +;;; webjump.el --- programmable Web hotlist -*- lexical-binding: t; -*- ;; Copyright (C) 1996-1997, 2001-2020 Free Software Foundation, Inc. @@ -323,8 +323,7 @@ Please submit bug reports and other feedback to the author, Neil W. Van Dyke (defun webjump-read-url-choice (what urls &optional default) ;; Note: Convert this to use `webjump-read-choice' someday. - (let* ((completions (mapcar (function (lambda (n) (cons n n))) - urls)) + (let* ((completions (mapcar (lambda (n) (cons n n)) urls)) (input (completing-read (concat what ;;(if default " (RET for default)" "") ": ") diff --git a/test/lisp/net/webjump-tests.el b/test/lisp/net/webjump-tests.el new file mode 100644 index 0000000000..47569c948f --- /dev/null +++ b/test/lisp/net/webjump-tests.el @@ -0,0 +1,73 @@ +;;; webjump-tests.el --- Tests for webjump.el -*- lexical-binding: t; -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; Author: Simen Heggestøyl +;; Keywords: + +;; 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: + +;; + +;;; Code: + +(require 'ert) +(require 'webjump) + +(ert-deftest webjump-tests-builtin () + (should (equal (webjump-builtin '[name] "gnu.org") "gnu.org"))) + +(ert-deftest webjump-tests-builtin-check-args () + (should (webjump-builtin-check-args [1 2 3] "Foo" 2)) + (should-error (webjump-builtin-check-args [1 2 3] "Foo" 3))) + +(ert-deftest webjump-tests-mirror-default () + (should (equal (webjump-mirror-default + '("https://ftp.gnu.org/pub/gnu/" + "https://ftpmirror.gnu.org")) + "https://ftp.gnu.org/pub/gnu/"))) + +(ert-deftest webjump-tests-null-or-blank-string-p () + (should (webjump-null-or-blank-string-p nil)) + (should (webjump-null-or-blank-string-p "")) + (should (webjump-null-or-blank-string-p " ")) + (should-not (webjump-null-or-blank-string-p " . "))) + +(ert-deftest webjump-tests-url-encode () + (should (equal (webjump-url-encode "") "")) + (should (equal (webjump-url-encode "a b c") "a+b+c")) + (should (equal (webjump-url-encode "foo?") "foo%3F")) + (should (equal (webjump-url-encode "/foo\\") "/foo%5C")) + (should (equal (webjump-url-encode "f&o") "f%26o"))) + +(ert-deftest webjump-tests-url-fix () + (should (equal (webjump-url-fix nil) "")) + (should (equal (webjump-url-fix "/tmp/") "file:///tmp/")) + (should (equal (webjump-url-fix "gnu.org") "http://gnu.org/")) + (should (equal (webjump-url-fix "ftp.x.org") "ftp://ftp.x.org/")) + (should (equal (webjump-url-fix "https://gnu.org") + "https://gnu.org/"))) + +(ert-deftest webjump-tests-url-fix-trailing-slash () + (should (equal (webjump-url-fix-trailing-slash "https://gnu.org") + "https://gnu.org/")) + (should (equal (webjump-url-fix-trailing-slash "https://gnu.org/") + "https://gnu.org/"))) + +(provide 'webjump-tests) +;;; webjump-tests.el ends here commit b1fe27d77db8f819641231ca46725f3eed0b4d9b Author: Mattias Engdegård Date: Sun May 17 18:11:27 2020 +0200 Fix calculator entry of numbers with negative exponents (bug#41347) * lisp/calculator.el (calculator-string-to-number): Remove obsolete string transformations preventing entry of 1e-3 etc. Keep one transformation to allow entry of "1.e3". Reported by Chris Zheng. diff --git a/lisp/calculator.el b/lisp/calculator.el index 7e0b2fcc6a..cd92f99268 100644 --- a/lisp/calculator.el +++ b/lisp/calculator.el @@ -858,12 +858,10 @@ The result should not exceed the screen width." "Convert the given STR to a number, according to the value of `calculator-input-radix'." (if calculator-input-radix - (string-to-number str (cadr (assq calculator-input-radix - '((bin 2) (oct 8) (hex 16))))) - (let* ((str (replace-regexp-in-string - "\\.\\([^0-9].*\\)?$" ".0\\1" str)) - (str (replace-regexp-in-string - "[eE][+-]?\\([^0-9].*\\)?$" "e0\\1" str))) + (string-to-number str (cadr (assq calculator-input-radix + '((bin 2) (oct 8) (hex 16))))) + ;; Allow entry of "1.e3". + (let ((str (replace-regexp-in-string (rx "." (any "eE")) "e" str))) (float (string-to-number str))))) (defun calculator-push-curnum () commit 2216468786f64cfa403dface1dab1cd20b84d5aa Author: Dmitry Gutov Date: Mon May 18 03:44:26 2020 +0300 Update the package version * lisp/progmodes/project.el: Update the package version. (project-vc-merge-submodules): Update the docstring. (project-try-vc): Add a FIXME. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 0b2761c2a5..44259990bb 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1,7 +1,7 @@ ;;; project.el --- Operations on the current project -*- lexical-binding: t; -*- ;; Copyright (C) 2015-2020 Free Software Foundation, Inc. -;; Version: 0.1.3 +;; Version: 0.2.0 ;; Package-Requires: ((emacs "26.3")) ;; This is a GNU ELPA :core package. Avoid using functionality that @@ -233,7 +233,10 @@ to find the list of ignores for each directory." :safe 'listp) (defcustom project-vc-merge-submodules t - "Non-nil to consider submodules part of the parent project." + "Non-nil to consider submodules part of the parent project. + +After changing this variable (using Customize or .dir-locals.el) +you might have to restart Emacs to see the effect." :type 'boolean :package-version '(project . "0.2.0") :safe 'booleanp) @@ -284,6 +287,8 @@ backend implementation of `project-external-roots'.") (vc-file-setprop dir 'project-git-root (if (and + ;; FIXME: Invalidate the cache when the value + ;; of this variable changes. project-vc-merge-submodules (project--submodule-p root)) (let* ((parent (file-name-directory @@ -302,9 +307,8 @@ backend implementation of `project-external-roots'.") ;; there is the custom var now. ;; ;; Some users may also set up things equivalent to Git submodules - ;; using "git worktree" instead (for example). However, we expect - ;; that most of them would prefer to treat those as separate - ;; projects anyway. + ;; using "git worktree" (for example). However, we expect that most + ;; of them would prefer to treat those as separate projects anyway. (let* ((gitfile (expand-file-name ".git" root))) (cond ((file-directory-p gitfile) commit 30e8d560aac0442cfcbd6c88f616227a5e67743c Author: Dmitry Gutov Date: Mon May 18 03:36:43 2020 +0300 Add user option project-vc-merge-submodules * lisp/progmodes/project.el (project-vc): Update the docstring. (project-vc-merge-submodules): New user option. (project-try-vc): Use it. (project--submodule-p): Extract from project-try-vc. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 198f040fb2..0b2761c2a5 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -223,7 +223,7 @@ to find the list of ignores for each directory." local-files)))) (defgroup project-vc nil - "Project implementation using the VC package." + "Project implementation based on the VC package." :version "25.1" :group 'tools) @@ -232,6 +232,12 @@ to find the list of ignores for each directory." :type '(repeat string) :safe 'listp) +(defcustom project-vc-merge-submodules t + "Non-nil to consider submodules part of the parent project." + :type 'boolean + :package-version '(project . "0.2.0") + :safe 'booleanp) + ;; FIXME: Using the current approach, major modes are supposed to set ;; this variable to a buffer-local value. So we don't have access to ;; the "external roots" of language A from buffers of language B, which @@ -273,36 +279,45 @@ backend implementation of `project-external-roots'.") (pcase backend ('Git ;; Don't stop at submodule boundary. - ;; Note: It's not necessarily clear-cut what should be - ;; considered a "submodule" in the sense that some users - ;; may setup things equivalent to "git-submodule"s using - ;; "git worktree" instead (for example). - ;; FIXME: Also it may be the case that some users would consider - ;; a submodule as its own project. So there's a good chance - ;; we will need to let the user tell us what is their intention. (or (vc-file-getprop dir 'project-git-root) - (let* ((root (vc-call-backend backend 'root dir)) - (gitfile (expand-file-name ".git" root))) + (let ((root (vc-call-backend backend 'root dir))) (vc-file-setprop dir 'project-git-root - (cond - ((file-directory-p gitfile) - root) - ((with-temp-buffer - (insert-file-contents gitfile) - (goto-char (point-min)) - ;; Kind of a hack to distinguish a submodule from - ;; other cases of .git files pointing elsewhere. - (looking-at "gitdir: [./]+/\\.git/modules/")) - (let* ((parent (file-name-directory - (directory-file-name root)))) - (vc-call-backend backend 'root parent))) - (t root))) - ))) + (if (and + project-vc-merge-submodules + (project--submodule-p root)) + (let* ((parent (file-name-directory + (directory-file-name root)))) + (vc-call-backend backend 'root parent)) + root))))) ('nil nil) (_ (ignore-errors (vc-call-backend backend 'root dir)))))) (and root (cons 'vc root)))) +(defun project--submodule-p (root) + ;; XXX: We only support Git submodules for now. + ;; + ;; For submodules, at least, we expect the users to prefer them to + ;; be considered part of the parent project. For those who don't, + ;; there is the custom var now. + ;; + ;; Some users may also set up things equivalent to Git submodules + ;; using "git worktree" instead (for example). However, we expect + ;; that most of them would prefer to treat those as separate + ;; projects anyway. + (let* ((gitfile (expand-file-name ".git" root))) + (cond + ((file-directory-p gitfile) + nil) + ((with-temp-buffer + (insert-file-contents gitfile) + (goto-char (point-min)) + ;; Kind of a hack to distinguish a submodule from + ;; other cases of .git files pointing elsewhere. + (looking-at "gitdir: [./]+/\\.git/modules/")) + t) + (t nil)))) + (cl-defmethod project-roots ((project (head vc))) (list (cdr project))) commit 94f01fe206b554df94f7860892088cd22ed191dd Author: Dmitry Gutov Date: Mon May 18 02:46:06 2020 +0300 vc-working-revision: Bind default-directory * lisp/vc/vc-hooks.el (vc-working-revision): Bind default-directory to be on the safe side. Suggested by Ilya Ostapyshyn (https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg02301.html). diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index 2ca9d3e620..ce72a49b95 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -498,7 +498,7 @@ status of this file. Otherwise, the value returned is one of: "Return the repository version from which FILE was checked out. If FILE is not registered, this function always returns nil." (or (vc-file-getprop file 'vc-working-revision) - (progn + (let ((default-directory (file-name-directory file))) (setq backend (or backend (vc-backend file))) (when backend (vc-file-setprop file 'vc-working-revision commit 00be23c2af4aa1bb09afc6404c5ef68997dc18f5 Author: Paul Eggert Date: Sun May 17 16:50:49 2020 -0700 Don’t attempt to modify constant strings These attempts were found by ‘make compile-always’. * lisp/language/tibet-util.el (tibetan-obsolete-glyphs): * lisp/org/org-agenda.el (org-agenda-get-restriction-and-command): Don’t try to modify string constants. diff --git a/lisp/language/tibet-util.el b/lisp/language/tibet-util.el index 29fff9175b..8684cdb133 100644 --- a/lisp/language/tibet-util.el +++ b/lisp/language/tibet-util.el @@ -43,13 +43,17 @@ ("་" . "་") ("༔" . "༔") ;; Yes these are dirty. But ... - ("༎ ༎" . ,(compose-string "༎ ༎" 0 3 [?༎ (Br . Bl) ? (Br . Bl) ?༎])) + ("༎ ༎" . ,(compose-string (copy-sequence "༎ ༎") + 0 3 [?༎ (Br . Bl) ? (Br . Bl) ?༎])) ("༄༅༅" . ,(compose-string - "࿁࿂࿂࿂" 0 4 + (copy-sequence "࿁࿂࿂࿂") 0 4 [?࿁ (Br . Bl) ?࿂ (Br . Bl) ?࿂ (Br . Bl) ?࿂])) - ("༄༅" . ,(compose-string "࿁࿂࿂" 0 3 [?࿁ (Br . Bl) ?࿂ (Br . Bl) ?࿂])) - ("༆" . ,(compose-string "࿁࿂༙" 0 3 [?࿁ (Br . Bl) ?࿂ (br . tr) ?༙])) - ("༄" . ,(compose-string "࿁࿂" 0 2 [?࿁ (Br . Bl) ?࿂])))) + ("༄༅" . ,(compose-string (copy-sequence "࿁࿂࿂") + 0 3 [?࿁ (Br . Bl) ?࿂ (Br . Bl) ?࿂])) + ("༆" . ,(compose-string (copy-sequence "࿁࿂༙") + 0 3 [?࿁ (Br . Bl) ?࿂ (br . tr) ?༙])) + ("༄" . ,(compose-string (copy-sequence "࿁࿂") + 0 2 [?࿁ (Br . Bl) ?࿂])))) ;;;###autoload (defun tibetan-char-p (ch) diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index 5fe140d00e..689d134627 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el @@ -2995,7 +2995,8 @@ Agenda views are separated by `org-agenda-block-separator'." (erase-buffer) (insert (eval-when-compile (let ((header - "Press key for an agenda command: + (copy-sequence + "Press key for an agenda command: -------------------------------- < Buffer, subtree/region restriction a Agenda for current week or day > Remove restriction t List of all TODO entries e Export agenda views @@ -3004,7 +3005,7 @@ s Search for keywords M Like m, but only TODO entries / Multi-occur S Like s, but only TODO entries ? Find :FLAGGED: entries C Configure custom agenda commands * Toggle sticky agenda views # List stuck projects (!=configure) -") +")) (start 0)) (while (string-match "\\(^\\| \\|(\\)\\(\\S-\\)\\( \\|=\\)" commit abec255c024938a40fa3c9730f602c0351e5877d Author: Andrea Corallo Date: Sun May 17 13:23:59 2020 +0100 * Fix Garbage Collector for missing calle-saved regs content (Bug#41357) * src/alloc.c (SET_STACK_TOP_ADDRESS): Do not call __builtin_unwind_init. (flush_stack_call_func1): Rename from 'flush_stack_call_func'. (flush_stack_call_func): New function to spill all registers before calling 'flush_stack_call_func1'. This to make sure the top of the stack identified includes those registers. diff --git a/src/alloc.c b/src/alloc.c index cc9ba8dbf5..ebc55857ea 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -4944,12 +4944,10 @@ typedef union #ifdef HAVE___BUILTIN_UNWIND_INIT # define SET_STACK_TOP_ADDRESS(p) \ stacktop_sentry sentry; \ - __builtin_unwind_init (); \ *(p) = NEAR_STACK_TOP (&sentry) #else # define SET_STACK_TOP_ADDRESS(p) \ stacktop_sentry sentry; \ - __builtin_unwind_init (); \ test_setjmp (); \ sys_setjmp (sentry.j); \ *(p) = NEAR_STACK_TOP (&sentry + (stack_bottom < &sentry.c)) @@ -5025,7 +5023,7 @@ mark_stack (char const *bottom, char const *end) from FUNC. */ NO_INLINE void -flush_stack_call_func (void (*func) (void *arg), void *arg) +flush_stack_call_func1 (void (*func) (void *arg), void *arg) { void *end; struct thread_state *self = current_thread; diff --git a/src/lisp.h b/src/lisp.h index a55fa32950..ad7d67ae69 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3811,7 +3811,15 @@ extern void alloc_unexec_pre (void); extern void alloc_unexec_post (void); extern void mark_maybe_objects (Lisp_Object const *, ptrdiff_t); extern void mark_stack (char const *, char const *); -extern void flush_stack_call_func (void (*func) (void *arg), void *arg); +extern void flush_stack_call_func1 (void (*func) (void *arg), void *arg); + +INLINE void +flush_stack_call_func (void (*func) (void *arg), void *arg) +{ + __builtin_unwind_init (); + flush_stack_call_func1 (func, arg); +} + extern void garbage_collect (void); extern void maybe_garbage_collect (void); extern const char *pending_malloc_warning; commit 5daa7a5fd4aced33a2ae016bde5bb37d1d95edf6 Author: Richard Stallman Date: Sun May 17 15:54:59 2020 -0400 Don't mention non-GNU package archives. diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index d3a2f07e25..be1ffc026d 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -3463,25 +3463,16 @@ see @ref{Packages that do not come with Emacs}. @cindex Emacs Lisp List @cindex Emacs Lisp Archive -The easiest way to add more features to your Emacs is to use the -command @kbd{M-x list-packages}. This contacts the -@uref{https://elpa.gnu.org, GNU ELPA} (``Emacs Lisp Package Archive'') -server and fetches the list of additional packages that it offers. -These are GNU packages that are available for use with Emacs, but are -distributed separately from Emacs itself, for reasons of space, etc. -You can browse the resulting @file{*Packages*} buffer to see what is -available, and then Emacs can automatically download and install the -packages that you select. @xref{Packages,,, emacs, The GNU Emacs Manual}. - -There are other, non-GNU, Emacs Lisp package servers, including: -@uref{https://melpa.org, MELPA}; and -@uref{https://marmalade-repo.org, Marmalade}. To use additional -package servers, customize the @code{package-archives} variable. Be -aware that installing a package can run arbitrary code, so only add -sources that you trust. Also, packages hosted on non-GNU package -servers may encourage or require you to install and use non-free -software; for example, MELPA is known to host some packages that do -this. +We distribute many packages that extend Emacs, in the +@uref{https://elpa.gnu.org, GNU ELPA} (``Emacs Lisp Package +Archive''). The command @kbd{M-x list-packages} contacts the GNU ELPA +server and fetches the list of packages that it distributes. These +GNU packages are designed for use with Emacs, but we distribute them +separately from Emacs itself, for reasons of space, and convenience of +development. You can browse the resulting @file{*Packages*} buffer to +see what is available, and then Emacs can automatically download and +install the packages that you select. @xref{Packages,,, emacs, The +GNU Emacs Manual}. The @uref{https://lists.gnu.org/mailman/listinfo/gnu-emacs-sources, GNU Emacs sources mailing list}, which is gatewayed to the commit a8f24a89d73a31d1bbea10b27f61c399637f9cb6 Author: Stefan Kangas Date: Sun May 17 14:59:10 2020 +0200 Fix minor issues with mouse-drag-and-drop-region-show-tooltip * lisp/mouse.el (mouse-drag-and-drop-region-show-tooltip): Fix defcustom type to allow all valid values. Suggested by David Ponce. (Bug#41351) (mouse-drag-and-drop-region): Fix bug where setting `drag-and-drop-region-show-tooltip' to 0 would still show a tooltip. diff --git a/lisp/mouse.el b/lisp/mouse.el index 795b4da19e..f045e5bdce 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -2575,9 +2575,12 @@ as it does when dropping text in the source buffer." If this option is nil, `mouse-drag-and-drop-region' does not show tooltips. If this is t, it shows the entire text dragged in a tooltip. If this is an integer (as with the default value of -256), it will show that many characters of the dragged text in -a tooltip." - :type 'integer +256), it will show up to that many characters of the dragged text +in a tooltip." + :type '(choice + (const :tag "Do not show tooltips" nil) + (const :tag "Show all text" t) + (integer :tag "Show characters (max)" 256)) :version "26.1") (defcustom mouse-drag-and-drop-region-show-cursor t @@ -2611,6 +2614,7 @@ is copied instead of being cut." (let* ((mouse-button (event-basic-type last-input-event)) (mouse-drag-and-drop-region-show-tooltip (when (and mouse-drag-and-drop-region-show-tooltip + (> mouse-drag-and-drop-region-show-tooltip 0) (display-multi-frame-p) (require 'tooltip)) mouse-drag-and-drop-region-show-tooltip))