compat.info (88021B)
1 This is compat.info, produced by makeinfo version 6.7 from compat.texi. 2 3 Copyright © 2022 Free Software Foundation, Inc. 4 5 Permission is granted to copy, distribute and/or modify this 6 document under the terms of the GNU Free Documentation License, 7 Version 1.3 or any later version published by the Free Software 8 Foundation; with no Invariant Sections, with the Front-Cover Texts 9 being “A GNU Manual,” and with the Back-Cover Texts as in (a) 10 below. A copy of the license is included in the section entitled 11 “GNU Free Documentation License.” 12 13 (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and 14 modify this GNU manual.” 15 16 INFO-DIR-SECTION Emacs 17 START-INFO-DIR-ENTRY 18 * Compat: (compat). Compatibility Library for Emacs Lisp. 19 END-INFO-DIR-ENTRY 20 21 22 File: compat.info, Node: Top, Next: Introduction, Up: (dir) 23 24 "Compat" Manual 25 *************** 26 27 This manual documents the usage of the "Compat" Emacs lisp library, the 28 forward-compatibility library for Emacs Lisp, corresponding to version 29 28.1.2.2. 30 31 Copyright © 2022 Free Software Foundation, Inc. 32 33 Permission is granted to copy, distribute and/or modify this 34 document under the terms of the GNU Free Documentation License, 35 Version 1.3 or any later version published by the Free Software 36 Foundation; with no Invariant Sections, with the Front-Cover Texts 37 being “A GNU Manual,” and with the Back-Cover Texts as in (a) 38 below. A copy of the license is included in the section entitled 39 “GNU Free Documentation License.” 40 41 (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and 42 modify this GNU manual.” 43 44 * Menu: 45 46 * Introduction:: 47 * Support:: 48 * Development:: 49 * Function Index:: 50 * Variable Index:: 51 52 — The Detailed Node Listing — 53 54 Introduction 55 56 * Overview:: 57 * Usage:: 58 * Intentions:: 59 60 Usage 61 62 * Additional libraries:: 63 64 Support 65 66 * Emacs 24.4:: Compatibility support for Emacs 24.4 67 * Emacs 25.1:: Compatibility support for Emacs 25.1 68 * Emacs 26.1:: Compatibility support for Emacs 26.1 69 * Emacs 27.1:: Compatibility support for Emacs 27.1 70 * Emacs 28.1:: Compatibility support for Emacs 28.1 71 72 73 74 File: compat.info, Node: Introduction, Next: Support, Prev: Top, Up: Top 75 76 1 Introduction 77 ************** 78 79 * Menu: 80 81 * Overview:: 82 * Usage:: 83 * Intentions:: 84 85 86 File: compat.info, Node: Overview, Next: Usage, Up: Introduction 87 88 1.1 Overview 89 ============ 90 91 The objective of Compat is to provide "forwards compatibility" library 92 for Emacs Lisp. That is to say by using Compat, an Elisp package does 93 not have to make the decision to either use new and useful functionality 94 or support old versions of Emacs. 95 96 Version 24.3 is chosen as the oldest version, because this is the 97 newest version on CentOS 7. It is intended to preserve compatibility 98 for at least as the Centos 7 reaches EOL 99 (https://wiki.centos.org/About/Product), 2024. 100 101 If you are developing a package with Compat in mind, consider loading 102 ‘compat-help‘ (on your system, not in a package) to get relevant notes 103 inserted into the help buffers of functions that are implemented or 104 advised in Compat. 105 106 Note that Compat provides a few prefixed function, ie. functions 107 with a ‘compat-’ prefix. These are used to provide extended 108 functionality for commands that are already defined (‘sort’, ‘assoc’, 109 ‘seq’, ...). It might be possible to transform these into advised 110 functions later on, so that the modified functionality is accessible 111 without a prefix. Feedback on this point is appreciated. 112 113 114 File: compat.info, Node: Usage, Next: Intentions, Prev: Overview, Up: Introduction 115 116 1.2 Usage 117 ========= 118 119 The intended use-case for this library is for package developers to add 120 as a dependency in the header: 121 122 ;; Package-Requires: ((emacs "24.3") (compat "28.1.2.2")) 123 124 There is no need to depend on ‘emacs’ 24.3 specifically. One can 125 choose to any newer version, if features not provided by Compat 126 necessitate it. 127 128 In any file where compatibility forms are used, a 129 130 (require 'compat) 131 132 should be added early on. 133 134 This will load all non-prefixed definitions (functions and macros 135 with a leading ‘compat-‘). To load these, an additional 136 137 (require 'compat-XY) ; e.g. 26 138 139 will be necessary, to load compatibility code for Emacs version XY. 140 141 It is recommended to subscribe to the compat-announce 142 (https://lists.sr.ht/~pkal/compat-announce) mailing list to be notified 143 when new versions are released or relevant changes are made. 144 145 * Menu: 146 147 * Additional libraries:: 148 149 150 File: compat.info, Node: Additional libraries, Up: Usage 151 152 1.2.1 Additional libraries 153 -------------------------- 154 155 These libraries are packages with Compat, but are disabled by default. 156 To use them you can use ‘M-x load-library’: 157 158 compat-help 159 Add notes to ‘*Help*’ buffer, if a compatibility definition has 160 something to warn you about. 161 compat-font-lock 162 Highlight functions that are implemented as compatibility 163 definitions. 164 165 166 File: compat.info, Node: Intentions, Prev: Usage, Up: Introduction 167 168 1.3 Intentions 169 ============== 170 171 The library intends to provide support back until Emacs 24.3. The 172 intended audience are package developers that are interested in using 173 newer developments, without having to break compatibility. 174 175 Sadly, total backwards compatibility cannot be provided for technical 176 reasons. These might include: 177 178 • An existing function or macro was extended by some new 179 functionality. To support these cases, the function or macro would 180 have to be advised. As this is usually regarded as invasive and is 181 shown to be a significant overhead, even when the new feature is 182 not used, this approach is not used. 183 184 As a compromise, prefixed functions and macros (starting with a 185 ‘compat-’ prefix) can be provided. 186 187 • New functionality was implemented in the core, and depends on 188 external libraries that cannot be reasonably duplicated in the 189 scope of a compatibility library. 190 191 • New functionality depends on an entire new, non-trivial library. 192 Sometimes these are provided via ELPA (xref, project, ...), but 193 other times it would be infeasible to duplicate an entire library 194 within Compat while also providing the necessary backwards 195 compatibility. 196 197 • It just wasn’t added, and there is no good reason (though good 198 excuses might exist). If you happen to find such a function, *note 199 reporting: Development. it would be much appreciated. 200 201 Always begin by assuming that this might be the case, unless proven 202 otherwise. 203 204 205 File: compat.info, Node: Support, Next: Development, Prev: Introduction, Up: Top 206 207 2 Support 208 ********* 209 210 This section goes into the features that Compat manages and doesn’t 211 manage to provide for each Emacs version. 212 213 * Menu: 214 215 * Emacs 24.4:: Compatibility support for Emacs 24.4 216 * Emacs 25.1:: Compatibility support for Emacs 25.1 217 * Emacs 26.1:: Compatibility support for Emacs 26.1 218 * Emacs 27.1:: Compatibility support for Emacs 27.1 219 * Emacs 28.1:: Compatibility support for Emacs 28.1 220 221 222 File: compat.info, Node: Emacs 24.4, Next: Emacs 25.1, Up: Support 223 224 2.1 Emacs 24.4 225 ============== 226 227 2.1.1 Unprefixed Definitions 228 ---------------------------- 229 230 The following functions and macros implemented in 24.4, and are provided 231 by Compat by default: 232 233 -- Macro: with-eval-after-load library body... 234 This macro arranges to evaluate BODY at the end of loading the file 235 LIBRARY, each time LIBRARY is loaded. If LIBRARY is already 236 loaded, it evaluates BODY right away. 237 238 You don’t need to give a directory or extension in the file name 239 LIBRARY. Normally, you just give a bare file name, like this: 240 241 (with-eval-after-load "js" (keymap-set js-mode-map "C-c C-c" 'js-eval)) 242 243 To restrict which files can trigger the evaluation, include a 244 directory or an extension or both in LIBRARY. Only a file whose 245 absolute true name (i.e., the name with all symbolic links chased 246 out) matches all the given name components will match. In the 247 following example, ‘my_inst.elc’ or ‘my_inst.elc.gz’ in some 248 directory ‘..../foo/bar’ will trigger the evaluation, but not 249 ‘my_inst.el’: 250 251 (with-eval-after-load "foo/bar/my_inst.elc" ...) 252 253 LIBRARY can also be a feature (i.e., a symbol), in which case BODY 254 is evaluated at the end of any file where ‘(provide LIBRARY)’ is 255 called. 256 257 An error in BODY does not undo the load, but does prevent execution 258 of the rest of BODY. 259 260 *Note (elisp)Hooks for Loading::. 261 262 -- Function: special-form-p object 263 This predicate tests whether its argument is a special form, and 264 returns ‘t’ if so, ‘nil’ otherwise. 265 266 *Note (elisp)Special Forms::. 267 268 -- Function: macrop object 269 This predicate tests whether its argument is a macro, and returns 270 ‘t’ if so, ‘nil’ otherwise. 271 272 *Note (elisp)Simple Macro::. 273 274 -- Function: string-suffix-p suffix string &optional ignore-case 275 This function returns non-‘nil’ if SUFFIX is a suffix of STRING; 276 i.e., if STRING ends with SUFFIX. If the optional argument 277 IGNORE-CASE is non-‘nil’, the comparison ignores case differences. 278 279 *Note (elisp)Text Comparison::. 280 281 -- Function: delete-consecutive-dups list &optional circular 282 Destructively remove ‘equal’ consecutive duplicates from LIST. 283 First and last elements are considered consecutive if CIRCULAR is 284 non-nil. 285 286 -- Function: define-error name message &optional parent 287 In order for a symbol to be an error symbol, it must be defined 288 with ‘define-error’ which takes a parent condition (defaults to 289 ‘error’). This parent defines the conditions that this kind of 290 error belongs to. The transitive set of parents always includes 291 the error symbol itself, and the symbol ‘error’. Because quitting 292 is not considered an error, the set of parents of ‘quit’ is just 293 ‘(quit)’. 294 295 *Note (elisp)Error Symbols::. 296 297 -- Function: bool-vector-exclusive-or a b &optional c 298 Return “bitwise exclusive or” of bool vectors A and B. If optional 299 argument C is given, the result of this operation is stored into C. 300 All arguments should be bool vectors of the same length. 301 302 *Note (elisp)Bool-Vectors::. 303 304 -- Function: bool-vector-union a b &optional c 305 Return “bitwise or” of bool vectors A and B. If optional argument 306 C is given, the result of this operation is stored into C. All 307 arguments should be bool vectors of the same length. 308 309 *Note (elisp)Bool-Vectors::. 310 311 -- Function: bool-vector-intersection a b &optional c 312 Return “bitwise and” of bool vectors A and B. If optional argument 313 C is given, the result of this operation is stored into C. All 314 arguments should be bool vectors of the same length. 315 316 *Note (elisp)Bool-Vectors::. 317 318 -- Function: bool-vector-set-difference a b &optional c 319 Return “set difference” of bool vectors A and B. If optional 320 argument C is given, the result of this operation is stored into C. 321 All arguments should be bool vectors of the same length. 322 323 *Note (elisp)Bool-Vectors::. 324 325 -- Function: bool-vector-not a &optional b 326 Return “set complement” of bool vector A. If optional argument B 327 is given, the result of this operation is stored into B. All 328 arguments should be bool vectors of the same length. 329 330 *Note (elisp)Bool-Vectors::. 331 332 -- Function: bool-vector-subsetp a b 333 Return ‘t’ if every ‘t’ value in A is also ‘t’ in B, ‘nil’ 334 otherwise. All arguments should be bool vectors of the same 335 length. 336 337 *Note (elisp)Bool-Vectors::. 338 339 -- Function: bool-vector-count-consecutive a b i 340 Return the number of consecutive elements in A equal B starting at 341 I. ‘a’ is a bool vector, B is ‘t’ or ‘nil’, and I is an index into 342 ‘a’. 343 344 *Note (elisp)Bool-Vectors::. 345 346 -- Function: bool-vector-count-population a 347 Return the number of elements that are ‘t’ in bool vector A. 348 349 *Note (elisp)Bool-Vectors::. 350 351 -- Function: completion-table-with-cache function &optional ignore-case 352 This is a wrapper for ‘completion-table-dynamic’ that saves the 353 last argument-result pair. This means that multiple lookups with 354 the same argument only need to call FUNCTION once. This can be 355 useful when a slow operation is involved, such as calling an 356 external process. 357 358 *Note (elisp)Programmed Completion::. 359 360 -- Function: face-spec-set face spec &optional spec-type 361 This function applies SPEC as a face spec for ‘face’. SPEC should 362 be a face spec, as described in the above documentation for 363 ‘defface’. 364 365 This function also defines FACE as a valid face name if it is not 366 already one, and (re)calculates its attributes on existing frames. 367 368 The optional argument SPEC-TYPE determines which spec to set. If 369 it is omitted or ‘nil’ or ‘face-override-spec’, this function sets 370 the “override spec”, which overrides face specs on FACE of all the 371 other types mentioned below. This is useful when calling this 372 function outside of Custom code. If SPEC-TYPE is ‘customized-face’ 373 or ‘saved-face’, this function sets the customized spec or the 374 saved custom spec, respectively. If it is ‘face-defface-spec’, 375 this function sets the default face spec (the same one set by 376 ‘defface’). If it is ‘reset’, this function clears out all 377 customization specs and override specs from FACE (in this case, the 378 value of SPEC is ignored). The effect of any other value of 379 SPEC-TYPE on the face specs is reserved for internal use, but the 380 function will still define FACE itself and recalculate its 381 attributes, as described above. 382 383 *Note (elisp)Defining Faces::. 384 385 2.1.2 Prefixed Definitions 386 -------------------------- 387 388 These functions are prefixed with ‘compat’ prefix, and are only loaded 389 when ‘compat-24’ is required: 390 391 -- Function: compat-= number-or-marker &rest number-or-markers 392 This function tests whether all its arguments are numerically 393 equal, and returns ‘t’ if so, ‘nil’ otherwise. 394 395 *Note (elisp)Comparison of Numbers::. 396 -- Function: compat-< number-or-marker &rest number-or-markers 397 This function tests whether each argument is strictly less than the 398 following argument. It returns ‘t’ if so, ‘nil’ otherwise. 399 400 *Note (elisp)Comparison of Numbers::. 401 -- Function: compat-> number-or-marker &rest number-or-markers 402 This function tests whether each argument is strictly greater than 403 the following argument. It returns ‘t’ if so, ‘nil’ otherwise. 404 405 *Note (elisp)Comparison of Numbers::. 406 -- Function: compat-<= number-or-marker &rest number-or-markers 407 This function tests whether each argument is less than or equal to 408 the following argument. It returns ‘t’ if so, ‘nil’ otherwise. 409 410 *Note (elisp)Comparison of Numbers::. 411 -- Function: compat->= number-or-marker &rest number-or-markers 412 This function tests whether each argument is greater than or equal 413 to the following argument. It returns ‘t’ if so, ‘nil’ otherwise. 414 415 *Note (elisp)Comparison of Numbers::. 416 417 These functions differ from the previous implementation in that they 418 allow for more than two argument to be compared. 419 420 -- Function: compat-split-string string &optional separators omit-nulls 421 trim 422 This function splits STRING into substrings based on the regular 423 expression SEPARATORS (*note (elisp)Regular Expressions::). Each 424 match for SEPARATORS defines a splitting point; the substrings 425 between splitting points are made into a list, which is returned. 426 427 *note (elisp)Creating Strings:: for more details. 428 429 This version handles the optional argument TRIM. If it is 430 non-‘nil’, it should be a regular expression to match text to trim 431 from the beginning and end of each substring. If trimming makes 432 the substring empty, it is treated as null. 433 434 2.1.3 Missing Definitions 435 ------------------------- 436 437 Compat does not provide support for the following Lisp features 438 implemented in 24.4: 439 440 • Allowing the second optional argument to ‘eval’ to specify a 441 lexical environment. 442 • The ‘define-alternatives’ macro. 443 • Support for the ‘defalias-fset-function’ symbol property. 444 • The ‘group-gid’ and ‘groupd-read-gid’ functions. 445 • The ‘pre-redisplay-function’ hook. 446 • Allowing for ‘with-demoted-errors’ to take a additional argument 447 ‘format’. 448 • The ‘add-face-text-property’ function. 449 • No ‘tty-setup-hook’ hook. 450 • The ‘get-pos-property’ function. 451 • The ‘define-advice’ macro. 452 • Support for generators. 453 • The ‘string-trim’, ‘string-trim-left’ and ‘string-trim-right’ 454 functions. These are instead provided as prefixed function as part 455 of *note Emacs 26.1:: support. 456 457 458 File: compat.info, Node: Emacs 25.1, Next: Emacs 26.1, Prev: Emacs 24.4, Up: Support 459 460 2.2 Emacs 25.1 461 ============== 462 463 2.2.1 Unprefixed Definitions 464 ---------------------------- 465 466 The following functions and macros implemented in 25.1, and are provided 467 by Compat by default: 468 469 -- Function: format-message string &rest objects 470 This function acts like ‘format’, except it also converts any grave 471 accents (`) and apostrophes (') in STRING as per the value of 472 ‘text-quoting-style’. 473 474 Typically grave accent and apostrophe in the format translate to 475 matching curved quotes, e.g., "Missing `%s'" might result in 476 "Missing ‘foo’". *Note (elisp)Text Quoting Style::, for how to 477 influence or inhibit this translation. 478 479 *note (elisp)Formatting Strings::. 480 481 -- Function: directory-name-p filename 482 This function returns non-‘nil’ if FILENAME ends with a directory 483 separator character. This is the forward slash ‘/’ on GNU and 484 other POSIX-like systems; MS-Windows and MS-DOS recognize both the 485 forward slash and the backslash ‘\’ as directory separators. 486 487 *Note (elisp)Directory Names::. 488 489 -- Function: string-greaterp string1 string2 490 This function returns the result of comparing STRING1 and STRING2 491 in the opposite order, i.e., it is equivalent to calling 492 ‘(string-lessp STRING2 STRING1)’. 493 494 *Note (elisp)Text Comparison::. 495 496 -- Macro: with-file-modes mode body... 497 This macro evaluates the BODY forms with the default permissions 498 for new files temporarily set to MODES (whose value is as for 499 ‘set-file-modes’ above). When finished, it restores the original 500 default file permissions, and returns the value of the last form in 501 BODY. 502 503 This is useful for creating private files, for example. 504 505 *Note (elisp)Changing Files::. 506 507 -- Function: alist-get key alist &optional default remove testfn 508 This function is similar to ‘assq’. It finds the first association 509 ‘(KEY . VALUE)’ by comparing KEY with ALIST elements, and, if 510 found, returns the VALUE of that association. If no association is 511 found, the function returns DEFAULT. Comparison of KEY against 512 ALIST elements uses the function specified by TESTFN, defaulting to 513 ‘eq’. 514 515 This is a generalized variable (*note (elisp)Generalized 516 Variables::) that can be used to change a value with ‘setf’. When 517 using it to set a value, optional argument REMOVE non-‘nil’ means 518 to remove KEY’s association from ALIST if the new value is ‘eql’ to 519 DEFAULT. 520 521 *note (elisp)Association Lists::. 522 523 -- Macro: if-let (bindings...) then &rest else... 524 As with ‘let*’, BINDINGS will consist of ‘(SYMBOL VALUE-FORM)’ 525 entries that are evaluated and bound sequentially. If all 526 VALUE-FORM evaluate to non-‘nil’ values, then THEN is evaluated as 527 were the case with a regular ‘let*’ expression, with all the 528 variables bound. If any VALUE-FORM evaluates to ‘nil’, ELSE is 529 evaluated, without any bound variables. 530 531 A binding may also optionally drop the SYMBOL, and simplify to 532 ‘(VALUE-FORM)’ if only the test is of interest. 533 534 For the sake of backwards compatibility, it is possible to write a 535 single binding without a binding list: 536 537 (if-let* (SYMBOL (test)) foo bar) 538 ≡ 539 (if-let* ((SYMBOL (test))) foo bar) 540 541 -- Macro: when-let (bindings...) &rest body 542 As with ‘when’, if one is only interested in the case where all 543 BINDINGS are non-nil. Otherwise BINDINGS are interpreted just as 544 they are by ‘if-let*’. 545 546 -- Macro: thread-first &rest forms 547 Combine FORMS into a single expression by “threading” each element 548 as the _first_ argument of their successor. Elements of FORMS can 549 either be an list of an atom. 550 551 For example, consider the threading expression and it’s equivalent 552 macro expansion: 553 554 (thread-first 555 5 556 (+ 20) 557 (/ 25) 558 - 559 (+ 40)) 560 ≡ 561 (+ (- (/ (+ 5 20) 25)) 40) 562 563 Note how the single ‘-’ got converted into a list before threading. 564 This example uses arithmetic functions, but ‘thread-first’ is not 565 restricted to arithmetic or side-effect free code. 566 567 -- Macro: thread-last &rest forms 568 Combine FORMS into a single expression by “threading” each element 569 as the _last_ argument of their successor. Elements of FORMS can 570 either be an list of an atom. 571 572 For example, consider the threading expression and it’s equivalent 573 macro expansion: 574 575 (thread-first 576 5 577 (+ 20) 578 (/ 25) 579 - 580 (+ 40)) 581 ≡ 582 (+ 40 (- (/ 25 (+ 20 5)))) 583 584 Note how the single ‘-’ got converted into a list before threading. 585 This example uses arithmetic functions, but ‘thread-last’ is not 586 restricted to arithmetic or side-effect free code. 587 588 -- Function: macroexpand-1 form &optional environment 589 This function expands macros like ‘macroexpand’, but it only 590 performs one step of the expansion: if the result is another macro 591 call, ‘macroexpand-1’ will not expand it. 592 593 *Note Expansion: (elisp)Expansion. 594 595 -- Function: directory-files-recursively directory regexp &optional 596 include-directories predicate follow-symlinks 597 Return all files under DIRECTORY whose names match REGEXP. This 598 function searches the specified DIRECTORY and its sub-directories, 599 recursively, for files whose basenames (i.e., without the leading 600 directories) match the specified REGEXP, and returns a list of the 601 absolute file names of the matching files (*note absolute file 602 names: (elisp)Relative File Names.). The file names are returned 603 in depth-first order, meaning that files in some sub-directory are 604 returned before the files in its parent directory. In addition, 605 matching files found in each subdirectory are sorted alphabetically 606 by their basenames. By default, directories whose names match 607 REGEXP are omitted from the list, but if the optional argument 608 INCLUDE-DIRECTORIES is non-‘nil’, they are included. 609 610 By default, all subdirectories are descended into. If PREDICATE is 611 ‘t’, errors when trying to descend into a subdirectory (for 612 instance, if it’s not readable by this user) are ignored. If it’s 613 neither ‘nil’ nor ‘t’, it should be a function that takes one 614 parameter (the subdirectory name) and should return non-‘nil’ if 615 the directory is to be descended into. 616 617 Symbolic links to subdirectories are not followed by default, but 618 if FOLLOW-SYMLINKS is non-‘nil’, they are followed. 619 620 *Note (elisp)Contents of Directories::. 621 622 -- Function: bool-vector &rest objects 623 This function creates and returns a bool-vector whose elements are 624 the arguments, OBJECTS. 625 626 *Note (elisp)Bool-Vectors::. 627 628 2.2.2 Prefixed Definitions 629 -------------------------- 630 631 These functions are prefixed with ‘compat’ prefix, and are only loaded 632 when ‘compat-25’ is required: 633 634 -- Function: compat-sort sequence predicate 635 This function sorts SEQUENCE stably. Note that this function 636 doesn’t work for all sequences; it may be used only for lists and 637 vectors. If SEQUENCE is a list, it is modified destructively. 638 This functions returns the sorted SEQUENCE and compares elements 639 using PREDICATE. A stable sort is one in which elements with equal 640 sort keys maintain their relative order before and after the sort. 641 Stability is important when successive sorts are used to order 642 elements according to different criteria. 643 644 *Note (elisp)Sequence Functions::. 645 646 The compatibility version adds support for vectors to be sorted, 647 not just lists. 648 649 2.2.3 Missing Definitions 650 ------------------------- 651 652 Compat does not provide support for the following Lisp features 653 implemented in 25.1: 654 655 • New ‘pcase’ patterns. 656 • The hook ‘prefix-command-echo-keystrokes-functions’ and 657 ‘prefix-command-preserve-state-hook’. 658 • The hook ‘pre-redisplay-functions’. 659 • The function ‘make-process’. 660 • Support for the variable ‘inhibit-message’. 661 • The ‘define-inline’ functionality. 662 • The functions ‘string-collate-lessp’ and ‘string-collate-equalp’. 663 • The function ‘funcall-interactivly’. 664 • The function ‘buffer-substring-with-bidi-context’. 665 • The function ‘font-info’. 666 • The function ‘default-font-width’. 667 • The function ‘window-font-height’ and ‘window-font-width’. 668 • The function ‘window-max-chars-per-line’. 669 • The function ‘set-binary-mode’. 670 • The functions ‘bufferpos-to-filepos’ and ‘filepos-to-bufferpos’. 671 672 673 File: compat.info, Node: Emacs 26.1, Next: Emacs 27.1, Prev: Emacs 25.1, Up: Support 674 675 2.3 Emacs 26.1 676 ============== 677 678 2.3.1 Unprefixed Definitions 679 ---------------------------- 680 681 The following functions and macros implemented in 26.1, and are provided 682 by Compat by default: 683 684 -- Function: func-arity function 685 This function provides information about the argument list of the 686 specified FUNCTION. The returned value is a cons cell of the form 687 ‘(MIN . MAX)’, where MIN is the minimum number of arguments, and 688 MAX is either the maximum number of arguments, or the symbol ‘many’ 689 for functions with ‘&rest’ arguments, or the symbol ‘unevalled’ if 690 FUNCTION is a special form. 691 692 Note that this function might return inaccurate results in some 693 situations, such as the following: 694 695 − Functions defined using ‘apply-partially’ (*note 696 apply-partially: (elisp)Calling Functions.). 697 698 − Functions that are advised using ‘advice-add’ (*note 699 (elisp)Advising Named Functions::). 700 701 − Functions that determine the argument list dynamically, as 702 part of their code. 703 704 *Note (elisp)What Is a Function::. 705 706 -- Function: mapcan function sequence 707 This function applies FUNCTION to each element of SEQUENCE, like 708 ‘mapcar’, but instead of collecting the results into a list, it 709 returns a single list with all the elements of the results (which 710 must be lists), by altering the results (using ‘nconc’; *note 711 (elisp)Rearrangement::). Like with ‘mapcar’, SEQUENCE can be of 712 any type except a char-table. 713 714 ;; Contrast this: (mapcar #'list '(a b c d)) ⇒ ((a) (b) (c) 715 (d)) ;; with this: (mapcan #'list '(a b c d)) ⇒ (a b c d) 716 717 *Note (elisp)Mapping Functions::. 718 719 -- Function: cXXXr 720 -- Function: cXXXXr 721 *Note (elisp)List Elements::. 722 723 -- Function: gensym &optional prefix 724 This function returns a symbol using ‘make-symbol’, whose name is 725 made by appending ‘gensym-counter’ to PREFIX and incrementing that 726 counter, guaranteeing that no two calls to this function will 727 generate a symbol with the same name. The prefix defaults to 728 ‘"g"’. 729 730 -- Variable: gensym-counter 731 See ‘gensym’. 732 733 -- Function: make-nearby-temp-file prefix &optional dir-flag suffix 734 This function is similar to ‘make-temp-file’, but it creates a 735 temporary file as close as possible to ‘default-directory’. If 736 PREFIX is a relative file name, and ‘default-directory’ is a remote 737 file name or located on a mounted file systems, the temporary file 738 is created in the directory returned by the function 739 ‘temporary-file-directory’. Otherwise, the function 740 ‘make-temp-file’ is used. PREFIX, DIR-FLAG and SUFFIX have the 741 same meaning as in ‘make-temp-file’. 742 743 (let ((default-directory "/ssh:remotehost:")) (make-nearby-temp-file 744 "foo")) ⇒ "/ssh:remotehost:/tmp/foo232J6v" 745 746 -- Variable: mounted-file-systems 747 A regular expression matching files names that are probably on a 748 mounted file system. 749 750 -- Function: temporary-file-directory 751 The directory for writing temporary files via 752 ‘make-nearby-temp-file’. In case of a remote ‘default-directory’, 753 this is a directory for temporary files on that remote host. If 754 such a directory does not exist, or ‘default-directory’ ought to be 755 located on a mounted file system (see ‘mounted-file-systems’), the 756 function returns ‘default-directory’. For a non-remote and 757 non-mounted ‘default-directory’, the value of the variable 758 ‘temporary-file-directory’ is returned. 759 760 *Note (elisp)Unique File Names::. 761 762 -- Macro: if-let* (bindings...) then &rest else 763 ‘if-let*’ is mostly equivalent to ‘if-let’, with the exception that 764 the legacy ‘(if (VAR (test)) foo bar)’ syntax is not permitted. 765 766 -- Macro: when-let* (bindings...) then &rest else 767 ‘when-let*’ is mostly equivalent to ‘when-let’, with the exception 768 that the legacy ‘(when-let (VAR (test)) foo bar)’ syntax is not 769 permitted. 770 771 -- Macro: and-let* (bindings...) &rest body 772 A combination of LET* and AND, analogous to ‘when-let*’. If all 773 BINDINGS are non-‘nil’ and BODY is ‘nil’, then the result of the 774 ‘and-let*’ form will be the last value bound in BINDINGS. 775 776 **Please Note:** The implementation provided by Compat does not 777 include a bug that was observed with Emacs 26 (see 778 <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31840>). 779 780 -- Function: file-local-name filename 781 This function returns the _local part_ of FILENAME. This is the 782 part of the file’s name that identifies it on the remote host, and 783 is typically obtained by removing from the remote file name the 784 parts that specify the remote host and the method of accessing it. 785 For example: 786 787 (file-local-name "/ssh:USER@HOST:/foo/bar") ⇒ 788 "/foo/bar" 789 790 For a remote FILENAME, this function returns a file name which 791 could be used directly as an argument of a remote process (*note 792 (elisp)Asynchronous Processes::, and *note (elisp)Synchronous 793 Processes::), and as the program to run on the remote host. If 794 FILENAME is local, this function returns it unchanged. 795 796 *Note (elisp)Magic File Names::. 797 798 -- Macro: file-name-quoted-p name 799 This macro returns non-‘nil’, when NAME is quoted with the prefix 800 ‘/:’. If NAME is a remote file name, the local part of NAME is 801 checked. 802 803 *Note (elisp)File Name Expansion::. 804 805 -- Macro: file-name-quote name 806 This macro adds the quotation prefix ‘/:’ to the file NAME. For a 807 local file NAME, it prefixes NAME with ‘/:’. If NAME is a remote 808 file name, the local part of NAME (*note (elisp)Magic File Names::) 809 is quoted. If NAME is already a quoted file name, NAME is returned 810 unchanged. 811 812 (substitute-in-file-name (file-name-quote "bar/~/foo")) ⇒ 813 "/:bar/~/foo" 814 815 (substitute-in-file-name (file-name-quote "/ssh:host:bar/~/foo")) 816 ⇒ "/ssh:host:/:bar/~/foo" 817 818 The macro cannot be used to suppress file name handlers from magic 819 file names (*note (elisp)Magic File Names::). 820 821 *Note (elisp)File Name Expansion::. 822 823 -- Function: read-multiple-choice prompt choices &optional help-string 824 show-help long-form 825 Ask user a multiple choice question. PROMPT should be a string 826 that will be displayed as the prompt. 827 828 CHOICES is an alist where the first element in each entry is a 829 character to be entered, the second element is a short name for the 830 entry to be displayed while prompting (if there’s room, it might be 831 shortened), and the third, optional entry is a longer explanation 832 that will be displayed in a help buffer if the user requests more 833 help. 834 835 If optional argument LONG-FORM is non-‘nil’, the user will have to 836 type in long-form answers (using ‘completing-read’) instead of 837 hitting a single key. The answers must be among the second 838 elements of the values in the CHOICES list. 839 840 Note: The Compat implementation of this function ignores the 841 optional arguments HELP-STRING and SHOW-HELP. Therefore the 842 optional third element in each CHOICES entry will also be 843 disregarded. 844 845 See *note Reading One Event: (elisp)Reading One Event. 846 847 -- Function: image-property 848 Defined in ‘image.el’. 849 850 This function can also be used as a generalised variable. To use 851 this you need to explicitly require ‘compat-26’. 852 853 -- Function: file-attribute-type 854 Return the field _type_ as generated by ‘file-attributes’. 855 856 *Note (elisp)File Attributes::. 857 858 -- Function: file-attribute-link-number 859 Return the field _link-number_ as generated by ‘file-attributes’. 860 861 *Note (elisp)File Attributes::. 862 863 -- Function: file-attribute-user-id 864 Return the field _user-id_ as generated by ‘file-attributes’. 865 866 *Note (elisp)File Attributes::. 867 868 -- Function: file-attribute-group-id 869 Return the field _group-id_ as generated by ‘file-attributes’. 870 871 *Note (elisp)File Attributes::. 872 873 -- Function: file-attribute-access-time 874 Return the field _access-time_ as generated by ‘file-attributes’. 875 876 *Note (elisp)File Attributes::. 877 878 -- Function: file-attribute-modification-time 879 Return the field _modification-time_ as generated by 880 ‘file-attributes’. 881 882 *Note (elisp)File Attributes::. 883 884 -- Function: file-attribute-status-change-time 885 Return the field _modification-time_ as generated by 886 ‘file-attributes’. 887 888 *Note (elisp)File Attributes::. 889 890 -- Function: file-attribute-size 891 Return the field _size_ as generated by ‘file-attributes’. 892 893 *Note (elisp)File Attributes::. 894 895 -- Function: file-attribute-modes 896 Return the field _modes_ as generated by ‘file-attributes’. 897 898 *Note (elisp)File Attributes::. 899 900 -- Function: file-attribute-inode-number 901 Return the field _inode-number_ as generated by ‘file-attributes’. 902 903 *Note (elisp)File Attributes::. 904 905 -- Function: file-attribute-device-number 906 Return the field _device-number_ as generated by ‘file-attributes’. 907 908 *Note (elisp)File Attributes::. 909 910 -- Function: file-attribute-collect attributes &rest attr-names 911 Filter the file attributes ATTRIBUTES, as generated by 912 ‘file-attributes’, according to ATTR-NAMES. 913 914 Valid attribute names for ATTR-NAMES are: type, link-number, 915 user-id, group-id, access-time, modification-time, 916 status-change-time, size, modes, inode-number and device-number. 917 918 (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) 919 (file-attribute-collect (file-attributes ".") 'type 'modes 920 'inode-number) ⇒ (t "drwxr-xr-x" 137819) 921 922 2.3.2 Prefixed Definitions 923 -------------------------- 924 925 These functions are prefixed with ‘compat’ prefix, and are only loaded 926 when ‘compat-26’ is required: 927 928 -- Function: compat-assoc key alist &optional testfn 929 This function returns the first association for KEY in ALIST, 930 comparing KEY against the alist elements using TESTFN if it is a 931 function, and ‘equal’ otherwise (*note (elisp)Equality 932 Predicates::). If TESTFN is a function, it is called with two 933 arguments: the CAR of an element from ALIST and KEY. The function 934 returns ‘nil’ if no association in ALIST has a CAR equal to KEY, as 935 tested by TESTFN. 936 937 *Note (elisp)Association Lists::. 938 939 The compatibility version adds support for handling the optional 940 argument TESTFN. 941 942 -- Function: compat-line-number-at-pos &optional pos absolute 943 This function returns the line number in the current buffer 944 corresponding to the buffer position POS. If POS is ‘nil’ or 945 omitted, the current buffer position is used. If ABSOLUTE is 946 ‘nil’, the default, counting starts at ‘(point-min)’, so the value 947 refers to the contents of the accessible portion of the 948 (potentially narrowed) buffer. If ABSOLUTE is non-‘nil’, ignore 949 any narrowing and return 950 951 *Note (elisp)Text Lines::. 952 953 The compatibility version adds support for handling the optional 954 argument ABSOLUTE. 955 956 -- Function: compat-alist-get key alist &optional default remove testfn 957 *Note (elisp)Association Lists::. This function is similar to 958 ‘assq’. It finds the first association ‘(KEY . VALUE)’ by 959 comparing KEY with ALIST elements, and, if found, returns the VALUE 960 of that association. If no association is found, the function 961 returns DEFAULT. Comparison of KEY against ALIST elements uses the 962 function specified by TESTFN, defaulting to ‘eq’. 963 964 *Note (elisp)Association Lists::. 965 966 The compatibility version handles the optional argument TESTFN. It 967 can also be used as a *note Generalized Variables: 968 (elisp)generalised variable. 969 970 -- Function: compat-string-trim-left string &optional regexp 971 Remove the leading text that matches REGEXP from STRING. REGEXP 972 defaults to ‘[ \t\n\r]+’. 973 974 *Note (elisp)Creating Strings::. 975 976 The compatibility version handles the optional argument REGEXP. 977 978 -- Function: compat-string-trim-right string &optional regexp 979 Remove the trailing text that matches REGEXP from STRING. REGEXP 980 defaults to ‘[ \t\n\r]+’. 981 982 *Note (elisp)Creating Strings::. 983 984 The compatibility version handles the optional argument REGEXP. 985 986 -- Function: compat-string-trim string &optional trim-left trim-right 987 Remove the leading text that matches TRIM-LEFT and trailing text 988 that matches TRIM-RIGHT from STRING. Both regexps default to ‘[ 989 \t\n\r]+’. 990 991 *Note (elisp)Creating Strings::. 992 993 The compatibility version handles the optional arguments TRIM-LEFT 994 and TRIM-RIGHT. 995 996 2.3.3 Missing Definitions 997 ------------------------- 998 999 Compat does not provide support for the following Lisp features 1000 implemented in 26.1: 1001 1002 • The function ‘secure-hash-algorithms’. 1003 • The function ‘gnutls-avalaible-p’. 1004 • Support for records and record functions. 1005 • The function ‘mapbacktrace’. 1006 • The function ‘file-name-case-insensitive-p’. 1007 • The file-attributes constructors. 1008 • The additional elements of ‘parse-partial-sexp’. 1009 • The function ‘add-variable-watcher’. 1010 • The function ‘undo-amalgamate-change-group’. 1011 • The function ‘char-from-name’ 1012 • Signalling errors when ‘length’ or ‘member’ deal with list cycles. 1013 • The function ‘frame-list-z-order’. 1014 • The function ‘frame-restack’. 1015 • Support for side windows and atomic windows. 1016 • All changes related to ‘display-buffer’. 1017 • The function ‘window-swap-states’. 1018 1019 1020 File: compat.info, Node: Emacs 27.1, Next: Emacs 28.1, Prev: Emacs 26.1, Up: Support 1021 1022 2.4 Emacs 27.1 1023 ============== 1024 1025 2.4.1 Unprefixed Definitions 1026 ---------------------------- 1027 1028 The following functions and macros implemented in 27.1, and are provided 1029 by Compat by default: 1030 1031 -- Function: proper-list-p object 1032 This function returns the length of OBJECT if it is a proper list, 1033 ‘nil’ otherwise (*note (elisp)Cons Cells::). In addition to 1034 satisfying ‘listp’, a proper list is neither circular nor dotted. 1035 1036 (proper-list-p '(a b c)) ⇒ 3 1037 (proper-list-p '(a b . c)) ⇒ nil 1038 1039 *Note (elisp)List-related Predicates::. 1040 1041 -- Function: string-distance string1 string2 &optional bytecompare 1042 This function returns the _Levenshtein distance_ between the source 1043 string STRING1 and the target string STRING2. The Levenshtein 1044 distance is the number of single-character changes—deletions, 1045 insertions, or replacements—required to transform the source string 1046 into the target string; it is one possible definition of the _edit 1047 distance_ between strings. 1048 1049 Letter-case of the strings is significant for the computed 1050 distance, but their text properties are ignored. If the optional 1051 argument BYTECOMPARE is non-‘nil’, the function calculates the 1052 distance in terms of bytes instead of characters. The byte-wise 1053 comparison uses the internal Emacs representation of characters, so 1054 it will produce inaccurate results for multibyte strings that 1055 include raw bytes (*note (elisp)Text Representations::); make the 1056 strings unibyte by encoding them (*note (elisp)Explicit Encoding::) 1057 if you need accurate results with raw bytes. 1058 1059 *Note (elisp)Text Comparison::. 1060 1061 -- Function: json-serialize object &rest args 1062 This function returns a new Lisp string which contains the JSON 1063 representation of OBJECT. The argument ARGS is a list of 1064 keyword/argument pairs. The following keywords are accepted: 1065 1066 ‘:null-object’ 1067 The value decides which Lisp object to use to represent the 1068 JSON keyword ‘null’. It defaults to the symbol ‘:null’. 1069 1070 ‘:false-object’ 1071 The value decides which Lisp object to use to represent the 1072 JSON keyword ‘false’. It defaults to the symbol ‘:false’. 1073 1074 *Note (elisp)Parsing JSON::. 1075 1076 -- Function: json-insert object &rest args 1077 This function inserts the JSON representation of OBJECT into the 1078 current buffer before point. The argument ARGS are interpreted as 1079 in ‘json-parse-string’. 1080 1081 *Note (elisp)Parsing JSON::. 1082 1083 -- Function: json-parse-string string &rest args 1084 This function parses the JSON value in STRING, which must be a Lisp 1085 string. If STRING doesn’t contain a valid JSON object, this 1086 function signals the ‘json-parse-error’ error. 1087 1088 The argument ARGS is a list of keyword/argument pairs. The 1089 following keywords are accepted: 1090 1091 ‘:object-type’ 1092 The value decides which Lisp object to use for representing 1093 the key-value mappings of a JSON object. It can be either 1094 ‘hash-table’, the default, to make hashtables with strings as 1095 keys; ‘alist’ to use alists with symbols as keys; or ‘plist’ 1096 to use plists with keyword symbols as keys. 1097 1098 ‘:array-type’ 1099 The value decides which Lisp object to use for representing a 1100 JSON array. It can be either ‘array’, the default, to use 1101 Lisp arrays; or ‘list’ to use lists. 1102 1103 ‘:null-object’ 1104 The value decides which Lisp object to use to represent the 1105 JSON keyword ‘null’. It defaults to the symbol ‘:null’. 1106 1107 ‘:false-object’ 1108 The value decides which Lisp object to use to represent the 1109 JSON keyword ‘false’. It defaults to the symbol ‘:false’. 1110 1111 *Note (elisp)Parsing JSON::. 1112 1113 -- Function: json-parse-buffer &rest args 1114 This function reads the next JSON value from the current buffer, 1115 starting at point. It moves point to the position immediately 1116 after the value if contains a valid JSON object; otherwise it 1117 signals the ‘json-parse-error’ error and doesn’t move point. The 1118 arguments ARGS are interpreted as in ‘json-parse-string’. 1119 1120 *Note (elisp)Parsing JSON::. 1121 1122 -- Macro: ignore-errors body... 1123 This construct executes BODY, ignoring any errors that occur during 1124 its execution. If the execution is without error, ‘ignore-errors’ 1125 returns the value of the last form in BODY; otherwise, it returns 1126 ‘nil’. 1127 1128 Here’s the example at the beginning of this subsection rewritten 1129 using ‘ignore-errors’: 1130 1131 (ignore-errors (delete-file filename)) 1132 1133 *Note (elisp)Handling Errors::. 1134 1135 -- Macro: dolist-with-progress-reporter (var count [result]) 1136 reporter-or-message body... 1137 This is another convenience macro that works the same way as 1138 ‘dolist’ does, but also reports loop progress using the functions 1139 described above. As in ‘dotimes-with-progress-reporter’, 1140 ‘reporter-or-message’ can be a progress reporter or a string. You 1141 can rewrite the previous example with this macro as follows: 1142 1143 (dolist-with-progress-reporter (k (number-sequence 0 500)) "Collecting 1144 some mana for Emacs..." (sit-for 0.01)) 1145 1146 *Note (elisp)Progress::. 1147 1148 -- Function: flatten-tree tree 1149 This function returns a “flattened” copy of TREE, that is, a list 1150 containing all the non-‘nil’ terminal nodes, or leaves, of the tree 1151 of cons cells rooted at TREE. Leaves in the returned list are in 1152 the same order as in TREE. 1153 1154 (flatten-tree '(1 (2 . 3) nil (4 5 (6)) 7)) ⇒(1 2 3 4 5 6 7) 1155 1156 *Note (elisp)Building Lists::. 1157 1158 -- Function: xor condition1 condition2 1159 This function returns the boolean exclusive-or of CONDITION1 and 1160 CONDITION2. That is, ‘xor’ returns ‘nil’ if either both arguments 1161 are ‘nil’, or both are non-‘nil’. Otherwise, it returns the value 1162 of that argument which is non-‘nil’. 1163 1164 Note that in contrast to ‘or’, both arguments are always evaluated. 1165 1166 *Note (elisp)Combining Conditions::. 1167 1168 -- Variable: regexp-unmatchable 1169 This variable contains a regexp that is guaranteed not to match any 1170 string at all. It is particularly useful as default value for 1171 variables that may be set to a pattern that actually matches 1172 something. 1173 1174 *Note (elisp)Regexp Functions:: 1175 1176 -- Function: decoded-time-second time 1177 Return the SECONDS field of a ‘decoded-time’ record TIME. 1178 1179 -- Function: decoded-time-minute time 1180 Return the MINUTE field of a ‘decoded-time’ record TIME. 1181 1182 -- Function: decoded-time-hour time 1183 Return the HOUR field of a ‘decoded-time’ record TIME. 1184 1185 -- Function: decoded-time-day time 1186 Return the DAY field of a ‘decoded-time’ record TIME. 1187 1188 -- Function: decoded-time-month time 1189 Return the MONTH field of a ‘decoded-time’ record TIME. 1190 1191 -- Function: decoded-time-year time 1192 Return the YEAR field of a ‘decoded-time’ record TIME. 1193 1194 -- Function: decoded-time-weekday time 1195 Return the WEEKDAY field of a ‘decoded-time’ record TIME. 1196 1197 -- Function: decoded-time-dst time 1198 Return the DST (daylight saving time indicator) field of a 1199 ‘decoded-time’ record TIME. 1200 1201 -- Function: decoded-time-zone time 1202 Return the ZONE field of a ‘decoded-time’ record TIME. 1203 1204 -- Function: package-get-version 1205 Return the version number of the package in which this is used. 1206 1207 -- Function: time-equal-p t1 t2 1208 This returns ‘t’ if the two time values T1 and T2 are equal. 1209 1210 *Note (elisp)Time Calculations::. 1211 1212 -- Function: date-days-in-month year month 1213 Return the number of days in MONTH in YEAR. For instance, February 1214 2020 has 29 days. 1215 1216 *Note (elisp)Time Calculations::. This function requires the 1217 ‘time-date’ feature to be loaded. 1218 1219 -- User Option: exec-path 1220 The value of this variable is a list of directories to search for 1221 programs to run in subprocesses. Each element is either the name 1222 of a directory (i.e., a string), or ‘nil’, which stands for the 1223 default directory (which is the value of ‘default-directory’). 1224 *Note executable-find: (elisp)Locating Files, for the details of 1225 this search. 1226 1227 The value of ‘exec-path’ is used by ‘call-process’ and 1228 ‘start-process’ when the PROGRAM argument is not an absolute file 1229 name. 1230 1231 Generally, you should not modify ‘exec-path’ directly. Instead, 1232 ensure that your ‘PATH’ environment variable is set appropriately 1233 before starting Emacs. Trying to modify ‘exec-path’ independently 1234 of ‘PATH’ can lead to confusing results. 1235 1236 *Note (elisp)Subprocess Creation::. 1237 1238 -- Function: provided-mode-derived-p mode &rest modes 1239 This function returns non-‘nil’ if MODE is derived from any of the 1240 major modes given by the symbols MODES. 1241 1242 -- Function: derived-mode-p &rest modes 1243 This function returns non-‘nil’ if the current major mode is 1244 derived from any of the major modes given by the symbols MODES. 1245 1246 *Note (elisp)Derived Modes::. 1247 1248 2.4.2 Prefixed Definitions 1249 -------------------------- 1250 1251 These functions are prefixed with ‘compat’ prefix, and are only loaded 1252 when ‘compat-27’ is required: 1253 1254 -- Function: compat-recenter &optional count redisplay 1255 This function scrolls the text in the selected window so that point 1256 is displayed at a specified vertical position within the window. 1257 It does not move point with respect to the text. 1258 1259 *Note (elisp)Textual Scrolling::. 1260 1261 This compatibility version adds support for the optional argument 1262 REDISPLAY. 1263 1264 -- Function: compat-lookup-key keymap key &optional accept-defaults 1265 This function returns the definition of KEY in KEYMAP. If the 1266 string or vector KEY is not a valid key sequence according to the 1267 prefix keys specified in KEYMAP, it must be too long and have extra 1268 events at the end that do not fit into a single key sequence. Then 1269 the value is a number, the number of events at the front of KEY 1270 that compose a complete key. 1271 1272 *Note (elisp)Low-Level Key Binding::. 1273 1274 This compatibility version allows for KEYMAP to be a list of 1275 keymaps, instead of just a singular keymap. 1276 1277 -- Macro: setq-local &rest pairs 1278 PAIRS is a list of variable and value pairs. This macro creates a 1279 buffer-local binding in the current buffer for each of the 1280 variables, and gives them a buffer-local value. It is equivalent 1281 to calling ‘make-local-variable’ followed by ‘setq’ for each of the 1282 variables. The variables should be unquoted symbols. 1283 1284 (setq-local var1 "value1" 1285 var2 "value2") 1286 1287 *Note (elisp)Creating Buffer-Local::. 1288 1289 This compatibility version allows for more than one variable to be 1290 set at once, as can be done with ‘setq’. 1291 1292 -- Function: compat-regexp-opt strings &optional paren 1293 This function returns an efficient regular expression that will 1294 match any of the strings in the list STRINGS. This is useful when 1295 you need to make matching or searching as fast as possible—for 1296 example, for Font Lock mode. 1297 1298 *Note (elisp)Regexp Functions::. 1299 1300 The compatibility version of this functions handles the case where 1301 STRINGS in an empty list. In that case, a regular expression is 1302 generated that never matches anything (see ‘regexp-unmatchable’). 1303 1304 -- Function: compat-file-size-human-readable file-size &optional flavor 1305 space unit 1306 Return a string with a human readable representation of FILE-SIZE. 1307 1308 The optional second argument FLAVOR controls the units and the 1309 display format. If FLAVOR is... 1310 1311 • ‘si’, each kilobyte is 1000 bytes and the produced suffixes 1312 are ‘k’, ‘M’, ‘G’, ‘T’, etc. 1313 • ‘iec’, each kilobyte is 1024 bytes and the produced suffixes 1314 are ‘KiB’, ‘MiB’, ‘GiB’, ‘TiB’, etc. 1315 • ‘nil’ or omitted, each kilobyte is 1024 bytes and the produced 1316 suffixes are ‘k’, ‘M’, ‘G’, ‘T’, etc. 1317 1318 The compatibility version handles the optional third (SPACE) and 1319 forth (UNIT) arguments. The argument SPACE can be a string that is 1320 placed between the number and the unit. The argument UNIT 1321 determines the unit to use. By default it will be an empty string, 1322 unless FLAVOR is ‘iec’, in which case it will be ‘B’. 1323 1324 -- Function: compat-assoc-delete-all 1325 This function is like ‘assq-delete-all’ except that it accepts an 1326 optional argument TEST, a predicate function to compare the keys in 1327 ALIST. If omitted or ‘nil’, TEST defaults to ‘equal’. As 1328 ‘assq-delete-all’, this function often modifies the original list 1329 structure of ALIST. 1330 1331 *Note (elisp)Association Lists::. 1332 1333 This compatibility version handles the optional third (TESTFN) 1334 argument. 1335 1336 -- Function: compat-executable-find program &optional remote 1337 This function searches for the executable file of the named PROGRAM 1338 and returns the absolute file name of the executable, including its 1339 file-name extensions, if any. It returns ‘nil’ if the file is not 1340 found. The function searches in all the directories in 1341 ‘exec-path’, and tries all the file-name extensions in 1342 ‘exec-suffixes’ (*note (elisp)Subprocess Creation::). 1343 1344 If REMOTE is non-‘nil’, and ‘default-directory’ is a remote 1345 directory, PROGRAM is searched on the respective remote host. 1346 1347 *Note (elisp)Locating Files::. 1348 1349 This compatibility version adds support to handle the optional 1350 second (REMOTE) argument. 1351 1352 -- Function: compat-dired-get-marked-files &optional localp arg filter 1353 distinguish-one-marked error 1354 Return a list of file names that are _marked_ in a Dired buffer. 1355 1356 This compatibility version handles the optional fifth (ERROR) 1357 argument, which signals an error if the list of found files is 1358 empty. ‘error’ can be a string with the error message. 1359 1360 2.4.3 Missing Definitions 1361 ------------------------- 1362 1363 Compat does not provide support for the following Lisp features 1364 implemented in 27.1: 1365 1366 • Bigint support. 1367 • The function ‘time-convert’. 1368 • All ‘iso8601-*’ functions. 1369 • The macro ‘benchmark-progn’. 1370 • The function ‘read-char-from-minibuffer’. 1371 • The minor mode ‘reveal-mode’. 1372 • The macro ‘with-suppressed-warnings’. 1373 • Support for ‘condition-case’ to handle t. 1374 • The functions ‘major-mode-suspend’ and ‘major-mode-restore’. 1375 • The function ‘provided-mode-derived-p’. 1376 • The function ‘file-system-info’. 1377 • The more consistent treatment of NaN values. 1378 • The function ‘ring-resize’. 1379 • The function ‘group-name’. 1380 • Additional ‘format-spec’ modifiers. 1381 • Support for additional body forms for 1382 ‘define-globalized-minor-mode’. 1383 • The macro ‘with-connection-local-variables’ and related 1384 functionality. 1385 1386 1387 File: compat.info, Node: Emacs 28.1, Prev: Emacs 27.1, Up: Support 1388 1389 2.5 Emacs 28.1 1390 ============== 1391 1392 2.5.1 Unprefixed Definitions 1393 ---------------------------- 1394 1395 The following functions and macros implemented in 28.1, and are provided 1396 by Compat by default: 1397 1398 -- Function: string-search needle haystack &optional start-pos 1399 Return the position of the first instance of NEEDLE in HAYSTACK, 1400 both of which are strings. If START-POS is non-‘nil’, start 1401 searching from that position in NEEDLE. Return ‘nil’ if no match 1402 was found. This function only considers the characters in the 1403 strings when doing the comparison; text properties are ignored. 1404 Matching is always case-sensitive. 1405 1406 -- Function: length= sequence length 1407 Return non-‘nil’ if the length of SEQUENCE is equal to LENGTH. 1408 1409 -- Function: length< sequence length 1410 Return non-‘nil’ if SEQUENCE is shorter than LENGTH. This may be 1411 more efficient than computing the length of SEQUENCE if SEQUENCE is 1412 a long list. 1413 1414 -- Function: length> sequence length 1415 Return non-‘nil’ if SEQUENCE is longer than LENGTH. 1416 1417 -- Function: file-name-concat directory &rest components 1418 Concatenate COMPONENTS to DIRECTORY, inserting a slash before the 1419 components if DIRECTORY or the preceding component didn’t end with 1420 a slash. 1421 1422 (file-name-concat "/tmp" "foo") ⇒ "/tmp/foo" 1423 1424 A DIRECTORY or components that are ‘nil’ or the empty string are 1425 ignored—they are filtered out first and do not affect the results 1426 in any way. 1427 1428 This is almost the same as using ‘concat’, but DIRNAME (and the 1429 non-final components) may or may not end with slash characters, and 1430 this function will not double those characters. 1431 1432 -- Function: garbage-collect-maybe factor 1433 Suggest to run garbage collection, if _enough_ data has been 1434 allocated. This is determined by the positive numerical argument 1435 FACTOR, that would proportionally increase the likelihood of 1436 garbage collection taking place. 1437 1438 This compatibility function does nothing and ignores any 1439 suggestion. 1440 1441 -- Function: string-replace from-string to-string in-string 1442 This function replaces all occurrences of FROM-STRING with 1443 TO-STRING in IN-STRING and returns the result. It may return one 1444 of its arguments unchanged, a constant string or a new string. 1445 Case is significant, and text properties are ignored. 1446 1447 -- Function: always &rest arguments 1448 This function ignores any ARGUMENTS and returns ‘t’. 1449 1450 *Note (elisp)Calling Functions::. 1451 1452 -- Function: insert-into-buffer to-buffer &optional start end 1453 This is like ‘insert-buffer-substring’, but works in the opposite 1454 direction: The text is copied from the current buffer into 1455 TO-BUFFER. The block of text is copied to the current point in 1456 TO-BUFFER, and point (in that buffer) is advanced to after the end 1457 of the copied text. Is ‘start’/‘end’ is ‘nil’, the entire text in 1458 the current buffer is copied over. 1459 1460 *Note (elisp)Insertion::. 1461 1462 -- Function: replace-string-in-region regexp replacement &optional 1463 start end 1464 This function replaces all the occurrences of REGEXP with 1465 REPLACEMENT in the region of buffer text between START and END; 1466 START defaults to position of point, and END defaults to the last 1467 accessible position of the buffer. The search for REGEXP is 1468 case-sensitive, and REPLACEMENT is inserted without changing its 1469 letter-case. The REPLACEMENT string can use the same special 1470 elements starting with ‘\’ as ‘replace-match’ does. The function 1471 returns the number of replaced occurrences, or ‘nil’ if REGEXP is 1472 not found. The function preserves the position of point. 1473 1474 (replace-regexp-in-region "foo[ \t]+bar" "foobar") 1475 *Note (elisp)Search and Replace::. 1476 1477 -- Function: replace-regexp-in-string string replacement &optional 1478 start end 1479 This function works similarly to ‘replace-regexp-in-region’, but 1480 searches for, and replaces, literal STRINGs instead of regular 1481 expressions. 1482 1483 *Note (elisp)Search and Replace::. 1484 1485 -- Function: buffer-local-boundp variable buffer 1486 This returns non-‘nil’ if there’s either a buffer-local binding of 1487 VARIABLE (a symbol) in buffer BUFFER, or VARIABLE has a global 1488 binding. 1489 1490 *Note (elisp)Creating Buffer-Local::. 1491 1492 -- Macro: with-existing-directory body... 1493 This macro ensures that ‘default-directory’ is bound to an existing 1494 directory before executing BODY. If ‘default-directory’ already 1495 exists, that’s preferred, and otherwise some other directory is 1496 used. This macro can be useful, for instance, when calling an 1497 external command that requires that it’s running in a directory 1498 that exists. The chosen directory is not guaranteed to be 1499 writable. 1500 1501 *Note (elisp)Testing Accessibility::. 1502 1503 -- Macro: dlet (bindings...) forms... 1504 This special form is like ‘let’, but it binds all variables 1505 dynamically. This is rarely useful—you usually want to bind normal 1506 variables lexically, and special variables (i.e., variables that 1507 are defined with ‘defvar’) dynamically, and this is what ‘let’ 1508 does. 1509 1510 ‘dlet’ can be useful when interfacing with old code that assumes 1511 that certain variables are dynamically bound (*note (elisp)Dynamic 1512 Binding::), but it’s impractical to ‘defvar’ these variables. 1513 ‘dlet’ will temporarily make the bound variables special, execute 1514 the forms, and then make the variables non-special again. 1515 1516 *Note (elisp)Local Variables::. 1517 1518 -- Function: ensure-list object 1519 This function returns OBJECT as a list. If OBJECT is already a 1520 list, the function returns it; otherwise, the function returns a 1521 one-element list containing OBJECT. 1522 1523 This is usually useful if you have a variable that may or may not 1524 be a list, and you can then say, for instance: 1525 1526 (dolist (elem (ensure-list foo)) 1527 (princ elem)) 1528 1529 *Note (elisp)Building Lists::. 1530 1531 -- Function: string-clean-whitespace string 1532 Clean up the whitespace in STRING by collapsing stretches of 1533 whitespace to a single space character, as well as removing all 1534 whitespace from the start and the end of STRING. 1535 1536 *Note (elisp)Creating Strings::. 1537 1538 -- Function: string-fill string length 1539 Attempt to Word-wrap STRING so that no lines are longer than 1540 LENGTH. Filling is done on whitespace boundaries only. If there 1541 are individual words that are longer than LENGTH, these will not be 1542 shortened. 1543 1544 *Note (elisp)Creating Strings::. 1545 1546 -- Function: string-lines string &optional omit-nulls keep-newlines 1547 Split STRING into a list of strings on newline boundaries. If the 1548 optional argument OMIT-NULLS is non-‘nil’, remove empty lines from 1549 the results. If the optional argument KEEP-NEWLINES is non-‘nil’, 1550 don’t remove the trailing newlines from the result strings. 1551 1552 *Note (elisp)Creating Strings::. 1553 1554 -- Function: string-pad string length &optional padding start 1555 Pad STRING to be of the given LENGTH using PADDING as the padding 1556 character. PADDING defaults to the space character. If STRING is 1557 longer than LENGTH, no padding is done. If START is ‘nil’ or 1558 omitted, the padding is appended to the characters of STRING, and 1559 if it’s non-‘nil’, the padding is prepended to STRING’s characters. 1560 1561 *Note (elisp)Creating Strings::. 1562 1563 -- Function: string-chop-newline string 1564 Remove the final newline, if any, from STRING. 1565 1566 *Note (elisp)Creating Strings::. 1567 1568 -- Macro: named-let name bindings &rest body 1569 This special form is a looping construct inspired from the Scheme 1570 language. It is similar to ‘let’: It binds the variables in 1571 BINDINGS, and then evaluates BODY. However, ‘named-let’ also binds 1572 NAME to a local function whose formal arguments are the variables 1573 in BINDINGS and whose body is BODY. This allows BODY to call 1574 itself recursively by calling NAME, where the arguments passed to 1575 NAME are used as the new values of the bound variables in the 1576 recursive invocation. 1577 1578 Recursive calls to NAME that occur in _tail positions_ in BODY are 1579 guaranteed to be optimized as _tail calls_, which means that they 1580 will not consume any additional stack space no matter how deeply 1581 the recursion runs. Such recursive calls will effectively jump to 1582 the top of the loop with new values for the variables. 1583 1584 *Note (elisp)Local Variables::. 1585 1586 -- Function: file-name-with-extension filename extension 1587 This function returns FILENAME with its extension set to EXTENSION. 1588 A single leading dot in the EXTENSION will be stripped if there is 1589 one. For example: 1590 1591 (file-name-with-extension "file" "el") 1592 ⇒ "file.el" 1593 (file-name-with-extension "file" ".el") 1594 ⇒ "file.el" 1595 (file-name-with-extension "file.c" "el") 1596 ⇒ "file.el" 1597 1598 Note that this function will error if FILENAME or EXTENSION are 1599 empty, or if the FILENAME is shaped like a directory (i.e., if 1600 ‘directory-name-p’ returns non-‘nil’). 1601 1602 *Note File Name Components: (elisp)File Name Components. 1603 1604 -- Function: directory-empty-p directory 1605 This utility function returns ‘t’ if given DIRECTORY is an 1606 accessible directory and it does not contain any files, i.e., is an 1607 empty directory. It will ignore ‘.’ and ‘..’ on systems that 1608 return them as files in a directory. 1609 1610 Symbolic links to directories count as directories. See 1611 FILE-SYMLINK-P to distinguish symlinks. 1612 1613 *Note (elisp)Contents of Directories::. 1614 1615 -- Function: format-prompt prompt default &rest format-args 1616 Format PROMPT with default value DEFAULT according to the 1617 ‘minibuffer-default-prompt-format’ variable. 1618 1619 ‘minibuffer-default-prompt-format’ is a format string (defaulting 1620 to ‘" (default %s)"’ that says how the “default” bit in prompts 1621 like ‘"Local filename (default somefile): "’ are to be formatted. 1622 1623 To allow the users to customize how this is displayed, code that 1624 prompts the user for a value (and has a default) should look 1625 something along the lines of this code snippet: 1626 1627 (read-file-name 1628 (format-prompt "Local filename" file) 1629 nil file) 1630 1631 If FORMAT-ARGS is ‘nil’, PROMPT is used as a literal string. If 1632 FORMAT-ARGS is non-‘nil’, PROMPT is used as a format control 1633 string, and PROMPT and FORMAT-ARGS are passed to ‘format’ (*note 1634 (elisp)Formatting Strings::). 1635 1636 ‘minibuffer-default-prompt-format’ can be ‘""’, in which case no 1637 default values are displayed. 1638 1639 If DEFAULT is ‘nil’, there is no default value, and therefore no 1640 “default value” string is included in the result value. If DEFAULT 1641 is a non-‘nil’ list, the first element of the list is used in the 1642 prompt. 1643 1644 *Note (elisp)Text from Minibuffer::. 1645 1646 -- Function: thing-at-mouse event thing &optional no-properties 1647 Mouse-EVENT equivalent of ‘thing-at-point’. THING can be ‘symbol’, 1648 ‘list’, ‘sexp’, ‘filename’, ‘url’, ... among other things. 1649 1650 When NO-PROPERTIES has a non-‘nil’ value, any text properties that 1651 might have been present in the buffer are stripped away. 1652 1653 -- Function: macroexp-file-name 1654 Return the name of the file in which the code is currently being 1655 evaluated, or ‘nil’ if it cannot be determined. 1656 1657 -- Macro: with-environment-variables variables body... 1658 This macro sets the environment variables according to VARIABLES 1659 temporarily when executing BODY. The previous values are restored 1660 when the form finishes. The argument VARIABLES should be a list of 1661 pairs of strings of the form ‘(VAR VALUE)’, where VAR is the name 1662 of the environment variable and VALUE is that variable’s value. 1663 1664 (with-environment-variables (("LANG" "C") 1665 ("LANGUAGE" "en_US:en")) 1666 (call-process "ls" nil t)) 1667 1668 *Note System Environment: (elisp)System Environment. 1669 1670 -- Function: button-buttonize string callback &optional data help-echo 1671 Return a button with STRING as its label. When interacted on, the 1672 one-argument function in CALLBACK is called and DATA (or ‘nil’ is 1673 not present) will be passed as the argument. 1674 1675 If non-‘nil’, the argument HELP-ECHO will be used to set the 1676 ‘help-echo’ text property. 1677 1678 -- Function: make-directory-autoloads dir output-file 1679 Parse and search the directory DIR for autoload definitions, and 1680 write the processed results to the file OUTPUT-FILE. 1681 1682 -- Function: color-values-from-color-spec spec 1683 Convert the textual color specification SPEC to a color triple 1684 ‘(RED GREEN blue)’. Each of RED, GREEN and ‘blue’ is a integer 1685 value between 0 and 65535. 1686 1687 The specification SPEC can be one of the following 1688 • ‘#RGB’, where R, G and B are hex numbers of equal length, 1-4 1689 digits each. 1690 • ‘rgb:R/G/B’, where R, G, and B are hex numbers, 1-4 digits 1691 each. 1692 • ‘rgbi:R/G/B’, where R, G and B are floating-point numbers in 1693 [0,1]. 1694 1695 -- Function: file-modes-number-to-symbolic modes 1696 This function converts a numeric file mode specification in MODES 1697 into the equivalent symbolic form. 1698 1699 *Note Changing Files: (elisp)Changing Files. 1700 1701 -- Function: file-backup-file-names filename 1702 This function returns a list of all the backup file names for 1703 FILENAME, or ‘nil’ if there are none. The files are sorted by 1704 modification time, descending, so that the most recent files are 1705 first. 1706 1707 *Note (elisp)Backup Names::. 1708 1709 -- Function: make-lock-file-name filename 1710 Return a string containing a lock file name for FILENAME, obeying 1711 ‘lock-file-name-transforms’. 1712 1713 -- Function: null-device 1714 Return the path to the null device (usually something like 1715 ‘/dev/null’) on the current system. 1716 1717 -- Function: decoded-time-period time 1718 Interpret TIME as a period and return its length in seconds. For 1719 computational purposes, years are 365 days long and months are 30 1720 days long. 1721 1722 -- Function: subr-primitive-p object 1723 Return ‘t’ if OBJECT is a primitive, built-in function. On systems 1724 with native compilation ‘subrp’ does not distinguish between 1725 built-in functions and functions that have been compiled. If 1726 native compilation is not avaliable, this function behaves 1727 identically to ‘subrp’. 1728 1729 -- Function: file-name-absolute-p filename 1730 This function returns ‘t’ if file FILENAME is an absolute file 1731 name, ‘nil’ otherwise. A file name is considered to be absolute if 1732 its first component is ‘~’, or is ‘~USER’ where USER is a valid 1733 login name. In the following examples, assume that there is a user 1734 named ‘rms’ but no user named ‘nosuchuser’. 1735 1736 (file-name-absolute-p "~rms/foo") 1737 ⇒ t 1738 (file-name-absolute-p "~nosuchuser/foo") 1739 ⇒ nil 1740 (file-name-absolute-p "rms/foo") 1741 ⇒ nil 1742 (file-name-absolute-p "/user/rms/foo") 1743 ⇒ t 1744 1745 *Note (elisp)Absolute and Relative File Names::. 1746 1747 2.5.2 Prefixed Definitions 1748 -------------------------- 1749 1750 These functions are prefixed with ‘compat’ prefix, and are only loaded 1751 when ‘compat-28’ is required: 1752 1753 -- Function: compat-unlock-buffer 1754 This function unlocks the file being visited in the current buffer, 1755 if the buffer is modified. If the buffer is not modified, then the 1756 file should not be locked, so this function does nothing. It also 1757 does nothing if the current buffer is not visiting a file, or is 1758 not locked. This function handles file system errors by calling 1759 ‘display-warning’ and otherwise ignores the error. 1760 1761 *Note (elisp)File Locks::. 1762 1763 This compatibility versions catches the ‘file-error’ condition, 1764 issuing a warning instead of propagating on the error. 1765 1766 -- Function: compat-string-width string &optional from to 1767 This function returns the width in columns of the string STRING, if 1768 it were displayed in the current buffer and the selected window. 1769 Optional arguments FROM and TO specify the substring of STRING to 1770 consider, and are interpreted as in ‘substring’ (*note 1771 (elisp)Creating Strings::). 1772 1773 The return value is an approximation: it only considers the values 1774 returned by ‘char-width’ for the constituent characters, always 1775 takes a tab character as taking ‘tab-width’ columns, ignores 1776 display properties and fonts, etc. 1777 1778 *Note (elisp)Size of Displayed Text::. 1779 1780 This compatibility version handles the optional arguments FROM and 1781 TO. 1782 1783 -- Function: compat-json-serialize 1784 *Note Emacs 27.1::. 1785 1786 This compatibility version handles primitive, top-level JSON values 1787 (numbers, strings, booleans). 1788 1789 -- Function: compat-json-insert 1790 *Note Emacs 27.1::. 1791 1792 This compatibility version handles primitive, top-level JSON values 1793 (numbers, strings, booleans). 1794 1795 -- Function: compat-json-parse-string 1796 *Note Emacs 27.1::. 1797 1798 This compatibility version handles primitive, top-level JSON values 1799 (numbers, strings, booleans). 1800 1801 -- Function: compat-json-parse-buffer 1802 *Note Emacs 27.1::. 1803 1804 This compatibility version handles primitive, top-level JSON values 1805 (numbers, strings, booleans). 1806 1807 -- Function: compat-count-windows 1808 Return the number of live windows on the selected frame. 1809 1810 The optional argument MINIBUF specifies whether the minibuffer 1811 window is included in the count. 1812 1813 If ALL-FRAMES is non-‘nil’, count the windows in all frames instead 1814 just the selected frame. 1815 1816 This compatibility version handles the optional argument 1817 ALL-FRAMES. 1818 1819 2.5.3 Missing Definitions 1820 ------------------------- 1821 1822 Compat does not provide support for the following Lisp features 1823 implemented in 28.1: 1824 1825 • Support for ‘interactive’ or ‘declare’ to list applicable modes. 1826 • Support for ‘:interactive’ argument to ‘define-minor-mode’ and 1827 ‘define-derived-mode’. 1828 • Support for ‘:predicate’ argument to 1829 ‘define-globalized-minor-mode’. 1830 • "Success handler" for ‘condition-case’. 1831 • The function ‘benchmark-call’. 1832 • Support for the ‘natnum’ defcustom type. 1833 • The function ‘macroexp-compiling-p’. 1834 • The function ‘macroexp-warn-and-return’. 1835 • Additional Edebug keywords. 1836 • Shorthand support. 1837 • The function ‘custom-add-choice’. 1838 • The function ‘decoded-time-period’. 1839 • The function ‘dom-print’. 1840 • The function ‘dom-remove-attribute’. 1841 • The function ‘dns-query-asynchronous’. 1842 • The function ‘get-locale-names’. 1843 • The function ‘json-avaliable-p’. 1844 • The function ‘mail-header-parse-addresses-lax’. 1845 • The function ‘mail-header-parse-address-lax’. 1846 • The function ‘make-separator-line’. 1847 • The function ‘num-processors’. 1848 • The function ‘object-intervals’. 1849 • The function ‘process-lines-ignore-status’. 1850 • The function ‘require-theme’. 1851 • The function ‘syntax-class-to-char’. 1852 • The function ‘path-separator’. 1853 1854 1855 File: compat.info, Node: Development, Next: Function Index, Prev: Support, Up: Top 1856 1857 3 Development 1858 ************* 1859 1860 Compat is developed on SourceHut (https://sr.ht/~pkal/compat). A 1861 restricted GitHub mirror (https://github.com/phikal/compat.el) is also 1862 maintained. 1863 1864 Patches and comments can be sent to the development mailing list 1865 (https://lists.sr.ht/~pkal/compat-devel) (~pkal/compat-devel@lists.sr.ht 1866 <~pkal/compat-devel@lists.sr.ht>). Bug reports are best sent to the 1867 issue tracker (https://todo.sr.ht/~pkal/compat) (~pkal/compat@todo.sr.ht 1868 <~pkal/compat@todo.sr.ht>). The GitHub mirror can also be used to 1869 submit patches. These may include issues in the compatibility code, 1870 missing definitions or performance issues. 1871 1872 Please note that as a GNU ELPA package, Compat requires contributors 1873 to have signed the FSF copyright assignment 1874 (https://www.gnu.org/software/emacs/manual/html_node/emacs/Copyright-Assignment.html), 1875 before any non-trivial contribution (roughly 15 lines of code) can be 1876 applied. 1877 1878 1879 File: compat.info, Node: Function Index, Next: Variable Index, Prev: Development, Up: Top 1880 1881 Appendix A Function Index 1882 ************************* 1883 1884 1885 * Menu: 1886 1887 * alist-get: Emacs 25.1. (line 50) 1888 * always: Emacs 28.1. (line 61) 1889 * and-let*: Emacs 26.1. (line 99) 1890 * bool-vector: Emacs 25.1. (line 166) 1891 * bool-vector-count-consecutive: Emacs 24.4. (line 118) 1892 * bool-vector-count-population: Emacs 24.4. (line 125) 1893 * bool-vector-exclusive-or: Emacs 24.4. (line 76) 1894 * bool-vector-intersection: Emacs 24.4. (line 90) 1895 * bool-vector-not: Emacs 24.4. (line 104) 1896 * bool-vector-set-difference: Emacs 24.4. (line 97) 1897 * bool-vector-subsetp: Emacs 24.4. (line 111) 1898 * bool-vector-union: Emacs 24.4. (line 83) 1899 * buffer-local-boundp: Emacs 28.1. (line 99) 1900 * button-buttonize: Emacs 28.1. (line 285) 1901 * color-values-from-color-spec: Emacs 28.1. (line 297) 1902 * compat-<: Emacs 24.4. (line 175) 1903 * compat-<=: Emacs 24.4. (line 185) 1904 * compat-=: Emacs 24.4. (line 170) 1905 * compat->: Emacs 24.4. (line 180) 1906 * compat->=: Emacs 24.4. (line 190) 1907 * compat-alist-get: Emacs 26.1. (line 284) 1908 * compat-assoc: Emacs 26.1. (line 256) 1909 * compat-assoc-delete-all: Emacs 27.1. (line 305) 1910 * compat-count-windows: Emacs 28.1. (line 422) 1911 * compat-dired-get-marked-files: Emacs 27.1. (line 333) 1912 * compat-executable-find: Emacs 27.1. (line 317) 1913 * compat-file-size-human-readable: Emacs 27.1. (line 285) 1914 * compat-json-insert: Emacs 28.1. (line 404) 1915 * compat-json-parse-buffer: Emacs 28.1. (line 416) 1916 * compat-json-parse-string: Emacs 28.1. (line 410) 1917 * compat-json-serialize: Emacs 28.1. (line 398) 1918 * compat-line-number-at-pos: Emacs 26.1. (line 270) 1919 * compat-lookup-key: Emacs 27.1. (line 245) 1920 * compat-recenter: Emacs 27.1. (line 235) 1921 * compat-regexp-opt: Emacs 27.1. (line 273) 1922 * compat-sort: Emacs 25.1. (line 178) 1923 * compat-split-string: Emacs 24.4. (line 199) 1924 * compat-string-trim: Emacs 26.1. (line 314) 1925 * compat-string-trim-left: Emacs 26.1. (line 298) 1926 * compat-string-trim-right: Emacs 26.1. (line 306) 1927 * compat-string-width: Emacs 28.1. (line 381) 1928 * compat-unlock-buffer: Emacs 28.1. (line 368) 1929 * completion-table-with-cache: Emacs 24.4. (line 130) 1930 * cXXXr: Emacs 26.1. (line 47) 1931 * cXXXXr: Emacs 26.1. (line 48) 1932 * date-days-in-month: Emacs 27.1. (line 193) 1933 * decoded-time-day: Emacs 27.1. (line 166) 1934 * decoded-time-dst: Emacs 27.1. (line 178) 1935 * decoded-time-hour: Emacs 27.1. (line 163) 1936 * decoded-time-minute: Emacs 27.1. (line 160) 1937 * decoded-time-month: Emacs 27.1. (line 169) 1938 * decoded-time-period: Emacs 28.1. (line 332) 1939 * decoded-time-second: Emacs 27.1. (line 157) 1940 * decoded-time-weekday: Emacs 27.1. (line 175) 1941 * decoded-time-year: Emacs 27.1. (line 172) 1942 * decoded-time-zone: Emacs 27.1. (line 182) 1943 * define-error: Emacs 24.4. (line 65) 1944 * delete-consecutive-dups: Emacs 24.4. (line 60) 1945 * derived-mode-p: Emacs 27.1. (line 223) 1946 * directory-empty-p: Emacs 28.1. (line 218) 1947 * directory-files-recursively: Emacs 25.1. (line 139) 1948 * directory-name-p: Emacs 25.1. (line 24) 1949 * dlet: Emacs 28.1. (line 117) 1950 * dolist-with-progress-reporter: Emacs 27.1. (line 116) 1951 * ensure-list: Emacs 28.1. (line 132) 1952 * face-spec-set: Emacs 24.4. (line 139) 1953 * file-attribute-access-time: Emacs 26.1. (line 201) 1954 * file-attribute-collect: Emacs 26.1. (line 238) 1955 * file-attribute-device-number: Emacs 26.1. (line 233) 1956 * file-attribute-group-id: Emacs 26.1. (line 196) 1957 * file-attribute-inode-number: Emacs 26.1. (line 228) 1958 * file-attribute-link-number: Emacs 26.1. (line 186) 1959 * file-attribute-modes: Emacs 26.1. (line 223) 1960 * file-attribute-modification-time: Emacs 26.1. (line 206) 1961 * file-attribute-size: Emacs 26.1. (line 218) 1962 * file-attribute-status-change-time: Emacs 26.1. (line 212) 1963 * file-attribute-type: Emacs 26.1. (line 181) 1964 * file-attribute-user-id: Emacs 26.1. (line 191) 1965 * file-backup-file-names: Emacs 28.1. (line 316) 1966 * file-local-name: Emacs 26.1. (line 108) 1967 * file-modes-number-to-symbolic: Emacs 28.1. (line 310) 1968 * file-name-absolute-p: Emacs 28.1. (line 344) 1969 * file-name-concat: Emacs 28.1. (line 31) 1970 * file-name-quote: Emacs 26.1. (line 133) 1971 * file-name-quoted-p: Emacs 26.1. (line 126) 1972 * file-name-with-extension: Emacs 28.1. (line 200) 1973 * flatten-tree: Emacs 27.1. (line 129) 1974 * format-message: Emacs 25.1. (line 12) 1975 * format-prompt: Emacs 28.1. (line 229) 1976 * func-arity: Emacs 26.1. (line 12) 1977 * garbage-collect-maybe: Emacs 28.1. (line 46) 1978 * gensym: Emacs 26.1. (line 51) 1979 * if-let: Emacs 25.1. (line 67) 1980 * if-let*: Emacs 26.1. (line 90) 1981 * ignore-errors: Emacs 27.1. (line 103) 1982 * image-property: Emacs 26.1. (line 175) 1983 * insert-into-buffer: Emacs 28.1. (line 66) 1984 * json-insert: Emacs 27.1. (line 57) 1985 * json-parse-buffer: Emacs 27.1. (line 94) 1986 * json-parse-string: Emacs 27.1. (line 64) 1987 * json-serialize: Emacs 27.1. (line 42) 1988 * length<: Emacs 28.1. (line 23) 1989 * length=: Emacs 28.1. (line 20) 1990 * length>: Emacs 28.1. (line 28) 1991 * macroexp-file-name: Emacs 28.1. (line 267) 1992 * macroexpand-1: Emacs 25.1. (line 132) 1993 * macrop: Emacs 24.4. (line 47) 1994 * make-directory-autoloads: Emacs 28.1. (line 293) 1995 * make-lock-file-name: Emacs 28.1. (line 324) 1996 * make-nearby-temp-file: Emacs 26.1. (line 61) 1997 * mapcan: Emacs 26.1. (line 34) 1998 * named-let: Emacs 28.1. (line 182) 1999 * null-device: Emacs 28.1. (line 328) 2000 * package-get-version: Emacs 27.1. (line 185) 2001 * proper-list-p: Emacs 27.1. (line 12) 2002 * provided-mode-derived-p: Emacs 27.1. (line 219) 2003 * read-multiple-choice: Emacs 26.1. (line 151) 2004 * replace-regexp-in-string: Emacs 28.1. (line 91) 2005 * replace-string-in-region: Emacs 28.1. (line 76) 2006 * setq-local: Emacs 27.1. (line 258) 2007 * special-form-p: Emacs 24.4. (line 41) 2008 * string-chop-newline: Emacs 28.1. (line 177) 2009 * string-clean-whitespace: Emacs 28.1. (line 145) 2010 * string-distance: Emacs 27.1. (line 22) 2011 * string-fill: Emacs 28.1. (line 152) 2012 * string-greaterp: Emacs 25.1. (line 32) 2013 * string-lines: Emacs 28.1. (line 160) 2014 * string-pad: Emacs 28.1. (line 168) 2015 * string-replace: Emacs 28.1. (line 55) 2016 * string-search: Emacs 28.1. (line 12) 2017 * string-suffix-p: Emacs 24.4. (line 53) 2018 * subr-primitive-p: Emacs 28.1. (line 337) 2019 * temporary-file-directory: Emacs 26.1. (line 78) 2020 * thing-at-mouse: Emacs 28.1. (line 260) 2021 * thread-first: Emacs 25.1. (line 90) 2022 * thread-last: Emacs 25.1. (line 111) 2023 * time-equal-p: Emacs 27.1. (line 188) 2024 * when-let: Emacs 25.1. (line 85) 2025 * when-let*: Emacs 26.1. (line 94) 2026 * with-environment-variables: Emacs 28.1. (line 271) 2027 * with-eval-after-load: Emacs 24.4. (line 12) 2028 * with-existing-directory: Emacs 28.1. (line 106) 2029 * with-file-modes: Emacs 25.1. (line 39) 2030 * xor: Emacs 27.1. (line 139) 2031 2032 2033 File: compat.info, Node: Variable Index, Prev: Function Index, Up: Top 2034 2035 Appendix B Variable Index 2036 ************************* 2037 2038 2039 * Menu: 2040 2041 * exec-path: Emacs 27.1. (line 200) 2042 * gensym-counter: Emacs 26.1. (line 58) 2043 * mounted-file-systems: Emacs 26.1. (line 74) 2044 * regexp-unmatchable: Emacs 27.1. (line 149) 2045 2046 2047 2048 Tag Table: 2049 Node: Top821 2050 Node: Introduction2274 2051 Node: Overview2433 2052 Node: Usage3656 2053 Node: Additional libraries4663 2054 Node: Intentions5118 2055 Node: Support6728 2056 Node: Emacs 24.47310 2057 Node: Emacs 25.117364 2058 Node: Emacs 26.126321 2059 Node: Emacs 27.140419 2060 Node: Emacs 28.155775 2061 Node: Development75469 2062 Node: Function Index76484 2063 Node: Variable Index87168 2064 2065 End Tag Table 2066 2067 2068 Local Variables: 2069 coding: utf-8 2070 End: