compat.info (132858B)
1 This is doc0jZUSv.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: doc0jZUSv.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.4.1. 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 * Limitations:: 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: doc0jZUSv.info, Node: Introduction, Next: Support, Prev: Top, Up: Top 72 73 1 Introduction 74 ************** 75 76 * Menu: 77 78 * Overview:: 79 * Usage:: 80 * Limitations:: 81 82 83 File: doc0jZUSv.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. By using Compat, an Elisp package does not have to make 90 the decision to either use new and useful functionality or support old 91 versions of Emacs. 92 93 The library provides support back until Emacs 24.4. The intended 94 audience are package developers that are interested in using newer 95 developments, without having to break compatibility. 96 97 98 File: doc0jZUSv.info, Node: Usage, Next: Limitations, Prev: Overview, Up: Introduction 99 100 1.2 Usage 101 ========= 102 103 The intended use-case for this library is for package developers to add 104 as a dependency in the header: 105 106 ;; Package-Requires: ((emacs "24.4") (compat "29.1.4.1")) 107 108 There is no need to depend on ‘emacs’ 24.4 specifically. One can 109 choose to any newer version, if features not provided by Compat 110 necessitate it, for example bug fixes or UI improvements. 111 112 In any file where compatibility forms are used, a 113 114 (require 'compat) 115 116 should be added early on. In packages which are part of Emacs itself 117 and which want to take advantage of Compat, the ‘noerror’ flag should be 118 specified: ‘(require 'compat nil 'noerror)’. In the future a minimal 119 version of Compat may be added to the Emacs core, such that the 120 ‘noerror’ flag will not be necessary anymore. 121 122 This will load all necessary Compat definitions. Compat also loads 123 the ‘seq’ library which is preloaded by default on Emacs 29. Note that 124 if Compat is installed on a recent version of Emacs, all of the 125 definitions are disabled at compile time, such that no negative 126 performance impact is incurred. 127 128 Note that Compat provides replacement functions with extended 129 functionality for functions that are already defined (‘sort’, ‘assoc’, 130 ...). These functions may have changed their calling convention 131 (additional optional arguments) or may have changed their behavior. 132 These functions must be looked up explicitly with ‘compat-function’ or 133 called explicitly with ‘compat-call’. We call them “Extended 134 Definitions”. In contrast, newly “Added Definitions” can be called as 135 usual. 136 137 (compat-call assoc key alist testfn) ;; Call extended `assoc' 138 (mapcan fun seq) ;; Call newly added `mapcan' 139 140 -- Macro: compat-call fun &rest args 141 This macro calls the compatibility function FUN with ARGS. Many 142 functions provided by Compat can be called directly without this 143 macro. However in the case where Compat provides an alternative 144 version of an existing function, the function call has to go 145 through ‘compat-call’. This happens for example when the calling 146 convention of a function has changed. 147 148 -- Macro: compat-function fun 149 This macro returns the compatibility function symbol for FUN. See 150 ‘compat-call’ for a more convenient macro to directly call 151 compatibility functions. 152 153 If Compat is used in core packages, where Compat must be required 154 currently with the ‘noerror’ flag, the macros ‘compat-call’ and 155 ‘compat-function’ ar not available. In the future the macros could be 156 added to subr. Alternatively a minimal version of compat.el could be 157 added to the core. For now it is necessary to replicate the definition 158 of the macros within core packages. For example the package ERC defines 159 its own macro ‘erc-compat-call’, which replicates the Compat definition 160 precisely. 161 162 This design has been chosen since Compat does not advise or override 163 existing functions. Generally Compat is written in defensive style 164 which is supposed to reduce potential breakage, and to increase the 165 chances of staying binary compatible across releases. The extensive 166 test coverage ensures that we can maintain high quality, which is 167 crucial for Compat which is not restricted to a namespace like usual 168 libraries. 169 170 If you intend to use a compatibility function in your code it is 171 recommended that you take a look at the test suite ‘compat-tests.el’. 172 There you can see the supported calling conventions, which are 173 guaranteed to work on the supported Emacs versions. We ensure this 174 using continuous integration. All functions provided by Compat are 175 covered by the test suite. There is a link to the corresponding test on 176 the first line of each definition. 177 178 You may want to subscribe to the compat-announce 179 (https://lists.sr.ht/~pkal/compat-announce) mailing list to be notified 180 when new versions are released or relevant changes are made. We also 181 provide a development mailing list 182 (https://lists.sr.ht/~pkal/compat-devel) (~pkal/compat-devel@lists.sr.ht 183 <~pkal/compat-devel@lists.sr.ht>). 184 185 186 File: doc0jZUSv.info, Node: Limitations, Prev: Usage, Up: Introduction 187 188 1.3 Limitations 189 =============== 190 191 The Compat library has a number of limitations. Complete backwards 192 compatibility cannot be provided due to the scope of Compat and for 193 technical reasons. The scope is intentionally restricted in order to 194 limit the size of Compat and to ensure that the library stays 195 maintainable. 196 197 Emacs version 24.4 is chosen as the oldest version supported by 198 Compat, since Elisp has seen significant changes at that version. On 199 the library level, subr-x was introduced in 24.4. Most popular Emacs 200 packages already require 24.4 or even newer versions of Emacs. 201 Supporting for more historical Emacs versions would complicate 202 maintainance significantly while only few packages and users would 203 benefit. 204 205 Below we list a number of reasons why certain functionality cannot be 206 provided. Note that in some special cases exceptions can be made and 207 functions can still be added to Compat even if they satisfy the criteria 208 from the list. In case you miss functionality which you think should 209 belong here, a *note report: Development. would be much appreciated. 210 211 • The additional functionality is a command or a user-facing minor or 212 major mode. Compat is limited to functionality on the “library 213 level”. Generally functions provided by Compat are 214 non-interactive, such that the user interface (M-x) is unaffected 215 by the presence of Compat. 216 217 • The function is not useful for package authors or not intended to 218 be used by packages, but is only useful on the configuration level. 219 The macro ‘setopt’ is such an example. 220 221 • Private (double dashed) functions are not ported back. If Compat 222 includes some private functions, they are meant purely for internal 223 usage. 224 225 • The added or extended function belongs to the “application level” 226 and not the “library level”. Features which are not preloaded 227 often belong to the “application level”. Application examples are 228 programming modes or modes like Dired, IRC and Gnus. If these 229 modes are extended with new functions, these are not ported back. 230 231 • An existing function or macro was extended by some new 232 functionality. To support these cases, the function or macro would 233 have to be advised. Since this is invasive and adds significant 234 overhead, even when the new feature is not used, Compat does not 235 use advices. As a compromise, compatibility functions and macros 236 with a changed calling convention or behavior can be accessed via 237 the ‘compat-function’ and ‘compat-call’ macros. In this manual we 238 call such definitions “Extended Definitions”. An example is the 239 function ‘plist-get’. Note that extended functions are subject to 240 closer scrutiny, since their usage via ‘compat-call’ is not 241 completely painless. If a particular extended function does not 242 see much usage or the extension yields only marginal benefits, we 243 may not provide it as part of Compat. 244 245 • Bug fixes are usually not ported back as part of Compat. Sometimes 246 library functions show wrong behavior for edge cases. In those 247 cases Compat could in principle provide a compatibility function 248 which is invoked via ‘compat-call’. Such extended definitions 249 would increase the maintainance burden of Compat. At the same time 250 the benefits would be small given that Compat does not override 251 existing definitions. 252 253 • The definition belongs to an Emacs core package, which is also 254 distributed via ELPA. Compat does not have to provide backward 255 compatibility for core packages since the updated package can be 256 installed directly from ELPA. Examples include the libraries xref, 257 project, seq, map and transient. 258 259 • New functionality depends on an entire new, non-trivial core 260 library, which is infeasible to duplicate within Compat. If a 261 backport of such a library is required, the preferred approach is 262 to either release the library separately on GNU ELPA as a core 263 package or as a separately maintained GNU ELPA package. An example 264 is the iso8601 library. 265 266 • New functionality was implemented in the C core, or depends on 267 external libraries that cannot be reasonably duplicated in the 268 scope of a compatibility library. Sometimes new functions on the C 269 level rely on internal data structures, which we cannot access, 270 rendering a backport impossible. For example a missing libxml 271 cannot be emulated. 272 273 • The semantics of Elisp changed on a deep level. For example the 274 addition of Bigint support in Emacs 27.1 cannot be replicated on 275 the level of Compat. 276 277 278 File: doc0jZUSv.info, Node: Support, Next: Development, Prev: Introduction, Up: Top 279 280 2 Support 281 ********* 282 283 This section goes into the features that Compat manages and doesn’t 284 manage to provide for each Emacs version. 285 286 * Menu: 287 288 * Emacs 25.1:: Compatibility support for Emacs 25.1 289 * Emacs 26.1:: Compatibility support for Emacs 26.1 290 * Emacs 27.1:: Compatibility support for Emacs 27.1 291 * Emacs 28.1:: Compatibility support for Emacs 28.1 292 * Emacs 29.1:: Compatibility support for Emacs 29.1 293 294 295 File: doc0jZUSv.info, Node: Emacs 25.1, Next: Emacs 26.1, Up: Support 296 297 2.1 Emacs 25.1 298 ============== 299 300 2.1.1 Added Definitions 301 ----------------------- 302 303 The following functions and macros are implemented in Emacs 25.1. These 304 functions are made available by Compat on Emacs versions older than 305 25.1. 306 307 -- User Option: text-quoting-style 308 The value of this user option is a symbol that specifies the style 309 Emacs should use for single quotes in the wording of help and 310 messages. If the option’s value is ‘curve’, the style is ‘like 311 this’ with curved single quotes. If the value is ‘straight’, the 312 style is 'like this' with straight apostrophes. If the value is 313 ‘grave’, quotes are not translated and the style is `like this' 314 with grave accent and apostrophe, the standard style before Emacs 315 version 25. The default value ‘nil’ acts like ‘curve’ if curved 316 single quotes seem to be displayable, and like ‘grave’ otherwise. 317 318 This option is useful on platforms that have problems with curved 319 quotes. You can customize it freely according to your personal 320 preference. 321 322 -- Function: region-bounds 323 Return the boundaries of the region. Value is a list of one or 324 more cons cells of the form ‘(start . end)’. It will have more 325 than one cons cell when the region is non-contiguous, see 326 ‘region-noncontiguous-p’ and ‘extract-rectangle-bounds’. 327 328 -- Function: region-noncontiguous-p 329 Return non-nil if the region contains several pieces. An example 330 is a rectangular region handled as a list of separate contiguous 331 regions for each line. 332 333 -- Macro: save-mark-and-excursion body... 334 This macro is like ‘save-excursion’, but also saves and restores 335 the mark location and ‘mark-active’. This macro does what 336 ‘save-excursion’ did before Emacs 25.1. 337 338 -- Function: format-message string &rest objects 339 This function acts like ‘format’, except it also converts any grave 340 accents (`) and apostrophes (') in STRING as per the value of 341 ‘text-quoting-style’. 342 343 Typically grave accent and apostrophe in the format translate to 344 matching curved quotes, e.g., "Missing `%s'" might result in 345 "Missing ‘foo’". *Note (elisp)Text Quoting Style::, for how to 346 influence or inhibit this translation. 347 348 *note (elisp)Formatting Strings::. 349 350 -- Function: directory-name-p filename 351 This function returns non-‘nil’ if FILENAME ends with a directory 352 separator character. This is the forward slash ‘/’ on GNU and 353 other POSIX-like systems; MS-Windows and MS-DOS recognize both the 354 forward slash and the backslash ‘\’ as directory separators. 355 356 *Note (elisp)Directory Names::. 357 358 -- Function: string-greaterp string1 string2 359 This function returns the result of comparing STRING1 and STRING2 360 in the opposite order, i.e., it is equivalent to calling 361 ‘(string-lessp STRING2 STRING1)’. 362 363 *Note (elisp)Text Comparison::. 364 365 -- Macro: with-file-modes mode body... 366 This macro evaluates the BODY forms with the default permissions 367 for new files temporarily set to MODES (whose value is as for 368 ‘set-file-modes’ above). When finished, it restores the original 369 default file permissions, and returns the value of the last form in 370 BODY. 371 372 This is useful for creating private files, for example. 373 374 *Note (elisp)Changing Files::. 375 376 -- Function: alist-get key alist &optional default remove 377 This function is similar to ‘assq’. It finds the first association 378 ‘(KEY . VALUE)’ by comparing KEY with ALIST elements, and, if 379 found, returns the VALUE of that association. If no association is 380 found, the function returns DEFAULT. 381 382 This is a generalized variable (*note (elisp)Generalized 383 Variables::) that can be used to change a value with ‘setf’. When 384 using it to set a value, optional argument REMOVE non-‘nil’ means 385 to remove KEY’s association from ALIST if the new value is ‘eql’ to 386 DEFAULT. 387 388 *note (elisp)Association Lists::. 389 390 -- Macro: if-let (bindings...) then &rest else... 391 As with ‘let*’, BINDINGS will consist of ‘(SYMBOL VALUE-FORM)’ 392 entries that are evaluated and bound sequentially. If all 393 VALUE-FORM evaluate to non-‘nil’ values, then THEN is evaluated as 394 were the case with a regular ‘let*’ expression, with all the 395 variables bound. If any VALUE-FORM evaluates to ‘nil’, ELSE is 396 evaluated, without any bound variables. 397 398 A binding may also optionally drop the SYMBOL, and simplify to 399 ‘(VALUE-FORM)’ if only the test is of interest. 400 401 For the sake of backwards compatibility, it is possible to write a 402 single binding without a binding list: 403 404 (if-let* (SYMBOL (test)) foo bar) 405 ≡ 406 (if-let* ((SYMBOL (test))) foo bar) 407 408 -- Macro: when-let (bindings...) &rest body 409 As with ‘when’, if one is only interested in the case where all 410 BINDINGS are non-nil. Otherwise BINDINGS are interpreted just as 411 they are by ‘if-let*’. 412 413 -- Function: hash-table-empty hash-table 414 Check whether HASH-TABLE is empty (has 0 elements). 415 416 -- Macro: thread-first &rest forms 417 Combine FORMS into a single expression by “threading” each element 418 as the _first_ argument of their successor. Elements of FORMS can 419 either be an list of an atom. 420 421 For example, consider the threading expression and it’s equivalent 422 macro expansion: 423 424 (thread-first 425 5 426 (+ 20) 427 (/ 25) 428 - 429 (+ 40)) 430 ≡ 431 (+ (- (/ (+ 5 20) 25)) 40) 432 433 Note how the single ‘-’ got converted into a list before threading. 434 This example uses arithmetic functions, but ‘thread-first’ is not 435 restricted to arithmetic or side-effect free code. 436 437 -- Macro: thread-last &rest forms 438 Combine FORMS into a single expression by “threading” each element 439 as the _last_ argument of their successor. Elements of FORMS can 440 either be an list of an atom. 441 442 For example, consider the threading expression and it’s equivalent 443 macro expansion: 444 445 (thread-first 446 5 447 (+ 20) 448 (/ 25) 449 - 450 (+ 40)) 451 ≡ 452 (+ 40 (- (/ 25 (+ 20 5)))) 453 454 Note how the single ‘-’ got converted into a list before threading. 455 This example uses arithmetic functions, but ‘thread-last’ is not 456 restricted to arithmetic or side-effect free code. 457 458 -- Function: macroexpand-1 form &optional environment 459 This function expands macros like ‘macroexpand’, but it only 460 performs one step of the expansion: if the result is another macro 461 call, ‘macroexpand-1’ will not expand it. 462 463 *Note Expansion: (elisp)Expansion. 464 465 -- Function: macroexp-quote e 466 Return an expression E such that ‘(eval e)’ is V. 467 468 -- Function: macroexp-parse body 469 Parse a function BODY into ‘(declarations . exps)’. 470 471 -- Function: bool-vector &rest objects 472 This function creates and returns a bool-vector whose elements are 473 the arguments, OBJECTS. 474 475 *Note (elisp)Bool-Vectors::. 476 477 2.1.2 Extended Definitions 478 -------------------------- 479 480 These functions must be called explicitly via ‘compat-call’, since their 481 calling convention or behavior was extended in Emacs 25.1: 482 483 -- Function: compat-call sort sequence predicate 484 This function sorts SEQUENCE stably. Note that this function 485 doesn’t work for all sequences; it may be used only for lists and 486 vectors. If SEQUENCE is a list, it is modified destructively. 487 This functions returns the sorted SEQUENCE and compares elements 488 using PREDICATE. A stable sort is one in which elements with equal 489 sort keys maintain their relative order before and after the sort. 490 Stability is important when successive sorts are used to order 491 elements according to different criteria. 492 493 *Note (elisp)Sequence Functions::. 494 495 The compatibility version adds support for vectors to be sorted, 496 not just lists. 497 498 2.1.3 Missing Definitions 499 ------------------------- 500 501 Compat does not provide support for the following Lisp features 502 implemented in 25.1: 503 504 • The function ‘macroexp-macroexpand’. 505 • The macro ‘macroexp-let2*’. 506 • The function ‘directory-files-recursively’. 507 • New ‘pcase’ patterns. 508 • The hook ‘prefix-command-echo-keystrokes-functions’ and 509 ‘prefix-command-preserve-state-hook’. 510 • The hook ‘pre-redisplay-functions’. 511 • The function ‘make-process’. 512 • Support for the variable ‘inhibit-message’. 513 • The ‘define-inline’ functionality. 514 • The functions ‘string-collate-lessp’ and ‘string-collate-equalp’. 515 • The function ‘funcall-interactively’. 516 • The function ‘buffer-substring-with-bidi-context’. 517 • The function ‘font-info’. 518 • The function ‘default-font-width’. 519 • The function ‘window-font-height’ and ‘window-font-width’. 520 • The function ‘window-max-chars-per-line’. 521 • The function ‘set-binary-mode’. 522 • The functions ‘bufferpos-to-filepos’ and ‘filepos-to-bufferpos’. 523 • The ‘thunk’ library. 524 525 526 File: doc0jZUSv.info, Node: Emacs 26.1, Next: Emacs 27.1, Prev: Emacs 25.1, Up: Support 527 528 2.2 Emacs 26.1 529 ============== 530 531 2.2.1 Added Definitions 532 ----------------------- 533 534 The following functions and macros are implemented in Emacs 26.1. These 535 functions are made available by Compat on Emacs versions older than 536 26.1. 537 538 -- Function: assoc-delete-all key alist 539 This function is like ‘assq-delete-all’ except that it uses ‘equal’ 540 to compare elements. 541 542 -- Function: read-answer question answers 543 This function prompts the user with text in QUESTION, which should 544 end in the ‘SPC’ character. The function includes in the prompt 545 the possible responses in ANSWERS by appending them to the end of 546 QUESTION. The possible responses are provided in ANSWERS as an 547 alist whose elements are of the following form: 548 549 (LONG-ANSWER SHORT-ANSWER HELP-MESSAGE) 550 551 where LONG-ANSWER is the complete text of the user response, a 552 string; SHORT-ANSWER is a short form of the same response, a single 553 character or a function key; and HELP-MESSAGE is the text that 554 describes the meaning of the answer. If the variable 555 ‘read-answer-short’ is non-‘nil’, the prompt will show the short 556 variants of the possible answers and the user is expected to type 557 the single characters/keys shown in the prompt; otherwise the 558 prompt will show the long variants of the answers, and the user is 559 expected to type the full text of one of the answers and end by 560 pressing <RET>. If ‘use-dialog-box’ is non-‘nil’, and this 561 function was invoked by mouse events, the question and the answers 562 will be displayed in a GUI dialog box. 563 564 The function returns the text of the LONG-ANSWER selected by the 565 user, regardless of whether long or short answers were shown in the 566 prompt and typed by the user. 567 568 Here is an example of using this function: 569 570 (let ((read-answer-short t)) 571 (read-answer "Foo " 572 '(("yes" ?y "perform the action") 573 ("no" ?n "skip to the next") 574 ("all" ?! "perform for the rest without more questions") 575 ("help" ?h "show help") 576 ("quit" ?q "exit")))) 577 578 -- Function: mapcan function sequence 579 This function applies FUNCTION to each element of SEQUENCE, like 580 ‘mapcar’, but instead of collecting the results into a list, it 581 returns a single list with all the elements of the results (which 582 must be lists), by altering the results (using ‘nconc’; *note 583 (elisp)Rearrangement::). Like with ‘mapcar’, SEQUENCE can be of 584 any type except a char-table. 585 586 ;; Contrast this: (mapcar #'list '(a b c d)) ⇒ ((a) (b) (c) 587 (d)) ;; with this: (mapcan #'list '(a b c d)) ⇒ (a b c d) 588 589 *Note (elisp)Mapping Functions::. 590 591 -- Function: cXXXr 592 -- Function: cXXXXr 593 *Note (elisp)List Elements::. 594 595 -- Function: gensym &optional prefix 596 This function returns a symbol using ‘make-symbol’, whose name is 597 made by appending ‘gensym-counter’ to PREFIX and incrementing that 598 counter, guaranteeing that no two calls to this function will 599 generate a symbol with the same name. The prefix defaults to 600 ‘"g"’. 601 602 -- Variable: gensym-counter 603 See ‘gensym’. 604 605 -- Function: buffer-hash &optional buffer-or-name 606 Return a hash of BUFFER-OR-NAME. If ‘nil’, this defaults to the 607 current buffer. As opposed to ‘secure-hash’, this function 608 computes the hash based on the internal representation of the 609 buffer, disregarding any coding systems. It’s therefore only 610 useful when comparing two buffers running in the same Emacs, and is 611 not guaranteed to return the same hash between different Emacs 612 versions. It should be somewhat more efficient on larger buffers 613 than ‘secure-hash’ is, and should not allocate more memory. 614 615 -- Macro: file-name-unquote name 616 This macro removes the quotation prefix ‘/:’ from the file NAME, if 617 any. If NAME is a remote file name, the local part of NAME is 618 unquoted. 619 620 -- Function: file-name-quoted-p name 621 This macro returns non-‘nil’, when NAME is quoted with the prefix 622 ‘/:’. If NAME is a remote file name, the local part of NAME is 623 checked. 624 625 *Note (elisp)File Name Expansion::. 626 627 -- Function: file-name-quote name 628 This macro adds the quotation prefix ‘/:’ to the file NAME. For a 629 local file NAME, it prefixes NAME with ‘/:’. If NAME is a remote 630 file name, the local part of NAME (*note (elisp)Magic File Names::) 631 is quoted. If NAME is already a quoted file name, NAME is returned 632 unchanged. 633 634 (substitute-in-file-name (compat-call file-name-quote "bar/~/foo")) ⇒ 635 "/:bar/~/foo" 636 637 (substitute-in-file-name (compat-call file-name-quote "/ssh:host:bar/~/foo")) 638 ⇒ "/ssh:host:/:bar/~/foo" 639 640 The macro cannot be used to suppress file name handlers from magic 641 file names (*note (elisp)Magic File Names::). 642 643 *Note (elisp)File Name Expansion::. 644 645 -- Function: make-nearby-temp-file prefix &optional dir-flag suffix 646 This function is similar to ‘make-temp-file’, but it creates a 647 temporary file as close as possible to ‘default-directory’. If 648 PREFIX is a relative file name, and ‘default-directory’ is a remote 649 file name or located on a mounted file systems, the temporary file 650 is created in the directory returned by the function 651 ‘temporary-file-directory’. Otherwise, the function 652 ‘make-temp-file’ is used. PREFIX, DIR-FLAG and SUFFIX have the 653 same meaning as in ‘make-temp-file’. 654 655 (let ((default-directory "/ssh:remotehost:")) (make-nearby-temp-file 656 "foo")) ⇒ "/ssh:remotehost:/tmp/foo232J6v" 657 658 -- Variable: mounted-file-systems 659 A regular expression matching files names that are probably on a 660 mounted file system. 661 662 -- Function: temporary-file-directory 663 The directory for writing temporary files via 664 ‘make-nearby-temp-file’. In case of a remote ‘default-directory’, 665 this is a directory for temporary files on that remote host. If 666 such a directory does not exist, or ‘default-directory’ ought to be 667 located on a mounted file system (see ‘mounted-file-systems’), the 668 function returns ‘default-directory’. For a non-remote and 669 non-mounted ‘default-directory’, the value of the variable 670 ‘temporary-file-directory’ is returned. 671 672 *Note (elisp)Unique File Names::. 673 674 -- Macro: if-let* (bindings...) then &rest else 675 ‘if-let*’ is mostly equivalent to ‘if-let’, with the exception that 676 the legacy ‘(if (VAR (test)) foo bar)’ syntax is not permitted. 677 678 -- Macro: when-let* (bindings...) then &rest else 679 ‘when-let*’ is mostly equivalent to ‘when-let’, with the exception 680 that the legacy ‘(when-let (VAR (test)) foo bar)’ syntax is not 681 permitted. 682 683 -- Macro: and-let* (bindings...) &rest body 684 A combination of LET* and AND, analogous to ‘when-let*’. If all 685 BINDINGS are non-‘nil’ and BODY is ‘nil’, then the result of the 686 ‘and-let*’ form will be the last value bound in BINDINGS. 687 688 **Please Note:** The implementation provided by Compat does not 689 include a bug that was observed with Emacs 26 (see 690 <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31840>). 691 692 -- Function: file-local-name filename 693 This function returns the _local part_ of FILENAME. This is the 694 part of the file’s name that identifies it on the remote host, and 695 is typically obtained by removing from the remote file name the 696 parts that specify the remote host and the method of accessing it. 697 For example: 698 699 (file-local-name "/ssh:USER@HOST:/foo/bar") ⇒ 700 "/foo/bar" 701 702 For a remote FILENAME, this function returns a file name which 703 could be used directly as an argument of a remote process (*note 704 (elisp)Asynchronous Processes::, and *note (elisp)Synchronous 705 Processes::), and as the program to run on the remote host. If 706 FILENAME is local, this function returns it unchanged. 707 708 *Note (elisp)Magic File Names::. 709 710 -- Function: read-multiple-choice prompt choices 711 Ask user a multiple choice question. PROMPT should be a string 712 that will be displayed as the prompt. 713 714 CHOICES is an alist where the first element in each entry is a 715 character to be entered, the second element is a short name for the 716 entry to be displayed while prompting (if there’s room, it might be 717 shortened), and the third, optional entry is a longer explanation 718 that will be displayed in a help buffer if the user requests more 719 help. 720 721 See *note Reading One Event: (elisp)Reading One Event. 722 723 -- Function: image-property 724 Defined in ‘image.el’. 725 726 This function can also be used as a generalised variable. 727 728 -- Function: file-attribute-type 729 Return the field _type_ as generated by ‘file-attributes’. 730 731 *Note (elisp)File Attributes::. 732 733 -- Function: file-attribute-link-number 734 Return the field _link-number_ as generated by ‘file-attributes’. 735 736 *Note (elisp)File Attributes::. 737 738 -- Function: file-attribute-user-id 739 Return the field _user-id_ as generated by ‘file-attributes’. 740 741 *Note (elisp)File Attributes::. 742 743 -- Function: file-attribute-group-id 744 Return the field _group-id_ as generated by ‘file-attributes’. 745 746 *Note (elisp)File Attributes::. 747 748 -- Function: file-attribute-access-time 749 Return the field _access-time_ as generated by ‘file-attributes’. 750 751 *Note (elisp)File Attributes::. 752 753 -- Function: file-attribute-modification-time 754 Return the field _modification-time_ as generated by 755 ‘file-attributes’. 756 757 *Note (elisp)File Attributes::. 758 759 -- Function: file-attribute-status-change-time 760 Return the field _modification-time_ as generated by 761 ‘file-attributes’. 762 763 *Note (elisp)File Attributes::. 764 765 -- Function: file-attribute-size 766 Return the field _size_ as generated by ‘file-attributes’. 767 768 *Note (elisp)File Attributes::. 769 770 -- Function: file-attribute-modes 771 Return the field _modes_ as generated by ‘file-attributes’. 772 773 *Note (elisp)File Attributes::. 774 775 -- Function: file-attribute-inode-number 776 Return the field _inode-number_ as generated by ‘file-attributes’. 777 778 *Note (elisp)File Attributes::. 779 780 -- Function: file-attribute-device-number 781 Return the field _device-number_ as generated by ‘file-attributes’. 782 783 *Note (elisp)File Attributes::. 784 785 -- Function: file-attribute-collect attributes &rest attr-names 786 Filter the file attributes ATTRIBUTES, as generated by 787 ‘file-attributes’, according to ATTR-NAMES. 788 789 Valid attribute names for ATTR-NAMES are: type, link-number, 790 user-id, group-id, access-time, modification-time, 791 status-change-time, size, modes, inode-number and device-number. 792 793 (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) 794 (file-attribute-collect (file-attributes ".") 'type 'modes 795 'inode-number) ⇒ (t "drwxr-xr-x" 137819) 796 797 2.2.2 Extended Definitions 798 -------------------------- 799 800 These functions must be called explicitly via ‘compat-call’, since their 801 calling convention or behavior was extended in Emacs 26.1: 802 803 -- Function: compat-call make-temp-file prefix &optional dir-flag 804 suffix text 805 This function creates a temporary file and returns its name. Emacs 806 creates the temporary file’s name by adding to PREFIX some random 807 characters that are different in each Emacs job. The result is 808 guaranteed to be a newly created file, containing TEXT if that’s 809 given as a string and empty otherwise. On MS-DOS, this function 810 can truncate PREFIX to fit into the 8+3 file-name limits. If 811 PREFIX is a relative file name, it is expanded against 812 ‘temporary-file-directory’. 813 814 The compatibility version adds support for handling the optional 815 argument TEXT. 816 817 (make-temp-file "foo") 818 ⇒ "/tmp/foo232J6v" 819 820 When ‘make-temp-file’ returns, the file has been created and is 821 empty. At that point, you should write the intended contents into 822 the file. 823 824 If DIR-FLAG is non-‘nil’, ‘make-temp-file’ creates an empty 825 directory instead of an empty file. It returns the file name, not 826 the directory name, of that directory. *Note (elisp)Directory 827 Names::. 828 829 If SUFFIX is non-‘nil’, ‘make-temp-file’ adds it at the end of the 830 file name. 831 832 If TEXT is a string, ‘make-temp-file’ inserts it in the file. 833 834 To prevent conflicts among different libraries running in the same 835 Emacs, each Lisp program that uses ‘make-temp-file’ should have its 836 own PREFIX. The number added to the end of PREFIX distinguishes 837 between the same application running in different Emacs jobs. 838 Additional added characters permit a large number of distinct names 839 even in one Emacs job. 840 841 -- Function: compat-call assoc key alist &optional testfn 842 This function returns the first association for KEY in ALIST, 843 comparing KEY against the alist elements using TESTFN if it is a 844 function, and ‘equal’ otherwise (*note (elisp)Equality 845 Predicates::). If TESTFN is a function, it is called with two 846 arguments: the CAR of an element from ALIST and KEY. The function 847 returns ‘nil’ if no association in ALIST has a CAR equal to KEY, as 848 tested by TESTFN. 849 850 *Note (elisp)Association Lists::. 851 852 The compatibility version adds support for handling the optional 853 argument TESTFN. 854 855 -- Function: compat-call line-number-at-pos &optional pos absolute 856 This function returns the line number in the current buffer 857 corresponding to the buffer position POS. If POS is ‘nil’ or 858 omitted, the current buffer position is used. If ABSOLUTE is 859 ‘nil’, the default, counting starts at ‘(point-min)’, so the value 860 refers to the contents of the accessible portion of the 861 (potentially narrowed) buffer. If ABSOLUTE is non-‘nil’, ignore 862 any narrowing and return 863 864 *Note (elisp)Text Lines::. 865 866 The compatibility version adds support for handling the optional 867 argument ABSOLUTE. 868 869 -- Function: compat-call alist-get key alist &optional default remove 870 testfn 871 *Note (elisp)Association Lists::. This function is similar to 872 ‘assq’. It finds the first association ‘(KEY . VALUE)’ by 873 comparing KEY with ALIST elements, and, if found, returns the VALUE 874 of that association. If no association is found, the function 875 returns DEFAULT. Comparison of KEY against ALIST elements uses the 876 function specified by TESTFN, defaulting to ‘eq’. 877 878 *Note (elisp)Association Lists::. 879 880 The compatibility version handles the optional argument TESTFN. It 881 can also be used as a *note Generalized Variables: 882 (elisp)generalised variable. 883 884 -- Function: compat-call string-trim-left string &optional regexp 885 Remove the leading text that matches REGEXP from STRING. REGEXP 886 defaults to ‘[ \t\n\r]+’. 887 888 *Note (elisp)Creating Strings::. 889 890 The compatibility version handles the optional argument REGEXP. 891 892 -- Function: compat-call string-trim-right string &optional regexp 893 Remove the trailing text that matches REGEXP from STRING. REGEXP 894 defaults to ‘[ \t\n\r]+’. 895 896 *Note (elisp)Creating Strings::. 897 898 The compatibility version handles the optional argument REGEXP. 899 900 -- Function: compat-call string-trim string &optional trim-left 901 trim-right 902 Remove the leading text that matches TRIM-LEFT and trailing text 903 that matches TRIM-RIGHT from STRING. Both regexps default to ‘[ 904 \t\n\r]+’. 905 906 *Note (elisp)Creating Strings::. 907 908 The compatibility version handles the optional arguments TRIM-LEFT 909 and TRIM-RIGHT. 910 911 2.2.3 Missing Definitions 912 ------------------------- 913 914 Compat does not provide support for the following Lisp features 915 implemented in 26.1: 916 917 • The function ‘func-arity’. 918 • The function ‘secure-hash-algorithms’. 919 • The function ‘gnutls-available-p’. 920 • Support for records and record functions. 921 • The function ‘mapbacktrace’. 922 • The function ‘file-name-case-insensitive-p’. 923 • The additional elements of ‘parse-partial-sexp’. 924 • The function ‘add-variable-watcher’. 925 • The function ‘undo-amalgamate-change-group’. 926 • The function ‘char-from-name’ 927 • Signalling errors when ‘length’ or ‘member’ deal with list cycles. 928 • The function ‘frame-list-z-order’. 929 • The function ‘frame-restack’. 930 • All changes related to ‘display-buffer’. 931 • The function ‘window-swap-states’. 932 • The function ‘string-version-lessp’. 933 • The ‘svg’ library. 934 • The ‘xdg’ library. 935 936 937 File: doc0jZUSv.info, Node: Emacs 27.1, Next: Emacs 28.1, Prev: Emacs 26.1, Up: Support 938 939 2.3 Emacs 27.1 940 ============== 941 942 2.3.1 Added Definitions 943 ----------------------- 944 945 The following functions and macros are implemented in Emacs 27.1. These 946 functions are made available by Compat on Emacs versions older than 947 27.1. 948 949 -- Function: major-mode-suspend 950 This function works like ‘fundamental-mode’, in that it kills all 951 buffer-local variables, but it also records the major mode in 952 effect, so that it could subsequently be restored. This function 953 and ‘major-mode-restore’ (described next) are useful when you need 954 to put a buffer under some specialized mode other than the one 955 Emacs chooses for it automatically, but would also like to be able 956 to switch back to the original mode later. 957 958 -- Function: major-mode-restore &optional avoided-modes 959 This function restores the major mode recorded by 960 ‘major-mode-suspend’. If no major mode was recorded, this function 961 calls ‘normal-mode’, but tries to force it not to choose any modes 962 in AVOIDED-MODES, if that argument is non-‘nil’. 963 964 -- Function: ring-resize ring size 965 Set the size of RING to SIZE. If the new size is smaller, then the 966 oldest items in the ring are discarded. 967 968 -- Function: minibuffer-history-value 969 Return the value of the minibuffer input history list. If 970 MINIBUFFER-HISTORY-VARIABLE points to a buffer-local variable and 971 the minibuffer is active, return the buffer-local value for the 972 buffer that was current when the minibuffer was activated." 973 974 -- Macro: with-minibuffer-selected-window &rest body 975 Execute the forms in BODY from the minibuffer in its original 976 window. When used in a minibuffer window, select the window 977 selected just before the minibuffer was activated, and execute the 978 forms. 979 980 -- Function: read-char-from-minibuffer prompt &optional chars history 981 This function uses the minibuffer to read and return a single 982 character. Optionally, it ignores any input that is not a member 983 of CHARS, a list of accepted characters. The HISTORY argument 984 specifies the history list symbol to use; if it is omitted or 985 ‘nil’, this function doesn’t use the history. 986 987 If you bind ‘help-form’ to a non-‘nil’ value while calling 988 ‘read-char-from-minibuffer’, then pressing ‘help-char’ causes it to 989 evaluate ‘help-form’ and display the result. 990 991 -- Function: bignump object 992 This predicate tests whether its argument is a large integer, and 993 returns ‘t’ if so, ‘nil’ otherwise. Unlike small integers, large 994 integers can be ‘=’ or ‘eql’ even if they are not ‘eq’. 995 996 -- Function: fixnump object 997 This predicate tests whether its argument is a small integer, and 998 returns ‘t’ if so, ‘nil’ otherwise. Small integers can be compared 999 with ‘eq’. 1000 1001 -- Special Form: with-suppressed-warnings warnings body... 1002 In execution, this is equivalent to ‘(progn BODY...)’, but the 1003 compiler does not issue warnings for the specified conditions in 1004 BODY. WARNINGS is an association list of warning symbols and 1005 function/variable symbols they apply to. For instance, if you wish 1006 to call an obsolete function called ‘foo’, but want to suppress the 1007 compilation warning, say: 1008 1009 (with-suppressed-warnings ((obsolete foo)) 1010 (foo ...)) 1011 1012 -- Function: proper-list-p object 1013 This function returns the length of OBJECT if it is a proper list, 1014 ‘nil’ otherwise (*note (elisp)Cons Cells::). In addition to 1015 satisfying ‘listp’, a proper list is neither circular nor dotted. 1016 1017 (proper-list-p '(a b c)) ⇒ 3 1018 (proper-list-p '(a b . c)) ⇒ nil 1019 1020 *Note (elisp)List-related Predicates::. 1021 1022 -- Function: string-distance string1 string2 &optional bytecompare 1023 This function returns the _Levenshtein distance_ between the source 1024 string STRING1 and the target string STRING2. The Levenshtein 1025 distance is the number of single-character changes—deletions, 1026 insertions, or replacements—required to transform the source string 1027 into the target string; it is one possible definition of the _edit 1028 distance_ between strings. 1029 1030 Letter-case of the strings is significant for the computed 1031 distance, but their text properties are ignored. If the optional 1032 argument BYTECOMPARE is non-‘nil’, the function calculates the 1033 distance in terms of bytes instead of characters. The byte-wise 1034 comparison uses the internal Emacs representation of characters, so 1035 it will produce inaccurate results for multibyte strings that 1036 include raw bytes (*note (elisp)Text Representations::); make the 1037 strings unibyte by encoding them (*note (elisp)Explicit Encoding::) 1038 if you need accurate results with raw bytes. 1039 1040 *Note (elisp)Text Comparison::. 1041 1042 -- Macro: ignore-errors body... 1043 This construct executes BODY, ignoring any errors that occur during 1044 its execution. If the execution is without error, ‘ignore-errors’ 1045 returns the value of the last form in BODY; otherwise, it returns 1046 ‘nil’. 1047 1048 Here’s the example at the beginning of this subsection rewritten 1049 using ‘ignore-errors’: 1050 1051 (ignore-errors (delete-file filename)) 1052 1053 *Note (elisp)Handling Errors::. 1054 1055 -- Macro: dolist-with-progress-reporter (var count [result]) 1056 reporter-or-message body... 1057 This is another convenience macro that works the same way as 1058 ‘dolist’ does, but also reports loop progress using the functions 1059 described above. As in ‘dotimes-with-progress-reporter’, 1060 ‘reporter-or-message’ can be a progress reporter or a string. You 1061 can rewrite the previous example with this macro as follows: 1062 1063 (dolist-with-progress-reporter (k (number-sequence 0 500)) "Collecting 1064 some mana for Emacs..." (sit-for 0.01)) 1065 1066 *Note (elisp)Progress::. 1067 1068 -- Function: flatten-tree tree 1069 This function returns a “flattened” copy of TREE, that is, a list 1070 containing all the non-‘nil’ terminal nodes, or leaves, of the tree 1071 of cons cells rooted at TREE. Leaves in the returned list are in 1072 the same order as in TREE. 1073 1074 (flatten-tree '(1 (2 . 3) nil (4 5 (6)) 7)) ⇒(1 2 3 4 5 6 7) 1075 1076 *Note (elisp)Building Lists::. 1077 1078 -- Function: xor condition1 condition2 1079 This function returns the boolean exclusive-or of CONDITION1 and 1080 CONDITION2. That is, ‘xor’ returns ‘nil’ if either both arguments 1081 are ‘nil’, or both are non-‘nil’. Otherwise, it returns the value 1082 of that argument which is non-‘nil’. 1083 1084 Note that in contrast to ‘or’, both arguments are always evaluated. 1085 1086 *Note (elisp)Combining Conditions::. 1087 1088 -- Variable: regexp-unmatchable 1089 This variable contains a regexp that is guaranteed not to match any 1090 string at all. It is particularly useful as default value for 1091 variables that may be set to a pattern that actually matches 1092 something. 1093 1094 *Note (elisp)Regexp Functions:: 1095 1096 -- Function: decoded-time-second time 1097 Return the SECONDS field of a ‘decoded-time’ record TIME. It can 1098 also be used as a *note Generalized Variables: (elisp)generalised 1099 variable. 1100 1101 -- Function: decoded-time-minute time 1102 Return the MINUTE field of a ‘decoded-time’ record TIME. It can 1103 also be used as a *note Generalized Variables: (elisp)generalised 1104 variable. 1105 1106 -- Function: decoded-time-hour time 1107 Return the HOUR field of a ‘decoded-time’ record TIME. It can also 1108 be used as a *note Generalized Variables: (elisp)generalised 1109 variable. 1110 1111 -- Function: decoded-time-day time 1112 Return the DAY field of a ‘decoded-time’ record TIME. It can also 1113 be used as a *note Generalized Variables: (elisp)generalised 1114 variable. 1115 1116 -- Function: decoded-time-month time 1117 Return the MONTH field of a ‘decoded-time’ record TIME. It can 1118 also be used as a *note Generalized Variables: (elisp)generalised 1119 variable. 1120 1121 -- Function: decoded-time-year time 1122 Return the YEAR field of a ‘decoded-time’ record TIME. It can also 1123 be used as a *note Generalized Variables: (elisp)generalised 1124 variable. 1125 1126 -- Function: decoded-time-weekday time 1127 Return the WEEKDAY field of a ‘decoded-time’ record TIME. It can 1128 also be used as a *note Generalized Variables: (elisp)generalised 1129 variable. 1130 1131 -- Function: decoded-time-dst time 1132 Return the DST (daylight saving time indicator) field of a 1133 ‘decoded-time’ record TIME. It can also be used as a *note 1134 Generalized Variables: (elisp)generalised variable. 1135 1136 -- Function: decoded-time-zone time 1137 Return the ZONE field of a ‘decoded-time’ record TIME. It can also 1138 be used as a *note Generalized Variables: (elisp)generalised 1139 variable. 1140 1141 -- Function: package-get-version 1142 Return the version number of the package in which this is used. 1143 1144 -- Function: time-equal-p t1 t2 1145 This returns ‘t’ if the two time values T1 and T2 are equal. 1146 1147 *Note (elisp)Time Calculations::. 1148 1149 -- Function: date-days-in-month year month 1150 Return the number of days in MONTH in YEAR. For instance, February 1151 2020 has 29 days. 1152 1153 *Note (elisp)Time Calculations::. This function requires the 1154 ‘time-date’ feature to be loaded. 1155 1156 -- Function: date-ordinal-to-time year ordinal 1157 Convert a YEAR/ORDINAL to the equivalent decoded-time structure. 1158 ORDINAL is the number of days since the start of the year, with 1159 January 1st being 1. 1160 1161 *Note (elisp)Time Calculations::. This function requires the 1162 ‘time-date’ feature to be loaded. 1163 1164 -- User Option: exec-path 1165 The value of this variable is a list of directories to search for 1166 programs to run in subprocesses. Each element is either the name 1167 of a directory (i.e., a string), or ‘nil’, which stands for the 1168 default directory (which is the value of ‘default-directory’). 1169 *Note executable-find: (elisp)Locating Files, for the details of 1170 this search. 1171 1172 The value of ‘exec-path’ is used by ‘call-process’ and 1173 ‘start-process’ when the PROGRAM argument is not an absolute file 1174 name. 1175 1176 Generally, you should not modify ‘exec-path’ directly. Instead, 1177 ensure that your ‘PATH’ environment variable is set appropriately 1178 before starting Emacs. Trying to modify ‘exec-path’ independently 1179 of ‘PATH’ can lead to confusing results. 1180 1181 *Note (elisp)Subprocess Creation::. 1182 1183 -- Function: provided-mode-derived-p mode &rest modes 1184 This function returns non-‘nil’ if MODE is derived from any of the 1185 major modes given by the symbols MODES. 1186 1187 -- Function: file-size-human-readable-iec size 1188 Human-readable string for SIZE bytes, using IEC prefixes. 1189 1190 -- Function: make-empty-file filename &optional parents 1191 This function creates an empty file named FILENAME. As 1192 ‘make-directory’, this function creates parent directories if 1193 PARENTS is non-‘nil’. If FILENAME already exists, this function 1194 signals an error. 1195 1196 -- Function: text-property-search-forward prop &optional value 1197 predicate not-current 1198 Search for the next region that has text property PROP set to VALUE 1199 according to PREDICATE. 1200 1201 This function is modeled after ‘search-forward’ and friends in that 1202 it moves point, but it returns a structure that describes the match 1203 instead of returning it in ‘match-beginning’ and friends. 1204 1205 If the text property can’t be found, the function returns ‘nil’. 1206 If it’s found, point is placed at the end of the region that has 1207 this text property match, and a ‘prop-match’ structure is returned. 1208 1209 PREDICATE can either be ‘t’ (which is a synonym for ‘equal’), ‘nil’ 1210 (which means “not equal”), or a predicate that will be called with 1211 two parameters: The first is VALUE, and the second is the value of 1212 the text property we’re inspecting. 1213 1214 If NOT-CURRENT, if point is in a region where we have a match, then 1215 skip past that and find the next instance instead. 1216 1217 The ‘prop-match’ structure has the following accessors: 1218 ‘prop-match-beginning’ (the start of the match), ‘prop-match-end’ 1219 (the end of the match), and ‘prop-match-value’ (the value of 1220 PROPERTY at the start of the match). 1221 1222 In the examples below, imagine that you’re in a buffer that looks 1223 like this: 1224 1225 This is a bold and here's bolditalic and this is the end. 1226 1227 That is, the “bold” words are the ‘bold’ face, and the “italic” 1228 word is in the ‘italic’ face. 1229 1230 With point at the start: 1231 1232 (while (setq match (text-property-search-forward 'face 'bold t)) 1233 (push (buffer-substring (prop-match-beginning match) 1234 (prop-match-end match)) 1235 words)) 1236 1237 This will pick out all the words that use the ‘bold’ face. 1238 1239 (while (setq match (text-property-search-forward 'face nil t)) 1240 (push (buffer-substring (prop-match-beginning match) 1241 (prop-match-end match)) 1242 words)) 1243 1244 This will pick out all the bits that have no face properties, which 1245 will result in the list ‘("This is a " "and here's " "and this is 1246 the end")’ (only reversed, since we used ‘push’). 1247 1248 (while (setq match (text-property-search-forward 'face nil nil)) 1249 (push (buffer-substring (prop-match-beginning match) 1250 (prop-match-end match)) 1251 words)) 1252 1253 This will pick out all the regions where ‘face’ is set to 1254 something, but this is split up into where the properties change, 1255 so the result here will be ‘("bold" "bold" "italic")’. 1256 1257 For a more realistic example where you might use this, consider 1258 that you have a buffer where certain sections represent URLs, and 1259 these are tagged with ‘shr-url’. 1260 1261 (while (setq match (text-property-search-forward 'shr-url nil nil)) 1262 (push (prop-match-value match) urls)) 1263 1264 This will give you a list of all those URLs. 1265 1266 *Note (Property Search)elisp::. 1267 1268 -- Function: text-property-search-backward prop &optional value 1269 predicate not-current 1270 This is just like ‘text-property-search-forward’, but searches 1271 backward instead. Point is placed at the beginning of the matched 1272 region instead of the end, though. 1273 1274 *Note (Property Search)elisp::. 1275 1276 2.3.2 Extended Definitions 1277 -------------------------- 1278 1279 These functions must be called explicitly via ‘compat-call’, since their 1280 calling convention or behavior was extended in Emacs 27.1: 1281 1282 -- Function: compat-call recenter &optional count redisplay 1283 This function scrolls the text in the selected window so that point 1284 is displayed at a specified vertical position within the window. 1285 It does not move point with respect to the text. 1286 1287 *Note (elisp)Textual Scrolling::. 1288 1289 This compatibility version adds support for the optional argument 1290 REDISPLAY. 1291 1292 -- Function: compat-call lookup-key keymap key &optional 1293 accept-defaults 1294 This function returns the definition of KEY in KEYMAP. If the 1295 string or vector KEY is not a valid key sequence according to the 1296 prefix keys specified in KEYMAP, it must be too long and have extra 1297 events at the end that do not fit into a single key sequence. Then 1298 the value is a number, the number of events at the front of KEY 1299 that compose a complete key. 1300 1301 *Note (elisp)Low-Level Key Binding::. 1302 1303 This compatibility version allows for KEYMAP to be a list of 1304 keymaps, instead of just a singular keymap. 1305 1306 -- Macro: compat-call setq-local &rest pairs 1307 PAIRS is a list of variable and value pairs. This macro creates a 1308 buffer-local binding in the current buffer for each of the 1309 variables, and gives them a buffer-local value. It is equivalent 1310 to calling ‘make-local-variable’ followed by ‘setq’ for each of the 1311 variables. The variables should be unquoted symbols. 1312 1313 (setq-local var1 "value1" 1314 var2 "value2") 1315 1316 *Note (elisp)Creating Buffer-Local::. 1317 1318 This compatibility version allows for more than one variable to be 1319 set at once, as can be done with ‘setq’. 1320 1321 -- Function: compat-call regexp-opt strings &optional paren 1322 This function returns an efficient regular expression that will 1323 match any of the strings in the list STRINGS. This is useful when 1324 you need to make matching or searching as fast as possible—for 1325 example, for Font Lock mode. 1326 1327 *Note (elisp)Regexp Functions::. 1328 1329 The compatibility version of this functions handles the case where 1330 STRINGS in an empty list. In that case, a regular expression is 1331 generated that never matches anything (see ‘regexp-unmatchable’). 1332 1333 -- Function: compat-call file-size-human-readable file-size &optional 1334 flavor space unit 1335 Return a string with a human readable representation of FILE-SIZE. 1336 1337 The optional second argument FLAVOR controls the units and the 1338 display format. If FLAVOR is... 1339 1340 • ‘si’, each kilobyte is 1000 bytes and the produced suffixes 1341 are ‘k’, ‘M’, ‘G’, ‘T’, etc. 1342 • ‘iec’, each kilobyte is 1024 bytes and the produced suffixes 1343 are ‘KiB’, ‘MiB’, ‘GiB’, ‘TiB’, etc. 1344 • ‘nil’ or omitted, each kilobyte is 1024 bytes and the produced 1345 suffixes are ‘k’, ‘M’, ‘G’, ‘T’, etc. 1346 1347 The compatibility version handles the optional third (SPACE) and 1348 forth (UNIT) arguments. The argument SPACE can be a string that is 1349 placed between the number and the unit. The argument UNIT 1350 determines the unit to use. By default it will be an empty string, 1351 unless FLAVOR is ‘iec’, in which case it will be ‘B’. 1352 1353 -- Function: compat-call assoc-delete-all key alist &optional test 1354 This function is like ‘assq-delete-all’ except that it accepts an 1355 optional argument TEST, a predicate function to compare the keys in 1356 ALIST. If omitted or ‘nil’, TEST defaults to ‘equal’. As 1357 ‘assq-delete-all’, this function often modifies the original list 1358 structure of ALIST. 1359 1360 *Note (elisp)Association Lists::. 1361 1362 This compatibility version handles the optional third (TESTFN) 1363 argument. 1364 1365 -- Function: compat-call executable-find program &optional remote 1366 This function searches for the executable file of the named PROGRAM 1367 and returns the absolute file name of the executable, including its 1368 file-name extensions, if any. It returns ‘nil’ if the file is not 1369 found. The function searches in all the directories in 1370 ‘exec-path’, and tries all the file-name extensions in 1371 ‘exec-suffixes’ (*note (elisp)Subprocess Creation::). 1372 1373 If REMOTE is non-‘nil’, and ‘default-directory’ is a remote 1374 directory, PROGRAM is searched on the respective remote host. 1375 1376 *Note (elisp)Locating Files::. 1377 1378 This compatibility version adds support to handle the optional 1379 second (REMOTE) argument. 1380 1381 2.3.3 Missing Definitions 1382 ------------------------- 1383 1384 Compat does not provide support for the following Lisp features 1385 implemented in 27.1: 1386 1387 • The functions ‘base64url-encode-*’. 1388 • The function ‘decoded-time-add’. 1389 • The function ‘decoded-time-set-defaults’. 1390 • The function ‘time-convert’. 1391 • The macro ‘benchmark-progn’. 1392 • Support for ‘condition-case’ to handle t. 1393 • The function ‘file-system-info’. 1394 • The function ‘group-name’. 1395 • The function ‘face-extend-p’ and ‘set-face-extend’. 1396 • Additional ‘format-spec’ modifiers. 1397 • Support for additional body forms for 1398 ‘define-globalized-minor-mode’. 1399 • The macro ‘with-connection-local-variables’ and related 1400 functionality. 1401 • The ‘iso8601’ library. 1402 • The ‘exif’ library. 1403 • The ‘image-converter’ library. 1404 1405 1406 File: doc0jZUSv.info, Node: Emacs 28.1, Next: Emacs 29.1, Prev: Emacs 27.1, Up: Support 1407 1408 2.4 Emacs 28.1 1409 ============== 1410 1411 2.4.1 Added Definitions 1412 ----------------------- 1413 1414 The following functions and macros are implemented in Emacs 28.1. These 1415 functions are made available by Compat on Emacs versions older than 1416 28.1. 1417 1418 The ‘defcustom’ type ‘natnum’ introduced in Emacs 28.1 is made 1419 available by Compat. 1420 1421 -- Function: process-lines-ignore-status program &rest args 1422 This function is just like ‘process-lines’, but does not signal an 1423 error if PROGRAM exits with a non-zero exit status. 1424 1425 -- Function: process-lines-handling-status program status-handler &rest 1426 args 1427 Execute PROGRAM with ARGS, returning its output as a list of lines. 1428 If STATUS-HANDLER is non-nil, it must be a function with one 1429 argument, which will be called with the exit status of the program 1430 before the output is collected. If STATUS-HANDLER is nil, an error 1431 is signaled if the program returns with a non-zero exit status. 1432 1433 -- Function: text-quoting-style 1434 You should not read the value of the variable ‘text-quoting-style’ 1435 directly. Instead, use this function with the same name to 1436 dynamically compute the correct quoting style on the current 1437 terminal in the ‘nil’ case described above. 1438 1439 -- Function: string-search needle haystack &optional start-pos 1440 Return the position of the first instance of NEEDLE in HAYSTACK, 1441 both of which are strings. If START-POS is non-‘nil’, start 1442 searching from that position in NEEDLE. Return ‘nil’ if no match 1443 was found. This function only considers the characters in the 1444 strings when doing the comparison; text properties are ignored. 1445 Matching is always case-sensitive. 1446 1447 -- Function: length= sequence length 1448 Return non-‘nil’ if the length of SEQUENCE is equal to LENGTH. 1449 1450 -- Function: length< sequence length 1451 Return non-‘nil’ if SEQUENCE is shorter than LENGTH. This may be 1452 more efficient than computing the length of SEQUENCE if SEQUENCE is 1453 a long list. 1454 1455 -- Function: length> sequence length 1456 Return non-‘nil’ if SEQUENCE is longer than LENGTH. 1457 1458 -- Function: file-name-concat directory &rest components 1459 Concatenate COMPONENTS to DIRECTORY, inserting a slash before the 1460 components if DIRECTORY or the preceding component didn’t end with 1461 a slash. 1462 1463 (file-name-concat "/tmp" "foo") ⇒ "/tmp/foo" 1464 1465 A DIRECTORY or components that are ‘nil’ or the empty string are 1466 ignored—they are filtered out first and do not affect the results 1467 in any way. 1468 1469 This is almost the same as using ‘concat’, but DIRNAME (and the 1470 non-final components) may or may not end with slash characters, and 1471 this function will not double those characters. 1472 1473 -- Function: garbage-collect-maybe factor 1474 Suggest to run garbage collection, if _enough_ data has been 1475 allocated. This is determined by the positive numerical argument 1476 FACTOR, that would proportionally increase the likelihood of 1477 garbage collection taking place. 1478 1479 This compatibility function does nothing and ignores any 1480 suggestion. 1481 1482 -- Function: string-replace from-string to-string in-string 1483 This function replaces all occurrences of FROM-STRING with 1484 TO-STRING in IN-STRING and returns the result. It may return one 1485 of its arguments unchanged, a constant string or a new string. 1486 Case is significant, and text properties are ignored. 1487 1488 -- Function: always &rest arguments 1489 This function ignores any ARGUMENTS and returns ‘t’. 1490 1491 *Note (elisp)Calling Functions::. 1492 1493 -- Function: make-separator-line &optional length 1494 Make a string appropriate for usage as a visual separator line. If 1495 LENGTH is nil, use the window width. 1496 1497 -- Function: insert-into-buffer to-buffer &optional start end 1498 This is like ‘insert-buffer-substring’, but works in the opposite 1499 direction: The text is copied from the current buffer into 1500 TO-BUFFER. The block of text is copied to the current point in 1501 TO-BUFFER, and point (in that buffer) is advanced to after the end 1502 of the copied text. Is ‘start’/‘end’ is ‘nil’, the entire text in 1503 the current buffer is copied over. 1504 1505 *Note (elisp)Insertion::. 1506 1507 -- Function: replace-string-in-region regexp replacement &optional 1508 start end 1509 This function replaces all the occurrences of REGEXP with 1510 REPLACEMENT in the region of buffer text between START and END; 1511 START defaults to position of point, and END defaults to the last 1512 accessible position of the buffer. The search for REGEXP is 1513 case-sensitive, and REPLACEMENT is inserted without changing its 1514 letter-case. The REPLACEMENT string can use the same special 1515 elements starting with ‘\’ as ‘replace-match’ does. The function 1516 returns the number of replaced occurrences, or ‘nil’ if REGEXP is 1517 not found. The function preserves the position of point. 1518 1519 (replace-regexp-in-region "foo[ \t]+bar" "foobar") 1520 *Note (elisp)Search and Replace::. 1521 1522 -- Function: replace-regexp-in-string string replacement &optional 1523 start end 1524 This function works similarly to ‘replace-regexp-in-region’, but 1525 searches for, and replaces, literal STRINGs instead of regular 1526 expressions. 1527 1528 *Note (elisp)Search and Replace::. 1529 1530 -- Function: buffer-local-boundp variable buffer 1531 This returns non-‘nil’ if there’s either a buffer-local binding of 1532 VARIABLE (a symbol) in buffer BUFFER, or VARIABLE has a global 1533 binding. 1534 1535 *Note (elisp)Creating Buffer-Local::. 1536 1537 -- Macro: with-existing-directory body... 1538 This macro ensures that ‘default-directory’ is bound to an existing 1539 directory before executing BODY. If ‘default-directory’ already 1540 exists, that’s preferred, and otherwise some other directory is 1541 used. This macro can be useful, for instance, when calling an 1542 external command that requires that it’s running in a directory 1543 that exists. The chosen directory is not guaranteed to be 1544 writable. 1545 1546 *Note (elisp)Testing Accessibility::. 1547 1548 -- Macro: dlet (bindings...) forms... 1549 This special form is like ‘let’, but it binds all variables 1550 dynamically. This is rarely useful—you usually want to bind normal 1551 variables lexically, and special variables (i.e., variables that 1552 are defined with ‘defvar’) dynamically, and this is what ‘let’ 1553 does. 1554 1555 ‘dlet’ can be useful when interfacing with old code that assumes 1556 that certain variables are dynamically bound (*note (elisp)Dynamic 1557 Binding::), but it’s impractical to ‘defvar’ these variables. 1558 ‘dlet’ will temporarily make the bound variables special, execute 1559 the forms, and then make the variables non-special again. 1560 1561 *Note (elisp)Local Variables::. 1562 1563 -- Function: ensure-list object 1564 This function returns OBJECT as a list. If OBJECT is already a 1565 list, the function returns it; otherwise, the function returns a 1566 one-element list containing OBJECT. 1567 1568 This is usually useful if you have a variable that may or may not 1569 be a list, and you can then say, for instance: 1570 1571 (dolist (elem (ensure-list foo)) 1572 (princ elem)) 1573 1574 *Note (elisp)Building Lists::. 1575 1576 -- Function: string-clean-whitespace string 1577 Clean up the whitespace in STRING by collapsing stretches of 1578 whitespace to a single space character, as well as removing all 1579 whitespace from the start and the end of STRING. 1580 1581 *Note (elisp)Creating Strings::. 1582 1583 -- Function: string-fill string length 1584 Attempt to Word-wrap STRING so that no lines are longer than 1585 LENGTH. Filling is done on whitespace boundaries only. If there 1586 are individual words that are longer than LENGTH, these will not be 1587 shortened. 1588 1589 *Note (elisp)Creating Strings::. 1590 1591 -- Function: string-lines string &optional omit-nulls 1592 Split STRING into a list of strings on newline boundaries. If the 1593 optional argument OMIT-NULLS is non-‘nil’, remove empty lines from 1594 the results. Note that this function returns trailing newlines on 1595 Emacs 28, use ‘compat-call string-lines’ instead if you want 1596 consistent behavior. 1597 1598 -- Function: string-pad string length &optional padding start 1599 Pad STRING to be of the given LENGTH using PADDING as the padding 1600 character. PADDING defaults to the space character. If STRING is 1601 longer than LENGTH, no padding is done. If START is ‘nil’ or 1602 omitted, the padding is appended to the characters of STRING, and 1603 if it’s non-‘nil’, the padding is prepended to STRING’s characters. 1604 1605 *Note (elisp)Creating Strings::. 1606 1607 -- Function: string-chop-newline string 1608 Remove the final newline, if any, from STRING. 1609 1610 *Note (elisp)Creating Strings::. 1611 1612 -- Macro: named-let name bindings &rest body 1613 This special form is a looping construct inspired from the Scheme 1614 language. It is similar to ‘let’: It binds the variables in 1615 BINDINGS, and then evaluates BODY. However, ‘named-let’ also binds 1616 NAME to a local function whose formal arguments are the variables 1617 in BINDINGS and whose body is BODY. This allows BODY to call 1618 itself recursively by calling NAME, where the arguments passed to 1619 NAME are used as the new values of the bound variables in the 1620 recursive invocation. 1621 1622 Recursive calls to NAME that occur in _tail positions_ in BODY are 1623 guaranteed to be optimized as _tail calls_, which means that they 1624 will not consume any additional stack space no matter how deeply 1625 the recursion runs. Such recursive calls will effectively jump to 1626 the top of the loop with new values for the variables. 1627 1628 *Note (elisp)Local Variables::. 1629 1630 -- Function: file-name-with-extension filename extension 1631 This function returns FILENAME with its extension set to EXTENSION. 1632 A single leading dot in the EXTENSION will be stripped if there is 1633 one. For example: 1634 1635 (file-name-with-extension "file" "el") 1636 ⇒ "file.el" 1637 (file-name-with-extension "file" ".el") 1638 ⇒ "file.el" 1639 (file-name-with-extension "file.c" "el") 1640 ⇒ "file.el" 1641 1642 Note that this function will error if FILENAME or EXTENSION are 1643 empty, or if the FILENAME is shaped like a directory (i.e., if 1644 ‘directory-name-p’ returns non-‘nil’). 1645 1646 *Note File Name Components: (elisp)File Name Components. 1647 1648 -- Function: directory-empty-p directory 1649 This utility function returns ‘t’ if given DIRECTORY is an 1650 accessible directory and it does not contain any files, i.e., is an 1651 empty directory. It will ignore ‘.’ and ‘..’ on systems that 1652 return them as files in a directory. 1653 1654 Symbolic links to directories count as directories. See 1655 FILE-SYMLINK-P to distinguish symlinks. 1656 1657 *Note (elisp)Contents of Directories::. 1658 1659 -- Function: format-prompt prompt default &rest format-args 1660 Format PROMPT with default value DEFAULT according to the 1661 ‘minibuffer-default-prompt-format’ variable. 1662 1663 ‘minibuffer-default-prompt-format’ is a format string (defaulting 1664 to ‘" (default %s)"’ that says how the “default” bit in prompts 1665 like ‘"Local filename (default somefile): "’ are to be formatted. 1666 1667 To allow the users to customize how this is displayed, code that 1668 prompts the user for a value (and has a default) should look 1669 something along the lines of this code snippet: 1670 1671 (read-file-name 1672 (format-prompt "Local filename" file) 1673 nil file) 1674 1675 If FORMAT-ARGS is ‘nil’, PROMPT is used as a literal string. If 1676 FORMAT-ARGS is non-‘nil’, PROMPT is used as a format control 1677 string, and PROMPT and FORMAT-ARGS are passed to ‘format’ (*note 1678 (elisp)Formatting Strings::). 1679 1680 ‘minibuffer-default-prompt-format’ can be ‘""’, in which case no 1681 default values are displayed. 1682 1683 If DEFAULT is ‘nil’, there is no default value, and therefore no 1684 “default value” string is included in the result value. If DEFAULT 1685 is a non-‘nil’ list, the first element of the list is used in the 1686 prompt. 1687 1688 *Note (elisp)Text from Minibuffer::. 1689 1690 -- Function: thing-at-mouse event thing &optional no-properties 1691 Mouse-EVENT equivalent of ‘thing-at-point’. THING can be ‘symbol’, 1692 ‘list’, ‘sexp’, ‘filename’, ‘url’, ... among other things. 1693 1694 When NO-PROPERTIES has a non-‘nil’ value, any text properties that 1695 might have been present in the buffer are stripped away. 1696 1697 -- Function: bounds-of-thing-at-mouse event thing 1698 Determine start and end locations for THING at mouse click given by 1699 EVENT. Like ‘bounds-of-thing-at-point’, but tries to use the 1700 position in EVENT where the mouse button is clicked to find the 1701 thing nearby. 1702 1703 -- Function: mark-thing-at-mouse click thing 1704 Activate the region around THING found near the mouse CLICK. 1705 1706 -- Function: macroexp-file-name 1707 Return the name of the file in which the code is currently being 1708 evaluated, or ‘nil’ if it cannot be determined. 1709 1710 -- Function: macroexp-warn-and-return msg form &optional category 1711 compile-only arg 1712 Return code equivalent to ‘form’ labeled with warning ‘msg’. 1713 1714 -- Macro: with-environment-variables variables body... 1715 This macro sets the environment variables according to VARIABLES 1716 temporarily when executing BODY. The previous values are restored 1717 when the form finishes. The argument VARIABLES should be a list of 1718 pairs of strings of the form ‘(VAR VALUE)’, where VAR is the name 1719 of the environment variable and VALUE is that variable’s value. 1720 1721 (with-environment-variables (("LANG" "C") 1722 ("LANGUAGE" "en_US:en")) 1723 (call-process "ls" nil t)) 1724 1725 *Note System Environment: (elisp)System Environment. 1726 1727 -- Function: color-dark-p rgb 1728 Whether RGB is more readable against white than black. RGB is a 1729 3-element list (R G B), each component in the range [0,1]. This 1730 predicate can be used both for determining a suitable (black or 1731 white) contrast color with RGB as background and as foreground. 1732 1733 -- Function: color-values-from-color-spec spec 1734 Convert the textual color specification SPEC to a color triple 1735 ‘(RED GREEN blue)’. Each of RED, GREEN and ‘blue’ is a integer 1736 value between 0 and 65535. 1737 1738 The specification SPEC can be one of the following 1739 • ‘#RGB’, where R, G and B are hex numbers of equal length, 1-4 1740 digits each. 1741 • ‘rgb:R/G/B’, where R, G, and B are hex numbers, 1-4 digits 1742 each. 1743 • ‘rgbi:R/G/B’, where R, G and B are floating-point numbers in 1744 [0,1]. 1745 1746 -- Function: file-modes-number-to-symbolic modes 1747 This function converts a numeric file mode specification in MODES 1748 into the equivalent symbolic form. 1749 1750 *Note Changing Files: (elisp)Changing Files. 1751 1752 -- Function: file-backup-file-names filename 1753 This function returns a list of all the backup file names for 1754 FILENAME, or ‘nil’ if there are none. The files are sorted by 1755 modification time, descending, so that the most recent files are 1756 first. 1757 1758 *Note (elisp)Backup Names::. 1759 1760 -- Function: make-lock-file-name filename 1761 Return a string containing a lock file name for FILENAME, obeying 1762 ‘lock-file-name-transforms’. 1763 1764 -- Function: decoded-time-period time 1765 Interpret TIME as a period and return its length in seconds. For 1766 computational purposes, years are 365 days long and months are 30 1767 days long. 1768 1769 -- Function: subr-primitive-p object 1770 Return ‘t’ if OBJECT is a primitive, built-in function. On systems 1771 with native compilation ‘subrp’ does not distinguish between 1772 built-in functions and functions that have been compiled. If 1773 native compilation is not available, this function behaves 1774 identically to ‘subrp’. 1775 1776 -- Function: subr-native-elisp-p object 1777 Return ‘t’ if OBJECT if the object is native compiled lisp. If 1778 native compilation is not available, this function always returns 1779 ‘nil’. 1780 1781 -- Macro: with-window-non-dedicated window &rest body 1782 Evaluate BODY with WINDOW temporarily made non-dedicated. If 1783 WINDOW is nil, use the selected window. Return the value of the 1784 last form in BODY. 1785 1786 2.4.2 Extended Definitions 1787 -------------------------- 1788 1789 These functions must be called explicitly via ‘compat-call’, since their 1790 calling convention or behavior was extended in Emacs 28.1: 1791 1792 -- Function: compat-call string-width string &optional from to 1793 This function returns the width in columns of the string STRING, if 1794 it were displayed in the current buffer and the selected window. 1795 Optional arguments FROM and TO specify the substring of STRING to 1796 consider, and are interpreted as in ‘substring’ (*note 1797 (elisp)Creating Strings::). 1798 1799 The return value is an approximation: it only considers the values 1800 returned by ‘char-width’ for the constituent characters, always 1801 takes a tab character as taking ‘tab-width’ columns, ignores 1802 display properties and fonts, etc. 1803 1804 *Note (elisp)Size of Displayed Text::. 1805 1806 This compatibility version handles the optional arguments FROM and 1807 TO. 1808 1809 -- Function: compat-call count-windows 1810 Return the number of live windows on the selected frame. 1811 1812 The optional argument MINIBUF specifies whether the minibuffer 1813 window is included in the count. 1814 1815 If ALL-FRAMES is non-‘nil’, count the windows in all frames instead 1816 just the selected frame. 1817 1818 This compatibility version handles the optional argument 1819 ALL-FRAMES. 1820 1821 2.4.3 Missing Definitions 1822 ------------------------- 1823 1824 Compat does not provide support for the following Lisp features 1825 implemented in 28.1: 1826 1827 • Support for ‘interactive’ or ‘declare’ to list applicable modes. 1828 • Support for ‘:interactive’ argument to ‘define-minor-mode’ and 1829 ‘define-derived-mode’. 1830 • Support for ‘:predicate’ argument to 1831 ‘define-globalized-minor-mode’. 1832 • Support for the ‘:success’ handler of ‘condition-case’. 1833 • The function ‘benchmark-call’. 1834 • Additional Edebug keywords. 1835 • The libjansson JSON APIs, e.g., ‘json-parse-string’. 1836 • The macro ‘pcase-setq’. 1837 • The function ‘custom-add-choice’. 1838 • The functions ‘dom-print’ and ‘dom-remove-attribute’. 1839 • The function ‘dns-query-asynchronous’. 1840 • The function ‘get-locale-names’. 1841 • The functions ‘mail-header-parse-addresses-lax’ and 1842 ‘mail-header-parse-address-lax’. 1843 • The function ‘num-processors’. 1844 • The function ‘object-intervals’. 1845 • The function ‘require-theme’. 1846 • The function ‘syntax-class-to-char’. 1847 • The function ‘path-separator’. 1848 • The function ‘null-device’. 1849 • The function ‘macroexp-compiling-p’. 1850 • The function ‘split-string-shell-command’. 1851 • The function ‘string-limit’. 1852 • The functions ‘innermost-minibuffer-p’ and 1853 ‘minibuffer-innermost-command-loop-p’. 1854 • The function ‘max-mini-window-lines’. 1855 • The function ‘lock-file’ and ‘unlock-file’. 1856 • The ‘multisession’ library. 1857 1858 1859 File: doc0jZUSv.info, Node: Emacs 29.1, Prev: Emacs 28.1, Up: Support 1860 1861 2.5 Emacs 29.1 1862 ============== 1863 1864 2.5.1 Added Definitions 1865 ----------------------- 1866 1867 The following functions and macros are implemented in Emacs 29.1. These 1868 functions are made available by Compat on Emacs versions older than 1869 29.1. Note that due to upstream changes, it might happen that there 1870 will be the need for changes, so use these functions with care. 1871 1872 The ‘defcustom’ type ‘key’ introduced in Emacs 28.1 is made available 1873 by Compat. 1874 1875 -- Function: count-sentences start end 1876 Count sentences in current buffer from START to END. 1877 1878 -- Function: readablep object 1879 This predicate says whether OBJECT has “readable syntax”, i.e., it 1880 can be written out and then read back by the Emacs Lisp reader. If 1881 it can’t, this function returns ‘nil’; if it can, this function 1882 returns a printed representation (via ‘prin1’). 1883 1884 -- Function: substitute-quotes string 1885 This function works like ‘substitute-command-keys’, but only 1886 replaces quote characters. 1887 1888 -- Function: get-scratch-buffer-create 1889 Return the *scratch* buffer, creating a new one if needed. 1890 1891 -- Function: use-region-noncontiguous-p 1892 Return non-nil for a non-contiguous region if ‘use-region-p’. 1893 1894 -- Function: use-region-end 1895 Return the end of the region if ‘use-region-p’. 1896 1897 -- Function: use-region-beginning 1898 Return the start of the region if ‘use-region-p’. 1899 1900 -- Macro: buffer-local-set-state variable value... 1901 Minor modes often set buffer-local variables that affect some 1902 features in Emacs. When a minor mode is switched off, the mode is 1903 expected to restore the previous state of these variables. This 1904 convenience macro helps with doing that: It works much like 1905 ‘setq-local’, but returns an object that can be used to restore 1906 these values back to their previous values/states (using the 1907 companion function ‘buffer-local-restore-state’). 1908 1909 -- Function: delete-line 1910 Delete the current line. 1911 1912 -- Function: list-of-strings-p object 1913 Return ‘t’ if OBJECT is ‘nil’ or a list of strings. 1914 1915 -- Function: plistp object 1916 Non-nil if and only if OBJECT is a valid plist. 1917 1918 -- Macro: with-memoization PLACE CODE... 1919 This macro provides a simple way to do memoization. CODE is 1920 evaluated and then stashed in PLACE. If PLACE’s value is 1921 non-‘nil’, return that value instead of evaluating CODE. 1922 1923 -- Special Form: with-restriction start end [:label label] body 1924 This special form saves the current bounds of the accessible 1925 portion of the buffer, sets the accessible portion to start at 1926 START and end at END, evaluates the BODY forms, and restores the 1927 saved bounds. In that case it is equivalent to 1928 1929 (save-restriction 1930 (narrow-to-region start end) 1931 body) 1932 1933 When the optional argument LABEL, a symbol, is present, the 1934 narrowing is “labeled”. A labeled narrowing differs from a 1935 non-labeled one in several ways: 1936 1937 • During the evaluation of the BODY form, ‘narrow-to-region’ and 1938 ‘widen’ can be used only within the START and END limits. 1939 1940 • To lift the restriction introduced by ‘with-restriction’ and 1941 gain access to other portions of the buffer, use 1942 ‘without-restriction’ with the same LABEL argument. (Another 1943 way to gain access to other portions of the buffer is to use 1944 an indirect buffer (*note (elisp)Indirect Buffers::).) 1945 1946 • Labeled narrowings can be nested. 1947 1948 • Labeled narrowings can only be used in Lisp programs: they are 1949 never visible on display, and never interfere with narrowings 1950 set by the user. 1951 1952 If you use ‘with-restriction’ with the optional LABEL argument, we 1953 recommend documenting the LABEL in the doc strings of the functions 1954 which use it, so that other Lisp programs your code calls could 1955 lift the labeled narrowing if and when it needs. 1956 1957 -- Special Form: without-restriction [:label label] body 1958 This special form saves the current bounds of the accessible 1959 portion of the buffer, widens the buffer, evaluates the BODY forms, 1960 and restores the saved bounds. In that case it is equivalent to 1961 1962 (save-restriction 1963 (widen) 1964 body) 1965 1966 When the optional argument LABEL is present, the narrowing set by 1967 ‘with-restriction’ with the same LABEL argument is lifted. 1968 1969 -- Function: pos-bol &optional count 1970 Like ‘line-beginning-position’, but ignores fields (and is more 1971 efficient). 1972 1973 -- Function: pos-eol &optional count 1974 Like ‘line-end-position’, but ignores fields (and is more 1975 efficient). 1976 1977 -- Macro: with-delayed-message (timeout message) body... 1978 Sometimes it’s unclear whether an operation will take a long time 1979 to execute or not, or it can be inconvenient to implement a 1980 progress reporter. This macro can be used in those situations. 1981 1982 (with-delayed-message (2 (format "Gathering data for %s" entry)) 1983 (setq data (gather-data entry))) 1984 1985 In this example, if the body takes more than two seconds to 1986 execute, the message will be displayed. If it takes a shorter time 1987 than that, the message won’t be displayed. In either case, the 1988 body is evaluated as normally, and the return value of the final 1989 element in the body is the return value of the macro. 1990 1991 The MESSAGE element is evaluated before BODY, and is always 1992 evaluated, whether the message is displayed or not. 1993 1994 -- Function: funcall-with-delayed-message timeout message function 1995 Like ‘funcall’, but display MESSAGE if FUNCTION takes longer than 1996 TIMEOUT. TIMEOUT is a number of seconds, and can be an integer or 1997 a floating point number. 1998 1999 If FUNCTION takes less time to execute than TIMEOUT seconds, 2000 MESSAGE is not displayed. 2001 2002 -- Function: buttonize string callback &optional data help-echo 2003 Sometimes it’s more convenient to make a string into a button 2004 without inserting it into a buffer immediately, for instance when 2005 creating data structures that may then, later, be inserted into a 2006 buffer. This function makes STRING into such a string, and 2007 CALLBACK will be called when the user clicks on the button. The 2008 optional DATA parameter will be used as the parameter when CALLBACK 2009 is called. If ‘nil’, the button is used as the parameter instead. 2010 2011 -- Function: buttonize-region start end callback &optional data 2012 help-echo 2013 Make the region between START and END into a button. When clicked, 2014 CALLBACK will be called with the DATA as the function argument. If 2015 DATA isn’t present (or is nil), the button itself will be used 2016 instead as the function argument. If HELP-ECHO, use that as the 2017 help-echo property. 2018 2019 -- Function: get-display-property position prop &optional object 2020 properties 2021 This convenience function can be used to get a specific display 2022 property, no matter whether the ‘display’ property is a vector, a 2023 list or a simple property. This is like ‘get-text-property’ (*note 2024 Examining Properties: (elisp)Examining Properties.), but works on 2025 the ‘display’ property only. 2026 2027 POSITION is the position in the buffer or string to examine, and 2028 PROP is the ‘display’ property to return. The optional OBJECT 2029 argument should be either a string or a buffer, and defaults to the 2030 current buffer. If the optional PROPERTIES argument is non-‘nil’, 2031 it should be a ‘display’ property, and in that case, POSITION and 2032 OBJECT are ignored. (This can be useful if you’ve already gotten 2033 the ‘display’ property with ‘get-char-property’, for instance 2034 (*note Examining Properties: (elisp)Examining Properties.). 2035 2036 -- Function: add-display-text-property start end prop value &optional 2037 object 2038 Add display property PROP with VALUE to the text from START to END. 2039 If any text in the region has a non-nil ‘display’ property, those 2040 properties are retained. 2041 2042 If OBJECT is non-‘nil’, it should be a string or a buffer. If 2043 ‘nil’, this defaults to the current buffer. 2044 2045 -- Function: take n list 2046 This function returns the N first elements of LIST. Essentially, 2047 it returns the part of LIST that ‘nthcdr’ skips. 2048 2049 ‘take’ returns LIST if shorter than N elements; it returns ‘nil’ if 2050 N is zero or negative. 2051 2052 (take 3 '(a b c d)) 2053 ⇒ (a b c) 2054 (take 10 '(a b c d)) 2055 ⇒ (a b c d) 2056 (take 0 '(a b c d)) 2057 ⇒ nil 2058 2059 -- Function: ntake n list 2060 This is a version of ‘take’ that works by destructively modifying 2061 the list structure of the argument. That makes it faster, but the 2062 original value of LIST may be lost. 2063 2064 ‘ntake’ returns LIST unmodified if shorter than N elements; it 2065 returns ‘nil’ if N is zero or negative. Otherwise, it returns LIST 2066 truncated to its first N elements. 2067 2068 This means that it is usually a good idea to use the return value 2069 and not just rely on the truncation effect unless N is known to be 2070 positive. 2071 2072 -- Function: compiled-function-p object 2073 This function returns ‘t’ if OBJECT is a function object that is 2074 not in the form of ELisp source code but something like machine 2075 code or byte code instead. More specifically it returns ‘t’ if the 2076 function is built-in, or byte-compiled, or natively-compiled, or a 2077 function loaded from a dynamic module. 2078 2079 -- Function: function-alias-p object &optional noerror 2080 Checks whether OBJECT is a function alias. If it is, it returns a 2081 list of symbols representing the function alias chain, else ‘nil’. 2082 For instance, if ‘a’ is an alias for ‘b’, and ‘b’ is an alias for 2083 ‘c’: 2084 2085 (function-alias-p 'a) 2086 ⇒ (b c) 2087 2088 If there’s a loop in the definitions, an error will be signalled. 2089 If NOERROR is non-‘nil’, the non-looping parts of the chain is 2090 returned instead. 2091 2092 -- Function: string-equal-ignore-case string1 string2 2093 ‘string-equal-ignore-case’ compares strings ignoring case 2094 differences, like ‘char-equal’ when ‘case-fold-search’ is ‘t’. 2095 2096 *Note (elisp)Text Comparison::. 2097 2098 -- Function: string-split string &optional separators omit-nulls trim 2099 ‘string-split’ is an alias for the function ‘split-string’. The 2100 name follows the convention of other string functions. 2101 2102 *Note (elisp)Creating Strings::. 2103 2104 -- Function: buffer-match-p condition buffer-or-name &optional arg 2105 This function checks if a buffer designated by ‘buffer-or-name’ 2106 satisfies a ‘condition’. Optional third argument ARG is passed to 2107 the predicate function in CONDITION. A condition can be one of the 2108 following: 2109 • A string, interpreted as a regular expression. The buffer 2110 satisfies the condition if the regular expression matches the 2111 buffer name. 2112 • A predicate function, which should return non-‘nil’ if the 2113 buffer matches. If the function expects one argument, it is 2114 called with BUFFER-OR-NAME as the argument; if it expects 2 2115 arguments, the first argument is BUFFER-OR-NAME and the second 2116 is ARG (or ‘nil’ if ARG is omitted). 2117 • A cons-cell ‘(OPER . EXPR)’ where OPER is one of 2118 ‘not’ 2119 Satisfied if EXPR doesn’t satisfy ‘buffer-match-p’ with 2120 the same buffer and ‘arg’. 2121 ‘or’ 2122 Satisfied if EXPR is a list and _any_ condition in EXPR 2123 satisfies ‘buffer-match-p’, with the same buffer and 2124 ‘arg’. 2125 ‘and’ 2126 Satisfied if EXPR is a list and _all_ conditions in EXPR 2127 satisfy ‘buffer-match-p’, with the same buffer and ‘arg’. 2128 ‘derived-mode’ 2129 Satisfied if the buffer’s major mode derives from EXPR. 2130 ‘major-mode’ 2131 Satisfied if the buffer’s major mode is equal to EXPR. 2132 Prefer using ‘derived-mode’ instead when both can work. 2133 • t Satisfied by any buffer. A convenient alternative to ‘""’ 2134 (empty string), ‘(and)’ (empty conjunction) or ‘always’. 2135 2136 *Note (elisp)Buffer List::. 2137 2138 -- Function: match-buffers condition &optional buffers arg 2139 This function returns a list of all buffers that satisfy a 2140 ‘condition’, as defined for ‘buffer-match-p’. By default all 2141 buffers are considered, but this can be restricted via the second 2142 optional ‘buffer-list’ argument. Optional third argument ARG will 2143 be used by CONDITION in the same way as ‘buffer-match-p’ does. 2144 2145 *Note (elisp)Buffer List::. 2146 2147 -- Function: string-glyph-split string 2148 When character compositions are in effect, sequence of characters 2149 can be composed for display to form _grapheme clusters_, for 2150 example to display accented characters, or ligatures, or Emoji, or 2151 when complex text shaping requires that for some scripts. When 2152 that happens, characters no longer map in a simple way to display 2153 columns, and display layout decisions with such strings, such as 2154 truncating too wide strings, can be a complex job. This function 2155 helps in performing suvh jobs: it splits up its argument STRING 2156 into a list of substrings, where each substring produces a single 2157 grapheme cluster that should be displayed as a unit. Lisp programs 2158 can then use this list to construct visually-valid substrings of 2159 STRING which will look correctly on display, or compute the width 2160 of any substring of STRING by adding the width of its constituents 2161 in the returned list, etc. 2162 2163 For instance, if you want to display a string without the first 2164 glyph, you can say: 2165 2166 (apply #'insert (cdr (string-glyph-split string)))) 2167 2168 *Note (elisp)Size of Displayed Text::. 2169 2170 -- Macro: with-buffer-unmodified-if-unchanged &rest body... 2171 Evaluate BODY like ‘progn’, but change buffer-modified status only 2172 if buffer text changes. If the buffer was unmodified before 2173 execution of BODY, and buffer text after execution of BODY is 2174 identical to what it was before, ensure that buffer is still marked 2175 unmodified afterwards. 2176 2177 Note that only changes in the raw byte sequence of the buffer text, 2178 as stored in the internal representation, are monitored for the 2179 purpose of detecting the lack of changes in buffer text. Any other 2180 changes that are normally perceived as "buffer modifications", such 2181 as changes in text properties, ‘buffer-file-coding-system’, buffer 2182 multibyteness, etc. – will not be noticed, and the buffer will 2183 still be marked unmodified, effectively ignoring those changes. 2184 2185 -- Function: file-attribute-file-identifier 2186 Return the fields ‘(inodenum device)’ as a list from attributes 2187 generated by ‘file-attributes’. 2188 2189 *Note (elisp)File Attributes::. 2190 2191 -- Function: file-name-split filename 2192 This function splits a file name into its components, and can be 2193 thought of as the inverse of ‘string-join’ with the appropriate 2194 directory separator. For example, 2195 2196 (file-name-split "/tmp/foo.txt") 2197 ⇒ ("" "tmp" "foo.txt") 2198 (string-join (file-name-split "/tmp/foo.txt") "/") 2199 ⇒ "/tmp/foo.txt" 2200 2201 -- Function: file-name-parent-directory filename 2202 This function returns the directory name of the parent directory of 2203 FILENAME. If FILENAME is at the root directory of the filesystem, 2204 it returns ‘nil’. A relative FILENAME is assumed to be relative to 2205 ‘default-directory’, and the return value will also be relative in 2206 that case. If the return value is non-‘nil’, it ends in a slash. 2207 2208 *Note (elisp)Directory Names::. 2209 2210 -- Function: file-has-changed-p file &optional tag 2211 This function returns non-‘nil’ if the time stamp of FILENAME has 2212 changed since the last call. When called for the first time for 2213 some FILENAME, it records the last modification time and size of 2214 the file, and returns non-‘nil’ when FILENAME exists. Thereafter, 2215 when called for the same FILENAME, it compares the current time 2216 stamp and size with the recorded ones, and returns non-‘nil’ only 2217 if either the time stamp or the size (or both) are different. This 2218 is useful when a Lisp program wants to re-read a file whenever it 2219 changes. With an optional argument TAG, which must be a symbol, 2220 the size and modification time comparisons are limited to calls 2221 with the same tag. 2222 2223 *Note (elisp)File Attributes::. 2224 2225 -- Function: directory-abbrev-make-regexp directory 2226 Create a regexp to match DIRECTORY for ‘directory-abbrev-alist’. 2227 2228 -- Function: directory-abbrev-apply filename 2229 Apply the abbreviations in ‘directory-abbrev-alist’ to FILENAME. 2230 Note that when calling this, you should set ‘case-fold-search’ as 2231 appropriate for the filesystem used for FILENAME. 2232 2233 -- Function: key-valid-p keys 2234 Say whether KEYS is a valid key. A key is a string consisting of 2235 one or more key strokes. The key strokes are separated by single 2236 space characters. 2237 2238 Each key stroke is either a single character, or the name of an 2239 event, surrounded by angle brackets. In addition, any key stroke 2240 may be preceded by one or more modifier keys. Finally, a limited 2241 number of characters have a special shorthand syntax. 2242 2243 Here’s some example key sequences. 2244 2245 ‘f’ 2246 The key ‘f’. 2247 ‘S o m’ 2248 A three key sequence of the keys ‘S’, ‘o’ and ‘m’. 2249 ‘C-c o’ 2250 A two key sequence of the keys ‘c’ with the control modifier 2251 and then the key ‘o’. 2252 ‘H-<left>’ 2253 The key named "left" with the hyper modifier. 2254 ‘M-RET’ 2255 The "return" key with a meta modifier. 2256 ‘C-M-<space>’ 2257 The "space" key with both the control and meta modifiers. 2258 2259 These are the characters that have shorthand syntax: ‘NUL’, ‘RET’, 2260 ‘TAB’, ‘LFD’, ‘ESC’, ‘SPC’, ‘DEL’. 2261 2262 Modifiers have to be specified in this order 2263 Alt (A)-Control (C)-Hyper (H)-Meta (M)-Shift (s)-Super (s) 2264 2265 -- Function: key-parse keys 2266 Convert KEYS to the internal Emacs key representation. See 2267 ‘key-valid-p’ for a description of valid key sequences. Examples 2268 include ‘f’, ‘C-c C-c’, ‘H-<left>’, ‘M-RET’ or ‘C-M-<return>’. 2269 2270 -- Function: keymap-set keymap key definition 2271 This function sets the binding for KEY in KEYMAP. (If KEY is more 2272 than one event long, the change is actually made in another keymap 2273 reached from KEYMAP.) The argument BINDING can be any Lisp object, 2274 but only certain types are meaningful. (For a list of meaningful 2275 types, see *note (elisp)Key Lookup::.) The value returned by 2276 ‘keymap-set’ is BINDING. 2277 2278 If KEY is ‘<t>’, this sets the default binding in KEYMAP. When an 2279 event has no binding of its own, the Emacs command loop uses the 2280 keymap’s default binding, if there is one. 2281 2282 Every prefix of KEY must be a prefix key (i.e., bound to a keymap) 2283 or undefined; otherwise an error is signaled. If some prefix of 2284 KEY is undefined, then ‘keymap-set’ defines it as a prefix key so 2285 that the rest of KEY can be defined as specified. 2286 2287 If there was previously no binding for KEY in KEYMAP, the new 2288 binding is added at the beginning of KEYMAP. The order of bindings 2289 in a keymap makes no difference for keyboard input, but it does 2290 matter for menu keymaps (*note (elisp)Menu Keymaps::). 2291 2292 *Note (elisp)Changing Key Bindings::. 2293 2294 -- Function: keymap-global-set key command 2295 This function sets the binding of KEY in the current global map to 2296 BINDING. 2297 2298 (keymap-global-set KEY BINDING) 2299 ≡ 2300 (keymap-set (current-global-map) KEY BINDING) 2301 2302 *Note (elisp)Key Binding Commands::. 2303 2304 -- Function: keymap-local-set key command 2305 This function sets the binding of KEY in the current local keymap 2306 to BINDING. 2307 2308 (keymap-local-set KEY BINDING) 2309 ≡ 2310 (keymap-set (current-local-map) KEY BINDING) 2311 2312 *Note (elisp)Key Binding Commands::. 2313 2314 -- Function: keymap-global-unset key &optional remove 2315 This function removes the binding of KEY from the current global 2316 map. 2317 2318 One use of this function is in preparation for defining a longer 2319 key that uses KEY as a prefix—which would not be allowed if KEY has 2320 a non-prefix binding. For example: 2321 2322 (keymap-global-unset "C-l") 2323 ⇒ nil 2324 (keymap-global-set "C-l C-l" 'redraw-display) 2325 ⇒ nil 2326 2327 *Note (elisp)Key Binding Commands::. 2328 2329 -- Function: keymap-local-unset key &optional remove 2330 This function removes the binding of KEY from the current local 2331 map. 2332 2333 *Note (elisp)Key Binding Commands::. 2334 2335 -- Function: keymap-substitute keymap olddef newdef &optional oldmap 2336 prefix 2337 Replace OLDDEF with NEWDEF for any keys in KEYMAP now defined as 2338 OLDDEF. In other words, OLDDEF is replaced with NEWDEF wherever it 2339 appears. Alternatively, if optional fourth argument OLDMAP is 2340 specified, we redefine in KEYMAP as NEWDEF those keys that are 2341 defined as OLDDEF in OLDMAP. 2342 2343 -- Function: keymap-lookup keymap key &optional accept-default no-remap 2344 position 2345 This function returns the definition of KEY in KEYMAP. All the 2346 other functions described in this chapter that look up keys use 2347 ‘keymap-lookup’. Here are examples: 2348 2349 (keymap-lookup (current-global-map) "C-x C-f") 2350 ⇒ find-file 2351 (keymap-lookup (current-global-map) "C-x C-f 1 2 3 4 5") 2352 ⇒ 2 2353 2354 *Note (elisp)Functions for Key Lookup::. 2355 2356 -- Function: keymap-local-lookup keys &optional accept-default 2357 Like ‘keymap-lookup’, but restricting the search for commands bound 2358 to KEYS to the current local keymap. 2359 2360 -- Function: keymap-global-lookup keys &optional accept-default 2361 Like ‘keymap-lookup’, but restricting the search for commands bound 2362 to KEYS to the current global keymap. 2363 2364 -- Function: define-keymap &rest definitions 2365 You can create a keymap with the functions described above, and 2366 then use ‘keymap-set’ (*note (elisp)Changing Key Bindings::) to 2367 specify key bindings in that map. When writing modes, however, you 2368 frequently have to bind a large number of keys at once, and using 2369 ‘keymap-set’ on them all can be tedious and error-prone. Instead 2370 you can use ‘define-keymap’, which creates a keymap and binds a 2371 number of keys. Here’s a very basic example: 2372 2373 (define-keymap 2374 "n" #'forward-line 2375 "f" #'previous-line 2376 "C-c C-c" #'quit-window) 2377 2378 This function creates a new sparse keymap, defines the keystrokes 2379 in PAIRS, and returns the new keymap. 2380 2381 PAIRS is a list of alternating key bindings and key definitions, as 2382 accepted by ‘keymap-set’. In addition, the key can be the special 2383 symbol ‘:menu’, in which case the definition should be a menu 2384 definition as accepted by ‘easy-menu-define’ (*note (elisp)Easy 2385 Menu::). Here’s a brief example of this usage: 2386 2387 (define-keymap :full t 2388 "g" #'eww-reload 2389 :menu '("Eww" 2390 ["Exit" quit-window t] 2391 ["Reload" eww-reload t])) 2392 2393 A number of keywords can be used before the key/definition pairs to 2394 change features of the new keymap. If any of the feature keywords 2395 is missing from the ‘define-keymap’ call, the default value for 2396 that feature is ‘nil’. Here’s a list of the available feature 2397 keywords: 2398 2399 ‘:full’ 2400 If non-‘nil’, create a char-table keymap (as from 2401 ‘make-keymap’) instead of a sparse keymap (as from 2402 ‘make-sparse-keymap’ (*note (elisp)Creating Keymaps::). A 2403 sparse keymap is the default. 2404 2405 ‘:parent’ 2406 If non-‘nil’, the value should be a keymap to use as the 2407 parent (*note (elisp)Inheritance and Keymaps::). 2408 2409 ‘:keymap’ 2410 If non-‘nil’, the value should be a keymap. Instead of 2411 creating a new keymap, the specified keymap is modified 2412 instead. 2413 2414 ‘:suppress’ 2415 If non-‘nil’, the keymap will be suppressed with 2416 ‘suppress-keymap’ (*note (elisp)Changing Key Bindings::). By 2417 default, digits and the minus sign are exempt from 2418 suppressing, but if the value is ‘nodigits’, this suppresses 2419 digits and minus-sign like it does with other characters. 2420 2421 ‘:name’ 2422 If non-‘nil’, the value should be a string to use as the menu 2423 for the keymap if you use it as a menu with ‘x-popup-menu’ 2424 (*note (elisp)Pop-Up Menus::). 2425 2426 ‘:prefix’ 2427 If non-‘nil’, the value should be a symbol to be used as a 2428 prefix command (*note (elisp)Prefix Keys::). If this is the 2429 case, this symbol is returned by ‘define-keymap’ instead of 2430 the map itself. 2431 2432 -- Function: defvar-keymap (variable-name &rest defs) 2433 By far, the most common thing to do with a keymap is to bind it to 2434 a variable. This is what virtually all modes do—a mode called 2435 ‘foo’ almost always has a variable called ‘foo-mode-map’. 2436 2437 This macro defines NAME as a variable, passes OPTIONS and PAIRS to 2438 ‘define-keymap’, and uses the result as the default value for the 2439 variable. 2440 2441 OPTIONS is like the keywords in ‘define-keymap’, but there’s an 2442 additional ‘:doc’ keyword that provides the doc string for the 2443 defined variable. 2444 2445 Here’s an example: 2446 2447 (defvar-keymap eww-textarea-map 2448 :parent text-mode-map 2449 "RET" #'forward-line 2450 "TAB" #'shr-next-link) 2451 2452 -- Macro: while-let spec then-forms... 2453 Like ‘when-let’, but repeat until a binding in SPEC is ‘nil’. The 2454 return value is always ‘nil’. 2455 2456 This is comparable to ‘and-let*’. 2457 2458 -- Macro: ert-with-temp-file name &rest body 2459 Bind NAME to the name of a new temporary file and evaluate BODY. 2460 Delete the temporary file after BODY exits normally or non-locally. 2461 NAME will be bound to the file name of the temporary file. See the 2462 docstring for supported keyword arguments. 2463 2464 -- Macro: ert-with-temp-directory name &rest body 2465 Bind NAME to the name of a new temporary directory and evaluate 2466 BODY. Delete the temporary directory after BODY exits normally or 2467 non-locally. 2468 2469 NAME is bound to the directory name, not the directory file name. 2470 (In other words, it will end with the directory delimiter; on 2471 Unix-like systems, it will end with "/".) 2472 2473 The same keyword arguments are supported as in ‘ert-with-temp-file’ 2474 (which see), except for ‘:text’. 2475 2476 -- Function: cl-constantly value 2477 Return a function that takes any number of arguments, but returns 2478 VALUE. 2479 2480 -- Macro: cl-with-gensyms names... body 2481 This macro expands to code that executes BODY with each of the 2482 variables in NAMES bound to a fresh uninterned symbol, or “gensym”, 2483 in Common Lisp parlance. For macros requiring more than one 2484 gensym, use of ‘cl-with-gensyms’ shortens the code and renders 2485 one’s intentions clearer. Compare: 2486 2487 (defmacro my-macro (foo) 2488 (let ((bar (gensym "bar")) 2489 (baz (gensym "baz")) 2490 (quux (gensym "quux"))) 2491 `(let ((,bar (+ ...))) 2492 ...))) 2493 2494 (defmacro my-macro (foo) 2495 (cl-with-gensyms (bar baz quux) 2496 `(let ((,bar (+ ...))) 2497 ...))) 2498 2499 -- Macro: cl-once-only ((variable form)...) body 2500 This macro is primarily to help the macro programmer ensure that 2501 forms supplied by the user of the macro are evaluated just once by 2502 its expansion even though the result of evaluating the form is to 2503 occur more than once. Less often, this macro is used to ensure 2504 that forms supplied by the macro programmer are evaluated just 2505 once. 2506 2507 Each VARIABLE may be used to refer to the result of evaluating FORM 2508 in BODY. ‘cl-once-only’ binds each VARIABLE to a fresh uninterned 2509 symbol during the evaluation of BODY. Then, ‘cl-once-only’ wraps 2510 the final expansion in code to evaluate each FORM and bind the 2511 result to the corresponding uninterned symbol. Thus, when the 2512 macro writer substitutes the value for VARIABLE into the expansion 2513 they are effectively referring to the result of evaluating FORM, 2514 rather than FORM itself. Another way to put this is that each 2515 VARIABLE is bound to an expression for the (singular) result of 2516 evaluating FORM. 2517 2518 The most common case is where VARIABLE is one of the arguments to 2519 the macro being written, so ‘(variable variable)’ may be 2520 abbreviated to just ‘variable’. 2521 2522 For example, consider this macro: 2523 2524 (defmacro my-list (x y &rest forms) 2525 (let ((x-result (gensym)) 2526 (y-result (gensym))) 2527 `(let ((,x-result ,x) 2528 (,y-result ,y)) 2529 (list ,x-result ,y-result ,x-result ,y-result 2530 (progn ,@forms)))) 2531 2532 In a call like ‘(my-list (pop foo) ...)’ the intermediate binding 2533 to ‘x-result’ ensures that the ‘pop’ is not done twice. But as a 2534 result the code is rather complex: the reader must keep track of 2535 how ‘x-result’ really just means the first parameter of the call to 2536 the macro, and the required use of multiple gensyms to avoid 2537 variable capture by ‘(progn ,@forms)’ obscures things further. 2538 ‘cl-once-only’ takes care of these details: 2539 2540 (defmacro my-list (x y &rest forms) 2541 (cl-once-only (x y) 2542 `(list ,x ,y ,x ,y 2543 (progn ,@forms)))) 2544 2545 2.5.2 Extended Definitions 2546 -------------------------- 2547 2548 These functions must be called explicitly via ‘compat-call’, since their 2549 calling convention or behavior was extended in Emacs 29.1: 2550 2551 -- Function: compat-call set-transient-map keymap &optional keep-pred 2552 on-exit message timeout 2553 This function adds KEYMAP as a “transient” keymap, which takes 2554 precedence over other keymaps for one (or more) subsequent keys. 2555 2556 Normally, KEYMAP is used just once, to look up the very next key. 2557 If the optional argument KEEP-PRED is ‘t’, the map stays active as 2558 long as the user types keys defined in KEYMAP; when the user types 2559 a key that is not in KEYMAP, the transient keymap is deactivated 2560 and normal key lookup continues for that key. 2561 2562 The KEEP-PRED argument can also be a function. In that case, the 2563 function is called with no arguments, prior to running each 2564 command, while KEYMAP is active; it should return non-‘nil’ if 2565 KEYMAP should stay active. 2566 2567 The optional argument ON-EXIT, if non-‘nil’, specifies a function 2568 that is called, with no arguments, after KEYMAP is deactivated. 2569 2570 The optional argument MESSAGE specifies the message to display 2571 after activating the transient map. If MESSAGE is a string, it is 2572 the format string for the message, and any ‘%k’ specifier in that 2573 string is replaced with the list of keys from the transient map. 2574 Any other non-‘nil’ value of MESSAGE stands for the default message 2575 format ‘Repeat with %k’. 2576 2577 If the optional argument TIMEOUT is non-‘nil’, it should be a 2578 number that specifies how many seconds of idle time to wait before 2579 deactivating KEYMAP. The value of the variable 2580 ‘set-transient-map-timeout’, if non-‘nil’, overrides the value of 2581 this argument. 2582 2583 This function works by adding and removing KEYMAP from the variable 2584 ‘overriding-terminal-local-map’, which takes precedence over all 2585 other active keymaps (*note (Searching Keymaps)elisp::). 2586 2587 -- Function: compat-call string-lines string &optional omit-nulls 2588 keep-newlines 2589 Split STRING into a list of strings on newline boundaries. If the 2590 optional argument OMIT-NULLS is non-‘nil’, remove empty lines from 2591 the results. If the optional argument KEEP-NEWLINES is non-‘nil’, 2592 don’t remove the trailing newlines from the result strings. 2593 2594 *Note (elisp)Creating Strings::. 2595 2596 -- Function: compat-call define-key 2597 This function is like ‘keymap-set’ (*note (elisp)Changing Key 2598 Bindings::, but understands only the legacy key syntaxes. 2599 2600 In addition, this function also has a REMOVE argument. If it is 2601 non-‘nil’, the definition will be removed. This is almost the same 2602 as setting the definition to ‘nil’, but makes a difference if the 2603 KEYMAP has a parent, and KEY is shadowing the same binding in the 2604 parent. With REMOVE, subsequent lookups will return the binding in 2605 the parent, whereas with a ‘nil’ definition the lookups will return 2606 ‘nil’. 2607 2608 *Note (elisp)Low-Level Key Binding::. 2609 2610 This compatibility version handles the optional argument REMOVE. 2611 2612 -- Function: compat-call plist-get plist prop &optional predicate 2613 This returns the value of the PROPERTY property stored in the 2614 property list PLIST. Comparisons are done with PREDICATE, and 2615 defaults to ‘eq’. It accepts a malformed PLIST argument. If 2616 PROPERTY is not found in the PLIST, it returns ‘nil’. 2617 2618 *Note (elisp)Plist Access::. 2619 2620 This compatibility version handles the optional argument PREDICATE. 2621 This is a generalized variable (*note (elisp)Generalized 2622 Variables::) that can be used to change a value with ‘setf’. 2623 2624 -- Function: compat-call plist-put plist prop val &optional predicate 2625 This stores VALUE as the value of the PROPERTY property in the 2626 property list PLIST. Comparisons are done with PREDICATE, and 2627 defaults to ‘eq’. It may modify PLIST destructively, or it may 2628 construct a new list structure without altering the old. The 2629 function returns the modified property list, so you can store that 2630 back in the place where you got PLIST. 2631 2632 *Note (elisp)Plist Access::. 2633 2634 This compatibility version handles the optional argument PREDICATE. 2635 2636 -- Function: compat-call plist-member plist prop &optional predicate 2637 This returns non-‘nil’ if PLIST contains the given PROPERTY. 2638 Comparisons are done with PREDICATE, and defaults to ‘eq’. Unlike 2639 ‘plist-get’, this allows you to distinguish between a missing 2640 property and a property with the value ‘nil’. The value is 2641 actually the tail of PLIST whose ‘car’ is PROPERTY. 2642 2643 *Note (elisp)Plist Access::. 2644 2645 This compatibility version handles the optional argument PREDICATE. 2646 2647 2.5.3 Missing Definitions 2648 ------------------------- 2649 2650 Compat does not provide support for the following Lisp features 2651 implemented in 29.1: 2652 2653 • The function ‘imagep’. 2654 • The function ‘image-at-point-p’. 2655 • The function ‘function-documentation’. 2656 • The macro ‘with-undo-amalgamate’. 2657 • The function ‘string-glyph-split’. 2658 • The function ‘string-limit’. 2659 • The function ‘string-pixel-width’ and ‘buffer-text-pixel-size’. 2660 • The function ‘minibuffer-lazy-highlight-setup’. 2661 • The function ‘pp-emacs-lisp-code’. 2662 • The functions ‘xdg-state-home’, ‘xdg-current-desktop’ and 2663 ‘xdg-session-type’. 2664 • The macro ‘setopt’. 2665 • The ‘oclosure’ library. 2666 • The ‘textsec’ library. 2667 • The ‘range’ library. 2668 • The ‘string-edit’ library. 2669 • The ‘vtable’ library. 2670 • The ‘pixel-fill’ library. 2671 2672 2673 File: doc0jZUSv.info, Node: Development, Next: Function Index, Prev: Support, Up: Top 2674 2675 3 Development 2676 ************* 2677 2678 Compat is developed on GitHub. 2679 2680 Bug reports, patches and comments are best sent to the issue tracker 2681 (https://github.com/emacs-compat/compat/issues). These may include 2682 issues in the compatibility code, missing definitions or performance 2683 issues. We also provide a development mailing list 2684 (https://lists.sr.ht/~pkal/compat-devel) (~pkal/compat-devel@lists.sr.ht 2685 <~pkal/compat-devel@lists.sr.ht>). 2686 2687 Please note that as a GNU ELPA package, Compat requires contributors 2688 to have signed the FSF copyright assignment 2689 (https://www.gnu.org/software/emacs/manual/html_node/emacs/Copyright-Assignment.html), 2690 before any non-trivial contribution (roughly 15 lines of code) can be 2691 applied. It is important that you provide tests when you contribute new 2692 functionality. Compat has 100% test coverage by the test suite. We use 2693 continuous integration to check if patches preserve existing 2694 functionality. 2695 2696 2697 File: doc0jZUSv.info, Node: Function Index, Next: Variable Index, Prev: Development, Up: Top 2698 2699 Appendix A Function Index 2700 ************************* 2701 2702 2703 * Menu: 2704 2705 * add-display-text-property: Emacs 29.1. (line 178) 2706 * alist-get: Emacs 25.1. (line 82) 2707 * always: Emacs 28.1. (line 83) 2708 * and-let*: Emacs 26.1. (line 158) 2709 * assoc-delete-all: Emacs 26.1. (line 13) 2710 * bignump: Emacs 27.1. (line 55) 2711 * bool-vector: Emacs 25.1. (line 178) 2712 * bounds-of-thing-at-mouse: Emacs 28.1. (line 292) 2713 * buffer-hash: Emacs 26.1. (line 80) 2714 * buffer-local-boundp: Emacs 28.1. (line 125) 2715 * buffer-local-restore-state: Emacs 29.1. (line 42) 2716 * buffer-local-set-state: Emacs 29.1. (line 42) 2717 * buffer-match-p: Emacs 29.1. (line 246) 2718 * buttonize: Emacs 29.1. (line 144) 2719 * buttonize-region: Emacs 29.1. (line 153) 2720 * cl-constantly: Emacs 29.1. (line 618) 2721 * cl-once-only: Emacs 29.1. (line 641) 2722 * cl-with-gensyms: Emacs 29.1. (line 622) 2723 * color-dark-p: Emacs 28.1. (line 323) 2724 * color-values-from-color-spec: Emacs 28.1. (line 329) 2725 * compat-call: Usage. (line 43) 2726 * compat-call <1>: Emacs 26.1. (line 278) 2727 * compat-call alist-get: Emacs 26.1. (line 344) 2728 * compat-call assoc: Emacs 26.1. (line 316) 2729 * compat-call assoc-delete-all: Emacs 27.1. (line 417) 2730 * compat-call count-windows: Emacs 28.1. (line 405) 2731 * compat-call define-key: Emacs 29.1. (line 738) 2732 * compat-call executable-find: Emacs 27.1. (line 429) 2733 * compat-call file-size-human-readable: Emacs 27.1. (line 397) 2734 * compat-call line-number-at-pos: Emacs 26.1. (line 330) 2735 * compat-call lookup-key: Emacs 27.1. (line 356) 2736 * compat-call plist-get: Emacs 29.1. (line 754) 2737 * compat-call plist-member: Emacs 29.1. (line 778) 2738 * compat-call plist-put: Emacs 29.1. (line 766) 2739 * compat-call recenter: Emacs 27.1. (line 346) 2740 * compat-call regexp-opt: Emacs 27.1. (line 385) 2741 * compat-call set-transient-map: Emacs 29.1. (line 693) 2742 * compat-call setq-local: Emacs 27.1. (line 370) 2743 * compat-call sort: Emacs 25.1. (line 190) 2744 * compat-call string-lines: Emacs 29.1. (line 729) 2745 * compat-call string-trim: Emacs 26.1. (line 375) 2746 * compat-call string-trim-left: Emacs 26.1. (line 359) 2747 * compat-call string-trim-right: Emacs 26.1. (line 367) 2748 * compat-call string-width: Emacs 28.1. (line 388) 2749 * compat-function: Usage. (line 51) 2750 * compiled-function-p: Emacs 29.1. (line 214) 2751 * count-sentences: Emacs 29.1. (line 17) 2752 * cXXXr: Emacs 26.1. (line 66) 2753 * cXXXXr: Emacs 26.1. (line 67) 2754 * date-days-in-month: Emacs 27.1. (line 213) 2755 * date-ordinal-to-time: Emacs 27.1. (line 220) 2756 * decoded-time-day: Emacs 27.1. (line 175) 2757 * decoded-time-dst: Emacs 27.1. (line 195) 2758 * decoded-time-hour: Emacs 27.1. (line 170) 2759 * decoded-time-minute: Emacs 27.1. (line 165) 2760 * decoded-time-month: Emacs 27.1. (line 180) 2761 * decoded-time-period: Emacs 28.1. (line 360) 2762 * decoded-time-second: Emacs 27.1. (line 160) 2763 * decoded-time-weekday: Emacs 27.1. (line 190) 2764 * decoded-time-year: Emacs 27.1. (line 185) 2765 * decoded-time-zone: Emacs 27.1. (line 200) 2766 * define-keymap: Emacs 29.1. (line 506) 2767 * defvar-keymap: Emacs 29.1. (line 574) 2768 * delete-line: Emacs 29.1. (line 51) 2769 * directory-abbrev-apply: Emacs 29.1. (line 370) 2770 * directory-abbrev-make-regexp: Emacs 29.1. (line 367) 2771 * directory-empty-p: Emacs 28.1. (line 243) 2772 * directory-name-p: Emacs 25.1. (line 56) 2773 * dlet: Emacs 28.1. (line 143) 2774 * dolist-with-progress-reporter: Emacs 27.1. (line 119) 2775 * ensure-list: Emacs 28.1. (line 158) 2776 * ert-with-temp-directory: Emacs 29.1. (line 606) 2777 * ert-with-temp-file: Emacs 29.1. (line 600) 2778 * file-attribute-access-time: Emacs 26.1. (line 223) 2779 * file-attribute-collect: Emacs 26.1. (line 260) 2780 * file-attribute-device-number: Emacs 26.1. (line 255) 2781 * file-attribute-file-identifier: Emacs 29.1. (line 327) 2782 * file-attribute-group-id: Emacs 26.1. (line 218) 2783 * file-attribute-inode-number: Emacs 26.1. (line 250) 2784 * file-attribute-link-number: Emacs 26.1. (line 208) 2785 * file-attribute-modes: Emacs 26.1. (line 245) 2786 * file-attribute-modification-time: Emacs 26.1. (line 228) 2787 * file-attribute-size: Emacs 26.1. (line 240) 2788 * file-attribute-status-change-time: Emacs 26.1. (line 234) 2789 * file-attribute-type: Emacs 26.1. (line 203) 2790 * file-attribute-user-id: Emacs 26.1. (line 213) 2791 * file-backup-file-names: Emacs 28.1. (line 348) 2792 * file-has-changed-p: Emacs 29.1. (line 352) 2793 * file-local-name: Emacs 26.1. (line 167) 2794 * file-modes-number-to-symbolic: Emacs 28.1. (line 342) 2795 * file-name-concat: Emacs 28.1. (line 53) 2796 * file-name-parent-directory: Emacs 29.1. (line 343) 2797 * file-name-quote: Emacs 26.1. (line 102) 2798 * file-name-quoted-p: Emacs 26.1. (line 95) 2799 * file-name-split: Emacs 29.1. (line 333) 2800 * file-name-unquote: Emacs 26.1. (line 90) 2801 * file-name-with-extension: Emacs 28.1. (line 225) 2802 * file-size-human-readable-iec: Emacs 27.1. (line 251) 2803 * fixnump: Emacs 27.1. (line 60) 2804 * flatten-tree: Emacs 27.1. (line 132) 2805 * format-message: Emacs 25.1. (line 44) 2806 * format-prompt: Emacs 28.1. (line 254) 2807 * funcall-with-delayed-message: Emacs 29.1. (line 136) 2808 * function-alias-p: Emacs 29.1. (line 221) 2809 * garbage-collect-maybe: Emacs 28.1. (line 68) 2810 * gensym: Emacs 26.1. (line 70) 2811 * get-display-property: Emacs 29.1. (line 161) 2812 * get-scratch-buffer-create: Emacs 29.1. (line 30) 2813 * hash-table-empty: Emacs 25.1. (line 120) 2814 * if-let: Emacs 25.1. (line 97) 2815 * if-let*: Emacs 26.1. (line 149) 2816 * ignore-errors: Emacs 27.1. (line 106) 2817 * image-property: Emacs 26.1. (line 198) 2818 * insert-into-buffer: Emacs 28.1. (line 92) 2819 * key-parse: Emacs 29.1. (line 407) 2820 * key-valid-p: Emacs 29.1. (line 375) 2821 * keymap-global-lookup: Emacs 29.1. (line 502) 2822 * keymap-global-set: Emacs 29.1. (line 436) 2823 * keymap-global-unset: Emacs 29.1. (line 456) 2824 * keymap-local-lookup: Emacs 29.1. (line 498) 2825 * keymap-local-set: Emacs 29.1. (line 446) 2826 * keymap-local-unset: Emacs 29.1. (line 471) 2827 * keymap-lookup: Emacs 29.1. (line 485) 2828 * keymap-set: Emacs 29.1. (line 412) 2829 * keymap-substitute: Emacs 29.1. (line 477) 2830 * length<: Emacs 28.1. (line 45) 2831 * length=: Emacs 28.1. (line 42) 2832 * length>: Emacs 28.1. (line 50) 2833 * list-of-strings-p: Emacs 29.1. (line 54) 2834 * macroexp-file-name: Emacs 28.1. (line 301) 2835 * macroexp-parse: Emacs 25.1. (line 175) 2836 * macroexp-quote: Emacs 25.1. (line 172) 2837 * macroexp-warn-and-return: Emacs 28.1. (line 305) 2838 * macroexpand-1: Emacs 25.1. (line 165) 2839 * major-mode-restore: Emacs 27.1. (line 22) 2840 * major-mode-suspend: Emacs 27.1. (line 13) 2841 * make-empty-file: Emacs 27.1. (line 254) 2842 * make-lock-file-name: Emacs 28.1. (line 356) 2843 * make-nearby-temp-file: Emacs 26.1. (line 120) 2844 * make-separator-line: Emacs 28.1. (line 88) 2845 * mapcan: Emacs 26.1. (line 53) 2846 * mark-thing-at-mouse: Emacs 28.1. (line 298) 2847 * match-buffers: Emacs 29.1. (line 280) 2848 * minibuffer-history-value: Emacs 27.1. (line 32) 2849 * named-let: Emacs 28.1. (line 207) 2850 * ntake: Emacs 29.1. (line 201) 2851 * package-get-version: Emacs 27.1. (line 205) 2852 * plistp: Emacs 29.1. (line 57) 2853 * pos-bol: Emacs 29.1. (line 111) 2854 * pos-eol: Emacs 29.1. (line 115) 2855 * process-lines-handling-status: Emacs 28.1. (line 20) 2856 * process-lines-ignore-status: Emacs 28.1. (line 16) 2857 * proper-list-p: Emacs 27.1. (line 76) 2858 * provided-mode-derived-p: Emacs 27.1. (line 247) 2859 * read-answer: Emacs 26.1. (line 17) 2860 * read-char-from-minibuffer: Emacs 27.1. (line 44) 2861 * read-multiple-choice: Emacs 26.1. (line 185) 2862 * readablep: Emacs 29.1. (line 20) 2863 * region-bounds: Emacs 25.1. (line 28) 2864 * region-noncontiguous-p: Emacs 25.1. (line 34) 2865 * replace-regexp-in-string: Emacs 28.1. (line 117) 2866 * replace-string-in-region: Emacs 28.1. (line 102) 2867 * ring-resize: Emacs 27.1. (line 28) 2868 * save-mark-and-excursion: Emacs 25.1. (line 39) 2869 * string-chop-newline: Emacs 28.1. (line 202) 2870 * string-clean-whitespace: Emacs 28.1. (line 171) 2871 * string-distance: Emacs 27.1. (line 86) 2872 * string-equal-ignore-case: Emacs 29.1. (line 234) 2873 * string-fill: Emacs 28.1. (line 178) 2874 * string-glyph-split: Emacs 29.1. (line 289) 2875 * string-greaterp: Emacs 25.1. (line 64) 2876 * string-lines: Emacs 28.1. (line 186) 2877 * string-pad: Emacs 28.1. (line 193) 2878 * string-replace: Emacs 28.1. (line 77) 2879 * string-search: Emacs 28.1. (line 34) 2880 * string-split: Emacs 29.1. (line 240) 2881 * subr-native-elisp-p: Emacs 28.1. (line 372) 2882 * subr-primitive-p: Emacs 28.1. (line 365) 2883 * substitute-quotes: Emacs 29.1. (line 26) 2884 * take: Emacs 29.1. (line 187) 2885 * temporary-file-directory: Emacs 26.1. (line 137) 2886 * text-property-search-backward: Emacs 27.1. (line 332) 2887 * text-property-search-forward: Emacs 27.1. (line 260) 2888 * text-quoting-style: Emacs 28.1. (line 28) 2889 * thing-at-mouse: Emacs 28.1. (line 285) 2890 * thread-first: Emacs 25.1. (line 123) 2891 * thread-last: Emacs 25.1. (line 144) 2892 * time-equal-p: Emacs 27.1. (line 208) 2893 * use-region-beginning: Emacs 29.1. (line 39) 2894 * use-region-end: Emacs 29.1. (line 36) 2895 * use-region-noncontiguous-p: Emacs 29.1. (line 33) 2896 * when-let: Emacs 25.1. (line 115) 2897 * when-let*: Emacs 26.1. (line 153) 2898 * while-let: Emacs 29.1. (line 594) 2899 * with-buffer-unmodified-if-unchanged: Emacs 29.1. (line 312) 2900 * with-delayed-message: Emacs 29.1. (line 119) 2901 * with-environment-variables: Emacs 28.1. (line 309) 2902 * with-existing-directory: Emacs 28.1. (line 132) 2903 * with-file-modes: Emacs 25.1. (line 71) 2904 * with-memoization: Emacs 29.1. (line 60) 2905 * with-minibuffer-selected-window: Emacs 27.1. (line 38) 2906 * with-restriction: Emacs 29.1. (line 65) 2907 * with-suppressed-warnings: Emacs 27.1. (line 65) 2908 * with-window-non-dedicated: Emacs 28.1. (line 377) 2909 * without-restriction: Emacs 29.1. (line 99) 2910 * xor: Emacs 27.1. (line 142) 2911 2912 2913 File: doc0jZUSv.info, Node: Variable Index, Prev: Function Index, Up: Top 2914 2915 Appendix B Variable Index 2916 ************************* 2917 2918 2919 * Menu: 2920 2921 * exec-path: Emacs 27.1. (line 228) 2922 * gensym-counter: Emacs 26.1. (line 77) 2923 * mounted-file-systems: Emacs 26.1. (line 133) 2924 * regexp-unmatchable: Emacs 27.1. (line 152) 2925 * set-transient-map-timeout: Emacs 29.1. (line 719) 2926 * text-quoting-style: Emacs 25.1. (line 13) 2927 2928 2929 2930 Tag Table: 2931 Node: Top829 2932 Node: Introduction2258 2933 Node: Overview2421 2934 Node: Usage2947 2935 Node: Limitations7161 2936 Node: Support11945 2937 Node: Emacs 25.112530 2938 Node: Emacs 26.121932 2939 Node: Emacs 27.139184 2940 Node: Emacs 28.159581 2941 Node: Emacs 29.179251 2942 Node: Development115649 2943 Node: Function Index116669 2944 Node: Variable Index131882 2945 2946 End Tag Table 2947 2948 2949 Local Variables: 2950 coding: utf-8 2951 End: