From e2406ff60f0fc061330c8b4dc430d1c8d94e6a79 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 10 May 2020 19:04:51 +0300 Subject: [PATCH 01/11] * lisp/dired.el (dired-toggle-marks): Doc fix. (Bug#41097) --- lisp/dired.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/dired.el b/lisp/dired.el index f2d478e83c6..4d0c2abdf55 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3641,8 +3641,8 @@ in the active region." (defun dired-toggle-marks () "Toggle marks: marked files become unmarked, and vice versa. -Files marked with other flags (such as `D') are not affected. -`.' and `..' are never toggled. +Flagged files (indicated with flags such as `C' and `D', not +with `*') are not affected, and `.' and `..' are never toggled. As always, hidden subdirs are not affected." (interactive) (save-excursion From 632aa9d57a53399088016c0cf29621653b61d7aa Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 10 May 2020 08:47:47 -0700 Subject: [PATCH 02/11] =?UTF-8?q?Go=20back=20to=20=E2=80=9CBah=C3=A1?= =?UTF-8?q?=E2=80=99=C3=AD=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/emacs/calendar.texi (Holidays): Revert previous change, as bahai.org spells it “Bahá’í” (with U+2019 RIGHT SINGLE QUOTATION MARK) and that’s good enough for us. --- doc/emacs/calendar.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/emacs/calendar.texi b/doc/emacs/calendar.texi index 8dc1a0b2df8..fe51ad35d77 100644 --- a/doc/emacs/calendar.texi +++ b/doc/emacs/calendar.texi @@ -532,7 +532,7 @@ holidays centered around a different month, use @kbd{C-u M-x holidays}, which prompts for the month and year. The holidays known to Emacs include United States holidays and the -major Bah@'{a}@t{'}@'{i}, Chinese, Christian, Islamic, and Jewish +major Bahá'í, Chinese, Christian, Islamic, and Jewish holidays; also the solstices and equinoxes. @findex list-holidays From 3d819956923ecbbc79f5b3ac154109a7ec7150b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Tue, 12 May 2020 19:33:19 +0100 Subject: [PATCH 03/11] Fix docstring of flymake-make-diagnostic (bug#40351) * lisp/progmodes/flymake.el (flymake-make-diagnostic): Fix docstring --- lisp/progmodes/flymake.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 7fca9dac1af..1ed733b7e37 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -313,9 +313,10 @@ generated it." &optional data overlay-properties) "Make a Flymake diagnostic for BUFFER's region from BEG to END. -TYPE is a key to symbol and TEXT is a description of the problem -detected in this region. DATA is any object that the caller -wishes to attach to the created diagnostic for later retrieval. +TYPE is a diagnostic symbol and TEXT is string describing the +problem detected in this region. DATA is any object that the +caller wishes to attach to the created diagnostic for later +retrieval. OVERLAY-PROPERTIES is an alist of properties attached to the created diagnostic, overriding the default properties and any From a37290a6f965d0e0c13a734e6be973e1bd43bb7f Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Wed, 13 May 2020 10:31:50 +0200 Subject: [PATCH 04/11] In x_hide_tip reset tip_last_frame for GTK+ tooltips only (Bug#41200) * src/xfns.c (x_hide_tip): Reset tip_last_frame only when using GTK+ system tooltips (Bug#41200). --- src/xfns.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/xfns.c b/src/xfns.c index a5431aa8909..b89fac1cdac 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -6746,9 +6746,11 @@ x_hide_tip (bool delete) } } - /* Reset tip_last_frame, it will be reassigned when showing the - next GTK+ system tooltip. */ - tip_last_frame = Qnil; + /* When using GTK+ system tooltips (compare Bug#41200) reset + tip_last_frame. It will be reassigned when showing the next + GTK+ system tooltip. */ + if (x_gtk_use_system_tooltips) + tip_last_frame = Qnil; /* Now look whether there's an Emacs tip around. */ if (FRAMEP (tip_frame)) From 48830c73e77255985685bd2df65f031cd115e069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pit-Claudel?= Date: Wed, 13 May 2020 10:37:05 -0400 Subject: [PATCH 05/11] Fix a crash in handle_display_spec * src/xdisp.c (handle_display_spec): Check that the cdr of the disable-eval spec is a cons before taking its car. (Bug#41232) --- src/xdisp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xdisp.c b/src/xdisp.c index b0fbc9936fb..1e865898e37 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -5104,7 +5104,7 @@ handle_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, if (CONSP (spec) && EQ (XCAR (spec), Qdisable_eval)) { enable_eval = false; - spec = XCAR (XCDR (spec)); + spec = CONSP (XCDR (spec)) ? XCAR (XCDR (spec)) : Qnil; } if (CONSP (spec) From 747e0a2523e474c76410430c40cb9b04500218d4 Mon Sep 17 00:00:00 2001 From: Simon Lang Date: Tue, 12 May 2020 22:54:52 +0100 Subject: [PATCH 06/11] Improve ediff readability in misterioso theme (Bug#41221) * etc/themes/misterioso-theme.el: Add ediff faces. Copyright-paperwork-exempt: yes --- etc/themes/misterioso-theme.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/etc/themes/misterioso-theme.el b/etc/themes/misterioso-theme.el index df8895385d2..b51c9b8e58b 100644 --- a/etc/themes/misterioso-theme.el +++ b/etc/themes/misterioso-theme.el @@ -63,6 +63,13 @@ `(button ((,class (:underline t)))) `(link ((,class (:foreground "#59e9ff" :underline t)))) `(link-visited ((,class (:foreground "#ed74cd" :underline t)))) + ;; Ediff + `(ediff-even-diff-A ((,class (:background "#1d2430")))) + `(ediff-even-diff-B ((,class (:background "#1d2430")))) + `(ediff-even-diff-C ((,class (:background "#1d2430")))) + `(ediff-odd-diff-A ((,class (:background "#415160")))) + `(ediff-odd-diff-B ((,class (:background "#415160")))) + `(ediff-odd-diff-C ((,class (:background "#415160")))) ;; Gnus faces `(gnus-group-news-1 ((,class (:foreground "#ff4242" :weight bold)))) `(gnus-group-news-1-low ((,class (:foreground "#ff4242")))) From 406fb0746c8b54869302d50b2327333769b7604b Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Thu, 14 May 2020 19:26:43 +0200 Subject: [PATCH 07/11] Fix documentation related to 'command-switch-alist'. While there, add a unit test to verify the behavior. * doc/lispref/os.texi (Command-Line Arguments): Fix documentation: the option string in 'command-switch-alist' does include leading hyphens. Also mention that 'command-switch-alist' parsing ignores equals signs in options. * test/lisp/startup-tests.el (startup-tests/command-switch-alist): New unit test. --- doc/lispref/os.texi | 10 +++++++- test/lisp/startup-tests.el | 47 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 test/lisp/startup-tests.el diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 92684c8993e..97b8b532fea 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -613,7 +613,7 @@ The elements of the @code{command-switch-alist} look like this: @end example The @sc{car}, @var{option}, is a string, the name of a command-line -option (not including the initial hyphen). The @var{handler-function} +option (including the initial hyphen). The @var{handler-function} is called to handle @var{option}, and receives the option name as its sole argument. @@ -623,6 +623,14 @@ remaining command-line arguments in the variable @code{command-line-args-left} (see below). (The entire list of command-line arguments is in @code{command-line-args}.) +Note that the handling of @code{command-switch-alist} doesn't treat +equals signs in @var{option} specially. That is, if there's an option +like @code{--name=value} on the command line, then only a +@code{command-switch-alist} member whose @code{car} is literally +@code{--name=value} will match this option. If you want to parse such +options, you need to use @code{command-line-functions} instead (see +below). + The command-line arguments are parsed by the @code{command-line-1} function in the @file{startup.el} file. See also @ref{Emacs Invocation, , Command Line Arguments for Emacs Invocation, emacs, The diff --git a/test/lisp/startup-tests.el b/test/lisp/startup-tests.el new file mode 100644 index 00000000000..314ffc93e4a --- /dev/null +++ b/test/lisp/startup-tests.el @@ -0,0 +1,47 @@ +;;; startup-tests.el --- unit tests for startup.el -*- lexical-binding: t; -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; Author: Philipp Stephani + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;; Unit tests for startup.el. + +;;; Code: + +(ert-deftest startup-tests/command-switch-alist () + (let* ((foo-args ()) (bar-args ()) + (command-switch-alist + (list (cons "--foo" + (lambda (arg) + (ert-info ("Processing argument --foo") + (push arg foo-args) + (should (equal command-line-args-left + '("value" "--bar=value"))) + (pop command-line-args-left)))) + (cons "--bar=value" + (lambda (arg) + (ert-info ("Processing argument --bar") + (push arg bar-args) + (should-not command-line-args-left))))))) + (command-line-1 '("--foo" "value" "--bar=value")) + (should (equal foo-args '("--foo"))) + (should (equal bar-args '("--bar=value"))))) + +;;; startup-tests.el ends here From e75f6be6cc117b0a30158a47c3231035f8ccdc20 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Fri, 15 May 2020 00:03:18 +0200 Subject: [PATCH 08/11] Fix dired default file operation (bug#41261) * lisp/dired-aux.el (dired-dwim-target-directories): Restore pre-emacs-27 behavior of 'dired-dwim-target'. --- lisp/dired-aux.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 0069c1744dc..7f988540c2c 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -2002,10 +2002,9 @@ Optional arg HOW-TO determines how to treat the target. (format prompt (dired-mark-prompt arg files)) dir default)) (defun dired-dwim-target-directories () - (cond ((functionp dired-dwim-target) - (funcall dired-dwim-target)) - (dired-dwim-target - (dired-dwim-target-next)))) + (if (functionp dired-dwim-target) + (funcall dired-dwim-target) + (dired-dwim-target-next))) (defun dired-dwim-target-next (&optional all-frames) ;; Return directories from all next windows with dired-mode buffers. From 28541674cdff8e4d1587391ac66818c56885f083 Mon Sep 17 00:00:00 2001 From: Tassilo Horn Date: Fri, 15 May 2020 22:24:29 +0200 Subject: [PATCH 09/11] Consider face inheritance when checking region face background. Some themes (like dracula) make the region face inherit from some other face. If the background color of the region was inherited, `indicate-copied-region' did the switch-point-and-mark-twice dance which is not visible in case the region is highlighted. It just looked like Emacs would hang for a second after M-w. * lisp/simple.el (indicate-copied-region): Consider face inheritance when checking region face background. --- lisp/simple.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/simple.el b/lisp/simple.el index ab277c4e115..e8bf77c7e6a 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4852,7 +4852,7 @@ of this sample text; it defaults to 40." ;; Swap point-and-mark quickly so as to show the region that ;; was selected. Don't do it if the region is highlighted. (unless (and (region-active-p) - (face-background 'region)) + (face-background 'region nil t)) ;; Swap point and mark. (set-marker (mark-marker) (point) (current-buffer)) (goto-char mark) From efd4e973a4f0c7fe9442b677c6fdeebb347e2b9d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 16 May 2020 10:30:43 +0300 Subject: [PATCH 10/11] Reflect the emacs-devel ELPA/MELPA dispute in FAQ * doc/misc/efaq.texi (Packages that do not come with Emacs): Warn that some MELPA packages may require non-free software. --- doc/misc/efaq.texi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index 962f76d1796..132e8ffaa93 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -3479,7 +3479,10 @@ There are other, non-GNU, Emacs Lisp package servers, including: @uref{https://marmalade-repo.org, Marmalade}. To use additional package servers, customize the @code{package-archives} variable. Be aware that installing a package can run arbitrary code, so only add -sources that you trust. +sources that you trust. Also, packages hosted on non-GNU package +servers may encourage or require you to install and use non-free +software; for example, MELPA is known to host some packages that do +this. The @uref{https://lists.gnu.org/mailman/listinfo/gnu-emacs-sources, GNU Emacs sources mailing list}, which is gatewayed to the From b4937f64cd97ff6bf93538987c014f8ea8ff9d34 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 16 May 2020 11:54:37 +0300 Subject: [PATCH 11/11] Improve documentation of manually installing Lisp packages * doc/emacs/building.texi (Lisp Libraries): Describe how to manually load packages in the init file. Mention the 'site-lisp' subdirectory of the default 'load-path'. * doc/emacs/package.texi (Packages): Describe manual installation of ELisp packages. Suggested by Jean-Christophe Helary . --- doc/emacs/building.texi | 32 ++++++++++++++++++++++++++++++++ doc/emacs/package.texi | 32 +++++++++++++++++++++++--------- 2 files changed, 55 insertions(+), 9 deletions(-) diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index e866eea4a29..fa60ce26621 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi @@ -1509,6 +1509,11 @@ putting a line like this in your init file (@pxref{Init File}): (add-to-list 'load-path "/path/to/my/lisp/library") @end example +It is customary to put locally installed libraries in the +@file{site-lisp} directory that is already in the default value of +@code{load-path}, or in some subdirectory of @file{site-lisp}. This +way, you don't need to modify the default value of @code{load-path}. + @cindex autoload Some commands are @dfn{autoloaded}; when you run them, Emacs automatically loads the associated library first. For instance, the @@ -1538,6 +1543,33 @@ compiled with XEmacs, a modified version of Emacs---they can cause Emacs to crash. Set the variable @code{load-dangerous-libraries} to @code{t} if you want to try loading them. + Once you put your library in a directory where Emacs can find and +load it, you may wish to make it available at startup. This is useful +when the library defines features that should be available +automatically on demand, and manually loading the library is thus +inconvenient. In these cases, make sure the library will be loaded by +adding suitable forms to your init file: either @code{load} or +@code{require} (if you always need to load the library at startup), or +@code{autoload} if you need Emacs to load the library when some +command or function is invoked. For example: + +@smalllisp +@group + ;; Loads @file{my-shining-package.elc} unconditionally. + (require 'my-shining-package) +@end group +@group + ;; Will load @file{my-shining-package.elc} when @code{my-func} is invoked. + (autoload 'my-func "my-shining-package") +@end group +@end smalllisp + + Note that installing a package using @code{package-install} +(@pxref{Package Installation}) takes care of placing the package's +Lisp files in a directory where Emacs will find it, and also writes +the necessary initialization code into your init files, making the +above manual customizations unnecessary. + @node Lisp Eval @section Evaluating Emacs Lisp Expressions @cindex Emacs Lisp mode diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi index 6bf4fc7e10c..517d2b75aa2 100644 --- a/doc/emacs/package.texi +++ b/doc/emacs/package.texi @@ -5,23 +5,37 @@ @node Packages @chapter Emacs Lisp Packages @cindex Package -@cindex Emacs Lisp package archive @cindex Package archive -Emacs includes a facility that lets you easily download and install -@dfn{packages} that implement additional features. Each package is a -separate Emacs Lisp program, sometimes including other components such -as an Info manual. + Emacs is extended by implementing additional features in +@dfn{packages}, which are Emacs Lisp libraries. These could be +written by you or provided by someone else. If you want to install +such a package so it is available in your future Emacs session, you +need to compile it and put it in a directory where Emacs looks for +Lisp libraries. @xref{Lisp Libraries}, for more details about this +manual installation method. Many packages provide installation and +usage instructions in the large commentary near the beginning of the +Lisp file; you can use those instructions for installing and +fine-tuning your use of the package. - @kbd{M-x list-packages} brings up a buffer named @file{*Packages*} -with a list of all packages. You can install or uninstall packages -via this buffer. @xref{Package Menu}. +@cindex Emacs Lisp package archive + Packages can also be provided by @dfn{package archives}, which are +large collections of Emacs Lisp packages. Each package is a separate +Emacs Lisp program, sometimes including other components such as an +Info manual. Emacs includes a facility that lets you easily download +and install packages from such archives. The rest of this chapter +describes this facility. + + To list the packages available for installation from package +archives, type @w{@kbd{M-x list-packages @key{RET}}}. It brings up a +buffer named @file{*Packages*} with a list of all packages. You can +install or uninstall packages via this buffer. @xref{Package Menu}. The command @kbd{C-h P} (@code{describe-package}) prompts for the name of a package, and displays a help buffer describing the attributes of the package and the features that it implements. - By default, Emacs downloads packages from a @dfn{package archive} + By default, Emacs downloads packages from a package archive maintained by the Emacs developers and hosted by the GNU project. Optionally, you can also download packages from archives maintained by third parties. @xref{Package Installation}.