Emacs 25.1
2.1.1 Added Definitions
The following functions and macros are implemented in Emacs 25.1. These functions are made available by Compat on Emacs versions older than 25.1.
User Option: text-quoting-style
The value of this user option is a symbol that specifies the style Emacs should use for single quotes in the wording of help and messages. If the option’s value is curve, the style is ‘like this’ with curved single quotes. If the value is straight, the style is 'like this' with straight apostrophes. If the value is grave, quotes are not translated and the style is `like this' with grave accent and apostrophe, the standard style before Emacs version 25. The default value nil acts like curve if curved single quotes seem to be displayable, and like grave otherwise.
This option is useful on platforms that have problems with curved quotes. You can customize it freely according to your personal preference.
Function: region-bounds
Return the boundaries of the region. Value is a list of one or more cons cells of the form (start . end). It will have more than one cons cell when the region is non-contiguous, see region-noncontiguous-p and extract-rectangle-bounds.
Function: region-noncontiguous-p
Return non-nil if the region contains several pieces. An example is a rectangular region handled as a list of separate contiguous regions for each line.
Macro: save-mark-and-excursion body…
This macro is like save-excursion, but also saves and restores the mark location and mark-active. This macro does what save-excursion did before Emacs 25.1.
Function: format-message string &rest objects
This function acts like format, except it also converts any grave accents (`) and apostrophes (') in string as per the value of text-quoting-style.
Typically grave accent and apostrophe in the format translate to matching curved quotes, e.g., "Missing `%s'" might result in "Missing ‘foo’". See (elisp)Text Quoting Style, for how to influence or inhibit this translation.
Function: directory-name-p filename
This function returns non-nil if filename ends with a directory separator character. This is the forward slash ‘/’ on GNU and other POSIX-like systems; MS-Windows and MS-DOS recognize both the forward slash and the backslash ‘\’ as directory separators.
Function: string-greaterp string1 string2
This function returns the result of comparing string1 and string2 in the opposite order, i.e., it is equivalent to calling (string-lessp string2 string1).
Macro: with-file-modes mode body…
This macro evaluates the body forms with the default permissions for new files temporarily set to modes (whose value is as for set-file-modes above). When finished, it restores the original default file permissions, and returns the value of the last form in body.
This is useful for creating private files, for example.
Function: alist-get key alist &optional default remove
This function is similar to assq. It finds the first association (key . value) by comparing key with alist elements, and, if found, returns the value of that association. If no association is found, the function returns default.
This is a generalized variable (see (elisp)Generalized Variables) that can be used to change a value with setf. When using it to set a value, optional argument remove non-nil means to remove key’s association from alist if the new value is eql to default.
Macro: if-let (bindings…) then &rest else…
As with let*, bindings will consist of (symbol value-form) entries that are evaluated and bound sequentially. If all value-form evaluate to non-nil values, then then is evaluated as were the case with a regular let* expression, with all the variables bound. If any value-form evaluates to nil, else is evaluated, without any bound variables.
A binding may also optionally drop the symbol, and simplify to (value-form) if only the test is of interest.
For the sake of backwards compatibility, it is possible to write a single binding without a binding list:
(if-let* (symbol (test)) foo bar)
≡
(if-let* ((symbol (test))) foo bar)Macro: when-let (bindings…) &rest body
As with when, if one is only interested in the case where all bindings are non-nil. Otherwise bindings are interpreted just as they are by if-let*.
Function: hash-table-empty hash-table
Check whether hash-table is empty (has 0 elements).
Macro: thread-first &rest forms
Combine forms into a single expression by “threading” each element as the first argument of their successor. Elements of forms can either be an list of an atom.
For example, consider the threading expression and it’s equivalent macro expansion:
(thread-first
5
(+ 20)
(/ 25)
-
(+ 40))
≡
(+ (- (/ (+ 5 20) 25)) 40)Note how the single - got converted into a list before threading. This example uses arithmetic functions, but thread-first is not restricted to arithmetic or side-effect free code.
Macro: thread-last &rest forms
Combine forms into a single expression by “threading” each element as the last argument of their successor. Elements of forms can either be an list of an atom.
For example, consider the threading expression and it’s equivalent macro expansion:
(thread-first
5
(+ 20)
(/ 25)
-
(+ 40))
≡
(+ 40 (- (/ 25 (+ 20 5))))Note how the single - got converted into a list before threading. This example uses arithmetic functions, but thread-last is not restricted to arithmetic or side-effect free code.
Function: macroexpand-1 form &optional environment
This function expands macros like macroexpand, but it only performs one step of the expansion: if the result is another macro call, macroexpand-1 will not expand it.
See Expansion.
Function: macroexp-quote e
Return an expression e such that (eval e) is v.
Function: macroexp-parse body
Parse a function body into (declarations . exps).
Function: bool-vector &rest objects
This function creates and returns a bool-vector whose elements are the arguments, objects.
See (elisp)Bool-Vectors.
2.1.2 Missing Definitions
Compat does not provide support for the following Lisp features implemented in 25.1:
- The function
macroexp-macroexpand. - The macro
macroexp-let2*. - The function
directory-files-recursively. - New
pcasepatterns. - The hook
prefix-command-echo-keystrokes-functionsandprefix-command-preserve-state-hook. - The hook
pre-redisplay-functions. - The function
make-process. - Support for the variable
inhibit-message. - The
define-inlinefunctionality. - The functions
string-collate-lesspandstring-collate-equalp. - The function
funcall-interactively. - The function
buffer-substring-with-bidi-context. - The function
font-info. - The function
default-font-width. - The function
window-font-heightandwindow-font-width. - The function
window-max-chars-per-line. - The function
set-binary-mode. - The functions
bufferpos-to-fileposandfilepos-to-bufferpos. - The
thunklibrary.