1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-22 07:09:54 +00:00

Merge from origin/emacs-29

06ef030f93 use-package.texi: New section "Manual installation"
f4ce6fa7d3 Revert "Revert "Improve last change to xfaces.c" (05ece1e...
b8d2ec920f Revert "Improve last change to xfaces.c" (05ece1eb8b)
24c8c28ae6 Do not pare arguments unnecessarily.
9c0d7bb73b Add automated tests for Eglot
d3669cfe15 Eglot: allow skipping compile-time warnings about LSP int...
04b7e01885 ; project.el: Bump version.
f2876014ad Add customizale faces for tree-sitter explorer
3e349ee119 Fix error message when installing non-existent package
733cdeabfb Don't use diff-mode buffer as a patch when it's visiting ...
87475f4af2 Fix pcase rx patterns using rx-let bindings (bug#59814)
4893a15631 Fix use-package-defaults defcustom type (bug#59941)
074b7e6f4d ; * lisp/use-package/bind-key.el: Remove ineffective back...
864ed9dfa1 ; * lisp/progmodes/dockerfile-ts-mode.el: use \' instead ...
9f7e5584a4 * lisp/language/indian.el: Improve Brahmi composition rul...
78ad33bb05 ; Minor cleanup of last change in xfaces.c.
2024ade271 ; Improve docs of relaxing face-font attribute match (bug...
This commit is contained in:
Stefan Kangas 2022-12-12 09:05:53 +01:00
commit fcd0b377e0
15 changed files with 1472 additions and 108 deletions

View File

@ -248,10 +248,6 @@ packages using the built-in @code{install-package} command, it will do
this automatically for you. Packages shipped with Emacs (built-in
packages) are always available.
If you install packages manually, you must make sure they are
available on your @code{load-path}. @xref{Lisp Libraries,,, emacs,
GNU Emacs Manual}, for details.
Some packages have more than one library. In those cases, you might
need more than one @code{use-package} declaration to make sure the
package is properly loaded. For complex configurations, you might
@ -267,8 +263,7 @@ on Emacs start. @xref{Installing packages}, for details.
* Conditional loading:: Loading packages conditionally.
* Loading sequentially:: Loading packages in sequence.
* Load dependencies:: Don't load without dependencies.
* Load path:: Using a custom @code{load-path}.
* Manual autoloads:: Setting up autoloads manually.
* Manual installation:: Loading manually installed packages.
@end menu
@node Loading basics
@ -623,36 +618,54 @@ As a convenience, a list of such packages may be specified:
For more complex logic, such as that supported by @code{:after},
simply use @code{:if} and the appropriate Lisp expression.
@node Manual installation
@section Manually installed package
When installing packages manually, without Emacs' built-in package
manager (@file{package.el}), it will obviously not help you set up
autoloads or add it to your @code{load-path}. You must do it
yourself. However, use-package makes this more convenient.
@menu
* Load path:: Using a custom @code{load-path}.
* Manual autoloads:: Setting up autoloads manually.
@end menu
@node Load path
@section Setting a custom @code{load-path}
@subsection Setting a custom @code{load-path}
@cindex custom @code{load-path} for loading a package
@cindex @code{load-path}, add directories for loading a package
When installing packages manually, you must make sure its libraries
are available on your @code{load-path}. @xref{Lisp Libraries,,,
emacs, GNU Emacs Manual}, for more details about package loading.
@findex :load-path
If a package resides in some directory that is not in your
@code{load-path}, use the @code{:load-path} keyword to add it. It
takes as argument a symbol, a function, a string or a list of strings.
If a directory is specified as a relative file name, it is expanded
relative to @code{user-emacs-directory}.
The @code{:load-path} keyword provides a convenient way to add
directories to your load path. It takes as argument a symbol, a
function, a string or a list of strings. If a directory is specified
as a relative file name, it is expanded relative to
@code{user-emacs-directory}.
For example:
@lisp
@group
(use-package ess-site
:load-path "site-lisp/ess/lisp/"
:commands R)
(use-package org
:load-path "site-lisp/org/lisp/"
:commands org-mode)
@end group
@end lisp
Note that when using a symbol or a function to provide a dynamically
generated list of directories, you must inform the byte-compiler of this
definition so that the value is available at byte-compilation time.
When using a symbol or a function to provide a dynamically generated
list of directories, you must inform the byte-compiler of this
definition, so that the value is available at byte-compilation time.
This is done by using the special form @code{eval-and-compile} (as
opposed to @code{eval-when-compile}, @pxref{Eval During Compile,,,
elisp, GNU Emacs Lisp Reference Manual}). Further, this value is fixed at
whatever was determined during compilation, to avoid looking up the
same information again on each startup. For example:
elisp, GNU Emacs Lisp Reference Manual}). Furthermore, this value is
fixed to the value it had during compilation. If the operation is
costly, you do not have to repeat it again on each startup. For
example:
@lisp
@group
@ -669,20 +682,25 @@ same information again on each startup. For example:
@end lisp
@node Manual autoloads
@section Setting up autoloads manually
@subsection Setting up autoloads manually
Packages often document how to set up its autoloads when it is being
manually installed. If it does, follow those instructions.
Otherwise, you might want to set them up manually.
@cindex autoloads for packages, setting up manually
@cindex package autoloads, setting up manually
@findex :commands
@findex :autoload
To autoload an interactive command, use the @code{:commands} keyword.
When you use the @code{:commands} keyword, it creates autoloads for
those commands (which defers loading of the module until those commands are
used). The @code{:commands} keyword takes either a symbol or a list
of symbols as its argument.
To autoload an interactive command, use the @code{:commands} keyword,
which takes either a symbol or a list of symbols as its argument. It
creates autoloads for those commands (which defers loading of the
module until those commands are used).
The @code{:autoload} keyword works like @code{:commands}, but is used
to autoload non-interactive functions. Here is an example:
The @code{:autoload} keyword takes the same arguments as
@code{:commands}, but is used to autoload non-interactive functions.
Here is an example:
@lisp
@group

View File

@ -1949,8 +1949,10 @@ SEEN is used internally to detect infinite recursion."
(if (eq next-pkg 'emacs)
(error "This package requires Emacs version %s"
(package-version-join next-version))
(error "Package `%s-%s' is unavailable"
next-pkg (package-version-join next-version))))))
(error (if (not next-version)
(format "Package `%s' is unavailable" next-pkg)
(format "Package `%s' (version %s) is unavailable"
next-pkg (package-version-join next-version))))))))
(setq packages
(package-compute-transaction (cons found packages)
(package-desc-reqs found)

View File

@ -1152,7 +1152,12 @@ For extending the `rx' notation in FORM, use `rx-define' or `rx-let-eval'."
(defun rx--to-expr (form)
"Translate the rx-expression FORM to a Lisp expression yielding a regexp."
(let* ((rx--delayed-evaluation t)
(let* ((rx--local-definitions
;; Retrieve local definitions from the macroexpansion environment.
;; (It's unclear whether the previous value of `rx--local-definitions'
;; should be included, and if so, in which order.)
(cdr (assq :rx-locals macroexpand-all-environment)))
(rx--delayed-evaluation t)
(elems (car (rx--translate form)))
(args nil))
;; Merge adjacent strings.
@ -1282,12 +1287,7 @@ Additional constructs can be defined using `rx-define' and `rx-let',
which see.
\(fn REGEXPS...)"
;; Retrieve local definitions from the macroexpansion environment.
;; (It's unclear whether the previous value of `rx--local-definitions'
;; should be included, and if so, in which order.)
(let ((rx--local-definitions
(cdr (assq :rx-locals macroexpand-all-environment))))
(rx--to-expr (cons 'seq regexps))))
(rx--to-expr (cons 'seq regexps)))
(defun rx--make-binding (name tail)
"Make a definitions entry out of TAIL.

View File

@ -552,24 +552,40 @@ environment."))
char-script-table))
;; Brahmi composition rules
(let ((consonant "[\U00011013-\U00011034]")
(non-consonant "[^\U00011013-\U00011034\U00011046\U0001107F]")
(vowel "[\U00011038-\U00011045]")
(numeral "[\U00011052-\U00011065]")
(multiplier "[\U00011064\U00011065]")
(virama "\U00011046")
(number-joiner "\U0001107F"))
(let ((consonant "[\x11013-\x11037\x11075]")
(independent-vowel "[\x11005-\x11012\x11071\x11072]")
(vowel "[\x11038-\x11045\x11073\x11074]")
(nasal "[\x11000\x11001]")
(virama "\x11046")
(jivhamuliya "\x11003")
(upadhmaniya "\x11004")
(ka-kha "[\x11013\x11014]")
(pa-pha "[\x11027\x11028]")
(number-joiner "\x1107F")
(numeral "[\x11052-\x11065]")
(multiplier "[\x11064\x11065]"))
(set-char-table-range composition-function-table
'(#x11046 . #x11046)
'(#x11046 . #x11046)
(list (vector
;; Consonant conjuncts
(concat consonant "\\(?:" virama consonant "\\)+"
vowel "?")
;; Consonant based syllables
(concat consonant "\\(?:" virama consonant
"\\)*\\(?:" virama "\\|" vowel "*"
nasal "?\\)")
1 'font-shape-gstring)
(vector
;; Vowelless consonants
(concat consonant virama non-consonant)
;; Vowel based syllables
(concat independent-vowel virama "?" vowel "?" nasal "?")
1 'font-shape-gstring)))
(set-char-table-range composition-function-table
'(#x11003 . #x11004)
(list (vector
;; Velar fricative
(concat jivhamuliya ka-kha "?")
0 'font-shape-gstring)
(vector
;; Bilabial fricative
(concat upadhmaniya pa-pha "?")
0 'font-shape-gstring)))
(set-char-table-range composition-function-table
'(#x1107F . #x1107F)
(list (vector

View File

@ -1456,7 +1456,7 @@ COMMAND and ARGS as arguments."
(pcomplete-match-string 1 0)))
((string-prefix-p "-" (pcomplete-arg 0))
(pcomplete-here (apply #'pcomplete-from-help command args)))
(t (pcomplete-here (pcomplete-entries))))))
(t (pcomplete-here* (pcomplete-entries))))))
(provide 'pcomplete)

View File

@ -132,7 +132,7 @@ the subtrees."
;;;###autoload
(add-to-list 'auto-mode-alist
;; NOTE: We can't use `rx' here, as it breaks bootstrap.
'("\\(?:Dockerfile\\(?:\\..*\\)?\\|\\.[Dd]ockerfile\\)$"
'("\\(?:Dockerfile\\(?:\\..*\\)?\\|\\.[Dd]ockerfile\\)\\'"
. dockerfile-ts-mode))
;;;###autoload

View File

@ -499,7 +499,7 @@ Here's what an element of this alist might look like:
;; disallow-non-standard-keys
;; enforce-required-keys
;; enforce-optional-keys
)
no-unknown-interfaces)
"How strictly to check LSP interfaces at compile- and run-time.
Value is a list of symbols (if the list is empty, no checks are
@ -520,7 +520,10 @@ happens at run-time. At compile-time, a warning is raised if a
destructuring spec doesn't use all optional fields.
If the symbol `disallow-unknown-methods' is present, Eglot warns
on unknown notifications and errors on unknown requests."))
on unknown notifications and errors on unknown requests.
If the symbol `no-unknown-interfaces' is present, Eglot warns at
compile time if an undeclared LSP interface is used."))
(cl-defun eglot--check-object (interface-name
object
@ -594,7 +597,7 @@ on unknown notifications and errors on unknown requests."))
(when missing-out (byte-compile-warn
"Destructuring for %s is missing out on %s"
interface-name missing-out))))
(t
((memq 'no-unknown-interfaces eglot-strict-mode)
(byte-compile-warn "Unknown LSP interface %s" interface-name))))))
(cl-defmacro eglot--dbind (vars object &body body)

View File

@ -1,7 +1,7 @@
;;; project.el --- Operations on the current project -*- lexical-binding: t; -*-
;; Copyright (C) 2015-2022 Free Software Foundation, Inc.
;; Version: 0.9.2
;; Version: 0.9.3
;; Package-Requires: ((emacs "26.1") (xref "1.4.0"))
;; This is a GNU ELPA :core package. Avoid using functionality that

View File

@ -1848,6 +1848,18 @@ to the offending pattern and highlight the pattern."
;;; Explorer
(defface treesit-explorer-anonymous-node
(let ((display t)
(atts '(:inherit shadow)))
`((,display . ,atts)))
"Face for anonymous nodes in tree-sitter explorer.")
(defface treesit-explorer-field-name
(let ((display t)
(atts nil))
`((,display . ,atts)))
"Face for field names in tree-sitter explorer.")
(defvar-local treesit--explorer-buffer nil
"Buffer used to display the syntax tree.")
@ -2026,7 +2038,8 @@ leaves point at the end of the last line of NODE."
;; draw everything in one line, other wise draw field name and the
;; rest of the node in two lines.
(when field-name
(insert field-name ": ")
(insert (propertize (concat field-name ": ")
'face 'treesit-explorer-field-name))
(when (and children (not all-children-inline))
(insert "\n")
(indent-to-column (1+ before-field-column))))
@ -2085,7 +2098,7 @@ leaves point at the end of the last line of NODE."
(overlay-put ov 'treesit-node node)
(overlay-put ov 'evaporate t)
(when (not named)
(overlay-put ov 'face 'shadow)))))
(overlay-put ov 'face 'treesit-explorer-anonymous-node)))))
(define-derived-mode treesit--explorer-tree-mode special-mode
"TS Explorer"
@ -2104,7 +2117,7 @@ window."
(unless (buffer-live-p treesit--explorer-buffer)
(setq-local treesit--explorer-buffer
(get-buffer-create
(format "*tree-sitter playground for %s*"
(format "*tree-sitter explorer for %s*"
(buffer-name))))
(setq-local treesit--explorer-language
(intern (completing-read

View File

@ -542,13 +542,13 @@ other modes. See `override-global-mode'."
(format
(format "%%-%ds%%-%ds%%s\n" (car bind-key-column-widths)
(cdr bind-key-column-widths))
key-name (format "`%s\'" command-desc)
key-name (format "`%s'" command-desc)
(if (string= command-desc at-present-desc)
(if (or (null was-command)
(string= command-desc was-command-desc))
""
(format "was `%s\'" was-command-desc))
(format "[now: `%s\']" at-present)))))
(format "was `%s'" was-command-desc))
(format "[now: `%s']" at-present)))))
(princ (if (string-match "[ \t]+\n" line)
(replace-match "\n" t t line)
line))))

View File

@ -210,9 +210,7 @@ a symbol) and a list of keywords (in normalized form). It should
return nil or non-nil depending on whether defaulting should be
attempted."
:type `(repeat
(list (choice :tag "Keyword"
,@(mapcar #'(lambda (k) (list 'const k))
use-package-keywords))
(list (symbol :tag "Keyword")
(choice :tag "Default value" sexp function)
(choice :tag "Enable if non-nil" sexp function)))
:group 'use-package)

View File

@ -1135,7 +1135,7 @@ BEWARE: this function may change the current buffer."
(vc-dir-deduce-fileset state-model-only-files))
((derived-mode-p 'dired-mode)
(dired-vc-deduce-fileset state-model-only-files not-state-changing))
((derived-mode-p 'diff-mode)
((and (derived-mode-p 'diff-mode) (not buffer-file-name))
(diff-vc-deduce-fileset))
((setq backend (vc-backend buffer-file-name))
(if state-model-only-files

View File

@ -6018,12 +6018,10 @@ realize_non_ascii_face (struct frame *f, Lisp_Object font_object,
appears in `font-fallback-ignored-attributes'. */
static void
font_unset_attribute (Lisp_Object font_object, enum font_property_index index,
Lisp_Object symbol)
font_maybe_unset_attribute (Lisp_Object font_object,
enum font_property_index index, Lisp_Object symbol)
{
Lisp_Object tail;
tail = Vfont_fallback_ignored_attributes;
Lisp_Object tail = Vface_font_lax_matched_attributes;
FOR_EACH_TAIL_SAFE (tail)
{
@ -6046,7 +6044,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]
#ifdef HAVE_WINDOW_SYSTEM
struct face *default_face;
struct frame *f;
Lisp_Object stipple, underline, overline, strike_through, box, spec;
Lisp_Object stipple, underline, overline, strike_through, box;
eassert (FRAME_WINDOW_P (cache->f));
@ -6089,33 +6087,33 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]
}
if (! FONT_OBJECT_P (attrs[LFACE_FONT_INDEX]))
{
spec = copy_font_spec (attrs[LFACE_FONT_INDEX]);
Lisp_Object spec = copy_font_spec (attrs[LFACE_FONT_INDEX]);
/* Unset several values in SPEC, usually the width, slant,
and weight. The best possible values for these
attributes is determined in font_find_for_lface, called
by font_load_for_lface, when the candidate list returned
by font_list_entities is sorted by font_select_entity
/* Maybe unset several values in SPEC, usually the width,
slant, and weight. The best possible values for these
attributes are determined in font_find_for_lface, called
by font_load_for_lface, when the list of candidate fonts
returned by font_list_entities is sorted by font_select_entity
(which calls font_sort_entities, which calls font_score).
If these attributes are not unset here, the candidate
font list returned by font_list_entities only contains
fonts that are exact matches for these weight, slant and
width attributes, which leads to suboptimal or wrong font
choices. (bug#5934) */
font_unset_attribute (spec, FONT_WEIGHT_INDEX, QCwidth);
font_unset_attribute (spec, FONT_SLANT_INDEX, QCslant);
font_unset_attribute (spec, FONT_WIDTH_INDEX, QCwidth);
fonts that are exact matches for these weight, slant, and
width attributes, which could lead to suboptimal or wrong
font selection. (bug#5934) */
font_maybe_unset_attribute (spec, FONT_WEIGHT_INDEX, QCweight);
font_maybe_unset_attribute (spec, FONT_SLANT_INDEX, QCslant);
font_maybe_unset_attribute (spec, FONT_WIDTH_INDEX, QCwidth);
/* Also allow unsetting other attributes for debugging
purposes. But not FONT_EXTRA_INDEX; that is not safe to
touch in the Haiku font backend. */
font_unset_attribute (spec, FONT_FAMILY_INDEX, QCfamily);
font_unset_attribute (spec, FONT_FOUNDRY_INDEX, QCfoundry);
font_unset_attribute (spec, FONT_REGISTRY_INDEX, QCregistry);
font_unset_attribute (spec, FONT_ADSTYLE_INDEX, QCadstyle);
font_unset_attribute (spec, FONT_SIZE_INDEX, QCsize);
font_unset_attribute (spec, FONT_DPI_INDEX, QCdpi);
font_unset_attribute (spec, FONT_SPACING_INDEX, QCspacing);
font_unset_attribute (spec, FONT_AVGWIDTH_INDEX, QCavgwidth);
touch, at least in the Haiku font backend. */
font_maybe_unset_attribute (spec, FONT_FAMILY_INDEX, QCfamily);
font_maybe_unset_attribute (spec, FONT_FOUNDRY_INDEX, QCfoundry);
font_maybe_unset_attribute (spec, FONT_REGISTRY_INDEX, QCregistry);
font_maybe_unset_attribute (spec, FONT_ADSTYLE_INDEX, QCadstyle);
font_maybe_unset_attribute (spec, FONT_SIZE_INDEX, QCsize);
font_maybe_unset_attribute (spec, FONT_DPI_INDEX, QCdpi);
font_maybe_unset_attribute (spec, FONT_SPACING_INDEX, QCspacing);
font_maybe_unset_attribute (spec, FONT_AVGWIDTH_INDEX, QCavgwidth);
attrs[LFACE_FONT_INDEX] = font_load_for_lface (f, attrs, spec);
}
@ -7406,22 +7404,24 @@ Lisp programs that change the value of this variable should also
clear the face cache, see `clear-face-cache'. */);
face_near_same_color_threshold = 30000;
DEFVAR_LISP ("font-fallback-ignored-attributes",
Vfont_fallback_ignored_attributes,
doc: /* A list of face attributes to ignore.
DEFVAR_LISP ("face-font-lax-matched-attributes",
Vface_font_lax_matched_attributes,
doc: /* Font-related face attributes to match in lax manner when realizing faces.
List of font-related face attributes to ignore when realizing a face.
This is a list of symbols representing face attributes that will be
ignored by Emacs when realizing a face, and an exact match couldn't be
found for its preferred font. For example:
The value should be a list of font-related face attribute symbols;
see `set-face-attribute' for the full list of attributes. The
corresponding face attributes will be treated as "soft" constraints
when looking for suitable fonts: if an exact match is not possible,
a font can be selected that is a close, but not an exact, match. For
example, looking for a semi-bold font might select a bold or a medium
font if no semi-bold font matching other attributes is found. Emacs
still tries to find a font that is the closest possible match; in
particular, if a font is available that matches the face attributes
exactly, it will be selected.
(:weight :slant :width)
tells Emacs to ignore the `:weight', `:slant' and `:width' face
attributes when searching for a font and an exact match could not be
found for the font attributes specified in the face being realized. */);
Vfont_fallback_ignored_attributes
= list3 (QCwidth, QCslant, QCwidth);
Note that if the `:extra' attribute is present in the value, it
will be ignored. */);
Vface_font_lax_matched_attributes = list3 (QCweight, QCslant, QCwidth);
#ifdef HAVE_WINDOW_SYSTEM
defsubr (&Sbitmap_spec_p);

View File

@ -207,6 +207,12 @@
(list 'ok z))
'(ok "F"))))
(ert-deftest rx-let-pcase ()
"Test `rx-let' around `pcase' with `rx' patterns (bug#59814)."
(should (equal (rx-let ((tata "ab"))
(pcase "abc" ((rx tata) 'toto)))
'toto)))
(ert-deftest rx-kleene ()
"Test greedy and non-greedy repetition operators."
(should (equal (rx (* "a") (+ "b") (\? "c") (?\s "d")

File diff suppressed because it is too large Load Diff