aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2020-05-16 10:29:14 -0700
committerGlenn Morris2020-05-16 10:29:14 -0700
commit788c2480f448e97773172f3e840976dbcdc3e6c8 (patch)
tree60d3425a657e682da7790fc5f0d2548995721ef2
parenta67415a71a1be5419547ac5e2abe51bc6bb37f1d (diff)
parentb4937f64cd97ff6bf93538987c014f8ea8ff9d34 (diff)
downloademacs-788c2480f448e97773172f3e840976dbcdc3e6c8.tar.gz
emacs-788c2480f448e97773172f3e840976dbcdc3e6c8.zip
Merge from origin/emacs-27
b4937f64cd (origin/emacs-27) Improve documentation of manually instal... efd4e973a4 Reflect the emacs-devel ELPA/MELPA dispute in FAQ 28541674cd Consider face inheritance when checking region face backgr... e75f6be6cc Fix dired default file operation (bug#41261) 406fb0746c Fix documentation related to 'command-switch-alist'. 747e0a2523 Improve ediff readability in misterioso theme (Bug#41221) 48830c73e7 Fix a crash in handle_display_spec a37290a6f9 In x_hide_tip reset tip_last_frame for GTK+ tooltips only ... 3d81995692 Fix docstring of flymake-make-diagnostic (bug#40351) 632aa9d57a Go back to “Bahá’í” e2406ff60f * lisp/dired.el (dired-toggle-marks): Doc fix. (Bug#41097) # Conflicts: # doc/emacs/building.texi
-rw-r--r--doc/emacs/building.texi32
-rw-r--r--doc/emacs/calendar.texi2
-rw-r--r--doc/emacs/package.texi32
-rw-r--r--doc/lispref/os.texi10
-rw-r--r--doc/misc/efaq.texi5
-rw-r--r--etc/themes/misterioso-theme.el7
-rw-r--r--lisp/dired-aux.el7
-rw-r--r--lisp/dired.el4
-rw-r--r--lisp/progmodes/flymake.el7
-rw-r--r--lisp/simple.el2
-rw-r--r--src/xdisp.c2
-rw-r--r--src/xfns.c8
-rw-r--r--test/lisp/startup-tests.el47
13 files changed, 139 insertions, 26 deletions
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi
index 77a0e807c2b..7074bd45d71 100644
--- a/doc/emacs/building.texi
+++ b/doc/emacs/building.texi
@@ -1541,6 +1541,11 @@ putting a line like this in your init file (@pxref{Init File}):
1541(add-to-list 'load-path "/path/to/my/lisp/library") 1541(add-to-list 'load-path "/path/to/my/lisp/library")
1542@end example 1542@end example
1543 1543
1544It is customary to put locally installed libraries in the
1545@file{site-lisp} directory that is already in the default value of
1546@code{load-path}, or in some subdirectory of @file{site-lisp}. This
1547way, you don't need to modify the default value of @code{load-path}.
1548
1544@cindex autoload 1549@cindex autoload
1545 Some commands are @dfn{autoloaded}; when you run them, Emacs 1550 Some commands are @dfn{autoloaded}; when you run them, Emacs
1546automatically loads the associated library first. For instance, the 1551automatically loads the associated library first. For instance, the
@@ -1563,6 +1568,33 @@ Automatic loading also occurs when completing names for
1563prefix being completed. To disable this feature, change the variable 1568prefix being completed. To disable this feature, change the variable
1564@code{help-enable-completion-autoload} to @code{nil}. 1569@code{help-enable-completion-autoload} to @code{nil}.
1565 1570
1571 Once you put your library in a directory where Emacs can find and
1572load it, you may wish to make it available at startup. This is useful
1573when the library defines features that should be available
1574automatically on demand, and manually loading the library is thus
1575inconvenient. In these cases, make sure the library will be loaded by
1576adding suitable forms to your init file: either @code{load} or
1577@code{require} (if you always need to load the library at startup), or
1578@code{autoload} if you need Emacs to load the library when some
1579command or function is invoked. For example:
1580
1581@smalllisp
1582@group
1583 ;; Loads @file{my-shining-package.elc} unconditionally.
1584 (require 'my-shining-package)
1585@end group
1586@group
1587 ;; Will load @file{my-shining-package.elc} when @code{my-func} is invoked.
1588 (autoload 'my-func "my-shining-package")
1589@end group
1590@end smalllisp
1591
1592 Note that installing a package using @code{package-install}
1593(@pxref{Package Installation}) takes care of placing the package's
1594Lisp files in a directory where Emacs will find it, and also writes
1595the necessary initialization code into your init files, making the
1596above manual customizations unnecessary.
1597
1566@node Lisp Eval 1598@node Lisp Eval
1567@section Evaluating Emacs Lisp Expressions 1599@section Evaluating Emacs Lisp Expressions
1568@cindex Emacs Lisp mode 1600@cindex Emacs Lisp mode
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
532holidays}, which prompts for the month and year. 532holidays}, which prompts for the month and year.
533 533
534 The holidays known to Emacs include United States holidays and the 534 The holidays known to Emacs include United States holidays and the
535major Bah@'{a}@t{'}@'{i}, Chinese, Christian, Islamic, and Jewish 535major Bahá'í, Chinese, Christian, Islamic, and Jewish
536holidays; also the solstices and equinoxes. 536holidays; also the solstices and equinoxes.
537 537
538@findex list-holidays 538@findex list-holidays
diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi
index 91e44b8eba8..453d9eb4010 100644
--- a/doc/emacs/package.texi
+++ b/doc/emacs/package.texi
@@ -5,23 +5,37 @@
5@node Packages 5@node Packages
6@chapter Emacs Lisp Packages 6@chapter Emacs Lisp Packages
7@cindex Package 7@cindex Package
8@cindex Emacs Lisp package archive
9@cindex Package archive 8@cindex Package archive
10 9
11Emacs includes a facility that lets you easily download and install 10 Emacs is extended by implementing additional features in
12@dfn{packages} that implement additional features. Each package is a 11@dfn{packages}, which are Emacs Lisp libraries. These could be
13separate Emacs Lisp program, sometimes including other components such 12written by you or provided by someone else. If you want to install
14as an Info manual. 13such a package so it is available in your future Emacs session, you
14need to compile it and put it in a directory where Emacs looks for
15Lisp libraries. @xref{Lisp Libraries}, for more details about this
16manual installation method. Many packages provide installation and
17usage instructions in the large commentary near the beginning of the
18Lisp file; you can use those instructions for installing and
19fine-tuning your use of the package.
15 20
16 @kbd{M-x list-packages} brings up a buffer named @file{*Packages*} 21@cindex Emacs Lisp package archive
17with a list of all packages. You can install or uninstall packages 22 Packages can also be provided by @dfn{package archives}, which are
18via this buffer. @xref{Package Menu}. 23large collections of Emacs Lisp packages. Each package is a separate
24Emacs Lisp program, sometimes including other components such as an
25Info manual. Emacs includes a facility that lets you easily download
26and install packages from such archives. The rest of this chapter
27describes this facility.
28
29 To list the packages available for installation from package
30archives, type @w{@kbd{M-x list-packages @key{RET}}}. It brings up a
31buffer named @file{*Packages*} with a list of all packages. You can
32install or uninstall packages via this buffer. @xref{Package Menu}.
19 33
20 The command @kbd{C-h P} (@code{describe-package}) prompts for the 34 The command @kbd{C-h P} (@code{describe-package}) prompts for the
21name of a package, and displays a help buffer describing the 35name of a package, and displays a help buffer describing the
22attributes of the package and the features that it implements. 36attributes of the package and the features that it implements.
23 37
24 By default, Emacs downloads packages from a @dfn{package archive} 38 By default, Emacs downloads packages from a package archive
25maintained by the Emacs developers and hosted by the GNU project. 39maintained by the Emacs developers and hosted by the GNU project.
26Optionally, you can also download packages from archives maintained by 40Optionally, you can also download packages from archives maintained by
27third parties. @xref{Package Installation}. 41third parties. @xref{Package Installation}.
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index 8bf48b1dbba..8f2c7439d9f 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:
613@end example 613@end example
614 614
615The @sc{car}, @var{option}, is a string, the name of a command-line 615The @sc{car}, @var{option}, is a string, the name of a command-line
616option (not including the initial hyphen). The @var{handler-function} 616option (including the initial hyphen). The @var{handler-function}
617is called to handle @var{option}, and receives the option name as its 617is called to handle @var{option}, and receives the option name as its
618sole argument. 618sole argument.
619 619
@@ -623,6 +623,14 @@ remaining command-line arguments in the variable
623@code{command-line-args-left} (see below). (The entire list of 623@code{command-line-args-left} (see below). (The entire list of
624command-line arguments is in @code{command-line-args}.) 624command-line arguments is in @code{command-line-args}.)
625 625
626Note that the handling of @code{command-switch-alist} doesn't treat
627equals signs in @var{option} specially. That is, if there's an option
628like @code{--name=value} on the command line, then only a
629@code{command-switch-alist} member whose @code{car} is literally
630@code{--name=value} will match this option. If you want to parse such
631options, you need to use @code{command-line-functions} instead (see
632below).
633
626The command-line arguments are parsed by the @code{command-line-1} 634The command-line arguments are parsed by the @code{command-line-1}
627function in the @file{startup.el} file. See also @ref{Emacs 635function in the @file{startup.el} file. See also @ref{Emacs
628Invocation, , Command Line Arguments for Emacs Invocation, emacs, The 636Invocation, , Command Line Arguments for Emacs Invocation, emacs, The
diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi
index 50a208d233b..d3a2f07e254 100644
--- a/doc/misc/efaq.texi
+++ b/doc/misc/efaq.texi
@@ -3478,7 +3478,10 @@ There are other, non-GNU, Emacs Lisp package servers, including:
3478@uref{https://marmalade-repo.org, Marmalade}. To use additional 3478@uref{https://marmalade-repo.org, Marmalade}. To use additional
3479package servers, customize the @code{package-archives} variable. Be 3479package servers, customize the @code{package-archives} variable. Be
3480aware that installing a package can run arbitrary code, so only add 3480aware that installing a package can run arbitrary code, so only add
3481sources that you trust. 3481sources that you trust. Also, packages hosted on non-GNU package
3482servers may encourage or require you to install and use non-free
3483software; for example, MELPA is known to host some packages that do
3484this.
3482 3485
3483The @uref{https://lists.gnu.org/mailman/listinfo/gnu-emacs-sources, 3486The @uref{https://lists.gnu.org/mailman/listinfo/gnu-emacs-sources,
3484GNU Emacs sources mailing list}, which is gatewayed to the 3487GNU Emacs sources mailing list}, which is gatewayed to the
diff --git a/etc/themes/misterioso-theme.el b/etc/themes/misterioso-theme.el
index 8161dbd9e94..ff9af0c7440 100644
--- a/etc/themes/misterioso-theme.el
+++ b/etc/themes/misterioso-theme.el
@@ -63,6 +63,13 @@
63 `(button ((,class (:underline t)))) 63 `(button ((,class (:underline t))))
64 `(link ((,class (:foreground "#59e9ff" :underline t)))) 64 `(link ((,class (:foreground "#59e9ff" :underline t))))
65 `(link-visited ((,class (:foreground "#ed74cd" :underline t)))) 65 `(link-visited ((,class (:foreground "#ed74cd" :underline t))))
66 ;; Ediff
67 `(ediff-even-diff-A ((,class (:background "#1d2430"))))
68 `(ediff-even-diff-B ((,class (:background "#1d2430"))))
69 `(ediff-even-diff-C ((,class (:background "#1d2430"))))
70 `(ediff-odd-diff-A ((,class (:background "#415160"))))
71 `(ediff-odd-diff-B ((,class (:background "#415160"))))
72 `(ediff-odd-diff-C ((,class (:background "#415160"))))
66 ;; Gnus faces 73 ;; Gnus faces
67 `(gnus-group-news-1 ((,class (:foreground "#ff4242" :weight bold)))) 74 `(gnus-group-news-1 ((,class (:foreground "#ff4242" :weight bold))))
68 `(gnus-group-news-1-low ((,class (:foreground "#ff4242")))) 75 `(gnus-group-news-1-low ((,class (:foreground "#ff4242"))))
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 60a352d78e0..24ebfa4b0de 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -2006,10 +2006,9 @@ Optional arg HOW-TO determines how to treat the target.
2006 (format prompt (dired-mark-prompt arg files)) dir default)) 2006 (format prompt (dired-mark-prompt arg files)) dir default))
2007 2007
2008(defun dired-dwim-target-directories () 2008(defun dired-dwim-target-directories ()
2009 (cond ((functionp dired-dwim-target) 2009 (if (functionp dired-dwim-target)
2010 (funcall dired-dwim-target)) 2010 (funcall dired-dwim-target)
2011 (dired-dwim-target 2011 (dired-dwim-target-next)))
2012 (dired-dwim-target-next))))
2013 2012
2014(defun dired-dwim-target-next (&optional all-frames) 2013(defun dired-dwim-target-next (&optional all-frames)
2015 ;; Return directories from all next windows with dired-mode buffers. 2014 ;; Return directories from all next windows with dired-mode buffers.
diff --git a/lisp/dired.el b/lisp/dired.el
index 14bbb28db52..aad44a6d698 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -3717,8 +3717,8 @@ in the active region."
3717 3717
3718(defun dired-toggle-marks () 3718(defun dired-toggle-marks ()
3719 "Toggle marks: marked files become unmarked, and vice versa. 3719 "Toggle marks: marked files become unmarked, and vice versa.
3720Files marked with other flags (such as `D') are not affected. 3720Flagged files (indicated with flags such as `C' and `D', not
3721`.' and `..' are never toggled. 3721with `*') are not affected, and `.' and `..' are never toggled.
3722As always, hidden subdirs are not affected." 3722As always, hidden subdirs are not affected."
3723 (interactive) 3723 (interactive)
3724 (save-excursion 3724 (save-excursion
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 93a09d10967..4ca5c657650 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -316,9 +316,10 @@ generated it."
316 &optional data 316 &optional data
317 overlay-properties) 317 overlay-properties)
318 "Make a Flymake diagnostic for BUFFER's region from BEG to END. 318 "Make a Flymake diagnostic for BUFFER's region from BEG to END.
319TYPE is a key to symbol and TEXT is a description of the problem 319TYPE is a diagnostic symbol and TEXT is string describing the
320detected in this region. DATA is any object that the caller 320problem detected in this region. DATA is any object that the
321wishes to attach to the created diagnostic for later retrieval. 321caller wishes to attach to the created diagnostic for later
322retrieval.
322 323
323OVERLAY-PROPERTIES is an alist of properties attached to the 324OVERLAY-PROPERTIES is an alist of properties attached to the
324created diagnostic, overriding the default properties and any 325created diagnostic, overriding the default properties and any
diff --git a/lisp/simple.el b/lisp/simple.el
index d151d6c9aeb..111afa69d1a 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -4903,7 +4903,7 @@ of this sample text; it defaults to 40."
4903 ;; Swap point-and-mark quickly so as to show the region that 4903 ;; Swap point-and-mark quickly so as to show the region that
4904 ;; was selected. Don't do it if the region is highlighted. 4904 ;; was selected. Don't do it if the region is highlighted.
4905 (unless (and (region-active-p) 4905 (unless (and (region-active-p)
4906 (face-background 'region)) 4906 (face-background 'region nil t))
4907 ;; Swap point and mark. 4907 ;; Swap point and mark.
4908 (set-marker (mark-marker) (point) (current-buffer)) 4908 (set-marker (mark-marker) (point) (current-buffer))
4909 (goto-char mark) 4909 (goto-char mark)
diff --git a/src/xdisp.c b/src/xdisp.c
index d65bb388699..cf15f579b58 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -5120,7 +5120,7 @@ handle_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
5120 if (CONSP (spec) && EQ (XCAR (spec), Qdisable_eval)) 5120 if (CONSP (spec) && EQ (XCAR (spec), Qdisable_eval))
5121 { 5121 {
5122 enable_eval = false; 5122 enable_eval = false;
5123 spec = XCAR (XCDR (spec)); 5123 spec = CONSP (XCDR (spec)) ? XCAR (XCDR (spec)) : Qnil;
5124 } 5124 }
5125 5125
5126 if (CONSP (spec) 5126 if (CONSP (spec)
diff --git a/src/xfns.c b/src/xfns.c
index 1f381e2a8b0..2ab5080d977 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -6738,9 +6738,11 @@ x_hide_tip (bool delete)
6738 } 6738 }
6739 } 6739 }
6740 6740
6741 /* Reset tip_last_frame, it will be reassigned when showing the 6741 /* When using GTK+ system tooltips (compare Bug#41200) reset
6742 next GTK+ system tooltip. */ 6742 tip_last_frame. It will be reassigned when showing the next
6743 tip_last_frame = Qnil; 6743 GTK+ system tooltip. */
6744 if (x_gtk_use_system_tooltips)
6745 tip_last_frame = Qnil;
6744 6746
6745 /* Now look whether there's an Emacs tip around. */ 6747 /* Now look whether there's an Emacs tip around. */
6746 if (FRAMEP (tip_frame)) 6748 if (FRAMEP (tip_frame))
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 @@
1;;; startup-tests.el --- unit tests for startup.el -*- lexical-binding: t; -*-
2
3;; Copyright (C) 2020 Free Software Foundation, Inc.
4
5;; Author: Philipp Stephani <phst@google.com>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
21
22;;; Commentary:
23
24;; Unit tests for startup.el.
25
26;;; Code:
27
28(ert-deftest startup-tests/command-switch-alist ()
29 (let* ((foo-args ()) (bar-args ())
30 (command-switch-alist
31 (list (cons "--foo"
32 (lambda (arg)
33 (ert-info ("Processing argument --foo")
34 (push arg foo-args)
35 (should (equal command-line-args-left
36 '("value" "--bar=value")))
37 (pop command-line-args-left))))
38 (cons "--bar=value"
39 (lambda (arg)
40 (ert-info ("Processing argument --bar")
41 (push arg bar-args)
42 (should-not command-line-args-left)))))))
43 (command-line-1 '("--foo" "value" "--bar=value"))
44 (should (equal foo-args '("--foo")))
45 (should (equal bar-args '("--bar=value")))))
46
47;;; startup-tests.el ends here