diff --git a/.mailmap b/.mailmap index 9647749940f..bbfe4bceba1 100644 --- a/.mailmap +++ b/.mailmap @@ -26,6 +26,7 @@ Andrew G Cohen Andrew G Cohen Arash Esbati Arash Esbati +Arni Magnusson Artur Malabarba Artur Malabarba Artur Malabarba Basil L. Contovounesios diff --git a/ChangeLog.4 b/ChangeLog.4 index 4bd583818ef..975750f40cd 100644 --- a/ChangeLog.4 +++ b/ChangeLog.4 @@ -11433,7 +11433,7 @@ * etc/NEWS: Update announcement. -2024-05-15 Sean Whitton +2024-05-15 Stefan Monnier (eglot--managed-mode): Avoid calling track-changes unregistered diff --git a/admin/MAINTAINERS b/admin/MAINTAINERS index 16601a76bd6..9bfdcdc7489 100644 --- a/admin/MAINTAINERS +++ b/admin/MAINTAINERS @@ -233,9 +233,22 @@ Philip Kaludercic lisp/emacs-lisp/compat.el lisp/net/rcirc.el +Sean Whitton + VC + lisp/vc/* + doc/emacs/files.texi (Diff Mode) + doc/emacs/maintaining.texi (Version Control) + doc/emacs/vc*-xtra.texi + doc/emacs/emerge-xtra.texi + doc/misc/ediff.texi + test/lisp/vc/* + ============================================================================== 2. Areas that someone is willing to maintain, although he would not necessarily mind if someone else was the official maintainer. +This list also includes people who are in the process of handing over +maintainership to someone listed above, but who want to continue to be +CC'd as though they were still the primary maintainer, in the meantime. ============================================================================== Kelvin White diff --git a/admin/authors.el b/admin/authors.el index bcb06953df3..50f3d1ae68d 100644 --- a/admin/authors.el +++ b/admin/authors.el @@ -213,7 +213,7 @@ files.") ("Noorul Islam" "Noorul Islam K M") ;;; ("Tetsurou Okazaki" "OKAZAKI Tetsurou") ; FIXME? (nil "odanoburu@") - (nil "one\\.last\\.kiss@outlook\\.com") + ("Xie Qi" "one\\.last\\.kiss@outlook\\.com" "shynur") ("Cao ZhenXiang" "mail@ookami\\.one") ("Óscar Fuentes" "Oscar Fuentes") (nil "pillule") diff --git a/doc/emacs/calendar.texi b/doc/emacs/calendar.texi index 10fe404099d..91ea3b9154d 100644 --- a/doc/emacs/calendar.texi +++ b/doc/emacs/calendar.texi @@ -106,7 +106,7 @@ commands for moving by characters and by lines. Just as @kbd{C-n} usually moves to the same column in the following line, in Calendar mode it is bound to @code{calendar-forward-week}, which moves to the same day in the following week. And @kbd{C-p} -(@code{calendar-backward-week} moves to the same day in the previous +(@code{calendar-backward-week}) moves to the same day in the previous week. @kbd{C-f} (@code{calendar-forward-day}) and @kbd{C-b} (@code{calendar-backward-day}) move forward and back by days. diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 3c34afbaa20..a632ffda4ab 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -2664,14 +2664,13 @@ loaded, this command can use it to generate completion candidates. @xref{Symbol Completion}. @findex list-tags - @kbd{M-x list-tags} reads the name of one of the files covered by -the selected tags table, and displays a list of tags defined in that -file. Do not include a directory as part of the file name unless the -file name recorded in the tags table includes a directory. This -command works only with the etags backend, and requires a tags table -for the project to be available. @xref{Tags Tables}. If used -interactively, the default tag is file name of the current buffer if -used interactively. + @kbd{M-x list-tags} reads the name of one of the files covered by the +selected tags table, with completion, and displays the list of tags +defined in that file; it offers the current buffer's file name as the +default file whose tags to list. Do not include a directory as part of +the file name unless the file name recorded in the tags table includes a +directory. This command works only with the etags backend, and requires +a tags table for the project to be available. @xref{Tags Tables}. @findex tags-next-file @kbd{M-x tags-next-file} visits files covered by the selected tags table. diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index 3b52385347b..f23dc1fdb51 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -792,6 +792,46 @@ search engine whose @acronym{URL} is specified by the variable Wowser Manual}). If the region is not active, or doesn't contain any words, this command prompts the user for a URL or keywords to search. +@findex dictionary-search +@findex dictionary +@findex dictionary-tooltip-mode +@cindex dictionary server protocol (DICT) +@cindex word definition search +@vindex dictionary-server + You can also search for definitions of a word by querying dictionary +servers via the @sc{dict} protocol defined by @acronym{RFC} 2229. Emacs +includes a client for this protocol. Type @w{@kbd{M-x dictionary-search +@key{RET}}} to connect to a @sc{dict} server and ask it to provide the +available definitions of a word. This command prompts for the word to +look up, using the word at point as the default, then asks the @sc{dict} +server to provide the definitions of that word in one or more +dictionaries. By default, the command first tries to connect to the +@sc{dict} server installed on the local host, and if that fails, it +tries @file{dict.org} after your confirmation; customize the variable +@code{dictionary-server} to specify, as a string, the URL of a single +server to use (use @samp{localhost} if you want to query only the local +server). Normally, @code{dictionary-search} tells the server to look up +the word in all the dictionaries available to the server, but if you +invoke the command with a prefix argument, it will prompt for a single +dictionary to look. The list of dictionaries available to a server can +be displayed by pressing the @samp{Select dictionary} button shown in +the @file{*Dictionary*} buffer, described below. + + First time you use @code{dictionary-search}, it creates a new +@file{*Dictionary*} buffer and turns on a special mode in it. The +buffer shows buttons for selecting a dictionary, searching a definition +of another word, etc. Subsequent @code{dictionary-search} commands +reuse this buffer. To create another such buffer (e.g., too look up +other words, perhaps in another dictionary), type @w{@kbd{M-x dictionary +@key{RET}}}. + + If you turn on @code{dictionary-tooltip-mode} in a buffer, Emacs will +look up the definitions of the word at mouse pointer and show those +definitions in a tool tip. This is handy when you are reading text with +many words about whose meaning you are unsure. + + For other options of dictionary-search, see the @code{dictionary} +customization group (@pxref{Specific Customization}). @node Symbol Search @section Symbol Search diff --git a/doc/lispref/ChangeLog.1 b/doc/lispref/ChangeLog.1 index e2d4c019b4a..a508ad9f28b 100644 --- a/doc/lispref/ChangeLog.1 +++ b/doc/lispref/ChangeLog.1 @@ -5551,7 +5551,7 @@ * loading.texi (Hooks for Loading): Document after-load-functions. Copyedits. -2010-03-24 Arni Magnusson (tiny change) +2010-03-24 Arni Magnusson (tiny change) * frames.texi (Cursor Parameters): Fix typo. (Bug#5760) diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 70db8521481..5c63f192447 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -1299,7 +1299,8 @@ and modification. This function returns @code{t} if the file @var{filename1} is newer than file @var{filename2}. If @var{filename1} does not exist, it returns @code{nil}. If @var{filename1} does exist, but -@var{filename2} does not, it returns @code{t}. +@var{filename2} does not, it returns @code{t}. Otherwise, it compares +the times of last modification of the files. In the following example, assume that the file @file{aug-19} was written on the 19th, @file{aug-20} was written on the 20th, and the file diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 76f15b2595c..af11e498d86 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -1732,11 +1732,11 @@ buffer-local variables interactively. @defun kill-all-local-variables &optional kill-permanent This function eliminates all the buffer-local variable bindings of the current buffer. As a result, the buffer will see the default values -of most variables. By default, for variables marked as permanent and +of most variables. By default, variables marked as permanent and local hook functions that have a non-@code{nil} @code{permanent-local-hook} property (@pxref{Setting Hooks}) won't be killed, but if the optional @var{kill-permanent} argument is -non-@code{nil}, even these variables will be killed. +non-@code{nil}, even those variables will be killed. This function also resets certain other information pertaining to the buffer: it sets the local keymap to @code{nil}, the syntax table to the diff --git a/doc/misc/ChangeLog.1 b/doc/misc/ChangeLog.1 index 37b304c2dca..14570bb174f 100644 --- a/doc/misc/ChangeLog.1 +++ b/doc/misc/ChangeLog.1 @@ -6407,7 +6407,7 @@ * epa.texi (Mail-mode integration): Mention the way to do "encrypt-to-self". (Bug#1807) -2009-02-05 Arni Magnusson (tiny change) +2009-02-05 Arni Magnusson (tiny change) * ada-mode.texi (No project files): Fix typo. (Bug#2214) diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi index fb5b618bd84..959bbfa6857 100644 --- a/doc/misc/eglot.texi +++ b/doc/misc/eglot.texi @@ -123,14 +123,16 @@ Here's how to start using Eglot with your programming project: @item Select and install a language server. -Eglot comes pre-configured with many popular language servers, see the -value of @code{eglot-server-programs}. If the server(s) mentioned -there satisfy your needs for the programming language(s) with which -you want to use Eglot, you just need to make sure those servers are -installed on your system. Alternatively, install one or more servers -of your choice and add them to the value of +Eglot comes pre-configured for many popular language servers, see the +value of @code{eglot-server-programs}. If the server(s) mentioned there +satisfy your needs for the programming language(s) with which you want +to use Eglot, you just need to make sure those servers are installed on +your system and Eglot can find them. + +Alternatively, install one or more servers of your choice and tell Eglot +where to find them. To do that, you may add to the value of @code{eglot-server-programs}, as described in @ref{Setting Up LSP -Servers}. +Servers} or have Eglot prompt you about it (@pxref{Eglot Commands}). @item Turn on Eglot for your project. @@ -197,7 +199,7 @@ particular server(s) you want to install. To use a language server, Eglot must know how to start it and which programming languages each server supports. This information is -provided by the variable @code{eglot-server-programs}. +commonly provided by the variable @code{eglot-server-programs}. @defvar eglot-server-programs This variable associates major modes with names and command-line @@ -939,12 +941,16 @@ to @w{@code{(disallow-non-standard-keys enforce-required-keys)}}. @vindex eglot-server-initialized-hook @item eglot-server-initialized-hook -A hook run after the server object is successfully initialized. +A hook run after the server object is successfully initialized (which +includes launching the process) but before any LSP communication is +attempted. Each function receives a @code{eglot-lsp-server} instance as +argument. @vindex eglot-connect-hook @item eglot-connect-hook -A hook run after connection to the server is successfully -established. @xref{Starting Eglot}. +A hook run after the LSP connection to the server is successfully +established. Each function receives a @code{eglot-lsp-server} instance +as argument. @xref{Starting Eglot}. @item eglot-managed-mode-hook A hook run after Eglot started or stopped managing a buffer. diff --git a/doc/misc/eieio.texi b/doc/misc/eieio.texi index 02cb51e6fdd..039588b311d 100644 --- a/doc/misc/eieio.texi +++ b/doc/misc/eieio.texi @@ -232,12 +232,6 @@ and you cannot define your own. The @code{:metaclass} tag in should return instances of the metaclass, behave differently in @eieio{} in that they return symbols or plain structures instead. -@item EQL specialization -EIEIO does not support it. - -@item @code{:around} method tag -This CLOS method tag is non-functional. - @item :default-initargs in @code{defclass} Each slot can have an @code{:initform} tag, so this is not really necessary. @@ -381,7 +375,7 @@ name, then the superclass showing up in the list first defines the slot attributes. Inheritance in @eieio{} is more than just combining different slots. -It is also important in method invocation. @ref{Methods}. +It is also important in method invocation. @ref{Writing Methods}. If a method is called on an instance of @code{my-subclass}, and that method only has an implementation on @code{my-baseclass}, or perhaps @@ -810,158 +804,19 @@ variable name of the same name as the slot. @node Writing Methods @chapter Writing Methods -Writing a method in @eieio{} is similar to writing a function. The -differences are that there are some extra options and there can be +Writing a method in @eieio{} is similar to writing a function. +The differences are that there are some extra options and there can be multiple definitions under the same function symbol. -Where a method defines an implementation for a particular data type, a -@dfn{generic method} accepts any argument, but contains no code. It -is used to provide the dispatching to the defined methods. A generic -method has no body, and is merely a symbol upon which methods are -attached. It also provides the base documentation for what methods -with that name do. +You do it using Emacs Lisp's built-in support for CLOS-style generic +functions via the @code{cl-defgeneric} and @code{cl-defmethod} macros +(@pxref{Generic Functions,,,elisp,GNU Emacs Lisp Reference Manual}). -@menu -* Generics:: -* Methods:: -* Static Methods:: -@end menu - -@node Generics -@section Generics - -Each @eieio{} method has one corresponding generic. This generic -provides a function binding and the base documentation for the method -symbol (@pxref{Symbol Components,,,elisp,GNU Emacs Lisp Reference -Manual}). - -@defmac cl-defgeneric method arglist [doc-string] -This macro turns the (unquoted) symbol @var{method} into a function. -@var{arglist} is the default list of arguments to use (not implemented -yet). @var{doc-string} is the documentation used for this symbol. - -A generic function acts as a placeholder for methods. There is no -need to call @code{cl-defgeneric} yourself, as @code{cl-defmethod} will call -it if necessary. Currently the argument list is unused. - -@code{cl-defgeneric} signals an error if you attempt to turn an existing -Emacs Lisp function into a generic function. - -You can also create a generic method with @code{cl-defmethod} -(@pxref{Methods}). When a method is created and there is no generic -method in place with that name, then a new generic will be created, -and the new method will use it. -@end defmac - -@node Methods -@section Methods - -A method is a function that is executed if the arguments passed -to it matches the method's specializers. Different @eieio{} classes may -share the same method names. - -Methods are created with the @code{cl-defmethod} macro, which is similar -to @code{defun}. - -@defmac cl-defmethod method [:before | :around | :after ] arglist [doc-string] forms - -@var{method} is the name of the function to create. - -@code{:before}, @code{:around}, and @code{:after} specify execution order -(i.e., when this form is called). If none of these symbols are present, the -method is said to be a @emph{primary}. - -@var{arglist} is the list of arguments to this method. The mandatory arguments -in this list may have a type specializer (see the example below) which means -that the method will only apply when those arguments match the given type -specializer. An argument with no type specializer means that the method -applies regardless of its value. - -@var{doc-string} is the documentation attached to the implementation. -All method doc-strings are incorporated into the generic method's -function documentation. - -@var{forms} is the body of the function. - -@end defmac - -@noindent -In the following example, we create a method @code{mymethod} for the -@code{classname} class: - -@example -(cl-defmethod mymethod ((obj classname) secondarg) - "Doc string" ) -@end example - -@noindent -This method only executes if the @var{obj} argument passed to it is an -@eieio{} object of class @code{classname}. - -A method with no type specializer is a @dfn{default method}. If a given -class has no implementation, then the default method is called when -that method is used on a given object of that class. - -Only one method per combination of specializers and qualifiers (@code{:before}, -@code{:around}, or @code{:after}) is kept. If two @code{cl-defmethod}s appear -with the same specializers and the same qualifiers, then the second -implementation replaces the first. - -When a method is called on an object, but there is no method specified -for that object, but there is a method specified for object's parent -class, the parent class's method is called. If there is a method -defined for both, only the child's method is called. A child method -may call a parent's method using @code{cl-call-next-method}, described -below. - -If multiple methods and default methods are defined for the same -method and class, they are executed in this order: - -@enumerate -@item :around methods -The most specific @code{:around} method is called first, which may invoke the -less specific ones via @code{cl-call-next-method}. If it doesn't invoke -@code{cl-call-next-method}, then no other methods will be executed. When there -are no more @code{:around} methods to call, falls through to run the other -(non-@code{:around}) methods. -@item :before methods -Called in sequence from most specific to least specific. -@item primary methods -The most specific method is called, which may invoke the less specific -ones via @code{cl-call-next-method}. -@item :after methods -Called in sequence from least specific to most specific. -@end enumerate - -If no methods exist, Emacs signals a @code{cl-no-applicable-method} error. -@xref{Signals}. If methods exist but none of them are primary, Emacs -signals a @code{cl-no-primary-method} error. @xref{Signals}. - -@defun cl-call-next-method &rest replacement-args -@anchor{cl-call-next-method} - -This function calls the superclass method from a subclass method. -This is the ``next method'' specified in the current method list. - -If @var{replacement-args} is non-@code{nil}, then use them instead of the -arguments originally provided to the method. - -Can only be used from within the lexical body of a primary or around method. -@end defun - -@defun cl-next-method-p -@anchor{cl-next-method-p} -Non-@code{nil} if there is a next method. - -Can only be used from within the lexical body of a primary or around method. -@end defun - -@node Static Methods -@section Static Methods - -Static methods do not depend on an object instance, but instead -operate on a class. You can create a static method by using -the @code{subclass} specializer with @code{cl-defmethod}: +EIEIO provides one extension to @code{cl-defmethod} to allow mathods to +dispatch on a class argument: so-called ``static'' methods do not depend +on an object instance, but instead operate on a class. You can create +a static method by using the @code{subclass} specializer with +@code{cl-defmethod}: @example (cl-defmethod make-instance ((class (subclass mychild)) &rest args) diff --git a/etc/TODO b/etc/TODO index 87ca19f37f2..21c85216964 100644 --- a/etc/TODO +++ b/etc/TODO @@ -788,9 +788,6 @@ to ASCII. *** Provide a user friendly interface to specify fonts -** Use the XIE X extension, if available, for image display -This is obsolete, as XIE itself is now considered obsolete. - ** Make monochrome images honor the face Display those images using the foreground and background colors of the applicable faces. diff --git a/etc/refcards/viperCard.tex b/etc/refcards/viperCard.tex index 3675c024a98..b722f99121c 100644 --- a/etc/refcards/viperCard.tex +++ b/etc/refcards/viperCard.tex @@ -301,7 +301,6 @@ \section{Insert Mode} \key{delete line word}{C-u} \key{indent shiftwidth forward}{C-t} \key{indent shiftwidth backward}{C-d} -\key{delete line word}{C-u} \key{quote following character}{C-v} \key{emulate Meta key in emacs state}{C-$\backslash$} \key{escape to Vi state for one command}{C-z} diff --git a/lisp/ChangeLog.16 b/lisp/ChangeLog.16 index fa956ac8784..6d807fbd44d 100644 --- a/lisp/ChangeLog.16 +++ b/lisp/ChangeLog.16 @@ -25198,7 +25198,7 @@ * emacs-lisp/package-x.el (package-upload-buffer-internal): Use `equal' for upload base check. -2011-03-08 Arni Magnusson (tiny change) +2011-03-08 Arni Magnusson (tiny change) * textmodes/texinfo.el (texinfo-environments): Add deftypecv, deftypeivar, deftypemethod, deftypeop, html. (Bug#2783) diff --git a/lisp/ChangeLog.17 b/lisp/ChangeLog.17 index 3eec2da2038..e6c35f63a20 100644 --- a/lisp/ChangeLog.17 +++ b/lisp/ChangeLog.17 @@ -6706,7 +6706,7 @@ 2014-10-12 Stefan Monnier * progmodes/bat-mode.el (bat-font-lock-keywords): Fix \\<_ typo - (bug#18622). Reported by Arni Magnusson . + (bug#18622). Reported by Arni Magnusson . * progmodes/prolog.el (prolog-electric--underscore): Same. 2014-10-12 Michael Albinus @@ -20214,7 +20214,7 @@ (dos-mode-syntax-table): Don't use "w" for symbol chars. (dos-font-lock-keywords): Try to adjust font-lock rules accordingly. -2013-08-07 Arni Magnusson +2013-08-07 Arni Magnusson * progmodes/dos.el: New file. * generic-x.el (bat-generic-mode): Redefine as an obsolete alias to diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 1ed0c71febe..993a880f34f 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -245,7 +245,7 @@ showing only titles and no page number." See `doc-view-mupdf-use-svg'. Only background and foreground colors are used as the SVG image's -descriptors, see (info \"(elisp) SVG Images\"). Non-standard values may +descriptors; see (info \"(elisp) SVG Images\"). Custom values may cause low-contrast issues with certain documents." :version "30.1") diff --git a/lisp/electric.el b/lisp/electric.el index d02bcb4735b..d84faf5433f 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -385,6 +385,9 @@ If multiple rules match, only first one is executed.") (defvar electric-layout-allow-duplicate-newlines nil "If non-nil, allow duplication of `before' newlines.") +(defvar electric-layout-allow-in-comment-or-string nil + "If non-nil, allow inserting newlines inside a comment or string.") + (defun electric-layout-post-self-insert-function () (when electric-layout-mode (electric-layout-post-self-insert-function-1))) @@ -409,7 +412,10 @@ If multiple rules match, only first one is executed.") (goto-char pos) (funcall probe last-command-event)))) (when res (throw 'done res)))))))))) - (when rule + (when (and rule + (or electric-layout-allow-in-comment-or-string + ;; Not in a comment or string. + (not (nth 8 (save-excursion (syntax-ppss pos)))))) (goto-char pos) (when (functionp rule) (setq rule (funcall rule))) (dolist (sym (if (symbolp rule) (list rule) rule)) diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el index 2ca9b64be33..c472d421eb0 100644 --- a/lisp/emacs-lisp/chart.el +++ b/lisp/emacs-lisp/chart.el @@ -574,13 +574,16 @@ R1 and R2 are dotted pairs. Colorize it with FACE." (defun chart-bar-quickie (dir title namelst nametitle numlst numtitle &optional max sort-pred) - "Wash over the complex EIEIO stuff and create a nice bar chart. -Create it going in direction DIR [`horizontal' `vertical'] with TITLE -using a name sequence NAMELST labeled NAMETITLE with values NUMLST -labeled NUMTITLE. -Optional arguments: -Set the chart's max element display to MAX, and sort lists with -SORT-PRED if desired." + "Create a bar chart named TITLE in direction DIR [`horizontal' `vertical']. +NAMELST is the list of bar names and NAMETITLE is the name the of axis +containing them. +NUMLST is the list of values and NUMTITLE is the name of the value +axis. +Optional argument MAX limits the chart's max element display to MAX by +passing it as second argument to `chart-trim', otherwise the chart's +display is unlimited. +Optional argument SORT-PRED is a predicate function passed as second +argument to `chart-sort' to sort the lists if desired." (let ((nc (make-instance 'chart-bar :title title :key-label "8-m" ; This is a text key pic diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 2e501005bf7..b37f744b175 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2505,7 +2505,7 @@ by EXPANSION, and (setq NAME ...) will act like (setf EXPANSION ...). (defmacro cl-once-only (names &rest body) "Generate code to evaluate each of NAMES just once in BODY. -This macro helps with writing other macros. Each of names is +This macro helps with writing other macros. Each of NAMES is either (NAME FORM) or NAME, which latter means (NAME NAME). During macroexpansion, each NAME is bound to an uninterned symbol. The expansion evaluates each FORM and binds it to the diff --git a/lisp/emacs-lisp/ert-font-lock.el b/lisp/emacs-lisp/ert-font-lock.el index c6fd65e1507..58c6c0311cd 100644 --- a/lisp/emacs-lisp/ert-font-lock.el +++ b/lisp/emacs-lisp/ert-font-lock.el @@ -36,6 +36,7 @@ ;;; Code: (require 'ert) +(require 'ert-x) (require 'newcomment) (require 'pcase) diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index f0270aca92c..1b54f1862be 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -436,7 +436,8 @@ the values of nil for each." :usage "[NAME=VALUE]... [COMMAND]...") (if args (or (eshell-parse-local-variables args) - (eshell-named-command (car args) (cdr args))) + (throw 'eshell-replace-command + `(eshell-named-command ,(car args) ',(cdr args)))) (eshell-with-buffered-print (dolist (setting (sort (eshell-environment-variables) 'string-lessp)) (eshell-buffered-print setting "\n")))))) diff --git a/lisp/filesets.el b/lisp/filesets.el index d6ba303b9eb..3af6f37b423 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -25,7 +25,7 @@ (defvar filesets-version "1.8.4") (defvar filesets-homepage - "http://members.a1.net/t.link/CompEmacsFilesets.html") + "https://web.archive.org/web/20210225032922/https://members.a1.net/t.link/CompEmacsFilesets.html") ;;; Commentary: diff --git a/lisp/find-dired.el b/lisp/find-dired.el index e52adaa9d9f..5b4ee0d70aa 100644 --- a/lisp/find-dired.el +++ b/lisp/find-dired.el @@ -174,6 +174,11 @@ The command run (after changing into DIR) is essentially except that the car of the variable `find-ls-option' specifies what to use in place of \"-ls\" as the final argument. +If your `find' program is not a GNU Find, the columns in the produced +Dired display might fail to align. We recommend to install GNU Find in +those cases (you may need to customize the value of `find-program' if +you do so), which attempts to align the columns. + Collect output in the \"*Find*\" buffer. To kill the job before it finishes, type \\[kill-find]. diff --git a/lisp/info-look.el b/lisp/info-look.el index 2baf133c7d3..37f6a6dbb8e 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el @@ -30,6 +30,8 @@ ;; Scheme: https://groups.csail.mit.edu/mac/ftpdir/scm/r5rs.info.tar.gz ;; LaTeX: https://mirrors.ctan.org/info/latex2e-help-texinfo/latex2e.texi ;; (or CTAN mirrors) +;; Python: https://www.python.org/ftp/python/doc/ +;; SICP: https://github.com/webframp/sicp-info ;; Traditionally, makeinfo quoted `like this', but version 5 and later ;; quotes 'like this' or ‘like this’. Doc specs with patterns @@ -1081,6 +1083,7 @@ Return nil if there is nothing appropriate in the buffer near point." ("srecode" "Index") ("tramp" "Variable Index" "Function Index") ("url" "Variable Index" "Function Index") + ("use-package" "Index") ("vhdl" "(vhdl-mode)Variable Index" "(vhdl-mode)Command Index") ("viper" "Variable Index" "Function Index") ("vtable" "Index") diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el index c8006294a7d..16e9d6f1bea 100644 --- a/lisp/mail/mailabbrev.el +++ b/lisp/mail/mailabbrev.el @@ -410,7 +410,7 @@ with a space." ;;; Syntax tables and abbrev-expansion (defcustom mail-abbrev-mode-regexp - "^\\(Resent-\\)?\\(To\\|From\\|Cc\\|Bcc\\|Reply-To\\):" + "^\\(Resent-\\)?\\(To\\|From\\|Cc\\|Bcc\\|Reply-To\\|X-Debbugs-Cc\\):" "Regexp matching mail headers in which mail abbrevs should be expanded. This string will be handed to `looking-at' with point at the beginning of the current line; if it matches, abbrev mode will be turned on, otherwise diff --git a/lisp/mail/mailalias.el b/lisp/mail/mailalias.el index cce2fcb104d..ca4ff67a6ac 100644 --- a/lisp/mail/mailalias.el +++ b/lisp/mail/mailalias.el @@ -50,7 +50,7 @@ When t this still needs to be initialized.") (defvar mail-address-field-regexp - "^\\(Resent-\\)?\\(To\\|From\\|Cc\\|Bcc\\|Reply-To\\):") + "^\\(Resent-\\)?\\(To\\|From\\|Cc\\|Bcc\\|Reply-To\\|X-Debbugs-Cc\\):") ;; `pattern' is bound dynamically before evaluating the forms in ;; `mail-complete-alist' and may be part of user customizations of @@ -61,7 +61,7 @@ When t this still needs to be initialized.") (defcustom mail-complete-alist ;; Don't refer to mail-address-field-regexp here; ;; that confuses some things such as cus-dep.el. - '(("^\\(Resent-\\)?\\(To\\|From\\|Cc\\|Bcc\\|Reply-To\\):" + '(("^\\(Resent-\\)?\\(To\\|From\\|Cc\\|Bcc\\|Reply-To\\|X-Debbugs-Cc\\):" . (mail-get-names pattern)) ("Newsgroups:" . (if (boundp 'gnus-active-hashtb) gnus-active-hashtb diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el index a5ce5b65cd7..d86e48e6281 100644 --- a/lisp/mail/rmailmm.el +++ b/lisp/mail/rmailmm.el @@ -579,11 +579,13 @@ HEADER is a header component of a MIME-entity object (see (ignore-errors (base64-decode-region pos (point)))) ((string= transfer-encoding "quoted-printable") (quoted-printable-decode-region pos (point)))))) - (decode-coding-region - pos (point) - ;; Use -dos decoding, to remove ^M characters left from base64 or - ;; rogue qp-encoded text. - (coding-system-change-eol-conversion coding-system 1)) + ;; If the text is empty, we don't have anything to decode. + (and (/= pos (point)) + (decode-coding-region + pos (point) + ;; Use -dos decoding, to remove ^M characters left from base64 + ;; or rogue qp-encoded text. + (coding-system-change-eol-conversion coding-system 1))) (if (and (or (not rmail-mime-coding-system) (consp rmail-mime-coding-system)) (not (eq (coding-system-base coding-system) 'us-ascii))) diff --git a/lisp/net/eudc.el b/lisp/net/eudc.el index da8955d52c9..9e640768285 100644 --- a/lisp/net/eudc.el +++ b/lisp/net/eudc.el @@ -23,25 +23,27 @@ ;; along with GNU Emacs. If not, see . ;;; Commentary: -;; This package provides a common interface to query directory servers using -;; different protocols such as LDAP, CCSO PH/QI or BBDB. Queries can be -;; made through an interactive form or inline. Inline query strings in -;; buffers are expanded with appropriately formatted query results -;; (especially used to expand email addresses in message buffers). EUDC -;; also interfaces with the BBDB package to let you register query results -;; into your own BBDB database. -;;; Usage: -;; EUDC comes with an extensive documentation, please refer to it. +;; This package provides a common interface to query directory servers using +;; different protocols such as LDAP, CCSO PH/QI or BBDB. Queries can be +;; made through an interactive form or inline. Inline query strings in +;; buffers are expanded with appropriately formatted query results +;; (especially used to expand email addresses in message buffers). EUDC +;; also interfaces with the BBDB package to let you register query results +;; into your own BBDB database. ;; -;; The main entry points of EUDC are: -;; `eudc-query-form': Query a directory server from a query form -;; `eudc-expand-inline': Query a directory server for the e-mail address -;; of the name before cursor and insert it in the -;; buffer -;; `eudc-get-phone': Get a phone number from a directory server -;; `eudc-get-email': Get an e-mail address from a directory server -;; `eudc-customize': Customize various aspects of EUDC +;; Usage: +;; +;; EUDC comes with extensive documentation, please refer to it. +;; +;; The main entry points of EUDC are: +;; `eudc-query-form': Query a directory server from a query form +;; `eudc-expand-inline': Query a directory server for the e-mail address +;; of the name before cursor and insert it in the +;; buffer +;; `eudc-get-phone': Get a phone number from a directory server +;; `eudc-get-email': Get an e-mail address from a directory server +;; `eudc-customize': Customize various aspects of EUDC ;;; Code: diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 659035d4acb..2a713de83c2 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -2537,9 +2537,25 @@ activity. Only run if the buffer is not visible and (rcirc-activity-string lopri) ")")) (and hipri "]"))) + ;; Consistently don't display anything if there aren't + ;; any IRC connections. Otherwise, whether we display + ;; "[]" or not depends on whether or not this function + ;; happens to have been called in this session yet. + ;; + ;; Consistently display nothing, rather than + ;; consistently displaying "[]", for the sake of the + ;; following sort of case: the user has enabled + ;; `rcirc-track-minor-mode' using the customization + ;; system, but also starts up Emacs instances that + ;; aren't used for IRC. Due to the use of easy + ;; customization, `rcirc-track-minor-mode' will be + ;; turned on for every instance of Emacs. But we don't + ;; want to take up valuable mode line space when, say, + ;; Emacs is started up as the value of EDITOR/VISUAL. ((not (null (rcirc-process-list))) "[]") - (t "[]"))) + (t + ""))) (run-hooks 'rcirc-update-activity-string-hook) (force-mode-line-update t))) diff --git a/lisp/net/sieve-manage.el b/lisp/net/sieve-manage.el index 0faeb02bcfd..da2167cd231 100644 --- a/lisp/net/sieve-manage.el +++ b/lisp/net/sieve-manage.el @@ -178,7 +178,8 @@ If it is nil, logging is disabled." (with-current-buffer (get-buffer-create sieve-manage-log) (set-buffer-multibyte nil) - (buffer-disable-undo))) + (buffer-disable-undo) + (current-buffer))) (goto-char (point-max)) (apply #'insert args)))) diff --git a/lisp/progmodes/bat-mode.el b/lisp/progmodes/bat-mode.el index 0687a0c9f32..613de34eb7e 100644 --- a/lisp/progmodes/bat-mode.el +++ b/lisp/progmodes/bat-mode.el @@ -1,8 +1,8 @@ ;;; bat-mode.el --- Major mode for editing DOS/Windows scripts -*- lexical-binding: t -*- -;; Copyright (C) 2003, 2008-2024 Free Software Foundation, Inc. +;; Copyright (C) 2003-2024 Free Software Foundation, Inc. -;; Author: Arni Magnusson +;; Author: Arni Magnusson ;; Keywords: languages ;; This file is part of GNU Emacs. diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index a3379ad7aab..576d715510d 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -324,10 +324,13 @@ characters of the current line." ;; If the start of the previous sibling isn't at the ;; beginning of a line, something's probably not quite ;; right, go a step further. (E.g., comment after a - ;; statement.) + ;; statement.) If the previous sibling is the first named + ;; node then anchor to that, e.g. when returning an aggregate + ;; and starting the items on the same line as {. (_ (goto-char (treesit-node-start prev-sibling)) - (if (looking-back (rx bol (* whitespace)) - (line-beginning-position)) + (if (or (looking-back (rx bol (* whitespace)) + (line-beginning-position))) + (null (treesit-node-prev-sibling prev-sibling t)) (setq continue nil) (setq prev-sibling (treesit-node-prev-sibling prev-sibling))))))) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 3353bffdf05..e129e2df552 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -6225,7 +6225,7 @@ default function." (t (funcall (default-value 'font-lock-syntactic-face-function) state)))) (defface cperl-method-call - '((t (:inherit 'default ))) + '((t (:inherit default ))) "Font Lock mode face for method calls. Usually, method calls are not fontified. We use this face to prevent calls to methods which look like diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el index 29325ab9632..1f86527191a 100644 --- a/lisp/progmodes/csharp-mode.el +++ b/lisp/progmodes/csharp-mode.el @@ -46,6 +46,7 @@ (declare-function treesit-node-type "treesit.c") (declare-function treesit-node-child-by-field-name "treesit.c") (declare-function treesit-query-capture "treesit.c") +(declare-function treesit-query-compile "treesit.c") (defgroup csharp nil "Major mode for editing C# code." @@ -730,6 +731,52 @@ compilation and evaluation time conflicts." "readonly" "unmanaged") "C# keywords for tree-sitter font-locking.") +(defun csharp-ts-mode--test-this-expression () + "Return non-nil if (this_expression) is named in csharp grammar." + (ignore-errors + (treesit-query-compile 'c-sharp "(this_expression)" t) + t)) + +(defun csharp-ts-mode--test-interpolated-string-text () + "Return non-nil if (interpolated_string_text) is in the grammar." + (ignore-errors + (treesit-query-compile 'c-sharp "(interpolated_string_text)" t) + t)) + +(defun csharp-ts-mode--test-type-constraint () + "Return non-nil if (type_constraint) is in the grammar." + (ignore-errors + (treesit-query-compile 'c-sharp "(type_constraint)" t) + t)) + +(defun csharp-ts-mode--test-type-of-expression () + "Return non-nil if (type_of_expression) is in the grammar." + (ignore-errors + (treesit-query-compile 'c-sharp "(type_of_expression)" t) + t)) + +(defun csharp-ts-mode--test-name-equals () + "Return non-nil if (name_equals) is in the grammar." + (ignore-errors + (treesit-query-compile 'c-sharp "(name_equals)" t) + t)) + +(defun csharp-ts-mode--test-if-directive () + "Return non-nil if (if_directive) is in the grammar." + (ignore-errors + (treesit-query-compile 'c-sharp "(if_directive)" t) + t)) + +(defun csharp-ts-mode--test-method-declaration-type-field () + "Return non-nil if (method_declaration) has a type field." + (ignore-errors + (treesit-query-compile 'c-sharp "(method_declaration type: (_))" t) + t)) + +(defvar csharp-ts-mode--type-field + (if (csharp-ts-mode--test-method-declaration-type-field) + 'type: 'returns:)) + (defvar csharp-ts-mode--font-lock-settings (treesit-font-lock-rules :language 'c-sharp @@ -760,7 +807,9 @@ compilation and evaluation time conflicts." :feature 'keyword `([,@csharp-ts-mode--keywords] @font-lock-keyword-face (modifier) @font-lock-keyword-face - (this_expression) @font-lock-keyword-face) + ,@(if (csharp-ts-mode--test-this-expression) + '((this_expression) @font-lock-keyword-face) + '("this" @font-lock-keyword-face))) :language 'c-sharp :override t @@ -786,18 +835,23 @@ compilation and evaluation time conflicts." :feature 'string `([(string_literal) (verbatim_string_literal) - (interpolated_string_text) - (interpolated_verbatim_string_text) - (character_literal) - "\"" - "$\"" - "@$\"" - "$@\""] @font-lock-string-face) + ,@(if (csharp-ts-mode--test-interpolated-string-text) + '((interpolated_string_text) + (interpolated_verbatim_string_text) + (character_literal) + "\"" + "$\"" + "@$\"" + "$@\"") + '((interpolated_string_expression) + (interpolation_start) + (interpolation_quote)))] + @font-lock-string-face) :language 'c-sharp :override t :feature 'type - '((predefined_type) @font-lock-type-face + `((predefined_type) @font-lock-type-face (implicit_type) @font-lock-type-face (nullable_type) @font-lock-type-face (type_parameter @@ -816,10 +870,17 @@ compilation and evaluation time conflicts." (cast_expression (generic_name (identifier) @font-lock-type-face)) ["operator"] @font-lock-type-face (type_parameter_constraints_clause - target: (identifier) @font-lock-type-face) - (type_constraint type: (identifier) @font-lock-type-face) - (type_constraint type: (generic_name (identifier) @font-lock-type-face)) - (type_of_expression (identifier) @font-lock-type-face) + (identifier) @font-lock-type-face) + ,@(if (csharp-ts-mode--test-type-constraint) + '((type_constraint type: (identifier) @font-lock-type-face) + (type_constraint type: (generic_name (identifier) @font-lock-type-face))) + '((type_parameter_constraint (type type: (identifier) @font-lock-type-face)) + (type_parameter_constraint (type type: (generic_name (identifier) @font-lock-type-face))))) + + ,@(when (csharp-ts-mode--test-type-of-expression) + '((type_of_expression (identifier) @font-lock-type-face)) + '((typeof_expression (identifier) @font-lock-type-face))) + (object_creation_expression type: (identifier) @font-lock-type-face) (object_creation_expression @@ -832,8 +893,9 @@ compilation and evaluation time conflicts." :override t `((qualified_name (identifier) @font-lock-type-face) (using_directive (identifier) @font-lock-type-face) - (using_directive (name_equals - (identifier) @font-lock-type-face)) + ,@(when (csharp-ts-mode--test-name-equals) + '((using_directive (name_equals + (identifier) @font-lock-type-face)))) (enum_declaration (identifier) @font-lock-type-face) (enum_member_declaration (identifier) @font-lock-variable-name-face) @@ -861,10 +923,10 @@ compilation and evaluation time conflicts." ;;; Check if keyword void_keyword is available, then return the correct rule." ,@(condition-case nil (progn (treesit-query-capture 'csharp '((void_keyword) @capture)) - `((method_declaration type: [(identifier) (void_keyword)] @font-lock-type-face))) + `((method_declaration ,csharp-ts-mode--type-field [(identifier) (void_keyword)] @font-lock-type-face))) (error - `((method_declaration type: [(identifier) (predefined_type)] @font-lock-type-face)))) - (method_declaration type: (generic_name (identifier) @font-lock-type-face)) + `((method_declaration ,csharp-ts-mode--type-field [(identifier) (predefined_type)] @font-lock-type-face)))) + (method_declaration ,csharp-ts-mode--type-field (generic_name (identifier) @font-lock-type-face)) (method_declaration name: (_) @font-lock-function-name-face) (catch_declaration @@ -907,25 +969,45 @@ compilation and evaluation time conflicts." :language 'c-sharp :feature 'directives :override t - '((if_directive - "if" @font-lock-preprocessor-face - (identifier) @font-lock-variable-use-face) - (elif_directive - "elif" @font-lock-preprocessor-face - (identifier) @font-lock-variable-use-face) - (else_directive) @font-lock-preprocessor-face - (endif_directive) @font-lock-preprocessor-face - (define_directive - "define" @font-lock-preprocessor-face - (identifier) @font-lock-variable-use-face) - (nullable_directive) @font-lock-preprocessor-face - (pragma_directive) @font-lock-preprocessor-face - (region_directive) @font-lock-preprocessor-face - (endregion_directive) @font-lock-preprocessor-face - (region_directive - (preproc_message) @font-lock-variable-use-face) - (endregion_directive - (preproc_message) @font-lock-variable-use-face)))) + (if (csharp-ts-mode--test-if-directive) + '((if_directive + "if" @font-lock-preprocessor-face + (identifier) @font-lock-variable-use-face) + (elif_directive + "elif" @font-lock-preprocessor-face + (identifier) @font-lock-variable-use-face) + (else_directive) @font-lock-preprocessor-face + (endif_directive) @font-lock-preprocessor-face + (define_directive + "define" @font-lock-preprocessor-face + (identifier) @font-lock-variable-use-face) + (nullable_directive) @font-lock-preprocessor-face + (pragma_directive) @font-lock-preprocessor-face + (region_directive) @font-lock-preprocessor-face + (endregion_directive) @font-lock-preprocessor-face + (region_directive + (preproc_message) @font-lock-variable-use-face) + (endregion_directive + (preproc_message) @font-lock-variable-use-face)) + '((preproc_if + "#if" @font-lock-preprocessor-face + (identifier) @font-lock-variable-use-face) + (preproc_elif + "#elif" @font-lock-preprocessor-face + (identifier) @font-lock-variable-use-face) + (preproc_else) @font-lock-preprocessor-face + "#endif" @font-lock-preprocessor-face + (preproc_define + "#define" @font-lock-preprocessor-face + (preproc_arg) @font-lock-variable-use-face) + (preproc_nullable) @font-lock-preprocessor-face + (preproc_pragma) @font-lock-preprocessor-face + (preproc_region) @font-lock-preprocessor-face + (preproc_endregion) @font-lock-preprocessor-face + (preproc_region + (preproc_arg) @font-lock-variable-use-face) + (preproc_endregion + (preproc_arg) @font-lock-variable-use-face))))) ;;;###autoload (add-to-list 'auto-mode-alist '("\\.cs\\'" . csharp-mode)) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index a358b823795..0a14146a245 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -178,9 +178,9 @@ ;;; User tweakable stuff (defgroup eglot nil - "Interaction with Language Server Protocol servers." + "Interaction with Language Server Protocol (LSP) servers." :prefix "eglot-" - :group 'applications) + :group 'tools) (defun eglot-alternatives (alternatives) "Compute server-choosing function for `eglot-server-programs'. @@ -1487,18 +1487,21 @@ Use current server's or first available Eglot events buffer." (defvar eglot-connect-hook '(eglot-signal-didChangeConfiguration) - "Hook run after connecting in `eglot--connect'.") + "Hook run after connecting to a server. +Each function is passed an `eglot-lsp-server' instance +as argument.") (defvar eglot-server-initialized-hook '() "Hook run after a `eglot-lsp-server' instance is created. -That is before a connection was established. Use +That is before a connection is established. Use `eglot-connect-hook' to hook into when a connection was successfully established and the server on the other side has received the initializing configuration. -Each function is passed the server as an argument") +Each function is passed an `eglot-lsp-server' instance +as argument.") (defun eglot--cmd (contact) "Helper for `eglot--connect'." @@ -3239,7 +3242,8 @@ for which LSP on-type-formatting should be requested." :resolveProvider) (plist-get lsp-comp :data)) (eglot--request server :completionItem/resolve - lsp-comp :cancel-on-input t) + lsp-comp :cancel-on-input t + :immediate t) lsp-comp)))))) (when (and (consp eglot--capf-session) (= (car bounds) (car (nth 0 eglot--capf-session))) diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el index a3e11658468..cacdb266298 100644 --- a/lisp/progmodes/elixir-ts-mode.el +++ b/lisp/progmodes/elixir-ts-mode.el @@ -734,9 +734,6 @@ Return nil if NODE is not a defun node or doesn't have a name." (when (treesit-ready-p 'heex) (setq-local treesit-range-settings elixir-ts--treesit-range-rules) - (setq-local treesit-simple-indent-rules - (append treesit-simple-indent-rules heex-ts--indent-rules)) - (setq-local treesit-font-lock-settings (append treesit-font-lock-settings heex-ts--font-lock-settings)) diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index d3eb0d46e9b..35dc0215046 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -1894,27 +1894,40 @@ description of the arguments." (try-completion string (tags-table-files) predicate)))) (defun tags--get-current-buffer-name-in-tags-file () - "Get the file name that the current buffer corresponds in the tags file." - (let ((tag-dir - (save-excursion - (visit-tags-table-buffer) - (file-name-directory (buffer-file-name))))) - (file-relative-name (buffer-file-name) tag-dir))) + "Return file name that corresponds to the current buffer in the tags table. +This returns the file name which corresponds to the current buffer relative +to the directory of the current tags table (see `visit-tags-table-buffer'). +If no file is associated with the current buffer, this function returns nil." + (let ((buf-fname (buffer-file-name))) + ;; FIXME: Are there interesting cases where 'buffer-file-name' + ;; returns nil, but there's some file we expect to find in TAGS that + ;; is associated with the buffer? The obvious cases of Dired and + ;; Info buffers are not interesting for TAGS, but are there any + ;; others? + (if buf-fname + (let ((tag-dir + (save-excursion + (visit-tags-table-buffer) + (file-name-directory buf-fname)))) + (file-relative-name buf-fname tag-dir))))) ;;;###autoload (defun list-tags (file &optional _next-match) "Display list of tags in file FILE. -This searches only the first table in the list, and no included -tables. FILE should be as it appeared in the `etags' command, -usually without a directory specification. If called -interactively, FILE defaults to the file name of the current -buffer." +Interactively, prompt for FILE, with completion, offering the current +buffer's file name as the defaul. +This command searches only the first table in the list of tags tables, +and does not search included tables. +FILE should be as it was submitted to the `etags' command, which usually +means relative to the directory of the tags table file." (interactive (list (completing-read "List tags in file: " 'tags-complete-tags-table-file nil t - ;; Default FILE to the current buffer. + ;; Default FILE to the current buffer's file. (tags--get-current-buffer-name-in-tags-file)))) + (if (string-empty-p file) + (user-error "You must specify a file name")) (with-output-to-temp-buffer "*Tags List*" (princ (substitute-command-keys "Tags in file `")) (tags-with-face 'highlight (princ file)) diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el index 8d0f49c2d89..4ea453c9b65 100644 --- a/lisp/progmodes/lua-ts-mode.el +++ b/lisp/progmodes/lua-ts-mode.el @@ -676,19 +676,19 @@ Calls REPORT-FN directly." (defun lua-ts-send-buffer () "Send current buffer to the inferior Lua process." - (interactive) + (interactive nil lua-ts-mode) (lua-ts-send-region (point-min) (point-max))) (defun lua-ts-send-file (file) "Send contents of FILE to the inferior Lua process." - (interactive "f") + (interactive "f" lua-ts-mode) (with-temp-buffer (insert-file-contents-literally file) (lua-ts-send-region (point-min) (point-max)))) (defun lua-ts-send-region (beg end) "Send region between BEG and END to the inferior Lua process." - (interactive "r") + (interactive "r" lua-ts-mode) (let ((string (buffer-substring-no-properties beg end)) (proc-buffer (lua-ts-inferior-lua))) (comint-send-string proc-buffer "print()") ; Prevent output from diff --git a/lisp/progmodes/php-ts-mode.el b/lisp/progmodes/php-ts-mode.el index 3f89de14075..d2559e5a45f 100644 --- a/lisp/progmodes/php-ts-mode.el +++ b/lisp/progmodes/php-ts-mode.el @@ -77,18 +77,19 @@ (declare-function treesit-parser-included-ranges "treesit.c") (declare-function treesit-parser-list "treesit.c") (declare-function treesit-parser-language "treesit.c") +(declare-function treesit-query-compile "treesit.c") (declare-function treesit-search-forward "treesit.c") (declare-function treesit-node-prev-sibling "treesit.c") (declare-function treesit-node-first-child-for-pos "treesit.c") ;;; Install treesitter language parsers (defvar php-ts-mode--language-source-alist - '((php . ("https://github.com/tree-sitter/tree-sitter-php" "v0.22.8" "php/src")) + '((php . ("https://github.com/tree-sitter/tree-sitter-php" "v0.23.0" "php/src")) (phpdoc . ("https://github.com/claytonrcarter/tree-sitter-phpdoc")) - (html . ("https://github.com/tree-sitter/tree-sitter-html" "v0.20.3")) - (javascript . ("https://github.com/tree-sitter/tree-sitter-javascript" "v0.21.2")) - (jsdoc . ("https://github.com/tree-sitter/tree-sitter-jsdoc" "v0.21.0")) - (css . ("https://github.com/tree-sitter/tree-sitter-css" "v0.21.0"))) + (html . ("https://github.com/tree-sitter/tree-sitter-html" "v0.23.0")) + (javascript . ("https://github.com/tree-sitter/tree-sitter-javascript" "v0.23.0")) + (jsdoc . ("https://github.com/tree-sitter/tree-sitter-jsdoc" "v0.23.0")) + (css . ("https://github.com/tree-sitter/tree-sitter-css" "v0.23.0"))) "Treesitter language parsers required by `php-ts-mode'. You can customize this variable if you want to stick to a specific commit and/or use different parsers.") @@ -490,7 +491,7 @@ characters of the current line." (treesit-node-start parent))))) (defun php-ts-mode--parent-html-heuristic (node parent _bol &rest _) - "Returns position based on html indentation. + "Return position based on html indentation. Returns 0 if the NODE is after the , otherwise returns the indentation point of the last word before the NODE, plus the @@ -773,6 +774,21 @@ characters of the current line." "__FUNCTION__" "__LINE__" "__METHOD__" "__NAMESPACE__" "__TRAIT__") "PHP predefined constant.") +(defun php-ts-mode--test-namespace-name-as-prefix-p () + "Return t if namespace_name_as_prefix keyword is a named node, nil otherwise." + (ignore-errors + (progn (treesit-query-compile 'php "(namespace_name_as_prefix)" t) t))) + +(defun php-ts-mode--test-namespace-aliasing-clause-p () + "Return t if namespace_name_as_prefix keyword is named node, nil otherwise." + (ignore-errors + (progn (treesit-query-compile 'php "(namespace_name_as_prefix)" t) t))) + +(defun php-ts-mode--test-namespace-use-group-clause-p () + "Return t if namespace_use_group_clause keyword is named node, nil otherwise." + (ignore-errors + (progn (treesit-query-compile 'php "(namespace_use_group_clause)" t) t))) + (defun php-ts-mode--font-lock-settings () "Tree-sitter font-lock settings." (treesit-font-lock-rules @@ -866,7 +882,7 @@ characters of the current line." :language 'php :feature 'definition :override t - '((php_tag) @font-lock-preprocessor-face + `((php_tag) @font-lock-preprocessor-face ("?>") @font-lock-preprocessor-face ;; Highlights identifiers in declarations. (class_declaration @@ -889,10 +905,16 @@ characters of the current line." ("=>") @font-lock-keyword-face (object_creation_expression (name) @font-lock-type-face) - (namespace_name_as_prefix "\\" @font-lock-delimiter-face) - (namespace_name_as_prefix (namespace_name (name)) @font-lock-type-face) - (namespace_use_clause (name) @font-lock-property-use-face) - (namespace_aliasing_clause (name) @font-lock-type-face) + ,@(when (php-ts-mode--test-namespace-name-as-prefix-p) + '((namespace_name_as_prefix "\\" @font-lock-delimiter-face) + (namespace_name_as_prefix + (namespace_name (name)) @font-lock-type-face))) + ,@(if (php-ts-mode--test-namespace-aliasing-clause-p) + '((namespace_aliasing_clause (name) @font-lock-type-face)) + '((namespace_use_clause alias: (name) @font-lock-type-face))) + ,@(when (not (php-ts-mode--test-namespace-use-group-clause-p)) + '((namespace_use_group + (namespace_use_clause (name) @font-lock-type-face)))) (namespace_name "\\" @font-lock-delimiter-face) (namespace_name (name) @font-lock-type-face) (use_declaration (name) @font-lock-property-use-face)) @@ -931,8 +953,10 @@ characters of the current line." :language 'php :feature 'base-clause :override t - '((base_clause (name) @font-lock-type-face) + `((base_clause (name) @font-lock-type-face) (use_as_clause (name) @font-lock-property-use-face) + ,@(when (not (php-ts-mode--test-namespace-name-as-prefix-p)) + '((qualified_name prefix: "\\" @font-lock-delimiter-face))) (qualified_name (name) @font-lock-constant-face)) :language 'php diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index a50446343a0..0001bdd21a9 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -233,23 +233,6 @@ ;; `python-imenu-format-parent-item-jump-label-function' variables for ;; changing the way labels are formatted in the tree version. -;; If you used python-mode.el you may miss auto-indentation when -;; inserting newlines. To achieve the same behavior you have two -;; options: - -;; 1) Enable the minor-mode `electric-indent-mode' (enabled by -;; default) and use RET. If this mode is disabled use -;; `newline-and-indent', bound to C-j. - -;; 2) Add the following hook in your .emacs: - -;; (add-hook 'python-mode-hook -;; (lambda () -;; (define-key python-mode-map "\C-m" 'newline-and-indent))) - -;; I'd recommend the first one since you'll get the same behavior for -;; all modes out-of-the-box. - ;; Flymake: A Flymake backend, using the pyflakes program by default, ;; is provided. You can also use flake8 or pylint by customizing ;; `python-flymake-command'. @@ -425,7 +408,7 @@ To customize the Python interpreter for interactive use, modify "Keymap for `python-mode'.") (defvar python-ts-mode-map (copy-keymap python-mode-map) - "Keymap for `(copy-keymap python-mode-map)'.") + "Keymap for `python-ts-mode'.") ;;; Python specialized rx diff --git a/lisp/window.el b/lisp/window.el index 006cfa19525..01010072190 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -2661,7 +2661,7 @@ window is included in the count. If ALL-FRAMES is non-nil, count the windows in all frames instead just the selected frame. -See `walk-windows' for the precise meaning of this argument." +See `walk-windows' for the precise meaning of these arguments." (length (window-list-1 nil minibuf all-frames))) ;;; Resizing windows. @@ -4617,7 +4617,8 @@ Also see `switch-to-prev-buffer-skip-regexp'." "Buffers that `switch-to-prev-buffer' and `switch-to-next-buffer' should skip. The value can either be a regexp or a list of regexps. Buffers whose names match these regexps are skipped by `switch-to-prev-buffer' -and `switch-to-next-buffer'. +and `switch-to-next-buffer', unless there's no other buffer to +switch to. Also see `switch-to-prev-buffer-skip'." :type '(choice regexp diff --git a/nt/INSTALL b/nt/INSTALL index 6167365169b..b959ce362f7 100644 --- a/nt/INSTALL +++ b/nt/INSTALL @@ -157,7 +157,7 @@ build should run on Windows 9X and newer systems). When the installation ends, perform the post-installation steps described on this page of the MinGW site: - http://www.mingw.org/wiki/Getting_Started + https://web.archive.org/web/20210106033223/http://www.mingw.org/wiki/Getting_Started in the "After Installing You Should ..." section. These steps are important for making your installation complete, and in particular diff --git a/src/coding.c b/src/coding.c index b21ed360578..5591b7fed45 100644 --- a/src/coding.c +++ b/src/coding.c @@ -5270,7 +5270,9 @@ decode_coding_raw_text (struct coding_system *coding) coding->chars_at_source = 1; coding->consumed_char = coding->src_chars; coding->consumed = coding->src_bytes; - if (eol_dos && coding->source[coding->src_bytes - 1] == '\r') + if (eol_dos + && coding->src_bytes > 0 /* empty source text? */ + && coding->source[coding->src_bytes - 1] == '\r') { coding->consumed_char--; coding->consumed--; diff --git a/src/fileio.c b/src/fileio.c index 7afe3e75737..2db2760916b 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3788,7 +3788,8 @@ DEFUN ("unix-sync", Funix_sync, Sunix_sync, 0, 0, "", DEFUN ("file-newer-than-file-p", Ffile_newer_than_file_p, Sfile_newer_than_file_p, 2, 2, 0, doc: /* Return t if file FILE1 is newer than file FILE2. If FILE1 does not exist, the answer is nil; -otherwise, if FILE2 does not exist, the answer is t. */) +otherwise, if FILE2 does not exist, the answer is t. +For existing files, this compares their last-modified times. */) (Lisp_Object file1, Lisp_Object file2) { struct stat st1, st2; diff --git a/test/lisp/eshell/esh-var-tests.el b/test/lisp/eshell/esh-var-tests.el index 6b0e225f05f..7b29e4a21db 100644 --- a/test/lisp/eshell/esh-var-tests.el +++ b/test/lisp/eshell/esh-var-tests.el @@ -669,6 +669,11 @@ nil, use FUNCTION instead." (eshell-match-command-output "env VAR=hello env" "VAR=hello\n") (should (equal (getenv "VAR") "value")))) +(ert-deftest esh-var-test/local-variables/env/no-locals () + "Test that \"env command\" works like \"command\"." + (with-temp-eshell + (eshell-match-command-output "env echo hi" "\\`hi\n"))) + ;; Variable aliases diff --git a/test/lisp/progmodes/c-ts-mode-resources/indent.erts b/test/lisp/progmodes/c-ts-mode-resources/indent.erts index 599173832b5..a13a74cf8b3 100644 --- a/test/lisp/progmodes/c-ts-mode-resources/indent.erts +++ b/test/lisp/progmodes/c-ts-mode-resources/indent.erts @@ -208,6 +208,21 @@ int main() } =-=-= +Name: Return Compund Literal + +=-= +struct pair { int fst, snd; }; +struct pair +make_pair(int long_identifier_a[], int long_identifier_b[], + int offset_a, int offset_b) +{ + int base_offset = 10; + return (struct pair) { long_identifier_a[base_offset + offset_b], + long_identifier_b[base_offset + offset_b] }; +} + +=-=-= + Name: Switch-Case statement =-= @@ -486,6 +501,30 @@ namespace A { } =-=-= +Name: Return Aggregate Initialized Struct + +=-= +struct pair { int x, y; } +pair +make_pair(int long_identifier_a[], int long_identifier_b[], + int offset_a, int offset_b) +{ + int base_offset = 10; + return { long_identifier_a[base_offset + offset_b], + long_identifier_b[base_offset + offset_b] }; +} +=-= +struct pair { int x, y; } +pair +make_pair(int long_identifier_a[], int long_identifier_b[], + int offset_a, int offset_b) +{ + int base_offset = 10; + return { long_identifier_a[base_offset + offset_b], + long_identifier_b[base_offset + offset_b] }; +} +=-=-= + Code: (lambda () (c-ts-mode)