Commit 41d9d51c authored by Glenn Morris's avatar Glenn Morris

Merge from origin/emacs-27

f0ebd919 (origin/emacs-27) ; * doc/lispref/anti.texi (Antinews): Fi...
6f059159 Update Acknowledgments sections
e1262d45 Update Antinews in ELisp manual
fd8128f0 ; Move the description of define-inline to a different nod...
524441d6 Improve wording in the ELisp manual
8addfa91 Reset to the standard value when reverting session's custo...
d6f9b097 Fix saving multiple themes
c556aabd Calc: fix interval entry (bug#39040)
91cd3c13 Fix horizontal line display in Custom buffers
15c8e984 ; * etc/NEWS: Fix a typo.
ff8996a3 flymake: fix typo in variable binding (bug#38752)
16eaaa07 ; Minor spelling fixes
5efe7956 Update Antinews in the Emacs manual
58412402 Use NSNumber instead of BOOL (bug#39047)
beec9f64 Add comment on fido-mode's file-sorting semantics
eb3c6ad3 Consider non-string minibuffer-default in icomplete

# Conflicts:
#	etc/NEWS
parents 17cfd708 f0ebd919
Pipeline #4537 passed with stage
in 54 minutes and 12 seconds
......@@ -235,6 +235,12 @@ use it, Snake and Tetris.
Andrew Cohen wrote @file{spam-wash.el}, to decode and clean email before
it is analyzed for spam.
@item
Daniel Colascione wrote the portable dumping code in @file{pdumper.c}
and elsewhere. He also implemented double-buffering for X-based GUI
frames, and the original support for loading shared-object modules
into Emacs.
@item
Theresa O'Connor wrote @file{json.el}, a file for parsing and
generating JSON files.
......@@ -502,6 +508,10 @@ expansion package.
Tassilo Horn wrote DocView mode, allowing viewing of PDF, PostScript and
DVI documents.
@item
Khaled Hosny, Yamamoto Mitsuharu, and Eli Zaretskii implemented
text shaping with HarfBuzz for Emacs.
@item
Joakim Hove wrote @file{html2text.el}, a html to plain text converter.
......@@ -702,7 +712,9 @@ files.
Juri Linkov wrote @file{misearch.el}, extending isearch to multi-buffer
searches; the code in @file{files-x.el} for handling file- and
directory-local variables; and the @code{info-finder} feature that
creates a virtual Info manual of package keywords.
creates a virtual Info manual of package keywords. He also
implemented the Tab Bar and window tab-lines, and added numerous
enhancements and improvements in I-search.
@item
Leo Liu wrote @file{pcmpl-x.el}, providing completion for
......@@ -817,6 +829,11 @@ David Megginson wrote @file{derived.el}, which allows one to define new
major modes by inheriting key bindings and commands from existing major
modes.
@item
Jimmy Aguilar Mena wrote the code to support the @code{:extend} face
attribute, and also implemented the optional
@code{display-fill-column-indicator} feature.
@item
Will Mengarini wrote @file{repeat.el}, a command to repeat the preceding
command with its arguments.
......@@ -1083,6 +1100,10 @@ Wolfgang Rupprecht wrote Emacs 19's floating-point support (including
Kevin Ryde wrote @file{info-xref.el}, a library for checking
references in Info files.
@item
Phil Sainty wrote @file{so-long.el}, a set of features for easier
editing of files with very long lines.
@item
James B. Salem and Brewster Kahle wrote @file{completion.el}, providing
dynamic word completion.
......@@ -1234,6 +1255,10 @@ buffers.
Tibor Šimko and Milan Zamazal wrote @file{slovak.el}, support for
editing text in Slovak language.
@item
João Távora wrote many improvements for @file{flymake.el}, an
on-the-fly syntax-checking package.
@item
Luc Teirlinck wrote @file{help-at-pt.el}, providing local help through
the keyboard.
......
This diff is collapsed.
......@@ -219,7 +219,7 @@ Appendices
* GNU Free Documentation License:: The license for this documentation.
* Emacs Invocation:: Hairy startup options.
* X Resources:: X resources for customizing Emacs.
* Antinews:: Information about Emacs version 25.
* Antinews:: Information about Emacs version 26.
* Mac OS / GNUstep:: Using Emacs under macOS and GNUstep.
* Microsoft Windows:: Using Emacs on Microsoft Windows and MS-DOS.
* Manifesto:: What's GNU? Gnu's Not Unix!
......@@ -1404,6 +1404,7 @@ Berry, Anna M. Bigatti, Ray Blaak, Martin Blais, Jim Blandy, Johan
Bockgård, Jan Böcker, Joel Boehland, Lennart Borgman, Per Bothner,
Terrence Brannon, Frank Bresz, Peter Breton, Emmanuel Briot, Kevin
Broadey, Vincent Broman, Michael Brouwer, David M. Brown, Ken Brown, Stefan Bruda,
Daniel Colascione,
Georges Brun-Cottan, Joe Buehler, Scott Byer, Włodek Bzyl, Tino Calancha,
Bill Carpenter, Per Cederqvist, Hans Chalupsky, Chris Chase, Bob
Chassell, Andrew Choi, Chong Yidong, Sacha Chua, Stewart Clamen, James
......@@ -1429,7 +1430,7 @@ Guillaume, Dmitry Gutov, Doug Gwyn, Bruno Haible, Ken'ichi Handa, Lars Hansen, C
Hanson, Jesper Harder, Alexandru Harsanyi, K. Shane Hartman, John
Heidemann, Jon K. Hellan, Magnus Henoch, Markus Heritsch, Dirk
Herrmann, Karl Heuer, Manabu Higashida, Konrad Hinsen, Anders Holst,
Jeffrey C. Honig, Tassilo Horn, Kurt Hornik, Tom Houlder, Joakim
Jeffrey C. Honig, Tassilo Horn, Kurt Hornik, Khaled Hosny, Tom Houlder, Joakim
Hove, Denis Howe, Lars Ingebrigtsen, Andrew Innes, Seiichiro Inoue,
Philip Jackson, Martyn Jago, Pavel Janik, Paul Jarc, Ulf Jasper,
Thorsten Jolitz, Michael K. Johnson, Kyle Jones, Terry Jones, Simon
......@@ -1449,7 +1450,7 @@ Lüdecke, Greg McGary, Roland McGrath, Michael McNamara, Alan Mackenzie,
Christopher J. Madsen, Neil M. Mager, Artur Malabarba, Ken Manheimer, Bill Mann,
Brian Marick, Simon Marshall, Bengt Martensson, Charlie Martin,
Yukihiro Matsumoto, Tomohiro Matsuyama, David Maus, Thomas May, Will Mengarini, David
Megginson, Stefan Merten, Ben A. Mesander, Wayne Mesard, Brad
Megginson, Jimmy Aguilar Mena, Stefan Merten, Ben A. Mesander, Wayne Mesard, Brad
Miller, Lawrence Mitchell, Richard Mlynarik, Gerd Möllmann, Dani Moncayo, Stefan
Monnier, Keith Moore, Jan Moringen, Morioka Tomohiko, Glenn Morris,
Don Morrison, Diane Murray, Riccardo Murri, Sen Nagata, Erik Naggum,
......@@ -1468,7 +1469,7 @@ Reitter, Alex Rezinsky, Rob Riepel, Lara Rios, Adrian Robert, Nick
Roberts, Roland B. Roberts, John Robinson, Denis B. Roegel, Danny
Roozendaal, Sebastian Rose, William Rosenblatt, Markus Rost, Guillermo
J. Rozas, Martin Rudalics, Ivar Rummelhoff, Jason Rumney, Wolfgang
Rupprecht, Benjamin Rutt, Kevin Ryde, James B. Salem, Masahiko Sato,
Rupprecht, Benjamin Rutt, Kevin Ryde, Phil Sainty, James B. Salem, Masahiko Sato,
Timo Savola, Jorgen Schäfer, Holger Schauer, William Schelter, Ralph
Schleicher, Gregor Schmid, Michael Schmidt, Ronald S. Schnell,
Philippe Schnoebelen, Jan Schormann, Alex Schroeder, Stefan Schoef,
......@@ -1481,9 +1482,9 @@ South, Andre Spiegel, Michael Staats, Thomas Steffen, Ulf Stegemann,
Reiner Steib, Sam Steingold, Ake Stenhoff, Philipp Stephani, Peter Stephenson, Ken
Stevens, Andy Stewart, Jonathan Stigelman, Martin Stjernholm, Kim F.
Storm, Steve Strassmann, Christopher Suckling, Olaf Sylvester, Naoto
Takahashi, Steven Tamm, Jan Tatarik, Luc Teirlinck, Jean-Philippe Theberge, Jens
T. Berger Thielemann, Spencer Thomas, Jim Thompson, Toru Tomabechi,
David O'Toole, Markus Triska, Tom Tromey, Eli
Takahashi, Steven Tamm, Jan Tatarik, João Távora, Luc Teirlinck,
Jean-Philippe Theberge, Jens T.@: Berger Thielemann, Spencer Thomas,
Jim Thompson, Toru Tomabechi, David O'Toole, Markus Triska, Tom Tromey, Eli
Tziperman, Daiki Ueno, Masanobu Umeda, Rajesh Vaidheeswarran, Neil
W. Van Dyke, Didier Verna, Joakim Verona, Ulrik Vieth, Geoffrey
Voelker, Johan Vromans, Inge Wallin, John Paul Wallington, Colin
......
This diff is collapsed.
......@@ -233,7 +233,7 @@ To view this manual in other formats, click
Appendices
* Antinews:: Info for users downgrading to Emacs 25.
* Antinews:: Info for users downgrading to Emacs 26.
* GNU Free Documentation License:: The license for this documentation.
* GPL:: Conditions for copying and changing GNU Emacs.
* Tips:: Advice and coding conventions for Emacs Lisp.
......
......@@ -576,8 +576,9 @@ naming conventions, which are being phased out.
@cindex defining a function
We usually give a name to a function when it is first created. This
is called @dfn{defining a function}, and it is done with the
@code{defun} macro.
is called @dfn{defining a function}, and we usually do it with the
@code{defun} macro. This section also describes other ways to define
a function.
@defmac defun name args [doc] [declare] [interactive] body@dots{}
@code{defun} is the usual way to define new Lisp functions. It
......@@ -682,95 +683,8 @@ definition will have no effect on them.
and tells the Lisp compiler to perform inline expansion on it.
@xref{Inline Functions}.
Alternatively, you can define a function by providing the code which
will inline it as a compiler macro. The following macros make this
possible.
@c FIXME: Can define-inline use the interactive spec?
@defmac define-inline name args [doc] [declare] body@dots{}
Define a function @var{name} by providing code that does its inlining,
as a compiler macro. The function will accept the argument list
@var{args} and will have the specified @var{body}.
If present, @var{doc} should be the function's documentation string
(@pxref{Function Documentation}); @var{declare}, if present, should be
a @code{declare} form (@pxref{Declare Form}) specifying the function's
metadata.
@end defmac
Functions defined via @code{define-inline} have several advantages
with respect to macros defined by @code{defsubst} or @code{defmacro}:
@itemize @minus
@item
They can be passed to @code{mapcar} (@pxref{Mapping Functions}).
@item
They are more efficient.
@item
They can be used as @dfn{place forms} to store values
(@pxref{Generalized Variables}).
@item
They behave in a more predictable way than @code{cl-defsubst}
(@pxref{Argument Lists,,, cl, Common Lisp Extensions for GNU Emacs
Lisp}).
@end itemize
Like @code{defmacro}, a function inlined with @code{define-inline}
inherits the scoping rules, either dynamic or lexical, from the call
site. @xref{Variable Scoping}.
The following macros should be used in the body of a function defined
by @code{define-inline}.
@defmac inline-quote expression
Quote @var{expression} for @code{define-inline}. This is similar to
the backquote (@pxref{Backquote}), but quotes code and accepts only
@code{,}, not @code{,@@}.
@end defmac
@defmac inline-letevals (bindings@dots{}) body@dots{}
This is similar to @code{let} (@pxref{Local Variables}): it sets up
local variables as specified by @var{bindings}, and then evaluates
@var{body} with those bindings in effect. Each element of
@var{bindings} should be either a symbol or a list of the form
@w{@code{(@var{var} @var{expr})}}; the result is to evaluate
@var{expr} and bind @var{var} to the result. The tail of
@var{bindings} can be either @code{nil} or a symbol which should hold
a list of arguments, in which case each argument is evaluated, and the
symbol is bound to the resulting list.
@end defmac
@defmac inline-const-p expression
Return non-@code{nil} if the value of @var{expression} is already
known.
@end defmac
@defmac inline-const-val expression
Return the value of @var{expression}.
@end defmac
@defmac inline-error format &rest args
Signal an error, formatting @var{args} according to @var{format}.
@end defmac
Here's an example of using @code{define-inline}:
@lisp
(define-inline myaccessor (obj)
(inline-letevals (obj)
(inline-quote (if (foo-p ,obj) (aref (cdr ,obj) 3) (aref ,obj 2)))))
@end lisp
@noindent
This is equivalent to
@lisp
(defsubst myaccessor (obj)
(if (foo-p obj) (aref (cdr obj) 3) (aref obj 2)))
@end lisp
To undefine a function name, use @code{fmakunbound}.
@xref{Function Cells}.
@node Calling Functions
@section Calling Functions
......@@ -2155,8 +2069,12 @@ this:
An @dfn{inline function} is a function that works just like an
ordinary function, except for one thing: when you byte-compile a call
to the function (@pxref{Byte Compilation}), the function's definition
is expanded into the caller. To define an inline function, use
@code{defsubst} instead of @code{defun}.
is expanded into the caller.
The simple way to define an inline function, is to write
@code{defsubst} instead of @code{defun}. The rest of the definition
looks just the same, but using @code{defsubst} says to make it inline
for byte compilation.
@defmac defsubst name args [doc] [declare] [interactive] body@dots{}
This macro defines an inline function. Its syntax is exactly the same
......@@ -2194,9 +2112,95 @@ argument of an inline function is evaluated exactly once, you needn't
worry about how many times the body uses the arguments, as you do for
macros.
As an alternative to @code{defsubst}, you can use
@code{define-inline} to define functions via their exhaustive compiler
macro. @xref{Defining Functions, define-inline}.
Alternatively, you can define a function by providing the code which
will inline it as a compiler macro. The following macros make this
possible.
@c FIXME: Can define-inline use the interactive spec?
@defmac define-inline name args [doc] [declare] body@dots{}
Define a function @var{name} by providing code that does its inlining,
as a compiler macro. The function will accept the argument list
@var{args} and will have the specified @var{body}.
If present, @var{doc} should be the function's documentation string
(@pxref{Function Documentation}); @var{declare}, if present, should be
a @code{declare} form (@pxref{Declare Form}) specifying the function's
metadata.
@end defmac
Functions defined via @code{define-inline} have several advantages
with respect to macros defined by @code{defsubst} or @code{defmacro}:
@itemize @minus
@item
They can be passed to @code{mapcar} (@pxref{Mapping Functions}).
@item
They are more efficient.
@item
They can be used as @dfn{place forms} to store values
(@pxref{Generalized Variables}).
@item
They behave in a more predictable way than @code{cl-defsubst}
(@pxref{Argument Lists,,, cl, Common Lisp Extensions for GNU Emacs
Lisp}).
@end itemize
Like @code{defmacro}, a function inlined with @code{define-inline}
inherits the scoping rules, either dynamic or lexical, from the call
site. @xref{Variable Scoping}.
The following macros should be used in the body of a function defined
by @code{define-inline}.
@defmac inline-quote expression
Quote @var{expression} for @code{define-inline}. This is similar to
the backquote (@pxref{Backquote}), but quotes code and accepts only
@code{,}, not @code{,@@}.
@end defmac
@defmac inline-letevals (bindings@dots{}) body@dots{}
This is similar to @code{let} (@pxref{Local Variables}): it sets up
local variables as specified by @var{bindings}, and then evaluates
@var{body} with those bindings in effect. Each element of
@var{bindings} should be either a symbol or a list of the form
@w{@code{(@var{var} @var{expr})}}; the result is to evaluate
@var{expr} and bind @var{var} to the result. The tail of
@var{bindings} can be either @code{nil} or a symbol which should hold
a list of arguments, in which case each argument is evaluated, and the
symbol is bound to the resulting list.
@end defmac
@defmac inline-const-p expression
Return non-@code{nil} if the value of @var{expression} is already
known.
@end defmac
@defmac inline-const-val expression
Return the value of @var{expression}.
@end defmac
@defmac inline-error format &rest args
Signal an error, formatting @var{args} according to @var{format}.
@end defmac
Here's an example of using @code{define-inline}:
@lisp
(define-inline myaccessor (obj)
(inline-letevals (obj)
(inline-quote (if (foo-p ,obj) (aref (cdr ,obj) 3) (aref ,obj 2)))))
@end lisp
@noindent
This is equivalent to
@lisp
(defsubst myaccessor (obj)
(if (foo-p obj) (aref (cdr obj) 3) (aref obj 2)))
@end lisp
@node Declare Form
@section The @code{declare} Form
......
......@@ -135,13 +135,26 @@ non-@code{nil} value, it returns that value; otherwise it returns
@node Setting Hooks
@subsection Setting Hooks
Here's an example that uses a mode hook to turn on Auto Fill mode when
in Lisp Interaction mode:
Here's an example that adds a funtion to a mode hook to turn
on Auto Fill mode when in Lisp Interaction mode:
@example
(add-hook 'lisp-interaction-mode-hook 'auto-fill-mode)
@end example
The value of a hook variable should be a list of functions. You can
manipulate that list using the normal Lisp facilities, but the modular
way is to use the functions @code{add-hook} and @code{remove-hook},
defined below. They take care to handle some unusual situations and
avoid problems.
It works to put a @code{lambda}-expression function on a hook, but
we recommend avoiding this because it can lead to confusion. If you
add the same @code{lambda}-expression a second time but write it
slightly differently, you will get two equivalent but distinct
functions on the hook. If you then remove one of them, the other will
still be on it.
@defun add-hook hook function &optional depth local
This function is the handy way to add function @var{function} to hook
variable @var{hook}. You can use it for abnormal hooks as well as for
......
......@@ -1687,7 +1687,7 @@ If non-nil, the default, buffers opened during pdbtracking session are
killed when pdbtracking session is finished.
---
*** New function 'python-shell-send-region'.
*** New function 'python-shell-send-statement.
It sends the statement delimited by 'python-nav-beginning-of-statement'
and 'python-nav-end-of-statement' to the inferior Python process.
......
......@@ -2288,7 +2288,7 @@ the United States."
(calc-alg-digit-entry)
(setq calc-aborted-prefix nil)
(let* ((calc-digit-value nil)
(calc-prev-char nil)
(calc-prev-char last-command-event)
(calc-prev-prev-char nil)
(calc-buffer (current-buffer))
(buf
......
......@@ -3035,17 +3035,18 @@ Update the widget to show that value. The value that was current
before this operation becomes the backup value."
(let* ((symbol (widget-value widget))
(saved-value (get symbol 'saved-value))
(comment (get symbol 'saved-variable-comment)))
(comment (get symbol 'saved-variable-comment))
value)
(custom-variable-backup-value widget)
(if (not (or saved-value comment))
;; If there is no saved value, remove the setting.
(custom-push-theme 'theme-value symbol 'user 'reset)
;; Otherwise, apply the saved value.
(put symbol 'variable-comment comment)
(custom-push-theme 'theme-value symbol 'user 'set (car-safe saved-value))
(ignore-errors
(funcall (or (get symbol 'custom-set) 'set-default)
symbol (eval (car saved-value)))))
;; If there is no saved value, remove the setting.
(custom-push-theme 'theme-value symbol 'user 'reset)
(setq value (car-safe saved-value))
(custom-push-theme 'theme-value symbol 'user 'set value)
(put symbol 'variable-comment comment))
(ignore-errors
(funcall (or (get symbol 'custom-set) #'set-default) symbol
(eval (or value (car (get symbol 'standard-value))))))
(put symbol 'customized-value nil)
(put symbol 'customized-variable-comment nil)
(widget-put widget :custom-state 'unknown)
......@@ -4295,6 +4296,7 @@ This works for both graphical and text displays."
(widget-put widget :children children)
(custom-group-state-update widget))
;; End line
(insert "\n")
(custom-group--draw-horizontal-line)))))
(defvar custom-group-menu
......
......@@ -1381,7 +1381,7 @@ function runs. To disable other themes, use `disable-theme'."
(custom-theme-recalc-variable symbol)))))))
(unless (eq theme 'user)
(setq custom-enabled-themes
(cons theme (delq theme custom-enabled-themes)))
(cons theme (remq theme custom-enabled-themes)))
;; Give the `user' theme the highest priority.
(enable-theme 'user)))
......
......@@ -448,13 +448,14 @@ Usually run by inclusion in `minibuffer-setup-hook'."
with end = (icomplete--field-end)
with all = (completion-all-sorted-completions beg end)
for fn in (cond ((and minibuffer-default
(stringp minibuffer-default) ; bug#38992
(= (icomplete--field-end) (icomplete--field-beg)))
;; When we have a non-nil default and no input
;; whatsoever: we want to make sure that default
;; is bubbled to the top so that
;; When we have a non-nil string default and
;; no input whatsoever: we want to make sure
;; that default is bubbled to the top so that
;; `icomplete-force-complete-and-exit' will
;; select it (do that even if the match doesn't
;; match the completion perfectly.
;; select it (do that even if the match
;; doesn't match the completion perfectly.
`(,(lambda (comp)
(equal minibuffer-default comp))
,(lambda (comp)
......@@ -462,6 +463,12 @@ Usually run by inclusion in `minibuffer-setup-hook'."
((and fido-mode
(not minibuffer-default)
(eq (icomplete--category) 'file))
;; `fido-mode' has some extra file-sorting
;; semantics even if there isn't a default,
;; which is to bubble "./" to the top if it
;; exists. This makes M-x dired RET RET go to
;; the directory of current file, which is
;; what vanilla Emacs and `ido-mode' both do.
`(,(lambda (comp)
(string= "./" comp)))))
thereis (cl-loop
......
......@@ -851,7 +851,7 @@ can also be executed interactively independently of
(interactive (list "Interrupted by user"))
(dolist (buf (buffer-list))
(with-current-buffer buf
(let (p flymake-proc--current-process)
(let ((p flymake-proc--current-process))
(when (process-live-p p)
(kill-process p)
(process-put p 'flymake-proc--interrupted reason)
......
......@@ -499,11 +499,11 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
#if defined (NS_IMPL_COCOA) && defined (MAC_OS_X_VERSION_10_7)
/* Work around for Mach port leaks on macOS 10.15 (bug#38618). */
NSURL *fileURL = [NSURL fileURLWithPath:fstr isDirectory:NO];
BOOL isUbiquitousItem = YES;
NSNumber *isUbiquitousItem = @YES;
[fileURL getResourceValue:(id *)&isUbiquitousItem
forKey:NSURLIsUbiquitousItemKey
error:nil];
if (isUbiquitousItem)
if ([isUbiquitousItem boolValue])
fstr = @"";
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment