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