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