mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-02-07 20:54:32 +00:00
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
This commit is contained in:
commit
788c2480f4
@ -1541,6 +1541,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
|
||||
@ -1563,6 +1568,33 @@ Automatic loading also occurs when completing names for
|
||||
prefix being completed. To disable this feature, change the variable
|
||||
@code{help-enable-completion-autoload} to @code{nil}.
|
||||
|
||||
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
|
||||
|
@ -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
|
||||
|
@ -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}.
|
||||
|
@ -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
|
||||
|
@ -3478,7 +3478,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
|
||||
|
@ -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"))))
|
||||
|
@ -2006,10 +2006,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.
|
||||
|
@ -3717,8 +3717,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
|
||||
|
@ -316,9 +316,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
|
||||
|
@ -4903,7 +4903,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)
|
||||
|
@ -5120,7 +5120,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)
|
||||
|
@ -6738,9 +6738,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))
|
||||
|
47
test/lisp/startup-tests.el
Normal file
47
test/lisp/startup-tests.el
Normal file
@ -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 <phst@google.com>
|
||||
|
||||
;; 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
;;; 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
|
Loading…
x
Reference in New Issue
Block a user