"Compat" Manual

Table of Contents

Next:   [Contents][Index]

"Compat" Manual

This manual documents the usage of the "Compat" Emacs lisp library, the forward-compatibility library for Emacs Lisp, corresponding to version 28.1.2.2.

Copyright © 2022 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover Texts being “A GNU Manual,” and with the Back-Cover Texts as in (a) below. A copy of the license is included in the section entitled “GNU Free Documentation License.”

(a) The FSF’s Back-Cover Text is: “You have the freedom to copy and modify this GNU manual.”


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction


Next: , Up: Introduction   [Contents][Index]

1.1 Overview

The objective of Compat is to provide "forwards compatibility" library for Emacs Lisp. That is to say by using Compat, an Elisp package does not have to make the decision to either use new and useful functionality or support old versions of Emacs.

Version 24.3 is chosen as the oldest version, because this is the newest version on CentOS 7. It is intended to preserve compatibility for at least as the Centos 7 reaches EOL, 2024.

If you are developing a package with Compat in mind, consider loading ‘compat-help‘ (on your system, not in a package) to get relevant notes inserted into the help buffers of functions that are implemented or advised in Compat.

Note that Compat provides a few prefixed function, ie. functions with a compat- prefix. These are used to provide extended functionality for commands that are already defined (sort, assoc, seq, …). It might be possible to transform these into advised functions later on, so that the modified functionality is accessible without a prefix. Feedback on this point is appreciated.


Next: , Previous: , Up: Introduction   [Contents][Index]

1.2 Usage

The intended use-case for this library is for package developers to add as a dependency in the header:

;; Package-Requires: ((emacs "24.3") (compat "28.1.2.2"))

There is no need to depend on emacs 24.3 specifically. One can choose to any newer version, if features not provided by Compat necessitate it.

In any file where compatibility forms are used, a

(require 'compat)

should be added early on.

This will load all non-prefixed definitions (functions and macros with a leading ‘compat-‘). To load these, an additional

(require 'compat-XY) ; e.g. 26

will be necessary, to load compatibility code for Emacs version XY.

It is recommended to subscribe to the compat-announce mailing list to be notified when new versions are released or relevant changes are made.


Up: Usage   [Contents][Index]

1.2.1 Additional libraries

These libraries are packages with Compat, but are disabled by default. To use them you can use M-x load-library:

compat-help

Add notes to *Help* buffer, if a compatibility definition has something to warn you about.

compat-font-lock

Highlight functions that are implemented as compatibility definitions.


Previous: , Up: Introduction   [Contents][Index]

1.3 Intentions

The library intends to provide support back until Emacs 24.3. The intended audience are package developers that are interested in using newer developments, without having to break compatibility.

Sadly, total backwards compatibility cannot be provided for technical reasons. These might include:


Next: , Previous: , Up: Top   [Contents][Index]

2 Support

This section goes into the features that Compat manages and doesn’t manage to provide for each Emacs version.


Next: , Up: Support   [Contents][Index]

2.1 Emacs 24.4

2.1.1 Unprefixed Definitions

The following functions and macros implemented in 24.4, and are provided by Compat by default:

Macro: with-eval-after-load library body…

This macro arranges to evaluate body at the end of loading the file library, each time library is loaded. If library is already loaded, it evaluates body right away.

You don’t need to give a directory or extension in the file name library. Normally, you just give a bare file name, like this:

(with-eval-after-load "js" (keymap-set js-mode-map "C-c C-c" 'js-eval))

To restrict which files can trigger the evaluation, include a directory or an extension or both in library. Only a file whose absolute true name (i.e., the name with all symbolic links chased out) matches all the given name components will match. In the following example, my_inst.elc or my_inst.elc.gz in some directory ..../foo/bar will trigger the evaluation, but not my_inst.el:

(with-eval-after-load "foo/bar/my_inst.elc" …)

library can also be a feature (i.e., a symbol), in which case body is evaluated at the end of any file where (provide library) is called.

An error in body does not undo the load, but does prevent execution of the rest of body.

See (elisp)Hooks for Loading.

Function: special-form-p object

This predicate tests whether its argument is a special form, and returns t if so, nil otherwise.

See (elisp)Special Forms.

Function: macrop object

This predicate tests whether its argument is a macro, and returns t if so, nil otherwise.

See (elisp)Simple Macro.

Function: string-suffix-p suffix string &optional ignore-case

This function returns non-nil if suffix is a suffix of string; i.e., if string ends with suffix. If the optional argument ignore-case is non-nil, the comparison ignores case differences.

See (elisp)Text Comparison.

Function: delete-consecutive-dups list &optional circular

Destructively remove equal consecutive duplicates from list. First and last elements are considered consecutive if circular is non-nil.

Function: define-error name message &optional parent

In order for a symbol to be an error symbol, it must be defined with define-error which takes a parent condition (defaults to error). This parent defines the conditions that this kind of error belongs to. The transitive set of parents always includes the error symbol itself, and the symbol error. Because quitting is not considered an error, the set of parents of quit is just (quit).

See (elisp)Error Symbols.

Function: bool-vector-exclusive-or a b &optional c

Return bitwise exclusive or of bool vectors a and b. If optional argument c is given, the result of this operation is stored into c. All arguments should be bool vectors of the same length.

See (elisp)Bool-Vectors.

Function: bool-vector-union a b &optional c

Return bitwise or of bool vectors a and b. If optional argument c is given, the result of this operation is stored into c. All arguments should be bool vectors of the same length.

See (elisp)Bool-Vectors.

Function: bool-vector-intersection a b &optional c

Return bitwise and of bool vectors a and b. If optional argument c is given, the result of this operation is stored into c. All arguments should be bool vectors of the same length.

See (elisp)Bool-Vectors.

Function: bool-vector-set-difference a b &optional c

Return set difference of bool vectors a and b. If optional argument c is given, the result of this operation is stored into c. All arguments should be bool vectors of the same length.

See (elisp)Bool-Vectors.

Function: bool-vector-not a &optional b

Return set complement of bool vector a. If optional argument b is given, the result of this operation is stored into b. All arguments should be bool vectors of the same length.

See (elisp)Bool-Vectors.

Function: bool-vector-subsetp a b

Return t if every t value in a is also t in b, nil otherwise. All arguments should be bool vectors of the same length.

See (elisp)Bool-Vectors.

Function: bool-vector-count-consecutive a b i

Return the number of consecutive elements in a equal b starting at i. a is a bool vector, b is t or nil, and i is an index into a.

See (elisp)Bool-Vectors.

Function: bool-vector-count-population a

Return the number of elements that are t in bool vector a.

See (elisp)Bool-Vectors.

Function: completion-table-with-cache function &optional ignore-case

This is a wrapper for completion-table-dynamic that saves the last argument-result pair. This means that multiple lookups with the same argument only need to call function once. This can be useful when a slow operation is involved, such as calling an external process.

See (elisp)Programmed Completion.

Function: face-spec-set face spec &optional spec-type

This function applies spec as a face spec for face. spec should be a face spec, as described in the above documentation for defface.

This function also defines face as a valid face name if it is not already one, and (re)calculates its attributes on existing frames.

The optional argument spec-type determines which spec to set. If it is omitted or nil or face-override-spec, this function sets the override spec, which overrides face specs on face of all the other types mentioned below. This is useful when calling this function outside of Custom code. If spec-type is customized-face or saved-face, this function sets the customized spec or the saved custom spec, respectively. If it is face-defface-spec, this function sets the default face spec (the same one set by defface). If it is reset, this function clears out all customization specs and override specs from face (in this case, the value of spec is ignored). The effect of any other value of spec-type on the face specs is reserved for internal use, but the function will still define face itself and recalculate its attributes, as described above.

See (elisp)Defining Faces.

2.1.2 Prefixed Definitions

These functions are prefixed with compat prefix, and are only loaded when compat-24 is required:

Function: compat-= number-or-marker &rest number-or-markers

This function tests whether all its arguments are numerically equal, and returns t if so, nil otherwise.

See (elisp)Comparison of Numbers.

Function: compat-< number-or-marker &rest number-or-markers

This function tests whether each argument is strictly less than the following argument. It returns t if so, nil otherwise.

See (elisp)Comparison of Numbers.

Function: compat-> number-or-marker &rest number-or-markers

This function tests whether each argument is strictly greater than the following argument. It returns t if so, nil otherwise.

See (elisp)Comparison of Numbers.

Function: compat-<= number-or-marker &rest number-or-markers

This function tests whether each argument is less than or equal to the following argument. It returns t if so, nil otherwise.

See (elisp)Comparison of Numbers.

Function: compat->= number-or-marker &rest number-or-markers

This function tests whether each argument is greater than or equal to the following argument. It returns t if so, nil otherwise.

See (elisp)Comparison of Numbers.

These functions differ from the previous implementation in that they allow for more than two argument to be compared.

Function: compat-split-string string &optional separators omit-nulls trim

This function splits string into substrings based on the regular expression separators (see (elisp)Regular Expressions). Each match for separators defines a splitting point; the substrings between splitting points are made into a list, which is returned.

see (elisp)Creating Strings for more details.

This version handles the optional argument trim. If it is non-nil, it should be a regular expression to match text to trim from the beginning and end of each substring. If trimming makes the substring empty, it is treated as null.

2.1.3 Missing Definitions

Compat does not provide support for the following Lisp features implemented in 24.4:


Next: , Previous: , Up: Support   [Contents][Index]

2.2 Emacs 25.1

2.2.1 Unprefixed Definitions

The following functions and macros implemented in 25.1, and are provided by Compat by default:

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.

(elisp)Formatting Strings.

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.

See (elisp)Directory Names.

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).

See (elisp)Text Comparison.

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.

See (elisp)Changing Files.

Function: alist-get key alist &optional default remove testfn

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. Comparison of key against alist elements uses the function specified by testfn, defaulting to eq.

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.

(elisp)Association Lists.

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*.

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 (elisp)Expansion.

Function: directory-files-recursively directory regexp &optional include-directories predicate follow-symlinks

Return all files under directory whose names match regexp. This function searches the specified directory and its sub-directories, recursively, for files whose basenames (i.e., without the leading directories) match the specified regexp, and returns a list of the absolute file names of the matching files (see (elisp)absolute file names). The file names are returned in depth-first order, meaning that files in some sub-directory are returned before the files in its parent directory. In addition, matching files found in each subdirectory are sorted alphabetically by their basenames. By default, directories whose names match regexp are omitted from the list, but if the optional argument include-directories is non-nil, they are included.

By default, all subdirectories are descended into. If predicate is t, errors when trying to descend into a subdirectory (for instance, if it’s not readable by this user) are ignored. If it’s neither nil nor t, it should be a function that takes one parameter (the subdirectory name) and should return non-nil if the directory is to be descended into.

Symbolic links to subdirectories are not followed by default, but if follow-symlinks is non-nil, they are followed.

See (elisp)Contents of Directories.

Function: bool-vector &rest objects

This function creates and returns a bool-vector whose elements are the arguments, objects.

See (elisp)Bool-Vectors.

2.2.2 Prefixed Definitions

These functions are prefixed with compat prefix, and are only loaded when compat-25 is required:

Function: compat-sort sequence predicate

This function sorts sequence stably. Note that this function doesn’t work for all sequences; it may be used only for lists and vectors. If sequence is a list, it is modified destructively. This functions returns the sorted sequence and compares elements using predicate. A stable sort is one in which elements with equal sort keys maintain their relative order before and after the sort. Stability is important when successive sorts are used to order elements according to different criteria.

See (elisp)Sequence Functions.

The compatibility version adds support for vectors to be sorted, not just lists.

2.2.3 Missing Definitions

Compat does not provide support for the following Lisp features implemented in 25.1:


Next: , Previous: , Up: Support   [Contents][Index]

2.3 Emacs 26.1

2.3.1 Unprefixed Definitions

The following functions and macros implemented in 26.1, and are provided by Compat by default:

Function: func-arity function

This function provides information about the argument list of the specified function. The returned value is a cons cell of the form (min . max), where min is the minimum number of arguments, and max is either the maximum number of arguments, or the symbol many for functions with &rest arguments, or the symbol unevalled if function is a special form.

Note that this function might return inaccurate results in some situations, such as the following:

See (elisp)What Is a Function.

Function: mapcan function sequence

This function applies function to each element of sequence, like mapcar, but instead of collecting the results into a list, it returns a single list with all the elements of the results (which must be lists), by altering the results (using nconc; see (elisp)Rearrangement). Like with mapcar, sequence can be of any type except a char-table.

;; Contrast this: (mapcar #'list '(a b c d)) ⇒ ((a) (b) (c)
(d)) ;; with this: (mapcan #'list '(a b c d)) ⇒ (a b c d)

See (elisp)Mapping Functions.

Function: cXXXr
Function: cXXXXr

See (elisp)List Elements.

Function: gensym &optional prefix

This function returns a symbol using make-symbol, whose name is made by appending gensym-counter to prefix and incrementing that counter, guaranteeing that no two calls to this function will generate a symbol with the same name. The prefix defaults to "g".

Variable: gensym-counter

See gensym.

Function: make-nearby-temp-file prefix &optional dir-flag suffix

This function is similar to make-temp-file, but it creates a temporary file as close as possible to default-directory. If prefix is a relative file name, and default-directory is a remote file name or located on a mounted file systems, the temporary file is created in the directory returned by the function temporary-file-directory. Otherwise, the function make-temp-file is used. prefix, dir-flag and suffix have the same meaning as in make-temp-file.

(let ((default-directory "/ssh:remotehost:")) (make-nearby-temp-file
  "foo")) ⇒ "/ssh:remotehost:/tmp/foo232J6v"
Variable: mounted-file-systems

A regular expression matching files names that are probably on a mounted file system.

Function: temporary-file-directory

The directory for writing temporary files via make-nearby-temp-file. In case of a remote default-directory, this is a directory for temporary files on that remote host. If such a directory does not exist, or default-directory ought to be located on a mounted file system (see mounted-file-systems), the function returns default-directory. For a non-remote and non-mounted default-directory, the value of the variable temporary-file-directory is returned.

See (elisp)Unique File Names.

Macro: if-let* (bindings…) then &rest else

if-let* is mostly equivalent to if-let, with the exception that the legacy (if (var (test)) foo bar) syntax is not permitted.

Macro: when-let* (bindings…) then &rest else

when-let* is mostly equivalent to when-let, with the exception that the legacy (when-let (var (test)) foo bar) syntax is not permitted.

Macro: and-let* (bindings…) &rest body

A combination of let* and and, analogous to when-let*. If all bindings are non-nil and body is nil, then the result of the and-let* form will be the last value bound in bindings.

Please Note: The implementation provided by Compat does not include a bug that was observed with Emacs 26 (see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31840).

Function: file-local-name filename

This function returns the local part of filename. This is the part of the file’s name that identifies it on the remote host, and is typically obtained by removing from the remote file name the parts that specify the remote host and the method of accessing it. For example:

(file-local-name "/ssh:user@host:/foo/bar") ⇒
     "/foo/bar"

For a remote filename, this function returns a file name which could be used directly as an argument of a remote process (see (elisp)Asynchronous Processes, and see (elisp)Synchronous Processes), and as the program to run on the remote host. If filename is local, this function returns it unchanged.

See (elisp)Magic File Names.

Macro: file-name-quoted-p name

This macro returns non-nil, when name is quoted with the prefix ‘/:’. If name is a remote file name, the local part of name is checked.

See (elisp)File Name Expansion.

Macro: file-name-quote name

This macro adds the quotation prefix ‘/:’ to the file name. For a local file name, it prefixes name with ‘/:’. If name is a remote file name, the local part of name (see (elisp)Magic File Names) is quoted. If name is already a quoted file name, name is returned unchanged.

(substitute-in-file-name (file-name-quote "bar/~/foo")) ⇒
     "/:bar/~/foo"

(substitute-in-file-name (file-name-quote "/ssh:host:bar/~/foo"))
     ⇒ "/ssh:host:/:bar/~/foo"

The macro cannot be used to suppress file name handlers from magic file names (see (elisp)Magic File Names).

See (elisp)File Name Expansion.

Function: read-multiple-choice prompt choices &optional help-string show-help long-form

Ask user a multiple choice question. prompt should be a string that will be displayed as the prompt.

choices is an alist where the first element in each entry is a character to be entered, the second element is a short name for the entry to be displayed while prompting (if there’s room, it might be shortened), and the third, optional entry is a longer explanation that will be displayed in a help buffer if the user requests more help.

If optional argument long-form is non-nil, the user will have to type in long-form answers (using completing-read) instead of hitting a single key. The answers must be among the second elements of the values in the choices list.

Note: The Compat implementation of this function ignores the optional arguments help-string and show-help. Therefore the optional third element in each choices entry will also be disregarded.

See (elisp)Reading One Event.

Function: image-property

Defined in image.el.

This function can also be used as a generalised variable. To use this you need to explicitly require compat-26.

Function: file-attribute-type

Return the field type as generated by file-attributes.

See (elisp)File Attributes.

Return the field link-number as generated by file-attributes.

See (elisp)File Attributes.

Function: file-attribute-user-id

Return the field user-id as generated by file-attributes.

See (elisp)File Attributes.

Function: file-attribute-group-id

Return the field group-id as generated by file-attributes.

See (elisp)File Attributes.

Function: file-attribute-access-time

Return the field access-time as generated by file-attributes.

See (elisp)File Attributes.

Function: file-attribute-modification-time

Return the field modification-time as generated by file-attributes.

See (elisp)File Attributes.

Function: file-attribute-status-change-time

Return the field modification-time as generated by file-attributes.

See (elisp)File Attributes.

Function: file-attribute-size

Return the field size as generated by file-attributes.

See (elisp)File Attributes.

Function: file-attribute-modes

Return the field modes as generated by file-attributes.

See (elisp)File Attributes.

Function: file-attribute-inode-number

Return the field inode-number as generated by file-attributes.

See (elisp)File Attributes.

Function: file-attribute-device-number

Return the field device-number as generated by file-attributes.

See (elisp)File Attributes.

Function: file-attribute-collect attributes &rest attr-names

Filter the file attributes attributes, as generated by file-attributes, according to attr-names.

Valid attribute names for attr-names are: type, link-number, user-id, group-id, access-time, modification-time, status-change-time, size, modes, inode-number and device-number.

(file-attributes ".") ⇒ (t 1 1000 1000 (25329 18215 325481 96000) (25325 15364 530263 840000) (25325 15364 530263 840000) 788 "drwxr-xr-x" t 137819 40)
(file-attribute-collect (file-attributes ".") 'type 'modes
'inode-number) ⇒ (t "drwxr-xr-x" 137819)

2.3.2 Prefixed Definitions

These functions are prefixed with compat prefix, and are only loaded when compat-26 is required:

Function: compat-assoc key alist &optional testfn

This function returns the first association for key in alist, comparing key against the alist elements using testfn if it is a function, and equal otherwise (see (elisp)Equality Predicates). If testfn is a function, it is called with two arguments: the CAR of an element from alist and key. The function returns nil if no association in alist has a CAR equal to key, as tested by testfn.

See (elisp)Association Lists.

The compatibility version adds support for handling the optional argument testfn.

Function: compat-line-number-at-pos &optional pos absolute

This function returns the line number in the current buffer corresponding to the buffer position pos. If pos is nil or omitted, the current buffer position is used. If absolute is nil, the default, counting starts at (point-min), so the value refers to the contents of the accessible portion of the (potentially narrowed) buffer. If absolute is non-nil, ignore any narrowing and return

See (elisp)Text Lines.

The compatibility version adds support for handling the optional argument absolute.

Function: compat-alist-get key alist &optional default remove testfn

See (elisp)Association Lists. 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. Comparison of key against alist elements uses the function specified by testfn, defaulting to eq.

See (elisp)Association Lists.

The compatibility version handles the optional argument testfn. It can also be used as a (elisp)Generalized Variables.

Function: compat-string-trim-left string &optional regexp

Remove the leading text that matches regexp from string. regexp defaults to ‘[ \t\n\r]+’.

See (elisp)Creating Strings.

The compatibility version handles the optional argument regexp.

Function: compat-string-trim-right string &optional regexp

Remove the trailing text that matches regexp from string. regexp defaults to ‘[ \t\n\r]+’.

See (elisp)Creating Strings.

The compatibility version handles the optional argument regexp.

Function: compat-string-trim string &optional trim-left trim-right

Remove the leading text that matches trim-left and trailing text that matches trim-right from string. Both regexps default to ‘[ \t\n\r]+’.

See (elisp)Creating Strings.

The compatibility version handles the optional arguments trim-left and trim-right.

2.3.3 Missing Definitions

Compat does not provide support for the following Lisp features implemented in 26.1:


Next: , Previous: , Up: Support   [Contents][Index]

2.4 Emacs 27.1

2.4.1 Unprefixed Definitions

The following functions and macros implemented in 27.1, and are provided by Compat by default:

Function: proper-list-p object

This function returns the length of object if it is a proper list, nil otherwise (see (elisp)Cons Cells). In addition to satisfying listp, a proper list is neither circular nor dotted.

(proper-list-p '(a b c)) ⇒ 3
(proper-list-p '(a b . c)) ⇒ nil

See (elisp)List-related Predicates.

Function: string-distance string1 string2 &optional bytecompare

This function returns the Levenshtein distance between the source string string1 and the target string string2. The Levenshtein distance is the number of single-character changes—deletions, insertions, or replacements—required to transform the source string into the target string; it is one possible definition of the edit distance between strings.

Letter-case of the strings is significant for the computed distance, but their text properties are ignored. If the optional argument bytecompare is non-nil, the function calculates the distance in terms of bytes instead of characters. The byte-wise comparison uses the internal Emacs representation of characters, so it will produce inaccurate results for multibyte strings that include raw bytes (see (elisp)Text Representations); make the strings unibyte by encoding them (see (elisp)Explicit Encoding) if you need accurate results with raw bytes.

See (elisp)Text Comparison.

Function: json-serialize object &rest args

This function returns a new Lisp string which contains the JSON representation of object. The argument args is a list of keyword/argument pairs. The following keywords are accepted:

:null-object

The value decides which Lisp object to use to represent the JSON keyword null. It defaults to the symbol :null.

:false-object

The value decides which Lisp object to use to represent the JSON keyword false. It defaults to the symbol :false.

See (elisp)Parsing JSON.

Function: json-insert object &rest args

This function inserts the JSON representation of object into the current buffer before point. The argument args are interpreted as in json-parse-string.

See (elisp)Parsing JSON.

Function: json-parse-string string &rest args

This function parses the JSON value in string, which must be a Lisp string. If string doesn’t contain a valid JSON object, this function signals the json-parse-error error.

The argument args is a list of keyword/argument pairs. The following keywords are accepted:

:object-type

The value decides which Lisp object to use for representing the key-value mappings of a JSON object. It can be either hash-table, the default, to make hashtables with strings as keys; alist to use alists with symbols as keys; or plist to use plists with keyword symbols as keys.

:array-type

The value decides which Lisp object to use for representing a JSON array. It can be either array, the default, to use Lisp arrays; or list to use lists.

:null-object

The value decides which Lisp object to use to represent the JSON keyword null. It defaults to the symbol :null.

:false-object

The value decides which Lisp object to use to represent the JSON keyword false. It defaults to the symbol :false.

See (elisp)Parsing JSON.

Function: json-parse-buffer &rest args

This function reads the next JSON value from the current buffer, starting at point. It moves point to the position immediately after the value if contains a valid JSON object; otherwise it signals the json-parse-error error and doesn’t move point. The arguments args are interpreted as in json-parse-string.

See (elisp)Parsing JSON.

Macro: ignore-errors body…

This construct executes body, ignoring any errors that occur during its execution. If the execution is without error, ignore-errors returns the value of the last form in body; otherwise, it returns nil.

Here’s the example at the beginning of this subsection rewritten using ignore-errors:

  (ignore-errors (delete-file filename))

See (elisp)Handling Errors.

Macro: dolist-with-progress-reporter (var count [result]) reporter-or-message body…

This is another convenience macro that works the same way as dolist does, but also reports loop progress using the functions described above. As in dotimes-with-progress-reporter, reporter-or-message can be a progress reporter or a string. You can rewrite the previous example with this macro as follows:

(dolist-with-progress-reporter (k (number-sequence 0 500)) "Collecting
    some mana for Emacs..."  (sit-for 0.01))

See (elisp)Progress.

Function: flatten-tree tree

This function returns a “flattened” copy of tree, that is, a list containing all the non-nil terminal nodes, or leaves, of the tree of cons cells rooted at tree. Leaves in the returned list are in the same order as in tree.

(flatten-tree '(1 (2 . 3) nil (4 5 (6)) 7)) ⇒(1 2 3 4 5 6 7)

See (elisp)Building Lists.

Function: xor condition1 condition2

This function returns the boolean exclusive-or of condition1 and condition2. That is, xor returns nil if either both arguments are nil, or both are non-nil. Otherwise, it returns the value of that argument which is non-nil.

Note that in contrast to or, both arguments are always evaluated.

See (elisp)Combining Conditions.

Variable: regexp-unmatchable

This variable contains a regexp that is guaranteed not to match any string at all. It is particularly useful as default value for variables that may be set to a pattern that actually matches something.

See (elisp)Regexp Functions

Function: decoded-time-second time

Return the seconds field of a decoded-time record time.

Function: decoded-time-minute time

Return the minute field of a decoded-time record time.

Function: decoded-time-hour time

Return the hour field of a decoded-time record time.

Function: decoded-time-day time

Return the day field of a decoded-time record time.

Function: decoded-time-month time

Return the month field of a decoded-time record time.

Function: decoded-time-year time

Return the year field of a decoded-time record time.

Function: decoded-time-weekday time

Return the weekday field of a decoded-time record time.

Function: decoded-time-dst time

Return the dst (daylight saving time indicator) field of a decoded-time record time.

Function: decoded-time-zone time

Return the zone field of a decoded-time record time.

Function: package-get-version

Return the version number of the package in which this is used.

Function: time-equal-p t1 t2

This returns t if the two time values t1 and t2 are equal.

See (elisp)Time Calculations.

Function: date-days-in-month year month

Return the number of days in month in year. For instance, February 2020 has 29 days.

See (elisp)Time Calculations. This function requires the time-date feature to be loaded.

User Option: exec-path

The value of this variable is a list of directories to search for programs to run in subprocesses. Each element is either the name of a directory (i.e., a string), or nil, which stands for the default directory (which is the value of default-directory). See (elisp)executable-find, for the details of this search.

The value of exec-path is used by call-process and start-process when the program argument is not an absolute file name.

Generally, you should not modify exec-path directly. Instead, ensure that your PATH environment variable is set appropriately before starting Emacs. Trying to modify exec-path independently of PATH can lead to confusing results.

See (elisp)Subprocess Creation.

Function: provided-mode-derived-p mode &rest modes

This function returns non-nil if mode is derived from any of the major modes given by the symbols modes.

Function: derived-mode-p &rest modes

This function returns non-nil if the current major mode is derived from any of the major modes given by the symbols modes.

See (elisp)Derived Modes.

2.4.2 Prefixed Definitions

These functions are prefixed with compat prefix, and are only loaded when compat-27 is required:

Function: compat-recenter &optional count redisplay

This function scrolls the text in the selected window so that point is displayed at a specified vertical position within the window. It does not move point with respect to the text.

See (elisp)Textual Scrolling.

This compatibility version adds support for the optional argument redisplay.

Function: compat-lookup-key keymap key &optional accept-defaults

This function returns the definition of key in keymap. If the string or vector key is not a valid key sequence according to the prefix keys specified in keymap, it must be too long and have extra events at the end that do not fit into a single key sequence. Then the value is a number, the number of events at the front of key that compose a complete key.

See (elisp)Low-Level Key Binding.

This compatibility version allows for keymap to be a list of keymaps, instead of just a singular keymap.

Macro: setq-local &rest pairs

pairs is a list of variable and value pairs. This macro creates a buffer-local binding in the current buffer for each of the variables, and gives them a buffer-local value. It is equivalent to calling make-local-variable followed by setq for each of the variables. The variables should be unquoted symbols.

(setq-local var1 "value1"
            var2 "value2")

See (elisp)Creating Buffer-Local.

This compatibility version allows for more than one variable to be set at once, as can be done with setq.

Function: compat-regexp-opt strings &optional paren

This function returns an efficient regular expression that will match any of the strings in the list strings. This is useful when you need to make matching or searching as fast as possible—for example, for Font Lock mode.

See (elisp)Regexp Functions.

The compatibility version of this functions handles the case where strings in an empty list. In that case, a regular expression is generated that never matches anything (see regexp-unmatchable).

Function: compat-file-size-human-readable file-size &optional flavor space unit

Return a string with a human readable representation of file-size.

The optional second argument flavor controls the units and the display format. If flavor is…

The compatibility version handles the optional third (space) and forth (unit) arguments. The argument space can be a string that is placed between the number and the unit. The argument unit determines the unit to use. By default it will be an empty string, unless flavor is iec, in which case it will be B.

Function: compat-assoc-delete-all

This function is like assq-delete-all except that it accepts an optional argument test, a predicate function to compare the keys in alist. If omitted or nil, test defaults to equal. As assq-delete-all, this function often modifies the original list structure of alist.

See (elisp)Association Lists.

This compatibility version handles the optional third (testfn) argument.

Function: compat-executable-find program &optional remote

This function searches for the executable file of the named program and returns the absolute file name of the executable, including its file-name extensions, if any. It returns nil if the file is not found. The function searches in all the directories in exec-path, and tries all the file-name extensions in exec-suffixes (see (elisp)Subprocess Creation).

If remote is non-nil, and default-directory is a remote directory, program is searched on the respective remote host.

See (elisp)Locating Files.

This compatibility version adds support to handle the optional second (remote) argument.

Function: compat-dired-get-marked-files &optional localp arg filter distinguish-one-marked error

Return a list of file names that are marked in a Dired buffer.

This compatibility version handles the optional fifth (error) argument, which signals an error if the list of found files is empty. error can be a string with the error message.

2.4.3 Missing Definitions

Compat does not provide support for the following Lisp features implemented in 27.1:


Previous: , Up: Support   [Contents][Index]

2.5 Emacs 28.1

2.5.1 Unprefixed Definitions

The following functions and macros implemented in 28.1, and are provided by Compat by default:

Function: string-search needle haystack &optional start-pos

Return the position of the first instance of needle in haystack, both of which are strings. If start-pos is non-nil, start searching from that position in needle. Return nil if no match was found. This function only considers the characters in the strings when doing the comparison; text properties are ignored. Matching is always case-sensitive.

Function: length= sequence length

Return non-nil if the length of sequence is equal to length.

Function: length< sequence length

Return non-nil if sequence is shorter than length. This may be more efficient than computing the length of sequence if sequence is a long list.

Function: length> sequence length

Return non-nil if sequence is longer than length.

Function: file-name-concat directory &rest components

Concatenate components to directory, inserting a slash before the components if directory or the preceding component didn’t end with a slash.

(file-name-concat "/tmp" "foo") ⇒ "/tmp/foo"

A directory or components that are nil or the empty string are ignored—they are filtered out first and do not affect the results in any way.

This is almost the same as using concat, but dirname (and the non-final components) may or may not end with slash characters, and this function will not double those characters.

Function: garbage-collect-maybe factor

Suggest to run garbage collection, if enough data has been allocated. This is determined by the positive numerical argument factor, that would proportionally increase the likelihood of garbage collection taking place.

This compatibility function does nothing and ignores any suggestion.

Function: string-replace from-string to-string in-string

This function replaces all occurrences of from-string with to-string in in-string and returns the result. It may return one of its arguments unchanged, a constant string or a new string. Case is significant, and text properties are ignored.

Function: always &rest arguments

This function ignores any arguments and returns t.

See (elisp)Calling Functions.

Function: insert-into-buffer to-buffer &optional start end

This is like insert-buffer-substring, but works in the opposite direction: The text is copied from the current buffer into to-buffer. The block of text is copied to the current point in to-buffer, and point (in that buffer) is advanced to after the end of the copied text. Is start/end is nil, the entire text in the current buffer is copied over.

See (elisp)Insertion.

Function: replace-string-in-region regexp replacement &optional start end

This function replaces all the occurrences of regexp with replacement in the region of buffer text between start and end; start defaults to position of point, and end defaults to the last accessible position of the buffer. The search for regexp is case-sensitive, and replacement is inserted without changing its letter-case. The replacement string can use the same special elements starting with ‘\’ as replace-match does. The function returns the number of replaced occurrences, or nil if regexp is not found. The function preserves the position of point.

(replace-regexp-in-region "foo[ \t]+bar" "foobar")

See (elisp)Search and Replace.

Function: replace-regexp-in-string string replacement &optional start end

This function works similarly to replace-regexp-in-region, but searches for, and replaces, literal strings instead of regular expressions.

See (elisp)Search and Replace.

Function: buffer-local-boundp variable buffer

This returns non-nil if there’s either a buffer-local binding of variable (a symbol) in buffer buffer, or variable has a global binding.

See (elisp)Creating Buffer-Local.

Macro: with-existing-directory body…

This macro ensures that default-directory is bound to an existing directory before executing body. If default-directory already exists, that’s preferred, and otherwise some other directory is used. This macro can be useful, for instance, when calling an external command that requires that it’s running in a directory that exists. The chosen directory is not guaranteed to be writable.

See (elisp)Testing Accessibility.

Macro: dlet (bindings…) forms…

This special form is like let, but it binds all variables dynamically. This is rarely useful—you usually want to bind normal variables lexically, and special variables (i.e., variables that are defined with defvar) dynamically, and this is what let does.

dlet can be useful when interfacing with old code that assumes that certain variables are dynamically bound (see (elisp)Dynamic Binding), but it’s impractical to defvar these variables. dlet will temporarily make the bound variables special, execute the forms, and then make the variables non-special again.

See (elisp)Local Variables.

Function: ensure-list object

This function returns object as a list. If object is already a list, the function returns it; otherwise, the function returns a one-element list containing object.

This is usually useful if you have a variable that may or may not be a list, and you can then say, for instance:

(dolist (elem (ensure-list foo))
  (princ elem))

See (elisp)Building Lists.

Function: string-clean-whitespace string

Clean up the whitespace in string by collapsing stretches of whitespace to a single space character, as well as removing all whitespace from the start and the end of string.

See (elisp)Creating Strings.

Function: string-fill string length

Attempt to Word-wrap string so that no lines are longer than length. Filling is done on whitespace boundaries only. If there are individual words that are longer than length, these will not be shortened.

See (elisp)Creating Strings.

Function: string-lines string &optional omit-nulls keep-newlines

Split string into a list of strings on newline boundaries. If the optional argument omit-nulls is non-nil, remove empty lines from the results. If the optional argument keep-newlines is non-nil, don’t remove the trailing newlines from the result strings.

See (elisp)Creating Strings.

Function: string-pad string length &optional padding start

Pad string to be of the given length using padding as the padding character. padding defaults to the space character. If string is longer than length, no padding is done. If start is nil or omitted, the padding is appended to the characters of string, and if it’s non-nil, the padding is prepended to string’s characters.

See (elisp)Creating Strings.

Function: string-chop-newline string

Remove the final newline, if any, from string.

See (elisp)Creating Strings.

Macro: named-let name bindings &rest body

This special form is a looping construct inspired from the Scheme language. It is similar to let: It binds the variables in bindings, and then evaluates body. However, named-let also binds name to a local function whose formal arguments are the variables in bindings and whose body is body. This allows body to call itself recursively by calling name, where the arguments passed to name are used as the new values of the bound variables in the recursive invocation.

Recursive calls to name that occur in tail positions in body are guaranteed to be optimized as tail calls, which means that they will not consume any additional stack space no matter how deeply the recursion runs. Such recursive calls will effectively jump to the top of the loop with new values for the variables.

See (elisp)Local Variables.

Function: file-name-with-extension filename extension

This function returns filename with its extension set to extension. A single leading dot in the extension will be stripped if there is one. For example:

(file-name-with-extension "file" "el")
     ⇒ "file.el"
(file-name-with-extension "file" ".el")
     ⇒ "file.el"
(file-name-with-extension "file.c" "el")
     ⇒ "file.el"

Note that this function will error if filename or extension are empty, or if the filename is shaped like a directory (i.e., if directory-name-p returns non-nil).

See (elisp)File Name Components.

Function: directory-empty-p directory

This utility function returns t if given directory is an accessible directory and it does not contain any files, i.e., is an empty directory. It will ignore ‘.’ and ‘..’ on systems that return them as files in a directory.

Symbolic links to directories count as directories. See file-symlink-p to distinguish symlinks.

See (elisp)Contents of Directories.

Function: format-prompt prompt default &rest format-args

Format prompt with default value default according to the minibuffer-default-prompt-format variable.

minibuffer-default-prompt-format is a format string (defaulting to ‘" (default %s)"’ that says how the “default” bit in prompts like ‘"Local filename (default somefile): "’ are to be formatted.

To allow the users to customize how this is displayed, code that prompts the user for a value (and has a default) should look something along the lines of this code snippet:

(read-file-name
 (format-prompt "Local filename" file)
 nil file)

If format-args is nil, prompt is used as a literal string. If format-args is non-nil, prompt is used as a format control string, and prompt and format-args are passed to format (see (elisp)Formatting Strings).

minibuffer-default-prompt-format can be ‘""’, in which case no default values are displayed.

If default is nil, there is no default value, and therefore no “default value” string is included in the result value. If default is a non-nil list, the first element of the list is used in the prompt.

See (elisp)Text from Minibuffer.

Function: thing-at-mouse event thing &optional no-properties

Mouse-event equivalent of thing-at-point. thing can be symbol, list, sexp, filename, url, … among other things.

When no-properties has a non-nil value, any text properties that might have been present in the buffer are stripped away.

Function: macroexp-file-name

Return the name of the file in which the code is currently being evaluated, or nil if it cannot be determined.

Macro: with-environment-variables variables body…

This macro sets the environment variables according to variables temporarily when executing body. The previous values are restored when the form finishes. The argument variables should be a list of pairs of strings of the form (var value), where var is the name of the environment variable and value is that variable’s value.

(with-environment-variables (("LANG" "C")
                             ("LANGUAGE" "en_US:en"))
  (call-process "ls" nil t))

See (elisp)System Environment.

Function: button-buttonize string callback &optional data help-echo

Return a button with string as its label. When interacted on, the one-argument function in callback is called and data (or nil is not present) will be passed as the argument.

If non-nil, the argument help-echo will be used to set the help-echo text property.

Function: make-directory-autoloads dir output-file

Parse and search the directory dir for autoload definitions, and write the processed results to the file output-file.

Function: color-values-from-color-spec spec

Convert the textual color specification spec to a color triple (red green blue). Each of red, green and blue is a integer value between 0 and 65535.

The specification spec can be one of the following

Function: file-modes-number-to-symbolic modes

This function converts a numeric file mode specification in modes into the equivalent symbolic form.

See (elisp)Changing Files.

Function: file-backup-file-names filename

This function returns a list of all the backup file names for filename, or nil if there are none. The files are sorted by modification time, descending, so that the most recent files are first.

See (elisp)Backup Names.

Function: make-lock-file-name filename

Return a string containing a lock file name for filename, obeying lock-file-name-transforms.

Function: null-device

Return the path to the null device (usually something like /dev/null) on the current system.

Function: decoded-time-period time

Interpret time as a period and return its length in seconds. For computational purposes, years are 365 days long and months are 30 days long.

Function: subr-primitive-p object

Return t if object is a primitive, built-in function. On systems with native compilation subrp does not distinguish between built-in functions and functions that have been compiled. If native compilation is not avaliable, this function behaves identically to subrp.

Function: file-name-absolute-p filename

This function returns t if file filename is an absolute file name, nil otherwise. A file name is considered to be absolute if its first component is ‘~’, or is ‘~user’ where user is a valid login name. In the following examples, assume that there is a user named ‘rms’ but no user named ‘nosuchuser’.

(file-name-absolute-p "~rms/foo")
     ⇒ t
(file-name-absolute-p "~nosuchuser/foo")
     ⇒ nil
(file-name-absolute-p "rms/foo")
     ⇒ nil
(file-name-absolute-p "/user/rms/foo")
     ⇒ t

See (elisp)Absolute and Relative File Names.

2.5.2 Prefixed Definitions

These functions are prefixed with compat prefix, and are only loaded when compat-28 is required:

Function: compat-unlock-buffer

This function unlocks the file being visited in the current buffer, if the buffer is modified. If the buffer is not modified, then the file should not be locked, so this function does nothing. It also does nothing if the current buffer is not visiting a file, or is not locked. This function handles file system errors by calling display-warning and otherwise ignores the error.

See (elisp)File Locks.

This compatibility versions catches the file-error condition, issuing a warning instead of propagating on the error.

Function: compat-string-width string &optional from to

This function returns the width in columns of the string string, if it were displayed in the current buffer and the selected window. Optional arguments from and to specify the substring of string to consider, and are interpreted as in substring (see (elisp)Creating Strings).

The return value is an approximation: it only considers the values returned by char-width for the constituent characters, always takes a tab character as taking tab-width columns, ignores display properties and fonts, etc.

See (elisp)Size of Displayed Text.

This compatibility version handles the optional arguments from and to.

Function: compat-json-serialize

See Emacs 27.1.

This compatibility version handles primitive, top-level JSON values (numbers, strings, booleans).

Function: compat-json-insert

See Emacs 27.1.

This compatibility version handles primitive, top-level JSON values (numbers, strings, booleans).

Function: compat-json-parse-string

See Emacs 27.1.

This compatibility version handles primitive, top-level JSON values (numbers, strings, booleans).

Function: compat-json-parse-buffer

See Emacs 27.1.

This compatibility version handles primitive, top-level JSON values (numbers, strings, booleans).

Function: compat-count-windows

Return the number of live windows on the selected frame.

The optional argument minibuf specifies whether the minibuffer window is included in the count.

If all-frames is non-nil, count the windows in all frames instead just the selected frame.

This compatibility version handles the optional argument all-frames.

2.5.3 Missing Definitions

Compat does not provide support for the following Lisp features implemented in 28.1:


Next: , Previous: , Up: Top   [Contents][Index]

3 Development

Compat is developed on SourceHut. A restricted GitHub mirror is also maintained.

Patches and comments can be sent to the development mailing list (~pkal/compat-devel@lists.sr.ht). Bug reports are best sent to the issue tracker (~pkal/compat@todo.sr.ht). The GitHub mirror can also be used to submit patches. These may include issues in the compatibility code, missing definitions or performance issues.

Please note that as a GNU ELPA package, Compat requires contributors to have signed the FSF copyright assignment, before any non-trivial contribution (roughly 15 lines of code) can be applied.


Next: , Previous: , Up: Top   [Contents][Index]

Appendix A Function Index

Jump to:   A   B   C   D   E   F   G   I   J   L   M   N   P   R   S   T   W   X  
Index Entry  Section

A
alist-get: Emacs 25.1
always: Emacs 28.1
and-let*: Emacs 26.1

B
bool-vector: Emacs 25.1
bool-vector-count-consecutive: Emacs 24.4
bool-vector-count-population: Emacs 24.4
bool-vector-exclusive-or: Emacs 24.4
bool-vector-intersection: Emacs 24.4
bool-vector-not: Emacs 24.4
bool-vector-set-difference: Emacs 24.4
bool-vector-subsetp: Emacs 24.4
bool-vector-union: Emacs 24.4
buffer-local-boundp: Emacs 28.1
button-buttonize: Emacs 28.1

C
color-values-from-color-spec: Emacs 28.1
compat-<: Emacs 24.4
compat-<=: Emacs 24.4
compat-=: Emacs 24.4
compat->: Emacs 24.4
compat->=: Emacs 24.4
compat-alist-get: Emacs 26.1
compat-assoc: Emacs 26.1
compat-assoc-delete-all: Emacs 27.1
compat-count-windows: Emacs 28.1
compat-dired-get-marked-files: Emacs 27.1
compat-executable-find: Emacs 27.1
compat-file-size-human-readable: Emacs 27.1
compat-json-insert: Emacs 28.1
compat-json-parse-buffer: Emacs 28.1
compat-json-parse-string: Emacs 28.1
compat-json-serialize: Emacs 28.1
compat-line-number-at-pos: Emacs 26.1
compat-lookup-key: Emacs 27.1
compat-recenter: Emacs 27.1
compat-regexp-opt: Emacs 27.1
compat-sort: Emacs 25.1
compat-split-string: Emacs 24.4
compat-string-trim: Emacs 26.1
compat-string-trim-left: Emacs 26.1
compat-string-trim-right: Emacs 26.1
compat-string-width: Emacs 28.1
compat-unlock-buffer: Emacs 28.1
completion-table-with-cache: Emacs 24.4
cXXXr: Emacs 26.1
cXXXXr: Emacs 26.1

D
date-days-in-month: Emacs 27.1
decoded-time-day: Emacs 27.1
decoded-time-dst: Emacs 27.1
decoded-time-hour: Emacs 27.1
decoded-time-minute: Emacs 27.1
decoded-time-month: Emacs 27.1
decoded-time-period: Emacs 28.1
decoded-time-second: Emacs 27.1
decoded-time-weekday: Emacs 27.1
decoded-time-year: Emacs 27.1
decoded-time-zone: Emacs 27.1
define-error: Emacs 24.4
delete-consecutive-dups: Emacs 24.4
derived-mode-p: Emacs 27.1
directory-empty-p: Emacs 28.1
directory-files-recursively: Emacs 25.1
directory-name-p: Emacs 25.1
dlet: Emacs 28.1
dolist-with-progress-reporter: Emacs 27.1

E
ensure-list: Emacs 28.1

F
face-spec-set: Emacs 24.4
file-attribute-access-time: Emacs 26.1
file-attribute-collect: Emacs 26.1
file-attribute-device-number: Emacs 26.1
file-attribute-group-id: Emacs 26.1
file-attribute-inode-number: Emacs 26.1
file-attribute-link-number: Emacs 26.1
file-attribute-modes: Emacs 26.1
file-attribute-modification-time: Emacs 26.1
file-attribute-size: Emacs 26.1
file-attribute-status-change-time: Emacs 26.1
file-attribute-type: Emacs 26.1
file-attribute-user-id: Emacs 26.1
file-backup-file-names: Emacs 28.1
file-local-name: Emacs 26.1
file-modes-number-to-symbolic: Emacs 28.1
file-name-absolute-p: Emacs 28.1
file-name-concat: Emacs 28.1
file-name-quote: Emacs 26.1
file-name-quoted-p: Emacs 26.1
file-name-with-extension: Emacs 28.1
flatten-tree: Emacs 27.1
format-message: Emacs 25.1
format-prompt: Emacs 28.1
func-arity: Emacs 26.1

G
garbage-collect-maybe: Emacs 28.1
gensym: Emacs 26.1

I
if-let: Emacs 25.1
if-let*: Emacs 26.1
ignore-errors: Emacs 27.1
image-property: Emacs 26.1
insert-into-buffer: Emacs 28.1

J
json-insert: Emacs 27.1
json-parse-buffer: Emacs 27.1
json-parse-string: Emacs 27.1
json-serialize: Emacs 27.1

L
length<: Emacs 28.1
length=: Emacs 28.1
length>: Emacs 28.1

M
macroexp-file-name: Emacs 28.1
macroexpand-1: Emacs 25.1
macrop: Emacs 24.4
make-directory-autoloads: Emacs 28.1
make-lock-file-name: Emacs 28.1
make-nearby-temp-file: Emacs 26.1
mapcan: Emacs 26.1

N
named-let: Emacs 28.1
null-device: Emacs 28.1

P
package-get-version: Emacs 27.1
proper-list-p: Emacs 27.1
provided-mode-derived-p: Emacs 27.1

R
read-multiple-choice: Emacs 26.1
replace-regexp-in-string: Emacs 28.1
replace-string-in-region: Emacs 28.1

S
setq-local: Emacs 27.1
special-form-p: Emacs 24.4
string-chop-newline: Emacs 28.1
string-clean-whitespace: Emacs 28.1
string-distance: Emacs 27.1
string-fill: Emacs 28.1
string-greaterp: Emacs 25.1
string-lines: Emacs 28.1
string-pad: Emacs 28.1
string-replace: Emacs 28.1
string-search: Emacs 28.1
string-suffix-p: Emacs 24.4
subr-primitive-p: Emacs 28.1

T
temporary-file-directory: Emacs 26.1
thing-at-mouse: Emacs 28.1
thread-first: Emacs 25.1
thread-last: Emacs 25.1
time-equal-p: Emacs 27.1

W
when-let: Emacs 25.1
when-let*: Emacs 26.1
with-environment-variables: Emacs 28.1
with-eval-after-load: Emacs 24.4
with-existing-directory: Emacs 28.1
with-file-modes: Emacs 25.1

X
xor: Emacs 27.1

Jump to:   A   B   C   D   E   F   G   I   J   L   M   N   P   R   S   T   W   X  

Previous: , Up: Top   [Contents][Index]

Appendix B Variable Index

Jump to:   E   G   M   R  
Index Entry  Section

E
exec-path: Emacs 27.1

G
gensym-counter: Emacs 26.1

M
mounted-file-systems: Emacs 26.1

R
regexp-unmatchable: Emacs 27.1

Jump to:   E   G   M   R