diff options
| author | Andrea Corallo | 2020-05-17 22:49:02 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2020-05-17 22:49:02 +0100 |
| commit | cd4ef52c8673a76c6fcb0efd7d2c74778522038c (patch) | |
| tree | b3d4b99c92ddccc02a2f3ee846b11419dde1d892 | |
| parent | 9e9421c7eecd74c9f163253ab760044fca53f26b (diff) | |
| parent | abec255c024938a40fa3c9730f602c0351e5877d (diff) | |
| download | emacs-cd4ef52c8673a76c6fcb0efd7d2c74778522038c.tar.gz emacs-cd4ef52c8673a76c6fcb0efd7d2c74778522038c.zip | |
Merge remote-tracking branch 'savannah/master' into HEAD
73 files changed, 704 insertions, 1941 deletions
diff --git a/admin/authors.el b/admin/authors.el index 13b203b9bc1..dc57c0a6b91 100644 --- a/admin/authors.el +++ b/admin/authors.el | |||
| @@ -365,7 +365,7 @@ Changes to files matching one of the regexps in this list are not listed.") | |||
| 365 | "lib/stdarg.in.h" "lib/stdbool.in.h" | 365 | "lib/stdarg.in.h" "lib/stdbool.in.h" |
| 366 | "unidata/bidimirror.awk" "unidata/biditype.awk" | 366 | "unidata/bidimirror.awk" "unidata/biditype.awk" |
| 367 | "split-man" "Xkeymap.txt" "ms-7bkermit" "ulimit.hack" | 367 | "split-man" "Xkeymap.txt" "ms-7bkermit" "ulimit.hack" |
| 368 | "gnu-hp300" "refcard.bit" "ledit.l" "forms.README" "forms-d2.dat" | 368 | "gnu-hp300" "refcard.bit" "forms.README" "forms-d2.dat" |
| 369 | "CXTERM-DIC/PY.tit" "CXTERM-DIC/ZIRANMA.tit" | 369 | "CXTERM-DIC/PY.tit" "CXTERM-DIC/ZIRANMA.tit" |
| 370 | "CXTERM-DIC/CTLau.tit" "CXTERM-DIC/CTLauB.tit" | 370 | "CXTERM-DIC/CTLau.tit" "CXTERM-DIC/CTLauB.tit" |
| 371 | "copying.paper" "celibacy.1" "condom.1" "echo.msg" "sex.6" | 371 | "copying.paper" "celibacy.1" "condom.1" "echo.msg" "sex.6" |
| @@ -609,7 +609,7 @@ Changes to files in this list are not listed.") | |||
| 609 | ;; No longer distributed: lselect.el. | 609 | ;; No longer distributed: lselect.el. |
| 610 | ("Lucid, Inc." :changed "bytecode.c" "byte-opt.el" "byte-run.el" | 610 | ("Lucid, Inc." :changed "bytecode.c" "byte-opt.el" "byte-run.el" |
| 611 | "bytecomp.el" "delsel.el" "disass.el" "faces.el" "font-lock.el" | 611 | "bytecomp.el" "delsel.el" "disass.el" "faces.el" "font-lock.el" |
| 612 | "lmenu.el" "mailabbrev.el" "select.el" "xfaces.c" "xselect.c") | 612 | "mailabbrev.el" "select.el" "xfaces.c" "xselect.c") |
| 613 | ;; MCC. No longer distributed: emacsserver.c. | 613 | ;; MCC. No longer distributed: emacsserver.c. |
| 614 | ("Microelectronics and Computer Technology Corporation" | 614 | ("Microelectronics and Computer Technology Corporation" |
| 615 | :changed "etags.c" "emacsclient.c" "movemail.c" | 615 | :changed "etags.c" "emacsclient.c" "movemail.c" |
| @@ -773,7 +773,7 @@ Changes to files in this list are not listed.") | |||
| 773 | "erc-hecomplete.el" | 773 | "erc-hecomplete.el" |
| 774 | "eshell/esh-maint.el" | 774 | "eshell/esh-maint.el" |
| 775 | "language/persian.el" | 775 | "language/persian.el" |
| 776 | "ledit.el" "meese.el" "iswitchb.el" "longlines.el" | 776 | "meese.el" "iswitchb.el" "longlines.el" |
| 777 | "mh-exec.el" "mh-init.el" "mh-customize.el" | 777 | "mh-exec.el" "mh-init.el" "mh-customize.el" |
| 778 | "net/zone-mode.el" "xesam.el" | 778 | "net/zone-mode.el" "xesam.el" |
| 779 | "term/mac-win.el" "sup-mouse.el" | 779 | "term/mac-win.el" "sup-mouse.el" |
diff --git a/admin/charsets/cp51932.awk b/admin/charsets/cp51932.awk index 6aac98815b5..c3555095249 100644 --- a/admin/charsets/cp51932.awk +++ b/admin/charsets/cp51932.awk | |||
| @@ -43,13 +43,14 @@ BEGIN { | |||
| 43 | 43 | ||
| 44 | END { | 44 | END { |
| 45 | print ")))"; | 45 | print ")))"; |
| 46 | print " (mapc #'(lambda (x)"; | 46 | print " (setq map (mapcar (lambda (x)"; |
| 47 | print " (setcar x (decode-char 'japanese-jisx0208 (car x))))"; | 47 | print " (cons (decode-char 'japanese-jisx0208 (car x))"; |
| 48 | print " map)"; | 48 | print " (cdr x)))"; |
| 49 | print " map))"; | ||
| 49 | print " (define-translation-table 'cp51932-decode map)"; | 50 | print " (define-translation-table 'cp51932-decode map)"; |
| 50 | print " (mapc #'(lambda (x)"; | 51 | print " (mapc (lambda (x)"; |
| 51 | print " (let ((tmp (car x)))"; | 52 | print " (let ((tmp (car x)))"; |
| 52 | print " (setcar x (cdr x)) (setcdr x tmp)))"; | 53 | print " (setcar x (cdr x)) (setcdr x tmp)))"; |
| 53 | print " map)"; | 54 | print " map)"; |
| 54 | print " (define-translation-table 'cp51932-encode map))"; | 55 | print " (define-translation-table 'cp51932-encode map))"; |
| 55 | print ""; | 56 | print ""; |
diff --git a/admin/charsets/eucjp-ms.awk b/admin/charsets/eucjp-ms.awk index 0c9f94d0f48..f6a6748ce51 100644 --- a/admin/charsets/eucjp-ms.awk +++ b/admin/charsets/eucjp-ms.awk | |||
| @@ -93,15 +93,17 @@ function write_entry (unicode) { | |||
| 93 | 93 | ||
| 94 | END { | 94 | END { |
| 95 | print ")))"; | 95 | print ")))"; |
| 96 | print " (mapc #'(lambda (x)"; | 96 | print " (setq map"; |
| 97 | print " (mapcar"; | ||
| 98 | print " (lambda (x)"; | ||
| 97 | print " (let ((code (logand (car x) #x7F7F)))"; | 99 | print " (let ((code (logand (car x) #x7F7F)))"; |
| 98 | print " (if (integerp (cdr x))"; | 100 | print " (if (integerp (cdr x))"; |
| 99 | print " (setcar x (decode-char 'japanese-jisx0208 code))"; | 101 | print " (cons (decode-char 'japanese-jisx0208 code) (cdr x))"; |
| 100 | print " (setcar x (decode-char 'japanese-jisx0212 code))"; | 102 | print " (cons (decode-char 'japanese-jisx0212 code)" |
| 101 | print " (setcdr x (cadr x)))))"; | 103 | print " (cadr x)))))"; |
| 102 | print " map)"; | 104 | print " map))"; |
| 103 | print " (define-translation-table 'eucjp-ms-decode map)"; | 105 | print " (define-translation-table 'eucjp-ms-decode map)"; |
| 104 | print " (mapc #'(lambda (x)"; | 106 | print " (mapc (lambda (x)"; |
| 105 | print " (let ((tmp (car x)))"; | 107 | print " (let ((tmp (car x)))"; |
| 106 | print " (setcar x (cdr x)) (setcdr x tmp)))"; | 108 | print " (setcar x (cdr x)) (setcdr x tmp)))"; |
| 107 | print " map)"; | 109 | print " map)"; |
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index 77a0e807c2b..7074bd45d71 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi | |||
| @@ -1541,6 +1541,11 @@ putting a line like this in your init file (@pxref{Init File}): | |||
| 1541 | (add-to-list 'load-path "/path/to/my/lisp/library") | 1541 | (add-to-list 'load-path "/path/to/my/lisp/library") |
| 1542 | @end example | 1542 | @end example |
| 1543 | 1543 | ||
| 1544 | It is customary to put locally installed libraries in the | ||
| 1545 | @file{site-lisp} directory that is already in the default value of | ||
| 1546 | @code{load-path}, or in some subdirectory of @file{site-lisp}. This | ||
| 1547 | way, you don't need to modify the default value of @code{load-path}. | ||
| 1548 | |||
| 1544 | @cindex autoload | 1549 | @cindex autoload |
| 1545 | Some commands are @dfn{autoloaded}; when you run them, Emacs | 1550 | Some commands are @dfn{autoloaded}; when you run them, Emacs |
| 1546 | automatically loads the associated library first. For instance, the | 1551 | automatically loads the associated library first. For instance, the |
| @@ -1563,6 +1568,33 @@ Automatic loading also occurs when completing names for | |||
| 1563 | prefix being completed. To disable this feature, change the variable | 1568 | prefix being completed. To disable this feature, change the variable |
| 1564 | @code{help-enable-completion-autoload} to @code{nil}. | 1569 | @code{help-enable-completion-autoload} to @code{nil}. |
| 1565 | 1570 | ||
| 1571 | Once you put your library in a directory where Emacs can find and | ||
| 1572 | load it, you may wish to make it available at startup. This is useful | ||
| 1573 | when the library defines features that should be available | ||
| 1574 | automatically on demand, and manually loading the library is thus | ||
| 1575 | inconvenient. In these cases, make sure the library will be loaded by | ||
| 1576 | adding suitable forms to your init file: either @code{load} or | ||
| 1577 | @code{require} (if you always need to load the library at startup), or | ||
| 1578 | @code{autoload} if you need Emacs to load the library when some | ||
| 1579 | command or function is invoked. For example: | ||
| 1580 | |||
| 1581 | @smalllisp | ||
| 1582 | @group | ||
| 1583 | ;; Loads @file{my-shining-package.elc} unconditionally. | ||
| 1584 | (require 'my-shining-package) | ||
| 1585 | @end group | ||
| 1586 | @group | ||
| 1587 | ;; Will load @file{my-shining-package.elc} when @code{my-func} is invoked. | ||
| 1588 | (autoload 'my-func "my-shining-package") | ||
| 1589 | @end group | ||
| 1590 | @end smalllisp | ||
| 1591 | |||
| 1592 | Note that installing a package using @code{package-install} | ||
| 1593 | (@pxref{Package Installation}) takes care of placing the package's | ||
| 1594 | Lisp files in a directory where Emacs will find it, and also writes | ||
| 1595 | the necessary initialization code into your init files, making the | ||
| 1596 | above manual customizations unnecessary. | ||
| 1597 | |||
| 1566 | @node Lisp Eval | 1598 | @node Lisp Eval |
| 1567 | @section Evaluating Emacs Lisp Expressions | 1599 | @section Evaluating Emacs Lisp Expressions |
| 1568 | @cindex Emacs Lisp mode | 1600 | @cindex Emacs Lisp mode |
diff --git a/doc/emacs/calendar.texi b/doc/emacs/calendar.texi index 8dc1a0b2df8..fe51ad35d77 100644 --- a/doc/emacs/calendar.texi +++ b/doc/emacs/calendar.texi | |||
| @@ -532,7 +532,7 @@ holidays centered around a different month, use @kbd{C-u M-x | |||
| 532 | holidays}, which prompts for the month and year. | 532 | holidays}, which prompts for the month and year. |
| 533 | 533 | ||
| 534 | The holidays known to Emacs include United States holidays and the | 534 | The holidays known to Emacs include United States holidays and the |
| 535 | major Bah@'{a}@t{'}@'{i}, Chinese, Christian, Islamic, and Jewish | 535 | major Bahá'í, Chinese, Christian, Islamic, and Jewish |
| 536 | holidays; also the solstices and equinoxes. | 536 | holidays; also the solstices and equinoxes. |
| 537 | 537 | ||
| 538 | @findex list-holidays | 538 | @findex list-holidays |
diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi index 91e44b8eba8..453d9eb4010 100644 --- a/doc/emacs/package.texi +++ b/doc/emacs/package.texi | |||
| @@ -5,23 +5,37 @@ | |||
| 5 | @node Packages | 5 | @node Packages |
| 6 | @chapter Emacs Lisp Packages | 6 | @chapter Emacs Lisp Packages |
| 7 | @cindex Package | 7 | @cindex Package |
| 8 | @cindex Emacs Lisp package archive | ||
| 9 | @cindex Package archive | 8 | @cindex Package archive |
| 10 | 9 | ||
| 11 | Emacs includes a facility that lets you easily download and install | 10 | Emacs is extended by implementing additional features in |
| 12 | @dfn{packages} that implement additional features. Each package is a | 11 | @dfn{packages}, which are Emacs Lisp libraries. These could be |
| 13 | separate Emacs Lisp program, sometimes including other components such | 12 | written by you or provided by someone else. If you want to install |
| 14 | as an Info manual. | 13 | such a package so it is available in your future Emacs session, you |
| 14 | need to compile it and put it in a directory where Emacs looks for | ||
| 15 | Lisp libraries. @xref{Lisp Libraries}, for more details about this | ||
| 16 | manual installation method. Many packages provide installation and | ||
| 17 | usage instructions in the large commentary near the beginning of the | ||
| 18 | Lisp file; you can use those instructions for installing and | ||
| 19 | fine-tuning your use of the package. | ||
| 15 | 20 | ||
| 16 | @kbd{M-x list-packages} brings up a buffer named @file{*Packages*} | 21 | @cindex Emacs Lisp package archive |
| 17 | with a list of all packages. You can install or uninstall packages | 22 | Packages can also be provided by @dfn{package archives}, which are |
| 18 | via this buffer. @xref{Package Menu}. | 23 | large collections of Emacs Lisp packages. Each package is a separate |
| 24 | Emacs Lisp program, sometimes including other components such as an | ||
| 25 | Info manual. Emacs includes a facility that lets you easily download | ||
| 26 | and install packages from such archives. The rest of this chapter | ||
| 27 | describes this facility. | ||
| 28 | |||
| 29 | To list the packages available for installation from package | ||
| 30 | archives, type @w{@kbd{M-x list-packages @key{RET}}}. It brings up a | ||
| 31 | buffer named @file{*Packages*} with a list of all packages. You can | ||
| 32 | install or uninstall packages via this buffer. @xref{Package Menu}. | ||
| 19 | 33 | ||
| 20 | The command @kbd{C-h P} (@code{describe-package}) prompts for the | 34 | The command @kbd{C-h P} (@code{describe-package}) prompts for the |
| 21 | name of a package, and displays a help buffer describing the | 35 | name of a package, and displays a help buffer describing the |
| 22 | attributes of the package and the features that it implements. | 36 | attributes of the package and the features that it implements. |
| 23 | 37 | ||
| 24 | By default, Emacs downloads packages from a @dfn{package archive} | 38 | By default, Emacs downloads packages from a package archive |
| 25 | maintained by the Emacs developers and hosted by the GNU project. | 39 | maintained by the Emacs developers and hosted by the GNU project. |
| 26 | Optionally, you can also download packages from archives maintained by | 40 | Optionally, you can also download packages from archives maintained by |
| 27 | third parties. @xref{Package Installation}. | 41 | third parties. @xref{Package Installation}. |
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index b3ad9b99649..686dbdb1caf 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi | |||
| @@ -1909,6 +1909,11 @@ omitted or @code{nil}, it defaults to 0, i.e., no access rights at | |||
| 1909 | all. | 1909 | all. |
| 1910 | @end defun | 1910 | @end defun |
| 1911 | 1911 | ||
| 1912 | @defun file-modes-number-to-symbolic modes | ||
| 1913 | This function converts a numeric file mode specification in | ||
| 1914 | @var{modes} into the equivalent symbolic form. | ||
| 1915 | @end defun | ||
| 1916 | |||
| 1912 | @defun set-file-times filename &optional time flag | 1917 | @defun set-file-times filename &optional time flag |
| 1913 | This function sets the access and modification times of @var{filename} | 1918 | This function sets the access and modification times of @var{filename} |
| 1914 | to @var{time}. The return value is @code{t} if the times are successfully | 1919 | to @var{time}. The return value is @code{t} if the times are successfully |
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 8bf48b1dbba..8f2c7439d9f 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi | |||
| @@ -613,7 +613,7 @@ The elements of the @code{command-switch-alist} look like this: | |||
| 613 | @end example | 613 | @end example |
| 614 | 614 | ||
| 615 | The @sc{car}, @var{option}, is a string, the name of a command-line | 615 | The @sc{car}, @var{option}, is a string, the name of a command-line |
| 616 | option (not including the initial hyphen). The @var{handler-function} | 616 | option (including the initial hyphen). The @var{handler-function} |
| 617 | is called to handle @var{option}, and receives the option name as its | 617 | is called to handle @var{option}, and receives the option name as its |
| 618 | sole argument. | 618 | sole argument. |
| 619 | 619 | ||
| @@ -623,6 +623,14 @@ remaining command-line arguments in the variable | |||
| 623 | @code{command-line-args-left} (see below). (The entire list of | 623 | @code{command-line-args-left} (see below). (The entire list of |
| 624 | command-line arguments is in @code{command-line-args}.) | 624 | command-line arguments is in @code{command-line-args}.) |
| 625 | 625 | ||
| 626 | Note that the handling of @code{command-switch-alist} doesn't treat | ||
| 627 | equals signs in @var{option} specially. That is, if there's an option | ||
| 628 | like @code{--name=value} on the command line, then only a | ||
| 629 | @code{command-switch-alist} member whose @code{car} is literally | ||
| 630 | @code{--name=value} will match this option. If you want to parse such | ||
| 631 | options, you need to use @code{command-line-functions} instead (see | ||
| 632 | below). | ||
| 633 | |||
| 626 | The command-line arguments are parsed by the @code{command-line-1} | 634 | The command-line arguments are parsed by the @code{command-line-1} |
| 627 | function in the @file{startup.el} file. See also @ref{Emacs | 635 | function in the @file{startup.el} file. See also @ref{Emacs |
| 628 | Invocation, , Command Line Arguments for Emacs Invocation, emacs, The | 636 | Invocation, , Command Line Arguments for Emacs Invocation, emacs, The |
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index c6e735a9b1e..22c50936185 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi | |||
| @@ -477,6 +477,22 @@ You should only ever change this variable with a let-binding; never | |||
| 477 | with @code{setq}. | 477 | with @code{setq}. |
| 478 | @end defvar | 478 | @end defvar |
| 479 | 479 | ||
| 480 | @defopt process-file-return-signal-string | ||
| 481 | This user option indicates whether a call of @code{process-file} | ||
| 482 | returns a string describing the signal interrupting a remote process. | ||
| 483 | |||
| 484 | When a process returns an exit code greater than 128, it is | ||
| 485 | interpreted as a signal. @code{process-file} requires to return a | ||
| 486 | string describing this signal. | ||
| 487 | |||
| 488 | Since there are processes violating this rule, returning exit codes | ||
| 489 | greater than 128 which are not bound to a signal, @code{process-file} | ||
| 490 | returns always the exit code as natural number for remote processes. | ||
| 491 | Setting this user option to non-nil forces @code{process-file} to | ||
| 492 | interpret such exit codes as signals, and to return a corresponding | ||
| 493 | string. | ||
| 494 | @end defopt | ||
| 495 | |||
| 480 | @defun call-process-region start end program &optional delete destination display &rest args | 496 | @defun call-process-region start end program &optional delete destination display &rest args |
| 481 | This function sends the text from @var{start} to @var{end} as | 497 | This function sends the text from @var{start} to @var{end} as |
| 482 | standard input to a process running @var{program}. It deletes the text | 498 | standard input to a process running @var{program}. It deletes the text |
diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index 50a208d233b..be1ffc026dd 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi | |||
| @@ -3463,22 +3463,16 @@ see @ref{Packages that do not come with Emacs}. | |||
| 3463 | @cindex Emacs Lisp List | 3463 | @cindex Emacs Lisp List |
| 3464 | @cindex Emacs Lisp Archive | 3464 | @cindex Emacs Lisp Archive |
| 3465 | 3465 | ||
| 3466 | The easiest way to add more features to your Emacs is to use the | 3466 | We distribute many packages that extend Emacs, in the |
| 3467 | command @kbd{M-x list-packages}. This contacts the | 3467 | @uref{https://elpa.gnu.org, GNU ELPA} (``Emacs Lisp Package |
| 3468 | @uref{https://elpa.gnu.org, GNU ELPA} (``Emacs Lisp Package Archive'') | 3468 | Archive''). The command @kbd{M-x list-packages} contacts the GNU ELPA |
| 3469 | server and fetches the list of additional packages that it offers. | 3469 | server and fetches the list of packages that it distributes. These |
| 3470 | These are GNU packages that are available for use with Emacs, but are | 3470 | GNU packages are designed for use with Emacs, but we distribute them |
| 3471 | distributed separately from Emacs itself, for reasons of space, etc. | 3471 | separately from Emacs itself, for reasons of space, and convenience of |
| 3472 | You can browse the resulting @file{*Packages*} buffer to see what is | 3472 | development. You can browse the resulting @file{*Packages*} buffer to |
| 3473 | available, and then Emacs can automatically download and install the | 3473 | see what is available, and then Emacs can automatically download and |
| 3474 | packages that you select. @xref{Packages,,, emacs, The GNU Emacs Manual}. | 3474 | install the packages that you select. @xref{Packages,,, emacs, The |
| 3475 | 3475 | GNU Emacs Manual}. | |
| 3476 | There are other, non-GNU, Emacs Lisp package servers, including: | ||
| 3477 | @uref{https://melpa.org, MELPA}; and | ||
| 3478 | @uref{https://marmalade-repo.org, Marmalade}. To use additional | ||
| 3479 | package servers, customize the @code{package-archives} variable. Be | ||
| 3480 | aware that installing a package can run arbitrary code, so only add | ||
| 3481 | sources that you trust. | ||
| 3482 | 3476 | ||
| 3483 | The @uref{https://lists.gnu.org/mailman/listinfo/gnu-emacs-sources, | 3477 | The @uref{https://lists.gnu.org/mailman/listinfo/gnu-emacs-sources, |
| 3484 | GNU Emacs sources mailing list}, which is gatewayed to the | 3478 | GNU Emacs sources mailing list}, which is gatewayed to the |
diff --git a/doc/misc/emacs-mime.texi b/doc/misc/emacs-mime.texi index 42a7750b9ac..2f38dcd4956 100644 --- a/doc/misc/emacs-mime.texi +++ b/doc/misc/emacs-mime.texi | |||
| @@ -917,7 +917,7 @@ Here's an example: | |||
| 917 | @lisp | 917 | @lisp |
| 918 | (add-to-list 'gnus-newsgroup-variables 'mm-coding-system-priorities) | 918 | (add-to-list 'gnus-newsgroup-variables 'mm-coding-system-priorities) |
| 919 | (setq gnus-parameters | 919 | (setq gnus-parameters |
| 920 | (nconc | 920 | (append |
| 921 | ;; Some charsets are just examples! | 921 | ;; Some charsets are just examples! |
| 922 | '(("^cn\\." ;; Chinese | 922 | '(("^cn\\." ;; Chinese |
| 923 | (mm-coding-system-priorities | 923 | (mm-coding-system-priorities |
diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index 57f713635f8..c33ca0ea02c 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi | |||
| @@ -159,6 +159,9 @@ The following persons have made contributions to Eshell. | |||
| 159 | 159 | ||
| 160 | @itemize @bullet | 160 | @itemize @bullet |
| 161 | @item | 161 | @item |
| 162 | John Wiegley is the original author of Eshell. | ||
| 163 | |||
| 164 | @item | ||
| 162 | Eli Zaretskii made it possible for Eshell to run without requiring | 165 | Eli Zaretskii made it possible for Eshell to run without requiring |
| 163 | asynchronous subprocess support. This is important for MS-DOS, which | 166 | asynchronous subprocess support. This is important for MS-DOS, which |
| 164 | does not have such support. | 167 | does not have such support. |
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 0b13c17dbcf..d1688deb1b7 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi | |||
| @@ -318,14 +318,14 @@ behind the scenes when you open a file with @value{tramp}. | |||
| 318 | @uref{https://ftp.gnu.org/gnu/tramp/}. The version number of | 318 | @uref{https://ftp.gnu.org/gnu/tramp/}. The version number of |
| 319 | @value{tramp} can be obtained by the variable @code{tramp-version}. | 319 | @value{tramp} can be obtained by the variable @code{tramp-version}. |
| 320 | For released @value{tramp} versions, this is a three-number string | 320 | For released @value{tramp} versions, this is a three-number string |
| 321 | like ``2.4.2''. | 321 | like ``2.4.3''. |
| 322 | 322 | ||
| 323 | A @value{tramp} release, which is packaged with Emacs, could differ | 323 | A @value{tramp} release, which is packaged with Emacs, could differ |
| 324 | slightly from the corresponding standalone release. This is because | 324 | slightly from the corresponding standalone release. This is because |
| 325 | it isn't always possible to synchronize release dates between Emacs | 325 | it isn't always possible to synchronize release dates between Emacs |
| 326 | and @value{tramp}. Such version numbers have the Emacs version number | 326 | and @value{tramp}. Such version numbers have the Emacs version number |
| 327 | as suffix, like ``2.3.5.26.3''. This means @w{@value{tramp} 2.3.5} as | 327 | as suffix, like ``2.4.3.27.1''. This means @w{@value{tramp} 2.4.3} as |
| 328 | integrated in @w{Emacs 26.3}. A complete list of @value{tramp} | 328 | integrated in @w{Emacs 27.1}. A complete list of @value{tramp} |
| 329 | versions packaged with Emacs can be retrieved by | 329 | versions packaged with Emacs can be retrieved by |
| 330 | 330 | ||
| 331 | @vindex customize-package-emacs-version-alist | 331 | @vindex customize-package-emacs-version-alist |
| @@ -337,12 +337,12 @@ versions packaged with Emacs can be retrieved by | |||
| 337 | ELPA} package. Besides the standalone releases, further minor version | 337 | ELPA} package. Besides the standalone releases, further minor version |
| 338 | of @value{tramp} will appear on GNU ELPA, until the next @value{tramp} | 338 | of @value{tramp} will appear on GNU ELPA, until the next @value{tramp} |
| 339 | release appears. These minor versions have a four-number string, like | 339 | release appears. These minor versions have a four-number string, like |
| 340 | ``2.4.2.1''. | 340 | ``2.4.3.1''. |
| 341 | 341 | ||
| 342 | @value{tramp} development versions are available on Git servers. | 342 | @value{tramp} development versions are available on Git servers. |
| 343 | Development versions contain new and incomplete features. The | 343 | Development versions contain new and incomplete features. The |
| 344 | development version of @value{tramp} is always the version number of | 344 | development version of @value{tramp} is always the version number of |
| 345 | the next release, plus the suffix ``-pre'', like ``2.4.3-pre''. | 345 | the next release, plus the suffix ``-pre'', like ``2.4.4-pre''. |
| 346 | 346 | ||
| 347 | One way to obtain @value{tramp} from Git server is to visit the | 347 | One way to obtain @value{tramp} from Git server is to visit the |
| 348 | Savannah project page at the following URL and then clicking on the | 348 | Savannah project page at the following URL and then clicking on the |
| @@ -2315,7 +2315,7 @@ string of that environment variable looks always like | |||
| 2315 | @example | 2315 | @example |
| 2316 | @group | 2316 | @group |
| 2317 | echo $INSIDE_EMACS | 2317 | echo $INSIDE_EMACS |
| 2318 | @result{} 26.2,tramp:2.3.4 | 2318 | @result{} 27.1,tramp:2.4.3 |
| 2319 | @end group | 2319 | @end group |
| 2320 | @end example | 2320 | @end example |
| 2321 | 2321 | ||
| @@ -3050,6 +3050,17 @@ host when the variable @code{default-directory} is remote: | |||
| 3050 | @end group | 3050 | @end group |
| 3051 | @end lisp | 3051 | @end lisp |
| 3052 | 3052 | ||
| 3053 | @vindex process-file-return-signal-string | ||
| 3054 | @code{process-file} shall return either the exit code of the process, | ||
| 3055 | or a string describing the signal, when the process has been | ||
| 3056 | interrupted. Since it cannot be determined reliably whether a remote | ||
| 3057 | process has been interrupted, @code{process-file} returns always the | ||
| 3058 | exit code. When the user option | ||
| 3059 | @code{process-file-return-signal-string} is non-nil, | ||
| 3060 | @code{process-file} regards all exit codes greater than 128 as an | ||
| 3061 | indication that the process has been interrupted, and returns a | ||
| 3062 | respective string. | ||
| 3063 | |||
| 3053 | Remote processes do not apply to @acronym{GVFS} (see @ref{GVFS-based | 3064 | Remote processes do not apply to @acronym{GVFS} (see @ref{GVFS-based |
| 3054 | methods}) because the remote file system is mounted on the local host | 3065 | methods}) because the remote file system is mounted on the local host |
| 3055 | and @value{tramp} just accesses by changing the | 3066 | and @value{tramp} just accesses by changing the |
| @@ -3057,9 +3068,17 @@ and @value{tramp} just accesses by changing the | |||
| 3057 | 3068 | ||
| 3058 | @value{tramp} starts a remote process when a command is executed in a | 3069 | @value{tramp} starts a remote process when a command is executed in a |
| 3059 | remote file or directory buffer. As of now, these packages have been | 3070 | remote file or directory buffer. As of now, these packages have been |
| 3060 | integrated to work with @value{tramp}: @file{compile.el} (commands | 3071 | integrated to work with @value{tramp}: @file{shell.el}, |
| 3061 | like @code{compile} and @code{grep}) and @file{gud.el} (@code{gdb} or | 3072 | @file{eshell.el}, @file{compile.el} (commands like @code{compile} and |
| 3062 | @code{perldb}). | 3073 | @code{grep}) and @file{gud.el} (@code{gdb} or @code{perldb}). |
| 3074 | |||
| 3075 | @vindex INSIDE_EMACS@r{, environment variable} | ||
| 3076 | @value{tramp} always modifies the @env{INSIDE_EMACS} environment | ||
| 3077 | variable for remote processes. Per default, this environment variable | ||
| 3078 | shows the Emacs version. @value{tramp} adds its own version string, | ||
| 3079 | so it looks like @samp{27.1,tramp:2.4.3.1}. However, other packages | ||
| 3080 | might also add their name to this environment variable, like | ||
| 3081 | @samp{27.1,comint,tramp:2.4.3.1}. | ||
| 3063 | 3082 | ||
| 3064 | For @value{tramp} to find the command on the remote, it must be | 3083 | For @value{tramp} to find the command on the remote, it must be |
| 3065 | accessible through the default search path as setup by @value{tramp} | 3084 | accessible through the default search path as setup by @value{tramp} |
| @@ -3254,7 +3273,7 @@ variables. | |||
| 3254 | @vindex async-shell-command-width | 3273 | @vindex async-shell-command-width |
| 3255 | @vindex COLUMNS@r{, environment variable} | 3274 | @vindex COLUMNS@r{, environment variable} |
| 3256 | If Emacs supports the variable @code{async-shell-command-width} (since | 3275 | If Emacs supports the variable @code{async-shell-command-width} (since |
| 3257 | @w{Emacs 27.1}), @value{tramp} cares about its value for asynchronous | 3276 | @w{Emacs 27}), @value{tramp} cares about its value for asynchronous |
| 3258 | shell commands. It specifies the number of display columns for | 3277 | shell commands. It specifies the number of display columns for |
| 3259 | command output. For synchronous shell commands, a similar effect can | 3278 | command output. For synchronous shell commands, a similar effect can |
| 3260 | be achieved by adding the environment variable @env{COLUMNS} to | 3279 | be achieved by adding the environment variable @env{COLUMNS} to |
| @@ -3741,7 +3760,7 @@ row are possible, like @file{/path/to/dir/file.tar.gz.uu/dir/file}. | |||
| 3741 | 3760 | ||
| 3742 | @vindex tramp-archive-all-gvfs-methods | 3761 | @vindex tramp-archive-all-gvfs-methods |
| 3743 | An archive file name could be a remote file name, as in | 3762 | An archive file name could be a remote file name, as in |
| 3744 | @file{/ftp:anonymous@@ftp.gnu.org:/gnu/tramp/tramp-2.3.2.tar.gz/INSTALL}. | 3763 | @file{/ftp:anonymous@@ftp.gnu.org:/gnu/tramp/tramp-2.4.3.tar.gz/INSTALL}. |
| 3745 | Since all file operations are mapped internally to @acronym{GVFS} | 3764 | Since all file operations are mapped internally to @acronym{GVFS} |
| 3746 | operations, remote file names supported by @code{tramp-gvfs} perform | 3765 | operations, remote file names supported by @code{tramp-gvfs} perform |
| 3747 | better, because no local copy of the file archive must be downloaded | 3766 | better, because no local copy of the file archive must be downloaded |
| @@ -3752,7 +3771,7 @@ the similar @samp{/scp:user@@host:...}. See the constant | |||
| 3752 | 3771 | ||
| 3753 | If @code{url-handler-mode} is enabled, archives could be visited via | 3772 | If @code{url-handler-mode} is enabled, archives could be visited via |
| 3754 | URLs, like | 3773 | URLs, like |
| 3755 | @file{https://ftp.gnu.org/gnu/tramp/tramp-2.3.2.tar.gz/INSTALL}. This | 3774 | @file{https://ftp.gnu.org/gnu/tramp/tramp-2.4.3.tar.gz/INSTALL}. This |
| 3756 | allows complex file operations like | 3775 | allows complex file operations like |
| 3757 | 3776 | ||
| 3758 | @lisp | 3777 | @lisp |
| @@ -3760,8 +3779,8 @@ allows complex file operations like | |||
| 3760 | (progn | 3779 | (progn |
| 3761 | (url-handler-mode 1) | 3780 | (url-handler-mode 1) |
| 3762 | (ediff-directories | 3781 | (ediff-directories |
| 3763 | "https://ftp.gnu.org/gnu/tramp/tramp-2.3.1.tar.gz/tramp-2.3.1" | 3782 | "https://ftp.gnu.org/gnu/tramp/tramp-2.4.2.tar.gz/tramp-2.4.2" |
| 3764 | "https://ftp.gnu.org/gnu/tramp/tramp-2.3.2.tar.gz/tramp-2.3.2" "")) | 3783 | "https://ftp.gnu.org/gnu/tramp/tramp-2.4.3.tar.gz/tramp-2.4.3" "")) |
| 3765 | @end group | 3784 | @end group |
| 3766 | @end lisp | 3785 | @end lisp |
| 3767 | 3786 | ||
| @@ -101,19 +101,23 @@ horizontal movements now stop at the edge of the board. | |||
| 101 | 101 | ||
| 102 | * Changes in Specialized Modes and Packages in Emacs 28.1 | 102 | * Changes in Specialized Modes and Packages in Emacs 28.1 |
| 103 | 103 | ||
| 104 | ** EIEIO: 'oset' and 'oset-default' are declared obsolete | 104 | ** EIEIO: 'oset' and 'oset-default' are declared obsolete. |
| 105 | 105 | ||
| 106 | ** New minor mode 'cl-font-lock-built-in-mode' for `lisp-mode' | 106 | ** New minor mode 'cl-font-lock-built-in-mode' for `lisp-mode'. |
| 107 | The mode provides refined highlighting of built-in functions, types, | 107 | The mode provides refined highlighting of built-in functions, types, |
| 108 | and variables. | 108 | and variables. |
| 109 | 109 | ||
| 110 | ** archive-mode | 110 | ** Archive mode |
| 111 | |||
| 111 | *** Can now modify members of 'ar' archives. | 112 | *** Can now modify members of 'ar' archives. |
| 112 | *** Display of summaries unified between backends | ||
| 113 | *** New var 'archive-hidden-columns' and cmd 'archive-hideshow-column' | ||
| 114 | These let you control which columns are displayed and which are kept hidden | ||
| 115 | 113 | ||
| 116 | ** Emacs-Lisp mode | 114 | *** Display of summaries unified between backends. |
| 115 | |||
| 116 | *** New user option 'archive-hidden-columns' and command | ||
| 117 | 'archive-hideshow-column'. These let you control which columns are | ||
| 118 | displayed and which are kept hidden. | ||
| 119 | |||
| 120 | ** Emacs Lisp mode | ||
| 117 | 121 | ||
| 118 | *** The mode-line now indicates whether we're using lexical or dynamic scoping. | 122 | *** The mode-line now indicates whether we're using lexical or dynamic scoping. |
| 119 | 123 | ||
| @@ -158,7 +162,7 @@ this user option. | |||
| 158 | This file was a compatibility kludge which is no longer needed. | 162 | This file was a compatibility kludge which is no longer needed. |
| 159 | 163 | ||
| 160 | --- | 164 | --- |
| 161 | ** 'lisp-mode' now uses 'common-lisp-indent-function'. | 165 | ** Lisp mode now uses 'common-lisp-indent-function'. |
| 162 | To revert to the previous behaviour, | 166 | To revert to the previous behaviour, |
| 163 | '(setq lisp-indent-function 'lisp-indent-function)' from 'lisp-mode-hook'. | 167 | '(setq lisp-indent-function 'lisp-indent-function)' from 'lisp-mode-hook'. |
| 164 | 168 | ||
| @@ -184,7 +188,7 @@ their backends. | |||
| 184 | ** Eshell | 188 | ** Eshell |
| 185 | 189 | ||
| 186 | --- | 190 | --- |
| 187 | *** Environment variable INSIDE_EMACS is now copied to subprocesses. | 191 | *** Environment variable 'INSIDE_EMACS' is now copied to subprocesses. |
| 188 | Its value equals the result of evaluating '(format "%s,eshell" emacs-version)'. | 192 | Its value equals the result of evaluating '(format "%s,eshell" emacs-version)'. |
| 189 | 193 | ||
| 190 | ** Tramp | 194 | ** Tramp |
| @@ -240,7 +244,7 @@ it after GDB quits. A toggle button is also provided under 'Gud -- | |||
| 240 | GDB-Windows'. | 244 | GDB-Windows'. |
| 241 | 245 | ||
| 242 | +++ | 246 | +++ |
| 243 | *** gdb-mi now has a better logic for displaying source buffers | 247 | *** gdb-mi now has a better logic for displaying source buffers. |
| 244 | Now GDB only uses one source window to display source file by default. | 248 | Now GDB only uses one source window to display source file by default. |
| 245 | Customize 'gdb-max-source-window-count' to use more than one window. | 249 | Customize 'gdb-max-source-window-count' to use more than one window. |
| 246 | Control source file display by 'gdb-display-source-buffer-action'. | 250 | Control source file display by 'gdb-display-source-buffer-action'. |
| @@ -259,11 +263,11 @@ case-insensitive matching of messages when the old behaviour is | |||
| 259 | required, but the recommended solution is to use a correctly matching | 263 | required, but the recommended solution is to use a correctly matching |
| 260 | regexp instead. | 264 | regexp instead. |
| 261 | 265 | ||
| 262 | ** Hi-Lock | 266 | ** Hi Lock mode |
| 263 | 267 | ||
| 264 | --- | 268 | --- |
| 265 | *** Matching in 'hi-lock-mode' is case-sensitive when regexp contains | 269 | *** Matching in 'hi-lock-mode' is case-sensitive when regexp contains |
| 266 | upper case characters and `search-upper-case' is non-nil. | 270 | upper case characters and 'search-upper-case' is non-nil. |
| 267 | 'highlight-phrase' also uses 'search-whitespace-regexp' | 271 | 'highlight-phrase' also uses 'search-whitespace-regexp' |
| 268 | to substitute spaces in regexp search. | 272 | to substitute spaces in regexp search. |
| 269 | 273 | ||
| @@ -274,13 +278,13 @@ The new default value is 2000000 (2 megabytes). | |||
| 274 | ** Texinfo | 278 | ** Texinfo |
| 275 | 279 | ||
| 276 | --- | 280 | --- |
| 277 | *** New customizable option 'texinfo-texi2dvi-options'. | 281 | *** New user option 'texinfo-texi2dvi-options'. |
| 278 | This is used when invoking 'texi2dvi' from 'texinfo-tex-buffer'. | 282 | This is used when invoking 'texi2dvi' from 'texinfo-tex-buffer'. |
| 279 | 283 | ||
| 280 | ** Rmail | 284 | ** Rmail |
| 281 | 285 | ||
| 282 | --- | 286 | --- |
| 283 | *** New customizable option 'rmail-re-abbrevs'. | 287 | *** New user option 'rmail-re-abbrevs'. |
| 284 | Its default value matches localized abbreviations of the "reply" | 288 | Its default value matches localized abbreviations of the "reply" |
| 285 | prefix on the Subject line in various languages. | 289 | prefix on the Subject line in various languages. |
| 286 | 290 | ||
| @@ -290,13 +294,13 @@ prefix on the Subject line in various languages. | |||
| 290 | These new navigation commands are bound to 'n' and 'p' in | 294 | These new navigation commands are bound to 'n' and 'p' in |
| 291 | 'apropos-mode'. | 295 | 'apropos-mode'. |
| 292 | 296 | ||
| 293 | ** cc-mode | 297 | ** CC mode |
| 294 | 298 | ||
| 295 | *** Added support for Doxygen documentation style. | 299 | *** Added support for Doxygen documentation style. |
| 296 | ‘doxygen’ is now valid ‘c-doc-comment-style’ which recognises all | 300 | 'doxygen' is now a valid 'c-doc-comment-style' which recognises all |
| 297 | comment styles supported by Doxygen (namely ‘///’, ‘//!’, ‘/** … */’ | 301 | comment styles supported by Doxygen (namely '///', '//!', '/** … */' |
| 298 | and ‘/*! … */’. ‘gtkdoc’ remains the default for C and C++ modes; to | 302 | and '/*! … */'. 'gtkdoc' remains the default for C and C++ modes; to |
| 299 | use ‘doxygen’ by default one might evaluate: | 303 | use 'doxygen' by default one might evaluate: |
| 300 | 304 | ||
| 301 | (setq-default c-doc-comment-style | 305 | (setq-default c-doc-comment-style |
| 302 | '((java-mode . javadoc) | 306 | '((java-mode . javadoc) |
| @@ -304,17 +308,17 @@ use ‘doxygen’ by default one might evaluate: | |||
| 304 | (c-mode . doxygen) | 308 | (c-mode . doxygen) |
| 305 | (c++-mode . doxygen))) | 309 | (c++-mode . doxygen))) |
| 306 | 310 | ||
| 307 | or use it in a custom ‘c-style’. | 311 | or use it in a custom 'c-style'. |
| 308 | 312 | ||
| 309 | *** Added support to line up ‘?’ and ‘:’ of a ternary operator. | 313 | *** Added support to line up '?' and ':' of a ternary operator. |
| 310 | The new ‘c-lineup-ternary-bodies’ function can be used as a lineup | 314 | The new 'c-lineup-ternary-bodies' function can be used as a lineup |
| 311 | function to align question mark and colon which are part of a ternary | 315 | function to align question mark and colon which are part of a ternary |
| 312 | operator (‘?:’). For example: | 316 | operator ('?:'). For example: |
| 313 | 317 | ||
| 314 | return arg % 2 == 0 ? arg / 2 | 318 | return arg % 2 == 0 ? arg / 2 |
| 315 | : (3 * arg + 1); | 319 | : (3 * arg + 1); |
| 316 | 320 | ||
| 317 | To enable, add it to appropriate entries in ‘c-offsets-alist’, e.g.: | 321 | To enable, add it to appropriate entries in 'c-offsets-alist', e.g.: |
| 318 | 322 | ||
| 319 | (c-set-offset 'arglist-cont '(c-lineup-ternary-bodies | 323 | (c-set-offset 'arglist-cont '(c-lineup-ternary-bodies |
| 320 | c-lineup-gcc-asm-reg)) | 324 | c-lineup-gcc-asm-reg)) |
| @@ -325,20 +329,21 @@ To enable, add it to appropriate entries in ‘c-offsets-alist’, e.g.: | |||
| 325 | 329 | ||
| 326 | ** browse-url | 330 | ** browse-url |
| 327 | 331 | ||
| 328 | *** Added support for custom URL handlers | 332 | *** Added support for custom URL handlers. |
| 329 | 333 | ||
| 330 | There is a new defvar 'browse-url-default-handlers' and a defcustom | 334 | There is a new variable 'browse-url-default-handlers' and a user |
| 331 | 'browse-url-handlers' being alists with (REGEXP-OR-PREDICATE | 335 | option 'browse-url-handlers' being alists with '(REGEXP-OR-PREDICATE |
| 332 | . FUNCTION) entries allowing to define different browsing FUNCTIONs | 336 | . FUNCTION)' entries allowing to define different browsing FUNCTIONs |
| 333 | depending on the URL to be browsed. The defvar is for default | 337 | depending on the URL to be browsed. The variable is for default |
| 334 | handlers provided by Emacs itself or external packages, the defcustom | 338 | handlers provided by Emacs itself or external packages, the user |
| 335 | is for the user (and allows for overriding the default handlers). | 339 | option is for the user (and allows for overriding the default |
| 340 | handlers). | ||
| 336 | 341 | ||
| 337 | Formerly, one could do the same by setting | 342 | Formerly, one could do the same by setting |
| 338 | 'browse-url-browser-function' to such an alist. This usage is still | 343 | 'browse-url-browser-function' to such an alist. This usage is still |
| 339 | supported but deprecated. | 344 | supported but deprecated. |
| 340 | 345 | ||
| 341 | *** Categorization of browsing functions in internal vs. external | 346 | *** Categorization of browsing functions in internal vs. external. |
| 342 | 347 | ||
| 343 | All standard browsing functions such as 'browse-url-firefox', | 348 | All standard browsing functions such as 'browse-url-firefox', |
| 344 | 'browse-url-mail', or 'eww' have been categorized into internal (URL | 349 | 'browse-url-mail', or 'eww' have been categorized into internal (URL |
| @@ -351,10 +356,11 @@ either an internal or external browser. | |||
| 351 | 356 | ||
| 352 | * New Modes and Packages in Emacs 28.1 | 357 | * New Modes and Packages in Emacs 28.1 |
| 353 | 358 | ||
| 354 | *** Lisp Data mode | 359 | ** Lisp Data mode |
| 360 | |||
| 355 | The new command 'lisp-data-mode' enables a major mode for buffers | 361 | The new command 'lisp-data-mode' enables a major mode for buffers |
| 356 | composed of Lisp symbolic expressions that do not form a computer | 362 | composed of Lisp symbolic expressions that do not form a computer |
| 357 | program. The '.dir-locals.el' file is automatically set to use this | 363 | program. The ".dir-locals.el" file is automatically set to use this |
| 358 | mode, as are other data files produced by Emacs. | 364 | mode, as are other data files produced by Emacs. |
| 359 | 365 | ||
| 360 | 366 | ||
| @@ -397,9 +403,17 @@ This is no longer supported, and setting this variable has no effect. | |||
| 397 | ** The macro 'with-displayed-buffer-window' is now obsolete. | 403 | ** The macro 'with-displayed-buffer-window' is now obsolete. |
| 398 | Use macro 'with-current-buffer-window' with action alist entry 'body-function'. | 404 | Use macro 'with-current-buffer-window' with action alist entry 'body-function'. |
| 399 | 405 | ||
| 406 | --- | ||
| 407 | ** Some libraries obsolete since Emacs 23 have been removed: | ||
| 408 | 'ledit.el', 'lmenu.el', 'lucid.el and 'old-whitespace.el'. | ||
| 409 | |||
| 400 | 410 | ||
| 401 | * Lisp Changes in Emacs 28.1 | 411 | * Lisp Changes in Emacs 28.1 |
| 402 | 412 | ||
| 413 | +++ | ||
| 414 | ** New function 'file-modes-number-to-symbolic' to convert a numeric | ||
| 415 | file mode specification into symbolic form. | ||
| 416 | |||
| 403 | ** New macro 'dlet' to dynamically bind variables. | 417 | ** New macro 'dlet' to dynamically bind variables. |
| 404 | 418 | ||
| 405 | ** The variable 'force-new-style-backquotes' has been removed. | 419 | ** The variable 'force-new-style-backquotes' has been removed. |
| @@ -428,23 +442,28 @@ such as "2020-01-15T16:12:21-08:00". | |||
| 428 | ** The new function 'dom-remove-attribute' has been added. | 442 | ** The new function 'dom-remove-attribute' has been added. |
| 429 | 443 | ||
| 430 | --- | 444 | --- |
| 431 | ** 'make-network-process', 'make-serial-process' :coding behavior change. | 445 | ** 'make-network-process', 'make-serial-process' ':coding' behavior change. |
| 432 | Previously, passing ":coding nil" to either of these functions would | 446 | Previously, passing ':coding nil' to either of these functions would |
| 433 | override any non-nil binding for 'coding-system-for-read' and | 447 | override any non-nil binding for 'coding-system-for-read' and |
| 434 | 'coding-system-for-write'. For consistency with 'make-process' and | 448 | 'coding-system-for-write'. For consistency with 'make-process' and |
| 435 | 'make-pipe-process', passing ":coding nil" is now ignored. No code in | 449 | 'make-pipe-process', passing ':coding nil' is now ignored. No code in |
| 436 | Emacs depended on the previous behavior; if you really want the | 450 | Emacs depended on the previous behavior; if you really want the |
| 437 | process' coding-system to be nil, use 'set-process-coding-system' | 451 | process' coding-system to be nil, use 'set-process-coding-system' |
| 438 | after the process has been created, or pass in ":coding '(nil nil)". | 452 | after the process has been created, or pass in ':coding '(nil nil)'. |
| 439 | 453 | ||
| 440 | +++ | 454 | +++ |
| 441 | ** 'open-network-stream' now accepts a :coding argument. | 455 | ** 'open-network-stream' now accepts a ':coding' argument. |
| 442 | This allows specifying the coding systems used by a network process | 456 | This allows specifying the coding systems used by a network process |
| 443 | for encoding and decoding without having to bind | 457 | for encoding and decoding without having to bind |
| 444 | coding-system-for-{read,write} or call 'set-process-coding-system'. | 458 | 'coding-system-for-{read,write}' or call 'set-process-coding-system'. |
| 459 | |||
| 460 | +++ | ||
| 461 | ** 'open-gnutls-stream' now also accepts a ':coding' argument. | ||
| 445 | 462 | ||
| 446 | +++ | 463 | +++ |
| 447 | ** 'open-gnutls-stream' now also accepts a :coding argument. | 464 | ** New user option 'process-file-return-signal-string'. |
| 465 | It controls, whether 'process-file' returns a string when a remote | ||
| 466 | process is interrupted by a signal. | ||
| 448 | 467 | ||
| 449 | 468 | ||
| 450 | * Changes in Emacs 28.1 on Non-Free Operating Systems | 469 | * Changes in Emacs 28.1 on Non-Free Operating Systems |
| @@ -465,12 +484,12 @@ current IME activation status. | |||
| 465 | ** On MS-Windows, Emacs can now use the native image API to display images. | 484 | ** On MS-Windows, Emacs can now use the native image API to display images. |
| 466 | Emacs can now use the MS-Windows GDI+ library to load and display | 485 | Emacs can now use the MS-Windows GDI+ library to load and display |
| 467 | images in JPEG, PNG, GIF and TIFF formats. This support is enabled | 486 | images in JPEG, PNG, GIF and TIFF formats. This support is enabled |
| 468 | unless Emacs was configured --without-native-image-api. | 487 | unless Emacs was configured '--without-native-image-api'. |
| 469 | 488 | ||
| 470 | This feature is experimental, and needs to be turned on to be used. | 489 | This feature is experimental, and needs to be turned on to be used. |
| 471 | To turn this on, set the variable 'w32-use-native-image-API' to a | 490 | To turn this on, set the variable 'w32-use-native-image-API' to a |
| 472 | non-nil value. Please report any bugs you find while using the native | 491 | non-nil value. Please report any bugs you find while using the native |
| 473 | image API via "M-x report-emacs-bug". | 492 | image API via 'M-x report-emacs-bug'. |
| 474 | 493 | ||
| 475 | 494 | ||
| 476 | ---------------------------------------------------------------------- | 495 | ---------------------------------------------------------------------- |
diff --git a/etc/themes/misterioso-theme.el b/etc/themes/misterioso-theme.el index 8161dbd9e94..ff9af0c7440 100644 --- a/etc/themes/misterioso-theme.el +++ b/etc/themes/misterioso-theme.el | |||
| @@ -63,6 +63,13 @@ | |||
| 63 | `(button ((,class (:underline t)))) | 63 | `(button ((,class (:underline t)))) |
| 64 | `(link ((,class (:foreground "#59e9ff" :underline t)))) | 64 | `(link ((,class (:foreground "#59e9ff" :underline t)))) |
| 65 | `(link-visited ((,class (:foreground "#ed74cd" :underline t)))) | 65 | `(link-visited ((,class (:foreground "#ed74cd" :underline t)))) |
| 66 | ;; Ediff | ||
| 67 | `(ediff-even-diff-A ((,class (:background "#1d2430")))) | ||
| 68 | `(ediff-even-diff-B ((,class (:background "#1d2430")))) | ||
| 69 | `(ediff-even-diff-C ((,class (:background "#1d2430")))) | ||
| 70 | `(ediff-odd-diff-A ((,class (:background "#415160")))) | ||
| 71 | `(ediff-odd-diff-B ((,class (:background "#415160")))) | ||
| 72 | `(ediff-odd-diff-C ((,class (:background "#415160")))) | ||
| 66 | ;; Gnus faces | 73 | ;; Gnus faces |
| 67 | `(gnus-group-news-1 ((,class (:foreground "#ff4242" :weight bold)))) | 74 | `(gnus-group-news-1 ((,class (:foreground "#ff4242" :weight bold)))) |
| 68 | `(gnus-group-news-1-low ((,class (:foreground "#ff4242")))) | 75 | `(gnus-group-news-1-low ((,class (:foreground "#ff4242")))) |
diff --git a/lisp/abbrev.el b/lisp/abbrev.el index 190b3504fa7..2d61a96010e 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el | |||
| @@ -255,11 +255,7 @@ have been saved." | |||
| 255 | (if (abbrev--table-symbols table) | 255 | (if (abbrev--table-symbols table) |
| 256 | (insert-abbrev-table-description table nil))) | 256 | (insert-abbrev-table-description table nil))) |
| 257 | (when (unencodable-char-position (point-min) (point-max) 'utf-8) | 257 | (when (unencodable-char-position (point-min) (point-max) 'utf-8) |
| 258 | (setq coding-system-for-write | 258 | (setq coding-system-for-write 'utf-8-emacs)) |
| 259 | (if (> emacs-major-version 24) | ||
| 260 | 'utf-8-emacs | ||
| 261 | ;; For compatibility with Emacs 22 (See Bug#8308) | ||
| 262 | 'emacs-mule))) | ||
| 263 | (goto-char (point-min)) | 259 | (goto-char (point-min)) |
| 264 | (insert (format ";;-*-coding: %s;-*-\n" coding-system-for-write)) | 260 | (insert (format ";;-*-coding: %s;-*-\n" coding-system-for-write)) |
| 265 | (write-region nil nil file nil (and (not verbose) 0))))) | 261 | (write-region nil nil file nil (and (not verbose) 0))))) |
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index c918f06c80e..6781c292d82 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el | |||
| @@ -563,28 +563,8 @@ in which case a second argument, length LEN, should be supplied." | |||
| 563 | (aref str (- len i))))) | 563 | (aref str (- len i))))) |
| 564 | result)) | 564 | result)) |
| 565 | 565 | ||
| 566 | (defun archive-int-to-mode (mode) | 566 | (define-obsolete-function-alias 'archive-int-to-mode |
| 567 | "Turn an integer like 0700 (i.e., 448) into a mode string like -rwx------." | 567 | 'file-modes-number-to-symbolic "28.1") |
| 568 | ;; FIXME: merge with tar-grind-file-mode. | ||
| 569 | (if (null mode) | ||
| 570 | "??????????" | ||
| 571 | (string | ||
| 572 | (if (zerop (logand 8192 mode)) | ||
| 573 | (if (zerop (logand 16384 mode)) ?- ?d) | ||
| 574 | ?c) ; completeness | ||
| 575 | (if (zerop (logand 256 mode)) ?- ?r) | ||
| 576 | (if (zerop (logand 128 mode)) ?- ?w) | ||
| 577 | (if (zerop (logand 64 mode)) | ||
| 578 | (if (zerop (logand 2048 mode)) ?- ?S) | ||
| 579 | (if (zerop (logand 2048 mode)) ?x ?s)) | ||
| 580 | (if (zerop (logand 32 mode)) ?- ?r) | ||
| 581 | (if (zerop (logand 16 mode)) ?- ?w) | ||
| 582 | (if (zerop (logand 8 mode)) | ||
| 583 | (if (zerop (logand 1024 mode)) ?- ?S) | ||
| 584 | (if (zerop (logand 1024 mode)) ?x ?s)) | ||
| 585 | (if (zerop (logand 4 mode)) ?- ?r) | ||
| 586 | (if (zerop (logand 2 mode)) ?- ?w) | ||
| 587 | (if (zerop (logand 1 mode)) ?- ?x)))) | ||
| 588 | 568 | ||
| 589 | (defun archive-calc-mode (oldmode newmode) | 569 | (defun archive-calc-mode (oldmode newmode) |
| 590 | "From the integer OLDMODE and the string NEWMODE calculate a new file mode. | 570 | "From the integer OLDMODE and the string NEWMODE calculate a new file mode. |
| @@ -1526,7 +1506,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself." | |||
| 1526 | (timelen (length (archive--file-desc-time sample))) | 1506 | (timelen (length (archive--file-desc-time sample))) |
| 1527 | (samplemode (and (archive--enabled-p 'Mode) | 1507 | (samplemode (and (archive--enabled-p 'Mode) |
| 1528 | (archive--file-desc-mode sample))) | 1508 | (archive--file-desc-mode sample))) |
| 1529 | (modelen (length (if samplemode (archive-int-to-mode samplemode))))) | 1509 | (modelen (length (if samplemode (file-modes-number-to-symbolic samplemode))))) |
| 1530 | (dolist (desc descs) | 1510 | (dolist (desc descs) |
| 1531 | (when ids | 1511 | (when ids |
| 1532 | (let* ((uid (archive--file-desc-uid desc)) | 1512 | (let* ((uid (archive--file-desc-uid desc)) |
| @@ -1573,7 +1553,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself." | |||
| 1573 | (text | 1553 | (text |
| 1574 | (concat " " | 1554 | (concat " " |
| 1575 | (when (> modelen 0) | 1555 | (when (> modelen 0) |
| 1576 | (concat (archive-int-to-mode | 1556 | (concat (file-modes-number-to-symbolic |
| 1577 | (archive--file-desc-mode desc)) | 1557 | (archive--file-desc-mode desc)) |
| 1578 | " ")) | 1558 | " ")) |
| 1579 | (when ids | 1559 | (when ids |
diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 0fa77ed3224..5bb16981711 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el | |||
| @@ -1723,7 +1723,7 @@ deletion, or > if it is flagged for displaying." | |||
| 1723 | ;; according to `bookmark-bookmarks-timestamp'. | 1723 | ;; according to `bookmark-bookmarks-timestamp'. |
| 1724 | (defun bookmark-bmenu-set-header () | 1724 | (defun bookmark-bmenu-set-header () |
| 1725 | "Set the immutable header line." | 1725 | "Set the immutable header line." |
| 1726 | (let ((header (concat "%% " "Bookmark"))) | 1726 | (let ((header (copy-sequence "%% Bookmark"))) |
| 1727 | (when bookmark-bmenu-toggle-filenames | 1727 | (when bookmark-bmenu-toggle-filenames |
| 1728 | (setq header (concat header | 1728 | (setq header (concat header |
| 1729 | (make-string (- bookmark-bmenu-file-column | 1729 | (make-string (- bookmark-bmenu-file-column |
diff --git a/lisp/button.el b/lisp/button.el index 3a6a6de774c..f969a03cb02 100644 --- a/lisp/button.el +++ b/lisp/button.el | |||
| @@ -349,7 +349,7 @@ Also see `insert-text-button'." | |||
| 349 | (or (plist-member properties 'type) | 349 | (or (plist-member properties 'type) |
| 350 | (plist-member properties :type)))) | 350 | (plist-member properties :type)))) |
| 351 | (when (stringp beg) | 351 | (when (stringp beg) |
| 352 | (setq object beg beg 0 end (length object))) | 352 | (setq object (copy-sequence beg) beg 0 end (length object))) |
| 353 | ;; Disallow setting the `category' property directly. | 353 | ;; Disallow setting the `category' property directly. |
| 354 | (when (plist-get properties 'category) | 354 | (when (plist-get properties 'category) |
| 355 | (error "Button `category' property may not be set directly")) | 355 | (error "Button `category' property may not be set directly")) |
diff --git a/lisp/calc/calc-comb.el b/lisp/calc/calc-comb.el index d4562a0cc86..c5d4d0837e7 100644 --- a/lisp/calc/calc-comb.el +++ b/lisp/calc/calc-comb.el | |||
| @@ -241,8 +241,8 @@ | |||
| 241 | (calcFunc-gcd (math-neg a) b)) | 241 | (calcFunc-gcd (math-neg a) b)) |
| 242 | ((Math-looks-negp b) | 242 | ((Math-looks-negp b) |
| 243 | (calcFunc-gcd a (math-neg b))) | 243 | (calcFunc-gcd a (math-neg b))) |
| 244 | ((Math-zerop a) b) | 244 | ((Math-zerop a) (math-abs b)) |
| 245 | ((Math-zerop b) a) | 245 | ((Math-zerop b) (math-abs a)) |
| 246 | ((and (Math-ratp a) | 246 | ((and (Math-ratp a) |
| 247 | (Math-ratp b)) | 247 | (Math-ratp b)) |
| 248 | (math-make-frac (math-gcd (if (eq (car-safe a) 'frac) (nth 1 a) a) | 248 | (math-make-frac (math-gcd (if (eq (car-safe a) 'frac) (nth 1 a) a) |
diff --git a/lisp/calc/calc-mtx.el b/lisp/calc/calc-mtx.el index fe241b57c60..2850b33721b 100644 --- a/lisp/calc/calc-mtx.el +++ b/lisp/calc/calc-mtx.el | |||
| @@ -275,7 +275,7 @@ in LUD decomposition." | |||
| 275 | k (1+ k))) | 275 | k (1+ k))) |
| 276 | (setcar (nthcdr j (nth i lu)) sum) | 276 | (setcar (nthcdr j (nth i lu)) sum) |
| 277 | (let ((dum (math-lud-pivot-check sum))) | 277 | (let ((dum (math-lud-pivot-check sum))) |
| 278 | (if (Math-lessp big dum) | 278 | (if (or (math-zerop big) (Math-lessp big dum)) |
| 279 | (setq big dum | 279 | (setq big dum |
| 280 | imax i))) | 280 | imax i))) |
| 281 | (setq i (1+ i))) | 281 | (setq i (1+ i))) |
diff --git a/lisp/cedet/data-debug.el b/lisp/cedet/data-debug.el index 075e122e79d..604fc40926c 100644 --- a/lisp/cedet/data-debug.el +++ b/lisp/cedet/data-debug.el | |||
| @@ -49,9 +49,9 @@ | |||
| 49 | 49 | ||
| 50 | ;;; Compatibility | 50 | ;;; Compatibility |
| 51 | ;; | 51 | ;; |
| 52 | (defalias 'data-debug-overlay-properties 'overlay-properties) | 52 | (define-obsolete-function-alias 'data-debug-overlay-properties 'overlay-properties "28.1") |
| 53 | (defalias 'data-debug-overlay-p 'overlayp) | 53 | (define-obsolete-function-alias 'data-debug-overlay-p 'overlayp "28.1") |
| 54 | (defalias 'dd-propertize 'propertize) | 54 | (define-obsolete-function-alias 'dd-propertize 'propertize "28.1") |
| 55 | 55 | ||
| 56 | ;;; GENERIC STUFF | 56 | ;;; GENERIC STUFF |
| 57 | ;; | 57 | ;; |
| @@ -73,7 +73,7 @@ The attributes belong to the tag PARENT." | |||
| 73 | "Insert all the parts of OVERLAY. | 73 | "Insert all the parts of OVERLAY. |
| 74 | PREFIX specifies what to insert at the start of each line." | 74 | PREFIX specifies what to insert at the start of each line." |
| 75 | (let ((attrprefix (concat (make-string (length prefix) ? ) "# ")) | 75 | (let ((attrprefix (concat (make-string (length prefix) ? ) "# ")) |
| 76 | (proplist (data-debug-overlay-properties overlay))) | 76 | (proplist (overlay-properties overlay))) |
| 77 | (data-debug-insert-property-list | 77 | (data-debug-insert-property-list |
| 78 | proplist attrprefix) | 78 | proplist attrprefix) |
| 79 | ) | 79 | ) |
| @@ -393,10 +393,10 @@ PREBUTTONTEXT is some text between prefix and the stuff list button." | |||
| 393 | (lambda (key value) | 393 | (lambda (key value) |
| 394 | (data-debug-insert-thing | 394 | (data-debug-insert-thing |
| 395 | key prefix | 395 | key prefix |
| 396 | (dd-propertize "key " 'face font-lock-comment-face)) | 396 | (propertize "key " 'face font-lock-comment-face)) |
| 397 | (data-debug-insert-thing | 397 | (data-debug-insert-thing |
| 398 | value prefix | 398 | value prefix |
| 399 | (dd-propertize "val " 'face font-lock-comment-face))) | 399 | (propertize "val " 'face font-lock-comment-face))) |
| 400 | hash-table)) | 400 | hash-table)) |
| 401 | 401 | ||
| 402 | (defun data-debug-insert-hash-table-from-point (point) | 402 | (defun data-debug-insert-hash-table-from-point (point) |
| @@ -415,9 +415,9 @@ PREBUTTONTEXT is some text between prefix and the stuff list button." | |||
| 415 | 415 | ||
| 416 | (defun data-debug-insert-hash-table-button (hash-table prefix prebuttontext) | 416 | (defun data-debug-insert-hash-table-button (hash-table prefix prebuttontext) |
| 417 | "Insert HASH-TABLE as expandable button with recursive prefix PREFIX and PREBUTTONTEXT in front of the button text." | 417 | "Insert HASH-TABLE as expandable button with recursive prefix PREFIX and PREBUTTONTEXT in front of the button text." |
| 418 | (let ((string (dd-propertize (format "%s" hash-table) | 418 | (let ((string (propertize (format "%s" hash-table) |
| 419 | 'face 'font-lock-keyword-face))) | 419 | 'face 'font-lock-keyword-face))) |
| 420 | (insert (dd-propertize | 420 | (insert (propertize |
| 421 | (concat prefix prebuttontext string) | 421 | (concat prefix prebuttontext string) |
| 422 | 'ddebug hash-table | 422 | 'ddebug hash-table |
| 423 | 'ddebug-indent (length prefix) | 423 | 'ddebug-indent (length prefix) |
| @@ -444,7 +444,7 @@ PREBUTTONTEXT is some text between prefix and the stuff list button." | |||
| 444 | (data-debug-insert-thing (car (cdr rest)) | 444 | (data-debug-insert-thing (car (cdr rest)) |
| 445 | prefix | 445 | prefix |
| 446 | (concat | 446 | (concat |
| 447 | (dd-propertize (format "%s" (car rest)) | 447 | (propertize (format "%s" (car rest)) |
| 448 | 'face font-lock-comment-face) | 448 | 'face font-lock-comment-face) |
| 449 | " : ")) | 449 | " : ")) |
| 450 | (setq rest (cdr (cdr rest)))) | 450 | (setq rest (cdr (cdr rest)))) |
| @@ -468,9 +468,9 @@ PREBUTTONTEXT is some text between prefix and the stuff list button." | |||
| 468 | A Symbol is a simple thing, but this provides some face and prefix rules. | 468 | A Symbol is a simple thing, but this provides some face and prefix rules. |
| 469 | PREFIX is the text that precedes the button. | 469 | PREFIX is the text that precedes the button. |
| 470 | PREBUTTONTEXT is some text between prefix and the thing." | 470 | PREBUTTONTEXT is some text between prefix and the thing." |
| 471 | (let ((string (dd-propertize (format "#<WIDGET %s>" (car widget)) | 471 | (let ((string (propertize (format "#<WIDGET %s>" (car widget)) |
| 472 | 'face 'font-lock-keyword-face))) | 472 | 'face 'font-lock-keyword-face))) |
| 473 | (insert (dd-propertize | 473 | (insert (propertize |
| 474 | (concat prefix prebuttontext string) | 474 | (concat prefix prebuttontext string) |
| 475 | 'ddebug widget | 475 | 'ddebug widget |
| 476 | 'ddebug-indent (length prefix) | 476 | 'ddebug-indent (length prefix) |
| @@ -613,7 +613,7 @@ PREBUTTONTEXT is some text between prefix and the stuff vector button." | |||
| 613 | (symbol-value symbol) | 613 | (symbol-value symbol) |
| 614 | (concat (make-string indent ? ) "> ") | 614 | (concat (make-string indent ? ) "> ") |
| 615 | (concat | 615 | (concat |
| 616 | (dd-propertize "value" | 616 | (propertize "value" |
| 617 | 'face 'font-lock-comment-face) | 617 | 'face 'font-lock-comment-face) |
| 618 | " "))) | 618 | " "))) |
| 619 | (data-debug-insert-property-list | 619 | (data-debug-insert-property-list |
| @@ -628,13 +628,13 @@ PREFIX is the text that precedes the button. | |||
| 628 | PREBUTTONTEXT is some text between prefix and the symbol button." | 628 | PREBUTTONTEXT is some text between prefix and the symbol button." |
| 629 | (let ((string | 629 | (let ((string |
| 630 | (cond ((fboundp symbol) | 630 | (cond ((fboundp symbol) |
| 631 | (dd-propertize (concat "#'" (symbol-name symbol)) | 631 | (propertize (concat "#'" (symbol-name symbol)) |
| 632 | 'face 'font-lock-function-name-face)) | 632 | 'face 'font-lock-function-name-face)) |
| 633 | ((boundp symbol) | 633 | ((boundp symbol) |
| 634 | (dd-propertize (concat "'" (symbol-name symbol)) | 634 | (propertize (concat "'" (symbol-name symbol)) |
| 635 | 'face 'font-lock-variable-name-face)) | 635 | 'face 'font-lock-variable-name-face)) |
| 636 | (t (format "'%s" symbol))))) | 636 | (t (format "'%s" symbol))))) |
| 637 | (insert (dd-propertize | 637 | (insert (propertize |
| 638 | (concat prefix prebuttontext string) | 638 | (concat prefix prebuttontext string) |
| 639 | 'ddebug symbol | 639 | 'ddebug symbol |
| 640 | 'ddebug-indent (length prefix) | 640 | 'ddebug-indent (length prefix) |
| @@ -657,7 +657,7 @@ PREBUTTONTEXT is some text between prefix and the thing." | |||
| 657 | (while (string-match "\t" newstr) | 657 | (while (string-match "\t" newstr) |
| 658 | (setq newstr (replace-match "\\t" t t newstr))) | 658 | (setq newstr (replace-match "\\t" t t newstr))) |
| 659 | (insert prefix prebuttontext | 659 | (insert prefix prebuttontext |
| 660 | (dd-propertize (format "\"%s\"" newstr) | 660 | (propertize (format "\"%s\"" newstr) |
| 661 | 'face font-lock-string-face) | 661 | 'face font-lock-string-face) |
| 662 | "\n" ))) | 662 | "\n" ))) |
| 663 | 663 | ||
| @@ -668,7 +668,7 @@ A Symbol is a simple thing, but this provides some face and prefix rules. | |||
| 668 | PREFIX is the text that precedes the button. | 668 | PREFIX is the text that precedes the button. |
| 669 | PREBUTTONTEXT is some text between prefix and the thing." | 669 | PREBUTTONTEXT is some text between prefix and the thing." |
| 670 | (insert prefix prebuttontext | 670 | (insert prefix prebuttontext |
| 671 | (dd-propertize (format "%S" thing) | 671 | (propertize (format "%S" thing) |
| 672 | 'face font-lock-string-face) | 672 | 'face font-lock-string-face) |
| 673 | "\n")) | 673 | "\n")) |
| 674 | 674 | ||
| @@ -737,10 +737,10 @@ FACE is the face to use." | |||
| 737 | (null . data-debug-insert-nil) | 737 | (null . data-debug-insert-nil) |
| 738 | 738 | ||
| 739 | ;; Overlay | 739 | ;; Overlay |
| 740 | (data-debug-overlay-p . data-debug-insert-overlay-button) | 740 | (overlayp . data-debug-insert-overlay-button) |
| 741 | 741 | ||
| 742 | ;; Overlay list | 742 | ;; Overlay list |
| 743 | ((lambda (thing) (and (consp thing) (data-debug-overlay-p (car thing)))) . | 743 | ((lambda (thing) (and (consp thing) (overlayp (car thing)))) . |
| 744 | data-debug-insert-overlay-list-button) | 744 | data-debug-insert-overlay-list-button) |
| 745 | 745 | ||
| 746 | ;; Buffer | 746 | ;; Buffer |
diff --git a/lisp/cedet/semantic/wisent/comp.el b/lisp/cedet/semantic/wisent/comp.el index 4e9927f23f1..42c5756b987 100644 --- a/lisp/cedet/semantic/wisent/comp.el +++ b/lisp/cedet/semantic/wisent/comp.el | |||
| @@ -3053,7 +3053,7 @@ one.") | |||
| 3053 | 3053 | ||
| 3054 | (defsubst wisent-ISVALID-TOKEN (x) | 3054 | (defsubst wisent-ISVALID-TOKEN (x) |
| 3055 | "Return non-nil if X is a character or an allowed symbol." | 3055 | "Return non-nil if X is a character or an allowed symbol." |
| 3056 | (or (wisent-char-p x) | 3056 | (or (characterp x) |
| 3057 | (wisent-ISVALID-VAR x))) | 3057 | (wisent-ISVALID-VAR x))) |
| 3058 | 3058 | ||
| 3059 | (defun wisent-push-token (symbol &optional nocheck) | 3059 | (defun wisent-push-token (symbol &optional nocheck) |
| @@ -3143,7 +3143,7 @@ the rule." | |||
| 3143 | (cond | 3143 | (cond |
| 3144 | ((or (memq item token-list) (memq item var-list))) | 3144 | ((or (memq item token-list) (memq item var-list))) |
| 3145 | ;; Create new literal character token | 3145 | ;; Create new literal character token |
| 3146 | ((wisent-char-p item) (wisent-push-token item t)) | 3146 | ((characterp item) (wisent-push-token item t)) |
| 3147 | ((error "Symbol `%s' is used, but is not defined as a token and has no rules" | 3147 | ((error "Symbol `%s' is used, but is not defined as a token and has no rules" |
| 3148 | item)))) | 3148 | item)))) |
| 3149 | (setq rhl (1+ rhl) | 3149 | (setq rhl (1+ rhl) |
diff --git a/lisp/cedet/semantic/wisent/wisent.el b/lisp/cedet/semantic/wisent/wisent.el index d8a35d3e7d3..a0a8bed1eaf 100644 --- a/lisp/cedet/semantic/wisent/wisent.el +++ b/lisp/cedet/semantic/wisent/wisent.el | |||
| @@ -55,11 +55,8 @@ | |||
| 55 | ;;;; Runtime stuff | 55 | ;;;; Runtime stuff |
| 56 | ;;;; ------------- | 56 | ;;;; ------------- |
| 57 | 57 | ||
| 58 | ;;; Compatibility | 58 | (define-obsolete-function-alias 'wisent-char-p |
| 59 | (eval-and-compile | 59 | #'characterp "28.1") |
| 60 | (if (fboundp 'char-valid-p) | ||
| 61 | (defalias 'wisent-char-p 'char-valid-p) | ||
| 62 | (defalias 'wisent-char-p 'char-or-char-int-p))) | ||
| 63 | 60 | ||
| 64 | ;;; Printed representation of terminals and nonterminals | 61 | ;;; Printed representation of terminals and nonterminals |
| 65 | (defconst wisent-escape-sequence-strings | 62 | (defconst wisent-escape-sequence-strings |
| @@ -80,7 +77,7 @@ | |||
| 80 | (defsubst wisent-item-to-string (item) | 77 | (defsubst wisent-item-to-string (item) |
| 81 | "Return a printed representation of ITEM. | 78 | "Return a printed representation of ITEM. |
| 82 | ITEM can be a nonterminal or terminal symbol, or a character literal." | 79 | ITEM can be a nonterminal or terminal symbol, or a character literal." |
| 83 | (if (wisent-char-p item) | 80 | (if (characterp item) |
| 84 | (or (cdr (assq item wisent-escape-sequence-strings)) | 81 | (or (cdr (assq item wisent-escape-sequence-strings)) |
| 85 | (format "'%c'" item)) | 82 | (format "'%c'" item)) |
| 86 | (symbol-name item))) | 83 | (symbol-name item))) |
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 60a352d78e0..24ebfa4b0de 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el | |||
| @@ -2006,10 +2006,9 @@ Optional arg HOW-TO determines how to treat the target. | |||
| 2006 | (format prompt (dired-mark-prompt arg files)) dir default)) | 2006 | (format prompt (dired-mark-prompt arg files)) dir default)) |
| 2007 | 2007 | ||
| 2008 | (defun dired-dwim-target-directories () | 2008 | (defun dired-dwim-target-directories () |
| 2009 | (cond ((functionp dired-dwim-target) | 2009 | (if (functionp dired-dwim-target) |
| 2010 | (funcall dired-dwim-target)) | 2010 | (funcall dired-dwim-target) |
| 2011 | (dired-dwim-target | 2011 | (dired-dwim-target-next))) |
| 2012 | (dired-dwim-target-next)))) | ||
| 2013 | 2012 | ||
| 2014 | (defun dired-dwim-target-next (&optional all-frames) | 2013 | (defun dired-dwim-target-next (&optional all-frames) |
| 2015 | ;; Return directories from all next windows with dired-mode buffers. | 2014 | ;; Return directories from all next windows with dired-mode buffers. |
diff --git a/lisp/dired.el b/lisp/dired.el index 14bbb28db52..aad44a6d698 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -3717,8 +3717,8 @@ in the active region." | |||
| 3717 | 3717 | ||
| 3718 | (defun dired-toggle-marks () | 3718 | (defun dired-toggle-marks () |
| 3719 | "Toggle marks: marked files become unmarked, and vice versa. | 3719 | "Toggle marks: marked files become unmarked, and vice versa. |
| 3720 | Files marked with other flags (such as `D') are not affected. | 3720 | Flagged files (indicated with flags such as `C' and `D', not |
| 3721 | `.' and `..' are never toggled. | 3721 | with `*') are not affected, and `.' and `..' are never toggled. |
| 3722 | As always, hidden subdirs are not affected." | 3722 | As always, hidden subdirs are not affected." |
| 3723 | (interactive) | 3723 | (interactive) |
| 3724 | (save-excursion | 3724 | (save-excursion |
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 4f72251aed5..62b82e4f32a 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el | |||
| @@ -1509,7 +1509,7 @@ | |||
| 1509 | byte-current-buffer byte-stack-ref)) | 1509 | byte-current-buffer byte-stack-ref)) |
| 1510 | 1510 | ||
| 1511 | (defconst byte-compile-side-effect-free-ops | 1511 | (defconst byte-compile-side-effect-free-ops |
| 1512 | (nconc | 1512 | (append |
| 1513 | '(byte-varref byte-nth byte-memq byte-car byte-cdr byte-length byte-aref | 1513 | '(byte-varref byte-nth byte-memq byte-car byte-cdr byte-length byte-aref |
| 1514 | byte-symbol-value byte-get byte-concat2 byte-concat3 byte-sub1 byte-add1 | 1514 | byte-symbol-value byte-get byte-concat2 byte-concat3 byte-sub1 byte-add1 |
| 1515 | byte-eqlsign byte-gtr byte-lss byte-leq byte-geq byte-diff byte-negate | 1515 | byte-eqlsign byte-gtr byte-lss byte-leq byte-geq byte-diff byte-negate |
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index 492c31bde74..8e7a34fc69c 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el | |||
| @@ -1221,7 +1221,6 @@ These two lines must come in the order given.")) | |||
| 1221 | (viper-harness-minor-mode "outline") | 1221 | (viper-harness-minor-mode "outline") |
| 1222 | (viper-harness-minor-mode "allout") | 1222 | (viper-harness-minor-mode "allout") |
| 1223 | (viper-harness-minor-mode "xref") | 1223 | (viper-harness-minor-mode "xref") |
| 1224 | (viper-harness-minor-mode "lmenu") | ||
| 1225 | (viper-harness-minor-mode "vc") | 1224 | (viper-harness-minor-mode "vc") |
| 1226 | (viper-harness-minor-mode "ltx-math") ; LaTeX-math-mode in AUC-TeX, which | 1225 | (viper-harness-minor-mode "ltx-math") ; LaTeX-math-mode in AUC-TeX, which |
| 1227 | (viper-harness-minor-mode "latex") ; sits in one of these two files | 1226 | (viper-harness-minor-mode "latex") ; sits in one of these two files |
diff --git a/lisp/ffap.el b/lisp/ffap.el index ead79b45c0e..d656b373729 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el | |||
| @@ -1607,7 +1607,7 @@ Each ALIST entry looks like (STRING . DATA) and defines one choice. | |||
| 1607 | Function CONT is applied to the entry chosen by the user." | 1607 | Function CONT is applied to the entry chosen by the user." |
| 1608 | ;; Note: this function is used with a different continuation | 1608 | ;; Note: this function is used with a different continuation |
| 1609 | ;; by the ffap-url add-on package. | 1609 | ;; by the ffap-url add-on package. |
| 1610 | ;; Could try rewriting to use easymenu.el or lmenu.el. | 1610 | ;; Could try rewriting to use easymenu.el. |
| 1611 | (let (choice) | 1611 | (let (choice) |
| 1612 | (cond | 1612 | (cond |
| 1613 | ;; Emacs mouse: | 1613 | ;; Emacs mouse: |
diff --git a/lisp/files.el b/lisp/files.el index c34fe003880..dba704f7a4b 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -7552,6 +7552,27 @@ as in \"og+rX-w\"." | |||
| 7552 | op char-right))) | 7552 | op char-right))) |
| 7553 | num-rights)) | 7553 | num-rights)) |
| 7554 | 7554 | ||
| 7555 | (defun file-modes-number-to-symbolic (mode) | ||
| 7556 | (string | ||
| 7557 | (if (zerop (logand 8192 mode)) | ||
| 7558 | (if (zerop (logand 16384 mode)) ?- ?d) | ||
| 7559 | ?c) ; completeness | ||
| 7560 | (if (zerop (logand 256 mode)) ?- ?r) | ||
| 7561 | (if (zerop (logand 128 mode)) ?- ?w) | ||
| 7562 | (if (zerop (logand 64 mode)) | ||
| 7563 | (if (zerop (logand 2048 mode)) ?- ?S) | ||
| 7564 | (if (zerop (logand 2048 mode)) ?x ?s)) | ||
| 7565 | (if (zerop (logand 32 mode)) ?- ?r) | ||
| 7566 | (if (zerop (logand 16 mode)) ?- ?w) | ||
| 7567 | (if (zerop (logand 8 mode)) | ||
| 7568 | (if (zerop (logand 1024 mode)) ?- ?S) | ||
| 7569 | (if (zerop (logand 1024 mode)) ?x ?s)) | ||
| 7570 | (if (zerop (logand 4 mode)) ?- ?r) | ||
| 7571 | (if (zerop (logand 2 mode)) ?- ?w) | ||
| 7572 | (if (zerop (logand 512 mode)) | ||
| 7573 | (if (zerop (logand 1 mode)) ?- ?x) | ||
| 7574 | (if (zerop (logand 1 mode)) ?T ?t)))) | ||
| 7575 | |||
| 7555 | (defun file-modes-symbolic-to-number (modes &optional from) | 7576 | (defun file-modes-symbolic-to-number (modes &optional from) |
| 7556 | "Convert symbolic file modes to numeric file modes. | 7577 | "Convert symbolic file modes to numeric file modes. |
| 7557 | MODES is the string to convert, it should match | 7578 | MODES is the string to convert, it should match |
diff --git a/lisp/frameset.el b/lisp/frameset.el index 10c6914f52d..0462d776c0e 100644 --- a/lisp/frameset.el +++ b/lisp/frameset.el | |||
| @@ -396,17 +396,17 @@ Properties can be set with | |||
| 396 | ;; or, if you're only changing a few items, | 396 | ;; or, if you're only changing a few items, |
| 397 | ;; | 397 | ;; |
| 398 | ;; (defvar my-filter-alist | 398 | ;; (defvar my-filter-alist |
| 399 | ;; (nconc '((my-param1 . :never) | 399 | ;; (append '((my-param1 . :never) |
| 400 | ;; (my-param2 . my-filtering-function)) | 400 | ;; (my-param2 . my-filtering-function)) |
| 401 | ;; frameset-filter-alist) | 401 | ;; frameset-filter-alist) |
| 402 | ;; "My brief customized parameter filter alist.") | 402 | ;; "My brief customized parameter filter alist.") |
| 403 | ;; | 403 | ;; |
| 404 | ;; and pass it to the FILTER arg of the save/restore functions, | 404 | ;; and pass it to the FILTER arg of the save/restore functions, |
| 405 | ;; ALWAYS taking care of not modifying the original lists; if you're | 405 | ;; ALWAYS taking care of not modifying the original lists; if you're |
| 406 | ;; going to do any modifying of my-filter-alist, please use | 406 | ;; going to do any modifying of my-filter-alist, please use |
| 407 | ;; | 407 | ;; |
| 408 | ;; (nconc '((my-param1 . :never) ...) | 408 | ;; (append '((my-param1 . :never) ...) |
| 409 | ;; (copy-sequence frameset-filter-alist)) | 409 | ;; (copy-sequence frameset-filter-alist)) |
| 410 | ;; | 410 | ;; |
| 411 | ;; One thing you shouldn't forget is that they are alists, so searching | 411 | ;; One thing you shouldn't forget is that they are alists, so searching |
| 412 | ;; in them is sequential. If you just want to change the default of | 412 | ;; in them is sequential. If you just want to change the default of |
| @@ -445,7 +445,7 @@ DO NOT MODIFY. See `frameset-filter-alist' for a full description.") | |||
| 445 | 445 | ||
| 446 | ;;;###autoload | 446 | ;;;###autoload |
| 447 | (defvar frameset-persistent-filter-alist | 447 | (defvar frameset-persistent-filter-alist |
| 448 | (nconc | 448 | (append |
| 449 | '((background-color . frameset-filter-sanitize-color) | 449 | '((background-color . frameset-filter-sanitize-color) |
| 450 | (buffer-list . :never) | 450 | (buffer-list . :never) |
| 451 | (buffer-predicate . :never) | 451 | (buffer-predicate . :never) |
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 6f367692ddd..341f04ad772 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el | |||
| @@ -1501,9 +1501,9 @@ the type of the variable (string, integer, character, etc).") | |||
| 1501 | 1501 | ||
| 1502 | ;; This is here rather than in gnus-art for compilation reasons. | 1502 | ;; This is here rather than in gnus-art for compilation reasons. |
| 1503 | (defvar gnus-article-mode-line-format-alist | 1503 | (defvar gnus-article-mode-line-format-alist |
| 1504 | (nconc '((?w (gnus-article-wash-status) ?s) | 1504 | (append '((?w (gnus-article-wash-status) ?s) |
| 1505 | (?m (gnus-article-mime-part-status) ?s)) | 1505 | (?m (gnus-article-mime-part-status) ?s)) |
| 1506 | gnus-summary-mode-line-format-alist)) | 1506 | gnus-summary-mode-line-format-alist)) |
| 1507 | 1507 | ||
| 1508 | (defvar gnus-last-search-regexp nil | 1508 | (defvar gnus-last-search-regexp nil |
| 1509 | "Default regexp for article search command.") | 1509 | "Default regexp for article search command.") |
diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index 7a5d88ce834..6265537e885 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el | |||
| @@ -11,9 +11,6 @@ | |||
| 11 | ;; Created: 2002-01-05 | 11 | ;; Created: 2002-01-05 |
| 12 | ;; Description: htmlize a buffer/source tree with optional hyperlinks | 12 | ;; Description: htmlize a buffer/source tree with optional hyperlinks |
| 13 | ;; URL: http://rtfm.etla.org/emacs/htmlfontify/ | 13 | ;; URL: http://rtfm.etla.org/emacs/htmlfontify/ |
| 14 | ;; Compatibility: Emacs23, Emacs22 | ||
| 15 | ;; Incompatibility: Emacs19, Emacs20, Emacs21 | ||
| 16 | ;; Last Updated: Thu 2009-11-19 01:31:21 +0000 | ||
| 17 | 14 | ||
| 18 | ;; This file is part of GNU Emacs. | 15 | ;; This file is part of GNU Emacs. |
| 19 | 16 | ||
diff --git a/lisp/language/japanese.el b/lisp/language/japanese.el index d77efa48c9b..9a99245dfde 100644 --- a/lisp/language/japanese.el +++ b/lisp/language/japanese.el | |||
| @@ -82,9 +82,7 @@ | |||
| 82 | (#x00A6 . #xFFE4) ; BROKEN LINE FULLWIDTH BROKEN LINE | 82 | (#x00A6 . #xFFE4) ; BROKEN LINE FULLWIDTH BROKEN LINE |
| 83 | ))) | 83 | ))) |
| 84 | (define-translation-table 'japanese-ucs-jis-to-cp932-map map) | 84 | (define-translation-table 'japanese-ucs-jis-to-cp932-map map) |
| 85 | (mapc #'(lambda (x) (let ((tmp (car x))) | 85 | (setq map (mapcar (lambda (x) (cons (cdr x) (car x))) map)) |
| 86 | (setcar x (cdr x)) (setcdr x tmp))) | ||
| 87 | map) | ||
| 88 | (define-translation-table 'japanese-ucs-cp932-to-jis-map map)) | 86 | (define-translation-table 'japanese-ucs-cp932-to-jis-map map)) |
| 89 | 87 | ||
| 90 | ;; U+2014 (EM DASH) vs U+2015 (HORIZONTAL BAR) | 88 | ;; U+2014 (EM DASH) vs U+2015 (HORIZONTAL BAR) |
| @@ -241,8 +239,10 @@ eucJP-ms is defined in <http://www.opengroup.or.jp/jvc/cde/appendix.html>." | |||
| 241 | (#x2b65 . [#x02E9 #x02E5]) | 239 | (#x2b65 . [#x02E9 #x02E5]) |
| 242 | (#x2b66 . [#x02E5 #x02E9]))) | 240 | (#x2b66 . [#x02E5 #x02E9]))) |
| 243 | table) | 241 | table) |
| 244 | (dolist (elt map) | 242 | (setq map |
| 245 | (setcar elt (decode-char 'japanese-jisx0213-1 (car elt)))) | 243 | (mapcar (lambda (x) (cons (decode-char 'japanese-jisx0213-1 (car x)) |
| 244 | (cdr x))) | ||
| 245 | map)) | ||
| 246 | (setq table (make-translation-table-from-alist map)) | 246 | (setq table (make-translation-table-from-alist map)) |
| 247 | (define-translation-table 'jisx0213-to-unicode table) | 247 | (define-translation-table 'jisx0213-to-unicode table) |
| 248 | (define-translation-table 'unicode-to-jisx0213 | 248 | (define-translation-table 'unicode-to-jisx0213 |
diff --git a/lisp/language/lao-util.el b/lisp/language/lao-util.el index a20aecee421..fa4c2f7f891 100644 --- a/lisp/language/lao-util.el +++ b/lisp/language/lao-util.el | |||
| @@ -183,7 +183,9 @@ | |||
| 183 | ;; Semi-vowel-sign-lo and lower vowels are put under the letter. | 183 | ;; Semi-vowel-sign-lo and lower vowels are put under the letter. |
| 184 | 184 | ||
| 185 | (defconst lao-transcription-consonant-alist | 185 | (defconst lao-transcription-consonant-alist |
| 186 | (sort '(;; single consonants | 186 | (sort |
| 187 | (copy-sequence | ||
| 188 | '(;; single consonants | ||
| 187 | ("k" . "ກ") | 189 | ("k" . "ກ") |
| 188 | ("kh" . "ຂ") | 190 | ("kh" . "ຂ") |
| 189 | ("qh" . "ຄ") | 191 | ("qh" . "ຄ") |
| @@ -223,14 +225,16 @@ | |||
| 223 | ("hy" . ["ຫຍ"]) | 225 | ("hy" . ["ຫຍ"]) |
| 224 | ("hn" . ["ຫນ"]) | 226 | ("hn" . ["ຫນ"]) |
| 225 | ("hm" . ["ຫມ"]) | 227 | ("hm" . ["ຫມ"]) |
| 226 | ) | 228 | )) |
| 227 | (function (lambda (x y) (> (length (car x)) (length (car y))))))) | 229 | (lambda (x y) (> (length (car x)) (length (car y)))))) |
| 228 | 230 | ||
| 229 | (defconst lao-transcription-semi-vowel-alist | 231 | (defconst lao-transcription-semi-vowel-alist |
| 230 | '(("r" . "ຼ"))) | 232 | '(("r" . "ຼ"))) |
| 231 | 233 | ||
| 232 | (defconst lao-transcription-vowel-alist | 234 | (defconst lao-transcription-vowel-alist |
| 233 | (sort '(("a" . "ະ") | 235 | (sort |
| 236 | (copy-sequence | ||
| 237 | '(("a" . "ະ") | ||
| 234 | ("ar" . "າ") | 238 | ("ar" . "າ") |
| 235 | ("i" . "ິ") | 239 | ("i" . "ິ") |
| 236 | ("ii" . "ີ") | 240 | ("ii" . "ີ") |
| @@ -257,8 +261,8 @@ | |||
| 257 | ("ai" . "ໄ") | 261 | ("ai" . "ໄ") |
| 258 | ("ei" . "ໃ") | 262 | ("ei" . "ໃ") |
| 259 | ("ao" . ["ເົາ"]) | 263 | ("ao" . ["ເົາ"]) |
| 260 | ("aM" . "ຳ")) | 264 | ("aM" . "ຳ"))) |
| 261 | (function (lambda (x y) (> (length (car x)) (length (car y))))))) | 265 | (lambda (x y) (> (length (car x)) (length (car y)))))) |
| 262 | 266 | ||
| 263 | ;; Maa-sakod is put at the tail. | 267 | ;; Maa-sakod is put at the tail. |
| 264 | (defconst lao-transcription-maa-sakod-alist | 268 | (defconst lao-transcription-maa-sakod-alist |
diff --git a/lisp/language/tibetan.el b/lisp/language/tibetan.el index d31cd5cd528..bbd4729f6c5 100644 --- a/lisp/language/tibetan.el +++ b/lisp/language/tibetan.el | |||
| @@ -326,7 +326,9 @@ | |||
| 326 | 326 | ||
| 327 | 327 | ||
| 328 | (defconst tibetan-subjoined-transcription-alist | 328 | (defconst tibetan-subjoined-transcription-alist |
| 329 | (sort '(("+k" . "ྐ") | 329 | (sort |
| 330 | (copy-sequence | ||
| 331 | '(("+k" . "ྐ") | ||
| 330 | ("+kh" . "ྑ") | 332 | ("+kh" . "ྑ") |
| 331 | ("+g" . "ྒ") | 333 | ("+g" . "ྒ") |
| 332 | ("+gh" . "ྒྷ") | 334 | ("+gh" . "ྒྷ") |
| @@ -371,8 +373,8 @@ | |||
| 371 | ("+W" . "ྺ") ;; fixed form subscribed WA | 373 | ("+W" . "ྺ") ;; fixed form subscribed WA |
| 372 | ("+Y" . "ྻ") ;; fixed form subscribed YA | 374 | ("+Y" . "ྻ") ;; fixed form subscribed YA |
| 373 | ("+R" . "ྼ") ;; fixed form subscribed RA | 375 | ("+R" . "ྼ") ;; fixed form subscribed RA |
| 374 | ) | 376 | )) |
| 375 | (lambda (x y) (> (length (car x)) (length (car y)))))) | 377 | (lambda (x y) (> (length (car x)) (length (car y)))))) |
| 376 | 378 | ||
| 377 | ;;; | 379 | ;;; |
| 378 | ;;; alist for Tibetan base consonant <-> subjoined consonant conversion. | 380 | ;;; alist for Tibetan base consonant <-> subjoined consonant conversion. |
diff --git a/lisp/mouse.el b/lisp/mouse.el index 9703d957d57..f045e5bdce2 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el | |||
| @@ -2556,7 +2556,7 @@ region, text is copied instead of being cut." | |||
| 2556 | (lambda (modifier) | 2556 | (lambda (modifier) |
| 2557 | `(const :tag ,(format "Enable, but copy with the %s modifier" | 2557 | `(const :tag ,(format "Enable, but copy with the %s modifier" |
| 2558 | modifier) | 2558 | modifier) |
| 2559 | modifier)) | 2559 | ,modifier)) |
| 2560 | '(alt super hyper shift control meta)) | 2560 | '(alt super hyper shift control meta)) |
| 2561 | (other :tag "Enable dragging the region" t)) | 2561 | (other :tag "Enable dragging the region" t)) |
| 2562 | :version "26.1") | 2562 | :version "26.1") |
| @@ -2575,9 +2575,12 @@ as it does when dropping text in the source buffer." | |||
| 2575 | If this option is nil, `mouse-drag-and-drop-region' does not show | 2575 | If this option is nil, `mouse-drag-and-drop-region' does not show |
| 2576 | tooltips. If this is t, it shows the entire text dragged in a | 2576 | tooltips. If this is t, it shows the entire text dragged in a |
| 2577 | tooltip. If this is an integer (as with the default value of | 2577 | tooltip. If this is an integer (as with the default value of |
| 2578 | 256), it will show that many characters of the dragged text in | 2578 | 256), it will show up to that many characters of the dragged text |
| 2579 | a tooltip." | 2579 | in a tooltip." |
| 2580 | :type 'integer | 2580 | :type '(choice |
| 2581 | (const :tag "Do not show tooltips" nil) | ||
| 2582 | (const :tag "Show all text" t) | ||
| 2583 | (integer :tag "Show characters (max)" 256)) | ||
| 2581 | :version "26.1") | 2584 | :version "26.1") |
| 2582 | 2585 | ||
| 2583 | (defcustom mouse-drag-and-drop-region-show-cursor t | 2586 | (defcustom mouse-drag-and-drop-region-show-cursor t |
| @@ -2611,6 +2614,7 @@ is copied instead of being cut." | |||
| 2611 | (let* ((mouse-button (event-basic-type last-input-event)) | 2614 | (let* ((mouse-button (event-basic-type last-input-event)) |
| 2612 | (mouse-drag-and-drop-region-show-tooltip | 2615 | (mouse-drag-and-drop-region-show-tooltip |
| 2613 | (when (and mouse-drag-and-drop-region-show-tooltip | 2616 | (when (and mouse-drag-and-drop-region-show-tooltip |
| 2617 | (> mouse-drag-and-drop-region-show-tooltip 0) | ||
| 2614 | (display-multi-frame-p) | 2618 | (display-multi-frame-p) |
| 2615 | (require 'tooltip)) | 2619 | (require 'tooltip)) |
| 2616 | mouse-drag-and-drop-region-show-tooltip)) | 2620 | mouse-drag-and-drop-region-show-tooltip)) |
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 7ef07afb8ef..b4a080ee0f6 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el | |||
| @@ -918,9 +918,11 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 918 | (kill-buffer (tramp-get-connection-buffer v)) | 918 | (kill-buffer (tramp-get-connection-buffer v)) |
| 919 | (setq ret 1))) | 919 | (setq ret 1))) |
| 920 | 920 | ||
| 921 | ;; Handle signals. | 921 | ;; Handle signals. `process-file-return-signal-string' exists |
| 922 | (when (and (natnump ret) (> ret 128)) | 922 | ;; since Emacs 28.1. |
| 923 | (setq ret (format "Signal %d" (- ret 128)))) | 923 | (when (and (bound-and-true-p process-file-return-signal-string) |
| 924 | (natnump ret) (> ret 128)) | ||
| 925 | (setq ret (nth (- ret 128) (tramp-get-signal-strings)))) | ||
| 924 | 926 | ||
| 925 | ;; Provide error file. | 927 | ;; Provide error file. |
| 926 | (when tmpstderr (rename-file tmpstderr (cadr destination) t)) | 928 | (when tmpstderr (rename-file tmpstderr (cadr destination) t)) |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index c609f58cdd8..523663cafbd 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -3159,9 +3159,11 @@ STDERR can also be a file name." | |||
| 3159 | (kill-buffer (tramp-get-connection-buffer v)) | 3159 | (kill-buffer (tramp-get-connection-buffer v)) |
| 3160 | (setq ret 1))) | 3160 | (setq ret 1))) |
| 3161 | 3161 | ||
| 3162 | ;; Handle signals. | 3162 | ;; Handle signals. `process-file-return-signal-string' exists |
| 3163 | (when (and (natnump ret) (> ret 128)) | 3163 | ;; since Emacs 28.1. |
| 3164 | (setq ret (format "Signal %d" (- ret 128)))) | 3164 | (when (and (bound-and-true-p process-file-return-signal-string) |
| 3165 | (natnump ret) (>= ret 128)) | ||
| 3166 | (setq ret (nth (- ret 128) (tramp-get-signal-strings)))) | ||
| 3165 | 3167 | ||
| 3166 | ;; Provide error file. | 3168 | ;; Provide error file. |
| 3167 | (when tmpstderr (rename-file tmpstderr (cadr destination) t)) | 3169 | (when tmpstderr (rename-file tmpstderr (cadr destination) t)) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 70fb46bb4cb..ee263ebe933 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -5047,6 +5047,23 @@ name of a process or buffer, or nil to default to the current buffer." | |||
| 5047 | (lambda () | 5047 | (lambda () |
| 5048 | (remove-hook 'interrupt-process-functions #'tramp-interrupt-process)))) | 5048 | (remove-hook 'interrupt-process-functions #'tramp-interrupt-process)))) |
| 5049 | 5049 | ||
| 5050 | (defun tramp-get-signal-strings () | ||
| 5051 | "Strings to return by `process-file' in case of signals." | ||
| 5052 | ;; We use key nil for local connection properties. | ||
| 5053 | (with-tramp-connection-property nil "signal-strings" | ||
| 5054 | (let (result) | ||
| 5055 | (if (and (stringp shell-file-name) (executable-find shell-file-name)) | ||
| 5056 | (dotimes (i 128) | ||
| 5057 | (push | ||
| 5058 | (if (= i 19) 1 ;; SIGSTOP | ||
| 5059 | (call-process | ||
| 5060 | shell-file-name nil nil nil "-c" (format "kill -%d $$" i))) | ||
| 5061 | result)) | ||
| 5062 | (dotimes (i 128) | ||
| 5063 | (push (format "Signal %d" i) result))) | ||
| 5064 | ;; Due to Bug#41287, we cannot add this to the `dotimes' clause. | ||
| 5065 | (reverse result)))) | ||
| 5066 | |||
| 5050 | ;; Checklist for `tramp-unload-hook' | 5067 | ;; Checklist for `tramp-unload-hook' |
| 5051 | ;; - Unload all `tramp-*' packages | 5068 | ;; - Unload all `tramp-*' packages |
| 5052 | ;; - Reset `file-name-handler-alist' | 5069 | ;; - Reset `file-name-handler-alist' |
diff --git a/lisp/obsolete/ledit.el b/lisp/obsolete/ledit.el deleted file mode 100644 index c99a06de570..00000000000 --- a/lisp/obsolete/ledit.el +++ /dev/null | |||
| @@ -1,157 +0,0 @@ | |||
| 1 | ;;; ledit.el --- Emacs side of ledit interface | ||
| 2 | |||
| 3 | ;; Copyright (C) 1985, 2001-2020 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Maintainer: emacs-devel@gnu.org | ||
| 6 | ;; Keywords: languages | ||
| 7 | ;; Obsolete-since: 24.3 | ||
| 8 | |||
| 9 | ;; This file is part of GNU Emacs. | ||
| 10 | |||
| 11 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 12 | ;; it under the terms of the GNU General Public License as published by | ||
| 13 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 14 | ;; (at your option) any later version. | ||
| 15 | |||
| 16 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 17 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 18 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 19 | ;; GNU General Public License for more details. | ||
| 20 | |||
| 21 | ;; You should have received a copy of the GNU General Public License | ||
| 22 | ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | ||
| 23 | |||
| 24 | ;;; Commentary: | ||
| 25 | |||
| 26 | ;; This is a major mode for editing Liszt. | ||
| 27 | |||
| 28 | ;;; Code: | ||
| 29 | |||
| 30 | ;;; To do: | ||
| 31 | ;;; o lisp -> emacs side of things (grind-definition and find-definition) | ||
| 32 | |||
| 33 | (defvar ledit-mode-map nil) | ||
| 34 | |||
| 35 | (defconst ledit-zap-file | ||
| 36 | (expand-file-name (concat (user-login-name) ".l1") temporary-file-directory) | ||
| 37 | "File name for data sent to Lisp by Ledit.") | ||
| 38 | (defconst ledit-read-file | ||
| 39 | (expand-file-name (concat (user-login-name) ".l2") temporary-file-directory) | ||
| 40 | "File name for data sent to Ledit by Lisp.") | ||
| 41 | (defconst ledit-compile-file | ||
| 42 | (expand-file-name (concat (user-login-name) ".l4") temporary-file-directory) | ||
| 43 | "File name for data sent to Lisp compiler by Ledit.") | ||
| 44 | (defconst ledit-buffer "*LEDIT*" | ||
| 45 | "Name of buffer in which Ledit accumulates data to send to Lisp.") | ||
| 46 | |||
| 47 | ;;;###autoload | ||
| 48 | (defconst ledit-save-files t "\ | ||
| 49 | *Non-nil means Ledit should save files before transferring to Lisp.") | ||
| 50 | ;;;###autoload | ||
| 51 | (defconst ledit-go-to-lisp-string "%?lisp" "\ | ||
| 52 | *Shell commands to execute to resume Lisp job.") | ||
| 53 | ;;;###autoload | ||
| 54 | (defconst ledit-go-to-liszt-string "%?liszt" "\ | ||
| 55 | *Shell commands to execute to resume Lisp compiler job.") | ||
| 56 | |||
| 57 | (defun ledit-save-defun () | ||
| 58 | "Save the current defun in the ledit buffer." | ||
| 59 | (interactive) | ||
| 60 | (save-excursion | ||
| 61 | (end-of-defun) | ||
| 62 | (let ((end (point))) | ||
| 63 | (beginning-of-defun) | ||
| 64 | (append-to-buffer ledit-buffer (point) end)) | ||
| 65 | (message "Current defun saved for Lisp"))) | ||
| 66 | |||
| 67 | (defun ledit-save-region (beg end) | ||
| 68 | "Save the current region in the ledit buffer" | ||
| 69 | (interactive "r") | ||
| 70 | (append-to-buffer ledit-buffer beg end) | ||
| 71 | (message "Region saved for Lisp")) | ||
| 72 | |||
| 73 | (defun ledit-zap-defun-to-lisp () | ||
| 74 | "Carry the current defun to Lisp." | ||
| 75 | (interactive) | ||
| 76 | (ledit-save-defun) | ||
| 77 | (ledit-go-to-lisp)) | ||
| 78 | |||
| 79 | (defun ledit-zap-defun-to-liszt () | ||
| 80 | "Carry the current defun to liszt." | ||
| 81 | (interactive) | ||
| 82 | (ledit-save-defun) | ||
| 83 | (ledit-go-to-liszt)) | ||
| 84 | |||
| 85 | (defun ledit-zap-region-to-lisp (beg end) | ||
| 86 | "Carry the current region to Lisp." | ||
| 87 | (interactive "r") | ||
| 88 | (ledit-save-region beg end) | ||
| 89 | (ledit-go-to-lisp)) | ||
| 90 | |||
| 91 | (defun ledit-go-to-lisp () | ||
| 92 | "Suspend Emacs and restart a waiting Lisp job." | ||
| 93 | (interactive) | ||
| 94 | (if ledit-save-files | ||
| 95 | (save-some-buffers)) | ||
| 96 | (if (get-buffer ledit-buffer) | ||
| 97 | (with-current-buffer ledit-buffer | ||
| 98 | (goto-char (point-min)) | ||
| 99 | (write-region (point-min) (point-max) ledit-zap-file) | ||
| 100 | (erase-buffer))) | ||
| 101 | (suspend-emacs ledit-go-to-lisp-string) | ||
| 102 | (load ledit-read-file t t)) | ||
| 103 | |||
| 104 | (defun ledit-go-to-liszt () | ||
| 105 | "Suspend Emacs and restart a waiting Liszt job." | ||
| 106 | (interactive) | ||
| 107 | (if ledit-save-files | ||
| 108 | (save-some-buffers)) | ||
| 109 | (if (get-buffer ledit-buffer) | ||
| 110 | (with-current-buffer ledit-buffer | ||
| 111 | (goto-char (point-min)) | ||
| 112 | (insert "(declare (macros t))\n") | ||
| 113 | (write-region (point-min) (point-max) ledit-compile-file) | ||
| 114 | (erase-buffer))) | ||
| 115 | (suspend-emacs ledit-go-to-liszt-string) | ||
| 116 | (load ledit-read-file t t)) | ||
| 117 | |||
| 118 | (defun ledit-setup () | ||
| 119 | "Set up key bindings for the Lisp/Emacs interface." | ||
| 120 | (unless ledit-mode-map | ||
| 121 | (setq ledit-mode-map (make-sparse-keymap)) | ||
| 122 | (set-keymap-parent ledit-mode-map lisp-mode-shared-map)) | ||
| 123 | (define-key ledit-mode-map "\e\^d" 'ledit-save-defun) | ||
| 124 | (define-key ledit-mode-map "\e\^r" 'ledit-save-region) | ||
| 125 | (define-key ledit-mode-map "\^xz" 'ledit-go-to-lisp) | ||
| 126 | (define-key ledit-mode-map "\e\^c" 'ledit-go-to-liszt)) | ||
| 127 | |||
| 128 | (ledit-setup) | ||
| 129 | |||
| 130 | ;;;###autoload | ||
| 131 | (defun ledit-mode () | ||
| 132 | "\\<ledit-mode-map>Major mode for editing text and stuffing it to a Lisp job. | ||
| 133 | Like Lisp mode, plus these special commands: | ||
| 134 | \\[ledit-save-defun] -- record defun at or after point | ||
| 135 | for later transmission to Lisp job. | ||
| 136 | \\[ledit-save-region] -- record region for later transmission to Lisp job. | ||
| 137 | \\[ledit-go-to-lisp] -- transfer to Lisp job and transmit saved text. | ||
| 138 | \\[ledit-go-to-liszt] -- transfer to Liszt (Lisp compiler) job | ||
| 139 | and transmit saved text. | ||
| 140 | |||
| 141 | \\{ledit-mode-map} | ||
| 142 | To make Lisp mode automatically change to Ledit mode, | ||
| 143 | do (setq lisp-mode-hook 'ledit-from-lisp-mode)" | ||
| 144 | (interactive) | ||
| 145 | (delay-mode-hooks (lisp-mode)) | ||
| 146 | (ledit-from-lisp-mode)) | ||
| 147 | |||
| 148 | ;;;###autoload | ||
| 149 | (defun ledit-from-lisp-mode () | ||
| 150 | (use-local-map ledit-mode-map) | ||
| 151 | (setq mode-name "Ledit") | ||
| 152 | (setq major-mode 'ledit-mode) | ||
| 153 | (run-mode-hooks 'ledit-mode-hook)) | ||
| 154 | |||
| 155 | (provide 'ledit) | ||
| 156 | |||
| 157 | ;;; ledit.el ends here | ||
diff --git a/lisp/obsolete/lmenu.el b/lisp/obsolete/lmenu.el deleted file mode 100644 index 678481924b2..00000000000 --- a/lisp/obsolete/lmenu.el +++ /dev/null | |||
| @@ -1,445 +0,0 @@ | |||
| 1 | ;;; lmenu.el --- emulate Lucid's menubar support | ||
| 2 | |||
| 3 | ;; Copyright (C) 1992-1994, 1997, 2001-2020 Free Software Foundation, | ||
| 4 | ;; Inc. | ||
| 5 | |||
| 6 | ;; Keywords: emulations obsolete | ||
| 7 | ;; Obsolete-since: 23.3 | ||
| 8 | |||
| 9 | ;; This file is part of GNU Emacs. | ||
| 10 | |||
| 11 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 12 | ;; it under the terms of the GNU General Public License as published by | ||
| 13 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 14 | ;; (at your option) any later version. | ||
| 15 | |||
| 16 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 17 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 18 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 19 | ;; GNU General Public License for more details. | ||
| 20 | |||
| 21 | ;; You should have received a copy of the GNU General Public License | ||
| 22 | ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | ||
| 23 | |||
| 24 | ;;; Commentary: | ||
| 25 | |||
| 26 | ;; This file has been obsolete since Emacs 23.3. | ||
| 27 | |||
| 28 | ;;; Code: | ||
| 29 | |||
| 30 | |||
| 31 | ;; First, emulate the Lucid menubar support in GNU Emacs 19. | ||
| 32 | |||
| 33 | ;; Arrange to use current-menubar to set up part of the menu bar. | ||
| 34 | |||
| 35 | (defvar current-menubar) | ||
| 36 | (defvar lucid-menubar-map) | ||
| 37 | (defvar lucid-failing-menubar) | ||
| 38 | |||
| 39 | (defvar recompute-lucid-menubar 'recompute-lucid-menubar) | ||
| 40 | (defun recompute-lucid-menubar () | ||
| 41 | (define-key lucid-menubar-map [menu-bar] | ||
| 42 | (condition-case nil | ||
| 43 | (make-lucid-menu-keymap "menu-bar" current-menubar) | ||
| 44 | (error (message "Invalid data in current-menubar moved to lucid-failing-menubar") | ||
| 45 | (sit-for 1) | ||
| 46 | (setq lucid-failing-menubar current-menubar | ||
| 47 | current-menubar nil)))) | ||
| 48 | (setq lucid-menu-bar-dirty-flag nil)) | ||
| 49 | |||
| 50 | (defvar lucid-menubar-map (make-sparse-keymap)) | ||
| 51 | (or (assq 'current-menubar minor-mode-map-alist) | ||
| 52 | (setq minor-mode-map-alist | ||
| 53 | (cons (cons 'current-menubar lucid-menubar-map) | ||
| 54 | minor-mode-map-alist))) | ||
| 55 | |||
| 56 | ;; XEmacs compatibility | ||
| 57 | (defun set-menubar-dirty-flag () | ||
| 58 | (force-mode-line-update) | ||
| 59 | (setq lucid-menu-bar-dirty-flag t)) | ||
| 60 | |||
| 61 | (defvar add-menu-item-count 0) | ||
| 62 | |||
| 63 | ;; This is a variable whose value is always nil. | ||
| 64 | (defvar make-lucid-menu-keymap-disable nil) | ||
| 65 | |||
| 66 | ;; Return a menu keymap corresponding to a Lucid-style menu list | ||
| 67 | ;; MENU-ITEMS, and with name MENU-NAME. | ||
| 68 | (defun make-lucid-menu-keymap (menu-name menu-items) | ||
| 69 | (let ((menu (make-sparse-keymap menu-name))) | ||
| 70 | ;; Process items in reverse order, | ||
| 71 | ;; since the define-key loop reverses them again. | ||
| 72 | (setq menu-items (reverse menu-items)) | ||
| 73 | (while menu-items | ||
| 74 | (let ((item (car menu-items)) | ||
| 75 | command name callback) | ||
| 76 | (cond ((stringp item) | ||
| 77 | (setq command nil) | ||
| 78 | (setq name (if (string-match "^-+$" item) "" item))) | ||
| 79 | ((consp item) | ||
| 80 | (setq command (make-lucid-menu-keymap (car item) (cdr item))) | ||
| 81 | (setq name (car item))) | ||
| 82 | ((vectorp item) | ||
| 83 | (setq command (make-symbol (format "menu-function-%d" | ||
| 84 | add-menu-item-count)) | ||
| 85 | add-menu-item-count (1+ add-menu-item-count) | ||
| 86 | name (aref item 0) | ||
| 87 | callback (aref item 1)) | ||
| 88 | (if (symbolp callback) | ||
| 89 | (fset command callback) | ||
| 90 | (fset command (list 'lambda () '(interactive) callback))) | ||
| 91 | (put command 'menu-alias t) | ||
| 92 | (let ((i 2)) | ||
| 93 | (while (< i (length item)) | ||
| 94 | (cond | ||
| 95 | ((eq (aref item i) ':active) | ||
| 96 | (put command 'menu-enable | ||
| 97 | (or (aref item (1+ i)) | ||
| 98 | 'make-lucid-menu-keymap-disable)) | ||
| 99 | (setq i (+ 2 i))) | ||
| 100 | ((eq (aref item i) ':suffix) | ||
| 101 | ;; unimplemented | ||
| 102 | (setq i (+ 2 i))) | ||
| 103 | ((eq (aref item i) ':keys) | ||
| 104 | ;; unimplemented | ||
| 105 | (setq i (+ 2 i))) | ||
| 106 | ((eq (aref item i) ':style) | ||
| 107 | ;; unimplemented | ||
| 108 | (setq i (+ 2 i))) | ||
| 109 | ((eq (aref item i) ':selected) | ||
| 110 | ;; unimplemented | ||
| 111 | (setq i (+ 2 i))) | ||
| 112 | ((and (symbolp (aref item i)) | ||
| 113 | (= ?: (string-to-char (symbol-name (aref item i))))) | ||
| 114 | (error "Unrecognized menu item keyword: %S" | ||
| 115 | (aref item i))) | ||
| 116 | ((= i 2) | ||
| 117 | ;; old-style format: active-p &optional suffix | ||
| 118 | (put command 'menu-enable | ||
| 119 | (or (aref item i) 'make-lucid-menu-keymap-disable)) | ||
| 120 | ;; suffix is unimplemented | ||
| 121 | (setq i (length item))) | ||
| 122 | (t | ||
| 123 | (error "Unexpected menu item value: %S" | ||
| 124 | (aref item i)))))))) | ||
| 125 | (if (null command) | ||
| 126 | ;; Handle inactive strings specially--allow any number | ||
| 127 | ;; of identical ones. | ||
| 128 | (setcdr menu (cons (list nil name) (cdr menu))) | ||
| 129 | (if name | ||
| 130 | (define-key menu (vector (intern name)) (cons name command))))) | ||
| 131 | (setq menu-items (cdr menu-items))) | ||
| 132 | menu)) | ||
| 133 | |||
| 134 | (declare-function x-popup-dialog "menu.c" (position contents &optional header)) | ||
| 135 | |||
| 136 | ;; XEmacs compatibility function | ||
| 137 | (defun popup-dialog-box (data) | ||
| 138 | "Pop up a dialog box. | ||
| 139 | A dialog box description is a list. | ||
| 140 | |||
| 141 | - The first element of the list is a string to display in the dialog box. | ||
| 142 | - The rest of the elements are descriptions of the dialog box's buttons. | ||
| 143 | Each one is a vector of three elements: | ||
| 144 | - The first element is the text of the button. | ||
| 145 | - The second element is the `callback'. | ||
| 146 | - The third element is t or nil, whether this button is selectable. | ||
| 147 | |||
| 148 | If the `callback' of a button is a symbol, then it must name a command. | ||
| 149 | It will be invoked with `call-interactively'. If it is a list, then it is | ||
| 150 | evaluated with `eval'. | ||
| 151 | |||
| 152 | One (and only one) of the buttons may be nil. This marker means that all | ||
| 153 | following buttons should be flushright instead of flushleft. | ||
| 154 | |||
| 155 | The syntax, more precisely: | ||
| 156 | |||
| 157 | form := <something to pass to `eval'> | ||
| 158 | command := <a symbol or string, to pass to `call-interactively'> | ||
| 159 | callback := command | form | ||
| 160 | active-p := <t, nil, or a form to evaluate to decide whether this | ||
| 161 | button should be selectable> | ||
| 162 | name := <string> | ||
| 163 | partition := `nil' | ||
| 164 | button := `[' name callback active-p `]' | ||
| 165 | dialog := `(' name [ button ]+ [ partition [ button ]+ ] `)'" | ||
| 166 | (let ((name (car data)) | ||
| 167 | (tail (cdr data)) | ||
| 168 | converted | ||
| 169 | choice meaning) | ||
| 170 | (while tail | ||
| 171 | (if (null (car tail)) | ||
| 172 | (setq converted (cons nil converted)) | ||
| 173 | (let ((item (aref (car tail) 0)) | ||
| 174 | (callback (aref (car tail) 1)) | ||
| 175 | (enable (aref (car tail) 2))) | ||
| 176 | (setq converted | ||
| 177 | (cons (if enable (cons item callback) item) | ||
| 178 | converted)))) | ||
| 179 | (setq tail (cdr tail))) | ||
| 180 | (setq choice (x-popup-dialog t (cons name (nreverse converted)))) | ||
| 181 | (if choice | ||
| 182 | (if (symbolp choice) | ||
| 183 | (call-interactively choice) | ||
| 184 | (eval choice))))) | ||
| 185 | |||
| 186 | ;; This is empty because the usual elements of the menu bar | ||
| 187 | ;; are provided by menu-bar.el instead. | ||
| 188 | ;; It would not make sense to duplicate them here. | ||
| 189 | (defconst default-menubar nil) | ||
| 190 | |||
| 191 | ;; XEmacs compatibility | ||
| 192 | (defun set-menubar (menubar) | ||
| 193 | "Set the default menubar to be menubar." | ||
| 194 | (setq-default current-menubar (copy-sequence menubar)) | ||
| 195 | (set-menubar-dirty-flag)) | ||
| 196 | |||
| 197 | ;; XEmacs compatibility | ||
| 198 | (defun set-buffer-menubar (menubar) | ||
| 199 | "Set the buffer-local menubar to be menubar." | ||
| 200 | (make-local-variable 'current-menubar) | ||
| 201 | (setq current-menubar (copy-sequence menubar)) | ||
| 202 | (set-menubar-dirty-flag)) | ||
| 203 | |||
| 204 | |||
| 205 | ;;; menu manipulation functions | ||
| 206 | |||
| 207 | ;; XEmacs compatibility | ||
| 208 | (defun find-menu-item (menubar item-path-list &optional parent) | ||
| 209 | "Searches MENUBAR for item given by ITEM-PATH-LIST. | ||
| 210 | Returns (ITEM . PARENT), where PARENT is the immediate parent of | ||
| 211 | the item found. | ||
| 212 | Signals an error if the item is not found." | ||
| 213 | (or parent (setq item-path-list (mapcar 'downcase item-path-list))) | ||
| 214 | (if (not (consp menubar)) | ||
| 215 | nil | ||
| 216 | (let ((rest menubar) | ||
| 217 | result) | ||
| 218 | (while rest | ||
| 219 | (if (and (car rest) | ||
| 220 | (equal (car item-path-list) | ||
| 221 | (downcase (if (vectorp (car rest)) | ||
| 222 | (aref (car rest) 0) | ||
| 223 | (if (stringp (car rest)) | ||
| 224 | (car rest) | ||
| 225 | (car (car rest))))))) | ||
| 226 | (setq result (car rest) rest nil) | ||
| 227 | (setq rest (cdr rest)))) | ||
| 228 | (if (cdr item-path-list) | ||
| 229 | (if (consp result) | ||
| 230 | (find-menu-item (cdr result) (cdr item-path-list) result) | ||
| 231 | (if result | ||
| 232 | (signal 'error (list "not a submenu" result)) | ||
| 233 | (signal 'error (list "no such submenu" (car item-path-list))))) | ||
| 234 | (cons result parent))))) | ||
| 235 | |||
| 236 | |||
| 237 | ;; XEmacs compatibility | ||
| 238 | (defun disable-menu-item (path) | ||
| 239 | "Make the named menu item be unselectable. | ||
| 240 | PATH is a list of strings which identify the position of the menu item in | ||
| 241 | the menu hierarchy. (\"File\" \"Save\") means the menu item called \"Save\" | ||
| 242 | under the toplevel \"File\" menu. (\"Menu\" \"Foo\" \"Item\") means the | ||
| 243 | menu item called \"Item\" under the \"Foo\" submenu of \"Menu\"." | ||
| 244 | (let* ((menubar current-menubar) | ||
| 245 | (pair (find-menu-item menubar path)) | ||
| 246 | (item (car pair)) | ||
| 247 | (menu (cdr pair))) | ||
| 248 | (or item | ||
| 249 | (signal 'error (list (if menu "No such menu item" "No such menu") | ||
| 250 | path))) | ||
| 251 | (if (consp item) (error "can't disable menus, only menu items")) | ||
| 252 | (aset item 2 nil) | ||
| 253 | (set-menubar-dirty-flag) | ||
| 254 | item)) | ||
| 255 | |||
| 256 | |||
| 257 | ;; XEmacs compatibility | ||
| 258 | (defun enable-menu-item (path) | ||
| 259 | "Make the named menu item be selectable. | ||
| 260 | PATH is a list of strings which identify the position of the menu item in | ||
| 261 | the menu hierarchy. (\"File\" \"Save\") means the menu item called \"Save\" | ||
| 262 | under the toplevel \"File\" menu. (\"Menu\" \"Foo\" \"Item\") means the | ||
| 263 | menu item called \"Item\" under the \"Foo\" submenu of \"Menu\"." | ||
| 264 | (let* ((menubar current-menubar) | ||
| 265 | (pair (find-menu-item menubar path)) | ||
| 266 | (item (car pair)) | ||
| 267 | (menu (cdr pair))) | ||
| 268 | (or item | ||
| 269 | (signal 'error (list (if menu "No such menu item" "No such menu") | ||
| 270 | path))) | ||
| 271 | (if (consp item) (error "%S is a menu, not a menu item" path)) | ||
| 272 | (aset item 2 t) | ||
| 273 | (set-menubar-dirty-flag) | ||
| 274 | item)) | ||
| 275 | |||
| 276 | |||
| 277 | (defun add-menu-item-1 (item-p menu-path item-name item-data enabled-p before) | ||
| 278 | (if before (setq before (downcase before))) | ||
| 279 | (let* ((menubar current-menubar) | ||
| 280 | (menu (condition-case () | ||
| 281 | (car (find-menu-item menubar menu-path)) | ||
| 282 | (error nil))) | ||
| 283 | (item (if (listp menu) | ||
| 284 | (car (find-menu-item (cdr menu) (list item-name))) | ||
| 285 | (signal 'error (list "not a submenu" menu-path))))) | ||
| 286 | (or menu | ||
| 287 | (let ((rest menu-path) | ||
| 288 | (so-far menubar)) | ||
| 289 | (while rest | ||
| 290 | ;;; (setq menu (car (find-menu-item (cdr so-far) (list (car rest))))) | ||
| 291 | (setq menu | ||
| 292 | (if (eq so-far menubar) | ||
| 293 | (car (find-menu-item so-far (list (car rest)))) | ||
| 294 | (car (find-menu-item (cdr so-far) (list (car rest)))))) | ||
| 295 | (or menu | ||
| 296 | (let ((rest2 so-far)) | ||
| 297 | (or rest2 | ||
| 298 | (error "Trying to modify a menu that doesn't exist")) | ||
| 299 | (while (and (cdr rest2) (car (cdr rest2))) | ||
| 300 | (setq rest2 (cdr rest2))) | ||
| 301 | (setcdr rest2 | ||
| 302 | (nconc (list (setq menu (list (car rest)))) | ||
| 303 | (cdr rest2))))) | ||
| 304 | (setq so-far menu) | ||
| 305 | (setq rest (cdr rest))))) | ||
| 306 | (or menu (setq menu menubar)) | ||
| 307 | (if item | ||
| 308 | nil ; it's already there | ||
| 309 | (if item-p | ||
| 310 | (setq item (vector item-name item-data enabled-p)) | ||
| 311 | (setq item (cons item-name item-data))) | ||
| 312 | ;; if BEFORE is specified, try to add it there. | ||
| 313 | (if before | ||
| 314 | (setq before (car (find-menu-item menu (list before))))) | ||
| 315 | (let ((rest menu) | ||
| 316 | (added-before nil)) | ||
| 317 | (while rest | ||
| 318 | (if (eq before (car (cdr rest))) | ||
| 319 | (progn | ||
| 320 | (setcdr rest (cons item (cdr rest))) | ||
| 321 | (setq rest nil added-before t)) | ||
| 322 | (setq rest (cdr rest)))) | ||
| 323 | (if (not added-before) | ||
| 324 | ;; adding before the first item on the menubar itself is harder | ||
| 325 | (if (and (eq menu menubar) (eq before (car menu))) | ||
| 326 | (setq menu (cons item menu) | ||
| 327 | current-menubar menu) | ||
| 328 | ;; otherwise, add the item to the end. | ||
| 329 | (nconc menu (list item)))))) | ||
| 330 | (if item-p | ||
| 331 | (progn | ||
| 332 | (aset item 1 item-data) | ||
| 333 | (aset item 2 (not (null enabled-p)))) | ||
| 334 | (setcar item item-name) | ||
| 335 | (setcdr item item-data)) | ||
| 336 | (set-menubar-dirty-flag) | ||
| 337 | item)) | ||
| 338 | |||
| 339 | ;; XEmacs compatibility | ||
| 340 | (defun add-menu-item (menu-path item-name function enabled-p &optional before) | ||
| 341 | "Add a menu item to some menu, creating the menu first if necessary. | ||
| 342 | If the named item exists already, it is changed. | ||
| 343 | MENU-PATH identifies the menu under which the new menu item should be inserted. | ||
| 344 | It is a list of strings; for example, (\"File\") names the top-level \"File\" | ||
| 345 | menu. (\"File\" \"Foo\") names a hypothetical submenu of \"File\". | ||
| 346 | ITEM-NAME is the string naming the menu item to be added. | ||
| 347 | FUNCTION is the command to invoke when this menu item is selected. | ||
| 348 | If it is a symbol, then it is invoked with `call-interactively', in the same | ||
| 349 | way that functions bound to keys are invoked. If it is a list, then the | ||
| 350 | list is simply evaluated. | ||
| 351 | ENABLED-P controls whether the item is selectable or not. | ||
| 352 | BEFORE, if provided, is the name of a menu item before which this item should | ||
| 353 | be added, if this item is not on the menu already. If the item is already | ||
| 354 | present, it will not be moved." | ||
| 355 | (or menu-path (error "must specify a menu path")) | ||
| 356 | (or item-name (error "must specify an item name")) | ||
| 357 | (add-menu-item-1 t menu-path item-name function enabled-p before)) | ||
| 358 | |||
| 359 | |||
| 360 | ;; XEmacs compatibility | ||
| 361 | (defun delete-menu-item (path) | ||
| 362 | "Remove the named menu item from the menu hierarchy. | ||
| 363 | PATH is a list of strings which identify the position of the menu item in | ||
| 364 | the menu hierarchy. (\"File\" \"Save\") means the menu item called \"Save\" | ||
| 365 | under the toplevel \"File\" menu. (\"Menu\" \"Foo\" \"Item\") means the | ||
| 366 | menu item called \"Item\" under the \"Foo\" submenu of \"Menu\"." | ||
| 367 | (let* ((menubar current-menubar) | ||
| 368 | (pair (find-menu-item menubar path)) | ||
| 369 | (item (car pair)) | ||
| 370 | (menu (or (cdr pair) menubar))) | ||
| 371 | (if (not item) | ||
| 372 | nil | ||
| 373 | ;; the menubar is the only special case, because other menus begin | ||
| 374 | ;; with their name. | ||
| 375 | (if (eq menu current-menubar) | ||
| 376 | (setq current-menubar (delq item menu)) | ||
| 377 | (delq item menu)) | ||
| 378 | (set-menubar-dirty-flag) | ||
| 379 | item))) | ||
| 380 | |||
| 381 | |||
| 382 | ;; XEmacs compatibility | ||
| 383 | (defun relabel-menu-item (path new-name) | ||
| 384 | "Change the string of the specified menu item. | ||
| 385 | PATH is a list of strings which identify the position of the menu item in | ||
| 386 | the menu hierarchy. (\"File\" \"Save\") means the menu item called \"Save\" | ||
| 387 | under the toplevel \"File\" menu. (\"Menu\" \"Foo\" \"Item\") means the | ||
| 388 | menu item called \"Item\" under the \"Foo\" submenu of \"Menu\". | ||
| 389 | NEW-NAME is the string that the menu item will be printed as from now on." | ||
| 390 | (or (stringp new-name) | ||
| 391 | (setq new-name (signal 'wrong-type-argument (list 'stringp new-name)))) | ||
| 392 | (let* ((menubar current-menubar) | ||
| 393 | (pair (find-menu-item menubar path)) | ||
| 394 | (item (car pair)) | ||
| 395 | (menu (cdr pair))) | ||
| 396 | (or item | ||
| 397 | (signal 'error (list (if menu "No such menu item" "No such menu") | ||
| 398 | path))) | ||
| 399 | (if (and (consp item) | ||
| 400 | (stringp (car item))) | ||
| 401 | (setcar item new-name) | ||
| 402 | (aset item 0 new-name)) | ||
| 403 | (set-menubar-dirty-flag) | ||
| 404 | item)) | ||
| 405 | |||
| 406 | ;; XEmacs compatibility | ||
| 407 | (defun add-menu (menu-path menu-name menu-items &optional before) | ||
| 408 | "Add a menu to the menubar or one of its submenus. | ||
| 409 | If the named menu exists already, it is changed. | ||
| 410 | MENU-PATH identifies the menu under which the new menu should be inserted. | ||
| 411 | It is a list of strings; for example, (\"File\") names the top-level \"File\" | ||
| 412 | menu. (\"File\" \"Foo\") names a hypothetical submenu of \"File\". | ||
| 413 | If MENU-PATH is nil, then the menu will be added to the menubar itself. | ||
| 414 | MENU-NAME is the string naming the menu to be added. | ||
| 415 | MENU-ITEMS is a list of menu item descriptions. | ||
| 416 | Each menu item should be a vector of three elements: | ||
| 417 | - a string, the name of the menu item; | ||
| 418 | - a symbol naming a command, or a form to evaluate; | ||
| 419 | - and a form whose value determines whether this item is selectable. | ||
| 420 | BEFORE, if provided, is the name of a menu before which this menu should | ||
| 421 | be added, if this menu is not on its parent already. If the menu is already | ||
| 422 | present, it will not be moved." | ||
| 423 | (or menu-name (error "must specify a menu name")) | ||
| 424 | (or menu-items (error "must specify some menu items")) | ||
| 425 | (add-menu-item-1 nil menu-path menu-name menu-items t before)) | ||
| 426 | |||
| 427 | |||
| 428 | |||
| 429 | (defvar put-buffer-names-in-file-menu t) | ||
| 430 | |||
| 431 | |||
| 432 | ;; Don't unconditionally enable menu bars; leave that up to the user. | ||
| 433 | ;;(let ((frames (frame-list))) | ||
| 434 | ;; (while frames | ||
| 435 | ;; (modify-frame-parameters (car frames) '((menu-bar-lines . 1))) | ||
| 436 | ;; (setq frames (cdr frames)))) | ||
| 437 | ;;(or (assq 'menu-bar-lines default-frame-alist) | ||
| 438 | ;; (setq default-frame-alist | ||
| 439 | ;; (cons '(menu-bar-lines . 1) default-frame-alist))) | ||
| 440 | |||
| 441 | (set-menubar default-menubar) | ||
| 442 | |||
| 443 | (provide 'lmenu) | ||
| 444 | |||
| 445 | ;;; lmenu.el ends here | ||
diff --git a/lisp/obsolete/lucid.el b/lisp/obsolete/lucid.el deleted file mode 100644 index 817cc9cfaaa..00000000000 --- a/lisp/obsolete/lucid.el +++ /dev/null | |||
| @@ -1,211 +0,0 @@ | |||
| 1 | ;;; lucid.el --- emulate some Lucid Emacs functions | ||
| 2 | |||
| 3 | ;; Copyright (C) 1993, 1995, 2001-2020 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Maintainer: emacs-devel@gnu.org | ||
| 6 | ;; Keywords: emulations | ||
| 7 | ;; Obsolete-since: 23.2 | ||
| 8 | |||
| 9 | ;; This file is part of GNU Emacs. | ||
| 10 | |||
| 11 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 12 | ;; it under the terms of the GNU General Public License as published by | ||
| 13 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 14 | ;; (at your option) any later version. | ||
| 15 | |||
| 16 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 17 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 18 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 19 | ;; GNU General Public License for more details. | ||
| 20 | |||
| 21 | ;; You should have received a copy of the GNU General Public License | ||
| 22 | ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | ||
| 23 | |||
| 24 | ;;; Commentary: | ||
| 25 | |||
| 26 | ;;; Code: | ||
| 27 | |||
| 28 | ;; XEmacs autoloads CL so we might as well make use of it. | ||
| 29 | (require 'cl) | ||
| 30 | |||
| 31 | (defalias 'current-time-seconds 'current-time) | ||
| 32 | |||
| 33 | (defun real-path-name (name &optional default) | ||
| 34 | (file-truename (expand-file-name name default))) | ||
| 35 | |||
| 36 | ;; It's not clear what to return if the mouse is not in FRAME. | ||
| 37 | (defun read-mouse-position (frame) | ||
| 38 | (let ((pos (mouse-position))) | ||
| 39 | (if (eq (car pos) frame) | ||
| 40 | (cdr pos)))) | ||
| 41 | |||
| 42 | (defun switch-to-other-buffer (arg) | ||
| 43 | "Switch to the previous buffer. | ||
| 44 | With a numeric arg N, switch to the Nth most recent buffer. | ||
| 45 | With an arg of 0, buries the current buffer at the | ||
| 46 | bottom of the buffer stack." | ||
| 47 | (interactive "p") | ||
| 48 | (if (eq arg 0) | ||
| 49 | (bury-buffer (current-buffer))) | ||
| 50 | (switch-to-buffer | ||
| 51 | (if (<= arg 1) (other-buffer (current-buffer)) | ||
| 52 | (nth arg | ||
| 53 | (apply 'nconc | ||
| 54 | (mapcar | ||
| 55 | (lambda (buf) | ||
| 56 | (if (= ?\ (string-to-char (buffer-name buf))) | ||
| 57 | nil | ||
| 58 | (list buf))) | ||
| 59 | (buffer-list))))))) | ||
| 60 | |||
| 61 | (defun device-class (&optional device) | ||
| 62 | "Return the class (color behavior) of DEVICE. | ||
| 63 | This will be one of `color', `grayscale', or `mono'. | ||
| 64 | This function exists for compatibility with XEmacs." | ||
| 65 | (cond | ||
| 66 | ((display-color-p device) 'color) | ||
| 67 | ((display-grayscale-p device) 'grayscale) | ||
| 68 | (t 'mono))) | ||
| 69 | |||
| 70 | (defalias 'find-face 'facep) | ||
| 71 | (defalias 'get-face 'facep) | ||
| 72 | ;; internal-try-face-font was removed from faces.el in rev 1.139, 1999/07/21. | ||
| 73 | ;;;(defalias 'try-face-font 'internal-try-face-font) | ||
| 74 | |||
| 75 | (defalias 'exec-to-string 'shell-command-to-string) | ||
| 76 | |||
| 77 | |||
| 78 | ;; Buffer context | ||
| 79 | |||
| 80 | (defun buffer-syntactic-context (&optional buffer) | ||
| 81 | "Syntactic context at point in BUFFER. | ||
| 82 | Either of `string', `comment' or nil. | ||
| 83 | This is an XEmacs compatibility function." | ||
| 84 | (with-current-buffer (or buffer (current-buffer)) | ||
| 85 | (let ((state (syntax-ppss (point)))) | ||
| 86 | (cond | ||
| 87 | ((nth 3 state) 'string) | ||
| 88 | ((nth 4 state) 'comment))))) | ||
| 89 | |||
| 90 | |||
| 91 | (defun buffer-syntactic-context-depth (&optional buffer) | ||
| 92 | "Syntactic parenthesis depth at point in BUFFER. | ||
| 93 | This is an XEmacs compatibility function." | ||
| 94 | (with-current-buffer (or buffer (current-buffer)) | ||
| 95 | (nth 0 (syntax-ppss (point))))) | ||
| 96 | |||
| 97 | |||
| 98 | ;; Extents | ||
| 99 | (defun make-extent (beg end &optional buffer) | ||
| 100 | (make-overlay beg end buffer)) | ||
| 101 | |||
| 102 | (defun extent-properties (extent) (overlay-properties extent)) | ||
| 103 | (unless (fboundp 'extent-property) (defalias 'extent-property 'overlay-get)) | ||
| 104 | |||
| 105 | (defun extent-at (pos &optional object property before) | ||
| 106 | (with-current-buffer (or object (current-buffer)) | ||
| 107 | (let ((overlays (overlays-at pos 'sorted))) | ||
| 108 | (when property | ||
| 109 | (let (filtered) | ||
| 110 | (while overlays | ||
| 111 | (if (overlay-get (car overlays) property) | ||
| 112 | (setq filtered (cons (car overlays) filtered))) | ||
| 113 | (setq overlays (cdr overlays))) | ||
| 114 | (setq overlays filtered))) | ||
| 115 | (if before | ||
| 116 | (nth 1 (memq before overlays)) | ||
| 117 | (car overlays))))) | ||
| 118 | |||
| 119 | (defun set-extent-property (extent prop value) | ||
| 120 | ;; Make sure that separate adjacent extents | ||
| 121 | ;; with the same mouse-face value | ||
| 122 | ;; do not run together as one extent. | ||
| 123 | (and (eq prop 'mouse-face) | ||
| 124 | (symbolp value) | ||
| 125 | (setq value (list value))) | ||
| 126 | (if (eq prop 'duplicable) | ||
| 127 | (cond ((and value (not (overlay-get extent prop))) | ||
| 128 | ;; If becoming duplicable, copy all overlayprops to text props. | ||
| 129 | (add-text-properties (overlay-start extent) | ||
| 130 | (overlay-end extent) | ||
| 131 | (overlay-properties extent) | ||
| 132 | (overlay-buffer extent))) | ||
| 133 | ;; If becoming no longer duplicable, remove these text props. | ||
| 134 | ((and (not value) (overlay-get extent prop)) | ||
| 135 | (remove-text-properties (overlay-start extent) | ||
| 136 | (overlay-end extent) | ||
| 137 | (overlay-properties extent) | ||
| 138 | (overlay-buffer extent)))) | ||
| 139 | ;; If extent is already duplicable, put this property | ||
| 140 | ;; on the text as well as on the overlay. | ||
| 141 | (if (overlay-get extent 'duplicable) | ||
| 142 | (put-text-property (overlay-start extent) | ||
| 143 | (overlay-end extent) | ||
| 144 | prop value (overlay-buffer extent)))) | ||
| 145 | (overlay-put extent prop value)) | ||
| 146 | |||
| 147 | (defun set-extent-face (extent face) | ||
| 148 | (set-extent-property extent 'face face)) | ||
| 149 | |||
| 150 | (defun set-extent-end-glyph (extent glyph) | ||
| 151 | (set-extent-property extent 'after-string glyph)) | ||
| 152 | |||
| 153 | (defun delete-extent (extent) | ||
| 154 | (set-extent-property extent 'duplicable nil) | ||
| 155 | (delete-overlay extent)) | ||
| 156 | |||
| 157 | ;; Support the Lucid names with `screen' instead of `frame'. | ||
| 158 | |||
| 159 | (defalias 'current-screen-configuration 'current-frame-configuration) | ||
| 160 | (defalias 'delete-screen 'delete-frame) | ||
| 161 | (defalias 'find-file-new-screen 'find-file-other-frame) | ||
| 162 | (defalias 'find-file-read-only-new-screen 'find-file-read-only-other-frame) | ||
| 163 | (defalias 'find-tag-new-screen 'find-tag-other-frame) | ||
| 164 | ;;(defalias 'focus-screen 'focus-frame) | ||
| 165 | (defalias 'iconify-screen 'iconify-frame) | ||
| 166 | (defalias 'mail-new-screen 'mail-other-frame) | ||
| 167 | (defalias 'make-screen-invisible 'make-frame-invisible) | ||
| 168 | (defalias 'make-screen-visible 'make-frame-visible) | ||
| 169 | ;; (defalias 'minibuffer-screen-list 'minibuffer-frame-list) | ||
| 170 | (defalias 'modify-screen-parameters 'modify-frame-parameters) | ||
| 171 | (defalias 'next-screen 'next-frame) | ||
| 172 | ;; (defalias 'next-multiscreen-window 'next-multiframe-window) | ||
| 173 | ;; (defalias 'previous-multiscreen-window 'previous-multiframe-window) | ||
| 174 | ;; (defalias 'redirect-screen-focus 'redirect-frame-focus) | ||
| 175 | (defalias 'redraw-screen 'redraw-frame) | ||
| 176 | ;; (defalias 'screen-char-height 'frame-char-height) | ||
| 177 | ;; (defalias 'screen-char-width 'frame-char-width) | ||
| 178 | ;; (defalias 'screen-configuration-to-register 'frame-configuration-to-register) | ||
| 179 | ;; (defalias 'screen-focus 'frame-focus) | ||
| 180 | (defalias 'screen-list 'frame-list) | ||
| 181 | ;; (defalias 'screen-live-p 'frame-live-p) | ||
| 182 | (defalias 'screen-parameters 'frame-parameters) | ||
| 183 | (defalias 'screen-pixel-height 'frame-pixel-height) | ||
| 184 | (defalias 'screen-pixel-width 'frame-pixel-width) | ||
| 185 | (defalias 'screen-root-window 'frame-root-window) | ||
| 186 | (defalias 'screen-selected-window 'frame-selected-window) | ||
| 187 | (defalias 'lower-screen 'lower-frame) | ||
| 188 | (defalias 'raise-screen 'raise-frame) | ||
| 189 | (defalias 'screen-visible-p 'frame-visible-p) | ||
| 190 | (defalias 'screenp 'framep) | ||
| 191 | (defalias 'select-screen 'select-frame) | ||
| 192 | (defalias 'selected-screen 'selected-frame) | ||
| 193 | ;; (defalias 'set-screen-configuration 'set-frame-configuration) | ||
| 194 | ;; (defalias 'set-screen-height 'set-frame-height) | ||
| 195 | (defalias 'set-screen-position 'set-frame-position) | ||
| 196 | (defalias 'set-screen-size 'set-frame-size) | ||
| 197 | ;; (defalias 'set-screen-width 'set-frame-width) | ||
| 198 | (defalias 'switch-to-buffer-new-screen 'switch-to-buffer-other-frame) | ||
| 199 | ;; (defalias 'unfocus-screen 'unfocus-frame) | ||
| 200 | (defalias 'visible-screen-list 'visible-frame-list) | ||
| 201 | (defalias 'window-screen 'window-frame) | ||
| 202 | (defalias 'x-create-screen 'x-create-frame) | ||
| 203 | (defalias 'x-new-screen 'make-frame) | ||
| 204 | |||
| 205 | (provide 'lucid) | ||
| 206 | |||
| 207 | ;; Local Variables: | ||
| 208 | ;; byte-compile-warnings: (not cl-functions) | ||
| 209 | ;; End: | ||
| 210 | |||
| 211 | ;;; lucid.el ends here | ||
diff --git a/lisp/obsolete/old-whitespace.el b/lisp/obsolete/old-whitespace.el deleted file mode 100644 index 2f46d7ddda5..00000000000 --- a/lisp/obsolete/old-whitespace.el +++ /dev/null | |||
| @@ -1,801 +0,0 @@ | |||
| 1 | ;;; whitespace.el --- warn about and clean bogus whitespaces in the file | ||
| 2 | |||
| 3 | ;; Copyright (C) 1999-2020 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: Rajesh Vaidheeswarran <rv@gnu.org> | ||
| 6 | ;; Keywords: convenience | ||
| 7 | ;; Obsolete-since: 23.1 | ||
| 8 | |||
| 9 | ;; This file is part of GNU Emacs. | ||
| 10 | |||
| 11 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 12 | ;; it under the terms of the GNU General Public License as published by | ||
| 13 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 14 | ;; (at your option) any later version. | ||
| 15 | |||
| 16 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 17 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 18 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 19 | ;; GNU General Public License for more details. | ||
| 20 | |||
| 21 | ;; You should have received a copy of the GNU General Public License | ||
| 22 | ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | ||
| 23 | |||
| 24 | ;;; Commentary: | ||
| 25 | |||
| 26 | ;; URL: http://www.dsmit.com/lisp/ | ||
| 27 | ;; | ||
| 28 | ;; The whitespace library is intended to find and help fix five different types | ||
| 29 | ;; of whitespace problems that commonly exist in source code. | ||
| 30 | ;; | ||
| 31 | ;; 1. Leading space (empty lines at the top of a file). | ||
| 32 | ;; 2. Trailing space (empty lines at the end of a file). | ||
| 33 | ;; 3. Indentation space (8 or more spaces at beginning of line, that should be | ||
| 34 | ;; replaced with TABS). | ||
| 35 | ;; 4. Spaces followed by a TAB. (Almost always, we never want that). | ||
| 36 | ;; 5. Spaces or TABS at the end of a line. | ||
| 37 | ;; | ||
| 38 | ;; Whitespace errors are reported in a buffer, and on the mode line. | ||
| 39 | ;; | ||
| 40 | ;; Mode line will show a W:<x>!<y> to denote a particular type of whitespace, | ||
| 41 | ;; where `x' and `y' can be one (or more) of: | ||
| 42 | ;; | ||
| 43 | ;; e - End-of-Line whitespace. | ||
| 44 | ;; i - Indentation whitespace. | ||
| 45 | ;; l - Leading whitespace. | ||
| 46 | ;; s - Space followed by Tab. | ||
| 47 | ;; t - Trailing whitespace. | ||
| 48 | ;; | ||
| 49 | ;; If any of the whitespace checks is turned off, the mode line will display a | ||
| 50 | ;; !<y>. | ||
| 51 | ;; | ||
| 52 | ;; (since (3) is the most controversial one, here is the rationale: Most | ||
| 53 | ;; terminal drivers and printer drivers have TAB configured or even | ||
| 54 | ;; hardcoded to be 8 spaces. (Some of them allow configuration, but almost | ||
| 55 | ;; always they default to 8.) | ||
| 56 | ;; | ||
| 57 | ;; Changing `tab-width' to other than 8 and editing will cause your code to | ||
| 58 | ;; look different from within Emacs, and say, if you cat it or more it, or | ||
| 59 | ;; even print it. | ||
| 60 | ;; | ||
| 61 | ;; Almost all the popular programming modes let you define an offset (like | ||
| 62 | ;; c-basic-offset or perl-indent-level) to configure the offset, so you | ||
| 63 | ;; should never have to set your `tab-width' to be other than 8 in all | ||
| 64 | ;; these modes. In fact, with an indent level of say, 4, 2 TABS will cause | ||
| 65 | ;; Emacs to replace your 8 spaces with one \t (try it). If vi users in | ||
| 66 | ;; your office complain, tell them to use vim, which distinguishes between | ||
| 67 | ;; tabstop and shiftwidth (vi equivalent of our offsets), and also ask them | ||
| 68 | ;; to set smarttab.) | ||
| 69 | ;; | ||
| 70 | ;; All the above have caused (and will cause) unwanted codeline integration and | ||
| 71 | ;; merge problems. | ||
| 72 | ;; | ||
| 73 | ;; whitespace.el will complain if it detects whitespaces on opening a file, and | ||
| 74 | ;; warn you on closing a file also (in case you had inserted any | ||
| 75 | ;; whitespaces during the process of your editing). | ||
| 76 | ;; | ||
| 77 | ;; Exported functions: | ||
| 78 | ;; | ||
| 79 | ;; `whitespace-buffer' - To check the current buffer for whitespace problems. | ||
| 80 | ;; `whitespace-cleanup' - To cleanup all whitespaces in the current buffer. | ||
| 81 | ;; `whitespace-region' - To check between point and mark for whitespace | ||
| 82 | ;; problems. | ||
| 83 | ;; `whitespace-cleanup-region' - To cleanup all whitespaces between point | ||
| 84 | ;; and mark in the current buffer. | ||
| 85 | |||
| 86 | ;;; Code: | ||
| 87 | |||
| 88 | (defvar whitespace-version "3.5" "Version of the whitespace library.") | ||
| 89 | |||
| 90 | (defvar whitespace-all-buffer-files nil | ||
| 91 | "An associated list of buffers and files checked for whitespace cleanliness. | ||
| 92 | |||
| 93 | This is to enable periodic checking of whitespace cleanliness in the files | ||
| 94 | visited by the buffers.") | ||
| 95 | |||
| 96 | (defvar whitespace-rescan-timer nil | ||
| 97 | "Timer object used to rescan the files in buffers that have been modified.") | ||
| 98 | |||
| 99 | ;; Tell Emacs about this new kind of minor mode | ||
| 100 | (defvar whitespace-mode nil | ||
| 101 | "Non-nil when Whitespace mode (a minor mode) is enabled.") | ||
| 102 | (make-variable-buffer-local 'whitespace-mode) | ||
| 103 | |||
| 104 | (defvar whitespace-mode-line nil | ||
| 105 | "String to display in the mode line for Whitespace mode.") | ||
| 106 | (make-variable-buffer-local 'whitespace-mode-line) | ||
| 107 | |||
| 108 | (defvar whitespace-check-buffer-leading nil | ||
| 109 | "Test leading whitespace for file in current buffer if t.") | ||
| 110 | (make-variable-buffer-local 'whitespace-check-buffer-leading) | ||
| 111 | ;;;###autoload(put 'whitespace-check-buffer-leading 'safe-local-variable 'booleanp) | ||
| 112 | |||
| 113 | (defvar whitespace-check-buffer-trailing nil | ||
| 114 | "Test trailing whitespace for file in current buffer if t.") | ||
| 115 | (make-variable-buffer-local 'whitespace-check-buffer-trailing) | ||
| 116 | ;;;###autoload(put 'whitespace-check-buffer-trailing 'safe-local-variable 'booleanp) | ||
| 117 | |||
| 118 | (defvar whitespace-check-buffer-indent nil | ||
| 119 | "Test indentation whitespace for file in current buffer if t.") | ||
| 120 | (make-variable-buffer-local 'whitespace-check-buffer-indent) | ||
| 121 | ;;;###autoload(put 'whitespace-check-buffer-indent 'safe-local-variable 'booleanp) | ||
| 122 | |||
| 123 | (defvar whitespace-check-buffer-spacetab nil | ||
| 124 | "Test Space-followed-by-TABS whitespace for file in current buffer if t.") | ||
| 125 | (make-variable-buffer-local 'whitespace-check-buffer-spacetab) | ||
| 126 | ;;;###autoload(put 'whitespace-check-buffer-spacetab 'safe-local-variable 'booleanp) | ||
| 127 | |||
| 128 | (defvar whitespace-check-buffer-ateol nil | ||
| 129 | "Test end-of-line whitespace for file in current buffer if t.") | ||
| 130 | (make-variable-buffer-local 'whitespace-check-buffer-ateol) | ||
| 131 | ;;;###autoload(put 'whitespace-check-buffer-ateol 'safe-local-variable 'booleanp) | ||
| 132 | |||
| 133 | (defvar whitespace-highlighted-space nil | ||
| 134 | "The variable to store the extent to highlight.") | ||
| 135 | (make-variable-buffer-local 'whitespace-highlighted-space) | ||
| 136 | |||
| 137 | (defalias 'whitespace-make-overlay | ||
| 138 | (if (featurep 'xemacs) 'make-extent 'make-overlay)) | ||
| 139 | (defalias 'whitespace-overlay-put | ||
| 140 | (if (featurep 'xemacs) 'set-extent-property 'overlay-put)) | ||
| 141 | (defalias 'whitespace-delete-overlay | ||
| 142 | (if (featurep 'xemacs) 'delete-extent 'delete-overlay)) | ||
| 143 | (defalias 'whitespace-overlay-start | ||
| 144 | (if (featurep 'xemacs) 'extent-start 'overlay-start)) | ||
| 145 | (defalias 'whitespace-overlay-end | ||
| 146 | (if (featurep 'xemacs) 'extent-end 'overlay-end)) | ||
| 147 | (defalias 'whitespace-mode-line-update | ||
| 148 | (if (featurep 'xemacs) 'redraw-modeline 'force-mode-line-update)) | ||
| 149 | |||
| 150 | (defgroup whitespace nil | ||
| 151 | "Check for and fix five different types of whitespaces in source code." | ||
| 152 | :version "21.1" | ||
| 153 | :link '(emacs-commentary-link "whitespace.el") | ||
| 154 | ;; Since XEmacs doesn't have a 'convenience group, use the next best group | ||
| 155 | ;; which is 'editing? | ||
| 156 | :group (if (featurep 'xemacs) 'editing 'convenience)) | ||
| 157 | |||
| 158 | (defcustom whitespace-check-leading-whitespace t | ||
| 159 | "Flag to check leading whitespace. This is the global for the system. | ||
| 160 | It can be overridden by setting a buffer local variable | ||
| 161 | `whitespace-check-buffer-leading'." | ||
| 162 | :type 'boolean | ||
| 163 | :group 'whitespace) | ||
| 164 | |||
| 165 | (defcustom whitespace-check-trailing-whitespace t | ||
| 166 | "Flag to check trailing whitespace. This is the global for the system. | ||
| 167 | It can be overridden by setting a buffer local variable | ||
| 168 | `whitespace-check-buffer-trailing'." | ||
| 169 | :type 'boolean | ||
| 170 | :group 'whitespace) | ||
| 171 | |||
| 172 | (defcustom whitespace-check-spacetab-whitespace t | ||
| 173 | "Flag to check space followed by a TAB. This is the global for the system. | ||
| 174 | It can be overridden by setting a buffer local variable | ||
| 175 | `whitespace-check-buffer-spacetab'." | ||
| 176 | :type 'boolean | ||
| 177 | :group 'whitespace) | ||
| 178 | |||
| 179 | (defcustom whitespace-spacetab-regexp "[ ]+\t" | ||
| 180 | "Regexp to match one or more spaces followed by a TAB." | ||
| 181 | :type 'regexp | ||
| 182 | :group 'whitespace) | ||
| 183 | |||
| 184 | (defcustom whitespace-check-indent-whitespace indent-tabs-mode | ||
| 185 | "Flag to check indentation whitespace. This is the global for the system. | ||
| 186 | It can be overridden by setting a buffer local variable | ||
| 187 | `whitespace-check-buffer-indent'." | ||
| 188 | :type 'boolean | ||
| 189 | :group 'whitespace) | ||
| 190 | |||
| 191 | (defcustom whitespace-indent-regexp "^\t*\\( \\)+" | ||
| 192 | "Regexp to match multiples of eight spaces near line beginnings. | ||
| 193 | The default value ignores leading TABs." | ||
| 194 | :type 'regexp | ||
| 195 | :group 'whitespace) | ||
| 196 | |||
| 197 | (defcustom whitespace-check-ateol-whitespace t | ||
| 198 | "Flag to check end-of-line whitespace. This is the global for the system. | ||
| 199 | It can be overridden by setting a buffer local variable | ||
| 200 | `whitespace-check-buffer-ateol'." | ||
| 201 | :type 'boolean | ||
| 202 | :group 'whitespace) | ||
| 203 | |||
| 204 | (defcustom whitespace-ateol-regexp "[ \t]+$" | ||
| 205 | "Regexp to match one or more TABs or spaces at line ends." | ||
| 206 | :type 'regexp | ||
| 207 | :group 'whitespace) | ||
| 208 | |||
| 209 | (defcustom whitespace-errbuf "*Whitespace Errors*" | ||
| 210 | "The name of the buffer where whitespace related messages will be logged." | ||
| 211 | :type 'string | ||
| 212 | :group 'whitespace) | ||
| 213 | |||
| 214 | (defcustom whitespace-clean-msg "clean." | ||
| 215 | "If non-nil, this message will be displayed after a whitespace check | ||
| 216 | determines a file to be clean." | ||
| 217 | :type 'string | ||
| 218 | :group 'whitespace) | ||
| 219 | |||
| 220 | (defcustom whitespace-abort-on-error nil | ||
| 221 | "While writing a file, abort if the file is unclean. | ||
| 222 | If `whitespace-auto-cleanup' is set, that takes precedence over | ||
| 223 | this variable." | ||
| 224 | :type 'boolean | ||
| 225 | :group 'whitespace) | ||
| 226 | |||
| 227 | (defcustom whitespace-auto-cleanup nil | ||
| 228 | "Cleanup a buffer automatically on finding it whitespace unclean." | ||
| 229 | :type 'boolean | ||
| 230 | :group 'whitespace) | ||
| 231 | |||
| 232 | (defcustom whitespace-silent nil | ||
| 233 | "All whitespace errors will be shown only in the mode line when t. | ||
| 234 | |||
| 235 | Note that setting this may cause all whitespaces introduced in a file to go | ||
| 236 | unnoticed when the buffer is killed, unless the user visits the `*Whitespace | ||
| 237 | Errors*' buffer before opening (or closing) another file." | ||
| 238 | :type 'boolean | ||
| 239 | :group 'whitespace) | ||
| 240 | |||
| 241 | (defcustom whitespace-modes '(ada-mode asm-mode autoconf-mode awk-mode | ||
| 242 | c-mode c++-mode cc-mode | ||
| 243 | change-log-mode cperl-mode | ||
| 244 | electric-nroff-mode emacs-lisp-mode | ||
| 245 | f90-mode fortran-mode html-mode | ||
| 246 | html3-mode java-mode jde-mode | ||
| 247 | ksh-mode latex-mode LaTeX-mode | ||
| 248 | lisp-mode m4-mode makefile-mode | ||
| 249 | modula-2-mode nroff-mode objc-mode | ||
| 250 | pascal-mode perl-mode prolog-mode | ||
| 251 | python-mode scheme-mode sgml-mode | ||
| 252 | sh-mode shell-script-mode simula-mode | ||
| 253 | tcl-mode tex-mode texinfo-mode | ||
| 254 | vrml-mode xml-mode) | ||
| 255 | |||
| 256 | "Major modes in which we turn on whitespace checking. | ||
| 257 | |||
| 258 | These are mostly programming and documentation modes. But you may add other | ||
| 259 | modes that you want whitespaces checked in by adding something like the | ||
| 260 | following to your `.emacs': | ||
| 261 | |||
| 262 | \(setq whitespace-modes (cons \\='my-mode (cons \\='my-other-mode | ||
| 263 | whitespace-modes))\) | ||
| 264 | |||
| 265 | Or, alternately, you can use the Emacs `customize' command to set this." | ||
| 266 | :type '(repeat symbol) | ||
| 267 | :group 'whitespace) | ||
| 268 | |||
| 269 | (defcustom whitespace-rescan-timer-time 600 | ||
| 270 | "Period in seconds to rescan modified buffers for whitespace creep. | ||
| 271 | |||
| 272 | This is the period after which the timer will fire causing | ||
| 273 | `whitespace-rescan-files-in-buffers' to check for whitespace creep in | ||
| 274 | modified buffers. | ||
| 275 | |||
| 276 | To disable timer scans, set this to zero." | ||
| 277 | :type 'integer | ||
| 278 | :group 'whitespace) | ||
| 279 | |||
| 280 | (defcustom whitespace-display-in-modeline t | ||
| 281 | "Display whitespace errors on the modeline." | ||
| 282 | :type 'boolean | ||
| 283 | :group 'whitespace) | ||
| 284 | |||
| 285 | (defcustom whitespace-display-spaces-in-color t | ||
| 286 | "Display the bogus whitespaces by coloring them with the face | ||
| 287 | `whitespace-highlight'." | ||
| 288 | :type 'boolean | ||
| 289 | :group 'whitespace) | ||
| 290 | |||
| 291 | (defface whitespace-highlight '((((class color) (background light)) | ||
| 292 | (:background "green1")) | ||
| 293 | (((class color) (background dark)) | ||
| 294 | (:background "sea green")) | ||
| 295 | (((class grayscale mono) | ||
| 296 | (background light)) | ||
| 297 | (:background "black")) | ||
| 298 | (((class grayscale mono) | ||
| 299 | (background dark)) | ||
| 300 | (:background "white"))) | ||
| 301 | "Face used for highlighting the bogus whitespaces that exist in the buffer." | ||
| 302 | :group 'whitespace) | ||
| 303 | |||
| 304 | (if (not (assoc 'whitespace-mode minor-mode-alist)) | ||
| 305 | (setq minor-mode-alist (cons '(whitespace-mode whitespace-mode-line) | ||
| 306 | minor-mode-alist))) | ||
| 307 | |||
| 308 | (set-default 'whitespace-check-buffer-leading | ||
| 309 | whitespace-check-leading-whitespace) | ||
| 310 | (set-default 'whitespace-check-buffer-trailing | ||
| 311 | whitespace-check-trailing-whitespace) | ||
| 312 | (set-default 'whitespace-check-buffer-indent | ||
| 313 | whitespace-check-indent-whitespace) | ||
| 314 | (set-default 'whitespace-check-buffer-spacetab | ||
| 315 | whitespace-check-spacetab-whitespace) | ||
| 316 | (set-default 'whitespace-check-buffer-ateol | ||
| 317 | whitespace-check-ateol-whitespace) | ||
| 318 | |||
| 319 | (defun whitespace-check-whitespace-mode (&optional arg) | ||
| 320 | "Test and set the whitespace-mode in qualifying buffers." | ||
| 321 | (if (null whitespace-mode) | ||
| 322 | (setq whitespace-mode | ||
| 323 | (if (or arg (member major-mode whitespace-modes)) | ||
| 324 | t | ||
| 325 | nil)))) | ||
| 326 | |||
| 327 | ;;;###autoload | ||
| 328 | (defun whitespace-toggle-leading-check () | ||
| 329 | "Toggle the check for leading space in the local buffer." | ||
| 330 | (interactive) | ||
| 331 | (let ((current-val whitespace-check-buffer-leading)) | ||
| 332 | (setq whitespace-check-buffer-leading (not current-val)) | ||
| 333 | (message "Will%s check for leading space in buffer." | ||
| 334 | (if whitespace-check-buffer-leading "" " not")) | ||
| 335 | (if whitespace-check-buffer-leading (whitespace-buffer-leading)))) | ||
| 336 | |||
| 337 | ;;;###autoload | ||
| 338 | (defun whitespace-toggle-trailing-check () | ||
| 339 | "Toggle the check for trailing space in the local buffer." | ||
| 340 | (interactive) | ||
| 341 | (let ((current-val whitespace-check-buffer-trailing)) | ||
| 342 | (setq whitespace-check-buffer-trailing (not current-val)) | ||
| 343 | (message "Will%s check for trailing space in buffer." | ||
| 344 | (if whitespace-check-buffer-trailing "" " not")) | ||
| 345 | (if whitespace-check-buffer-trailing (whitespace-buffer-trailing)))) | ||
| 346 | |||
| 347 | ;;;###autoload | ||
| 348 | (defun whitespace-toggle-indent-check () | ||
| 349 | "Toggle the check for indentation space in the local buffer." | ||
| 350 | (interactive) | ||
| 351 | (let ((current-val whitespace-check-buffer-indent)) | ||
| 352 | (setq whitespace-check-buffer-indent (not current-val)) | ||
| 353 | (message "Will%s check for indentation space in buffer." | ||
| 354 | (if whitespace-check-buffer-indent "" " not")) | ||
| 355 | (if whitespace-check-buffer-indent | ||
| 356 | (whitespace-buffer-search whitespace-indent-regexp)))) | ||
| 357 | |||
| 358 | ;;;###autoload | ||
| 359 | (defun whitespace-toggle-spacetab-check () | ||
| 360 | "Toggle the check for space-followed-by-TABs in the local buffer." | ||
| 361 | (interactive) | ||
| 362 | (let ((current-val whitespace-check-buffer-spacetab)) | ||
| 363 | (setq whitespace-check-buffer-spacetab (not current-val)) | ||
| 364 | (message "Will%s check for space-followed-by-TABs in buffer." | ||
| 365 | (if whitespace-check-buffer-spacetab "" " not")) | ||
| 366 | (if whitespace-check-buffer-spacetab | ||
| 367 | (whitespace-buffer-search whitespace-spacetab-regexp)))) | ||
| 368 | |||
| 369 | |||
| 370 | ;;;###autoload | ||
| 371 | (defun whitespace-toggle-ateol-check () | ||
| 372 | "Toggle the check for end-of-line space in the local buffer." | ||
| 373 | (interactive) | ||
| 374 | (let ((current-val whitespace-check-buffer-ateol)) | ||
| 375 | (setq whitespace-check-buffer-ateol (not current-val)) | ||
| 376 | (message "Will%s check for end-of-line space in buffer." | ||
| 377 | (if whitespace-check-buffer-ateol "" " not")) | ||
| 378 | (if whitespace-check-buffer-ateol | ||
| 379 | (whitespace-buffer-search whitespace-ateol-regexp)))) | ||
| 380 | |||
| 381 | |||
| 382 | ;;;###autoload | ||
| 383 | (defun whitespace-buffer (&optional quiet) | ||
| 384 | "Find five different types of white spaces in buffer. | ||
| 385 | These are: | ||
| 386 | 1. Leading space \(empty lines at the top of a file). | ||
| 387 | 2. Trailing space \(empty lines at the end of a file). | ||
| 388 | 3. Indentation space \(8 or more spaces, that should be replaced with TABS). | ||
| 389 | 4. Spaces followed by a TAB. \(Almost always, we never want that). | ||
| 390 | 5. Spaces or TABS at the end of a line. | ||
| 391 | |||
| 392 | Check for whitespace only if this buffer really contains a non-empty file | ||
| 393 | and: | ||
| 394 | 1. the major mode is one of the whitespace-modes, or | ||
| 395 | 2. `whitespace-buffer' was explicitly called with a prefix argument." | ||
| 396 | (interactive) | ||
| 397 | (let ((whitespace-error nil)) | ||
| 398 | (whitespace-check-whitespace-mode current-prefix-arg) | ||
| 399 | (if (and buffer-file-name (> (buffer-size) 0) whitespace-mode) | ||
| 400 | (progn | ||
| 401 | (whitespace-check-buffer-list (buffer-name) buffer-file-name) | ||
| 402 | (whitespace-tickle-timer) | ||
| 403 | (overlay-recenter (point-max)) | ||
| 404 | (remove-overlays nil nil 'face 'whitespace-highlight) | ||
| 405 | (if whitespace-auto-cleanup | ||
| 406 | (if buffer-read-only | ||
| 407 | (if (not quiet) | ||
| 408 | (message "Can't cleanup: %s is read-only" (buffer-name))) | ||
| 409 | (whitespace-cleanup-internal)) | ||
| 410 | (let ((whitespace-leading (if whitespace-check-buffer-leading | ||
| 411 | (whitespace-buffer-leading) | ||
| 412 | nil)) | ||
| 413 | (whitespace-trailing (if whitespace-check-buffer-trailing | ||
| 414 | (whitespace-buffer-trailing) | ||
| 415 | nil)) | ||
| 416 | (whitespace-indent (if whitespace-check-buffer-indent | ||
| 417 | (whitespace-buffer-search | ||
| 418 | whitespace-indent-regexp) | ||
| 419 | nil)) | ||
| 420 | (whitespace-spacetab (if whitespace-check-buffer-spacetab | ||
| 421 | (whitespace-buffer-search | ||
| 422 | whitespace-spacetab-regexp) | ||
| 423 | nil)) | ||
| 424 | (whitespace-ateol (if whitespace-check-buffer-ateol | ||
| 425 | (whitespace-buffer-search | ||
| 426 | whitespace-ateol-regexp) | ||
| 427 | nil)) | ||
| 428 | (whitespace-errmsg nil) | ||
| 429 | (whitespace-filename buffer-file-name) | ||
| 430 | (whitespace-this-modeline "")) | ||
| 431 | |||
| 432 | ;; Now let's complain if we found any of the above. | ||
| 433 | (setq whitespace-error (or whitespace-leading whitespace-indent | ||
| 434 | whitespace-spacetab whitespace-ateol | ||
| 435 | whitespace-trailing)) | ||
| 436 | |||
| 437 | (if whitespace-error | ||
| 438 | (progn | ||
| 439 | (setq whitespace-errmsg | ||
| 440 | (concat whitespace-filename " contains:\n" | ||
| 441 | (if whitespace-leading | ||
| 442 | "Leading whitespace\n") | ||
| 443 | (if whitespace-indent | ||
| 444 | (concat "Indentation whitespace" | ||
| 445 | whitespace-indent "\n")) | ||
| 446 | (if whitespace-spacetab | ||
| 447 | (concat "Space followed by Tab" | ||
| 448 | whitespace-spacetab "\n")) | ||
| 449 | (if whitespace-ateol | ||
| 450 | (concat "End-of-line whitespace" | ||
| 451 | whitespace-ateol "\n")) | ||
| 452 | (if whitespace-trailing | ||
| 453 | "Trailing whitespace\n") | ||
| 454 | "\ntype `M-x whitespace-cleanup' to " | ||
| 455 | "cleanup the file.")) | ||
| 456 | (setq whitespace-this-modeline | ||
| 457 | (concat (if whitespace-ateol "e") | ||
| 458 | (if whitespace-indent "i") | ||
| 459 | (if whitespace-leading "l") | ||
| 460 | (if whitespace-spacetab "s") | ||
| 461 | (if whitespace-trailing "t"))))) | ||
| 462 | (whitespace-update-modeline whitespace-this-modeline) | ||
| 463 | (if (get-buffer whitespace-errbuf) | ||
| 464 | (kill-buffer whitespace-errbuf)) | ||
| 465 | (with-current-buffer (get-buffer-create whitespace-errbuf) | ||
| 466 | (if whitespace-errmsg | ||
| 467 | (progn | ||
| 468 | (insert whitespace-errmsg) | ||
| 469 | (if (not (or quiet whitespace-silent)) | ||
| 470 | (display-buffer (current-buffer) t)) | ||
| 471 | (if (not quiet) | ||
| 472 | (message "Whitespaces: [%s%s] in %s" | ||
| 473 | whitespace-this-modeline | ||
| 474 | (let ((whitespace-unchecked | ||
| 475 | (whitespace-unchecked-whitespaces))) | ||
| 476 | (if whitespace-unchecked | ||
| 477 | (concat "!" whitespace-unchecked) | ||
| 478 | "")) | ||
| 479 | whitespace-filename))) | ||
| 480 | (if (and (not quiet) (not (equal whitespace-clean-msg ""))) | ||
| 481 | (message "%s %s" whitespace-filename | ||
| 482 | whitespace-clean-msg)))))))) | ||
| 483 | whitespace-error)) | ||
| 484 | |||
| 485 | ;;;###autoload | ||
| 486 | (defun whitespace-region (s e) | ||
| 487 | "Check the region for whitespace errors." | ||
| 488 | (interactive "r") | ||
| 489 | (save-excursion | ||
| 490 | (save-restriction | ||
| 491 | (narrow-to-region s e) | ||
| 492 | (whitespace-buffer)))) | ||
| 493 | |||
| 494 | ;;;###autoload | ||
| 495 | (defun whitespace-cleanup () | ||
| 496 | "Cleanup the five different kinds of whitespace problems. | ||
| 497 | It normally applies to the whole buffer, but in Transient Mark mode | ||
| 498 | when the mark is active it applies to the region. | ||
| 499 | See `whitespace-buffer' docstring for a summary of the problems." | ||
| 500 | (interactive) | ||
| 501 | (if (and transient-mark-mode mark-active) | ||
| 502 | (whitespace-cleanup-region (region-beginning) (region-end)) | ||
| 503 | (whitespace-cleanup-internal))) | ||
| 504 | |||
| 505 | (defun whitespace-cleanup-internal (&optional region-only) | ||
| 506 | ;; If this buffer really contains a file, then run, else quit. | ||
| 507 | (whitespace-check-whitespace-mode current-prefix-arg) | ||
| 508 | (if (and buffer-file-name whitespace-mode) | ||
| 509 | (let ((whitespace-any nil) | ||
| 510 | (whitespace-tabwidth 8) | ||
| 511 | (whitespace-tabwidth-saved tab-width)) | ||
| 512 | |||
| 513 | ;; since all printable TABS should be 8, irrespective of how | ||
| 514 | ;; they are displayed. | ||
| 515 | (setq tab-width whitespace-tabwidth) | ||
| 516 | |||
| 517 | (if (and whitespace-check-buffer-leading | ||
| 518 | (whitespace-buffer-leading)) | ||
| 519 | (progn | ||
| 520 | (whitespace-buffer-leading-cleanup) | ||
| 521 | (setq whitespace-any t))) | ||
| 522 | |||
| 523 | (if (and whitespace-check-buffer-trailing | ||
| 524 | (whitespace-buffer-trailing)) | ||
| 525 | (progn | ||
| 526 | (whitespace-buffer-trailing-cleanup) | ||
| 527 | (setq whitespace-any t))) | ||
| 528 | |||
| 529 | (if (and whitespace-check-buffer-indent | ||
| 530 | (whitespace-buffer-search whitespace-indent-regexp)) | ||
| 531 | (progn | ||
| 532 | (whitespace-indent-cleanup) | ||
| 533 | (setq whitespace-any t))) | ||
| 534 | |||
| 535 | (if (and whitespace-check-buffer-spacetab | ||
| 536 | (whitespace-buffer-search whitespace-spacetab-regexp)) | ||
| 537 | (progn | ||
| 538 | (whitespace-buffer-cleanup whitespace-spacetab-regexp "\t") | ||
| 539 | (setq whitespace-any t))) | ||
| 540 | |||
| 541 | (if (and whitespace-check-buffer-ateol | ||
| 542 | (whitespace-buffer-search whitespace-ateol-regexp)) | ||
| 543 | (progn | ||
| 544 | (whitespace-buffer-cleanup whitespace-ateol-regexp "") | ||
| 545 | (setq whitespace-any t))) | ||
| 546 | |||
| 547 | ;; Call this recursively till everything is taken care of | ||
| 548 | (if whitespace-any | ||
| 549 | (whitespace-cleanup-internal region-only) | ||
| 550 | ;; if we are done, talk to the user | ||
| 551 | (progn | ||
| 552 | (unless whitespace-silent | ||
| 553 | (if region-only | ||
| 554 | (message "The region is now clean") | ||
| 555 | (message "%s is now clean" buffer-file-name))) | ||
| 556 | (whitespace-update-modeline))) | ||
| 557 | (setq tab-width whitespace-tabwidth-saved)))) | ||
| 558 | |||
| 559 | ;;;###autoload | ||
| 560 | (defun whitespace-cleanup-region (s e) | ||
| 561 | "Whitespace cleanup on the region." | ||
| 562 | (interactive "r") | ||
| 563 | (save-excursion | ||
| 564 | (save-restriction | ||
| 565 | (narrow-to-region s e) | ||
| 566 | (whitespace-cleanup-internal t)) | ||
| 567 | (whitespace-buffer t))) | ||
| 568 | |||
| 569 | (defun whitespace-buffer-leading () | ||
| 570 | "Return t if the current buffer has leading newline characters. | ||
| 571 | If highlighting is enabled, highlight these characters." | ||
| 572 | (save-excursion | ||
| 573 | (goto-char (point-min)) | ||
| 574 | (skip-chars-forward "\n") | ||
| 575 | (unless (bobp) | ||
| 576 | (whitespace-highlight-the-space (point-min) (point)) | ||
| 577 | t))) | ||
| 578 | |||
| 579 | (defun whitespace-buffer-leading-cleanup () | ||
| 580 | "Remove any leading newline characters from current buffer." | ||
| 581 | (save-excursion | ||
| 582 | (goto-char (point-min)) | ||
| 583 | (skip-chars-forward "\n") | ||
| 584 | (delete-region (point-min) (point)))) | ||
| 585 | |||
| 586 | (defun whitespace-buffer-trailing () | ||
| 587 | "Return t if the current buffer has extra trailing newline characters. | ||
| 588 | If highlighting is enabled, highlight these characters." | ||
| 589 | (save-excursion | ||
| 590 | (goto-char (point-max)) | ||
| 591 | (skip-chars-backward "\n") | ||
| 592 | (forward-line) | ||
| 593 | (unless (eobp) | ||
| 594 | (whitespace-highlight-the-space (point) (point-max)) | ||
| 595 | t))) | ||
| 596 | |||
| 597 | (defun whitespace-buffer-trailing-cleanup () | ||
| 598 | "Remove extra trailing newline characters from current buffer." | ||
| 599 | (save-excursion | ||
| 600 | (goto-char (point-max)) | ||
| 601 | (skip-chars-backward "\n") | ||
| 602 | (unless (eobp) | ||
| 603 | (forward-line) | ||
| 604 | (delete-region (point) (point-max))))) | ||
| 605 | |||
| 606 | (defun whitespace-buffer-search (regexp) | ||
| 607 | "Search for any given whitespace REGEXP." | ||
| 608 | (with-local-quit | ||
| 609 | (let (whitespace-retval) | ||
| 610 | (save-excursion | ||
| 611 | (goto-char (point-min)) | ||
| 612 | (while (re-search-forward regexp nil t) | ||
| 613 | (whitespace-highlight-the-space (match-beginning 0) (match-end 0)) | ||
| 614 | (push (match-beginning 0) whitespace-retval))) | ||
| 615 | (when whitespace-retval | ||
| 616 | (format " %s" (nreverse whitespace-retval)))))) | ||
| 617 | |||
| 618 | (defun whitespace-buffer-cleanup (regexp newregexp) | ||
| 619 | "Search for any given whitespace REGEXP and replace it with the NEWREGEXP." | ||
| 620 | (save-excursion | ||
| 621 | (goto-char (point-min)) | ||
| 622 | (while (re-search-forward regexp nil t) | ||
| 623 | (replace-match newregexp)))) | ||
| 624 | |||
| 625 | (defun whitespace-indent-cleanup () | ||
| 626 | "Search for 8/more spaces at the start of a line and replace it with tabs." | ||
| 627 | (save-excursion | ||
| 628 | (goto-char (point-min)) | ||
| 629 | (while (re-search-forward whitespace-indent-regexp nil t) | ||
| 630 | (let ((column (current-column)) | ||
| 631 | (indent-tabs-mode t)) | ||
| 632 | (delete-region (match-beginning 0) (point)) | ||
| 633 | (indent-to column))))) | ||
| 634 | |||
| 635 | (defun whitespace-unchecked-whitespaces () | ||
| 636 | "Return the list of whitespaces whose testing has been suppressed." | ||
| 637 | (let ((unchecked-spaces | ||
| 638 | (concat (if (not whitespace-check-buffer-ateol) "e") | ||
| 639 | (if (not whitespace-check-buffer-indent) "i") | ||
| 640 | (if (not whitespace-check-buffer-leading) "l") | ||
| 641 | (if (not whitespace-check-buffer-spacetab) "s") | ||
| 642 | (if (not whitespace-check-buffer-trailing) "t")))) | ||
| 643 | (if (not (equal unchecked-spaces "")) | ||
| 644 | unchecked-spaces | ||
| 645 | nil))) | ||
| 646 | |||
| 647 | (defun whitespace-update-modeline (&optional whitespace-err) | ||
| 648 | "Update mode line with whitespace errors. | ||
| 649 | Also with whitespaces whose testing has been turned off." | ||
| 650 | (if whitespace-display-in-modeline | ||
| 651 | (progn | ||
| 652 | (setq whitespace-mode-line nil) | ||
| 653 | ;; Whitespace errors | ||
| 654 | (if (and whitespace-err (not (equal whitespace-err ""))) | ||
| 655 | (setq whitespace-mode-line whitespace-err)) | ||
| 656 | ;; Whitespace suppressed errors | ||
| 657 | (let ((whitespace-unchecked (whitespace-unchecked-whitespaces))) | ||
| 658 | (if whitespace-unchecked | ||
| 659 | (setq whitespace-mode-line | ||
| 660 | (concat whitespace-mode-line "!" whitespace-unchecked)))) | ||
| 661 | ;; Add the whitespace modeline prefix | ||
| 662 | (setq whitespace-mode-line (if whitespace-mode-line | ||
| 663 | (concat " W:" whitespace-mode-line) | ||
| 664 | nil)) | ||
| 665 | (whitespace-mode-line-update)))) | ||
| 666 | |||
| 667 | (defun whitespace-highlight-the-space (b e) | ||
| 668 | "Highlight the current line, unhighlighting a previously jumped to line." | ||
| 669 | (if whitespace-display-spaces-in-color | ||
| 670 | (let ((ol (whitespace-make-overlay b e))) | ||
| 671 | (whitespace-overlay-put ol 'face 'whitespace-highlight)))) | ||
| 672 | |||
| 673 | (defun whitespace-unhighlight-the-space() | ||
| 674 | "Unhighlight the currently highlight line." | ||
| 675 | (if (and whitespace-display-spaces-in-color whitespace-highlighted-space) | ||
| 676 | (progn | ||
| 677 | (mapc 'whitespace-delete-overlay whitespace-highlighted-space) | ||
| 678 | (setq whitespace-highlighted-space nil)))) | ||
| 679 | |||
| 680 | (defun whitespace-check-buffer-list (buf-name buf-file) | ||
| 681 | "Add a buffer and its file to the whitespace monitor list. | ||
| 682 | |||
| 683 | The buffer named BUF-NAME and its associated file BUF-FILE are now monitored | ||
| 684 | periodically for whitespace." | ||
| 685 | (if (and whitespace-mode (not (member (list buf-file buf-name) | ||
| 686 | whitespace-all-buffer-files))) | ||
| 687 | (add-to-list 'whitespace-all-buffer-files (list buf-file buf-name)))) | ||
| 688 | |||
| 689 | (defun whitespace-tickle-timer () | ||
| 690 | "Tickle timer to periodically to scan qualifying files for whitespace creep. | ||
| 691 | |||
| 692 | If timer is not set, then set it to scan the files in | ||
| 693 | `whitespace-all-buffer-files' periodically (defined by | ||
| 694 | `whitespace-rescan-timer-time') for whitespace creep." | ||
| 695 | (if (and whitespace-rescan-timer-time | ||
| 696 | (/= whitespace-rescan-timer-time 0) | ||
| 697 | (not whitespace-rescan-timer)) | ||
| 698 | (setq whitespace-rescan-timer | ||
| 699 | (add-timeout whitespace-rescan-timer-time | ||
| 700 | 'whitespace-rescan-files-in-buffers nil | ||
| 701 | whitespace-rescan-timer-time)))) | ||
| 702 | |||
| 703 | (defun whitespace-rescan-files-in-buffers (&optional arg) | ||
| 704 | "Check monitored files for whitespace creep since last scan." | ||
| 705 | (let ((whitespace-all-my-files whitespace-all-buffer-files) | ||
| 706 | buffile bufname thiselt buf) | ||
| 707 | (if (not whitespace-all-my-files) | ||
| 708 | (progn | ||
| 709 | (disable-timeout whitespace-rescan-timer) | ||
| 710 | (setq whitespace-rescan-timer nil)) | ||
| 711 | (while whitespace-all-my-files | ||
| 712 | (setq thiselt (car whitespace-all-my-files)) | ||
| 713 | (setq whitespace-all-my-files (cdr whitespace-all-my-files)) | ||
| 714 | (setq buffile (car thiselt)) | ||
| 715 | (setq bufname (cadr thiselt)) | ||
| 716 | (setq buf (get-buffer bufname)) | ||
| 717 | (if (buffer-live-p buf) | ||
| 718 | (with-current-buffer bufname | ||
| 719 | ;;(message "buffer %s live" bufname) | ||
| 720 | (if whitespace-mode | ||
| 721 | (progn | ||
| 722 | ;;(message "checking for whitespace in %s" bufname) | ||
| 723 | (if whitespace-auto-cleanup | ||
| 724 | (progn | ||
| 725 | ;;(message "cleaning up whitespace in %s" bufname) | ||
| 726 | (whitespace-cleanup-internal)) | ||
| 727 | (progn | ||
| 728 | ;;(message "whitespace-buffer %s." (buffer-name)) | ||
| 729 | (whitespace-buffer t)))) | ||
| 730 | ;;(message "Removing %s from refresh list" bufname) | ||
| 731 | (whitespace-refresh-rescan-list buffile bufname))) | ||
| 732 | ;;(message "Removing %s from refresh list" bufname) | ||
| 733 | (whitespace-refresh-rescan-list buffile bufname)))))) | ||
| 734 | |||
| 735 | (defun whitespace-refresh-rescan-list (buffile bufname) | ||
| 736 | "Refresh the list of files to be rescanned for whitespace creep." | ||
| 737 | (if whitespace-all-buffer-files | ||
| 738 | (setq whitespace-all-buffer-files | ||
| 739 | (delete (list buffile bufname) whitespace-all-buffer-files)) | ||
| 740 | (when whitespace-rescan-timer | ||
| 741 | (disable-timeout whitespace-rescan-timer) | ||
| 742 | (setq whitespace-rescan-timer nil)))) | ||
| 743 | |||
| 744 | ;;;###autoload | ||
| 745 | (defalias 'global-whitespace-mode 'whitespace-global-mode) | ||
| 746 | |||
| 747 | ;;;###autoload | ||
| 748 | (define-minor-mode whitespace-global-mode | ||
| 749 | "Toggle using Whitespace mode in new buffers. | ||
| 750 | |||
| 751 | When this mode is active, `whitespace-buffer' is added to | ||
| 752 | `find-file-hook' and `kill-buffer-hook'." | ||
| 753 | :global t | ||
| 754 | :group 'whitespace | ||
| 755 | (if whitespace-global-mode | ||
| 756 | (progn | ||
| 757 | (add-hook 'find-file-hook 'whitespace-buffer) | ||
| 758 | (add-hook 'write-file-functions 'whitespace-write-file-hook nil t) | ||
| 759 | (add-hook 'kill-buffer-hook 'whitespace-buffer)) | ||
| 760 | (remove-hook 'find-file-hook 'whitespace-buffer) | ||
| 761 | (remove-hook 'write-file-functions 'whitespace-write-file-hook t) | ||
| 762 | (remove-hook 'kill-buffer-hook 'whitespace-buffer))) | ||
| 763 | |||
| 764 | ;;;###autoload | ||
| 765 | (defun whitespace-write-file-hook () | ||
| 766 | "Hook function to be called on the buffer when whitespace check is enabled. | ||
| 767 | This is meant to be added buffer-locally to `write-file-functions'." | ||
| 768 | (let ((werr nil)) | ||
| 769 | (if whitespace-auto-cleanup | ||
| 770 | (whitespace-cleanup-internal) | ||
| 771 | (setq werr (whitespace-buffer))) | ||
| 772 | (if (and whitespace-abort-on-error werr) | ||
| 773 | (error "Abort write due to whitespaces in %s" | ||
| 774 | buffer-file-name))) | ||
| 775 | nil) | ||
| 776 | |||
| 777 | (defun whitespace-unload-function () | ||
| 778 | "Unload the whitespace library." | ||
| 779 | (if (unintern "whitespace-unload-hook" obarray) | ||
| 780 | ;; if whitespace-unload-hook is defined, let's get rid of it | ||
| 781 | ;; and recursively call `unload-feature' | ||
| 782 | (progn (unload-feature 'whitespace) t) | ||
| 783 | ;; this only happens in the recursive call | ||
| 784 | (whitespace-global-mode -1) | ||
| 785 | (save-current-buffer | ||
| 786 | (dolist (buf (buffer-list)) | ||
| 787 | (set-buffer buf) | ||
| 788 | (remove-hook 'write-file-functions 'whitespace-write-file-hook t))) | ||
| 789 | ;; continue standard unloading | ||
| 790 | nil)) | ||
| 791 | |||
| 792 | (defun whitespace-unload-hook () | ||
| 793 | (remove-hook 'find-file-hook 'whitespace-buffer) | ||
| 794 | (remove-hook 'write-file-functions 'whitespace-write-file-hook t) | ||
| 795 | (remove-hook 'kill-buffer-hook 'whitespace-buffer)) | ||
| 796 | |||
| 797 | (add-hook 'whitespace-unload-hook 'whitespace-unload-hook) | ||
| 798 | |||
| 799 | (provide 'whitespace) | ||
| 800 | |||
| 801 | ;;; whitespace.el ends here | ||
diff --git a/lisp/password-cache.el b/lisp/password-cache.el index 5e5f3240bc3..86d802f283c 100644 --- a/lisp/password-cache.el +++ b/lisp/password-cache.el | |||
| @@ -31,7 +31,7 @@ | |||
| 31 | ;; ;; Minibuffer prompt for password. | 31 | ;; ;; Minibuffer prompt for password. |
| 32 | ;; => "foo" | 32 | ;; => "foo" |
| 33 | ;; | 33 | ;; |
| 34 | ;; (password-cache-add "test" "foo") | 34 | ;; (password-cache-add "test" (copy-sequence "foo")) |
| 35 | ;; => nil | 35 | ;; => nil |
| 36 | 36 | ||
| 37 | ;; (password-read "Password? " "test") | 37 | ;; (password-read "Password? " "test") |
diff --git a/lisp/printing.el b/lisp/printing.el index 181092ee999..b8879befae3 100644 --- a/lisp/printing.el +++ b/lisp/printing.el | |||
| @@ -5622,8 +5622,6 @@ COMMAND.exe, COMMAND.bat and COMMAND.com in this order." | |||
| 5622 | ;; header | 5622 | ;; header |
| 5623 | (let ((versions (concat "printing v" pr-version | 5623 | (let ((versions (concat "printing v" pr-version |
| 5624 | " ps-print v" ps-print-version))) | 5624 | " ps-print v" ps-print-version))) |
| 5625 | ;; to keep compatibility with Emacs 20 & 21: | ||
| 5626 | ;; DO NOT REPLACE `?\ ' BY `?\s' | ||
| 5627 | (widget-insert (make-string (- 79 (length versions)) ?\ ) versions)) | 5625 | (widget-insert (make-string (- 79 (length versions)) ?\ ) versions)) |
| 5628 | (pr-insert-italic "\nCurrent Directory : " 1) | 5626 | (pr-insert-italic "\nCurrent Directory : " 1) |
| 5629 | (pr-insert-italic default-directory) | 5627 | (pr-insert-italic default-directory) |
diff --git a/lisp/progmodes/autoconf.el b/lisp/progmodes/autoconf.el index 5d5811b47d1..d12bed7e27d 100644 --- a/lisp/progmodes/autoconf.el +++ b/lisp/progmodes/autoconf.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; autoconf.el --- mode for editing Autoconf configure.ac files | 1 | ;;; autoconf.el --- mode for editing Autoconf configure.ac files -*- lexical-binding: t; -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2000-2020 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2000-2020 Free Software Foundation, Inc. |
| 4 | 4 | ||
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index aa3f7d399e9..8c8296fd6da 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -405,7 +405,7 @@ comment at the start of cc-engine.el for more info." | |||
| 405 | (when (and (car c-macro-cache) | 405 | (when (and (car c-macro-cache) |
| 406 | (> (point) (car c-macro-cache)) ; in case we have a | 406 | (> (point) (car c-macro-cache)) ; in case we have a |
| 407 | ; zero-sized region. | 407 | ; zero-sized region. |
| 408 | (not (eq (char-before (1- (point))) ?\\))) | 408 | (not lim)) |
| 409 | (setcdr c-macro-cache (point)) | 409 | (setcdr c-macro-cache (point)) |
| 410 | (setq c-macro-cache-syntactic nil))))))) | 410 | (setq c-macro-cache-syntactic nil))))))) |
| 411 | 411 | ||
| @@ -1642,6 +1642,21 @@ comment at the start of cc-engine.el for more info." | |||
| 1642 | (forward-char 2) | 1642 | (forward-char 2) |
| 1643 | t)))) | 1643 | t)))) |
| 1644 | 1644 | ||
| 1645 | (defmacro c-forward-comment-minus-1 () | ||
| 1646 | "Call (forward-comment -1), taking care of escaped newlines. | ||
| 1647 | Return the result of `forward-comment' if it gets called, nil otherwise." | ||
| 1648 | `(if (not comment-end-can-be-escaped) | ||
| 1649 | (forward-comment -1) | ||
| 1650 | (when (and (< (skip-syntax-backward " >") 0) | ||
| 1651 | (eq (char-after) ?\n)) | ||
| 1652 | (forward-char)) | ||
| 1653 | (cond | ||
| 1654 | ((and (eq (char-before) ?\n) | ||
| 1655 | (eq (char-before (1- (point))) ?\\)) | ||
| 1656 | (backward-char) | ||
| 1657 | nil) | ||
| 1658 | (t (forward-comment -1))))) | ||
| 1659 | |||
| 1645 | (defun c-backward-single-comment () | 1660 | (defun c-backward-single-comment () |
| 1646 | "Move backward past whitespace and the closest preceding comment, if any. | 1661 | "Move backward past whitespace and the closest preceding comment, if any. |
| 1647 | Return t if a comment was found, nil otherwise. In either case, the | 1662 | Return t if a comment was found, nil otherwise. In either case, the |
| @@ -1675,12 +1690,12 @@ This function does not do any hidden buffer changes." | |||
| 1675 | ;; same line. | 1690 | ;; same line. |
| 1676 | (re-search-forward "\\=\\s *[\n\r]" start t) | 1691 | (re-search-forward "\\=\\s *[\n\r]" start t) |
| 1677 | 1692 | ||
| 1678 | (if (if (forward-comment -1) | 1693 | (if (if (c-forward-comment-minus-1) |
| 1679 | (if (eolp) | 1694 | (if (eolp) |
| 1680 | ;; If forward-comment above succeeded and we're at eol | 1695 | ;; If forward-comment above succeeded and we're at eol |
| 1681 | ;; then the newline we moved over above didn't end a | 1696 | ;; then the newline we moved over above didn't end a |
| 1682 | ;; line comment, so we give it another go. | 1697 | ;; line comment, so we give it another go. |
| 1683 | (forward-comment -1) | 1698 | (c-forward-comment-minus-1) |
| 1684 | t)) | 1699 | t)) |
| 1685 | 1700 | ||
| 1686 | ;; Emacs <= 20 and XEmacs move back over the closer of a | 1701 | ;; Emacs <= 20 and XEmacs move back over the closer of a |
| @@ -1709,7 +1724,7 @@ comment at the start of cc-engine.el for more info." | |||
| 1709 | 1724 | ||
| 1710 | (if (let (moved-comment) | 1725 | (if (let (moved-comment) |
| 1711 | (while | 1726 | (while |
| 1712 | (and (not (setq moved-comment (forward-comment -1))) | 1727 | (and (not (setq moved-comment (c-forward-comment-minus-1))) |
| 1713 | ;; Cope specifically with ^M^J here - | 1728 | ;; Cope specifically with ^M^J here - |
| 1714 | ;; forward-comment sometimes gets stuck after ^Ms, | 1729 | ;; forward-comment sometimes gets stuck after ^Ms, |
| 1715 | ;; sometimes after ^M^J. | 1730 | ;; sometimes after ^M^J. |
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index e3a924efb06..d822788bee2 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el | |||
| @@ -1431,7 +1431,7 @@ Note that the style variables are always made local to the buffer." | |||
| 1431 | 1431 | ||
| 1432 | ;; Move to end of logical line (as it will be after the change, or as it | 1432 | ;; Move to end of logical line (as it will be after the change, or as it |
| 1433 | ;; was before unescaping a NL.) | 1433 | ;; was before unescaping a NL.) |
| 1434 | (re-search-forward "\\(\\\\\\(.\\|\n\\)\\|[^\\\n\r]\\)*" nil t) | 1434 | (re-search-forward "\\(?:\\\\\\(?:.\\|\n\\)\\|[^\\\n\r]\\)*" nil t) |
| 1435 | ;; We're at an EOLL or point-max. | 1435 | ;; We're at an EOLL or point-max. |
| 1436 | (if (equal (c-get-char-property (point) 'syntax-table) '(15)) | 1436 | (if (equal (c-get-char-property (point) 'syntax-table) '(15)) |
| 1437 | (if (memq (char-after) '(?\n ?\r)) | 1437 | (if (memq (char-after) '(?\n ?\r)) |
| @@ -1539,7 +1539,7 @@ Note that the style variables are always made local to the buffer." | |||
| 1539 | (progn | 1539 | (progn |
| 1540 | (goto-char (min (1+ end) ; 1+, in case a NL has become escaped. | 1540 | (goto-char (min (1+ end) ; 1+, in case a NL has become escaped. |
| 1541 | (point-max))) | 1541 | (point-max))) |
| 1542 | (re-search-forward "\\(\\\\\\(.\\|\n\\)\\|[^\\\n\r]\\)*" | 1542 | (re-search-forward "\\(?:\\\\\\(?:.\\|\n\\)\\|[^\\\n\r]\\)*" |
| 1543 | nil t) | 1543 | nil t) |
| 1544 | (point)) | 1544 | (point)) |
| 1545 | c-new-END)) | 1545 | c-new-END)) |
| @@ -1620,8 +1620,8 @@ Note that the style variables are always made local to the buffer." | |||
| 1620 | (c-beginning-of-macro)))) | 1620 | (c-beginning-of-macro)))) |
| 1621 | (goto-char (1+ end)) ; After the \ | 1621 | (goto-char (1+ end)) ; After the \ |
| 1622 | ;; Search forward for EOLL | 1622 | ;; Search forward for EOLL |
| 1623 | (setq lim (re-search-forward "\\(\\\\\\(.\\|\n\\)\\|[^\\\n\r]\\)*" | 1623 | (setq lim (re-search-forward "\\(?:\\\\\\(?:.\\|\n\\)\\|[^\\\n\r]\\)*" |
| 1624 | nil t)) | 1624 | nil t)) |
| 1625 | (goto-char (1+ end)) | 1625 | (goto-char (1+ end)) |
| 1626 | (when (c-search-forward-char-property-with-value-on-char | 1626 | (when (c-search-forward-char-property-with-value-on-char |
| 1627 | 'syntax-table '(15) ?\" lim) | 1627 | 'syntax-table '(15) ?\" lim) |
diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el index 28e7667cda1..08cf802bcbe 100644 --- a/lisp/progmodes/ebnf2ps.el +++ b/lisp/progmodes/ebnf2ps.el | |||
| @@ -4975,8 +4975,6 @@ killed after process termination." | |||
| 4975 | (defun ebnf-eps-filename (str) | 4975 | (defun ebnf-eps-filename (str) |
| 4976 | (let* ((len (length str)) | 4976 | (let* ((len (length str)) |
| 4977 | (stri 0) | 4977 | (stri 0) |
| 4978 | ;; to keep compatibility with Emacs 20 & 21: | ||
| 4979 | ;; DO NOT REPLACE `?\ ' BY `?\s' | ||
| 4980 | (new (make-string len ?\ ))) | 4978 | (new (make-string len ?\ ))) |
| 4981 | (while (< stri len) | 4979 | (while (< stri len) |
| 4982 | (aset new stri (aref ebnf-map-name (aref str stri))) | 4980 | (aset new stri (aref ebnf-map-name (aref str stri))) |
| @@ -5993,8 +5991,6 @@ killed after process termination." | |||
| 5993 | (defun ebnf-trim-right (str) | 5991 | (defun ebnf-trim-right (str) |
| 5994 | (let* ((len (1- (length str))) | 5992 | (let* ((len (1- (length str))) |
| 5995 | (index len)) | 5993 | (index len)) |
| 5996 | ;; to keep compatibility with Emacs 20 & 21: | ||
| 5997 | ;; DO NOT REPLACE `?\ ' BY `?\s' | ||
| 5998 | (while (and (> index 0) (= (aref str index) ?\ )) | 5994 | (while (and (> index 0) (= (aref str index) ?\ )) |
| 5999 | (setq index (1- index))) | 5995 | (setq index (1- index))) |
| 6000 | (if (= index len) | 5996 | (if (= index len) |
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index b737134f90c..d37eb8c152d 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el | |||
| @@ -655,18 +655,16 @@ functions are annotated with \"<f>\" via the | |||
| 655 | ;; WORKAROUND: This is nominally a constant, but the text properties | 655 | ;; WORKAROUND: This is nominally a constant, but the text properties |
| 656 | ;; are not preserved thru dump if use defconst. See bug#21237. | 656 | ;; are not preserved thru dump if use defconst. See bug#21237. |
| 657 | (defvar elisp--xref-format | 657 | (defvar elisp--xref-format |
| 658 | (let ((str "(%s %s)")) | 658 | #("(%s %s)" |
| 659 | (put-text-property 1 3 'face 'font-lock-keyword-face str) | 659 | 1 3 (face font-lock-keyword-face) |
| 660 | (put-text-property 4 6 'face 'font-lock-function-name-face str) | 660 | 4 6 (face font-lock-function-name-face))) |
| 661 | str)) | ||
| 662 | 661 | ||
| 663 | ;; WORKAROUND: This is nominally a constant, but the text properties | 662 | ;; WORKAROUND: This is nominally a constant, but the text properties |
| 664 | ;; are not preserved thru dump if use defconst. See bug#21237. | 663 | ;; are not preserved thru dump if use defconst. See bug#21237. |
| 665 | (defvar elisp--xref-format-extra | 664 | (defvar elisp--xref-format-extra |
| 666 | (let ((str "(%s %s %s)")) | 665 | #("(%s %s %s)" |
| 667 | (put-text-property 1 3 'face 'font-lock-keyword-face str) | 666 | 1 3 (face font-lock-keyword-face) |
| 668 | (put-text-property 4 6 'face 'font-lock-function-name-face str) | 667 | 4 6 (face font-lock-function-name-face))) |
| 669 | str)) | ||
| 670 | 668 | ||
| 671 | (defvar find-feature-regexp);; in find-func.el | 669 | (defvar find-feature-regexp);; in find-func.el |
| 672 | 670 | ||
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 93a09d10967..4ca5c657650 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el | |||
| @@ -316,9 +316,10 @@ generated it." | |||
| 316 | &optional data | 316 | &optional data |
| 317 | overlay-properties) | 317 | overlay-properties) |
| 318 | "Make a Flymake diagnostic for BUFFER's region from BEG to END. | 318 | "Make a Flymake diagnostic for BUFFER's region from BEG to END. |
| 319 | TYPE is a key to symbol and TEXT is a description of the problem | 319 | TYPE is a diagnostic symbol and TEXT is string describing the |
| 320 | detected in this region. DATA is any object that the caller | 320 | problem detected in this region. DATA is any object that the |
| 321 | wishes to attach to the created diagnostic for later retrieval. | 321 | caller wishes to attach to the created diagnostic for later |
| 322 | retrieval. | ||
| 322 | 323 | ||
| 323 | OVERLAY-PROPERTIES is an alist of properties attached to the | 324 | OVERLAY-PROPERTIES is an alist of properties attached to the |
| 324 | created diagnostic, overriding the default properties and any | 325 | created diagnostic, overriding the default properties and any |
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index ca8b5fa84e0..198f040fb29 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; project.el --- Operations on the current project -*- lexical-binding: t; -*- | 1 | ;;; project.el --- Operations on the current project -*- lexical-binding: t; -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2015-2020 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2015-2020 Free Software Foundation, Inc. |
| 4 | ;; Version: 0.1 | 4 | ;; Version: 0.1.3 |
| 5 | ;; Package-Requires: ((emacs "26.3")) | 5 | ;; Package-Requires: ((emacs "26.3")) |
| 6 | 6 | ||
| 7 | ;; This is a GNU ELPA :core package. Avoid using functionality that | 7 | ;; This is a GNU ELPA :core package. Avoid using functionality that |
| @@ -273,9 +273,32 @@ backend implementation of `project-external-roots'.") | |||
| 273 | (pcase backend | 273 | (pcase backend |
| 274 | ('Git | 274 | ('Git |
| 275 | ;; Don't stop at submodule boundary. | 275 | ;; Don't stop at submodule boundary. |
| 276 | ;; Note: It's not necessarily clear-cut what should be | ||
| 277 | ;; considered a "submodule" in the sense that some users | ||
| 278 | ;; may setup things equivalent to "git-submodule"s using | ||
| 279 | ;; "git worktree" instead (for example). | ||
| 280 | ;; FIXME: Also it may be the case that some users would consider | ||
| 281 | ;; a submodule as its own project. So there's a good chance | ||
| 282 | ;; we will need to let the user tell us what is their intention. | ||
| 276 | (or (vc-file-getprop dir 'project-git-root) | 283 | (or (vc-file-getprop dir 'project-git-root) |
| 277 | (vc-file-setprop dir 'project-git-root | 284 | (let* ((root (vc-call-backend backend 'root dir)) |
| 278 | (vc-find-root dir ".git/")))) | 285 | (gitfile (expand-file-name ".git" root))) |
| 286 | (vc-file-setprop | ||
| 287 | dir 'project-git-root | ||
| 288 | (cond | ||
| 289 | ((file-directory-p gitfile) | ||
| 290 | root) | ||
| 291 | ((with-temp-buffer | ||
| 292 | (insert-file-contents gitfile) | ||
| 293 | (goto-char (point-min)) | ||
| 294 | ;; Kind of a hack to distinguish a submodule from | ||
| 295 | ;; other cases of .git files pointing elsewhere. | ||
| 296 | (looking-at "gitdir: [./]+/\\.git/modules/")) | ||
| 297 | (let* ((parent (file-name-directory | ||
| 298 | (directory-file-name root)))) | ||
| 299 | (vc-call-backend backend 'root parent))) | ||
| 300 | (t root))) | ||
| 301 | ))) | ||
| 279 | ('nil nil) | 302 | ('nil nil) |
| 280 | (_ (ignore-errors (vc-call-backend backend 'root dir)))))) | 303 | (_ (ignore-errors (vc-call-backend backend 'root dir)))))) |
| 281 | (and root (cons 'vc root)))) | 304 | (and root (cons 'vc root)))) |
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index b516ff0fe95..7d1ee705b80 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | ;; xref.el --- Cross-referencing commands -*-lexical-binding:t-*- | 1 | ;;; xref.el --- Cross-referencing commands -*-lexical-binding:t-*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2014-2020 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2014-2020 Free Software Foundation, Inc. |
| 4 | ;; Version: 1.0.0 | 4 | ;; Version: 1.0.1 |
| 5 | ;; Package-Requires: ((emacs "26.3") (project "0.1")) | 5 | ;; Package-Requires: ((emacs "26.3") (project "0.1.1")) |
| 6 | 6 | ||
| 7 | ;; This is a GNU ELPA :core package. Avoid functionality that is not | 7 | ;; This is a GNU ELPA :core package. Avoid functionality that is not |
| 8 | ;; compatible with the version of Emacs recorded above. | 8 | ;; compatible with the version of Emacs recorded above. |
| @@ -1322,11 +1322,11 @@ directory, used as the root of the ignore globs." | |||
| 1322 | (lambda (ignore) | 1322 | (lambda (ignore) |
| 1323 | (when (string-match-p "/\\'" ignore) | 1323 | (when (string-match-p "/\\'" ignore) |
| 1324 | (setq ignore (concat ignore "*"))) | 1324 | (setq ignore (concat ignore "*"))) |
| 1325 | (if (string-match "\\`\\./" ignore) | 1325 | (shell-quote-argument (if (string-match "\\`\\./" ignore) |
| 1326 | (setq ignore (replace-match dir t t ignore)) | 1326 | (replace-match dir t t ignore) |
| 1327 | (unless (string-prefix-p "*" ignore) | 1327 | (if (string-prefix-p "*" ignore) |
| 1328 | (setq ignore (concat "*/" ignore)))) | 1328 | ignore |
| 1329 | (shell-quote-argument ignore)) | 1329 | (concat "*/" ignore))))) |
| 1330 | ignores | 1330 | ignores |
| 1331 | " -o -path ") | 1331 | " -o -path ") |
| 1332 | " " | 1332 | " " |
diff --git a/lisp/simple.el b/lisp/simple.el index b5ba05426f5..111afa69d1a 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -4141,6 +4141,20 @@ its behavior with respect to remote file attribute caching. | |||
| 4141 | You should only ever change this variable with a let-binding; | 4141 | You should only ever change this variable with a let-binding; |
| 4142 | never with `setq'.") | 4142 | never with `setq'.") |
| 4143 | 4143 | ||
| 4144 | (defcustom process-file-return-signal-string nil | ||
| 4145 | "Whether to return a string describing the signal interrupting a process. | ||
| 4146 | When a process returns an exit code greater than 128, it is | ||
| 4147 | interpreted as a signal. `process-file' requires to return a | ||
| 4148 | string describing this signal. | ||
| 4149 | Since there are processes violating this rule, returning exit | ||
| 4150 | codes greater than 128 which are not bound to a signal, | ||
| 4151 | `process-file' returns the exit code as natural number also in | ||
| 4152 | this case. Setting this user option to non-nil forces | ||
| 4153 | `process-file' to interpret such exit codes as signals, and to | ||
| 4154 | return a corresponding string." | ||
| 4155 | :version "28.1" | ||
| 4156 | :type 'boolean) | ||
| 4157 | |||
| 4144 | (defun start-file-process (name buffer program &rest program-args) | 4158 | (defun start-file-process (name buffer program &rest program-args) |
| 4145 | "Start a program in a subprocess. Return the process object for it. | 4159 | "Start a program in a subprocess. Return the process object for it. |
| 4146 | 4160 | ||
| @@ -4889,7 +4903,7 @@ of this sample text; it defaults to 40." | |||
| 4889 | ;; Swap point-and-mark quickly so as to show the region that | 4903 | ;; Swap point-and-mark quickly so as to show the region that |
| 4890 | ;; was selected. Don't do it if the region is highlighted. | 4904 | ;; was selected. Don't do it if the region is highlighted. |
| 4891 | (unless (and (region-active-p) | 4905 | (unless (and (region-active-p) |
| 4892 | (face-background 'region)) | 4906 | (face-background 'region nil t)) |
| 4893 | ;; Swap point and mark. | 4907 | ;; Swap point and mark. |
| 4894 | (set-marker (mark-marker) (point) (current-buffer)) | 4908 | (set-marker (mark-marker) (point) (current-buffer)) |
| 4895 | (goto-char mark) | 4909 | (goto-char mark) |
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el index a3c1715b1e1..73978ffc4a7 100644 --- a/lisp/tar-mode.el +++ b/lisp/tar-mode.el | |||
| @@ -480,23 +480,9 @@ checksum before doing the check." | |||
| 480 | 480 | ||
| 481 | (defun tar-grind-file-mode (mode) | 481 | (defun tar-grind-file-mode (mode) |
| 482 | "Construct a `rw-r--r--' string indicating MODE. | 482 | "Construct a `rw-r--r--' string indicating MODE. |
| 483 | MODE should be an integer which is a file mode value." | 483 | MODE should be an integer which is a file mode value. |
| 484 | (string | 484 | For instance, if mode is #o700, then it produces `rwx------'." |
| 485 | (if (zerop (logand 256 mode)) ?- ?r) | 485 | (substring (file-modes-number-to-symbolic mode) 1)) |
| 486 | (if (zerop (logand 128 mode)) ?- ?w) | ||
| 487 | (if (zerop (logand 2048 mode)) | ||
| 488 | (if (zerop (logand 64 mode)) ?- ?x) | ||
| 489 | (if (zerop (logand 64 mode)) ?S ?s)) | ||
| 490 | (if (zerop (logand 32 mode)) ?- ?r) | ||
| 491 | (if (zerop (logand 16 mode)) ?- ?w) | ||
| 492 | (if (zerop (logand 1024 mode)) | ||
| 493 | (if (zerop (logand 8 mode)) ?- ?x) | ||
| 494 | (if (zerop (logand 8 mode)) ?S ?s)) | ||
| 495 | (if (zerop (logand 4 mode)) ?- ?r) | ||
| 496 | (if (zerop (logand 2 mode)) ?- ?w) | ||
| 497 | (if (zerop (logand 512 mode)) | ||
| 498 | (if (zerop (logand 1 mode)) ?- ?x) | ||
| 499 | (if (zerop (logand 1 mode)) ?T ?t)))) | ||
| 500 | 486 | ||
| 501 | (defun tar-header-block-summarize (tar-hblock &optional mod-p) | 487 | (defun tar-header-block-summarize (tar-hblock &optional mod-p) |
| 502 | "Return a line similar to the output of `tar -vtf'." | 488 | "Return a line similar to the output of `tar -vtf'." |
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index fa82227f36c..4712f314080 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el | |||
| @@ -3559,9 +3559,9 @@ LOCAL is t for interactive calls." | |||
| 3559 | (lambda () | 3559 | (lambda () |
| 3560 | (:documentation | 3560 | (:documentation |
| 3561 | (format "Insert a template for a @%s entry; see also `bibtex-entry'." | 3561 | (format "Insert a template for a @%s entry; see also `bibtex-entry'." |
| 3562 | entry) | 3562 | entry)) |
| 3563 | (interactive "*") | 3563 | (interactive "*") |
| 3564 | (bibtex-entry entry))))) | 3564 | (bibtex-entry entry)))) |
| 3565 | ;; Menu entries | 3565 | ;; Menu entries |
| 3566 | (define-key menu-map (vector fname) | 3566 | (define-key menu-map (vector fname) |
| 3567 | `(menu-item ,(or (nth 1 elt) (car elt)) ,fname)))) | 3567 | `(menu-item ,(or (nth 1 elt) (car elt)) ,fname)))) |
diff --git a/lisp/vc/ediff-vers.el b/lisp/vc/ediff-vers.el index a95606fad5e..4ee7ee5c1f5 100644 --- a/lisp/vc/ediff-vers.el +++ b/lisp/vc/ediff-vers.el | |||
| @@ -49,15 +49,10 @@ comparison or merge operations are being performed." | |||
| 49 | :group 'ediff-vers | 49 | :group 'ediff-vers |
| 50 | ) | 50 | ) |
| 51 | 51 | ||
| 52 | (defalias 'ediff-vc-revision-other-window | 52 | (define-obsolete-function-alias 'ediff-vc-revision-other-window |
| 53 | (if (fboundp 'vc-revision-other-window) | 53 | #'vc-revision-other-window "28.1") |
| 54 | 'vc-revision-other-window | 54 | (define-obsolete-function-alias 'ediff-vc-working-revision |
| 55 | 'vc-version-other-window)) | 55 | #'vc-working-revision "28.1") |
| 56 | |||
| 57 | (defalias 'ediff-vc-working-revision | ||
| 58 | (if (fboundp 'vc-working-revision) | ||
| 59 | 'vc-working-revision | ||
| 60 | 'vc-workfile-version)) | ||
| 61 | 56 | ||
| 62 | ;; VC.el support | 57 | ;; VC.el support |
| 63 | 58 | ||
| @@ -88,12 +83,12 @@ comparison or merge operations are being performed." | |||
| 88 | (setq rev1 (ediff-vc-latest-version (buffer-file-name)))) | 83 | (setq rev1 (ediff-vc-latest-version (buffer-file-name)))) |
| 89 | (save-window-excursion | 84 | (save-window-excursion |
| 90 | (save-excursion | 85 | (save-excursion |
| 91 | (ediff-vc-revision-other-window rev1) | 86 | (vc-revision-other-window rev1) |
| 92 | (setq rev1buf (current-buffer) | 87 | (setq rev1buf (current-buffer) |
| 93 | file1 (buffer-file-name))) | 88 | file1 (buffer-file-name))) |
| 94 | (save-excursion | 89 | (save-excursion |
| 95 | (or (string= rev2 "") ; use current buffer | 90 | (or (string= rev2 "") ; use current buffer |
| 96 | (ediff-vc-revision-other-window rev2)) | 91 | (vc-revision-other-window rev2)) |
| 97 | (setq rev2buf (current-buffer) | 92 | (setq rev2buf (current-buffer) |
| 98 | file2 (buffer-file-name))) | 93 | file2 (buffer-file-name))) |
| 99 | (push (lambda () | 94 | (push (lambda () |
| @@ -165,18 +160,18 @@ comparison or merge operations are being performed." | |||
| 165 | (let (buf1 buf2 ancestor-buf) | 160 | (let (buf1 buf2 ancestor-buf) |
| 166 | (save-window-excursion | 161 | (save-window-excursion |
| 167 | (save-excursion | 162 | (save-excursion |
| 168 | (ediff-vc-revision-other-window rev1) | 163 | (vc-revision-other-window rev1) |
| 169 | (setq buf1 (current-buffer))) | 164 | (setq buf1 (current-buffer))) |
| 170 | (save-excursion | 165 | (save-excursion |
| 171 | (or (string= rev2 "") | 166 | (or (string= rev2 "") |
| 172 | (ediff-vc-revision-other-window rev2)) | 167 | (vc-revision-other-window rev2)) |
| 173 | (setq buf2 (current-buffer))) | 168 | (setq buf2 (current-buffer))) |
| 174 | (if ancestor-rev | 169 | (if ancestor-rev |
| 175 | (save-excursion | 170 | (save-excursion |
| 176 | (if (string= ancestor-rev "") | 171 | (if (string= ancestor-rev "") |
| 177 | (setq ancestor-rev (ediff-vc-working-revision | 172 | (setq ancestor-rev (vc-working-revision |
| 178 | buffer-file-name))) | 173 | buffer-file-name))) |
| 179 | (ediff-vc-revision-other-window ancestor-rev) | 174 | (vc-revision-other-window ancestor-rev) |
| 180 | (setq ancestor-buf (current-buffer)))) | 175 | (setq ancestor-buf (current-buffer)))) |
| 181 | (push (let ((f1 (buffer-file-name buf1)) | 176 | (push (let ((f1 (buffer-file-name buf1)) |
| 182 | (f2 (unless (string= rev2 "") (buffer-file-name buf2))) | 177 | (f2 (unless (string= rev2 "") (buffer-file-name buf2))) |
diff --git a/src/alloc.c b/src/alloc.c index f2b80fac882..d6ba4d97905 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -4952,12 +4952,10 @@ typedef union | |||
| 4952 | #ifdef HAVE___BUILTIN_UNWIND_INIT | 4952 | #ifdef HAVE___BUILTIN_UNWIND_INIT |
| 4953 | # define SET_STACK_TOP_ADDRESS(p) \ | 4953 | # define SET_STACK_TOP_ADDRESS(p) \ |
| 4954 | stacktop_sentry sentry; \ | 4954 | stacktop_sentry sentry; \ |
| 4955 | __builtin_unwind_init (); \ | ||
| 4956 | *(p) = NEAR_STACK_TOP (&sentry) | 4955 | *(p) = NEAR_STACK_TOP (&sentry) |
| 4957 | #else | 4956 | #else |
| 4958 | # define SET_STACK_TOP_ADDRESS(p) \ | 4957 | # define SET_STACK_TOP_ADDRESS(p) \ |
| 4959 | stacktop_sentry sentry; \ | 4958 | stacktop_sentry sentry; \ |
| 4960 | __builtin_unwind_init (); \ | ||
| 4961 | test_setjmp (); \ | 4959 | test_setjmp (); \ |
| 4962 | sys_setjmp (sentry.j); \ | 4960 | sys_setjmp (sentry.j); \ |
| 4963 | *(p) = NEAR_STACK_TOP (&sentry + (stack_bottom < &sentry.c)) | 4961 | *(p) = NEAR_STACK_TOP (&sentry + (stack_bottom < &sentry.c)) |
| @@ -5033,7 +5031,7 @@ mark_stack (char const *bottom, char const *end) | |||
| 5033 | from FUNC. */ | 5031 | from FUNC. */ |
| 5034 | 5032 | ||
| 5035 | NO_INLINE void | 5033 | NO_INLINE void |
| 5036 | flush_stack_call_func (void (*func) (void *arg), void *arg) | 5034 | flush_stack_call_func1 (void (*func) (void *arg), void *arg) |
| 5037 | { | 5035 | { |
| 5038 | void *end; | 5036 | void *end; |
| 5039 | struct thread_state *self = current_thread; | 5037 | struct thread_state *self = current_thread; |
diff --git a/src/lisp.h b/src/lisp.h index 66a86ddadfa..893e278afe0 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3819,7 +3819,15 @@ extern void alloc_unexec_pre (void); | |||
| 3819 | extern void alloc_unexec_post (void); | 3819 | extern void alloc_unexec_post (void); |
| 3820 | extern void mark_maybe_objects (Lisp_Object const *, ptrdiff_t); | 3820 | extern void mark_maybe_objects (Lisp_Object const *, ptrdiff_t); |
| 3821 | extern void mark_stack (char const *, char const *); | 3821 | extern void mark_stack (char const *, char const *); |
| 3822 | extern void flush_stack_call_func (void (*func) (void *arg), void *arg); | 3822 | extern void flush_stack_call_func1 (void (*func) (void *arg), void *arg); |
| 3823 | |||
| 3824 | INLINE void | ||
| 3825 | flush_stack_call_func (void (*func) (void *arg), void *arg) | ||
| 3826 | { | ||
| 3827 | __builtin_unwind_init (); | ||
| 3828 | flush_stack_call_func1 (func, arg); | ||
| 3829 | } | ||
| 3830 | |||
| 3823 | extern void garbage_collect (void); | 3831 | extern void garbage_collect (void); |
| 3824 | extern void maybe_garbage_collect (void); | 3832 | extern void maybe_garbage_collect (void); |
| 3825 | extern const char *pending_malloc_warning; | 3833 | extern const char *pending_malloc_warning; |
diff --git a/src/xdisp.c b/src/xdisp.c index d65bb388699..cf15f579b58 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -5120,7 +5120,7 @@ handle_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, | |||
| 5120 | if (CONSP (spec) && EQ (XCAR (spec), Qdisable_eval)) | 5120 | if (CONSP (spec) && EQ (XCAR (spec), Qdisable_eval)) |
| 5121 | { | 5121 | { |
| 5122 | enable_eval = false; | 5122 | enable_eval = false; |
| 5123 | spec = XCAR (XCDR (spec)); | 5123 | spec = CONSP (XCDR (spec)) ? XCAR (XCDR (spec)) : Qnil; |
| 5124 | } | 5124 | } |
| 5125 | 5125 | ||
| 5126 | if (CONSP (spec) | 5126 | if (CONSP (spec) |
diff --git a/src/xfns.c b/src/xfns.c index 1f381e2a8b0..2ab5080d977 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -6738,9 +6738,11 @@ x_hide_tip (bool delete) | |||
| 6738 | } | 6738 | } |
| 6739 | } | 6739 | } |
| 6740 | 6740 | ||
| 6741 | /* Reset tip_last_frame, it will be reassigned when showing the | 6741 | /* When using GTK+ system tooltips (compare Bug#41200) reset |
| 6742 | next GTK+ system tooltip. */ | 6742 | tip_last_frame. It will be reassigned when showing the next |
| 6743 | tip_last_frame = Qnil; | 6743 | GTK+ system tooltip. */ |
| 6744 | if (x_gtk_use_system_tooltips) | ||
| 6745 | tip_last_frame = Qnil; | ||
| 6744 | 6746 | ||
| 6745 | /* Now look whether there's an Emacs tip around. */ | 6747 | /* Now look whether there's an Emacs tip around. */ |
| 6746 | if (FRAMEP (tip_frame)) | 6748 | if (FRAMEP (tip_frame)) |
diff --git a/test/lisp/arc-mode-tests.el b/test/lisp/arc-mode-tests.el index df658b98139..22ca7e2ec55 100644 --- a/test/lisp/arc-mode-tests.el +++ b/test/lisp/arc-mode-tests.el | |||
| @@ -28,7 +28,7 @@ | |||
| 28 | (let ((alist (list (cons 448 "-rwx------") | 28 | (let ((alist (list (cons 448 "-rwx------") |
| 29 | (cons 420 "-rw-r--r--") | 29 | (cons 420 "-rw-r--r--") |
| 30 | (cons 292 "-r--r--r--") | 30 | (cons 292 "-r--r--r--") |
| 31 | (cons 512 "----------") | 31 | (cons 512 "---------T") |
| 32 | (cons 1024 "------S---") ; Bug#28092 | 32 | (cons 1024 "------S---") ; Bug#28092 |
| 33 | (cons 2048 "---S------")))) | 33 | (cons 2048 "---S------")))) |
| 34 | (dolist (x alist) | 34 | (dolist (x alist) |
diff --git a/test/lisp/calc/calc-tests.el b/test/lisp/calc/calc-tests.el index 6db5426ff6d..c8cb97a8bca 100644 --- a/test/lisp/calc/calc-tests.el +++ b/test/lisp/calc/calc-tests.el | |||
| @@ -345,6 +345,58 @@ An existing calc stack is reused, otherwise a new one is created." | |||
| 345 | (should (Math-num-integerp '(float 1 0))) | 345 | (should (Math-num-integerp '(float 1 0))) |
| 346 | (should-not (Math-num-integerp nil))) | 346 | (should-not (Math-num-integerp nil))) |
| 347 | 347 | ||
| 348 | (ert-deftest calc-matrix-determinant () | ||
| 349 | (should (equal (calcFunc-det '(vec (vec 3))) | ||
| 350 | 3)) | ||
| 351 | (should (equal (calcFunc-det '(vec (vec 2 3) (vec 6 7))) | ||
| 352 | -4)) | ||
| 353 | (should (equal (calcFunc-det '(vec (vec 1 2 3) (vec 4 5 7) (vec 9 6 2))) | ||
| 354 | 15)) | ||
| 355 | (should (equal (calcFunc-det '(vec (vec 0 5 7 3) | ||
| 356 | (vec 0 0 2 0) | ||
| 357 | (vec 1 2 3 4) | ||
| 358 | (vec 0 0 0 3))) | ||
| 359 | 30)) | ||
| 360 | (should (equal (calcFunc-det '(vec (vec (var a var-a)))) | ||
| 361 | '(var a var-a))) | ||
| 362 | (should (equal (calcFunc-det '(vec (vec 2 (var a var-a)) | ||
| 363 | (vec 7 (var a var-a)))) | ||
| 364 | '(* -5 (var a var-a)))) | ||
| 365 | (should (equal (calcFunc-det '(vec (vec 1 0 0 0) | ||
| 366 | (vec 0 1 0 0) | ||
| 367 | (vec 0 0 0 1) | ||
| 368 | (vec 0 0 (var a var-a) 0))) | ||
| 369 | '(neg (var a var-a))))) | ||
| 370 | |||
| 371 | (ert-deftest calc-gcd () | ||
| 372 | (should (equal (calcFunc-gcd 3 4) 1)) | ||
| 373 | (should (equal (calcFunc-gcd 12 15) 3)) | ||
| 374 | (should (equal (calcFunc-gcd -12 15) 3)) | ||
| 375 | (should (equal (calcFunc-gcd 12 -15) 3)) | ||
| 376 | (should (equal (calcFunc-gcd -12 -15) 3)) | ||
| 377 | (should (equal (calcFunc-gcd 0 5) 5)) | ||
| 378 | (should (equal (calcFunc-gcd 5 0) 5)) | ||
| 379 | (should (equal (calcFunc-gcd 0 -5) 5)) | ||
| 380 | (should (equal (calcFunc-gcd -5 0) 5)) | ||
| 381 | (should (equal (calcFunc-gcd 0 0) 0)) | ||
| 382 | (should (equal (calcFunc-gcd 0 '(var x var-x)) | ||
| 383 | '(calcFunc-abs (var x var-x)))) | ||
| 384 | (should (equal (calcFunc-gcd '(var x var-x) 0) | ||
| 385 | '(calcFunc-abs (var x var-x))))) | ||
| 386 | |||
| 387 | (ert-deftest calc-sum-gcd () | ||
| 388 | ;; sum(gcd(0,n),n,-1,-1) | ||
| 389 | (should (equal (math-simplify '(calcFunc-sum (calcFunc-gcd 0 (var n var-n)) | ||
| 390 | (var n var-n) -1 -1)) | ||
| 391 | 1)) | ||
| 392 | ;; sum(sum(gcd(n,k),k,-1,1),n,-1,1) | ||
| 393 | (should (equal (math-simplify | ||
| 394 | '(calcFunc-sum | ||
| 395 | (calcFunc-sum (calcFunc-gcd (var n var-n) (var k var-k)) | ||
| 396 | (var k var-k) -1 1) | ||
| 397 | (var n var-n) -1 1)) | ||
| 398 | 8))) | ||
| 399 | |||
| 348 | (provide 'calc-tests) | 400 | (provide 'calc-tests) |
| 349 | ;;; calc-tests.el ends here | 401 | ;;; calc-tests.el ends here |
| 350 | 402 | ||
diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el b/test/lisp/emacs-lisp/cl-macs-tests.el index 983e79ac57c..24bbad0cc6b 100644 --- a/test/lisp/emacs-lisp/cl-macs-tests.el +++ b/test/lisp/emacs-lisp/cl-macs-tests.el | |||
| @@ -425,7 +425,9 @@ collection clause." | |||
| 425 | '(2 3 4 5 6)))) | 425 | '(2 3 4 5 6)))) |
| 426 | 426 | ||
| 427 | (ert-deftest cl-macs-loop-across-ref () | 427 | (ert-deftest cl-macs-loop-across-ref () |
| 428 | (should (equal (cl-loop with my-vec = ["one" "two" "three"] | 428 | (should (equal (cl-loop with my-vec = (vector (cl-copy-seq "one") |
| 429 | (cl-copy-seq "two") | ||
| 430 | (cl-copy-seq "three")) | ||
| 429 | for x across-ref my-vec | 431 | for x across-ref my-vec |
| 430 | do (setf (aref x 0) (upcase (aref x 0))) | 432 | do (setf (aref x 0) (upcase (aref x 0))) |
| 431 | finally return my-vec) | 433 | finally return my-vec) |
diff --git a/test/lisp/erc/erc-track-tests.el b/test/lisp/erc/erc-track-tests.el index 7e924c22347..457f08cb73c 100644 --- a/test/lisp/erc/erc-track-tests.el +++ b/test/lisp/erc/erc-track-tests.el | |||
| @@ -107,8 +107,8 @@ | |||
| 107 | 107 | ||
| 108 | (ert-deftest erc-track--erc-faces-in () | 108 | (ert-deftest erc-track--erc-faces-in () |
| 109 | "`erc-faces-in' should pick up both 'face and 'font-lock-face properties." | 109 | "`erc-faces-in' should pick up both 'face and 'font-lock-face properties." |
| 110 | (let ((str0 "is bold") | 110 | (let ((str0 (copy-sequence "is bold")) |
| 111 | (str1 "is bold")) | 111 | (str1 (copy-sequence "is bold"))) |
| 112 | ;; Turn on Font Lock mode: this initialize `char-property-alias-alist' | 112 | ;; Turn on Font Lock mode: this initialize `char-property-alias-alist' |
| 113 | ;; to '((face font-lock-face)). Note that `font-lock-mode' don't | 113 | ;; to '((face font-lock-face)). Note that `font-lock-mode' don't |
| 114 | ;; turn on the mode if the test is run on batch mode or if the | 114 | ;; turn on the mode if the test is run on batch mode or if the |
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index 05d9ceebf1d..4b902fd82ae 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el | |||
| @@ -1164,6 +1164,42 @@ works as expected if the default directory is quoted." | |||
| 1164 | (should-not (make-directory a/b t)) | 1164 | (should-not (make-directory a/b t)) |
| 1165 | (delete-directory dir 'recursive))) | 1165 | (delete-directory dir 'recursive))) |
| 1166 | 1166 | ||
| 1167 | (ert-deftest files-tests-file-modes-symbolic-to-number () | ||
| 1168 | (let ((alist (list (cons "a=rwx" #o777) | ||
| 1169 | (cons "o=t" #o1000) | ||
| 1170 | (cons "o=xt" #o1001) | ||
| 1171 | (cons "o=tx" #o1001) ; Order doesn't matter. | ||
| 1172 | (cons "u=rwx,g=rx,o=rx" #o755) | ||
| 1173 | (cons "u=rwx,g=,o=" #o700) | ||
| 1174 | (cons "u=rwx" #o700) ; Empty permissions can be ignored. | ||
| 1175 | (cons "u=rw,g=r,o=r" #o644) | ||
| 1176 | (cons "u=rw,g=r,o=t" #o1640) | ||
| 1177 | (cons "u=rw,g=r,o=xt" #o1641) | ||
| 1178 | (cons "u=rwxs,g=rs,o=xt" #o7741) | ||
| 1179 | (cons "u=rws,g=rs,o=t" #o7640) | ||
| 1180 | (cons "u=rws,g=rs,o=r" #o6644) | ||
| 1181 | (cons "a=r" #o444) | ||
| 1182 | (cons "u=S" nil) | ||
| 1183 | (cons "u=T" nil) | ||
| 1184 | (cons "u=Z" nil)))) | ||
| 1185 | (dolist (x alist) | ||
| 1186 | (if (cdr-safe x) | ||
| 1187 | (should (equal (cdr x) (file-modes-symbolic-to-number (car x)))) | ||
| 1188 | (should-error (file-modes-symbolic-to-number (car x))))))) | ||
| 1189 | |||
| 1190 | (ert-deftest files-tests-file-modes-number-to-symbolic () | ||
| 1191 | (let ((alist (list (cons #o755 "-rwxr-xr-x") | ||
| 1192 | (cons #o700 "-rwx------") | ||
| 1193 | (cons #o644 "-rw-r--r--") | ||
| 1194 | (cons #o1640 "-rw-r----T") | ||
| 1195 | (cons #o1641 "-rw-r----t") | ||
| 1196 | (cons #o7741 "-rwsr-S--t") | ||
| 1197 | (cons #o7640 "-rwSr-S--T") | ||
| 1198 | (cons #o6644 "-rwSr-Sr--") | ||
| 1199 | (cons #o444 "-r--r--r--")))) | ||
| 1200 | (dolist (x alist) | ||
| 1201 | (should (equal (cdr x) (file-modes-number-to-symbolic (car x))))))) | ||
| 1202 | |||
| 1167 | (ert-deftest files-tests-no-file-write-contents () | 1203 | (ert-deftest files-tests-no-file-write-contents () |
| 1168 | "Test that `write-contents-functions' permits saving a file. | 1204 | "Test that `write-contents-functions' permits saving a file. |
| 1169 | Usually `basic-save-buffer' will prompt for a file name if the | 1205 | Usually `basic-save-buffer' will prompt for a file name if the |
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index de85f83982c..1f56baad7ce 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -75,6 +75,7 @@ | |||
| 75 | ;; Needed for Emacs 26. | 75 | ;; Needed for Emacs 26. |
| 76 | (defvar async-shell-command-width) | 76 | (defvar async-shell-command-width) |
| 77 | ;; Needed for Emacs 27. | 77 | ;; Needed for Emacs 27. |
| 78 | (defvar process-file-return-signal-string) | ||
| 78 | (defvar shell-command-dont-erase-buffer) | 79 | (defvar shell-command-dont-erase-buffer) |
| 79 | 80 | ||
| 80 | ;; Beautify batch mode. | 81 | ;; Beautify batch mode. |
| @@ -4208,18 +4209,27 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4208 | (should (zerop (process-file "true"))) | 4209 | (should (zerop (process-file "true"))) |
| 4209 | (should-not (zerop (process-file "false"))) | 4210 | (should-not (zerop (process-file "false"))) |
| 4210 | (should-not (zerop (process-file "binary-does-not-exist"))) | 4211 | (should-not (zerop (process-file "binary-does-not-exist"))) |
| 4211 | (should | 4212 | ;; Return exit code. |
| 4212 | (= 42 | 4213 | (should (= 42 (process-file |
| 4214 | (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh") | ||
| 4215 | nil nil nil "-c" "exit 42"))) | ||
| 4216 | ;; Return exit code in case the process is interrupted, | ||
| 4217 | ;; and there's no indication for a signal describing string. | ||
| 4218 | (let (process-file-return-signal-string) | ||
| 4219 | (should | ||
| 4220 | (= (+ 128 2) | ||
| 4221 | (process-file | ||
| 4222 | (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh") | ||
| 4223 | nil nil nil "-c" "kill -2 $$")))) | ||
| 4224 | ;; Return string in case the process is interrupted and | ||
| 4225 | ;; there's an indication for a signal describing string. | ||
| 4226 | (let ((process-file-return-signal-string t)) | ||
| 4227 | (should | ||
| 4228 | (string-equal | ||
| 4229 | "Interrupt" | ||
| 4213 | (process-file | 4230 | (process-file |
| 4214 | (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh") | 4231 | (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh") |
| 4215 | nil nil nil "-c" "exit 42"))) | 4232 | nil nil nil "-c" "kill -2 $$")))) |
| 4216 | ;; Return string in case the process is interrupted. | ||
| 4217 | (should | ||
| 4218 | (string-equal | ||
| 4219 | "Signal 2" | ||
| 4220 | (process-file | ||
| 4221 | (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh") | ||
| 4222 | nil nil nil "-c" "kill -2 $$"))) | ||
| 4223 | 4233 | ||
| 4224 | (with-temp-buffer | 4234 | (with-temp-buffer |
| 4225 | (write-region "foo" nil tmp-name) | 4235 | (write-region "foo" nil tmp-name) |
diff --git a/test/lisp/password-cache-tests.el b/test/lisp/password-cache-tests.el index 01f4358fc59..55ebbfce7fe 100644 --- a/test/lisp/password-cache-tests.el +++ b/test/lisp/password-cache-tests.el | |||
| @@ -28,31 +28,31 @@ | |||
| 28 | 28 | ||
| 29 | (ert-deftest password-cache-tests-add-and-remove () | 29 | (ert-deftest password-cache-tests-add-and-remove () |
| 30 | (let ((password-data (copy-hash-table password-data))) | 30 | (let ((password-data (copy-hash-table password-data))) |
| 31 | (password-cache-add "foo" "bar") | 31 | (password-cache-add "foo" (copy-sequence "bar")) |
| 32 | (should (eq (password-in-cache-p "foo") t)) | 32 | (should (eq (password-in-cache-p "foo") t)) |
| 33 | (password-cache-remove "foo") | 33 | (password-cache-remove "foo") |
| 34 | (should (not (password-in-cache-p "foo"))))) | 34 | (should (not (password-in-cache-p "foo"))))) |
| 35 | 35 | ||
| 36 | (ert-deftest password-cache-tests-read-from-cache () | 36 | (ert-deftest password-cache-tests-read-from-cache () |
| 37 | (let ((password-data (copy-hash-table password-data))) | 37 | (let ((password-data (copy-hash-table password-data))) |
| 38 | (password-cache-add "foo" "bar") | 38 | (password-cache-add "foo" (copy-sequence "bar")) |
| 39 | (should (equal (password-read-from-cache "foo") "bar")) | 39 | (should (equal (password-read-from-cache "foo") "bar")) |
| 40 | (should (not (password-read-from-cache nil))))) | 40 | (should (not (password-read-from-cache nil))))) |
| 41 | 41 | ||
| 42 | (ert-deftest password-cache-tests-in-cache-p () | 42 | (ert-deftest password-cache-tests-in-cache-p () |
| 43 | (let ((password-data (copy-hash-table password-data))) | 43 | (let ((password-data (copy-hash-table password-data))) |
| 44 | (password-cache-add "foo" "bar") | 44 | (password-cache-add "foo" (copy-sequence "bar")) |
| 45 | (should (password-in-cache-p "foo")) | 45 | (should (password-in-cache-p "foo")) |
| 46 | (should (not (password-read-from-cache nil))))) | 46 | (should (not (password-read-from-cache nil))))) |
| 47 | 47 | ||
| 48 | (ert-deftest password-cache-tests-read () | 48 | (ert-deftest password-cache-tests-read () |
| 49 | (let ((password-data (copy-hash-table password-data))) | 49 | (let ((password-data (copy-hash-table password-data))) |
| 50 | (password-cache-add "foo" "bar") | 50 | (password-cache-add "foo" (copy-sequence "bar")) |
| 51 | (should (equal (password-read nil "foo") "bar")))) | 51 | (should (equal (password-read nil "foo") "bar")))) |
| 52 | 52 | ||
| 53 | (ert-deftest password-cache-tests-reset () | 53 | (ert-deftest password-cache-tests-reset () |
| 54 | (let ((password-data (copy-hash-table password-data))) | 54 | (let ((password-data (copy-hash-table password-data))) |
| 55 | (password-cache-add "foo" "bar") | 55 | (password-cache-add "foo" (copy-sequence "bar")) |
| 56 | (password-reset) | 56 | (password-reset) |
| 57 | (should (not (password-in-cache-p "foo"))))) | 57 | (should (not (password-in-cache-p "foo"))))) |
| 58 | 58 | ||
| @@ -60,14 +60,14 @@ | |||
| 60 | :tags '(:expensive-test) | 60 | :tags '(:expensive-test) |
| 61 | (let ((password-data (copy-hash-table password-data)) | 61 | (let ((password-data (copy-hash-table password-data)) |
| 62 | (password-cache-expiry 0.01)) | 62 | (password-cache-expiry 0.01)) |
| 63 | (password-cache-add "foo" "bar") | 63 | (password-cache-add "foo" (copy-sequence "bar")) |
| 64 | (sit-for 0.1) | 64 | (sit-for 0.1) |
| 65 | (should (not (password-in-cache-p "foo"))))) | 65 | (should (not (password-in-cache-p "foo"))))) |
| 66 | 66 | ||
| 67 | (ert-deftest password-cache-tests-no-password-cache () | 67 | (ert-deftest password-cache-tests-no-password-cache () |
| 68 | (let ((password-data (copy-hash-table password-data)) | 68 | (let ((password-data (copy-hash-table password-data)) |
| 69 | (password-cache nil)) | 69 | (password-cache nil)) |
| 70 | (password-cache-add "foo" "bar") | 70 | (password-cache-add "foo" (copy-sequence "bar")) |
| 71 | (should (not (password-in-cache-p "foo"))) | 71 | (should (not (password-in-cache-p "foo"))) |
| 72 | (should (not (password-read-from-cache "foo"))))) | 72 | (should (not (password-read-from-cache "foo"))))) |
| 73 | 73 | ||
diff --git a/test/lisp/progmodes/autoconf-tests.el b/test/lisp/progmodes/autoconf-tests.el new file mode 100644 index 00000000000..63cf2889ee2 --- /dev/null +++ b/test/lisp/progmodes/autoconf-tests.el | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | ;;; autoconf-tests.el --- Tests for autoconf.el -*- lexical-binding: t; -*- | ||
| 2 | |||
| 3 | ;; Copyright (C) 2020 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: Simen Heggestøyl <simenheg@gmail.com> | ||
| 6 | ;; Keywords: | ||
| 7 | |||
| 8 | ;; This file is part of GNU Emacs. | ||
| 9 | |||
| 10 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 11 | ;; it under the terms of the GNU General Public License as published by | ||
| 12 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 13 | ;; (at your option) any later version. | ||
| 14 | |||
| 15 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 18 | ;; GNU General Public License for more details. | ||
| 19 | |||
| 20 | ;; You should have received a copy of the GNU General Public License | ||
| 21 | ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | ||
| 22 | |||
| 23 | ;;; Commentary: | ||
| 24 | |||
| 25 | ;; | ||
| 26 | |||
| 27 | ;;; Code: | ||
| 28 | |||
| 29 | (require 'autoconf) | ||
| 30 | (require 'ert) | ||
| 31 | |||
| 32 | (ert-deftest autoconf-tests-current-defun-function-define () | ||
| 33 | (with-temp-buffer | ||
| 34 | (insert "AC_DEFINE(HAVE_RSVG, 1, [Define to 1 if using librsvg.])") | ||
| 35 | (goto-char (point-min)) | ||
| 36 | (should-not (autoconf-current-defun-function)) | ||
| 37 | (forward-char 10) | ||
| 38 | (should (equal (autoconf-current-defun-function) "HAVE_RSVG")))) | ||
| 39 | |||
| 40 | (ert-deftest autoconf-tests-current-defun-function-subst () | ||
| 41 | (with-temp-buffer | ||
| 42 | (insert "AC_SUBST(srcdir)") | ||
| 43 | (goto-char (point-min)) | ||
| 44 | (should-not (autoconf-current-defun-function)) | ||
| 45 | (forward-char 9) | ||
| 46 | (should (equal (autoconf-current-defun-function) "srcdir")))) | ||
| 47 | |||
| 48 | (ert-deftest autoconf-tests-autoconf-mode-comment-syntax () | ||
| 49 | (with-temp-buffer | ||
| 50 | (autoconf-mode) | ||
| 51 | (insert "dnl Autoconf script for GNU Emacs") | ||
| 52 | (should (nth 4 (syntax-ppss))))) | ||
| 53 | |||
| 54 | (provide 'autoconf-tests) | ||
| 55 | ;;; autoconf-tests.el ends here | ||
diff --git a/test/lisp/startup-tests.el b/test/lisp/startup-tests.el new file mode 100644 index 00000000000..314ffc93e4a --- /dev/null +++ b/test/lisp/startup-tests.el | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | ;;; startup-tests.el --- unit tests for startup.el -*- lexical-binding: t; -*- | ||
| 2 | |||
| 3 | ;; Copyright (C) 2020 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: Philipp Stephani <phst@google.com> | ||
| 6 | |||
| 7 | ;; This file is part of GNU Emacs. | ||
| 8 | |||
| 9 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 10 | ;; it under the terms of the GNU General Public License as published by | ||
| 11 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 12 | ;; (at your option) any later version. | ||
| 13 | |||
| 14 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 15 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | ;; GNU General Public License for more details. | ||
| 18 | |||
| 19 | ;; You should have received a copy of the GNU General Public License | ||
| 20 | ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | ||
| 21 | |||
| 22 | ;;; Commentary: | ||
| 23 | |||
| 24 | ;; Unit tests for startup.el. | ||
| 25 | |||
| 26 | ;;; Code: | ||
| 27 | |||
| 28 | (ert-deftest startup-tests/command-switch-alist () | ||
| 29 | (let* ((foo-args ()) (bar-args ()) | ||
| 30 | (command-switch-alist | ||
| 31 | (list (cons "--foo" | ||
| 32 | (lambda (arg) | ||
| 33 | (ert-info ("Processing argument --foo") | ||
| 34 | (push arg foo-args) | ||
| 35 | (should (equal command-line-args-left | ||
| 36 | '("value" "--bar=value"))) | ||
| 37 | (pop command-line-args-left)))) | ||
| 38 | (cons "--bar=value" | ||
| 39 | (lambda (arg) | ||
| 40 | (ert-info ("Processing argument --bar") | ||
| 41 | (push arg bar-args) | ||
| 42 | (should-not command-line-args-left))))))) | ||
| 43 | (command-line-1 '("--foo" "value" "--bar=value")) | ||
| 44 | (should (equal foo-args '("--foo"))) | ||
| 45 | (should (equal bar-args '("--bar=value"))))) | ||
| 46 | |||
| 47 | ;;; startup-tests.el ends here | ||
diff --git a/test/lisp/tar-mode-tests.el b/test/lisp/tar-mode-tests.el index bc41b863da7..f05389df60f 100644 --- a/test/lisp/tar-mode-tests.el +++ b/test/lisp/tar-mode-tests.el | |||
| @@ -29,7 +29,8 @@ | |||
| 29 | (cons 420 "rw-r--r--") | 29 | (cons 420 "rw-r--r--") |
| 30 | (cons 292 "r--r--r--") | 30 | (cons 292 "r--r--r--") |
| 31 | (cons 512 "--------T") | 31 | (cons 512 "--------T") |
| 32 | (cons 1024 "-----S---")))) | 32 | (cons 1024 "-----S---") |
| 33 | (cons 2048 "--S------")))) | ||
| 33 | (dolist (x alist) | 34 | (dolist (x alist) |
| 34 | (should (equal (cdr x) (tar-grind-file-mode (car x))))))) | 35 | (should (equal (cdr x) (tar-grind-file-mode (car x))))))) |
| 35 | 36 | ||
diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el index c6ceae4a00e..b65543a64b5 100644 --- a/test/src/fns-tests.el +++ b/test/src/fns-tests.el | |||
| @@ -49,21 +49,21 @@ | |||
| 49 | (should-error (nreverse)) | 49 | (should-error (nreverse)) |
| 50 | (should-error (nreverse 1)) | 50 | (should-error (nreverse 1)) |
| 51 | (should-error (nreverse (make-char-table 'foo))) | 51 | (should-error (nreverse (make-char-table 'foo))) |
| 52 | (should (equal (nreverse "xyzzy") "yzzyx")) | 52 | (should (equal (nreverse (copy-sequence "xyzzy")) "yzzyx")) |
| 53 | (let ((A [])) | 53 | (let ((A (vector))) |
| 54 | (nreverse A) | 54 | (nreverse A) |
| 55 | (should (equal A []))) | 55 | (should (equal A []))) |
| 56 | (let ((A [0])) | 56 | (let ((A (vector 0))) |
| 57 | (nreverse A) | 57 | (nreverse A) |
| 58 | (should (equal A [0]))) | 58 | (should (equal A [0]))) |
| 59 | (let ((A [1 2 3 4])) | 59 | (let ((A (vector 1 2 3 4))) |
| 60 | (nreverse A) | 60 | (nreverse A) |
| 61 | (should (equal A [4 3 2 1]))) | 61 | (should (equal A [4 3 2 1]))) |
| 62 | (let ((A [1 2 3 4])) | 62 | (let ((A (vector 1 2 3 4))) |
| 63 | (nreverse A) | 63 | (nreverse A) |
| 64 | (nreverse A) | 64 | (nreverse A) |
| 65 | (should (equal A [1 2 3 4]))) | 65 | (should (equal A [1 2 3 4]))) |
| 66 | (let* ((A [1 2 3 4]) | 66 | (let* ((A (vector 1 2 3 4)) |
| 67 | (B (nreverse (nreverse A)))) | 67 | (B (nreverse (nreverse A)))) |
| 68 | (should (equal A B)))) | 68 | (should (equal A B)))) |
| 69 | 69 | ||
| @@ -146,13 +146,13 @@ | |||
| 146 | ;; Invalid UTF-8 sequences shall be indicated. How to create such strings? | 146 | ;; Invalid UTF-8 sequences shall be indicated. How to create such strings? |
| 147 | 147 | ||
| 148 | (ert-deftest fns-tests-sort () | 148 | (ert-deftest fns-tests-sort () |
| 149 | (should (equal (sort '(9 5 2 -1 5 3 8 7 4) (lambda (x y) (< x y))) | 149 | (should (equal (sort (list 9 5 2 -1 5 3 8 7 4) (lambda (x y) (< x y))) |
| 150 | '(-1 2 3 4 5 5 7 8 9))) | 150 | '(-1 2 3 4 5 5 7 8 9))) |
| 151 | (should (equal (sort '(9 5 2 -1 5 3 8 7 4) (lambda (x y) (> x y))) | 151 | (should (equal (sort (list 9 5 2 -1 5 3 8 7 4) (lambda (x y) (> x y))) |
| 152 | '(9 8 7 5 5 4 3 2 -1))) | 152 | '(9 8 7 5 5 4 3 2 -1))) |
| 153 | (should (equal (sort '[9 5 2 -1 5 3 8 7 4] (lambda (x y) (< x y))) | 153 | (should (equal (sort (vector 9 5 2 -1 5 3 8 7 4) (lambda (x y) (< x y))) |
| 154 | [-1 2 3 4 5 5 7 8 9])) | 154 | [-1 2 3 4 5 5 7 8 9])) |
| 155 | (should (equal (sort '[9 5 2 -1 5 3 8 7 4] (lambda (x y) (> x y))) | 155 | (should (equal (sort (vector 9 5 2 -1 5 3 8 7 4) (lambda (x y) (> x y))) |
| 156 | [9 8 7 5 5 4 3 2 -1])) | 156 | [9 8 7 5 5 4 3 2 -1])) |
| 157 | (should (equal | 157 | (should (equal |
| 158 | (sort | 158 | (sort |
| @@ -172,7 +172,7 @@ | |||
| 172 | ;; Punctuation and whitespace characters are relevant for POSIX. | 172 | ;; Punctuation and whitespace characters are relevant for POSIX. |
| 173 | (should | 173 | (should |
| 174 | (equal | 174 | (equal |
| 175 | (sort '("11" "12" "1 1" "1 2" "1.1" "1.2") | 175 | (sort (list "11" "12" "1 1" "1 2" "1.1" "1.2") |
| 176 | (lambda (a b) (string-collate-lessp a b "POSIX"))) | 176 | (lambda (a b) (string-collate-lessp a b "POSIX"))) |
| 177 | '("1 1" "1 2" "1.1" "1.2" "11" "12"))) | 177 | '("1 1" "1 2" "1.1" "1.2" "11" "12"))) |
| 178 | ;; Punctuation and whitespace characters are not taken into account | 178 | ;; Punctuation and whitespace characters are not taken into account |
| @@ -180,7 +180,7 @@ | |||
| 180 | (when (eq system-type 'windows-nt) | 180 | (when (eq system-type 'windows-nt) |
| 181 | (should | 181 | (should |
| 182 | (equal | 182 | (equal |
| 183 | (sort '("11" "12" "1 1" "1 2" "1.1" "1.2") | 183 | (sort (list "11" "12" "1 1" "1 2" "1.1" "1.2") |
| 184 | (lambda (a b) | 184 | (lambda (a b) |
| 185 | (let ((w32-collate-ignore-punctuation t)) | 185 | (let ((w32-collate-ignore-punctuation t)) |
| 186 | (string-collate-lessp | 186 | (string-collate-lessp |
| @@ -190,7 +190,7 @@ | |||
| 190 | ;; Diacritics are different letters for POSIX, they sort lexicographical. | 190 | ;; Diacritics are different letters for POSIX, they sort lexicographical. |
| 191 | (should | 191 | (should |
| 192 | (equal | 192 | (equal |
| 193 | (sort '("Ævar" "Agustín" "Adrian" "Eli") | 193 | (sort (list "Ævar" "Agustín" "Adrian" "Eli") |
| 194 | (lambda (a b) (string-collate-lessp a b "POSIX"))) | 194 | (lambda (a b) (string-collate-lessp a b "POSIX"))) |
| 195 | '("Adrian" "Agustín" "Eli" "Ævar"))) | 195 | '("Adrian" "Agustín" "Eli" "Ævar"))) |
| 196 | ;; Diacritics are sorted between similar letters for other locales, | 196 | ;; Diacritics are sorted between similar letters for other locales, |
| @@ -198,7 +198,7 @@ | |||
| 198 | (when (eq system-type 'windows-nt) | 198 | (when (eq system-type 'windows-nt) |
| 199 | (should | 199 | (should |
| 200 | (equal | 200 | (equal |
| 201 | (sort '("Ævar" "Agustín" "Adrian" "Eli") | 201 | (sort (list "Ævar" "Agustín" "Adrian" "Eli") |
| 202 | (lambda (a b) | 202 | (lambda (a b) |
| 203 | (let ((w32-collate-ignore-punctuation t)) | 203 | (let ((w32-collate-ignore-punctuation t)) |
| 204 | (string-collate-lessp | 204 | (string-collate-lessp |
| @@ -212,7 +212,7 @@ | |||
| 212 | (should (not (string-version-lessp "foo20000.png" "foo12.png"))) | 212 | (should (not (string-version-lessp "foo20000.png" "foo12.png"))) |
| 213 | (should (string-version-lessp "foo.png" "foo2.png")) | 213 | (should (string-version-lessp "foo.png" "foo2.png")) |
| 214 | (should (not (string-version-lessp "foo2.png" "foo.png"))) | 214 | (should (not (string-version-lessp "foo2.png" "foo.png"))) |
| 215 | (should (equal (sort '("foo12.png" "foo2.png" "foo1.png") | 215 | (should (equal (sort (list "foo12.png" "foo2.png" "foo1.png") |
| 216 | 'string-version-lessp) | 216 | 'string-version-lessp) |
| 217 | '("foo1.png" "foo2.png" "foo12.png"))) | 217 | '("foo1.png" "foo2.png" "foo12.png"))) |
| 218 | (should (string-version-lessp "foo2" "foo1234")) | 218 | (should (string-version-lessp "foo2" "foo1234")) |
| @@ -432,9 +432,9 @@ | |||
| 432 | (should-error (mapcan)) | 432 | (should-error (mapcan)) |
| 433 | (should-error (mapcan #'identity)) | 433 | (should-error (mapcan #'identity)) |
| 434 | (should-error (mapcan #'identity (make-char-table 'foo))) | 434 | (should-error (mapcan #'identity (make-char-table 'foo))) |
| 435 | (should (equal (mapcan #'list '(1 2 3)) '(1 2 3))) | 435 | (should (equal (mapcan #'list (list 1 2 3)) '(1 2 3))) |
| 436 | ;; `mapcan' is destructive | 436 | ;; `mapcan' is destructive |
| 437 | (let ((data '((foo) (bar)))) | 437 | (let ((data (list (list 'foo) (list 'bar)))) |
| 438 | (should (equal (mapcan #'identity data) '(foo bar))) | 438 | (should (equal (mapcan #'identity data) '(foo bar))) |
| 439 | (should (equal data '((foo bar) (bar)))))) | 439 | (should (equal data '((foo bar) (bar)))))) |
| 440 | 440 | ||