diff options
| author | Glenn Morris | 2018-03-22 07:50:37 -0700 |
|---|---|---|
| committer | Glenn Morris | 2018-03-22 07:50:37 -0700 |
| commit | 0afb436eeb9b87dbd13b012e3b13d51fc6745f0d (patch) | |
| tree | 683cf853c6bc6065a5f5a3d9ae81feda1882da95 | |
| parent | 081c39beb0340f5d6084dc90796ba726a52c928e (diff) | |
| parent | 8ac621bb5594786c66cc724864e6037c8c650774 (diff) | |
| download | emacs-0afb436eeb9b87dbd13b012e3b13d51fc6745f0d.tar.gz emacs-0afb436eeb9b87dbd13b012e3b13d51fc6745f0d.zip | |
Merge from origin/emacs-26
8ac621b (origin/emacs-26) Document DEFUN attributes
16d0cc7 * etc/NEWS: Add an entry for auth-source-pass.
cc1702f Fix the MSDOS build
daa9e85 Improve warning and error messages
7612dd1 Adjust eieio persistence tests for expected failure
f0cf4dc Let eieio-persistent-read read what object-write has written
40ad1ff Handle possible classtype values in eieio-persistent-read
4ec935d Add new tests for eieio persistence
47917d8 * lisp/gnus/gnus-cloud.el (gnus-cloud-synced-files): Fix doc ...
e32f352 * lisp/ibuf-ext.el (ibuffer-never-search-content-mode): Fix t...
5268f30 * doc/lispref/windows.texi (Selecting Windows): Fix a typo.
143b485 * doc/lispref/internals.texi (Writing Emacs Primitives): Fix ...
4ab4551 Firm up documentation of generalized variables
a5bf099 Improve documentation of Auto-Revert mode
ed05eaa Improvements in dired.texi
Conflicts:
etc/NEWS
| -rw-r--r-- | doc/emacs/dired.texi | 48 | ||||
| -rw-r--r-- | doc/emacs/files.texi | 3 | ||||
| -rw-r--r-- | doc/lispref/internals.texi | 41 | ||||
| -rw-r--r-- | doc/lispref/variables.texi | 34 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 2 | ||||
| -rw-r--r-- | etc/NEWS.26 | 4 | ||||
| -rw-r--r-- | lisp/emacs-lisp/eieio-base.el | 47 | ||||
| -rw-r--r-- | lisp/gnus/gnus-cloud.el | 12 | ||||
| -rw-r--r-- | lisp/ibuf-ext.el | 2 | ||||
| -rw-r--r-- | msdos/sed2v2.inp | 1 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el | 121 |
11 files changed, 249 insertions, 66 deletions
diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index cbf4194d397..fbb3030c2a4 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi | |||
| @@ -12,7 +12,8 @@ | |||
| 12 | Dired makes an Emacs buffer containing a listing of a directory, and | 12 | Dired makes an Emacs buffer containing a listing of a directory, and |
| 13 | optionally some of its subdirectories as well. You can use the normal | 13 | optionally some of its subdirectories as well. You can use the normal |
| 14 | Emacs commands to move around in this buffer, and special Dired | 14 | Emacs commands to move around in this buffer, and special Dired |
| 15 | commands to operate on the listed files. | 15 | commands to operate on the listed files. Dired works with both local |
| 16 | and remote directories. | ||
| 16 | 17 | ||
| 17 | The Dired buffer is normally read-only, and inserting text in it is | 18 | The Dired buffer is normally read-only, and inserting text in it is |
| 18 | not allowed (however, the Wdired mode allows that, @pxref{Wdired}). | 19 | not allowed (however, the Wdired mode allows that, @pxref{Wdired}). |
| @@ -109,8 +110,9 @@ default) means to perform the check; any other non-@code{nil} value | |||
| 109 | means to use the @samp{--dired} option; and @code{nil} means not to | 110 | means to use the @samp{--dired} option; and @code{nil} means not to |
| 110 | use the @samp{--dired} option. | 111 | use the @samp{--dired} option. |
| 111 | 112 | ||
| 112 | On MS-Windows and MS-DOS systems, Emacs emulates @command{ls}. | 113 | On MS-Windows and MS-DOS systems, and also on some remote systems, |
| 113 | @xref{ls in Lisp}, for options and peculiarities of this emulation. | 114 | Emacs emulates @command{ls}. @xref{ls in Lisp}, for options and |
| 115 | peculiarities of this emulation. | ||
| 114 | 116 | ||
| 115 | @findex dired-other-window | 117 | @findex dired-other-window |
| 116 | @kindex C-x 4 d | 118 | @kindex C-x 4 d |
| @@ -131,10 +133,13 @@ deletes its window if the window was created just for that buffer. | |||
| 131 | 133 | ||
| 132 | @kindex C-n @r{(Dired)} | 134 | @kindex C-n @r{(Dired)} |
| 133 | @kindex C-p @r{(Dired)} | 135 | @kindex C-p @r{(Dired)} |
| 136 | @findex dired-next-line | ||
| 137 | @findex dired-previous-line | ||
| 134 | All the usual Emacs cursor motion commands are available in Dired | 138 | All the usual Emacs cursor motion commands are available in Dired |
| 135 | buffers. The keys @kbd{C-n} and @kbd{C-p} are redefined to put the | 139 | buffers. The keys @kbd{C-n} and @kbd{C-p} are redefined to run |
| 136 | cursor at the beginning of the file name on the line, rather than at | 140 | @code{dired-next-line} and @code{dired-previous-line}, respectively, |
| 137 | the beginning of the line. | 141 | and they put the cursor at the beginning of the file name on the line, |
| 142 | rather than at the beginning of the line. | ||
| 138 | 143 | ||
| 139 | @kindex SPC @r{(Dired)} | 144 | @kindex SPC @r{(Dired)} |
| 140 | For extra convenience, @key{SPC} and @kbd{n} in Dired are equivalent | 145 | For extra convenience, @key{SPC} and @kbd{n} in Dired are equivalent |
| @@ -235,10 +240,11 @@ the buffer, and no files actually deleted. | |||
| 235 | You can delete empty directories just like other files, but normally | 240 | You can delete empty directories just like other files, but normally |
| 236 | Dired cannot delete directories that are nonempty. If the variable | 241 | Dired cannot delete directories that are nonempty. If the variable |
| 237 | @code{dired-recursive-deletes} is non-@code{nil}, then Dired can | 242 | @code{dired-recursive-deletes} is non-@code{nil}, then Dired can |
| 238 | delete nonempty directories including all their contents. That can | 243 | delete nonempty directories including all their contents. That can be |
| 239 | be somewhat risky. | 244 | somewhat risky. If the value of the variable is @code{always}, Dired |
| 240 | Even if you have set @code{dired-recursive-deletes} to @code{nil}, | 245 | will delete nonempty directories recursively, which is even more |
| 241 | you might want sometimes to delete recursively directories | 246 | risky. Even if you have set @code{dired-recursive-deletes} to |
| 247 | @code{nil}, you might want sometimes to delete recursively directories | ||
| 242 | without being asked for confirmation for all of them. This is handy | 248 | without being asked for confirmation for all of them. This is handy |
| 243 | when you have marked many directories for deletion and you are very | 249 | when you have marked many directories for deletion and you are very |
| 244 | sure that all of them can safely be deleted. For every nonempty | 250 | sure that all of them can safely be deleted. For every nonempty |
| @@ -252,6 +258,9 @@ questions. | |||
| 252 | directories into the operating system's Trash, instead of deleting | 258 | directories into the operating system's Trash, instead of deleting |
| 253 | them outright. @xref{Misc File Ops}. | 259 | them outright. @xref{Misc File Ops}. |
| 254 | 260 | ||
| 261 | An alternative way of deleting files is to mark them with @kbd{m} | ||
| 262 | and delete with @kbd{D}, see @ref{Operating on Files}. | ||
| 263 | |||
| 255 | @node Flagging Many Files | 264 | @node Flagging Many Files |
| 256 | @section Flagging Many Files at Once | 265 | @section Flagging Many Files at Once |
| 257 | @cindex flagging many files for deletion (in Dired) | 266 | @cindex flagging many files for deletion (in Dired) |
| @@ -420,7 +429,9 @@ Mark the current file with @samp{*} (@code{dired-mark}). If the | |||
| 420 | region is active, mark all files in the region instead; otherwise, if | 429 | region is active, mark all files in the region instead; otherwise, if |
| 421 | a numeric argument @var{n} is supplied, mark the next @var{n} files | 430 | a numeric argument @var{n} is supplied, mark the next @var{n} files |
| 422 | instead, starting with the current file (if @var{n} is negative, mark | 431 | instead, starting with the current file (if @var{n} is negative, mark |
| 423 | the previous @minus{}@var{n} files). | 432 | the previous @minus{}@var{n} files). If invoked on a subdirectory |
| 433 | header line (@pxref{Subdirectories in Dired}), this command marks all | ||
| 434 | the files in that subdirectory. | ||
| 424 | 435 | ||
| 425 | @item * * | 436 | @item * * |
| 426 | @kindex * * @r{(Dired)} | 437 | @kindex * * @r{(Dired)} |
| @@ -578,10 +589,10 @@ command will look in the buffer without revisiting the file, so the results | |||
| 578 | might be inconsistent with the file on disk if its contents have changed | 589 | might be inconsistent with the file on disk if its contents have changed |
| 579 | since it was last visited. If you don't want this, you may wish to | 590 | since it was last visited. If you don't want this, you may wish to |
| 580 | revert the files you have visited in your buffers, or to turn on | 591 | revert the files you have visited in your buffers, or to turn on |
| 581 | @code{auto-revert} mode in those buffers, before invoking this | 592 | Auto-Revert mode in those buffers, before invoking this command. |
| 582 | command. @xref{Reverting}. If you prefer that this command should always | 593 | @xref{Reverting}. If you prefer that this command should always |
| 583 | revisit the file, without you having to revert the file or enable | 594 | revisit the file, without you having to revert the file or enable |
| 584 | @code{auto-revert} mode, you might want to set | 595 | Auto-Revert mode, you might want to set |
| 585 | @code{dired-always-read-filesystem} to non-@code{nil}. | 596 | @code{dired-always-read-filesystem} to non-@code{nil}. |
| 586 | 597 | ||
| 587 | @item C-/ | 598 | @item C-/ |
| @@ -766,7 +777,9 @@ suitable guess made using the variables @code{lpr-command} and | |||
| 766 | @item Z | 777 | @item Z |
| 767 | Compress the specified files (@code{dired-do-compress}). If the file | 778 | Compress the specified files (@code{dired-do-compress}). If the file |
| 768 | appears to be a compressed file already, uncompress it instead. Each | 779 | appears to be a compressed file already, uncompress it instead. Each |
| 769 | marked file is compressed into its own archive. | 780 | marked file is compressed into its own archive. This uses the |
| 781 | @command{gzip} program if it is available, otherwise it uses | ||
| 782 | @command{compress}. | ||
| 770 | 783 | ||
| 771 | @findex dired-do-compress-to | 784 | @findex dired-do-compress-to |
| 772 | @kindex c @r{(Dired)} | 785 | @kindex c @r{(Dired)} |
| @@ -1048,6 +1061,9 @@ minibuffer is the file at the mark (i.e., the ordinary Emacs mark, | |||
| 1048 | not a Dired mark; @pxref{Setting Mark}). Otherwise, if the file at | 1061 | not a Dired mark; @pxref{Setting Mark}). Otherwise, if the file at |
| 1049 | point has a backup file (@pxref{Backup}), that is the default. | 1062 | point has a backup file (@pxref{Backup}), that is the default. |
| 1050 | 1063 | ||
| 1064 | You could also compare files using @code{ediff-files}, see | ||
| 1065 | @ref{Major Entry Points,,, ediff, Ediff User's Manual}. | ||
| 1066 | |||
| 1051 | @node Subdirectories in Dired | 1067 | @node Subdirectories in Dired |
| 1052 | @section Subdirectories in Dired | 1068 | @section Subdirectories in Dired |
| 1053 | @cindex subdirectories in Dired | 1069 | @cindex subdirectories in Dired |
| @@ -1476,7 +1492,7 @@ space. | |||
| 1476 | each marked file. With just @kbd{C-u} as the prefix argument, it uses | 1492 | each marked file. With just @kbd{C-u} as the prefix argument, it uses |
| 1477 | file names relative to the Dired buffer's default directory. (This | 1493 | file names relative to the Dired buffer's default directory. (This |
| 1478 | can still contain slashes if in a subdirectory.) As a special case, | 1494 | can still contain slashes if in a subdirectory.) As a special case, |
| 1479 | if point is on a directory headerline, @kbd{w} gives you the absolute | 1495 | if point is on a directory header line, @kbd{w} gives you the absolute |
| 1480 | name of that directory. Any prefix argument or marked files are | 1496 | name of that directory. Any prefix argument or marked files are |
| 1481 | ignored in this case. | 1497 | ignored in this case. |
| 1482 | 1498 | ||
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 77bdb6ee448..4e9e7ac3f0a 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi | |||
| @@ -991,6 +991,9 @@ Auto-Revert Tail mode works also for remote files. | |||
| 991 | When a buffer is auto-reverted, a message is generated. This can be | 991 | When a buffer is auto-reverted, a message is generated. This can be |
| 992 | suppressed by setting @code{auto-revert-verbose} to @code{nil}. | 992 | suppressed by setting @code{auto-revert-verbose} to @code{nil}. |
| 993 | 993 | ||
| 994 | In Dired buffers (@pxref{Dired}), Auto-Revert mode refreshes the | ||
| 995 | buffer when a file is created or deleted in the buffer's directory. | ||
| 996 | |||
| 994 | @xref{VC Undo}, for commands to revert to earlier versions of files | 997 | @xref{VC Undo}, for commands to revert to earlier versions of files |
| 995 | under version control. @xref{VC Mode Line}, for Auto Revert | 998 | under version control. @xref{VC Mode Line}, for Auto Revert |
| 996 | peculiarities when visiting files under version control. | 999 | peculiarities when visiting files under version control. |
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index 76be7bf0ac6..7ae5b5c693d 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi | |||
| @@ -735,7 +735,7 @@ Lisp form. For example: | |||
| 735 | 735 | ||
| 736 | @example | 736 | @example |
| 737 | @group | 737 | @group |
| 738 | DEFUN ("foo", Ffoo, Sfoo, 0, UNEVALLED, | 738 | DEFUN ("foo", Ffoo, Sfoo, 0, UNEVALLED, 0 |
| 739 | "(list (read-char-by-name \"Insert character: \")\ | 739 | "(list (read-char-by-name \"Insert character: \")\ |
| 740 | (prefix-numeric-value current-prefix-arg)\ | 740 | (prefix-numeric-value current-prefix-arg)\ |
| 741 | t))", | 741 | t))", |
| @@ -768,6 +768,43 @@ the actual documentation. The others have placeholders beginning with | |||
| 768 | All the usual rules for documentation strings in Lisp code | 768 | All the usual rules for documentation strings in Lisp code |
| 769 | (@pxref{Documentation Tips}) apply to C code documentation strings | 769 | (@pxref{Documentation Tips}) apply to C code documentation strings |
| 770 | too. | 770 | too. |
| 771 | |||
| 772 | The documentation string can be followed by a list of C function | ||
| 773 | attributes for the C function that implements the primitive, like | ||
| 774 | this: | ||
| 775 | |||
| 776 | @example | ||
| 777 | @group | ||
| 778 | DEFUN ("bar", Fbar, Sbar, 0, UNEVALLED, 0 | ||
| 779 | doc: /* @dots{} /* | ||
| 780 | attributes: @var{attr1} @var{attr2} @dots{}) | ||
| 781 | @end group | ||
| 782 | @end example | ||
| 783 | |||
| 784 | @noindent | ||
| 785 | You can specify more than a single attribute, one after the other. | ||
| 786 | Currently, only the following attributes are recognized: | ||
| 787 | |||
| 788 | @table @code | ||
| 789 | @item noreturn | ||
| 790 | Declares the C function as one that never returns. This corresponds | ||
| 791 | to the C11 keyword @code{_Noreturn} and to @w{@code{__attribute__ | ||
| 792 | ((__noreturn__))}} attribute of GCC (@pxref{Function Attributes,,, | ||
| 793 | gcc, Using the GNU Compiler Collection}). | ||
| 794 | |||
| 795 | @item const | ||
| 796 | Declares that the function does not examine any values except its | ||
| 797 | arguments, and has no effects except the return value. This | ||
| 798 | corresponds to @w{@code{__attribute__ ((__const__))}} attribute of | ||
| 799 | GCC. | ||
| 800 | |||
| 801 | @item noinline | ||
| 802 | This corresponds to @w{@code{__attribute__ ((__noinline__))}} | ||
| 803 | attribute of GCC, which prevents the function from being considered | ||
| 804 | for inlining. This might be needed, e.g., to countermand effects of | ||
| 805 | link-time optimizations on stack-based variables. | ||
| 806 | @end table | ||
| 807 | |||
| 771 | @end table | 808 | @end table |
| 772 | 809 | ||
| 773 | After the call to the @code{DEFUN} macro, you must write the | 810 | After the call to the @code{DEFUN} macro, you must write the |
| @@ -850,7 +887,7 @@ defined with @code{DEFVAR_BOOL} are automatically added to the list | |||
| 850 | @code{byte-boolean-vars} used by the byte compiler. | 887 | @code{byte-boolean-vars} used by the byte compiler. |
| 851 | 888 | ||
| 852 | @cindex defining customization variables in C | 889 | @cindex defining customization variables in C |
| 853 | If you want to make a Lisp variables that is defined in C behave | 890 | If you want to make a Lisp variable that is defined in C behave |
| 854 | like one declared with @code{defcustom}, add an appropriate entry to | 891 | like one declared with @code{defcustom}, add an appropriate entry to |
| 855 | @file{cus-start.el}. | 892 | @file{cus-start.el}. |
| 856 | 893 | ||
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index aecee6f3056..b80bc88a585 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi | |||
| @@ -2317,11 +2317,12 @@ Attempting to assign them any other value will result in an error: | |||
| 2317 | 2317 | ||
| 2318 | @cindex generalized variable | 2318 | @cindex generalized variable |
| 2319 | @cindex place form | 2319 | @cindex place form |
| 2320 | A @dfn{generalized variable} or @dfn{place form} is one of the many places | 2320 | A @dfn{generalized variable} or @dfn{place form} is one of the many |
| 2321 | in Lisp memory where values can be stored. The simplest place form is | 2321 | places in Lisp memory where values can be stored using the @code{setf} |
| 2322 | a regular Lisp variable. But the @sc{car}s and @sc{cdr}s of lists, elements | 2322 | macro (@pxref{Setting Generalized Variables}). The simplest place |
| 2323 | of arrays, properties of symbols, and many other locations are also | 2323 | form is a regular Lisp variable. But the @sc{car}s and @sc{cdr}s of |
| 2324 | places where Lisp values are stored. | 2324 | lists, elements of arrays, properties of symbols, and many other |
| 2325 | locations are also places where Lisp values get stored. | ||
| 2325 | 2326 | ||
| 2326 | Generalized variables are analogous to lvalues in the C | 2327 | Generalized variables are analogous to lvalues in the C |
| 2327 | language, where @samp{x = a[i]} gets an element from an array | 2328 | language, where @samp{x = a[i]} gets an element from an array |
| @@ -2342,8 +2343,8 @@ variables. The @code{setf} form is like @code{setq}, except that it | |||
| 2342 | accepts arbitrary place forms on the left side rather than just | 2343 | accepts arbitrary place forms on the left side rather than just |
| 2343 | symbols. For example, @code{(setf (car a) b)} sets the car of | 2344 | symbols. For example, @code{(setf (car a) b)} sets the car of |
| 2344 | @code{a} to @code{b}, doing the same operation as @code{(setcar a b)}, | 2345 | @code{a} to @code{b}, doing the same operation as @code{(setcar a b)}, |
| 2345 | but without having to remember two separate functions for setting and | 2346 | but without you having to use two separate functions for setting and |
| 2346 | accessing every type of place. | 2347 | accessing this type of place. |
| 2347 | 2348 | ||
| 2348 | @defmac setf [place form]@dots{} | 2349 | @defmac setf [place form]@dots{} |
| 2349 | This macro evaluates @var{form} and stores it in @var{place}, which | 2350 | This macro evaluates @var{form} and stores it in @var{place}, which |
| @@ -2353,18 +2354,19 @@ just as with @code{setq}. @code{setf} returns the value of the last | |||
| 2353 | @var{form}. | 2354 | @var{form}. |
| 2354 | @end defmac | 2355 | @end defmac |
| 2355 | 2356 | ||
| 2356 | The following Lisp forms will work as generalized variables, and | 2357 | The following Lisp forms are the forms in Emacs that will work as |
| 2357 | so may appear in the @var{place} argument of @code{setf}: | 2358 | generalized variables, and so may appear in the @var{place} argument |
| 2359 | of @code{setf}: | ||
| 2358 | 2360 | ||
| 2359 | @itemize | 2361 | @itemize |
| 2360 | @item | 2362 | @item |
| 2361 | A symbol naming a variable. In other words, @code{(setf x y)} is | 2363 | A symbol. In other words, @code{(setf x y)} is exactly equivalent to |
| 2362 | exactly equivalent to @code{(setq x y)}, and @code{setq} itself is | 2364 | @code{(setq x y)}, and @code{setq} itself is strictly speaking |
| 2363 | strictly speaking redundant given that @code{setf} exists. Many | 2365 | redundant given that @code{setf} exists. Most programmers will |
| 2364 | programmers continue to prefer @code{setq} for setting simple | 2366 | continue to prefer @code{setq} for setting simple variables, though, |
| 2365 | variables, though, purely for stylistic or historical reasons. | 2367 | for stylistic and historical reasons. The macro @code{(setf x y)} |
| 2366 | The macro @code{(setf x y)} actually expands to @code{(setq x y)}, | 2368 | actually expands to @code{(setq x y)}, so there is no performance |
| 2367 | so there is no performance penalty for using it in compiled code. | 2369 | penalty for using it in compiled code. |
| 2368 | 2370 | ||
| 2369 | @item | 2371 | @item |
| 2370 | A call to any of the following standard Lisp functions: | 2372 | A call to any of the following standard Lisp functions: |
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 75651b99fde..8d8877bdfda 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -1772,7 +1772,7 @@ raise the frame or make sure input focus is directed to that frame. | |||
| 1772 | @end defun | 1772 | @end defun |
| 1773 | 1773 | ||
| 1774 | @cindex select window hook | 1774 | @cindex select window hook |
| 1775 | @cindex running a hook when a windows gets selected | 1775 | @cindex running a hook when a window gets selected |
| 1776 | For historical reasons, Emacs does not run a separate hook whenever a | 1776 | For historical reasons, Emacs does not run a separate hook whenever a |
| 1777 | window gets selected. Applications and internal routines often | 1777 | window gets selected. Applications and internal routines often |
| 1778 | temporarily select a window to perform a few actions on it. They do | 1778 | temporarily select a window to perform a few actions on it. They do |
diff --git a/etc/NEWS.26 b/etc/NEWS.26 index eded00e6554..f5da6870b77 100644 --- a/etc/NEWS.26 +++ b/etc/NEWS.26 | |||
| @@ -1274,6 +1274,10 @@ specialized for editing freedesktop.org desktop entries. | |||
| 1274 | ** New major mode 'less-css-mode' (a minor variant of 'css-mode') for | 1274 | ** New major mode 'less-css-mode' (a minor variant of 'css-mode') for |
| 1275 | editing Less files. | 1275 | editing Less files. |
| 1276 | 1276 | ||
| 1277 | +++ | ||
| 1278 | ** New package 'auth-source-pass' integrates 'auth-source' with the | ||
| 1279 | password manager password-store (http://passwordstore.org). | ||
| 1280 | |||
| 1277 | 1281 | ||
| 1278 | * Incompatible Lisp Changes in Emacs 26.1 | 1282 | * Incompatible Lisp Changes in Emacs 26.1 |
| 1279 | 1283 | ||
diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el index c0ad7ac4605..9f9f870a757 100644 --- a/lisp/emacs-lisp/eieio-base.el +++ b/lisp/emacs-lisp/eieio-base.el | |||
| @@ -219,7 +219,7 @@ for CLASS. Optional ALLOW-SUBCLASS says that it is ok for | |||
| 219 | `eieio-persistent-read' to load in subclasses of class instead of | 219 | `eieio-persistent-read' to load in subclasses of class instead of |
| 220 | being pedantic." | 220 | being pedantic." |
| 221 | (unless class | 221 | (unless class |
| 222 | (message "Unsafe call to `eieio-persistent-read'.")) | 222 | (warn "`eieio-persistent-read' called without specifying a class")) |
| 223 | (when class (cl-check-type class class)) | 223 | (when class (cl-check-type class class)) |
| 224 | (let ((ret nil) | 224 | (let ((ret nil) |
| 225 | (buffstr nil)) | 225 | (buffstr nil)) |
| @@ -234,13 +234,16 @@ being pedantic." | |||
| 234 | ;; the current buffer will work. | 234 | ;; the current buffer will work. |
| 235 | (setq ret (read buffstr)) | 235 | (setq ret (read buffstr)) |
| 236 | (when (not (child-of-class-p (car ret) 'eieio-persistent)) | 236 | (when (not (child-of-class-p (car ret) 'eieio-persistent)) |
| 237 | (error "Corrupt object on disk: Unknown saved object")) | 237 | (error |
| 238 | "Invalid object: %s is not a subclass of `eieio-persistent'" | ||
| 239 | (car ret))) | ||
| 238 | (when (and class | 240 | (when (and class |
| 239 | (not (or (eq (car ret) class ) ; same class | 241 | (not (or (eq (car ret) class) ; same class |
| 240 | (and allow-subclass | 242 | (and allow-subclass ; subclass |
| 241 | (child-of-class-p (car ret) class)) ; subclasses | 243 | (child-of-class-p (car ret) class))))) |
| 242 | ))) | 244 | (error |
| 243 | (error "Corrupt object on disk: Invalid saved class")) | 245 | "Invalid object: %s is not an object of class %s nor a subclass" |
| 246 | (car ret) class)) | ||
| 244 | (setq ret (eieio-persistent-convert-list-to-object ret)) | 247 | (setq ret (eieio-persistent-convert-list-to-object ret)) |
| 245 | (oset ret file filename)) | 248 | (oset ret file filename)) |
| 246 | (kill-buffer " *tmp eieio read*")) | 249 | (kill-buffer " *tmp eieio read*")) |
| @@ -332,7 +335,8 @@ Second, any text properties will be stripped from strings." | |||
| 332 | ;; We have a predicate, but it doesn't satisfy the predicate? | 335 | ;; We have a predicate, but it doesn't satisfy the predicate? |
| 333 | (dolist (PV (cdr proposed-value)) | 336 | (dolist (PV (cdr proposed-value)) |
| 334 | (unless (child-of-class-p (car PV) (car classtype)) | 337 | (unless (child-of-class-p (car PV) (car classtype)) |
| 335 | (error "Corrupt object on disk"))) | 338 | (error "Invalid object: slot member %s does not match class %s" |
| 339 | (car PV) (car classtype)))) | ||
| 336 | 340 | ||
| 337 | ;; We have a list of objects here. Lets load them | 341 | ;; We have a list of objects here. Lets load them |
| 338 | ;; in. | 342 | ;; in. |
| @@ -349,7 +353,7 @@ Second, any text properties will be stripped from strings." | |||
| 349 | (seq-some | 353 | (seq-some |
| 350 | (lambda (elt) | 354 | (lambda (elt) |
| 351 | (child-of-class-p (car proposed-value) elt)) | 355 | (child-of-class-p (car proposed-value) elt)) |
| 352 | classtype)) | 356 | (if (listp classtype) classtype (list classtype)))) |
| 353 | (eieio-persistent-convert-list-to-object | 357 | (eieio-persistent-convert-list-to-object |
| 354 | proposed-value)) | 358 | proposed-value)) |
| 355 | (t | 359 | (t |
| @@ -360,19 +364,28 @@ Second, any text properties will be stripped from strings." | |||
| 360 | ((hash-table-p proposed-value) | 364 | ((hash-table-p proposed-value) |
| 361 | (maphash | 365 | (maphash |
| 362 | (lambda (key value) | 366 | (lambda (key value) |
| 363 | (when (class-p (car-safe value)) | 367 | (cond ((class-p (car-safe value)) |
| 364 | (setf (gethash key proposed-value) | 368 | (setf (gethash key proposed-value) |
| 365 | (eieio-persistent-convert-list-to-object | 369 | (eieio-persistent-convert-list-to-object |
| 366 | value)))) | 370 | value))) |
| 371 | ((and (consp value) | ||
| 372 | (eq (car value) 'quote)) | ||
| 373 | (setf (gethash key proposed-value) | ||
| 374 | (cadr value))))) | ||
| 367 | proposed-value) | 375 | proposed-value) |
| 368 | proposed-value) | 376 | proposed-value) |
| 369 | 377 | ||
| 370 | ((vectorp proposed-value) | 378 | ((vectorp proposed-value) |
| 371 | (dotimes (i (length proposed-value)) | 379 | (dotimes (i (length proposed-value)) |
| 372 | (when (class-p (car-safe (aref proposed-value i))) | 380 | (let ((val (aref proposed-value i))) |
| 373 | (aset proposed-value i | 381 | (cond ((class-p (car-safe val)) |
| 374 | (eieio-persistent-convert-list-to-object | 382 | (aset proposed-value i |
| 375 | (aref proposed-value i))))) | 383 | (eieio-persistent-convert-list-to-object |
| 384 | (aref proposed-value i)))) | ||
| 385 | ((and (consp val) | ||
| 386 | (eq (car val) 'quote)) | ||
| 387 | (aset proposed-value i | ||
| 388 | (cadr val)))))) | ||
| 376 | proposed-value) | 389 | proposed-value) |
| 377 | 390 | ||
| 378 | ((stringp proposed-value) | 391 | ((stringp proposed-value) |
diff --git a/lisp/gnus/gnus-cloud.el b/lisp/gnus/gnus-cloud.el index ac5ff7d47cf..86cd399ff1c 100644 --- a/lisp/gnus/gnus-cloud.el +++ b/lisp/gnus/gnus-cloud.el | |||
| @@ -48,10 +48,14 @@ | |||
| 48 | "~/.authinfo.gpg" | 48 | "~/.authinfo.gpg" |
| 49 | "~/.gnus.el" | 49 | "~/.gnus.el" |
| 50 | (:directory "~/News" :match ".*.SCORE\\'")) | 50 | (:directory "~/News" :match ".*.SCORE\\'")) |
| 51 | "List of file regexps that should be kept up-to-date via the cloud." | 51 | "List of files that should be kept up-to-date via the cloud. |
| 52 | Each element may be either a string or a property list. | ||
| 53 | The latter should have a :directory element whose value is a string, | ||
| 54 | and a :match element whose value is a regular expression to match | ||
| 55 | against the basename of files in said directory." | ||
| 52 | :group 'gnus-cloud | 56 | :group 'gnus-cloud |
| 53 | ;; FIXME this type does not match the default. Nor does the documentation. | 57 | :type '(repeat (choice (string :tag "File") |
| 54 | :type '(repeat regexp)) | 58 | (plist :tag "Property list")))) |
| 55 | 59 | ||
| 56 | (defcustom gnus-cloud-storage-method (if (featurep 'epg) 'epg 'base64-gzip) | 60 | (defcustom gnus-cloud-storage-method (if (featurep 'epg) 'epg 'base64-gzip) |
| 57 | "Storage method for cloud data, defaults to EPG if that's available." | 61 | "Storage method for cloud data, defaults to EPG if that's available." |
| @@ -290,6 +294,8 @@ Use old data if FORCE-OLDER is not nil." | |||
| 290 | (dolist (elem gnus-cloud-synced-files) | 294 | (dolist (elem gnus-cloud-synced-files) |
| 291 | (cond | 295 | (cond |
| 292 | ((stringp elem) | 296 | ((stringp elem) |
| 297 | ;; This seems fragile. String comparison, with no | ||
| 298 | ;; expand-file-name to resolve ~, etc. | ||
| 293 | (when (equal elem file-name) | 299 | (when (equal elem file-name) |
| 294 | (setq matched t))) | 300 | (setq matched t))) |
| 295 | ((consp elem) | 301 | ((consp elem) |
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index 91d9acb3a3c..a1adb1df35a 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el | |||
| @@ -114,7 +114,7 @@ Buffers whose name matches a regexp in this list, are not searched." | |||
| 114 | "A list of major modes ignored by `ibuffer-mark-by-content-regexp'. | 114 | "A list of major modes ignored by `ibuffer-mark-by-content-regexp'. |
| 115 | Buffers whose major mode is in this list, are not searched." | 115 | Buffers whose major mode is in this list, are not searched." |
| 116 | :version "26.1" | 116 | :version "26.1" |
| 117 | :type '(repeat regexp) | 117 | :type '(repeat (symbol :tag "Major mode")) |
| 118 | :require 'ibuf-ext | 118 | :require 'ibuf-ext |
| 119 | :group 'ibuffer) | 119 | :group 'ibuffer) |
| 120 | 120 | ||
diff --git a/msdos/sed2v2.inp b/msdos/sed2v2.inp index c57fa4b0416..d6544052d29 100644 --- a/msdos/sed2v2.inp +++ b/msdos/sed2v2.inp | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | /^#undef DOS_NT *$/s/^.*$/#define DOS_NT/ | 32 | /^#undef DOS_NT *$/s/^.*$/#define DOS_NT/ |
| 33 | /^#undef FLOAT_CHECK_DOMAIN *$/s/^.*$/#define FLOAT_CHECK_DOMAIN/ | 33 | /^#undef FLOAT_CHECK_DOMAIN *$/s/^.*$/#define FLOAT_CHECK_DOMAIN/ |
| 34 | /^#undef HAVE_ALLOCA *$/s/^.*$/#define HAVE_ALLOCA 1/ | 34 | /^#undef HAVE_ALLOCA *$/s/^.*$/#define HAVE_ALLOCA 1/ |
| 35 | /^#undef HAVE_SBRK *$/s/^.*$/#define HAVE_SBRK 1/ | ||
| 35 | /^#undef HAVE_SETITIMER *$/s/^.*$/#define HAVE_SETITIMER 1/ | 36 | /^#undef HAVE_SETITIMER *$/s/^.*$/#define HAVE_SETITIMER 1/ |
| 36 | /^#undef HAVE_STRUCT_UTIMBUF *$/s/^.*$/#define HAVE_STRUCT_UTIMBUF 1/ | 37 | /^#undef HAVE_STRUCT_UTIMBUF *$/s/^.*$/#define HAVE_STRUCT_UTIMBUF 1/ |
| 37 | /^#undef LOCALTIME_CACHE *$/s/^.*$/#define LOCALTIME_CACHE 1/ | 38 | /^#undef LOCALTIME_CACHE *$/s/^.*$/#define LOCALTIME_CACHE 1/ |
diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el b/test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el index b485972078d..f5c25e64912 100644 --- a/test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el +++ b/test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; eieio-persist.el --- Tests for eieio-persistent class | 1 | ;;; eieio-test-persist.el --- Tests for eieio-persistent class |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2011-2018 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2011-2018 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -40,6 +40,17 @@ This is usually a symbol that starts with `:'." | |||
| 40 | (car tuple) | 40 | (car tuple) |
| 41 | nil))) | 41 | nil))) |
| 42 | 42 | ||
| 43 | (defun hash-equal (hash1 hash2) | ||
| 44 | "Compare two hash tables to see whether they are equal." | ||
| 45 | (and (= (hash-table-count hash1) | ||
| 46 | (hash-table-count hash2)) | ||
| 47 | (catch 'flag | ||
| 48 | (maphash (lambda (x y) | ||
| 49 | (or (equal (gethash x hash2) y) | ||
| 50 | (throw 'flag nil))) | ||
| 51 | hash1) | ||
| 52 | (throw 'flag t)))) | ||
| 53 | |||
| 43 | (defun persist-test-save-and-compare (original) | 54 | (defun persist-test-save-and-compare (original) |
| 44 | "Compare the object ORIGINAL against the one read fromdisk." | 55 | "Compare the object ORIGINAL against the one read fromdisk." |
| 45 | 56 | ||
| @@ -49,8 +60,8 @@ This is usually a symbol that starts with `:'." | |||
| 49 | (class (eieio-object-class original)) | 60 | (class (eieio-object-class original)) |
| 50 | (fromdisk (eieio-persistent-read file class)) | 61 | (fromdisk (eieio-persistent-read file class)) |
| 51 | (cv (cl--find-class class)) | 62 | (cv (cl--find-class class)) |
| 52 | (slots (eieio--class-slots cv)) | 63 | (slots (eieio--class-slots cv))) |
| 53 | ) | 64 | |
| 54 | (unless (object-of-class-p fromdisk class) | 65 | (unless (object-of-class-p fromdisk class) |
| 55 | (error "Persistent class %S != original class %S" | 66 | (error "Persistent class %S != original class %S" |
| 56 | (eieio-object-class fromdisk) | 67 | (eieio-object-class fromdisk) |
| @@ -62,18 +73,24 @@ This is usually a symbol that starts with `:'." | |||
| 62 | (origvalue (eieio-oref original oneslot)) | 73 | (origvalue (eieio-oref original oneslot)) |
| 63 | (fromdiskvalue (eieio-oref fromdisk oneslot)) | 74 | (fromdiskvalue (eieio-oref fromdisk oneslot)) |
| 64 | (initarg-p (eieio--attribute-to-initarg | 75 | (initarg-p (eieio--attribute-to-initarg |
| 65 | (cl--find-class class) oneslot)) | 76 | (cl--find-class class) oneslot))) |
| 66 | ) | ||
| 67 | 77 | ||
| 68 | (if initarg-p | 78 | (if initarg-p |
| 69 | (unless (equal origvalue fromdiskvalue) | 79 | (unless |
| 80 | (cond ((and (hash-table-p origvalue) (hash-table-p fromdiskvalue)) | ||
| 81 | (hash-equal origvalue fromdiskvalue)) | ||
| 82 | (t (equal origvalue fromdiskvalue))) | ||
| 70 | (error "Slot %S Original Val %S != Persistent Val %S" | 83 | (error "Slot %S Original Val %S != Persistent Val %S" |
| 71 | oneslot origvalue fromdiskvalue)) | 84 | oneslot origvalue fromdiskvalue)) |
| 72 | ;; Else !initarg-p | 85 | ;; Else !initarg-p |
| 73 | (unless (equal (cl--slot-descriptor-initform slot) fromdiskvalue) | 86 | (let ((origval (cl--slot-descriptor-initform slot)) |
| 87 | (diskval fromdiskvalue)) | ||
| 88 | (unless | ||
| 89 | (cond ((and (hash-table-p origval) (hash-table-p diskval)) | ||
| 90 | (hash-equal origval diskval)) | ||
| 91 | (t (equal origval diskval))) | ||
| 74 | (error "Slot %S Persistent Val %S != Default Value %S" | 92 | (error "Slot %S Persistent Val %S != Default Value %S" |
| 75 | oneslot fromdiskvalue (cl--slot-descriptor-initform slot)))) | 93 | oneslot diskval origvalue)))))))) |
| 76 | )))) | ||
| 77 | 94 | ||
| 78 | ;;; Simple Case | 95 | ;;; Simple Case |
| 79 | ;; | 96 | ;; |
| @@ -203,13 +220,16 @@ persistent class.") | |||
| 203 | ((slot1 :initarg :slot1 | 220 | ((slot1 :initarg :slot1 |
| 204 | :type (or persistent-random-class null persist-not-persistent)) | 221 | :type (or persistent-random-class null persist-not-persistent)) |
| 205 | (slot2 :initarg :slot2 | 222 | (slot2 :initarg :slot2 |
| 206 | :type (or persist-not-persistent persist-random-class null)))) | 223 | :type (or persist-not-persistent persistent-random-class null)) |
| 224 | (slot3 :initarg :slot3 | ||
| 225 | :type persistent-random-class))) | ||
| 207 | 226 | ||
| 208 | (ert-deftest eieio-test-multiple-class-slot () | 227 | (ert-deftest eieio-test-multiple-class-slot () |
| 209 | (let ((persist | 228 | (let ((persist |
| 210 | (persistent-multiclass-slot | 229 | (persistent-multiclass-slot |
| 211 | :slot1 (persistent-random-class) | 230 | :slot1 (persistent-random-class) |
| 212 | :slot2 (persist-not-persistent) | 231 | :slot2 (persist-not-persistent) |
| 232 | :slot3 (persistent-random-class) | ||
| 213 | :file (concat default-directory "test-ps5.pt")))) | 233 | :file (concat default-directory "test-ps5.pt")))) |
| 214 | (unwind-protect | 234 | (unwind-protect |
| 215 | (persist-test-save-and-compare persist) | 235 | (persist-test-save-and-compare persist) |
| @@ -235,4 +255,85 @@ persistent class.") | |||
| 235 | (persist-test-save-and-compare persist-wols) | 255 | (persist-test-save-and-compare persist-wols) |
| 236 | (delete-file (oref persist-wols file)))) | 256 | (delete-file (oref persist-wols file)))) |
| 237 | 257 | ||
| 258 | ;;; Tests targeted at popular libraries in the wild. | ||
| 259 | |||
| 260 | ;; Objects inside hash tables and vectors (pcache), see bug#29220. | ||
| 261 | (defclass person () | ||
| 262 | ((name :type string :initarg :name))) | ||
| 263 | |||
| 264 | (defclass classy (eieio-persistent) | ||
| 265 | ((teacher | ||
| 266 | :type person | ||
| 267 | :initarg :teacher) | ||
| 268 | (students | ||
| 269 | :initarg :students :initform (make-hash-table :test 'equal)) | ||
| 270 | (janitors | ||
| 271 | :type list | ||
| 272 | :initarg :janitors) | ||
| 273 | (random-vector | ||
| 274 | :type vector | ||
| 275 | :initarg :random-vector))) | ||
| 276 | |||
| 277 | (ert-deftest eieio-test-persist-hash-and-vector () | ||
| 278 | (let* ((jane (make-instance 'person :name "Jane")) | ||
| 279 | (bob (make-instance 'person :name "Bob")) | ||
| 280 | (hans (make-instance 'person :name "Hans")) | ||
| 281 | (dierdre (make-instance 'person :name "Dierdre")) | ||
| 282 | (class (make-instance 'classy | ||
| 283 | :teacher jane | ||
| 284 | :janitors (list [tuesday nil] | ||
| 285 | [friday nil]) | ||
| 286 | :random-vector [nil] | ||
| 287 | :file (concat default-directory "classy-" emacs-version ".eieio")))) | ||
| 288 | (puthash "Bob" bob (slot-value class 'students)) | ||
| 289 | (aset (slot-value class 'random-vector) 0 | ||
| 290 | (make-instance 'persistent-random-class)) | ||
| 291 | (unwind-protect | ||
| 292 | (persist-test-save-and-compare class) | ||
| 293 | (delete-file (oref class file))) | ||
| 294 | (aset (car (slot-value class 'janitors)) 1 hans) | ||
| 295 | (aset (nth 1 (slot-value class 'janitors)) 1 dierdre) | ||
| 296 | (unwind-protect | ||
| 297 | ;; FIXME: This should not error. | ||
| 298 | (should-error (persist-test-save-and-compare class)) | ||
| 299 | (delete-file (oref class file))))) | ||
| 300 | |||
| 301 | ;; Extra quotation of lists inside other objects (Gnus registry), also | ||
| 302 | ;; bug#29220. | ||
| 303 | |||
| 304 | (defclass eieio-container (eieio-persistent) | ||
| 305 | ((alist | ||
| 306 | :initarg :alist | ||
| 307 | :type list) | ||
| 308 | (vec | ||
| 309 | :initarg :vec | ||
| 310 | :type vector) | ||
| 311 | (htab | ||
| 312 | :initarg :htab | ||
| 313 | :type hash-table))) | ||
| 314 | |||
| 315 | (ert-deftest eieio-test-persist-interior-lists () | ||
| 316 | (let* ((thing (make-instance | ||
| 317 | 'eieio-container | ||
| 318 | :vec [nil] | ||
| 319 | :htab (make-hash-table :test #'equal) | ||
| 320 | :file (concat default-directory | ||
| 321 | "container-" emacs-version ".eieio"))) | ||
| 322 | (john (make-instance 'person :name "John")) | ||
| 323 | (alexie (make-instance 'person :name "Alexie")) | ||
| 324 | (alst '(("first" (one two three)) | ||
| 325 | ("second" (four five six))))) | ||
| 326 | (setf (slot-value thing 'alist) alst) | ||
| 327 | (puthash "alst" alst (slot-value thing 'htab)) | ||
| 328 | (aset (slot-value thing 'vec) 0 alst) | ||
| 329 | (unwind-protect | ||
| 330 | (persist-test-save-and-compare thing) | ||
| 331 | (delete-file (slot-value thing 'file))) | ||
| 332 | (setf (nth 2 (cadar alst)) john | ||
| 333 | (nth 2 (cadadr alst)) alexie) | ||
| 334 | (unwind-protect | ||
| 335 | ;; FIXME: Should not error. | ||
| 336 | (should-error (persist-test-save-and-compare thing)) | ||
| 337 | (delete-file (slot-value thing 'file))))) | ||
| 338 | |||
| 238 | ;;; eieio-test-persist.el ends here | 339 | ;;; eieio-test-persist.el ends here |