From 1fe1e0a8e7e3863d36c1a87ca38d2fa39bc25a56 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 17 May 2016 23:55:38 +0300 Subject: [PATCH 01/39] * lisp/char-fold.el: Rename from character-fold.el. * lisp/replace.el (replace-char-fold): Rename from replace-character-fold. * test/automated/char-fold-tests.el: Rename from character-fold-tests.el. http://lists.gnu.org/archive/html/emacs-devel/2015-12/msg00529.html --- doc/emacs/search.texi | 8 +- etc/NEWS | 8 +- lisp/{character-fold.el => char-fold.el} | 52 +++++------ lisp/isearch.el | 10 +-- lisp/menu-bar.el | 2 +- lisp/replace.el | 16 ++-- ...acter-fold-tests.el => char-fold-tests.el} | 90 +++++++++---------- 7 files changed, 93 insertions(+), 93 deletions(-) rename lisp/{character-fold.el => char-fold.el} (85%) rename test/automated/{character-fold-tests.el => char-fold-tests.el} (53%) diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index 7958a4a2bfa..d841934c855 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -1264,13 +1264,13 @@ but match under character folding are known as @dfn{equivalent character sequences}. @kindex M-s ' @r{(Incremental Search)} -@findex isearch-toggle-character-fold +@findex isearch-toggle-char-fold Generally, search commands in Emacs do not by default perform character folding in order to match equivalent character sequences. You can enable this behavior by customizing the variable -@code{search-default-mode} to @code{character-fold-to-regexp}. +@code{search-default-mode} to @code{char-fold-to-regexp}. @xref{Search Customizations}. Within an incremental search, typing -@kbd{M-s '} (@code{isearch-toggle-character-fold}) toggles character +@kbd{M-s '} (@code{isearch-toggle-char-fold}) toggles character folding, but only for that search. (Replace commands have a different default, controlled by a separate option; see @ref{Replacement and Lax Matches}.) @@ -1481,7 +1481,7 @@ replacement is done without case conversion. (@pxref{Lax Search, character folding}) when looking for the text to replace. To enable character folding for matching in @code{query-replace} and @code{replace-string}, set the variable -@code{replace-character-fold} to a non-@code{nil} value. (This +@code{replace-char-fold} to a non-@code{nil} value. (This setting does not affect the replacement text, only how Emacs finds the text to replace. It also doesn't affect @code{replace-regexp}.) diff --git a/etc/NEWS b/etc/NEWS index 3031cab4782..670465f2ab8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -633,11 +633,11 @@ as many other symbols like U+249C (PARENTHESIZED LATIN SMALL LETTER A). Character folding is enabled by customizing 'search-default-mode' to -the value 'character-fold-to-regexp'. You can also toggle character +the value 'char-fold-to-regexp'. You can also toggle character folding in the middle of a search by typing 'M-s ''. 'query-replace' honors character folding if the new variable -'replace-character-fold' is customized to a non-nil value. +'replace-char-fold' is customized to a non-nil value. +++ *** New user option 'search-default-mode'. @@ -647,9 +647,9 @@ value, nil specifies that Isearch does literal searches (however, as in previous Emacs versions). +++ -*** New function 'character-fold-to-regexp' can be used +*** New function 'char-fold-to-regexp' can be used by searching commands to produce a regexp matching anything that -character-folds into STRING. +char-folds into STRING. +++ *** The new 'M-s M-w' key binding uses eww to search the web for the diff --git a/lisp/character-fold.el b/lisp/char-fold.el similarity index 85% rename from lisp/character-fold.el rename to lisp/char-fold.el index 2d3a8c67fa5..68bea29ea45 100644 --- a/lisp/character-fold.el +++ b/lisp/char-fold.el @@ -1,4 +1,4 @@ -;;; character-fold.el --- match unicode to similar ASCII -*- lexical-binding: t; -*- +;;; char-fold.el --- match unicode to similar ASCII -*- lexical-binding: t; -*- ;; Copyright (C) 2015-2016 Free Software Foundation, Inc. @@ -22,12 +22,12 @@ ;;; Code: -(eval-and-compile (put 'character-fold-table 'char-table-extra-slots 1)) +(eval-and-compile (put 'char-fold-table 'char-table-extra-slots 1)) -(defconst character-fold-table +(defconst char-fold-table (eval-when-compile - (let ((equiv (make-char-table 'character-fold-table)) - (equiv-multi (make-char-table 'character-fold-table)) + (let ((equiv (make-char-table 'char-fold-table)) + (equiv-multi (make-char-table 'char-fold-table)) (table (unicode-property-table-internal 'decomposition))) (set-char-table-extra-slot equiv 0 equiv-multi) @@ -115,7 +115,7 @@ equiv) equiv)) "Used for folding characters of the same group during search. -This is a char-table with the `character-fold-table' subtype. +This is a char-table with the `char-fold-table' subtype. Let us refer to the character in question by char-x. Each entry is either nil (meaning char-x only matches literally) @@ -136,18 +136,18 @@ For instance, the default alist for ?f includes: Exceptionally for the space character (32), ALIST is ignored.") -(defun character-fold--make-space-string (n) +(defun char-fold--make-space-string (n) "Return a string that matches N spaces." (format "\\(?:%s\\|%s\\)" (make-string n ?\s) (apply #'concat - (make-list n (or (aref character-fold-table ?\s) " "))))) + (make-list n (or (aref char-fold-table ?\s) " "))))) ;;;###autoload -(defun character-fold-to-regexp (string &optional _lax from) - "Return a regexp matching anything that character-folds into STRING. +(defun char-fold-to-regexp (string &optional _lax from) + "Return a regexp matching anything that char-folds into STRING. Any character in STRING that has an entry in -`character-fold-table' is replaced with that entry (which is a +`char-fold-table' is replaced with that entry (which is a regexp) and other characters are `regexp-quote'd. If the resulting regexp would be too long for Emacs to handle, @@ -156,7 +156,7 @@ just return the result of calling `regexp-quote' on STRING. FROM is for internal use. It specifies an index in the STRING from which to start." (let* ((spaces 0) - (multi-char-table (char-table-extra-slot character-fold-table 0)) + (multi-char-table (char-table-extra-slot char-fold-table 0)) (i (or from 0)) (end (length string)) (out nil)) @@ -172,9 +172,9 @@ from which to start." (pcase (aref string i) (`?\s (setq spaces (1+ spaces))) (c (when (> spaces 0) - (push (character-fold--make-space-string spaces) out) + (push (char-fold--make-space-string spaces) out) (setq spaces 0)) - (let ((regexp (or (aref character-fold-table c) + (let ((regexp (or (aref char-fold-table c) (regexp-quote (string c)))) ;; Long string. The regexp would probably be too long. (alist (unless (> end 50) @@ -206,13 +206,13 @@ from which to start." (let ((length (car entry)) (suffix-regexp (cdr entry))) (concat suffix-regexp - (character-fold-to-regexp subs nil length)))) + (char-fold-to-regexp subs nil length)))) `((0 . ,regexp) . ,matched-entries) "\\|") "\\)")))) out)))) (setq i (1+ i))) (when (> spaces 0) - (push (character-fold--make-space-string spaces) out)) + (push (char-fold--make-space-string spaces) out)) (let ((regexp (apply #'concat (nreverse out)))) ;; Limited by `MAX_BUF_SIZE' in `regex.c'. (if (> (length regexp) 5000) @@ -221,22 +221,22 @@ from which to start." ;;; Commands provided for completeness. -(defun character-fold-search-forward (string &optional bound noerror count) - "Search forward for a character-folded version of STRING. -STRING is converted to a regexp with `character-fold-to-regexp', +(defun char-fold-search-forward (string &optional bound noerror count) + "Search forward for a char-folded version of STRING. +STRING is converted to a regexp with `char-fold-to-regexp', which is searched for with `re-search-forward'. BOUND NOERROR COUNT are passed to `re-search-forward'." (interactive "sSearch: ") - (re-search-forward (character-fold-to-regexp string) bound noerror count)) + (re-search-forward (char-fold-to-regexp string) bound noerror count)) -(defun character-fold-search-backward (string &optional bound noerror count) - "Search backward for a character-folded version of STRING. -STRING is converted to a regexp with `character-fold-to-regexp', +(defun char-fold-search-backward (string &optional bound noerror count) + "Search backward for a char-folded version of STRING. +STRING is converted to a regexp with `char-fold-to-regexp', which is searched for with `re-search-backward'. BOUND NOERROR COUNT are passed to `re-search-backward'." (interactive "sSearch: ") - (re-search-backward (character-fold-to-regexp string) bound noerror count)) + (re-search-backward (char-fold-to-regexp string) bound noerror count)) -(provide 'character-fold) +(provide 'char-fold) -;;; character-fold.el ends here +;;; char-fold.el ends here diff --git a/lisp/isearch.el b/lisp/isearch.el index 418d9ea273a..e4de0b627e3 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -222,7 +222,7 @@ It is nil if none yet.") Default value, nil, means edit the string instead." :type 'boolean) -(autoload 'character-fold-to-regexp "character-fold") +(autoload 'char-fold-to-regexp "char-fold") (defcustom search-default-mode nil "Default mode to use when starting isearch. @@ -236,7 +236,7 @@ isearch). If a function, use that function as an `isearch-regexp-function'. Example functions (and the keys to toggle them during isearch) are `word-search-regexp' \(`\\[isearch-toggle-word]'), `isearch-symbol-regexp' -\(`\\[isearch-toggle-symbol]'), and `character-fold-to-regexp' \(`\\[isearch-toggle-character-fold]')." +\(`\\[isearch-toggle-symbol]'), and `char-fold-to-regexp' \(`\\[isearch-toggle-char-fold]')." ;; :type is set below by `isearch-define-mode-toggle'. :type '(choice (const :tag "Literal search" nil) (const :tag "Regexp search" t) @@ -718,7 +718,7 @@ Type \\[isearch-toggle-invisible] to toggle search in invisible text. Type \\[isearch-toggle-regexp] to toggle regular-expression mode. Type \\[isearch-toggle-word] to toggle word mode. Type \\[isearch-toggle-symbol] to toggle symbol mode. -Type \\[isearch-toggle-character-fold] to toggle character folding. +Type \\[isearch-toggle-char-fold] to toggle character folding. Type \\[isearch-toggle-lax-whitespace] to toggle whitespace matching. In incremental searches, a space or spaces normally matches any whitespace @@ -1546,9 +1546,9 @@ The command then executes BODY and updates the isearch prompt." Turning on word search turns off regexp mode.") (isearch-define-mode-toggle symbol "_" isearch-symbol-regexp "\ Turning on symbol search turns off regexp mode.") -(isearch-define-mode-toggle character-fold "'" character-fold-to-regexp "\ +(isearch-define-mode-toggle char-fold "'" char-fold-to-regexp "\ Turning on character-folding turns off regexp mode.") -(put 'character-fold-to-regexp 'isearch-message-prefix "char-fold ") +(put 'char-fold-to-regexp 'isearch-message-prefix "char-fold ") (isearch-define-mode-toggle regexp "r" nil nil (setq isearch-regexp (not isearch-regexp)) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 6571a4b9d4f..640395e8d7d 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -1257,7 +1257,7 @@ mail status in mode line")) (defvar menu-bar-search-options-menu (let ((menu (make-sparse-keymap "Search Options"))) - (dolist (x '((character-fold-to-regexp "Fold Characters" "Character folding") + (dolist (x '((char-fold-to-regexp "Fold Characters" "Character folding") (isearch-symbol-regexp "Whole Symbols" "Whole symbol") (word-search-regexp "Whole Words" "Whole word"))) (bindings--define-key menu (vector (nth 0 x)) diff --git a/lisp/replace.el b/lisp/replace.el index 26e5875dc08..fe90062cc8a 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -33,7 +33,7 @@ :type 'boolean :group 'matching) -(defcustom replace-character-fold nil +(defcustom replace-char-fold nil "Non-nil means replacement commands should do character folding in matches. This means, for instance, that \\=' will match a large variety of unicode quotes. @@ -324,7 +324,7 @@ If `replace-lax-whitespace' is non-nil, a space or spaces in the string to be replaced will match a sequence of whitespace chars defined by the regexp in `search-whitespace-regexp'. -If `replace-character-fold' is non-nil, matching uses character folding, +If `replace-char-fold' is non-nil, matching uses character folding, i.e. it ignores diacritics and other differences between equivalent character strings. @@ -383,7 +383,7 @@ If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp to be replaced will match a sequence of whitespace chars defined by the regexp in `search-whitespace-regexp'. -This function is not affected by `replace-character-fold'. +This function is not affected by `replace-char-fold'. Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace only matches surrounded by word boundaries. A negative prefix arg means @@ -474,7 +474,7 @@ If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp to be replaced will match a sequence of whitespace chars defined by the regexp in `search-whitespace-regexp'. -This function is not affected by `replace-character-fold'. +This function is not affected by `replace-char-fold'. Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace only matches that are surrounded by word boundaries. @@ -568,7 +568,7 @@ If `replace-lax-whitespace' is non-nil, a space or spaces in the string to be replaced will match a sequence of whitespace chars defined by the regexp in `search-whitespace-regexp'. -If `replace-character-fold' is non-nil, matching uses character folding, +If `replace-char-fold' is non-nil, matching uses character folding, i.e. it ignores diacritics and other differences between equivalent character strings. @@ -623,7 +623,7 @@ If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp to be replaced will match a sequence of whitespace chars defined by the regexp in `search-whitespace-regexp'. -This function is not affected by `replace-character-fold' +This function is not affected by `replace-char-fold' In Transient Mark mode, if the mark is active, operate on the contents of the region. Otherwise, operate from point to the end of the buffer's @@ -2051,9 +2051,9 @@ It is called with three arguments, as if it were ;; used after `recursive-edit' might override them. (let* ((isearch-regexp regexp-flag) (isearch-regexp-function (or delimited-flag - (and replace-character-fold + (and replace-char-fold (not regexp-flag) - #'character-fold-to-regexp))) + #'char-fold-to-regexp))) (isearch-lax-whitespace replace-lax-whitespace) (isearch-regexp-lax-whitespace diff --git a/test/automated/character-fold-tests.el b/test/automated/char-fold-tests.el similarity index 53% rename from test/automated/character-fold-tests.el rename to test/automated/char-fold-tests.el index c611217712e..485254aa6cf 100644 --- a/test/automated/character-fold-tests.el +++ b/test/automated/char-fold-tests.el @@ -1,4 +1,4 @@ -;;; character-fold-tests.el --- Tests for character-fold.el -*- lexical-binding: t; -*- +;;; char-fold-tests.el --- Tests for char-fold.el -*- lexical-binding: t; -*- ;; Copyright (C) 2013-2016 Free Software Foundation, Inc. @@ -20,42 +20,42 @@ ;;; Code: (require 'ert) -(require 'character-fold) +(require 'char-fold) -(defun character-fold--random-word (n) +(defun char-fold--random-word (n) (mapconcat (lambda (_) (string (+ 9 (random 117)))) (make-list n nil) "")) -(defun character-fold--test-search-with-contents (contents string) +(defun char-fold--test-search-with-contents (contents string) (with-temp-buffer (insert contents) (goto-char (point-min)) - (should (search-forward-regexp (character-fold-to-regexp string) nil 'noerror)) + (should (search-forward-regexp (char-fold-to-regexp string) nil 'noerror)) (goto-char (point-min)) - (should (character-fold-search-forward string nil 'noerror)) - (should (character-fold-search-backward string nil 'noerror)))) + (should (char-fold-search-forward string nil 'noerror)) + (should (char-fold-search-backward string nil 'noerror)))) -(ert-deftest character-fold--test-consistency () +(ert-deftest char-fold--test-consistency () (dotimes (n 30) - (let ((w (character-fold--random-word n))) + (let ((w (char-fold--random-word n))) ;; A folded string should always match the original string. - (character-fold--test-search-with-contents w w)))) + (char-fold--test-search-with-contents w w)))) -(ert-deftest character-fold--test-lax-whitespace () +(ert-deftest char-fold--test-lax-whitespace () (dotimes (n 40) - (let ((w1 (character-fold--random-word n)) - (w2 (character-fold--random-word n)) + (let ((w1 (char-fold--random-word n)) + (w2 (char-fold--random-word n)) (search-spaces-regexp "\\s-+")) - (character-fold--test-search-with-contents + (char-fold--test-search-with-contents (concat w1 "\s\n\s\t\f\t\n\r\t" w2) (concat w1 " " w2)) - (character-fold--test-search-with-contents + (char-fold--test-search-with-contents (concat w1 "\s\n\s\t\f\t\n\r\t" w2) (concat w1 (make-string 10 ?\s) w2))))) -(defun character-fold--test-match-exactly (string &rest strings-to-match) - (let ((re (concat "\\`" (character-fold-to-regexp string) "\\'"))) +(defun char-fold--test-match-exactly (string &rest strings-to-match) + (let ((re (concat "\\`" (char-fold-to-regexp string) "\\'"))) (dolist (it strings-to-match) (should (string-match re it))) ;; Case folding @@ -64,49 +64,49 @@ (should (string-match (upcase re) (downcase it))) (should (string-match (downcase re) (upcase it))))))) -(ert-deftest character-fold--test-some-defaults () +(ert-deftest char-fold--test-some-defaults () (dolist (it '(("ffl" . "ffl") ("ffi" . "ffi") ("fi" . "fi") ("ff" . "ff") ("ä" . "ä"))) - (character-fold--test-search-with-contents (cdr it) (car it)) - (let ((multi (char-table-extra-slot character-fold-table 0)) - (character-fold-table (make-char-table 'character-fold-table))) - (set-char-table-extra-slot character-fold-table 0 multi) - (character-fold--test-match-exactly (car it) (cdr it))))) + (char-fold--test-search-with-contents (cdr it) (car it)) + (let ((multi (char-table-extra-slot char-fold-table 0)) + (char-fold-table (make-char-table 'char-fold-table))) + (set-char-table-extra-slot char-fold-table 0 multi) + (char-fold--test-match-exactly (car it) (cdr it))))) -(ert-deftest character-fold--test-fold-to-regexp () - (let ((character-fold-table (make-char-table 'character-fold-table)) - (multi (make-char-table 'character-fold-table))) - (set-char-table-extra-slot character-fold-table 0 multi) - (aset character-fold-table ?a "xx") - (aset character-fold-table ?1 "44") - (aset character-fold-table ?\s "-!-") - (character-fold--test-match-exactly "a1a1" "xx44xx44") - (character-fold--test-match-exactly "a1 a 1" "xx44-!--!-xx-!-44") +(ert-deftest char-fold--test-fold-to-regexp () + (let ((char-fold-table (make-char-table 'char-fold-table)) + (multi (make-char-table 'char-fold-table))) + (set-char-table-extra-slot char-fold-table 0 multi) + (aset char-fold-table ?a "xx") + (aset char-fold-table ?1 "44") + (aset char-fold-table ?\s "-!-") + (char-fold--test-match-exactly "a1a1" "xx44xx44") + (char-fold--test-match-exactly "a1 a 1" "xx44-!--!-xx-!-44") (aset multi ?a '(("1" . "99") ("2" . "88") ("12" . "77"))) - (character-fold--test-match-exactly "a" "xx") - (character-fold--test-match-exactly "a1" "xx44" "99") - (character-fold--test-match-exactly "a12" "77" "xx442" "992") - (character-fold--test-match-exactly "a2" "88") + (char-fold--test-match-exactly "a" "xx") + (char-fold--test-match-exactly "a1" "xx44" "99") + (char-fold--test-match-exactly "a12" "77" "xx442" "992") + (char-fold--test-match-exactly "a2" "88") (aset multi ?1 '(("2" . "yy"))) - (character-fold--test-match-exactly "a1" "xx44" "99") - (character-fold--test-match-exactly "a12" "77" "xx442" "992") + (char-fold--test-match-exactly "a1" "xx44" "99") + (char-fold--test-match-exactly "a12" "77" "xx442" "992") ;; Support for this case is disabled. See function definition or: ;; https://lists.gnu.org/archive/html/emacs-devel/2015-11/msg02562.html - ;; (character-fold--test-match-exactly "a12" "xxyy") + ;; (char-fold--test-match-exactly "a12" "xxyy") )) -(ert-deftest character-fold--speed-test () +(ert-deftest char-fold--speed-test () (dolist (string (append '("tty-set-up-initial-frame-face" "tty-set-up-initial-frame-face-frame-faceframe-faceframe-faceframe-face") - (mapcar #'character-fold--random-word '(10 50 100 + (mapcar #'char-fold--random-word '(10 50 100 50 100)))) (message "Testing %s" string) ;; Make sure we didn't just fallback on the trivial search. (should-not (string= (regexp-quote string) - (character-fold-to-regexp string))) + (char-fold-to-regexp string))) (with-temp-buffer (save-excursion (insert string)) (let ((time (time-to-seconds (current-time)))) @@ -114,11 +114,11 @@ ;; created a lot of redundant paths in the regexp. Because of ;; that, if a really long string "almost" matches, the regexp ;; engine took a long time to realize that it doesn't match. - (should-not (character-fold-search-forward (concat string "c") nil 'noerror)) + (should-not (char-fold-search-forward (concat string "c") nil 'noerror)) ;; Ensure it took less than a second. (should (< (- (time-to-seconds (current-time)) time) 1)))))) -(provide 'character-fold-tests) -;;; character-fold-tests.el ends here +(provide 'char-fold-tests) +;;; char-fold-tests.el ends here From 3b5e38cde194c4faa3865aa437b4a2749946c24d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 18 May 2016 01:05:00 -0700 Subject: [PATCH 02/39] Modernize ASLR advice in etc/PROBLEMS * etc/PROBLEMS (Segfault during 'make'): Modernize advice for seccomp, Docker, and NetBSD (Bug#23529). --- etc/PROBLEMS | 93 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 56 insertions(+), 37 deletions(-) diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 533c4e9be8d..8733095c8d4 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -2600,51 +2600,70 @@ See , . ** Dumping -*** Segfault during 'make bootstrap' under the Linux kernel. +*** Segfault during 'make' -In Red Hat Linux kernels, "Exec-shield" functionality is enabled by -default, which creates a different memory layout that can break the -emacs dumper. Emacs tries to handle this at build time, but if this -fails, the following instructions may be useful. +If Emacs segfaults when 'make' executes one of these commands: -Exec-shield is enabled on your system if + LC_ALL=C ./temacs -batch -l loadup bootstrap + LC_ALL=C ./temacs -batch -l loadup dump + +the problem may be due to inadequate workarounds for address space +layout randomization (ASLR), an operating system feature that +randomizes the virtual address space of a process. ASLR is commonly +enabled in Linux and NetBSD kernels, and is intended to deter exploits +of pointer-related bugs in applications. If ASLR is enabled, the +command: + + cat /proc/sys/kernel/randomize_va_space # GNU/Linux + sysctl security.pax.aslr.global # NetBSD + +outputs a nonzero value. + +These segfaults should not occur on most modern systems, because the +Emacs build procedure uses the command 'setfattr' or 'paxctl' to mark +the Emacs executable as requiring non-randomized address space, and +Emacs uses the 'personality' system call to disable address space +randomization when dumping. However, older kernels may not support +'setfattr', 'paxctl', or 'personality', and newer Linux kernels have a +secure computing mode (seccomp) that can be configured to disable the +'personality' call. + +It may be possible to work around the 'personality' problem in a newer +Linux kernel by configuring seccomp to allow the 'personality' call. +For example, if you are building Emacs under Docker, you can run the +Docker container with a security profile that allows 'personality' by +using Docker's --security-opt option with an appropriate profile; see +. + +To work around the ASLR problem in either an older or a newer kernel, +you can temporarily disable the feature while building Emacs. On +GNU/Linux you can do so using the following command (as root). + + echo 0 > /proc/sys/kernel/randomize_va_space + +You can re-enable the feature when you are done, by echoing the +original value back to the file. NetBSD uses a different command, +e.g., 'sysctl -w security.pax.aslr.global=0'. + +Alternatively, you can try using the 'setarch' command when building +temacs like this, where -R disables address space randomization: + + setarch $(uname -m) -R make + +ASLR is not the only problem that can break Emacs dumping. Another +issue is that in Red Hat Linux kernels, Exec-shield is enabled by +default, and this creates a different memory layout. Emacs should +handle this at build time, but if this fails the following +instructions may be useful. Exec-shield is enabled on your system if cat /proc/sys/kernel/exec-shield -prints a value other than 0. (Please read your system documentation -for more details on Exec-shield and associated commands.) - -Additionally, Linux kernel versions since 2.6.12 randomize the virtual -address space of a process by default. If this feature is enabled on -your system, then - - cat /proc/sys/kernel/randomize_va_space - -prints a value other than 0. - -When these features are enabled, building Emacs may segfault during -the execution of this command: - - ./temacs --batch --load loadup [dump|bootstrap] - -To work around this problem, you can temporarily disable these -features while building Emacs. You can do so using the following -commands (as root). Remember to re-enable them when you are done, -by echoing the original values back to the files. +prints a nonzero value. You can temporarily disable it as follows: echo 0 > /proc/sys/kernel/exec-shield - echo 0 > /proc/sys/kernel/randomize_va_space -Or, on x86, you can try using the 'setarch' command when running -temacs, like this: - - setarch i386 -R ./temacs --batch --load loadup [dump|bootstrap] - -or - - setarch i386 -R make - -(The -R option disables address space randomization.) +As with randomize_va_space, you can re-enable Exec-shield when you are +done, by echoing the original value back to the file. *** temacs prints "Pure Lisp storage exhausted". From c45d9f61f7ecf77baf73e16985e484c0b2299401 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 18 May 2016 22:50:45 +0300 Subject: [PATCH 03/39] Improve documentation of 'server-name' * doc/emacs/misc.texi (Emacs Server): Fix example of setting 'server-name'. Mention how to do that with daemon sessions. (Bug#23576) --- doc/emacs/misc.texi | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index af2b6acd8a4..497a4abd71b 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -1596,10 +1596,17 @@ variable to @samp{emacsclient +%d %s}.} You can run multiple Emacs servers on the same machine by giving each one a unique @dfn{server name}, using the variable @code{server-name}. For example, @kbd{M-x set-variable @key{RET} -server-name @key{RET} foo @key{RET}} sets the server name to +server-name @key{RET} "foo" @key{RET}} sets the server name to @samp{foo}. The @code{emacsclient} program can specify a server by name, using the @samp{-s} option (@pxref{emacsclient Options}). + If you want to run multiple Emacs daemons (@pxref{Initial Options}), +you can give each daemon its own server name like this: + +@example + emacs --eval "(setq server-name \"foo\")" --daemon +@end example + @findex server-eval-at If you have defined a server by a unique server name, it is possible to connect to the server from another Emacs instance and evaluate Lisp From 6e7129551ca2ff67732549ae8b1b43276c410c95 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Wed, 18 May 2016 17:58:56 -0300 Subject: [PATCH 04/39] * lisp/emacs-lisp/package.el (package--with-response-buffer): Fix some macro locals leaking into body. (Bug#22440) * test/automated/package-test.el (package-test-signed): Manually check all possible values of `package-check-signature'. --- lisp/emacs-lisp/package.el | 37 +++++++++++++++++++--------------- test/automated/package-test.el | 11 ++++++++-- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 58973dfa920..aa18c2d30bc 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1154,6 +1154,8 @@ errors signaled by ERROR-FORM or by BODY). (while (keywordp (car body)) (setq body (cdr (cdr body)))) (macroexp-let2* nil ((url-1 url) + (url-sym (make-symbol "url")) + (b-sym (make-symbol "b-sym")) (noerror-1 noerror)) `(cl-macrolet ((unless-error (body-2 &rest before-body) (let ((err (make-symbol "err"))) @@ -1165,23 +1167,26 @@ errors signaled by ERROR-FORM or by BODY). `(signal (car ,err) (cdr ,err))))) ,@body-2))))) (if (string-match-p "\\`https?:" ,url-1) - (let* ((url (concat ,url-1 ,file)) - (callback (lambda (status) - (let ((b (current-buffer))) - (require 'url-handlers) - (unless-error ,body - (when-let ((er (plist-get status :error))) - (error "Error retrieving: %s %S" url er)) - (with-current-buffer b - (goto-char (point-min)) - (unless (search-forward-regexp "^\r?\n\r?" nil 'noerror) - (error "Error retrieving: %s %S" url "incomprehensible buffer"))) - (url-insert-buffer-contents b url) - (kill-buffer b) - (goto-char (point-min))))))) + (let ((,url-sym (concat ,url-1 ,file))) (if ,async - (unless-error nil (url-retrieve url callback nil 'silent)) - (unless-error ,body (url-insert-file-contents url)))) + (unless-error nil + (url-retrieve ,url-sym + (lambda (status) + (let ((,b-sym (current-buffer))) + (require 'url-handlers) + (unless-error ,body + (when-let ((er (plist-get status :error))) + (error "Error retrieving: %s %S" ,url-sym er)) + (with-current-buffer ,b-sym + (goto-char (point-min)) + (unless (search-forward-regexp "^\r?\n\r?" nil 'noerror) + (error "Error retrieving: %s %S" ,url-sym "incomprehensible buffer"))) + (url-insert-buffer-contents ,b-sym ,url-sym) + (kill-buffer ,b-sym) + (goto-char (point-min))))) + nil + 'silent)) + (unless-error ,body (url-insert-file-contents ,url-sym)))) (unless-error ,body (let ((url (expand-file-name ,file ,url-1))) (unless (file-name-absolute-p url) diff --git a/test/automated/package-test.el b/test/automated/package-test.el index 55806454741..c4c856f3031 100644 --- a/test/automated/package-test.el +++ b/test/automated/package-test.el @@ -475,8 +475,15 @@ Must called from within a `tar-mode' buffer." (package-initialize) (package-import-keyring keyring) (package-refresh-contents) - (should (package-install 'signed-good)) - (should-error (package-install 'signed-bad)) + (let ((package-check-signature 'allow-unsigned)) + (should (package-install 'signed-good)) + (should-error (package-install 'signed-bad))) + (let ((package-check-signature t)) + (should (package-install 'signed-good)) + (should-error (package-install 'signed-bad))) + (let ((package-check-signature nil)) + (should (package-install 'signed-good)) + (should (package-install 'signed-bad))) ;; Check if the installed package status is updated. (let ((buf (package-list-packages))) (package-menu-refresh) From ebc3a94e27ec9dcbe24790795741c062bed2c1a0 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Wed, 18 May 2016 20:09:24 -0300 Subject: [PATCH 05/39] * lisp/emacs-lisp/package.el: Fix free variable warnings. (package--with-response-buffer): Replace two usages of `macroexp-let2*' with `let'. --- lisp/emacs-lisp/package.el | 74 +++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index aa18c2d30bc..8f309cb798f 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1154,44 +1154,44 @@ errors signaled by ERROR-FORM or by BODY). (while (keywordp (car body)) (setq body (cdr (cdr body)))) (macroexp-let2* nil ((url-1 url) - (url-sym (make-symbol "url")) - (b-sym (make-symbol "b-sym")) (noerror-1 noerror)) - `(cl-macrolet ((unless-error (body-2 &rest before-body) - (let ((err (make-symbol "err"))) - `(with-temp-buffer - (when (condition-case ,err - (progn ,@before-body t) - ,(list 'error ',error-form - (list 'unless ',noerror-1 - `(signal (car ,err) (cdr ,err))))) - ,@body-2))))) - (if (string-match-p "\\`https?:" ,url-1) - (let ((,url-sym (concat ,url-1 ,file))) - (if ,async - (unless-error nil - (url-retrieve ,url-sym - (lambda (status) - (let ((,b-sym (current-buffer))) - (require 'url-handlers) - (unless-error ,body - (when-let ((er (plist-get status :error))) - (error "Error retrieving: %s %S" ,url-sym er)) - (with-current-buffer ,b-sym - (goto-char (point-min)) - (unless (search-forward-regexp "^\r?\n\r?" nil 'noerror) - (error "Error retrieving: %s %S" ,url-sym "incomprehensible buffer"))) - (url-insert-buffer-contents ,b-sym ,url-sym) - (kill-buffer ,b-sym) - (goto-char (point-min))))) - nil - 'silent)) - (unless-error ,body (url-insert-file-contents ,url-sym)))) - (unless-error ,body - (let ((url (expand-file-name ,file ,url-1))) - (unless (file-name-absolute-p url) - (error "Location %s is not a url nor an absolute file name" url)) - (insert-file-contents url))))))) + (let ((url-sym (make-symbol "url")) + (b-sym (make-symbol "b-sym"))) + `(cl-macrolet ((unless-error (body-2 &rest before-body) + (let ((err (make-symbol "err"))) + `(with-temp-buffer + (when (condition-case ,err + (progn ,@before-body t) + ,(list 'error ',error-form + (list 'unless ',noerror-1 + `(signal (car ,err) (cdr ,err))))) + ,@body-2))))) + (if (string-match-p "\\`https?:" ,url-1) + (let ((,url-sym (concat ,url-1 ,file))) + (if ,async + (unless-error nil + (url-retrieve ,url-sym + (lambda (status) + (let ((,b-sym (current-buffer))) + (require 'url-handlers) + (unless-error ,body + (when-let ((er (plist-get status :error))) + (error "Error retrieving: %s %S" ,url-sym er)) + (with-current-buffer ,b-sym + (goto-char (point-min)) + (unless (search-forward-regexp "^\r?\n\r?" nil 'noerror) + (error "Error retrieving: %s %S" ,url-sym "incomprehensible buffer"))) + (url-insert-buffer-contents ,b-sym ,url-sym) + (kill-buffer ,b-sym) + (goto-char (point-min))))) + nil + 'silent)) + (unless-error ,body (url-insert-file-contents ,url-sym)))) + (unless-error ,body + (let ((url (expand-file-name ,file ,url-1))) + (unless (file-name-absolute-p url) + (error "Location %s is not a url nor an absolute file name" url)) + (insert-file-contents url)))))))) (define-error 'bad-signature "Failed to verify signature") From d4ae6d7033b34e8b75c59aaf1584131e439ef2d5 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Thu, 19 May 2016 18:05:19 +0900 Subject: [PATCH 06/39] epg: Add a way to detect gpg1 executable for tests Fixes bug#23561. * test/automated/epg-tests.el (epg-tests-program-alist-for-passphrase-callback): New constant. (epg-tests-find-usable-gpg-configuration): New function, renamed from `epg-tests-gpg-usable'. All callers changed. (epg-tests-gpg-usable): Remove. * lisp/epg-config.el (epg-config--program-alist): Factor out constructor element to... (epg-config--configuration-constructor-alist): ...here. (epg-find-configuration): Rename FORCE argument to NO-CACHE, and add PROGRAM-ALIST argument. --- lisp/epg-config.el | 80 +++++++++++++++++++++---------------- test/automated/epg-tests.el | 42 ++++++++++--------- 2 files changed, 70 insertions(+), 52 deletions(-) diff --git a/lisp/epg-config.el b/lisp/epg-config.el index 8a208044cba..9179e04dcc1 100644 --- a/lisp/epg-config.el +++ b/lisp/epg-config.el @@ -81,57 +81,69 @@ Note that the buffer name starts with a space." (defconst epg-config--program-alist '((OpenPGP epg-gpg-program - epg-config--make-gpg-configuration ("gpg2" . "2.1.6") ("gpg" . "1.4.3")) (CMS epg-gpgsm-program - epg-config--make-gpgsm-configuration ("gpgsm" . "2.0.4"))) "Alist used to obtain the usable configuration of executables. The first element of each entry is protocol symbol, which is either `OpenPGP' or `CMS'. The second element is a symbol where -the executable name is remembered. The third element is a -function which constructs a configuration object (actually a -plist). The rest of the entry is an alist mapping executable -names to the minimum required version suitable for the use with -Emacs.") +the executable name is remembered. The rest of the entry is an +alist mapping executable names to the minimum required version +suitable for the use with Emacs.") + +(defconst epg-config--configuration-constructor-alist + '((OpenPGP . epg-config--make-gpg-configuration) + (CMS . epg-config--make-gpgsm-configuration)) + "Alist used to obtain the usable configuration of executables. +The first element of each entry is protocol symbol, which is +either `OpenPGP' or `CMS'. The second element is a function +which constructs a configuration object (actually a plist).") (defvar epg--configurations nil) ;;;###autoload -(defun epg-find-configuration (protocol &optional force) +(defun epg-find-configuration (protocol &optional no-cache program-alist) "Find or create a usable configuration to handle PROTOCOL. This function first looks at the existing configuration found by -the previous invocation of this function, unless FORCE is non-nil. +the previous invocation of this function, unless NO-CACHE is non-nil. -Then it walks through `epg-config--program-alist'. If -`epg-gpg-program' or `epg-gpgsm-program' is already set with -custom, use it. Otherwise, it tries the programs listed in the -entry until the version requirement is met." - (let ((entry (assq protocol epg-config--program-alist))) +Then it walks through PROGRAM-ALIST or +`epg-config--program-alist'. If `epg-gpg-program' or +`epg-gpgsm-program' is already set with custom, use it. +Otherwise, it tries the programs listed in the entry until the +version requirement is met." + (unless program-alist + (setq program-alist epg-config--program-alist)) + (let ((entry (assq protocol program-alist))) (unless entry (error "Unknown protocol %S" protocol)) - (cl-destructuring-bind (symbol constructor . alist) + (cl-destructuring-bind (symbol . alist) (cdr entry) - (or (and (not force) (alist-get protocol epg--configurations)) - ;; If the executable value is already set with M-x - ;; customize, use it without checking. - (if (get symbol 'saved-value) - (let ((configuration (funcall constructor (symbol-value symbol)))) - (push (cons protocol configuration) epg--configurations) - configuration) - (catch 'found - (dolist (program-version alist) - (let ((executable (executable-find (car program-version)))) - (when executable - (let ((configuration - (funcall constructor executable))) - (when (ignore-errors - (epg-check-configuration configuration - (cdr program-version)) - t) - (push (cons protocol configuration) epg--configurations) - (throw 'found configuration)))))))))))) + (let ((constructor + (alist-get protocol epg-config--configuration-constructor-alist))) + (or (and (not no-cache) (alist-get protocol epg--configurations)) + ;; If the executable value is already set with M-x + ;; customize, use it without checking. + (if (and symbol (get symbol 'saved-value)) + (let ((configuration + (funcall constructor (symbol-value symbol)))) + (push (cons protocol configuration) epg--configurations) + configuration) + (catch 'found + (dolist (program-version alist) + (let ((executable (executable-find (car program-version)))) + (when executable + (let ((configuration + (funcall constructor executable))) + (when (ignore-errors + (epg-check-configuration configuration + (cdr program-version)) + t) + (unless no-cache + (push (cons protocol configuration) + epg--configurations)) + (throw 'found configuration))))))))))))) ;; Create an `epg-configuration' object for `gpg', using PROGRAM. (defun epg-config--make-gpg-configuration (program) diff --git a/test/automated/epg-tests.el b/test/automated/epg-tests.el index 4a317974ef5..d51ab23f71e 100644 --- a/test/automated/epg-tests.el +++ b/test/automated/epg-tests.el @@ -30,16 +30,17 @@ (expand-file-name "data/epg" (getenv "EMACS_TEST_DIRECTORY")) "Directory containing epg test data.") -(defun epg-tests-gpg-usable (&optional require-passphrase) - (and (executable-find epg-gpg-program) - (condition-case nil - (progn - (epg-check-configuration (epg-configuration)) - (if require-passphrase - (string-match "\\`1\\." - (cdr (assq 'version (epg-configuration)))) - t)) - (error nil)))) +(defconst epg-tests-program-alist-for-passphrase-callback + '((OpenPGP + nil + ("gpg" . "1.4.3")))) + +(defun epg-tests-find-usable-gpg-configuration (&optional require-passphrase) + (epg-find-configuration + 'OpenPGP + 'no-cache + (if require-passphrase + epg-tests-program-alist-for-passphrase-callback))) (defun epg-tests-passphrase-callback (_c _k _d) ;; Need to create a copy here, since the string will be wiped out @@ -52,9 +53,14 @@ &rest body) "Set up temporary locations and variables for testing." (declare (indent 1)) - `(let* ((epg-tests-home-directory (make-temp-file "epg-tests-homedir" t))) + `(let ((epg-tests-home-directory (make-temp-file "epg-tests-homedir" t))) (unwind-protect (let ((context (epg-make-context 'OpenPGP))) + (setf (epg-context-program context) + (alist-get 'program + (epg-tests-find-usable-gpg-configuration + ,(if require-passphrase + `'require-passphrase)))) (setf (epg-context-home-directory context) epg-tests-home-directory) (setenv "GPG_AGENT_INFO") @@ -78,7 +84,7 @@ (delete-directory epg-tests-home-directory t))))) (ert-deftest epg-decrypt-1 () - (skip-unless (epg-tests-gpg-usable 'require-passphrase)) + (skip-unless (epg-tests-find-usable-gpg-configuration 'require-passphrase)) (with-epg-tests (:require-passphrase t) (should (equal "test" (epg-decrypt-string epg-tests-context "\ @@ -90,14 +96,14 @@ jA0EAwMCE19JBLTvvmhgyRrGGglRbnKkK9PJG8fDwO5ccjysrR7IcdNcnA== -----END PGP MESSAGE-----"))))) (ert-deftest epg-roundtrip-1 () - (skip-unless (epg-tests-gpg-usable 'require-passphrase)) + (skip-unless (epg-tests-find-usable-gpg-configuration 'require-passphrase)) (with-epg-tests (:require-passphrase t) (let ((cipher (epg-encrypt-string epg-tests-context "symmetric" nil))) (should (equal "symmetric" (epg-decrypt-string epg-tests-context cipher)))))) (ert-deftest epg-roundtrip-2 () - (skip-unless (epg-tests-gpg-usable 'require-passphrase)) + (skip-unless (epg-tests-find-usable-gpg-configuration 'require-passphrase)) (with-epg-tests (:require-passphrase t :require-public-key t :require-secret-key t) @@ -108,7 +114,7 @@ jA0EAwMCE19JBLTvvmhgyRrGGglRbnKkK9PJG8fDwO5ccjysrR7IcdNcnA== (epg-decrypt-string epg-tests-context cipher)))))) (ert-deftest epg-sign-verify-1 () - (skip-unless (epg-tests-gpg-usable 'require-passphrase)) + (skip-unless (epg-tests-find-usable-gpg-configuration 'require-passphrase)) (with-epg-tests (:require-passphrase t :require-public-key t :require-secret-key t) @@ -122,7 +128,7 @@ jA0EAwMCE19JBLTvvmhgyRrGGglRbnKkK9PJG8fDwO5ccjysrR7IcdNcnA== (should (eq 'good (epg-signature-status (car verify-result))))))) (ert-deftest epg-sign-verify-2 () - (skip-unless (epg-tests-gpg-usable 'require-passphrase)) + (skip-unless (epg-tests-find-usable-gpg-configuration 'require-passphrase)) (with-epg-tests (:require-passphrase t :require-public-key t :require-secret-key t) @@ -138,7 +144,7 @@ jA0EAwMCE19JBLTvvmhgyRrGGglRbnKkK9PJG8fDwO5ccjysrR7IcdNcnA== (should (eq 'good (epg-signature-status (car verify-result))))))) (ert-deftest epg-sign-verify-3 () - (skip-unless (epg-tests-gpg-usable 'require-passphrase)) + (skip-unless (epg-tests-find-usable-gpg-configuration 'require-passphrase)) (with-epg-tests (:require-passphrase t :require-public-key t :require-secret-key t) @@ -153,7 +159,7 @@ jA0EAwMCE19JBLTvvmhgyRrGGglRbnKkK9PJG8fDwO5ccjysrR7IcdNcnA== (should (eq 'good (epg-signature-status (car verify-result))))))) (ert-deftest epg-import-1 () - (skip-unless (epg-tests-gpg-usable 'require-passphrase)) + (skip-unless (epg-tests-find-usable-gpg-configuration 'require-passphrase)) (with-epg-tests (:require-passphrase nil) (should (= 0 (length (epg-list-keys epg-tests-context)))) (should (= 0 (length (epg-list-keys epg-tests-context nil t))))) From e41a5cbae9d208a191884e634f77ab6ccc990e64 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 19 May 2016 22:57:53 +0300 Subject: [PATCH 07/39] Avoid errors with Czech and Slovak input methods * lisp/leim/quail/slovak.el (slovak, slovak-prog-1, slovak-prog-2) (slovak-prog-3): Remove the kp-* key bindings, they are not needed and cause errors in "C-u C-x =". * lisp/leim/quail/czech.el (czech, czech-qwerty, czech-prog-1) (czech-prog-2, czech-prog-3): Remove the kp-* key bindings. (Bug#23559) --- lisp/leim/quail/czech.el | 65 +++------------------------------------ lisp/leim/quail/slovak.el | 52 +++---------------------------- 2 files changed, 9 insertions(+), 108 deletions(-) diff --git a/lisp/leim/quail/czech.el b/lisp/leim/quail/czech.el index 365c3c51059..ddb4af53db3 100644 --- a/lisp/leim/quail/czech.el +++ b/lisp/leim/quail/czech.el @@ -142,18 +142,7 @@ ("=[" ?\[) ("=]" ?\]) ("={" ?{) - ("=}" ?}) - ([kp-1] ?1) - ([kp-2] ?2) - ([kp-3] ?3) - ([kp-4] ?4) - ([kp-5] ?5) - ([kp-6] ?6) - ([kp-7] ?7) - ([kp-8] ?8) - ([kp-9] ?9) - ([kp-0] ?0) - ([kp-add] ?+)) + ("=}" ?})) (quail-define-package "czech-qwerty" "Czech" "CZ" t @@ -260,18 +249,7 @@ ("=[" ?\[) ("=]" ?\]) ("={" ?{) - ("=}" ?}) - ([kp-1] ?1) - ([kp-2] ?2) - ([kp-3] ?3) - ([kp-4] ?4) - ([kp-5] ?5) - ([kp-6] ?6) - ([kp-7] ?7) - ([kp-8] ?8) - ([kp-9] ?9) - ([kp-0] ?0) - ([kp-add] ?+)) + ("=}" ?})) (quail-define-package "czech-prog-1" "Czech" "CZ" t @@ -350,18 +328,7 @@ All other keys are the same as on standard US keyboard." ("++U" ?Ů) ("+++U" ?Ü) ("+Y" ?Ý) - ("+Z" ?Ž) - ([kp-1] ?1) - ([kp-2] ?2) - ([kp-3] ?3) - ([kp-4] ?4) - ([kp-5] ?5) - ([kp-6] ?6) - ([kp-7] ?7) - ([kp-8] ?8) - ([kp-9] ?9) - ([kp-0] ?0) - ([kp-add] ?+)) + ("+Z" ?Ž)) (quail-define-package "czech-prog-2" "Czech" "CZ" t @@ -440,18 +407,7 @@ All other keys are the same as on standard US keyboard." ("++U" ?Ů) ("+++U" ?Ü) ("+Y" ?Ý) - ("+Z" ?Ž) - ([kp-1] ?1) - ([kp-2] ?2) - ([kp-3] ?3) - ([kp-4] ?4) - ([kp-5] ?5) - ([kp-6] ?6) - ([kp-7] ?7) - ([kp-8] ?8) - ([kp-9] ?9) - ([kp-0] ?0) - ([kp-add] ?+)) + ("+Z" ?Ž)) (quail-define-package "czech-prog-3" "Czech" "CZ" t @@ -552,17 +508,6 @@ All other keys are the same as on standard US keyboard." ("+u" ?ů) ("+=u" ?ü) ("=y" ?ý) - ("+z" ?ž) - ([kp-1] ?1) - ([kp-2] ?2) - ([kp-3] ?3) - ([kp-4] ?4) - ([kp-5] ?5) - ([kp-6] ?6) - ([kp-7] ?7) - ([kp-8] ?8) - ([kp-9] ?9) - ([kp-0] ?0) - ([kp-add] ?+)) + ("+z" ?ž)) ;;; czech.el ends here diff --git a/lisp/leim/quail/slovak.el b/lisp/leim/quail/slovak.el index 4294fd7613b..e00f03fa1f6 100644 --- a/lisp/leim/quail/slovak.el +++ b/lisp/leim/quail/slovak.el @@ -151,18 +151,7 @@ ("+7" ?&) ("+8" ?*) ("+9" ?\() - ("+0" ?\)) - ([kp-1] ?1) - ([kp-2] ?2) - ([kp-3] ?3) - ([kp-4] ?4) - ([kp-5] ?5) - ([kp-6] ?6) - ([kp-7] ?7) - ([kp-8] ?8) - ([kp-9] ?9) - ([kp-0] ?0) - ([kp-add] ?+)) + ("+0" ?\))) (quail-define-package @@ -245,18 +234,7 @@ All other keys are the same as on standard US keyboard." ("[[[U" ?Ü) ("[Y" ?Ý) ("[Z" ?Ž) - ("[[Z" ?Ž) - ([kp-1] ?1) - ([kp-2] ?2) - ([kp-3] ?3) - ([kp-4] ?4) - ([kp-5] ?5) - ([kp-6] ?6) - ([kp-7] ?7) - ([kp-8] ?8) - ([kp-9] ?9) - ([kp-0] ?0) - ([kp-add] ?+)) + ("[[Z" ?Ž)) (quail-define-package @@ -347,18 +325,7 @@ All other keys are the same as on standard US keyboard." ("+U" ?Ů) ("+=U" ?Ü) ("=Y" ?Ý) - ("+Z" ?Ž) - ([kp-1] ?1) - ([kp-2] ?2) - ([kp-3] ?3) - ([kp-4] ?4) - ([kp-5] ?5) - ([kp-6] ?6) - ([kp-7] ?7) - ([kp-8] ?8) - ([kp-9] ?9) - ([kp-0] ?0) - ([kp-add] ?+)) + ("+Z" ?Ž)) (quail-define-package @@ -463,17 +430,6 @@ All other keys are the same as on standard US keyboard." ("[Y" ?Ý) ("[Z" ?Ž) ("[[Z" ?Ž) - ("]Z" ?Ž) - ([kp-1] ?1) - ([kp-2] ?2) - ([kp-3] ?3) - ([kp-4] ?4) - ([kp-5] ?5) - ([kp-6] ?6) - ([kp-7] ?7) - ([kp-8] ?8) - ([kp-9] ?9) - ([kp-0] ?0) - ([kp-add] ?+)) + ("]Z" ?Ž)) ;;; slovak.el ends here From dadfc30dae9529282a05720155d4aa1c5bd749b1 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Fri, 20 May 2016 19:34:06 +0900 Subject: [PATCH 08/39] Revert "epg: Add a way to detect gpg1 executable for tests" This reverts commit d4ae6d7033b34e8b75c59aaf1584131e439ef2d5. --- lisp/epg-config.el | 80 ++++++++++++++++--------------------- test/automated/epg-tests.el | 42 +++++++++---------- 2 files changed, 52 insertions(+), 70 deletions(-) diff --git a/lisp/epg-config.el b/lisp/epg-config.el index 9179e04dcc1..8a208044cba 100644 --- a/lisp/epg-config.el +++ b/lisp/epg-config.el @@ -81,69 +81,57 @@ Note that the buffer name starts with a space." (defconst epg-config--program-alist '((OpenPGP epg-gpg-program + epg-config--make-gpg-configuration ("gpg2" . "2.1.6") ("gpg" . "1.4.3")) (CMS epg-gpgsm-program + epg-config--make-gpgsm-configuration ("gpgsm" . "2.0.4"))) "Alist used to obtain the usable configuration of executables. The first element of each entry is protocol symbol, which is either `OpenPGP' or `CMS'. The second element is a symbol where -the executable name is remembered. The rest of the entry is an -alist mapping executable names to the minimum required version -suitable for the use with Emacs.") - -(defconst epg-config--configuration-constructor-alist - '((OpenPGP . epg-config--make-gpg-configuration) - (CMS . epg-config--make-gpgsm-configuration)) - "Alist used to obtain the usable configuration of executables. -The first element of each entry is protocol symbol, which is -either `OpenPGP' or `CMS'. The second element is a function -which constructs a configuration object (actually a plist).") +the executable name is remembered. The third element is a +function which constructs a configuration object (actually a +plist). The rest of the entry is an alist mapping executable +names to the minimum required version suitable for the use with +Emacs.") (defvar epg--configurations nil) ;;;###autoload -(defun epg-find-configuration (protocol &optional no-cache program-alist) +(defun epg-find-configuration (protocol &optional force) "Find or create a usable configuration to handle PROTOCOL. This function first looks at the existing configuration found by -the previous invocation of this function, unless NO-CACHE is non-nil. +the previous invocation of this function, unless FORCE is non-nil. -Then it walks through PROGRAM-ALIST or -`epg-config--program-alist'. If `epg-gpg-program' or -`epg-gpgsm-program' is already set with custom, use it. -Otherwise, it tries the programs listed in the entry until the -version requirement is met." - (unless program-alist - (setq program-alist epg-config--program-alist)) - (let ((entry (assq protocol program-alist))) +Then it walks through `epg-config--program-alist'. If +`epg-gpg-program' or `epg-gpgsm-program' is already set with +custom, use it. Otherwise, it tries the programs listed in the +entry until the version requirement is met." + (let ((entry (assq protocol epg-config--program-alist))) (unless entry (error "Unknown protocol %S" protocol)) - (cl-destructuring-bind (symbol . alist) + (cl-destructuring-bind (symbol constructor . alist) (cdr entry) - (let ((constructor - (alist-get protocol epg-config--configuration-constructor-alist))) - (or (and (not no-cache) (alist-get protocol epg--configurations)) - ;; If the executable value is already set with M-x - ;; customize, use it without checking. - (if (and symbol (get symbol 'saved-value)) - (let ((configuration - (funcall constructor (symbol-value symbol)))) - (push (cons protocol configuration) epg--configurations) - configuration) - (catch 'found - (dolist (program-version alist) - (let ((executable (executable-find (car program-version)))) - (when executable - (let ((configuration - (funcall constructor executable))) - (when (ignore-errors - (epg-check-configuration configuration - (cdr program-version)) - t) - (unless no-cache - (push (cons protocol configuration) - epg--configurations)) - (throw 'found configuration))))))))))))) + (or (and (not force) (alist-get protocol epg--configurations)) + ;; If the executable value is already set with M-x + ;; customize, use it without checking. + (if (get symbol 'saved-value) + (let ((configuration (funcall constructor (symbol-value symbol)))) + (push (cons protocol configuration) epg--configurations) + configuration) + (catch 'found + (dolist (program-version alist) + (let ((executable (executable-find (car program-version)))) + (when executable + (let ((configuration + (funcall constructor executable))) + (when (ignore-errors + (epg-check-configuration configuration + (cdr program-version)) + t) + (push (cons protocol configuration) epg--configurations) + (throw 'found configuration)))))))))))) ;; Create an `epg-configuration' object for `gpg', using PROGRAM. (defun epg-config--make-gpg-configuration (program) diff --git a/test/automated/epg-tests.el b/test/automated/epg-tests.el index d51ab23f71e..4a317974ef5 100644 --- a/test/automated/epg-tests.el +++ b/test/automated/epg-tests.el @@ -30,17 +30,16 @@ (expand-file-name "data/epg" (getenv "EMACS_TEST_DIRECTORY")) "Directory containing epg test data.") -(defconst epg-tests-program-alist-for-passphrase-callback - '((OpenPGP - nil - ("gpg" . "1.4.3")))) - -(defun epg-tests-find-usable-gpg-configuration (&optional require-passphrase) - (epg-find-configuration - 'OpenPGP - 'no-cache - (if require-passphrase - epg-tests-program-alist-for-passphrase-callback))) +(defun epg-tests-gpg-usable (&optional require-passphrase) + (and (executable-find epg-gpg-program) + (condition-case nil + (progn + (epg-check-configuration (epg-configuration)) + (if require-passphrase + (string-match "\\`1\\." + (cdr (assq 'version (epg-configuration)))) + t)) + (error nil)))) (defun epg-tests-passphrase-callback (_c _k _d) ;; Need to create a copy here, since the string will be wiped out @@ -53,14 +52,9 @@ &rest body) "Set up temporary locations and variables for testing." (declare (indent 1)) - `(let ((epg-tests-home-directory (make-temp-file "epg-tests-homedir" t))) + `(let* ((epg-tests-home-directory (make-temp-file "epg-tests-homedir" t))) (unwind-protect (let ((context (epg-make-context 'OpenPGP))) - (setf (epg-context-program context) - (alist-get 'program - (epg-tests-find-usable-gpg-configuration - ,(if require-passphrase - `'require-passphrase)))) (setf (epg-context-home-directory context) epg-tests-home-directory) (setenv "GPG_AGENT_INFO") @@ -84,7 +78,7 @@ (delete-directory epg-tests-home-directory t))))) (ert-deftest epg-decrypt-1 () - (skip-unless (epg-tests-find-usable-gpg-configuration 'require-passphrase)) + (skip-unless (epg-tests-gpg-usable 'require-passphrase)) (with-epg-tests (:require-passphrase t) (should (equal "test" (epg-decrypt-string epg-tests-context "\ @@ -96,14 +90,14 @@ jA0EAwMCE19JBLTvvmhgyRrGGglRbnKkK9PJG8fDwO5ccjysrR7IcdNcnA== -----END PGP MESSAGE-----"))))) (ert-deftest epg-roundtrip-1 () - (skip-unless (epg-tests-find-usable-gpg-configuration 'require-passphrase)) + (skip-unless (epg-tests-gpg-usable 'require-passphrase)) (with-epg-tests (:require-passphrase t) (let ((cipher (epg-encrypt-string epg-tests-context "symmetric" nil))) (should (equal "symmetric" (epg-decrypt-string epg-tests-context cipher)))))) (ert-deftest epg-roundtrip-2 () - (skip-unless (epg-tests-find-usable-gpg-configuration 'require-passphrase)) + (skip-unless (epg-tests-gpg-usable 'require-passphrase)) (with-epg-tests (:require-passphrase t :require-public-key t :require-secret-key t) @@ -114,7 +108,7 @@ jA0EAwMCE19JBLTvvmhgyRrGGglRbnKkK9PJG8fDwO5ccjysrR7IcdNcnA== (epg-decrypt-string epg-tests-context cipher)))))) (ert-deftest epg-sign-verify-1 () - (skip-unless (epg-tests-find-usable-gpg-configuration 'require-passphrase)) + (skip-unless (epg-tests-gpg-usable 'require-passphrase)) (with-epg-tests (:require-passphrase t :require-public-key t :require-secret-key t) @@ -128,7 +122,7 @@ jA0EAwMCE19JBLTvvmhgyRrGGglRbnKkK9PJG8fDwO5ccjysrR7IcdNcnA== (should (eq 'good (epg-signature-status (car verify-result))))))) (ert-deftest epg-sign-verify-2 () - (skip-unless (epg-tests-find-usable-gpg-configuration 'require-passphrase)) + (skip-unless (epg-tests-gpg-usable 'require-passphrase)) (with-epg-tests (:require-passphrase t :require-public-key t :require-secret-key t) @@ -144,7 +138,7 @@ jA0EAwMCE19JBLTvvmhgyRrGGglRbnKkK9PJG8fDwO5ccjysrR7IcdNcnA== (should (eq 'good (epg-signature-status (car verify-result))))))) (ert-deftest epg-sign-verify-3 () - (skip-unless (epg-tests-find-usable-gpg-configuration 'require-passphrase)) + (skip-unless (epg-tests-gpg-usable 'require-passphrase)) (with-epg-tests (:require-passphrase t :require-public-key t :require-secret-key t) @@ -159,7 +153,7 @@ jA0EAwMCE19JBLTvvmhgyRrGGglRbnKkK9PJG8fDwO5ccjysrR7IcdNcnA== (should (eq 'good (epg-signature-status (car verify-result))))))) (ert-deftest epg-import-1 () - (skip-unless (epg-tests-find-usable-gpg-configuration 'require-passphrase)) + (skip-unless (epg-tests-gpg-usable 'require-passphrase)) (with-epg-tests (:require-passphrase nil) (should (= 0 (length (epg-list-keys epg-tests-context)))) (should (= 0 (length (epg-list-keys epg-tests-context nil t))))) From 421e3c4b2f14cfdf84a07095be1cbc76c9038da0 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Wed, 18 May 2016 16:31:07 -0300 Subject: [PATCH 09/39] * lisp/emacs-lisp/package.el (package-refresh-contents): Don't change the value of `package-check-signature'. (package-check-signature): Use `epg-find-configuration' instead of `executable-find'. --- lisp/emacs-lisp/package.el | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 8f309cb798f..b0a6db087ba 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -301,10 +301,12 @@ contrast, `package-user-dir' contains packages for personal use." :risky t :version "24.1") -(defvar epg-gpg-program) +(declare-function epg-find-configuration "epg-config" + (protocol &optional force)) (defcustom package-check-signature - (if (progn (require 'epg-config) (executable-find epg-gpg-program)) + (if (and (require 'epg-config) + (epg-find-configuration 'OpenPGP)) 'allow-unsigned) "Non-nil means to check package signatures when installing. The value `allow-unsigned' means to still install a package even if @@ -1461,8 +1463,6 @@ taken care of by `package-initialize'." (defvar package--downloads-in-progress nil "List of in-progress asynchronous downloads.") -(declare-function epg-find-configuration "epg-config" - (protocol &optional force)) (declare-function epg-import-keys-from-file "epg" (context keys)) ;;;###autoload @@ -1562,12 +1562,6 @@ downloads in the background." (let ((default-keyring (expand-file-name "package-keyring.gpg" data-directory)) (inhibit-message async)) - (if (get 'package-check-signature 'saved-value) - (when package-check-signature - (epg-find-configuration 'OpenPGP)) - (setq package-check-signature - (if (epg-find-configuration 'OpenPGP) - 'allow-unsigned))) (when (and package-check-signature (file-exists-p default-keyring)) (condition-case-unless-debug error (package-import-keyring default-keyring) From 30989a0ae1923b4466cf4902a5ac009fc1d2fdad Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 21 May 2016 10:19:32 +0300 Subject: [PATCH 10/39] Mention GTK+ problems in etc/PROBLEMS * etc/PROBLEMS (GDK_SCALE, GDK_DPI_SCALE): Mention the possible problems this could create and the workaround. (Bug#23587) --- etc/PROBLEMS | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 8733095c8d4..31f38e3980d 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -940,6 +940,21 @@ into Meta. This is because of the great importance of Meta in Emacs. ** Window-manager and toolkit-related problems +*** Emacs built with GTK+ toolkit produces corrupted display on HiDPI screen + +This can happen if you set GDK_SCALE=2 in the environment or in your +'.xinitrc' file. (This setting is usually accompanied by +GDK_DPI_SCALE=0.5.) Emacs can not support these settings correctly, +as it doesn't use GTK+ exclusively. The result is that sometimes +widgets like the scroll bar are displayed incorrectly, and frames +could be displayed "cropped" to only part of the stuff that should be +displayed. + +The workaround is to explicitly disable these settings when invoking +Emacs, for example (from a Posix shell prompt): + + $ GDK_SCALE=1 GDK_DPI_SCALE=1 emacs + *** Metacity: Resizing Emacs or ALT-Tab causes X to be unresponsive. This happens sometimes when using Metacity. Resizing Emacs or ALT-Tab:bing From c9f7ec736b78bef5359b6da03296277c535e8e89 Mon Sep 17 00:00:00 2001 From: Jun Hao Date: Sat, 21 May 2016 12:34:20 -0700 Subject: [PATCH 11/39] * lisp/desktop.el: Disable restore frameset if in non-graphic display. Fixes: debbugs:17693 --- lisp/desktop.el | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/lisp/desktop.el b/lisp/desktop.el index 822db050e1f..dba3277c091 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -1163,7 +1163,7 @@ This function also sets `desktop-dirname' to nil." "Restore the state of a set of frames. This function depends on the value of `desktop-saved-frameset' being set (usually, by reading it from the desktop)." - (when (desktop-restoring-frameset-p) + (when (and (display-graphic-p) (desktop-restoring-frameset-p)) (frameset-restore desktop-saved-frameset :reuse-frames (eq desktop-restore-reuses-frames t) :cleanup-frames (not (eq desktop-restore-reuses-frames 'keep)) @@ -1634,15 +1634,8 @@ If there are no buffers left to create, kill the timer." (setq command-line-args (delete key command-line-args)) (desktop-save-mode 0))) (when desktop-save-mode - ;; People don't expect emacs -nw, or --daemon, - ;; to create graphical frames (bug#17693). - ;; TODO perhaps there should be a separate value - ;; for desktop-restore-frames to control this startup behavior? - (let ((desktop-restore-frames (and desktop-restore-frames - initial-window-system - (not (daemonp))))) - (desktop-read) - (setq inhibit-startup-screen t))))) + (desktop-read) + (setq inhibit-startup-screen t)))) (provide 'desktop) From 5ab083034ca221a7b4f00156a0efece84da999d8 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 22 May 2016 19:20:28 +0300 Subject: [PATCH 12/39] Provide workaround for xftfont rendering problem * src/xftfont.c (syms_of_xftfont) : New variable. (xftfont_open): Use it to work around problems with rendering some fonts. (Bug#23360) --- src/xftfont.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/xftfont.c b/src/xftfont.c index 7926325419c..34c6f7d3e42 100644 --- a/src/xftfont.c +++ b/src/xftfont.c @@ -395,6 +395,24 @@ xftfont_open (struct frame *f, Lisp_Object entity, int pixel_size) font->ascent = xftfont->ascent; font->descent = xftfont->descent; + /* The following workaround is unnecessary on most systems, and + causes annoying differences in glyph height between regular and + bold fonts (see bug#22383). However, with some fonts, such as + monaco, removing the workaround results in overlapping vertical + space of a line, see bug#23360. As long as the way to reconcile + these opposites is not known, we provide a user option to work + around the problem. */ + if (pixel_size >= 5 + && xft_font_ascent_descent_override) + { + /* The above condition is a dirty workaround because + XftTextExtents8 behaves strangely for some fonts + (e.g. "Dejavu Sans Mono") when pixel_size is less than 5. */ + if (font->ascent < extents.y) + font->ascent = extents.y; + if (font->descent < extents.height - extents.y) + font->descent = extents.height - extents.y; + } font->height = font->ascent + font->descent; if (XINT (AREF (entity, FONT_SIZE_INDEX)) == 0) @@ -733,6 +751,12 @@ syms_of_xftfont (void) DEFSYM (QCembolden, ":embolden"); DEFSYM (QClcdfilter, ":lcdfilter"); + DEFVAR_BOOL ("xft-font-ascent-descent-override", + xft_font_ascent_descent_override, + doc: /* Non-nil means override the ascent and descent values for Xft font driver. +This is needed with some fonts to correct vertical overlap of glyphs. */); + xft_font_ascent_descent_override = 0; + ascii_printable[0] = 0; xftfont_driver = ftfont_driver; From 869092c9ed373e97f92c7f7518396e3fbdb24dd8 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 22 May 2016 13:38:53 -0700 Subject: [PATCH 13/39] Bring back xterm pasting with middle mouse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem reported by Jan Synáček. Solution suggested by Stefan Monnier (Bug#23519). * lisp/isearch.el (isearch-mode-map): Add a binding for xterm-paste. (xterm--pasted-text): New decl. (isearch-xterm-paste): New function. * lisp/term/xterm.el (xterm--pasted-text): New function, taken from xterm-paste internals. (xterm-paste): Use it. --- lisp/isearch.el | 8 ++++++++ lisp/term/xterm.el | 39 ++++++++++++++++++++------------------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index e4de0b627e3..7360a0b3742 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -510,6 +510,7 @@ This is like `describe-bindings', but displays only Isearch keys." ;; People expect to be able to paste with the mouse. (define-key map [mouse-2] #'isearch-mouse-2) (define-key map [down-mouse-2] nil) + (define-key map [xterm-paste] #'isearch-xterm-paste) ;; Some bindings you may want to put in your isearch-mode-hook. ;; Suggest some alternates... @@ -2001,6 +2002,13 @@ is bound to outside of Isearch." (when (functionp binding) (call-interactively binding))))) +(declare-function xterm--pasted-text "term/xterm" ()) + +(defun isearch-xterm-paste () + "Pull terminal paste into search string." + (interactive) + (isearch-yank-string (xterm--pasted-text))) + (defun isearch-yank-internal (jumpform) "Pull the text from point to the point reached by JUMPFORM. JUMPFORM is a lambda expression that takes no arguments and returns diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index e06423ccfdd..19eb37a51d6 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -71,28 +71,29 @@ string bytes that can be copied is 3/4 of this value." (defconst xterm-paste-ending-sequence "\e[201~" "Characters send by the terminal to end a bracketed paste.") +(defun xterm--pasted-text () + "Handle the rest of a terminal paste operation. +Return the pasted text as a string." + (let ((end-marker-length (length xterm-paste-ending-sequence))) + (with-temp-buffer + (set-buffer-multibyte nil) + (while (not (search-backward xterm-paste-ending-sequence + (- (point) end-marker-length) t)) + (let ((event (read-event nil nil + ;; Use finite timeout to avoid glomming the + ;; event onto this-command-keys. + most-positive-fixnum))) + (when (eql event ?\r) + (setf event ?\n)) + (insert event))) + (let ((last-coding-system-used)) + (decode-coding-region (point-min) (point) (keyboard-coding-system) + t))))) + (defun xterm-paste () "Handle the start of a terminal paste operation." (interactive) - (let* ((end-marker-length (length xterm-paste-ending-sequence)) - (pasted-text (with-temp-buffer - (set-buffer-multibyte nil) - (while (not (search-backward - xterm-paste-ending-sequence - (- (point) end-marker-length) t)) - (let ((event (read-event - nil nil - ;; Use finite timeout to avoid - ;; glomming the event onto - ;; this-command-keys. - most-positive-fixnum))) - (when (eql event ?\r) - (setf event ?\n)) - (insert event))) - (let ((last-coding-system-used)) - (decode-coding-region - (point-min) (point) - (keyboard-coding-system) t)))) + (let* ((pasted-text (xterm--pasted-text)) (interprogram-paste-function (lambda () pasted-text))) (yank))) From 2671179b11a9423792aaf2439a26a2562679c086 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Sun, 22 May 2016 21:02:34 +0000 Subject: [PATCH 14/39] Don't print the "decomposition" line for control chars in what-cursor-position This is a temporary workaround for bug #23594, where the decomposition line for linefeed corrupted the display on a Linux virtual terminal. * lisp/descr-text.el (describe-char): Remove `decomposition' from the list of character code properties printed for control characters. --- lisp/descr-text.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lisp/descr-text.el b/lisp/descr-text.el index 5f1a4304342..528820876ec 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el @@ -806,9 +806,16 @@ relevant to POS." 'describe-char-unidata-list)) 'follow-link t) (insert "\n") - (dolist (elt (if (eq describe-char-unidata-list t) - (nreverse (mapcar 'car char-code-property-alist)) - describe-char-unidata-list)) + (dolist (elt + (cond ((eq describe-char-unidata-list t) + (nreverse (mapcar 'car char-code-property-alist))) + ((< char 32) + ;; Temporary fix (2016-05-22): The + ;; decomposition item for \n corrupts the + ;; display on a Linux virtual terminal. + ;; (Bug #23594). + (remq 'decomposition describe-char-unidata-list)) + (t describe-char-unidata-list))) (let ((val (get-char-code-property char elt)) description) (when val From 18a9bc1152452fecfa09e6f2f3a5d6677a564977 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 22 May 2016 17:29:58 -0700 Subject: [PATCH 15/39] Do not trash symlinks to init file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the user’s init file is a symbolic link, do not break the link when initializing the package system. Problem reported by Jackson Hamilton (Bug#23050). * lisp/emacs-lisp/package.el (package--ensure-init-file): Bind find-file-visit-truename when visiting the init file, and save and restore the buffer name the way cus-edit does in a similar situation (Bug#454). --- lisp/emacs-lisp/package.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index b0a6db087ba..14626e2f28f 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1869,6 +1869,7 @@ add a call to it along with some explanatory comments." (file-readable-p user-init-file) (file-writable-p user-init-file)) (let* ((buffer (find-buffer-visiting user-init-file)) + buffer-name (contains-init (if buffer (with-current-buffer buffer @@ -1884,8 +1885,12 @@ add a call to it along with some explanatory comments." (re-search-forward "(package-initialize\\_>" nil 'noerror))))) (unless contains-init (with-current-buffer (or buffer - (let ((delay-mode-hooks t)) + (let ((delay-mode-hooks t) + (find-file-visit-truename t)) (find-file-noselect user-init-file))) + (when buffer + (setq buffer-name (buffer-file-name)) + (set-visited-file-name (file-chase-links user-init-file))) (save-excursion (save-restriction (widen) @@ -1904,7 +1909,10 @@ add a call to it along with some explanatory comments." (insert "\n")) (let ((file-precious-flag t)) (save-buffer)) - (unless buffer + (if buffer + (progn + (set-visited-file-name buffer-name) + (set-buffer-modified-p nil)) (kill-buffer (current-buffer))))))))) (setq package--init-file-ensured t)) From 920d76c2084f0621dec8664840dd3fb2e9b34891 Mon Sep 17 00:00:00 2001 From: Kaushal Modi Date: Sun, 22 May 2016 17:48:33 -0700 Subject: [PATCH 16/39] Fix reference to obsolete fn ps-eval-switch lpr-eval-switch is functionally the same as ps-eval-switch, which was obsoleted in 2cdeb903c57126d3ad5f0cbd72e182584b76ee29. So use that instead (Bug#19717). * lisp/printing.el (pr-switches): Use lpr-eval-switch instead of ps-eval-switch. --- lisp/printing.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/printing.el b/lisp/printing.el index 3bd5a67298d..d9cc2a3614a 100644 --- a/lisp/printing.el +++ b/lisp/printing.el @@ -5673,7 +5673,7 @@ If menu binding was not done, calls `pr-menu-bind'." (or (listp switches) (error "%S should have a list of strings" mess)) (lpr-flatten-list ; dynamic evaluation - (mapcar 'ps-eval-switch switches))) + (mapcar #'lpr-eval-switch switches))) (defun pr-ps-preview (kind n-up filename mess) From c0139e32f1f3bb287b04e02a69a7848d6a040003 Mon Sep 17 00:00:00 2001 From: Phillip Lord Date: Sat, 21 May 2016 10:06:12 +0100 Subject: [PATCH 17/39] Fix viper undo breakage from undo-boundary changes * lisp/simple.el (undo-auto-disable-boundaries): New variable * lisp/emulation/viper-init.el (viper-undo-in-complex-command, viper-undo-needs-adjustment): Rename variable to reflect new purpose, (viper-buffer-undo-list-mark): Remove * lisp/emulation/viper-cmd.el (viper-set-complex-command-for-undo): Add undo using `undo-boundary', disable default undo-boundary addition. * lisp/emulation/viper-cmd.el (viper-complete-complex-command-for-undo,viper-adjust-undo): Change function name, remove old undo list manipulation. * lisp/emulation/viper-cmd.el (viper-undo,viper-repeat, viper-change-state-to-vi,viper-change-state): Update for function name change. Addresses Bug #22295 --- lisp/emulation/viper-cmd.el | 43 ++++++++++-------------------------- lisp/emulation/viper-init.el | 9 ++------ lisp/simple.el | 23 ++++++++++++++----- 3 files changed, 32 insertions(+), 43 deletions(-) diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 93cf3b0fb10..6b8fa46362d 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el @@ -631,7 +631,7 @@ (viper-over-whitespace-line)) (indent-to-left-margin)) (viper-add-newline-at-eob-if-necessary) - (viper-adjust-undo) + (viper-complete-complex-command-for-undo) (if (eq viper-current-state 'emacs-state) (viper-restore-cursor-color 'after-emacs-mode) @@ -1570,7 +1570,7 @@ If the prefix argument ARG is non-nil, it is used instead of `val'." (if (and (eolp) (not (bolp))) (backward-char 1)) )) - (viper-adjust-undo) ; take care of undo + (viper-complete-complex-command-for-undo) ; take care of undo ;; If the prev cmd was rotating the command ring, this means that `.' has ;; just executed a command from that ring. So, push it on the ring again. ;; If we are just executing previous command , then don't push viper-d-com @@ -1671,6 +1671,7 @@ invokes the command before that, etc." (undo-start) (undo-more 2) + (viper-complete-complex-command-for-undo) ;;(setq undo-beg-posn (or undo-beg-posn (point)) ;; undo-end-posn (or undo-end-posn (point))) ;;(setq undo-beg-posn (or undo-beg-posn before-undo-pt) @@ -1710,37 +1711,17 @@ invokes the command before that, etc." ;; The following two functions are used to set up undo properly. ;; In VI, unlike Emacs, if you open a line, say, and add a bunch of lines, ;; they are undone all at once. -(defun viper-adjust-undo () - (if viper-undo-needs-adjustment - (let ((inhibit-quit t) - tmp tmp2) - (setq viper-undo-needs-adjustment nil) - (if (listp buffer-undo-list) - (if (setq tmp (memq viper-buffer-undo-list-mark buffer-undo-list)) - (progn - (setq tmp2 (cdr tmp)) ; the part after mark - - ;; cut tail from buffer-undo-list temporarily by direct - ;; manipulation with pointers in buffer-undo-list - (setcdr tmp nil) - - (setq buffer-undo-list (delq nil buffer-undo-list)) - (setq buffer-undo-list - (delq viper-buffer-undo-list-mark buffer-undo-list)) - ;; restore tail of buffer-undo-list - (setq buffer-undo-list (nconc buffer-undo-list tmp2))) - (setq buffer-undo-list (delq nil buffer-undo-list))))) - )) +(defun viper-complete-complex-command-for-undo () + (setq undo-auto-disable-boundaries nil) + (setq viper-undo-in-complex-command nil) + (undo-boundary)) (defun viper-set-complex-command-for-undo () - (if (listp buffer-undo-list) - (if (not viper-undo-needs-adjustment) - (let ((inhibit-quit t)) - (setq buffer-undo-list - (cons viper-buffer-undo-list-mark buffer-undo-list)) - (setq viper-undo-needs-adjustment t))))) - + (when (not viper-undo-in-complex-command) + (setq undo-auto-disable-boundaries t) + (setq viper-undo-in-complex-command t) + (undo-boundary))) ;;; Viper's destructive Command ring utilities @@ -2604,7 +2585,7 @@ These keys are ESC, RET, and LineFeed." (delete-char 1 t) (insert char)) - (viper-adjust-undo) + (viper-complete-complex-command-for-undo) (backward-char arg) )) diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el index 104245b7571..c1e76629477 100644 --- a/lisp/emulation/viper-init.el +++ b/lisp/emulation/viper-init.el @@ -370,13 +370,8 @@ Use `\\[viper-set-expert-level]' to change this.") ;; VI-style Undo ;; Used to 'undo' complex commands, such as replace and insert commands. -(viper-deflocalvar viper-undo-needs-adjustment nil) -(put 'viper-undo-needs-adjustment 'permanent-local t) - -;; A mark that Viper puts on buffer-undo-list. Marks the beginning of a -;; complex command that must be undone atomically. If inserted, it is -;; erased by viper-change-state-to-vi and viper-repeat. -(defconst viper-buffer-undo-list-mark 'viper) +(viper-deflocalvar viper-undo-in-complex-command nil) +(put 'viper-undo-in-complex-command 'permanent-local t) (defcustom viper-keep-point-on-undo nil "Non-nil means not to move point while undoing commands. diff --git a/lisp/simple.el b/lisp/simple.el index 97b40bd214e..c5aa2922475 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2839,6 +2839,18 @@ buffers that were changed during the last command.") If set to non-nil, this will effectively disable the timer.") +(defvar-local undo-auto-disable-boundaries nil + "Disable the automatic addition of boundaries. + +If set to non-nil, `undo-boundary' will not be called +automatically in a buffer either at the end of a command, or as a +result of `undo-auto-current-boundary-timer'. + +When this is set to non-nil, it is important to ensure that +`undo-boundary' is called frequently enough. Failure to do so +will result in user-visible warnings that the situation is +probably a bug.") + (defvar undo-auto--this-command-amalgamating nil "Non-nil if `this-command' should be amalgamated. This variable is set to nil by `undo-auto--boundaries' and is set @@ -2878,7 +2890,8 @@ REASON describes the reason that the boundary is being added; see (dolist (b undo-auto--undoably-changed-buffers) (when (buffer-live-p b) (with-current-buffer b - (undo-auto--ensure-boundary cause)))) + (unless undo-auto-disable-boundaries + (undo-auto--ensure-boundary cause))))) (setq undo-auto--undoably-changed-buffers nil)) (defun undo-auto--boundary-timer () @@ -2905,10 +2918,10 @@ See also `undo-auto--buffer-undoably-changed'.") "Add an `undo-boundary' in appropriate buffers." (undo-auto--boundaries (let ((amal undo-auto--this-command-amalgamating)) - (setq undo-auto--this-command-amalgamating nil) - (if amal - 'amalgamate - 'command)))) + (setq undo-auto--this-command-amalgamating nil) + (if amal + 'amalgamate + 'command)))) (defun undo-auto-amalgamate () "Amalgamate undo if necessary. From df4a14be69bdf878df391fe78d2a3d25bd7fd139 Mon Sep 17 00:00:00 2001 From: Phillip Lord Date: Mon, 23 May 2016 10:39:26 +0100 Subject: [PATCH 18/39] Add automated test for viper-tests.el --- test/automated/viper-tests.el | 160 ++++++++++++++++++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 test/automated/viper-tests.el diff --git a/test/automated/viper-tests.el b/test/automated/viper-tests.el new file mode 100644 index 00000000000..1be92a4e1f6 --- /dev/null +++ b/test/automated/viper-tests.el @@ -0,0 +1,160 @@ +;;; viper-tests.el --- tests for viper. + +;; Copyright (C) 2016 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; This program 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. +;; +;; This program 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 this program. If not, see `http://www.gnu.org/licenses/'. + +;;; Commentary: + +;;; Code: + + +(require 'viper) + +(defun viper-test-undo-kmacro (kmacro) + "In a clean viper buffer, run KMACRO and return `buffer-string'. + +This function makes as many attempts as possible to clean up +after itself, although it will leave a buffer called +*viper-test-buffer* if it fails (this is deliberate!)." + (let ( + ;; Viper just turns itself off during batch use. + (noninteractive nil) + ;; Switch off start up message or it will chew the key presses + (viper-inhibit-startup-message 't) + ;; Select an expert-level for the same reason. + (viper-expert-level 5) + ;; viper loads this even with -q so make sure it's empty! + (viper-custom-file-name (make-temp-file "viper-tests")) + (before-buffer (current-buffer))) + (unwind-protect + (progn + ;; viper-mode is essentially global, so set it here + (viper-mode) + ;; We must switch to buffer because we are using a keyboard macro + ;; which appears to not go to the current-buffer but what ever is + ;; currently taking keyboard events. We use a named buffer because + ;; then we can see what it in it if it all goes wrong. + (switch-to-buffer + (get-buffer-create + "*viper-test-buffer*")) + (erase-buffer) + ;; The new buffer fails to enter vi state so set it. + (viper-change-state-to-vi) + ;; Run the macro + (execute-kbd-macro kmacro) + (let ((rtn + (buffer-substring-no-properties + (point-min) + (point-max)))) + ;; Kill the buffer iff the macro succeeds + (kill-buffer) + rtn)) + ;; switch everthing off and restore the buffer + (toggle-viper-mode) + (switch-to-buffer before-buffer)))) + +(ert-deftest viper-test-go () + "Test that this file is running." + (should t)) + +(ert-deftest viper-test-fix () + "Test that the viper kmacro fixture is working." + (should + (viper-test-undo-kmacro []))) + +(ert-deftest viper-test-undo-1 () + "Test for VI like undo behaviour. + +Insert 1, then 2 on consecutive lines, followed by undo. This +should leave just 1 in the buffer. + +Test for Bug #22295" + (should + (equal + "1\n" + (viper-test-undo-kmacro + [ + ?a + ?1 + escape + ?o + ?2 + escape + ?u + ] + )))) + +(ert-deftest viper-test-undo-2 () + "Test for VI like undo behaviour. + +Insert \"1 2 3 4 5\" then delete the 2, then the 4, and undo. +Should restore the 4, but leave the 2 deleted. + +Test for Bug #22295" + (should + (equal + "1 3 4 5\n" + (viper-test-undo-kmacro + [ + ?i + ?1 ? ?2 ? ?3 ? ?4 ? ?5 + escape + ?F ?2 ?d ?w + ?w ?d ?w + ?u + ])))) + +(ert-deftest viper-test-undo-3 () + "Test for VI like undo behaviour. + +Insert \"1 2 3 4 5 6\", delete the 2, then the 3 4 and 5. +Should restore the 3 4 and 5 but not the 2. + +Test for Bug #22295" + (should + (equal + "1 3 4 5 6\n" + (viper-test-undo-kmacro + [ + ;; Insert this lot. + ?i ?1 ? ?2 ? ?3 ? ?4 ? ?5 ? ?6 + escape + ;; Start of line. + ?0 + ;; Move to 2, delete + ?w ?d ?w + ;; Delete 3 4 5 + ?. ?. ?. + ;; Undo del 5, then + ?u ?. ?. + ])))) + + +(ert-deftest viper-test-undo-4() + (should + (equal + "" + (viper-test-undo-kmacro + [ + ?i ?1 escape + ?o ?2 escape + ?o ?3 escape + ?u ?. ?. + ]) + ))) + +;;; viper-tests.el ends here From c33ed39efc2d99e4289bf40f4686f5ac5efedce0 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 23 May 2016 08:43:26 -0700 Subject: [PATCH 19/39] ; * test/automated/viper-tests.el: Standardize license notice. --- test/automated/viper-tests.el | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/automated/viper-tests.el b/test/automated/viper-tests.el index 1be92a4e1f6..8b30f050935 100644 --- a/test/automated/viper-tests.el +++ b/test/automated/viper-tests.el @@ -4,18 +4,18 @@ ;; This file is part of GNU Emacs. -;; This program 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. -;; -;; This program 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. -;; +;; 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 this program. If not, see `http://www.gnu.org/licenses/'. +;; along with GNU Emacs. If not, see . ;;; Commentary: From 44a6aed33fdde11d4a0a2eb4aa5e91b6b5a23347 Mon Sep 17 00:00:00 2001 From: Phillip Lord Date: Mon, 23 May 2016 16:59:24 +0100 Subject: [PATCH 20/39] ; * test/automated/data-tests.el: Standardize license notice. --- test/automated/data-tests.el | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/automated/data-tests.el b/test/automated/data-tests.el index 9ca5ac53333..0a292336f35 100644 --- a/test/automated/data-tests.el +++ b/test/automated/data-tests.el @@ -4,18 +4,18 @@ ;; This file is part of GNU Emacs. -;; This program 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. -;; -;; This program 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. -;; +;; 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 this program. If not, see `http://www.gnu.org/licenses/'. +;; along with GNU Emacs. If not, see . ;;; Commentary: From bdfbe6deff52bbf820b0fa1a5ea78b89963e5738 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 24 May 2016 08:59:09 -0700 Subject: [PATCH 21/39] ; * admin/release-process: Copyedits. --- admin/release-process | 69 +++++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/admin/release-process b/admin/release-process index 3f75ff52ca4..410116becb4 100644 --- a/admin/release-process +++ b/admin/release-process @@ -7,7 +7,7 @@ Each release cycle will be split into two periods. ** Phase one: development The first phase of the release schedule is the "heads-down" working -period for new features, on the 'master' branch and several feature +period for new features, on the 'master' branch and any needed feature branches. ** Phase two: fixing and stabilizing the release branch @@ -29,46 +29,61 @@ command to do that, then commit the changes it made and push to 'master'. For major releases, also update the value of 'customize-changed-options-previous-release'. -The 2 main manuals, the User Manual and the Emacs Lisp Manual, need to -be proofread, preferably by at least 2 different persons, and any -uncovered problems fixed. This is a lot of work, so it is advisable -to divide the job between several people (see the checklist near the -end of this file). +Each chapter of the two main manuals, the User Manual and the Emacs +Lisp Manual, should be proofread, preferably by at least two people. +This job is so big that it should be considered a collective +responsibility, not fobbed off on just a few people. After each +chapter is checked, mark off the name(s) of those who checked it in +the checklist near the end of this file. In parallel to this phase, 'master' can receive new features, to be released in the next release cycle. From time to time, the master branches merges bugfix commits from the "emacs-NN" branch. +See admin/gitmerge.el. * RELEASE-CRITICAL BUGS -Emacs uses the "blocking bug(s)" feature of Debbugs for bugs need to -be addressed in the next release. +Emacs uses the "blocking" feature of Debbugs for bugs that need to be +addressed in the next release. -Currently, bug#19759 is the tracking bug for release of 25.1. Say -bug#123 needs to be fixed for Emacs 25.1. Send a message to -control@debbugs.gnu.org that says: +Currently, bug#19759 is the tracking bug for release of 25.1 and +bug#21966 is the tracking bug for the next release. Say bug#123 needs +to be fixed for Emacs 25.1. Send a message to control@debbugs.gnu.org +that says: block 19759 by 123 -Change "block" to "unblock" to unblock the bug. +Change "block" to "unblock" to remove a bug from the list. Closed +bugs are not listed as blockers, so you do not need to explicitly +unblock one that has been closed. You may need to force an update of +the tracking bug with ctrl-f5/shift-reload to see the latest version. + * TO BE DONE SHORTLY BEFORE RELEASE -** Make sure the Copyright date reflects the current year in the source -files. See 'admin/notes/years' for information about maintaining -copyright years for GNU Emacs. +See 'admin/make-tarball.txt' for the details of making a release or pretest. + +** Make sure the Copyright date reflects the current year in all source files. +(This should be done each January anyway, regardless of releases.) +See admin/update-copyright and admin.el's set-copyright. +For more details, see 'admin/notes/years'. ** Make sure the necessary sources and scripts for any generated files are included in the source tarball. (They don't need to be installed, -so e.g. admin/ is fine.) - -** Regenerate AUTHORS by using admin/authors.el -(The instructions are at the beginning of that file.) +so e.g. admin/ is fine.) This is important for legal compliance. ** Remove temporary +++/--- lines in NEWS. But first make sure there are no unmarked entries, and update the -documentation (or decide no updates are necessary) for those that -aren't. +documentation (or decide no updates are necessary) for those that aren't. + +** Try to reorder NEWS: most important things first, related items together. + +** For a major release, add a "New in Emacs XX" section to faq.texi. + +** cusver-check from admin.el can help find new defcustoms missing +:version tags. + +** Add a line to etc/HISTORY for the release version number and date. ** Manuals Check for node names using problematic characters: @@ -84,8 +99,7 @@ For major releases, rewrite the "Antinews" appendix of the User Manual previous version. The way to do that is read NEWS, pick up the more significant changes and new features in the upcoming release, then describe the "benefits" from losing those features. Be funny, use -humor. The text written for the previous major release can serve as -good example. +humor. The text written for the previous releases can serve as an example. Check cross-references between the manuals (e.g. from emacs to elisp) are correct. You can use something like the following in the info @@ -146,10 +160,6 @@ size that the GNU Press are going to use when they print the manuals. I think this is different to what you get if you just use e.g. 'make emacs.pdf' (e.g., enable "smallbook"). -** Try to reorder NEWS: most important things first, related items together. - -** For a major release, add a "New in Emacs XX" section to faq.texi. - ** Check the keybindings in the refcards are correct, and add any new ones. What paper size are the English versions supposed to be on? On Debian testing, the packages texlive-lang-czechslovak and @@ -171,11 +181,6 @@ pt-br Rodrigo Real ru Alex Ott sk Miroslav Vaško -** cusver-check from admin.el can help find new defcustoms missing -:version tags. - -** Add a line to etc/HISTORY for the release version number and date. - * BUGS ** Check for modes which bind M-s that conflicts with a new global binding M-s From fbfd4787fbec11fe69f5e661e7c5ab4436f7cb72 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 24 May 2016 19:04:16 +0300 Subject: [PATCH 22/39] Avoid aborting due to errors in arguments of 'set-face-attribute' * src/xfaces.c (Finternal_set_lisp_face_attribute): Check the FRAME argument before using it. This avoids gratuitous aborts in Emacs built with --enable-checking when the luser was unlucky enough to get the argument list in wrong order. --- src/xfaces.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xfaces.c b/src/xfaces.c index ac1370003df..88f5f3415b0 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -2678,9 +2678,10 @@ FRAME 0 means change the face on all frames, and change the default { if (NILP (frame)) frame = selected_frame; - f = XFRAME (frame); CHECK_LIVE_FRAME (frame); + f = XFRAME (frame); + lface = lface_from_face_name (f, face, false); /* If a frame-local face doesn't exist yet, create one. */ From 503e752c4a4ec4dc05c112ae82753b85594c99be Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 24 May 2016 19:06:20 +0300 Subject: [PATCH 23/39] ; * CONTRIBUTE: Fix a typo. --- CONTRIBUTE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTE b/CONTRIBUTE index 5102b4fe4f1..a70682f29ab 100644 --- a/CONTRIBUTE +++ b/CONTRIBUTE @@ -183,7 +183,7 @@ intended for more-conservative changes such as bug fixes. Typically, collective development is active on the master branch and possibly on the current release branch. Periodically, the current release branch is merged into the master, using the gitmerge function described in -admin/notes-git-workflow. +admin/notes/git-workflow. If you are fixing a bug that exists in the current release, be sure to commit it to the release branch; it will be merged to the master From bea1b65b3c71668e3e990721e39bba8b5007e9c6 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 24 May 2016 12:51:00 -0400 Subject: [PATCH 24/39] * admin/admin.el (add-release-logs): Also update etc/HISTORY. --- admin/admin.el | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/admin/admin.el b/admin/admin.el index fe807ff96fe..a3d56277918 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -30,6 +30,7 @@ (defun add-release-logs (root version &optional date) "Add \"Version VERSION released.\" change log entries in ROOT. +Also update the etc/HISTORY file. Root must be the root of an Emacs source tree. Optional argument DATE is the release date, default today." (interactive (list (read-directory-name "Emacs root directory: ") @@ -42,6 +43,12 @@ Optional argument DATE is the release date, default today." (setq root (expand-file-name root)) (unless (file-exists-p (expand-file-name "src/emacs.c" root)) (user-error "%s doesn't seem to be the root of an Emacs source tree" root)) + ;; FIXME this does not check that a ChangeLog that exists is not + ;; your own personal one. Perhaps we should move any existing file + ;; and unconditionally call make ChangeLog? + ;; Or make ChangeLog CHANGELOG=temp and compare with the existing? + (unless (file-exists-p (expand-file-name "ChangeLog" root)) + (user-error "No top-level ChangeLog - run \"make ChangeLog\" first")) (require 'add-log) (or date (setq date (funcall add-log-time-format nil t))) (let* ((logs (process-lines "find" root "-name" "ChangeLog")) @@ -53,7 +60,14 @@ Optional argument DATE is the release date, default today." (dolist (log logs) (find-file log) (goto-char (point-min)) - (insert entry)))) + (insert entry))) + (let ((histfile (expand-file-name "etc/HISTORY" root))) + (unless (file-exists-p histfile) + (error "%s not present" histfile)) + (find-file histfile) + (goto-char (point-max)) + (search-backward " ") + (insert (format "GNU Emacs %s (%s) emacs-%s\n\n" version date version)))) (defun set-version-in-file (root file version rx) "Subroutine of `set-version' and `set-copyright'." From 906c810158def49133d5433e6cbae05ce3edb7e6 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 24 May 2016 13:00:57 -0400 Subject: [PATCH 25/39] ; * admin/release-process: Move etc/HISTORY from here... ; * admin/make-tarball.txt: ... to here. --- admin/make-tarball.txt | 21 ++++++++++----------- admin/release-process | 2 -- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index 030ad4cee68..af18ff6a2e6 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt @@ -51,24 +51,23 @@ General steps (for each step, check for possible errors): Commit any fixes to authors.el. 3. Set the version number (M-x load-file RET admin/admin.el RET, then - M-x set-version RET). For a release, add released ChangeLog - entries (create a ChangeLog symlink a la vc-dwim, then run M-x - add-release-logs RET, then run the shell command 'vc-dwim --commit'). - - For a pretest, start at version .90. After .99, use .990 (so that - it sorts). + M-x set-version RET). For a pretest, start at version .90. After + .99, use .990 (so that it sorts). The final pretest should be a release candidate. Set the version number to that of the actual release. Pick a date about a week - from now when you intend to make the release. Use vc-dwim and - M-x add-release-logs as described above to add commit messages - that will appear in the tarball's automatically-generated ChangeLog - file as entries for that date. + from now when you intend to make the release. Use M-x + add-release-logs to add entries to etc/HISTORY and the ChangeLog + file. It's best not to commit these files until the release is + actually made. Merge the entries from (unversioned) ChangeLog + into the top of the current versioned ChangeLog.N and commit that + along with etc/HISTORY. Then you can tag that commit as the + release. Name the tar file as emacs-XX.Y-rc1.tar. If all goes well in the following week, you can simply rename the file and use it for the actual release. If you need another release candidate, remember - to adjust the ChangeLog entries. + to adjust the ChangeLog and etc/HISTORY entries. If you need to change only a file(s) that cannot possibly affect the build (README, ChangeLog, NEWS, etc.) then rather than doing diff --git a/admin/release-process b/admin/release-process index 410116becb4..e4ef4d94647 100644 --- a/admin/release-process +++ b/admin/release-process @@ -83,8 +83,6 @@ documentation (or decide no updates are necessary) for those that aren't. ** cusver-check from admin.el can help find new defcustoms missing :version tags. -** Add a line to etc/HISTORY for the release version number and date. - ** Manuals Check for node names using problematic characters: find doc -name '*.texi' -exec grep '^@node[^,]*[:.()]' {} + From f3d2dedeba37d899be72a37339d0370aa3ae4c70 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 24 May 2016 13:26:04 -0400 Subject: [PATCH 26/39] * doc/misc/vhdl-mode.texi (Sample Init File): Rename node to avoid ".". --- doc/misc/vhdl-mode.texi | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/misc/vhdl-mode.texi b/doc/misc/vhdl-mode.texi index ec83b7e62ee..e26ec5277c0 100644 --- a/doc/misc/vhdl-mode.texi +++ b/doc/misc/vhdl-mode.texi @@ -65,7 +65,7 @@ modify this GNU manual.'' * Syntactic Symbols:: * Frequently Asked Questions:: * Getting the latest VHDL Mode release:: -* Sample .emacs File:: +* Sample Init File:: * Limitations and Known Bugs:: * Mailing Lists and Submitting Bug Reports:: * GNU Free Documentation License:: The license for this documentation. @@ -484,7 +484,7 @@ Here's a simplified example of what you can add to your @file{.emacs} file to make the changes described in the previous section (@ref{Interactive Customization}) more permanent. See the Emacs manuals for more information on customizing Emacs via hooks. -@xref{Sample .emacs File}, for a more complete sample @file{.emacs} file. +@xref{Sample Init File}, for a more complete sample @file{.emacs} file. @example @group @@ -600,7 +600,7 @@ optional third argument, which if non-@code{nil}, automatically institutes the new style in the current buffer. The sample @file{.emacs} file provides a concrete example of how a new -style can be added and automatically set. @xref{Sample .emacs File}. +style can be added and automatically set. @xref{Sample Init File}. @node File Styles @subsection File Styles @@ -874,7 +874,7 @@ simply add the following to the top of your @file{.emacs} file: @end example -See the sample @file{.emacs} file @ref{Sample .emacs File} for +See the sample @file{.emacs} file @ref{Sample Init File} for details. @end quotation @@ -894,9 +894,9 @@ either of these lists. The official Emacs VHDL Mode Home Page can be found at @uref{http://www.iis.ee.ethz.ch/~zimmi/emacs/vhdl-mode.html}. -@node Sample .emacs File -@chapter Sample @file{.emacs} file -@cindex Sample @file{.emacs} file +@node Sample Init File +@chapter Sample Init File +@cindex Sample init file Most customizations can be done using the ``Customize'' entry in the VHDL Mode menu, which requires no editing of the .emacs file. From 2e589c00422e68624024c8a77799d54964e7b3a2 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 24 May 2016 21:24:45 +0300 Subject: [PATCH 27/39] Fix cross-references between manuals * doc/misc/viper.texi (Viper Specials): * doc/misc/url.texi (Tramp): * doc/misc/sem-user.texi (Smart Jump): * doc/lispintro/emacs-lisp-intro.texi (Finding More): * doc/misc/efaq.texi (Replacing text across multiple files): Fix cross-references between manuals. (Bug#23612) * doc/lispintro/emacs-lisp-intro.texi (etags): Node deleted: no longer relevant to Emacs Lisp programming. --- doc/lispintro/emacs-lisp-intro.texi | 187 +++------------------------- doc/misc/efaq.texi | 4 +- doc/misc/sem-user.texi | 6 +- doc/misc/url.texi | 4 +- doc/misc/viper.texi | 2 +- 5 files changed, 22 insertions(+), 181 deletions(-) diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index eea46af6b19..10162b35467 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -584,7 +584,6 @@ Regular Expression Searches * re-search-forward:: Very similar to @code{search-forward}. * forward-sentence:: A straightforward example of regexp search. * forward-paragraph:: A somewhat complex example. -* etags:: How to create your own @file{TAGS} table. * Regexp Review:: * re-search Exercises:: @@ -4583,54 +4582,21 @@ definition. @end ignore More generally, if you want to see a function in its original source -file, you can use the @code{find-tag} function to jump to it. -@code{find-tag} works with a wide variety of languages, not just -Lisp, and C, and it works with non-programming text as well. For -example, @code{find-tag} will jump to the various nodes in the -Texinfo source file of this document. -The @code{find-tag} function depends on @dfn{tags tables} that record -the locations of the functions, variables, and other items to which -@code{find-tag} jumps. +file, you can use the @code{xref-find-definitions} function to jump to +it. @code{xref-find-definitions} works with a wide variety of +languages, not just Lisp, and C, and it works with non-programming +text as well. For example, @code{xref-find-definitions} will jump to +the various nodes in the Texinfo source file of this document. -To use the @code{find-tag} command, type @kbd{M-.} (i.e., press the -period key while holding down the @key{META} key, or else type the -@key{ESC} key and then type the period key), and then, at the prompt, -type in the name of the function whose source code you want to see, -such as @code{mark-whole-buffer}, and then type @key{RET}. Emacs will -switch buffers and display the source code for the function on your -screen. To switch back to your current buffer, type @kbd{C-x b -@key{RET}}. (On some keyboards, the @key{META} key is labeled -@key{ALT}.) - -@c !!! 22.1.1 tags table location in this paragraph -@cindex TAGS table, specifying -@findex find-tag -Depending on how the initial default values of your copy of Emacs are -set, you may also need to specify the location of your tags table, -which is a file called @file{TAGS}. For example, if you are -interested in Emacs sources, the tags table you will most likely want, -if it has already been created for you, will be in a subdirectory of -the @file{/usr/local/share/emacs/} directory; thus you would use the -@code{M-x visit-tags-table} command and specify a pathname such as -@file{/usr/local/share/emacs/22.1.1/lisp/TAGS}. If the tags table -has not already been created, you will have to create it yourself. It -will be in a file such as @file{/usr/local/src/emacs/src/TAGS}. - -@need 1250 -To create a @file{TAGS} file in a specific directory, switch to that -directory in Emacs using @kbd{M-x cd} command, or list the directory -with @kbd{C-x d} (@code{dired}). Then run the compile command, with -@w{@code{etags *.el}} as the command to execute: - -@smallexample -M-x compile RET etags *.el RET -@end smallexample - -For more information, see @ref{etags, , Create Your Own @file{TAGS} File}. - -After you become more familiar with Emacs Lisp, you will find that you will -frequently use @code{find-tag} to navigate your way around source code; -and you will create your own @file{TAGS} tables. +To use the @code{xref-find-definitions} command, type @kbd{M-.} +(i.e., press the period key while holding down the @key{META} key, or +else type the @key{ESC} key and then type the period key), and then, +at the prompt, type in the name of the function whose source code you +want to see, such as @code{mark-whole-buffer}, and then type +@key{RET}. Emacs will switch buffers and display the source code for +the function on your screen. To switch back to your current buffer, +type @kbd{C-x b @key{RET}}. (On some keyboards, the @key{META} key is +labeled @key{ALT}.) @cindex Library, as term for ``file'' Incidentally, the files that contain Lisp code are conventionally @@ -12142,7 +12108,6 @@ introduces several new features. * re-search-forward:: Very similar to @code{search-forward}. * forward-sentence:: A straightforward example of regexp search. * forward-paragraph:: A somewhat complex example. -* etags:: How to create your own @file{TAGS} table. * Regexp Review:: * re-search Exercises:: @end menu @@ -13294,130 +13259,6 @@ key; you will be taken directly to the source. (Be sure to install your sources! Without them, you are like a person who tries to drive a car with his eyes shut!) -@node etags -@section Create Your Own @file{TAGS} File -@findex etags -@cindex @file{TAGS} file, create own - -Besides @kbd{C-h f} (@code{describe-function}), another way to see the -source of a function is to type @kbd{M-.} (@code{find-tag}) and the -name of the function when prompted for it. This is a good habit to -get into. The @kbd{M-.} (@code{find-tag}) command takes you directly -to the source for a function, variable, or node. The function depends -on tags tables to tell it where to go. - -If the @code{find-tag} function first asks you for the name of a -@file{TAGS} table, give it the name of a @file{TAGS} file such as -@file{/usr/local/src/emacs/src/TAGS}. (The exact path to your -@file{TAGS} file depends on how your copy of Emacs was installed. I -just told you the location that provides both my C and my Emacs Lisp -sources.) - -You can also create your own @file{TAGS} file for directories that -lack one. - -You often need to build and install tags tables yourself. They are -not built automatically. A tags table is called a @file{TAGS} file; -the name is in upper case letters. - -You can create a @file{TAGS} file by calling the @code{etags} program -that comes as a part of the Emacs distribution. Usually, @code{etags} -is compiled and installed when Emacs is built. (@code{etags} is not -an Emacs Lisp function or a part of Emacs; it is a C program.) - -@need 1250 -To create a @file{TAGS} file, first switch to the directory in which -you want to create the file. In Emacs you can do this with the -@kbd{M-x cd} command, or by visiting a file in the directory, or by -listing the directory with @kbd{C-x d} (@code{dired}). Then run the -compile command, with @w{@code{etags *.el}} as the command to execute - -@smallexample -M-x compile RET etags *.el RET -@end smallexample - -@noindent -to create a @file{TAGS} file for Emacs Lisp. - -For example, if you have a large number of files in your -@file{~/emacs} directory, as I do---I have 137 @file{.el} files in it, -of which I load 12---you can create a @file{TAGS} file for the Emacs -Lisp files in that directory. - -@need 1250 -The @code{etags} program takes all the usual shell wildcards. For -example, if you have two directories for which you want a single -@file{TAGS} file, type @w{@code{etags *.el ../elisp/*.el}}, where -@file{../elisp/} is the second directory: - -@smallexample -M-x compile RET etags *.el ../elisp/*.el RET -@end smallexample - -@need 1250 -Type - -@smallexample -M-x compile RET etags --help RET -@end smallexample - -@noindent -to see a list of the options accepted by @code{etags} as well as a -list of supported languages. - -The @code{etags} program handles more than 20 languages, including -Emacs Lisp, Common Lisp, Scheme, C, C++, Ada, Fortran, HTML, Java, -LaTeX, Pascal, Perl, PostScript, Python, TeX, Texinfo, makefiles, and -most assemblers. The program has no switches for specifying the -language; it recognizes the language in an input file according to its -file name and contents. - -@file{etags} is very helpful when you are writing code yourself and -want to refer back to functions you have already written. Just run -@code{etags} again at intervals as you write new functions, so they -become part of the @file{TAGS} file. - -If you think an appropriate @file{TAGS} file already exists for what -you want, but do not know where it is, you can use the @code{locate} -program to attempt to find it. - -Type @w{@kbd{M-x locate @key{RET} TAGS @key{RET}}} and Emacs will list -for you the full path names of all your @file{TAGS} files. On my -system, this command lists 34 @file{TAGS} files. On the other hand, a -plain vanilla system I recently installed did not contain any -@file{TAGS} files. - -If the tags table you want has been created, you can use the @code{M-x -visit-tags-table} command to specify it. Otherwise, you will need to -create the tag table yourself and then use @code{M-x -visit-tags-table}. - -@subsubheading Building Tags in the Emacs sources -@cindex Building Tags in the Emacs sources -@cindex Tags in the Emacs sources -@findex make tags - -The GNU Emacs sources come with a @file{Makefile} that contains a -sophisticated @code{etags} command that creates, collects, and merges -tags tables from all over the Emacs sources and puts the information -into one @file{TAGS} file in the @file{src/} directory. (The -@file{src/} directory is below the top level of your Emacs directory.) - -@need 1250 -To build this @file{TAGS} file, go to the top level of your Emacs -source directory and run the compile command @code{make tags}: - -@smallexample -M-x compile RET make tags RET -@end smallexample - -@noindent -(The @code{make tags} command works well with the GNU Emacs sources, -as well as with some other source packages.) - -For more information, see @ref{Tags, , Tag Tables, emacs, The GNU Emacs -Manual}. - @node Regexp Review @section Review diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index fd4fd4f3798..8eee9e1d869 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -2290,7 +2290,7 @@ is actually typical for regexp syntax.) @cindex Recursive search/replace operations Dired mode (@kbd{M-x dired @key{RET}}, or @kbd{C-x d}) supports the -command @code{dired-do-query-replace-regexp} (@kbd{Q}), which allows +command @code{dired-do-find-regexp-and-replace} (@kbd{Q}), which allows users to replace regular expressions in multiple files. You can use this command to perform search/replace operations on @@ -2315,7 +2315,7 @@ To accept all replacements in each file, hit @kbd{!}. Another way to do the same thing is to use the ``tags'' feature of Emacs: it includes the command @code{tags-query-replace} which performs a query-replace across all the files mentioned in the @file{TAGS} file. -@xref{Tags Search,,, emacs, The GNU Emacs Manual}. +@xref{Identifier Search,,, emacs, The GNU Emacs Manual}. @node Documentation for etags @section Where is the documentation for @code{etags}? diff --git a/doc/misc/sem-user.texi b/doc/misc/sem-user.texi index a8684a40b3a..fd88c88c7eb 100644 --- a/doc/misc/sem-user.texi +++ b/doc/misc/sem-user.texi @@ -874,9 +874,9 @@ command, like this: @end example @end defun -These commands are often more accurate than the @code{find-tag} -command (@pxref{Tags,,,emacs,Emacs manual}), because the Semantic -Analyzer is context-sensitive. +These commands are often more accurate than the @code{xref-find-definitions} +command (@pxref{Looking Up Identifiers,,,emacs,Emacs manual}), because +the Semantic Analyzer is context-sensitive. You can also use @kbd{C-c , j} (@code{semantic-complete-jump-local}) and @kbd{C-c , J} (@code{semantic-complete-jump}) to navigate tags. diff --git a/doc/misc/url.texi b/doc/misc/url.texi index a3c6b88ea05..91cb6b54a84 100644 --- a/doc/misc/url.texi +++ b/doc/misc/url.texi @@ -820,12 +820,12 @@ The file transfer protocol. @xref{file/ftp}. @item ssh @cindex ssh -The secure shell protocol. @xref{Inline Methods,,, tramp, The Tramp +The secure shell protocol. @xref{Inline methods,,, tramp, The Tramp Manual}. @item scp @cindex scp -The secure file copy protocol. @xref{External Methods,,, tramp, The +The secure file copy protocol. @xref{External methods,,, tramp, The Tramp Manual}. @item rsync diff --git a/doc/misc/viper.texi b/doc/misc/viper.texi index 6b169f3c8e6..6b82653c629 100644 --- a/doc/misc/viper.texi +++ b/doc/misc/viper.texi @@ -2568,7 +2568,7 @@ above block should be commented out. Even though these commands are sometimes useful, they are no substitute for the powerful @emph{tag table} facility of Emacs. Viper's @kbd{:tag} command -in a primitive interface to Emacs tags. @xref{Tags,Tags,Tags,emacs, +in a primitive interface to Emacs tags. @xref{Tags Tables,,,emacs, The GNU Emacs Manual}, for more information on tags. The following two commands are normally bound to a mouse click and are part From b995d1edf475f2676be04eb70ec31a8c2bc28a8c Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 24 May 2016 14:37:54 -0400 Subject: [PATCH 28/39] * doc/misc/eww.texi (Advanced): Fix xref. --- doc/misc/eww.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/misc/eww.texi b/doc/misc/eww.texi index 795556b922b..7726a8d3dc4 100644 --- a/doc/misc/eww.texi +++ b/doc/misc/eww.texi @@ -251,7 +251,7 @@ variables @code{shr-color-visible-distance-min} and In addition to maintaining the history at run-time, EWW will also save the partial state of its buffers (the URIs and the titles of the pages visited) in the desktop file if one is used. @xref{Saving Emacs -Sessions, , emacs, The GNU Emacs Manual}. +Sessions,,, emacs, The GNU Emacs Manual}. @vindex eww-desktop-remove-duplicates EWW history may sensibly contain multiple entries for the same page From 4efb3e8169e8a75f3e2016c8780746785fc6b85f Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 24 May 2016 14:58:27 -0400 Subject: [PATCH 29/39] * doc/emacs/files.texi (Comparing Files): * doc/emacs/trouble.texi (Sending Patches): Fix external xrefs. --- doc/emacs/files.texi | 2 +- doc/emacs/trouble.texi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index af7a2fc2f3d..3bbb3cddb38 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -1281,7 +1281,7 @@ The value of @code{diff-switches} should be a string; the default is @c Note that the actual name of the info file is diffutils.info, @c but it adds a dir entry for diff too. @c On older systems, only "info diff" works, not "info diffutils". -@xref{Top,, Diff, diff, Comparing and Merging Files}, for more +@xref{Top,, Diff, diffutils, Comparing and Merging Files}, for more information about the @command{diff} program. The output of the @code{diff} command is shown using a major mode diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi index bff3a58651f..6f6071b446a 100644 --- a/doc/emacs/trouble.texi +++ b/doc/emacs/trouble.texi @@ -1175,7 +1175,7 @@ see @url{http://www.gnu.org/prep/standards/html_node/Change-Log-Concepts.html}, @end ifset @xref{Change Log Concepts, Change Log Concepts, -Change Log Concepts, gnu-coding-standards, GNU Coding Standards}. +Change Log Concepts, standards, GNU Coding Standards}. @item When you write the fix, keep in mind that we can't install a change that From 825ca2542e01879715cf9c112d0f04e849b8d863 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Wed, 25 May 2016 03:49:35 +0300 Subject: [PATCH 30/39] Rename vc-stay-local back to vc-cvs-stay-local * lisp/vc/vc-cvs.el (vc-cvs-stay-local): Rename back from vc-stay-local (bug#19548). Improve the docstring. (vc-cvs-stay-local-p): Update accordingly. --- lisp/vc/vc-cvs.el | 15 +++++++-------- lisp/vc/vc.el | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index 2dca708dc38..a2499a2294b 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el @@ -121,7 +121,7 @@ This is only meaningful if you don't use the implicit checkout model :version "21.1" :group 'vc-cvs) -(defcustom vc-stay-local 'only-file +(defcustom vc-cvs-stay-local 'only-file "Non-nil means use local operations when possible for remote repositories. This avoids slow queries over the network and instead uses heuristics and past information to determine the current status of a file. @@ -131,11 +131,11 @@ server, but heuristics will be used to determine the status for all other VC operations. The value can also be a regular expression or list of regular -expressions to match against the host name of a repository; then VC -only stays local for hosts that match it. Alternatively, the value -can be a list of regular expressions where the first element is the -symbol `except'; then VC always stays local except for hosts matched -by these regular expressions." +expressions to match against the host name of a repository; then +vc-cvs only stays local for hosts that match it. Alternatively, +the value can be a list of regular expressions where the first +element is the symbol `except'; then vc-cvs always stays local +except for hosts matched by these regular expressions." :type '(choice (const :tag "Always stay local" t) (const :tag "Only for file operations" only-file) (const :tag "Don't stay local" nil) @@ -789,8 +789,7 @@ If FILE is a list of files, return non-nil if any of them individually should stay local." (if (listp file) (delq nil (mapcar (lambda (arg) (vc-cvs-stay-local-p arg)) file)) - (let* ((sym (vc-make-backend-sym 'CVS 'stay-local)) - (stay-local (if (boundp sym) (symbol-value sym) vc-stay-local))) + (let ((stay-local vc-cvs-stay-local)) (if (symbolp stay-local) stay-local (let ((dirname (if (file-directory-p file) (directory-file-name file) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 25b41e34e64..790272c3d7a 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -577,8 +577,8 @@ ;; only affected back ends were SCCS and RCS. ;; ;; - vc-stay-local-p and repository-hostname are no longer part -;; of the public API. The vc-stay-local configuration variable -;; remains but only affects the CVS back end. +;; of the public API. The vc-cvs-stay-local configuration variable +;; remains and only affects the CVS back end. ;; ;; - The init-revision function and the default-initial-revision ;; variable are gone. These have't made sense on anything shipped From 897fb6fa49d5ffc85f0a796e7414a43ef05ad096 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Wed, 25 May 2016 04:01:12 +0300 Subject: [PATCH 31/39] ; 'Changes from the pre-25.1 API' copyedits --- lisp/vc/vc.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 790272c3d7a..af875e89907 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -552,7 +552,7 @@ ;; argument, since on no system since RCS has setting the initial ;; revision been even possible, let alone sane. ;; -;; INCOMPATIBLE CHANGE: In older versions of the API, vc-diff did +;; - INCOMPATIBLE CHANGE: In older versions of the API, vc-diff did ;; not take an async-mode flag as a fourth optional argument. (This ;; change eliminated a particularly ugly global.) ;; @@ -563,12 +563,12 @@ ;; SVN.) ;; ;; - INCOMPATIBLE CHANGE: The old fourth 'default-state' argument of -;; vc-dir-status-files is gone; none of the back ends actually used it. +;; dir-status-files is gone; none of the back ends actually used it. ;; -;; - vc-dir-status is no longer a public method; it has been replaced -;; by vc-dir-status-files. +;; - dir-status is no longer a public method; it has been replaced by +;; dir-status-files. ;; -;; - vc-state-heuristic is no longer a public method (the CVS backend +;; - state-heuristic is no longer a public method (the CVS backend ;; retains it as a private one). ;; ;; - the vc-mistrust-permissions configuration variable is gone; the From 3f4a9d9d262d63562cdc9dde8d157567cb7c243c Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 25 May 2016 12:47:13 -0400 Subject: [PATCH 32/39] * admin/authors.el (authors): First update the ChangeLog. * admin/make-tarball.txt: Related updates. --- admin/authors.el | 32 ++++++++++++++++++++++---------- admin/make-tarball.txt | 15 ++++++++------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/admin/authors.el b/admin/authors.el index f1aa2fa4428..b93c9b251ca 100644 --- a/admin/authors.el +++ b/admin/authors.el @@ -1361,24 +1361,36 @@ and changed by AUTHOR." (cons (list author wrote-list cowrote-list changed-list) authors-author-list))))) -(defun authors (root) +(defun authors (root &optional nologupdate) "Extract author information from change logs and Lisp source files. -ROOT is the root directory under which to find the files. If called -interactively, ROOT is read from the minibuffer. -Result is a buffer *Authors* containing authorship information, and a -buffer *Authors Errors* containing references to unknown files." - (interactive "DEmacs source directory: ") +ROOT is the root directory under which to find the files. +Interactively, read ROOT from the minibuffer. +Accurate author information requires up-to-date change logs, so this +first updates them, unless optional prefix argument NOLOGUPDATE is non-nil. +The result is a buffer *Authors* containing authorship information, +and a buffer *Authors Errors* containing references to unknown files." + (interactive "DEmacs source directory: \nP") (setq root (expand-file-name root)) + (unless (file-exists-p (expand-file-name "src/emacs.c" root)) + (unless (y-or-n-p + (format "Not the root directory of Emacs: %s, continue? " root)) + (user-error "Not the root directory"))) + ;; May contain your personal entries. + (or (not (file-exists-p (expand-file-name "ChangeLog" root))) + (y-or-n-p "Unversioned ChangeLog present, continue?") + (user-error "Unversioned ChangeLog may have irrelevant entries")) + (or nologupdate + ;; There are likely to be things that need fixing, so we update + ;; the versioned ChangeLog.N rather than the unversioned ChangeLog. + (zerop (call-process "make" nil nil nil + "-C" root "change-history-nocommit")) + (error "Problem updating ChangeLog")) (let ((logs (process-lines find-program root "-name" "ChangeLog*")) (table (make-hash-table :test 'equal)) (buffer-name "*Authors*") authors-checked-files-alist authors-invalid-file-names) (authors-add-fixed-entries table) - (unless (file-exists-p (expand-file-name "src/emacs.c" root)) - (unless (y-or-n-p - (format "Not the root directory of Emacs: %s, continue? " root)) - (error "Not the root directory"))) (dolist (log logs) (when (string-match "ChangeLog\\(.[0-9]+\\)?$" log) (message "Scanning %s..." log) diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index af18ff6a2e6..77486cc6399 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt @@ -37,14 +37,15 @@ General steps (for each step, check for possible errors): M-: (require 'authors) RET M-x authors RET + (This first updates the current versioned ChangeLog.N) + If there is an "*Authors Errors*" buffer, address the issues. - If there was a ChangeLog typo, run "make change-history" and then - fix the newest ChangeLog history file. If a file was deleted or - renamed, consider adding an appropriate entry to - authors-ignored-files, authors-valid-file-names, or + If there was a ChangeLog typo, fix the relevant entry. + If a file was deleted or renamed, consider adding an appropriate + entry to authors-ignored-files, authors-valid-file-names, or authors-renamed-files-alist. - If necessary, repeat M-x authors after making those changes. + If necessary, repeat 'C-u M-x authors' after making those changes. Save the "*Authors*" buffer as etc/AUTHORS. Check the diff looks reasonable. Maybe add entries to authors-ambiguous-files or authors-aliases, and repeat. @@ -85,8 +86,8 @@ General steps (for each step, check for possible errors): 5. Copy lisp/loaddefs.el to lisp/ldefs-boot.el. - Commit etc/AUTHORS, lisp/ldefs-boot.el, and the files changed - by M-x set-version. + Commit ChangeLog.N, etc/AUTHORS, lisp/ldefs-boot.el, and the + files changed by M-x set-version. If someone else made a commit between step 1 and now, you need to repeat from step 4 onwards. (You can commit the files From 42275df3dff4b81c7c6aa15df84deace9cfc9d6f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 25 May 2016 10:39:14 -0700 Subject: [PATCH 33/39] * doc/misc/texinfo.tex: Revert previous change (Bug#23611). --- doc/misc/texinfo.tex | 56 +++++++++++++++++--------------------------- 1 file changed, 22 insertions(+), 34 deletions(-) diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex index 314063cafe1..37e2de896ec 100644 --- a/doc/misc/texinfo.tex +++ b/doc/misc/texinfo.tex @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2016-05-07.20} +\def\texinfoversion{2016-04-14.07} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, @@ -67,10 +67,6 @@ \everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} -% LaTeX's \typeout. This ensures that the messages it is used for -% are identical in format to the corresponding ones from latex/pdflatex. -\def\typeout{\immediate\write17}% - \chardef\other=12 % We never want plain's \outer definition of \+ in Texinfo. @@ -1538,6 +1534,7 @@ % % PDF outline support % + \pdfmakepagedesttrue \relax % Emulate the primitive of pdfTeX \def\pdfdest name#1 xyz{% \special{pdf:dest (name#1) [@thispage /XYZ @xpos @ypos]}% @@ -3273,8 +3270,8 @@ % @{ @} @lbracechar{} @rbracechar{} all generate brace characters. % Unless we're in typewriter, use \ecfont because the CM text fonts do % not have braces, and we don't want to switch into math. -\def\mylbrace{{\ifmonospace\char123\else\ensuremath\lbrace\fi}} -\def\myrbrace{{\ifmonospace\char125\else\ensuremath\rbrace\fi}} +\def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}} +\def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}} \let\{=\mylbrace \let\lbracechar=\{ \let\}=\myrbrace \let\rbracechar=\} \begingroup @@ -4756,7 +4753,7 @@ \def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx} \def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}} -% Used when writing an index entry out to an index file to prevent +% Used when writing an index entry out to an index file, to prevent % expansion of Texinfo commands that can appear in an index entry. % \def\indexdummies{% @@ -4892,9 +4889,12 @@ % % We want to disable all macros so that they are not expanded by \write. \macrolist - \definedummyword\value % \normalturnoffactive + % + % Handle some cases of @value -- where it does not contain any + % (non-fully-expandable) commands. + \makevalueexpandable } % \commondummiesnofonts: common to \commondummies and \indexnofonts. @@ -5159,10 +5159,9 @@ \ifx\suffix\indexisfl\def\suffix{f1}\fi % Open the file \immediate\openout\csname#1indfile\endcsname \jobname.\suffix - % Using \immediate above here prevents an object entering into the current - % box, which could confound checks such as those in \safewhatsit for - % preceding skips. - \typeout{Writing index file \jobname.\suffix}% + % Using \immediate here prevents an object entering into the current box, + % which could confound checks such as those in \safewhatsit for preceding + % skips. \fi} \def\indexisfl{fl} @@ -5370,7 +5369,6 @@ % index. The easiest way to prevent this problem is to make sure % there is some text. \putwordIndexNonexistent - \typeout{No file \jobname.\indexname s.}% \else \catcode`\\ = 0 % @@ -6684,14 +6682,7 @@ % 1 and 2 (the page numbers aren't printed), and so are the first % two pages of the document. Thus, we'd have two destinations named % `1', and two named `2'. - \ifpdf - \global\pdfmakepagedesttrue - \else - \ifx\XeTeXrevision\thisisundefined - \else - \global\pdfmakepagedesttrue - \fi - \fi + \ifpdf \global\pdfmakepagedesttrue \fi } @@ -8871,7 +8862,6 @@ % include an _ in the xref name, etc. \indexnofonts \turnoffactive - \def\value##1{##1}% \expandafter\global\expandafter\let\expandafter\Xthisreftitle \csname XR#1-title\endcsname }% @@ -9012,14 +9002,14 @@ \fi\fi\fi } -% \refx{NAME}{SUFFIX} - reference a cross-reference string named NAME. SUFFIX -% is output afterwards if non-empty. +% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. +% If its value is nonempty, SUFFIX is output afterward. +% \def\refx#1#2{% \requireauxfile {% \indexnofonts \otherbackslash - \def\value##1{##1}% \expandafter\global\expandafter\let\expandafter\thisrefX \csname XR#1\endcsname }% @@ -9044,18 +9034,16 @@ #2% Output the suffix in any case. } -% This is the macro invoked by entries in the aux file. Define a control -% sequence for a cross-reference target (we prepend XR to the control sequence -% name to avoid collisions). The value is the page number. If this is a float -% type, we have more work to do. +% This is the macro invoked by entries in the aux file. Usually it's +% just a \def (we prepend XR to the control sequence name to avoid +% collisions). But if this is a float type, we have more work to do. % \def\xrdef#1#2{% - {% Expand the node or anchor name to remove control sequences. - % \turnoffactive stops 8-bit characters being changed to commands - % like @'e. \refx does the same to retrieve the value in the definition. + {% The node name might contain 8-bit characters, which in our current + % implementation are changed to commands like @'e. Don't let these + % mess up the control sequence name. \indexnofonts \turnoffactive - \def\value##1{##1}% \xdef\safexrefname{#1}% }% % From 3c79e51821720a32782a7601d01b7e97a110dc67 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 25 May 2016 14:17:25 -0400 Subject: [PATCH 34/39] * admin/admin.el (add-release-logs): Generate ChangeLog if needed. --- admin/admin.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/admin/admin.el b/admin/admin.el index a3d56277918..33b0808f4fa 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -47,8 +47,9 @@ Optional argument DATE is the release date, default today." ;; your own personal one. Perhaps we should move any existing file ;; and unconditionally call make ChangeLog? ;; Or make ChangeLog CHANGELOG=temp and compare with the existing? - (unless (file-exists-p (expand-file-name "ChangeLog" root)) - (user-error "No top-level ChangeLog - run \"make ChangeLog\" first")) + (or (file-exists-p (expand-file-name "ChangeLog" root)) + (zerop (call-process "make" nil nil nil "-C" root "ChangeLog")) + (error "Problem generating ChangeLog")) (require 'add-log) (or date (setq date (funcall add-log-time-format nil t))) (let* ((logs (process-lines "find" root "-name" "ChangeLog")) From 5fa80cfe9fc1b7056b5cbf7fa6a44a23611d6f01 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 25 May 2016 14:35:44 -0400 Subject: [PATCH 35/39] * build-aux/gitlog-to-emacslog: Handle empty generated ChangeLog. This is relevant for M-x add-release-logs right after M-x authors. --- build-aux/gitlog-to-emacslog | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/build-aux/gitlog-to-emacslog b/build-aux/gitlog-to-emacslog index 5c187f5eae0..345c37f63da 100755 --- a/build-aux/gitlog-to-emacslog +++ b/build-aux/gitlog-to-emacslog @@ -81,7 +81,7 @@ test -d .git || { --ignore-line='^; ' --format='%B' \ "$gen_origin..$new_origin" >"ChangeLog.tmp" || exit -if test -s "ChangeLog.tmp"; then +if test -e "ChangeLog.tmp"; then # Fix up bug references. # This would be better as eg a --transform option to gitlog-to-changelog, @@ -99,7 +99,7 @@ if test -s "ChangeLog.tmp"; then ` start_year= end_year= - for year in $years; do + for year in ${years:-`date +%Y`}; do : ${start_year:=$year} end_year=$year done @@ -110,13 +110,19 @@ if test -s "ChangeLog.tmp"; then year_range=$start_year-$end_year fi - # Update gen_origin and append a proper copyright notice. - sed -n ' - 1i\ + # Update gen_origin + if test "$gen_origin" != "$new_origin"; then + sed -n ' + 1i\ - /^This file records repository revisions/p - s/^commit [0-9a-f]* (exclusive)/commit '"$gen_origin"' (exclusive)/p - s/^commit [0-9a-f]* (inclusive)/commit '"$new_origin"' (inclusive)/p + /^This file records repository revisions/p + s/^commit [0-9a-f]* (exclusive)/commit '"$gen_origin"' (exclusive)/p + s/^commit [0-9a-f]* (inclusive)/commit '"$new_origin"' (inclusive)/p + ' >"ChangeLog.tmp" || exit + fi + + # Append a proper copyright notice. + sed -n ' /^See ChangeLog.[0-9]* for earlier/,${ s/ChangeLog\.[0-9]*/ChangeLog.'$nmax'/ s/\(Copyright[ (C)]*\)[0-9]*-[0-9]*/\1'"$year_range"'/ From 853b9b92072e9eff11aff9c0110380c9a93864ca Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 25 May 2016 14:45:05 -0400 Subject: [PATCH 36/39] * admin/admin.el (add-release-logs): Basic check of existing ChangeLog. --- admin/admin.el | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/admin/admin.el b/admin/admin.el index 33b0808f4fa..4af1ff9003a 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -43,13 +43,19 @@ Optional argument DATE is the release date, default today." (setq root (expand-file-name root)) (unless (file-exists-p (expand-file-name "src/emacs.c" root)) (user-error "%s doesn't seem to be the root of an Emacs source tree" root)) - ;; FIXME this does not check that a ChangeLog that exists is not - ;; your own personal one. Perhaps we should move any existing file - ;; and unconditionally call make ChangeLog? - ;; Or make ChangeLog CHANGELOG=temp and compare with the existing? - (or (file-exists-p (expand-file-name "ChangeLog" root)) - (zerop (call-process "make" nil nil nil "-C" root "ChangeLog")) - (error "Problem generating ChangeLog")) + (let ((clog (expand-file-name "ChangeLog" root))) + (if (file-exists-p clog) + ;; Basic check that a ChangeLog that exists is not your personal one. + ;; TODO Perhaps we should move any existing file and unconditionally + ;; call make ChangeLog? Or make ChangeLog CHANGELOG=temp and compare + ;; with the existing? + (with-temp-buffer + (insert-file-contents clog) + (or (re-search-forward "^[ \t]*Copyright.*Free Software" nil t) + (user-error "ChangeLog looks like a personal one - remove it?"))) + (or + (zerop (call-process "make" nil nil nil "-C" root "ChangeLog")) + (error "Problem generating ChangeLog")))) (require 'add-log) (or date (setq date (funcall add-log-time-format nil t))) (let* ((logs (process-lines "find" root "-name" "ChangeLog")) From 0be672542ad60e6c73d36b7fdc1b6786786595ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Bela=C3=AFche?= Date: Wed, 25 May 2016 23:42:54 +0200 Subject: [PATCH 37/39] Document problem: slow screen refresh on missing font. See discussion of bug#22519 for more on this. --- etc/PROBLEMS | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 31f38e3980d..84d39a490a8 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -749,6 +749,20 @@ the following variables: tex-font-script-display (how much to lower/raise); tex-suscript-height-ratio (how much smaller than normal); tex-suscript-height-minimum (minimum height). +** Screen refresh is slow when there are special characters for which no suitable font is available + +If the display is too slow in refreshing when you scroll to a new +region, or when you edit the buffer, it might be due to the fact that +some characters cannot be displayed in the default font, and Emacs is +spending too much time in looking for a suitable font to display them. + +You can suspect this if you have several characters that are displayed +as small rectangles containing a hexadecimal code inside. + +The solution is to install the appropriate fonts on your machine. For +instance if you are editing a text with a lot of math symbols, then +installing a font like 'Symbola' should solve this problem. + * Internationalization problems ** M-{ does not work on a Spanish PC keyboard. From a4d882cd09507fa1f891984fc7435923de3566fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Bela=C3=AFche?= Date: Thu, 26 May 2016 11:03:21 +0200 Subject: [PATCH 38/39] Correct old cell name unbinding when renaming cell. Bug is to unbind old cell names when renaming a cell with 'makunbound'. when the old cell name is of A1 type, then 'kill-local-variable' must be used instead, so that only the current spreadsheet is affected. When the old cell name is a renamed cell, then 'ses--unbind-cell-name' must be used in order to remove the old name from the name hashmap. * ses.el (ses-rename-cell): check consistency of cell symbol from text-property and from array object. Instead of 'makunbound', use either 'ses--unbind-cell-name' or 'kill-local-variable' depending on whether the cell old name is a named cell or an A1 type cell --- lisp/ses.el | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/lisp/ses.el b/lisp/ses.el index 50101945f34..ab9f0715fd8 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -3454,9 +3454,18 @@ highlighted range in the spreadsheet." (setq cell (or cell (ses-get-cell row col)) old-name (ses-cell-symbol cell) new-rowcol (ses-decode-cell-symbol (symbol-name new-name))) + ;; when ses-rename-cell is called interactively, then 'sym' is the + ;; 'cursor-intangible' property of text at cursor position, while + ;; 'old-name' is the symbol stored in array cell at coordinate + ;; 'rowcol' corresponding to 'ses-cell' property of symbol + ;; 'sym'. Both must be the same. + (unless (eq sym old-name) + (error "Spreadsheet is broken, both symbols %S and %S refering to cell (%d,%d)" sym old-name row col)) (if new-rowcol + ;; the new name is of A1 type, so we test that the coordinate + ;; inferred from new name (if (equal new-rowcol rowcol) - (put new-name 'ses-cell rowcol) + (put new-name 'ses-cell rowcol) (error "Not a valid name for this cell location")) (setq ses--named-cell-hashmap (or ses--named-cell-hashmap (make-hash-table :test 'eq))) @@ -3470,7 +3479,7 @@ highlighted range in the spreadsheet." (setf (ses-cell-formula xcell) (ses-replace-name-in-formula (ses-cell-formula xcell) - sym + old-name new-name)))) ;; Replace name by new name in reference list of cells to which renamed ;; cell refers to. @@ -3478,11 +3487,14 @@ highlighted range in the spreadsheet." (let* ((x (ses-sym-rowcol ref)) (xcell (ses-get-cell (car x) (cdr x)))) (setf (ses-cell-references xcell) - (cons new-name (delq sym + (cons new-name (delq old-name (ses-cell-references xcell)))))) (set (make-local-variable new-name) (symbol-value sym)) (setf (ses-cell--symbol cell) new-name) - (makunbound sym) + ;; Unbind old name + (if (eq (get old-name 'ses-cell) :ses-named) + (ses--unbind-cell-name old-name) + (kill-local-variable old-name)) (and curcell (setq ses--curcell new-name)) (save-excursion (or curcell (ses-goto-print row col)) From c3489d050405ccb026cd44a280ead3a5f6b456d9 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 26 May 2016 14:57:29 -0400 Subject: [PATCH 39/39] * lisp/w32-fns.el (set-message-beep, w32-get-locale-info) (w32-get-valid-locale-ids): Improve declarations. --- lisp/w32-fns.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/w32-fns.el b/lisp/w32-fns.el index 472355741b8..0f31c4a668d 100644 --- a/lisp/w32-fns.el +++ b/lisp/w32-fns.el @@ -31,9 +31,9 @@ ;;;; Function keys -(declare-function set-message-beep "w32fns.c") -(declare-function w32-get-locale-info "w32proc.c") -(declare-function w32-get-valid-locale-ids "w32proc.c") +(declare-function set-message-beep "w32fns.c" (sound)) +(declare-function w32-get-locale-info "w32proc.c" (lcid &optional longform)) +(declare-function w32-get-valid-locale-ids "w32proc.c" ()) ;; Map all versions of a filename (8.3, longname, mixed case) to the ;; same buffer.