diff options
| author | Anders Lindgren | 2015-10-28 12:13:18 +0100 |
|---|---|---|
| committer | Anders Lindgren | 2015-10-28 12:13:18 +0100 |
| commit | e69f7770611d85e130806763a46db7e212bc952f (patch) | |
| tree | 96bdd02003f21cea72a604d8f14a06ff99cd9744 | |
| parent | 0392e241b844487261d4dfcccc9a442793e0a868 (diff) | |
| parent | cc587a3539612d250d222363b18d15258e33f82a (diff) | |
| download | emacs-e69f7770611d85e130806763a46db7e212bc952f.tar.gz emacs-e69f7770611d85e130806763a46db7e212bc952f.zip | |
Merge branch 'master' of /Volumes/HD2/build/emacs-git-ssh
35 files changed, 830 insertions, 654 deletions
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index ca8abe54ace..65a97a46699 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi | |||
| @@ -2038,32 +2038,35 @@ forward slash (@samp{/}) character. | |||
| 2038 | @node Directory Names | 2038 | @node Directory Names |
| 2039 | @subsection Directory Names | 2039 | @subsection Directory Names |
| 2040 | @cindex directory name | 2040 | @cindex directory name |
| 2041 | @cindex directory file name | ||
| 2041 | @cindex file name of directory | 2042 | @cindex file name of directory |
| 2042 | 2043 | ||
| 2043 | A @dfn{directory name} is the name of a directory. A directory is | 2044 | A @dfn{directory name} is the name of a directory. A directory is |
| 2044 | actually a kind of file, so it has a file name, which is related to | 2045 | actually a kind of file, so it has a file name (called the |
| 2045 | the directory name but not identical to it. (This is not quite the | 2046 | @dfn{directory file name}, which is related to the directory name but |
| 2046 | same as the usual Unix terminology.) These two different names for | 2047 | not identical to it. (This is not quite the same as the usual Unix |
| 2047 | the same entity are related by a syntactic transformation. On GNU and | 2048 | terminology.) These two different names for the same entity are |
| 2048 | Unix systems, this is simple: a directory name ends in a slash, | 2049 | related by a syntactic transformation. On GNU and Unix systems, this |
| 2049 | whereas the directory's name as a file lacks that slash. On MS-DOS | 2050 | is simple: a directory name ends in a slash, whereas the directory |
| 2050 | the relationship is more complicated. | 2051 | file name lacks that slash. On MS-DOS the relationship is more |
| 2051 | 2052 | complicated. | |
| 2052 | The difference between a directory name and its name as a file is | 2053 | |
| 2054 | The difference between directory name and directory file name is | ||
| 2053 | subtle but crucial. When an Emacs variable or function argument is | 2055 | subtle but crucial. When an Emacs variable or function argument is |
| 2054 | described as being a directory name, a file name of a directory is not | 2056 | described as being a directory name, a directory file name is not |
| 2055 | acceptable. When @code{file-name-directory} returns a string, that is | 2057 | acceptable. When @code{file-name-directory} returns a string, that is |
| 2056 | always a directory name. | 2058 | always a directory name. |
| 2057 | 2059 | ||
| 2058 | The following two functions convert between directory names and file | 2060 | The following two functions convert between directory names and |
| 2059 | names. They do nothing special with environment variable substitutions | 2061 | directory file names. They do nothing special with environment |
| 2060 | such as @samp{$HOME}, and the constructs @samp{~}, @samp{.} and @samp{..}. | 2062 | variable substitutions such as @samp{$HOME}, and the constructs |
| 2063 | @samp{~}, @samp{.} and @samp{..}. | ||
| 2061 | 2064 | ||
| 2062 | @defun file-name-as-directory filename | 2065 | @defun file-name-as-directory filename |
| 2063 | This function returns a string representing @var{filename} in a form | 2066 | This function returns a string representing @var{filename} in a form |
| 2064 | that the operating system will interpret as the name of a directory. On | 2067 | that the operating system will interpret as the name of a directory (a |
| 2065 | most systems, this means appending a slash to the string (if it does not | 2068 | directory name). On most systems, this means appending a slash to the |
| 2066 | already end in one). | 2069 | string (if it does not already end in one). |
| 2067 | 2070 | ||
| 2068 | @example | 2071 | @example |
| 2069 | @group | 2072 | @group |
| @@ -2074,10 +2077,10 @@ already end in one). | |||
| 2074 | @end defun | 2077 | @end defun |
| 2075 | 2078 | ||
| 2076 | @defun directory-file-name dirname | 2079 | @defun directory-file-name dirname |
| 2077 | This function returns a string representing @var{dirname} in a form that | 2080 | This function returns a string representing @var{dirname} in a form |
| 2078 | the operating system will interpret as the name of a file. On most | 2081 | that the operating system will interpret as the name of a file (a |
| 2079 | systems, this means removing the final slash (or backslash) from the | 2082 | directory file name). On most systems, this means removing the final |
| 2080 | string. | 2083 | slash (or backslash) from the string. |
| 2081 | 2084 | ||
| 2082 | @example | 2085 | @example |
| 2083 | @group | 2086 | @group |
| @@ -2119,6 +2122,13 @@ Don't try concatenating a slash by hand, as in | |||
| 2119 | because this is not portable. Always use | 2122 | because this is not portable. Always use |
| 2120 | @code{file-name-as-directory}. | 2123 | @code{file-name-as-directory}. |
| 2121 | 2124 | ||
| 2125 | To avoid the issues mentioned above, or if the @var{dirname} value | ||
| 2126 | might be nil (for example, from an element of @code{load-path}), use: | ||
| 2127 | |||
| 2128 | @example | ||
| 2129 | (expand-file-name @var{relfile} @var{dirname}) | ||
| 2130 | @end example | ||
| 2131 | |||
| 2122 | To convert a directory name to its abbreviation, use this | 2132 | To convert a directory name to its abbreviation, use this |
| 2123 | function: | 2133 | function: |
| 2124 | 2134 | ||
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 0160de82086..7050df86a18 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi | |||
| @@ -2697,6 +2697,11 @@ watch library. Otherwise, the actions @code{deleted} and | |||
| 2697 | (rename-file "/tmp/foo" "/tmp/bla") | 2697 | (rename-file "/tmp/foo" "/tmp/bla") |
| 2698 | @result{} Event (35025468 renamed "/tmp/foo" "/tmp/bla") | 2698 | @result{} Event (35025468 renamed "/tmp/foo" "/tmp/bla") |
| 2699 | @end group | 2699 | @end group |
| 2700 | |||
| 2701 | @group | ||
| 2702 | (delete-file "/tmp/bla") | ||
| 2703 | @result{} Event (35025468 deleted "/tmp/bla") | ||
| 2704 | @end group | ||
| 2700 | @end example | 2705 | @end example |
| 2701 | @end defun | 2706 | @end defun |
| 2702 | 2707 | ||
| @@ -2718,15 +2723,15 @@ also makes it invalid. | |||
| 2718 | 2723 | ||
| 2719 | @example | 2724 | @example |
| 2720 | @group | 2725 | @group |
| 2721 | (setq desc (file-notify-add-watch | 2726 | (make-directory "/tmp/foo") |
| 2722 | "/tmp/foo" '(change) 'my-notify-callback)) | 2727 | @result{} nil |
| 2723 | @result{} 35025468 | ||
| 2724 | @end group | 2728 | @end group |
| 2725 | 2729 | ||
| 2726 | @group | 2730 | @group |
| 2727 | (write-region "foo" nil "/tmp/foo") | 2731 | (setq desc |
| 2728 | @result{} Event (35025468 created "/tmp/foo") | 2732 | (file-notify-add-watch |
| 2729 | Event (35025468 changed "/tmp/foo") | 2733 | "/tmp/foo" '(change) 'my-notify-callback)) |
| 2734 | @result{} 35025468 | ||
| 2730 | @end group | 2735 | @end group |
| 2731 | 2736 | ||
| 2732 | @group | 2737 | @group |
| @@ -2735,8 +2740,32 @@ also makes it invalid. | |||
| 2735 | @end group | 2740 | @end group |
| 2736 | 2741 | ||
| 2737 | @group | 2742 | @group |
| 2738 | (delete-file "/tmp/foo") | 2743 | (write-region "bla" nil "/tmp/foo/bla") |
| 2739 | @result{} Event (35025468 deleted "/tmp/foo") | 2744 | @result{} Event (35025468 created "/tmp/foo/.#bla") |
| 2745 | Event (35025468 created "/tmp/foo/bla") | ||
| 2746 | Event (35025468 changed "/tmp/foo/bla") | ||
| 2747 | Event (35025468 changed "/tmp/foo/.#bla") | ||
| 2748 | @end group | ||
| 2749 | |||
| 2750 | @group | ||
| 2751 | ;; Deleting a file in the directory doesn't invalidate the watch. | ||
| 2752 | (delete-file "/tmp/foo/bla") | ||
| 2753 | @result{} Event (35025468 deleted "/tmp/foo/bla") | ||
| 2754 | @end group | ||
| 2755 | |||
| 2756 | @group | ||
| 2757 | (write-region "bla" nil "/tmp/foo/bla") | ||
| 2758 | @result{} Event (35025468 created "/tmp/foo/.#bla") | ||
| 2759 | Event (35025468 created "/tmp/foo/bla") | ||
| 2760 | Event (35025468 changed "/tmp/foo/bla") | ||
| 2761 | Event (35025468 changed "/tmp/foo/.#bla") | ||
| 2762 | @end group | ||
| 2763 | |||
| 2764 | @group | ||
| 2765 | ;; Deleting the directory invalidates the watch. | ||
| 2766 | (delete-directory "/tmp/foo" 'recursive) | ||
| 2767 | @result{} Event (35025468 deleted "/tmp/foo/bla") | ||
| 2768 | Event (35025468 deleted "/tmp/foo") | ||
| 2740 | Event (35025468 stopped "/tmp/foo") | 2769 | Event (35025468 stopped "/tmp/foo") |
| 2741 | @end group | 2770 | @end group |
| 2742 | 2771 | ||
diff --git a/etc/images/icons/hicolor/scalable/apps/emacs.svg b/etc/images/icons/hicolor/scalable/apps/emacs.svg index 9de91c61c01..52742043f40 100644 --- a/etc/images/icons/hicolor/scalable/apps/emacs.svg +++ b/etc/images/icons/hicolor/scalable/apps/emacs.svg | |||
| @@ -6,45 +6,19 @@ | |||
| 6 | xmlns:svg="http://www.w3.org/2000/svg" | 6 | xmlns:svg="http://www.w3.org/2000/svg" |
| 7 | xmlns="http://www.w3.org/2000/svg" | 7 | xmlns="http://www.w3.org/2000/svg" |
| 8 | xmlns:xlink="http://www.w3.org/1999/xlink" | 8 | xmlns:xlink="http://www.w3.org/1999/xlink" |
| 9 | xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||
| 10 | xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||
| 11 | version="1.0" | ||
| 12 | width="48" | ||
| 13 | height="48" | ||
| 14 | viewBox="0.171 0.201 512 512" | ||
| 15 | id="svg4768" | ||
| 16 | xml:space="preserve" | 9 | xml:space="preserve" |
| 17 | inkscape:version="0.91 r13725" | 10 | id="svg4768" |
| 18 | sodipodi:docname="emacs.svg" | 11 | viewBox="0.171 0.201 512 512" |
| 19 | inkscape:export-filename="/home/nico/work/emacs/etc/images/icons/hicolor/16x16/apps/emacs.png" | 12 | height="48" |
| 20 | inkscape:export-xdpi="30" | 13 | width="48" |
| 21 | inkscape:export-ydpi="30"><metadata | 14 | version="1.0"><metadata |
| 22 | id="metadata70"><rdf:RDF><cc:Work | 15 | id="metadata70"><rdf:RDF><cc:Work |
| 23 | rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type | 16 | rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type |
| 24 | rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><sodipodi:namedview | 17 | rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><!-- Gnu Emacs Icon |
| 25 | pagecolor="#ffffff" | ||
| 26 | bordercolor="#666666" | ||
| 27 | borderopacity="1" | ||
| 28 | objecttolerance="10" | ||
| 29 | gridtolerance="10" | ||
| 30 | guidetolerance="10" | ||
| 31 | inkscape:pageopacity="0" | ||
| 32 | inkscape:pageshadow="2" | ||
| 33 | inkscape:window-width="1600" | ||
| 34 | inkscape:window-height="836" | ||
| 35 | id="namedview68" | ||
| 36 | showgrid="false" | ||
| 37 | inkscape:zoom="6.9532167" | ||
| 38 | inkscape:cx="2.4213042" | ||
| 39 | inkscape:cy="30.151333" | ||
| 40 | inkscape:window-x="0" | ||
| 41 | inkscape:window-y="27" | ||
| 42 | inkscape:window-maximized="1" | ||
| 43 | inkscape:current-layer="svg4768" | ||
| 44 | showguides="true" | ||
| 45 | inkscape:guide-bbox="true" /><!-- Gnu Emacs Icon | ||
| 46 | Copyright (C) 2008-2015 Free Software Foundation, Inc. | 18 | Copyright (C) 2008-2015 Free Software Foundation, Inc. |
| 47 | 19 | ||
| 20 | Author: Nicolas Petton <nicolas@petton.fr> | ||
| 21 | |||
| 48 | This file is part of GNU Emacs. | 22 | This file is part of GNU Emacs. |
| 49 | 23 | ||
| 50 | GNU Emacs is free software: you can redistribute it and/or modify | 24 | GNU Emacs is free software: you can redistribute it and/or modify |
| @@ -62,259 +36,251 @@ | |||
| 62 | 36 | ||
| 63 | --><!-- Created with Inkscape (http://www.inkscape.org/) --><defs | 37 | --><!-- Created with Inkscape (http://www.inkscape.org/) --><defs |
| 64 | id="defs4770"><linearGradient | 38 | id="defs4770"><linearGradient |
| 65 | inkscape:collect="always" | ||
| 66 | id="linearGradient4292"><stop | 39 | id="linearGradient4292"><stop |
| 67 | style="stop-color:#411f5d;stop-opacity:1" | 40 | id="stop4294" |
| 68 | offset="0" | 41 | offset="0" |
| 69 | id="stop4294" /><stop | 42 | style="stop-color:#411f5d;stop-opacity:1" /><stop |
| 70 | style="stop-color:#5b2a85;stop-opacity:1" | 43 | id="stop4296" |
| 71 | offset="1" | 44 | offset="1" |
| 72 | id="stop4296" /></linearGradient><linearGradient | 45 | style="stop-color:#5b2a85;stop-opacity:1" /></linearGradient><linearGradient |
| 73 | id="linearGradient4284"><stop | 46 | id="linearGradient4284"><stop |
| 74 | id="stop4286" | 47 | offset="0" |
| 75 | style="stop-color:#8381c5;stop-opacity:1" | 48 | style="stop-color:#8381c5;stop-opacity:1" |
| 76 | offset="0" /><stop | 49 | id="stop4286" /><stop |
| 77 | offset="0.56639391" | 50 | id="stop4290" |
| 78 | style="stop-color:#7e55b3;stop-opacity:0.99607843" | 51 | style="stop-color:#7e55b3;stop-opacity:0.99607843" |
| 79 | id="stop4290" /><stop | 52 | offset="0.56639391" /><stop |
| 80 | id="stop4288" | 53 | offset="1" |
| 81 | style="stop-color:#a52ecb;stop-opacity:0.99215686" | 54 | style="stop-color:#a52ecb;stop-opacity:0.99215686" |
| 82 | offset="1" /></linearGradient><linearGradient | 55 | id="stop4288" /></linearGradient><linearGradient |
| 83 | id="linearGradient4898"><stop | 56 | id="linearGradient4898"><stop |
| 84 | offset="0" | 57 | id="stop4278" |
| 85 | style="stop-color:#bab8db;stop-opacity:1" | 58 | style="stop-color:#bab8db;stop-opacity:1" |
| 86 | id="stop4278" /><stop | 59 | offset="0" /><stop |
| 87 | offset="1" | 60 | id="stop4280" |
| 88 | style="stop-color:#5955a9;stop-opacity:0.99159664" | 61 | style="stop-color:#5955a9;stop-opacity:0.99159664" |
| 89 | id="stop4280" /></linearGradient><linearGradient | 62 | offset="1" /></linearGradient><linearGradient |
| 90 | id="linearGradient3294"><stop | 63 | id="linearGradient3294"><stop |
| 91 | id="stop3296" | 64 | offset="0" |
| 92 | style="stop-color:#6376e6;stop-opacity:1" | 65 | style="stop-color:#6376e6;stop-opacity:1" |
| 93 | offset="0" /><stop | 66 | id="stop3296" /><stop |
| 94 | id="stop3302" | 67 | offset="0.50094414" |
| 95 | style="stop-color:#222989;stop-opacity:1" | 68 | style="stop-color:#222989;stop-opacity:1" |
| 96 | offset="0.50094414" /><stop | 69 | id="stop3302" /><stop |
| 97 | id="stop3298" | 70 | offset="1" |
| 98 | style="stop-color:#00003d;stop-opacity:1" | 71 | style="stop-color:#00003d;stop-opacity:1" |
| 99 | offset="1" /></linearGradient><linearGradient | 72 | id="stop3298" /></linearGradient><linearGradient |
| 100 | id="linearGradient3284"><stop | 73 | id="linearGradient3284"><stop |
| 101 | id="stop3286" | 74 | offset="0" |
| 102 | style="stop-color:#000000;stop-opacity:1" | 75 | style="stop-color:#000000;stop-opacity:1" |
| 103 | offset="0" /><stop | 76 | id="stop3286" /><stop |
| 104 | id="stop3292" | 77 | offset="0.84845906" |
| 105 | style="stop-color:#000000;stop-opacity:0.49803922" | 78 | style="stop-color:#000000;stop-opacity:0.49803922" |
| 106 | offset="0.84845906" /><stop | 79 | id="stop3292" /><stop |
| 107 | id="stop3288" | 80 | offset="1" |
| 108 | style="stop-color:#000000;stop-opacity:0" | 81 | style="stop-color:#000000;stop-opacity:0" |
| 109 | offset="1" /></linearGradient><linearGradient | 82 | id="stop3288" /></linearGradient><linearGradient |
| 110 | id="linearGradient3274"><stop | 83 | id="linearGradient3274"><stop |
| 111 | id="stop3276" | 84 | offset="0" |
| 112 | style="stop-color:#000000;stop-opacity:1" | 85 | style="stop-color:#000000;stop-opacity:1" |
| 113 | offset="0" /><stop | 86 | id="stop3276" /><stop |
| 114 | id="stop3278" | 87 | offset="1" |
| 115 | style="stop-color:#000000;stop-opacity:0" | 88 | style="stop-color:#000000;stop-opacity:0" |
| 116 | offset="1" /></linearGradient><linearGradient | 89 | id="stop3278" /></linearGradient><linearGradient |
| 117 | id="linearGradient3262"><stop | 90 | id="linearGradient3262"><stop |
| 118 | id="stop3264" | 91 | offset="0" |
| 119 | style="stop-color:#000000;stop-opacity:1" | 92 | style="stop-color:#000000;stop-opacity:1" |
| 120 | offset="0" /><stop | 93 | id="stop3264" /><stop |
| 121 | id="stop3266" | 94 | offset="1" |
| 122 | style="stop-color:#000000;stop-opacity:0" | 95 | style="stop-color:#000000;stop-opacity:0" |
| 123 | offset="1" /></linearGradient><linearGradient | 96 | id="stop3266" /></linearGradient><linearGradient |
| 124 | id="linearGradient3242"><stop | 97 | id="linearGradient3242"><stop |
| 125 | id="stop3244" | 98 | offset="0" |
| 126 | style="stop-color:#282828;stop-opacity:1" | 99 | style="stop-color:#282828;stop-opacity:1" |
| 127 | offset="0" /><stop | 100 | id="stop3244" /><stop |
| 128 | id="stop3252" | 101 | offset="0.39253417" |
| 129 | style="stop-color:#808080;stop-opacity:1" | 102 | style="stop-color:#808080;stop-opacity:1" |
| 130 | offset="0.39253417" /><stop | 103 | id="stop3252" /><stop |
| 131 | id="stop3246" | 104 | offset="1" |
| 132 | style="stop-color:#d9d9d9;stop-opacity:1" | 105 | style="stop-color:#d9d9d9;stop-opacity:1" |
| 133 | offset="1" /></linearGradient><linearGradient | 106 | id="stop3246" /></linearGradient><linearGradient |
| 134 | id="linearGradient3202"><stop | 107 | id="linearGradient3202"><stop |
| 135 | id="stop3204" | 108 | offset="0" |
| 136 | style="stop-color:#2b2b2b;stop-opacity:1" | 109 | style="stop-color:#2b2b2b;stop-opacity:1" |
| 137 | offset="0" /><stop | 110 | id="stop3204" /><stop |
| 138 | id="stop3250" | 111 | offset="0.5" |
| 139 | style="stop-color:#828383;stop-opacity:1" | 112 | style="stop-color:#828383;stop-opacity:1" |
| 140 | offset="0.5" /><stop | 113 | id="stop3250" /><stop |
| 141 | id="stop3206" | 114 | offset="1" |
| 142 | style="stop-color:#dadbdb;stop-opacity:1" | 115 | style="stop-color:#dadbdb;stop-opacity:1" |
| 143 | offset="1" /></linearGradient><linearGradient | 116 | id="stop3206" /></linearGradient><linearGradient |
| 144 | id="linearGradient4966"><stop | 117 | id="linearGradient4966"><stop |
| 145 | id="stop4968" | 118 | offset="0" |
| 146 | style="stop-color:#b6b3d8;stop-opacity:1" | 119 | style="stop-color:#b6b3d8;stop-opacity:1" |
| 147 | offset="0" /><stop | 120 | id="stop4968" /><stop |
| 148 | id="stop4970" | 121 | offset="1" |
| 149 | style="stop-color:#b6b3d8;stop-opacity:0" | 122 | style="stop-color:#b6b3d8;stop-opacity:0" |
| 150 | offset="1" /></linearGradient><linearGradient | 123 | id="stop4970" /></linearGradient><linearGradient |
| 151 | id="linearGradient4938"><stop | 124 | id="linearGradient4938"><stop |
| 152 | id="stop4940" | 125 | offset="0" |
| 153 | style="stop-color:#000000;stop-opacity:1" | 126 | style="stop-color:#000000;stop-opacity:1" |
| 154 | offset="0" /><stop | 127 | id="stop4940" /><stop |
| 155 | id="stop4942" | 128 | offset="1" |
| 156 | style="stop-color:#000000;stop-opacity:0" | 129 | style="stop-color:#000000;stop-opacity:0" |
| 157 | offset="1" /></linearGradient><linearGradient | 130 | id="stop4942" /></linearGradient><linearGradient |
| 158 | id="linearGradient4282"><stop | 131 | id="linearGradient4282"><stop |
| 159 | id="stop4900" | 132 | offset="0" |
| 160 | style="stop-color:#bab8db;stop-opacity:1" | 133 | style="stop-color:#bab8db;stop-opacity:1" |
| 161 | offset="0" /><stop | 134 | id="stop4900" /><stop |
| 162 | id="stop4902" | 135 | offset="1" |
| 163 | style="stop-color:#5955a9;stop-opacity:0.99159664" | 136 | style="stop-color:#5955a9;stop-opacity:0.99159664" |
| 164 | offset="1" /></linearGradient><linearGradient | 137 | id="stop4902" /></linearGradient><linearGradient |
| 165 | id="linearGradient4876"><stop | 138 | id="linearGradient4876"><stop |
| 166 | id="stop4878" | 139 | offset="0" |
| 167 | style="stop-color:#d3d2e8;stop-opacity:1" | 140 | style="stop-color:#d3d2e8;stop-opacity:1" |
| 168 | offset="0" /><stop | 141 | id="stop4878" /><stop |
| 169 | id="stop4880" | 142 | offset="1" |
| 170 | style="stop-color:#5955a9;stop-opacity:0.99159664" | 143 | style="stop-color:#5955a9;stop-opacity:0.99159664" |
| 171 | offset="1" /></linearGradient><radialGradient | 144 | id="stop4880" /></linearGradient><radialGradient |
| 172 | cx="20.951529" | 145 | gradientTransform="matrix(0.6817439,0,0,0.5905355,-3.8523706,-28.935273)" |
| 173 | cy="-108.96888" | 146 | gradientUnits="userSpaceOnUse" |
| 174 | r="266.76535" | ||
| 175 | fx="20.951529" | ||
| 176 | fy="-108.96888" | ||
| 177 | id="radialGradient4892" | ||
| 178 | xlink:href="#linearGradient4898" | 147 | xlink:href="#linearGradient4898" |
| 148 | id="radialGradient4892" | ||
| 149 | fy="-108.96888" | ||
| 150 | fx="20.951529" | ||
| 151 | r="266.76535" | ||
| 152 | cy="-108.96888" | ||
| 153 | cx="20.951529" /><radialGradient | ||
| 154 | gradientTransform="matrix(1,0,0,0.1854103,0,383.88493)" | ||
| 179 | gradientUnits="userSpaceOnUse" | 155 | gradientUnits="userSpaceOnUse" |
| 180 | gradientTransform="matrix(0.6817439,0,0,0.5905355,-3.8523706,-28.935273)" /><radialGradient | ||
| 181 | cx="233.8876" | ||
| 182 | cy="471.26172" | ||
| 183 | r="170.49393" | ||
| 184 | fx="233.8876" | ||
| 185 | fy="471.26172" | ||
| 186 | id="radialGradient4944" | ||
| 187 | xlink:href="#linearGradient4938" | 156 | xlink:href="#linearGradient4938" |
| 157 | id="radialGradient4944" | ||
| 158 | fy="471.26172" | ||
| 159 | fx="233.8876" | ||
| 160 | r="170.49393" | ||
| 161 | cy="471.26172" | ||
| 162 | cx="233.8876" /><radialGradient | ||
| 163 | gradientTransform="matrix(1,0,0,0.9121621,0,32.654948)" | ||
| 188 | gradientUnits="userSpaceOnUse" | 164 | gradientUnits="userSpaceOnUse" |
| 189 | gradientTransform="matrix(1,0,0,0.1854103,0,383.88493)" /><radialGradient | ||
| 190 | cx="299.70135" | ||
| 191 | cy="371.76376" | ||
| 192 | r="76.696358" | ||
| 193 | fx="299.70135" | ||
| 194 | fy="371.76376" | ||
| 195 | id="radialGradient4972" | ||
| 196 | xlink:href="#linearGradient4966" | 165 | xlink:href="#linearGradient4966" |
| 166 | id="radialGradient4972" | ||
| 167 | fy="371.76376" | ||
| 168 | fx="299.70135" | ||
| 169 | r="76.696358" | ||
| 170 | cy="371.76376" | ||
| 171 | cx="299.70135" /><radialGradient | ||
| 172 | gradientTransform="matrix(0.414705,0.3300575,-0.5059004,0.6356454,346.95314,49.479585)" | ||
| 197 | gradientUnits="userSpaceOnUse" | 173 | gradientUnits="userSpaceOnUse" |
| 198 | gradientTransform="matrix(1,0,0,0.9121621,0,32.654948)" /><radialGradient | ||
| 199 | cx="289.44067" | ||
| 200 | cy="390.45248" | ||
| 201 | r="17.67668" | ||
| 202 | fx="289.44067" | ||
| 203 | fy="390.45248" | ||
| 204 | id="radialGradient3210" | ||
| 205 | xlink:href="#linearGradient3202" | 174 | xlink:href="#linearGradient3202" |
| 206 | gradientUnits="userSpaceOnUse" | 175 | id="radialGradient3210" |
| 207 | gradientTransform="matrix(0.414705,0.3300575,-0.5059004,0.6356454,346.95314,49.479585)" /><radialGradient | 176 | fy="390.45248" |
| 208 | cx="283.50717" | 177 | fx="289.44067" |
| 209 | cy="382.14804" | ||
| 210 | r="17.67668" | 178 | r="17.67668" |
| 211 | fx="283.50717" | 179 | cy="390.45248" |
| 212 | fy="382.14804" | 180 | cx="289.44067" /><radialGradient |
| 213 | id="radialGradient3238" | 181 | gradientTransform="matrix(0.414705,0.3300575,-0.5059004,0.6356454,448.41009,-65.398074)" |
| 182 | gradientUnits="userSpaceOnUse" | ||
| 214 | xlink:href="#linearGradient3202" | 183 | xlink:href="#linearGradient3202" |
| 184 | id="radialGradient3238" | ||
| 185 | fy="382.14804" | ||
| 186 | fx="283.50717" | ||
| 187 | r="17.67668" | ||
| 188 | cy="382.14804" | ||
| 189 | cx="283.50717" /><radialGradient | ||
| 190 | gradientTransform="matrix(-6.5565014e-2,-5.9721765e-2,1.6871024,-1.8521705,171.90774,540.51473)" | ||
| 215 | gradientUnits="userSpaceOnUse" | 191 | gradientUnits="userSpaceOnUse" |
| 216 | gradientTransform="matrix(0.414705,0.3300575,-0.5059004,0.6356454,448.41009,-65.398074)" /><radialGradient | ||
| 217 | cx="418.45551" | ||
| 218 | cy="181.18982" | ||
| 219 | r="63.068935" | ||
| 220 | fx="418.45551" | ||
| 221 | fy="181.18982" | ||
| 222 | id="radialGradient3248" | ||
| 223 | xlink:href="#linearGradient3242" | 192 | xlink:href="#linearGradient3242" |
| 193 | id="radialGradient3248" | ||
| 194 | fy="181.18982" | ||
| 195 | fx="418.45551" | ||
| 196 | r="63.068935" | ||
| 197 | cy="181.18982" | ||
| 198 | cx="418.45551" /><radialGradient | ||
| 199 | gradientTransform="matrix(0.4055116,-3.3440123e-2,0.1034174,4.3988695,177.23251,-1191.6649)" | ||
| 224 | gradientUnits="userSpaceOnUse" | 200 | gradientUnits="userSpaceOnUse" |
| 225 | gradientTransform="matrix(-6.5565014e-2,-5.9721765e-2,1.6871024,-1.8521705,171.90774,540.51473)" /><radialGradient | ||
| 226 | cx="354.51709" | ||
| 227 | cy="357.33591" | ||
| 228 | r="33.712105" | ||
| 229 | fx="354.51709" | ||
| 230 | fy="357.33591" | ||
| 231 | id="radialGradient3268" | ||
| 232 | xlink:href="#linearGradient3262" | 201 | xlink:href="#linearGradient3262" |
| 202 | id="radialGradient3268" | ||
| 203 | fy="357.33591" | ||
| 204 | fx="354.51709" | ||
| 205 | r="33.712105" | ||
| 206 | cy="357.33591" | ||
| 207 | cx="354.51709" /><radialGradient | ||
| 208 | gradientTransform="matrix(-0.1339874,-0.1146812,0.3079048,-0.3597394,444.23592,395.03849)" | ||
| 233 | gradientUnits="userSpaceOnUse" | 209 | gradientUnits="userSpaceOnUse" |
| 234 | gradientTransform="matrix(0.4055116,-3.3440123e-2,0.1034174,4.3988695,177.23251,-1191.6649)" /><radialGradient | ||
| 235 | cx="510.58469" | ||
| 236 | cy="223.55537" | ||
| 237 | r="132.28336" | ||
| 238 | fx="510.58469" | ||
| 239 | fy="223.55537" | ||
| 240 | id="radialGradient3280" | ||
| 241 | xlink:href="#linearGradient3274" | 210 | xlink:href="#linearGradient3274" |
| 211 | id="radialGradient3280" | ||
| 212 | fy="223.55537" | ||
| 213 | fx="510.58469" | ||
| 214 | r="132.28336" | ||
| 215 | cy="223.55537" | ||
| 216 | cx="510.58469" /><radialGradient | ||
| 217 | gradientTransform="matrix(-1.2497569,1.3798305,-9.6289463e-2,-7.2974479e-2,674.3826,-70.590682)" | ||
| 242 | gradientUnits="userSpaceOnUse" | 218 | gradientUnits="userSpaceOnUse" |
| 243 | gradientTransform="matrix(-0.1339874,-0.1146812,0.3079048,-0.3597394,444.23592,395.03849)" /><radialGradient | ||
| 244 | cx="284.4671" | ||
| 245 | cy="-158.17821" | ||
| 246 | r="110.2972" | ||
| 247 | fx="284.4671" | ||
| 248 | fy="-158.17821" | ||
| 249 | id="radialGradient3290" | ||
| 250 | xlink:href="#linearGradient3284" | 219 | xlink:href="#linearGradient3284" |
| 220 | id="radialGradient3290" | ||
| 221 | fy="-158.17821" | ||
| 222 | fx="284.4671" | ||
| 223 | r="110.2972" | ||
| 224 | cy="-158.17821" | ||
| 225 | cx="284.4671" /><radialGradient | ||
| 226 | gradientTransform="matrix(-0.1008165,-8.0872321e-2,1.0745309,-1.3395252,13.843287,784.79288)" | ||
| 251 | gradientUnits="userSpaceOnUse" | 227 | gradientUnits="userSpaceOnUse" |
| 252 | gradientTransform="matrix(-1.2497569,1.3798305,-9.6289463e-2,-7.2974479e-2,674.3826,-70.590682)" /><radialGradient | ||
| 253 | cx="425.51019" | ||
| 254 | cy="356.62274" | ||
| 255 | r="143.34167" | ||
| 256 | fx="425.51019" | ||
| 257 | fy="356.62274" | ||
| 258 | id="radialGradient3300" | ||
| 259 | xlink:href="#linearGradient3294" | 228 | xlink:href="#linearGradient3294" |
| 260 | gradientUnits="userSpaceOnUse" | 229 | id="radialGradient3300" |
| 261 | gradientTransform="matrix(-0.1008165,-8.0872321e-2,1.0745309,-1.3395252,13.843287,784.79288)" /><filter | 230 | fy="356.62274" |
| 262 | inkscape:collect="always" | 231 | fx="425.51019" |
| 263 | style="color-interpolation-filters:sRGB" | 232 | r="143.34167" |
| 264 | id="filter4350" | 233 | cy="356.62274" |
| 265 | x="-0.044626798" | 234 | cx="425.51019" /><filter |
| 266 | width="1.0892536" | 235 | height="1.088351" |
| 267 | y="-0.044175496" | 236 | y="-0.044175496" |
| 268 | height="1.088351"><feGaussianBlur | 237 | width="1.0892536" |
| 269 | inkscape:collect="always" | 238 | x="-0.044626798" |
| 270 | stdDeviation="8.7848425" | 239 | id="filter4350" |
| 271 | id="feGaussianBlur4352" /></filter><linearGradient | 240 | style="color-interpolation-filters:sRGB"><feGaussianBlur |
| 272 | inkscape:collect="always" | 241 | id="feGaussianBlur4352" |
| 273 | xlink:href="#linearGradient4284" | 242 | stdDeviation="8.7848425" /></filter><linearGradient |
| 274 | id="linearGradient4245" | 243 | y2="300.73987" |
| 275 | gradientUnits="userSpaceOnUse" | ||
| 276 | gradientTransform="matrix(0.87385837,0,0,0.82818057,246.00762,250.28138)" | ||
| 277 | spreadMethod="pad" | ||
| 278 | x1="-122.20192" | ||
| 279 | y1="-161.8512" | ||
| 280 | x2="236.61363" | 244 | x2="236.61363" |
| 281 | y2="300.73987" /><linearGradient | 245 | y1="-161.8512" |
| 282 | inkscape:collect="always" | 246 | x1="-122.20192" |
| 283 | xlink:href="#linearGradient4292" | 247 | spreadMethod="pad" |
| 284 | id="linearGradient4247" | 248 | gradientTransform="matrix(0.87385837,0,0,0.82818057,246.00762,250.28138)" |
| 285 | gradientUnits="userSpaceOnUse" | 249 | gradientUnits="userSpaceOnUse" |
| 286 | gradientTransform="matrix(0.98684959,0,0,0.98684959,3.0344187,2.5250397)" | 250 | id="linearGradient4245" |
| 287 | x1="447.80933" | 251 | xlink:href="#linearGradient4284" /><linearGradient |
| 288 | y1="396.6066" | 252 | y2="66.018341" |
| 289 | x2="173.94518" | 253 | x2="173.94518" |
| 290 | y2="66.018341" /></defs><rect | 254 | y1="396.6066" |
| 291 | width="512" | 255 | x1="447.80933" |
| 292 | height="512" | 256 | gradientTransform="matrix(0.98684959,0,0,0.98684959,3.0344187,2.5250397)" |
| 293 | x="0.171" | 257 | gradientUnits="userSpaceOnUse" |
| 294 | y="0.20100001" | 258 | id="linearGradient4247" |
| 259 | xlink:href="#linearGradient4292" /></defs><rect | ||
| 260 | style="fill:none;display:none" | ||
| 295 | id="rect4772" | 261 | id="rect4772" |
| 296 | style="fill:none;display:none" /><g | 262 | y="0.20100001" |
| 297 | id="g4788" | 263 | x="0.171" |
| 298 | style="display:none"><g | 264 | height="512" |
| 299 | id="g4790" | 265 | width="512" /><g |
| 300 | style="display:inline" /></g><g | 266 | style="display:none" |
| 301 | id="g4806" | 267 | id="g4788"><g |
| 302 | style="display:none"><g | 268 | style="display:inline" |
| 303 | id="g4808" | 269 | id="g4790" /></g><g |
| 304 | style="display:inline"><path | 270 | style="display:none" |
| 305 | d="M 349.098,256.651 C 348.833,256.397 386.735,284.256 388.519,281.663 C 394.881,272.411 470.565,188.526 473.303,165.427 C 473.545,163.424 472.787,161.331 472.787,161.331 C 472.787,161.331 471.597,161.187 466.462,157.017 C 463.77,154.825 460.979,152.436 460.979,152.436 C 444.925,153.434 403.094,193.995 349.917,256.004" | 271 | id="g4806"><g |
| 272 | style="display:inline" | ||
| 273 | id="g4808"><path | ||
| 274 | style="fill:#050505;display:none" | ||
| 306 | id="path4810" | 275 | id="path4810" |
| 307 | style="fill:#050505;display:none" /></g></g><path | 276 | d="M 349.098,256.651 C 348.833,256.397 386.735,284.256 388.519,281.663 C 394.881,272.411 470.565,188.526 473.303,165.427 C 473.545,163.424 472.787,161.331 472.787,161.331 C 472.787,161.331 471.597,161.187 466.462,157.017 C 463.77,154.825 460.979,152.436 460.979,152.436 C 444.925,153.434 403.094,193.995 349.917,256.004" /></g></g><path |
| 308 | transform="matrix(0.98684957,0,0,0.98684957,3.0344041,2.5250397)" | ||
| 309 | d="m 491.66937,257.75916 c 0,131.79436 -105.76,238.63481 -236.22155,238.63481 -130.46155,0 -236.221539,-106.84045 -236.221539,-238.63481 0,-131.79437 105.759989,-238.634808 236.221539,-238.634808 130.46155,0 236.22155,106.840438 236.22155,238.634808 z" | ||
| 310 | id="path4233" | ||
| 311 | style="opacity:0.40500004;fill:#211f46;fill-opacity:0.99607843;stroke:#0a0b1b;stroke-width:8.53333378;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter4350)" | 277 | style="opacity:0.40500004;fill:#211f46;fill-opacity:0.99607843;stroke:#0a0b1b;stroke-width:8.53333378;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter4350)" |
| 312 | inkscape:connector-curvature="0" /><path | 278 | id="path4233" |
| 313 | inkscape:connector-curvature="0" | 279 | d="m 491.66937,257.75916 c 0,131.79436 -105.76,238.63481 -236.22155,238.63481 -130.46155,0 -236.221539,-106.84045 -236.221539,-238.63481 0,-131.79437 105.759989,-238.634808 236.221539,-238.634808 130.46155,0 236.22155,106.840438 236.22155,238.634808 z" |
| 314 | style="opacity:1;fill:url(#linearGradient4245);fill-opacity:1;stroke:url(#linearGradient4247);stroke-width:13.33816814;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" | 280 | transform="matrix(0.98684957,0,0,0.98684957,3.0344041,2.5250397)" /><path |
| 281 | d="m 488.23812,256.89456 c 0,130.06121 -104.3692,235.49665 -233.1151,235.49665 -128.7459,0 -233.115201,-105.43544 -233.115201,-235.49665 0,-130.06123 104.369301,-235.49666 233.115201,-235.49666 128.7459,0 233.1151,105.43543 233.1151,235.49666 z" | ||
| 315 | id="path4235" | 282 | id="path4235" |
| 316 | d="m 488.23812,256.89456 c 0,130.06121 -104.3692,235.49665 -233.1151,235.49665 -128.7459,0 -233.115201,-105.43544 -233.115201,-235.49665 0,-130.06123 104.369301,-235.49666 233.115201,-235.49666 128.7459,0 233.1151,105.43543 233.1151,235.49666 z" /><path | 283 | style="opacity:1;fill:url(#linearGradient4245);fill-opacity:1;stroke:url(#linearGradient4247);stroke-width:13.33816814;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /><path |
| 317 | inkscape:connector-curvature="0" | 284 | d="m 175.0003,422.31057 c 0,0 19.7385,1.39634 45.1312,-0.84159 10.2834,-0.9063 49.3267,-4.74128 78.5169,-11.14289 0,0 35.5899,-7.61669 54.6301,-14.63335 19.9225,-7.34185 30.7636,-13.57304 35.6433,-22.40243 -0.2128,-1.80907 1.5024,-8.22438 -7.685,-12.07788 -23.4887,-9.85199 -50.73,-8.06998 -104.6338,-9.21285 -59.7772,-2.05391 -79.6627,-12.05971 -90.2556,-20.11838 -10.1579,-8.17519 -5.05,-30.79254 38.4742,-50.71499 21.9244,-10.60898 107.8705,-30.18698 107.8705,-30.18698 -28.9451,-14.30725 -82.9186,-39.45893 -94.0134,-44.89023 -9.7308,-4.76348 -25.303,-11.93595 -28.6785,-20.61368 -3.8271,-8.33089 9.0383,-15.50726 16.2248,-17.56236 23.1448,-6.67602 55.8182,-10.82538 85.5548,-11.29122 14.9472,-0.23417 17.3734,-1.19586 17.3734,-1.19586 20.6243,-3.42116 34.2014,-17.53175 28.5446,-39.87876 -5.0783,-22.81046 -31.8617,-36.21365 -57.3138,-31.57361 -23.9682,4.36956 -81.7378,21.15007 -81.7378,21.15007 71.4075,-0.61803 83.3592,0.57378 88.697,8.03676 3.1523,4.40742 -1.4324,10.45068 -20.4765,13.56099 -20.733,3.38616 -63.8312,7.46399 -63.8312,7.46399 -41.3449,2.4554 -70.4682,2.61974 -79.203,21.11314 -5.7065,12.08196 6.0854,22.7633 11.2538,29.4493 21.8407,24.28905 53.3882,37.38879 73.6948,47.03553 7.6405,3.62963 30.0586,10.48407 30.0586,10.48407 -65.8782,-3.62335 -113.4003,16.6055 -141.2764,39.89622 -31.5288,29.16261 -17.581403,63.92354 47.0124,85.3268 38.1517,12.6416 57.0725,18.58695 113.9815,13.46232 33.52,-1.80673 38.8041,-0.73155 39.1383,2.01892 0.4705,3.87242 -37.2311,13.49165 -47.524,16.4606 -26.1853,7.55306 -94.8276,22.80438 -95.1712,22.87835 z" |
| 318 | style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" | ||
| 319 | id="path4237" | 285 | id="path4237" |
| 320 | d="m 175.0003,422.31057 c 0,0 19.7385,1.39634 45.1312,-0.84159 10.2834,-0.9063 49.3267,-4.74128 78.5169,-11.14289 0,0 35.5899,-7.61669 54.6301,-14.63335 19.9225,-7.34185 30.7636,-13.57304 35.6433,-22.40243 -0.2128,-1.80907 1.5024,-8.22438 -7.685,-12.07788 -23.4887,-9.85199 -50.73,-8.06998 -104.6338,-9.21285 -59.7772,-2.05391 -79.6627,-12.05971 -90.2556,-20.11838 -10.1579,-8.17519 -5.05,-30.79254 38.4742,-50.71499 21.9244,-10.60898 107.8705,-30.18698 107.8705,-30.18698 -28.9451,-14.30725 -82.9186,-39.45893 -94.0134,-44.89023 -9.7308,-4.76348 -25.303,-11.93595 -28.6785,-20.61368 -3.8271,-8.33089 9.0383,-15.50726 16.2248,-17.56236 23.1448,-6.67602 55.8182,-10.82538 85.5548,-11.29122 14.9472,-0.23417 17.3734,-1.19586 17.3734,-1.19586 20.6243,-3.42116 34.2014,-17.53175 28.5446,-39.87876 -5.0783,-22.81046 -31.8617,-36.21365 -57.3138,-31.57361 -23.9682,4.36956 -81.7378,21.15007 -81.7378,21.15007 71.4075,-0.61803 83.3592,0.57378 88.697,8.03676 3.1523,4.40742 -1.4324,10.45068 -20.4765,13.56099 -20.733,3.38616 -63.8312,7.46399 -63.8312,7.46399 -41.3449,2.4554 -70.4682,2.61974 -79.203,21.11314 -5.7065,12.08196 6.0854,22.7633 11.2538,29.4493 21.8407,24.28905 53.3882,37.38879 73.6948,47.03553 7.6405,3.62963 30.0586,10.48407 30.0586,10.48407 -65.8782,-3.62335 -113.4003,16.6055 -141.2764,39.89622 -31.5288,29.16261 -17.581403,63.92354 47.0124,85.3268 38.1517,12.6416 57.0725,18.58695 113.9815,13.46232 33.52,-1.80673 38.8041,-0.73155 39.1383,2.01892 0.4705,3.87242 -37.2311,13.49165 -47.524,16.4606 -26.1853,7.55306 -94.8276,22.80438 -95.1712,22.87835 z" /></svg> \ No newline at end of file | 286 | style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /></svg> |
diff --git a/lisp/autorevert.el b/lisp/autorevert.el index 37ee8eedcfd..f0c12d2d97e 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el | |||
| @@ -570,37 +570,54 @@ no more reverts are possible until the next call of | |||
| 570 | ;; Since we watch a directory, a file name must be returned. | 570 | ;; Since we watch a directory, a file name must be returned. |
| 571 | (cl-assert (stringp file)) | 571 | (cl-assert (stringp file)) |
| 572 | (when (eq action 'renamed) (cl-assert (stringp file1))) | 572 | (when (eq action 'renamed) (cl-assert (stringp file1))) |
| 573 | ;; Loop over all buffers, in order to find the intended one. | 573 | |
| 574 | (cl-dolist (buffer buffers) | 574 | (if (eq action 'stopped) |
| 575 | (when (buffer-live-p buffer) | 575 | ;; File notification has stopped. Continue with polling. |
| 576 | (with-current-buffer buffer | 576 | (cl-dolist (buffer buffers) |
| 577 | (when (or | 577 | (with-current-buffer buffer |
| 578 | ;; A buffer associated with a file. | 578 | (when (or |
| 579 | (and (stringp buffer-file-name) | 579 | ;; A buffer associated with a file. |
| 580 | (or | 580 | (and (stringp buffer-file-name) |
| 581 | (and (memq action '(attribute-changed changed created)) | 581 | (string-equal |
| 582 | (string-equal | 582 | (file-name-nondirectory file) |
| 583 | (file-name-nondirectory file) | 583 | (file-name-nondirectory buffer-file-name))) |
| 584 | (file-name-nondirectory buffer-file-name))) | 584 | ;; A buffer w/o a file, like dired. |
| 585 | (and (eq action 'renamed) | 585 | (null buffer-file-name)) |
| 586 | (string-equal | 586 | (auto-revert-notify-rm-watch) |
| 587 | (file-name-nondirectory file1) | 587 | (setq-local auto-revert-use-notify nil)))) |
| 588 | (file-name-nondirectory buffer-file-name))))) | 588 | |
| 589 | ;; A buffer w/o a file, like dired. | 589 | ;; Loop over all buffers, in order to find the intended one. |
| 590 | (and (null buffer-file-name) | 590 | (cl-dolist (buffer buffers) |
| 591 | (memq action '(created renamed deleted)))) | 591 | (when (buffer-live-p buffer) |
| 592 | ;; Mark buffer modified. | 592 | (with-current-buffer buffer |
| 593 | (setq auto-revert-notify-modified-p t) | 593 | (when (or |
| 594 | 594 | ;; A buffer associated with a file. | |
| 595 | ;; Revert the buffer now if we're not locked out. | 595 | (and (stringp buffer-file-name) |
| 596 | (when (/= auto-revert-buffers-counter-lockedout | 596 | (or |
| 597 | auto-revert-buffers-counter) | 597 | (and (memq |
| 598 | (auto-revert-handler) | 598 | action '(attribute-changed changed created)) |
| 599 | (setq auto-revert-buffers-counter-lockedout | 599 | (string-equal |
| 600 | auto-revert-buffers-counter)) | 600 | (file-name-nondirectory file) |
| 601 | 601 | (file-name-nondirectory buffer-file-name))) | |
| 602 | ;; No need to check other buffers. | 602 | (and (eq action 'renamed) |
| 603 | (cl-return)))))))) | 603 | (string-equal |
| 604 | (file-name-nondirectory file1) | ||
| 605 | (file-name-nondirectory buffer-file-name))))) | ||
| 606 | ;; A buffer w/o a file, like dired. | ||
| 607 | (and (null buffer-file-name) | ||
| 608 | (memq action '(created renamed deleted)))) | ||
| 609 | ;; Mark buffer modified. | ||
| 610 | (setq auto-revert-notify-modified-p t) | ||
| 611 | |||
| 612 | ;; Revert the buffer now if we're not locked out. | ||
| 613 | (when (/= auto-revert-buffers-counter-lockedout | ||
| 614 | auto-revert-buffers-counter) | ||
| 615 | (auto-revert-handler) | ||
| 616 | (setq auto-revert-buffers-counter-lockedout | ||
| 617 | auto-revert-buffers-counter)) | ||
| 618 | |||
| 619 | ;; No need to check other buffers. | ||
| 620 | (cl-return))))))))) | ||
| 604 | 621 | ||
| 605 | (defun auto-revert-active-p () | 622 | (defun auto-revert-active-p () |
| 606 | "Check if auto-revert is active (in current buffer or globally)." | 623 | "Check if auto-revert is active (in current buffer or globally)." |
diff --git a/lisp/cedet/cedet-global.el b/lisp/cedet/cedet-global.el index 3773ba09f32..3ceed5d3b54 100644 --- a/lisp/cedet/cedet-global.el +++ b/lisp/cedet/cedet-global.el | |||
| @@ -97,7 +97,7 @@ SCOPE is the scope of the search, such as 'project or 'subdirs." | |||
| 97 | ;; Check for warnings. | 97 | ;; Check for warnings. |
| 98 | (with-current-buffer b | 98 | (with-current-buffer b |
| 99 | (goto-char (point-min)) | 99 | (goto-char (point-min)) |
| 100 | (when (re-search-forward "Error\\|Warning" nil t) | 100 | (when (re-search-forward "Error\\|Warning\\|invalid" nil t) |
| 101 | (error "Output:\n%S" (buffer-string)))) | 101 | (error "Output:\n%S" (buffer-string)))) |
| 102 | 102 | ||
| 103 | b)) | 103 | b)) |
| @@ -186,12 +186,14 @@ If a database already exists, then just update it." | |||
| 186 | (let ((root (cedet-gnu-global-root dir))) | 186 | (let ((root (cedet-gnu-global-root dir))) |
| 187 | (if root (setq dir root)) | 187 | (if root (setq dir root)) |
| 188 | (let ((default-directory dir)) | 188 | (let ((default-directory dir)) |
| 189 | (cedet-gnu-global-gtags-call | 189 | (if root |
| 190 | (when root | 190 | ;; Incremental update. This can be either "gtags -i" or |
| 191 | '("-u");; Incremental update flag. | 191 | ;; "global -u"; the gtags manpage says it's better to use |
| 192 | )) | 192 | ;; "global -u". |
| 193 | ) | 193 | (cedet-gnu-global-call (list "-u")) |
| 194 | )) | 194 | (cedet-gnu-global-gtags-call nil) |
| 195 | ) | ||
| 196 | ))) | ||
| 195 | 197 | ||
| 196 | (provide 'cedet-global) | 198 | (provide 'cedet-global) |
| 197 | 199 | ||
diff --git a/lisp/cedet/ede/generic.el b/lisp/cedet/ede/generic.el index b865ff5028d..d3be545a158 100644 --- a/lisp/cedet/ede/generic.el +++ b/lisp/cedet/ede/generic.el | |||
| @@ -303,7 +303,7 @@ CLASS is the EIEIO class that is used to track this project. It should subclass | |||
| 303 | (ede-generic-new-autoloader "generic-cvs" "Generic CVS" | 303 | (ede-generic-new-autoloader "generic-cvs" "Generic CVS" |
| 304 | "CVS" 'ede-generic-vc-project) | 304 | "CVS" 'ede-generic-vc-project) |
| 305 | (ede-generic-new-autoloader "generic-mtn" "Generic Monotone" | 305 | (ede-generic-new-autoloader "generic-mtn" "Generic Monotone" |
| 306 | "_MTN/options" 'ede-generic-vc-project) | 306 | "_MTN" 'ede-generic-vc-project) |
| 307 | 307 | ||
| 308 | ;; Take advantage of existing 'projectile' based projects. | 308 | ;; Take advantage of existing 'projectile' based projects. |
| 309 | ;; @TODO - if projectile supports compile commands etc, can we | 309 | ;; @TODO - if projectile supports compile commands etc, can we |
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 2eba0216faf..21c1f1be394 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el | |||
| @@ -64,7 +64,7 @@ | |||
| 64 | (require 'ewoc) | 64 | (require 'ewoc) |
| 65 | (require 'find-func) | 65 | (require 'find-func) |
| 66 | (require 'help) | 66 | (require 'help) |
| 67 | 67 | (require 'pp) | |
| 68 | 68 | ||
| 69 | ;;; UI customization options. | 69 | ;;; UI customization options. |
| 70 | 70 | ||
| @@ -1300,7 +1300,8 @@ EXPECTEDP specifies whether the result was expected." | |||
| 1300 | (defun ert--pp-with-indentation-and-newline (object) | 1300 | (defun ert--pp-with-indentation-and-newline (object) |
| 1301 | "Pretty-print OBJECT, indenting it to the current column of point. | 1301 | "Pretty-print OBJECT, indenting it to the current column of point. |
| 1302 | Ensures a final newline is inserted." | 1302 | Ensures a final newline is inserted." |
| 1303 | (let ((begin (point))) | 1303 | (let ((begin (point)) |
| 1304 | (pp-escape-newlines nil)) | ||
| 1304 | (pp object (current-buffer)) | 1305 | (pp object (current-buffer)) |
| 1305 | (unless (bolp) (insert "\n")) | 1306 | (unless (bolp) (insert "\n")) |
| 1306 | (save-excursion | 1307 | (save-excursion |
diff --git a/lisp/emacs-lisp/map.el b/lisp/emacs-lisp/map.el index cc437e02e78..5ef51f12d96 100644 --- a/lisp/emacs-lisp/map.el +++ b/lisp/emacs-lisp/map.el | |||
| @@ -45,12 +45,12 @@ | |||
| 45 | (require 'seq) | 45 | (require 'seq) |
| 46 | 46 | ||
| 47 | (pcase-defmacro map (&rest args) | 47 | (pcase-defmacro map (&rest args) |
| 48 | "pcase pattern matching map elements. | 48 | "Build a `pcase' pattern matching map elements. |
| 49 | 49 | ||
| 50 | Matches if the object is a map (list, hash-table or array), and | 50 | The `pcase' pattern will match each element of PATTERN against |
| 51 | each PATTERN matches the corresponding elements of the map. | 51 | the corresponding elements of the map. |
| 52 | 52 | ||
| 53 | Supernumerary elements of the map are ignored if fewer ARGS are | 53 | Extra elements of the map are ignored if fewer ARGS are |
| 54 | given, and the match does not fail. | 54 | given, and the match does not fail. |
| 55 | 55 | ||
| 56 | ARGS can be a list of the form (KEY PAT), in which case KEY in an | 56 | ARGS can be a list of the form (KEY PAT), in which case KEY in an |
| @@ -92,7 +92,7 @@ Return RESULT if non-nil or the result of evaluation of the form." | |||
| 92 | (t (error "Unsupported map: %s" ,map-var))))) | 92 | (t (error "Unsupported map: %s" ,map-var))))) |
| 93 | 93 | ||
| 94 | (defun map-elt (map key &optional default) | 94 | (defun map-elt (map key &optional default) |
| 95 | "Perform a lookup in MAP of KEY and return its associated value. | 95 | "Lookup KEY in MAP and return its associated value. |
| 96 | If KEY is not found, return DEFAULT which defaults to nil. | 96 | If KEY is not found, return DEFAULT which defaults to nil. |
| 97 | 97 | ||
| 98 | If MAP is a list, `eql' is used to lookup KEY. | 98 | If MAP is a list, `eql' is used to lookup KEY. |
| @@ -122,7 +122,7 @@ MAP can be a list, hash-table or array." | |||
| 122 | default))) | 122 | default))) |
| 123 | 123 | ||
| 124 | (defmacro map-put (map key value) | 124 | (defmacro map-put (map key value) |
| 125 | "In MAP, associate KEY with VALUE and return MAP. | 125 | "Associate KEY with VALUE in MAP and return MAP. |
| 126 | If KEY is already present in MAP, replace the associated value | 126 | If KEY is already present in MAP, replace the associated value |
| 127 | with VALUE. | 127 | with VALUE. |
| 128 | 128 | ||
| @@ -133,8 +133,9 @@ MAP can be a list, hash-table or array." | |||
| 133 | ,map))) | 133 | ,map))) |
| 134 | 134 | ||
| 135 | (defmacro map-delete (map key) | 135 | (defmacro map-delete (map key) |
| 136 | "In MAP, delete the key KEY if present and return MAP. | 136 | "Delete KEY from MAP and return MAP. |
| 137 | If MAP is an array, store nil at the index KEY. | 137 | No error is signaled if KEY is not a key of MAP. If MAP is an |
| 138 | array, store nil at the index KEY. | ||
| 138 | 139 | ||
| 139 | MAP can be a list, hash-table or array." | 140 | MAP can be a list, hash-table or array." |
| 140 | (declare (debug t)) | 141 | (declare (debug t)) |
| @@ -245,7 +246,7 @@ MAP can be a list, hash-table or array." | |||
| 245 | (arrayp map))) | 246 | (arrayp map))) |
| 246 | 247 | ||
| 247 | (defun map-empty-p (map) | 248 | (defun map-empty-p (map) |
| 248 | "Return non-nil is MAP is empty. | 249 | "Return non-nil if MAP is empty. |
| 249 | 250 | ||
| 250 | MAP can be a list, hash-table or array." | 251 | MAP can be a list, hash-table or array." |
| 251 | (map--dispatch map | 252 | (map--dispatch map |
| @@ -254,7 +255,7 @@ MAP can be a list, hash-table or array." | |||
| 254 | :hash-table (zerop (hash-table-count map)))) | 255 | :hash-table (zerop (hash-table-count map)))) |
| 255 | 256 | ||
| 256 | (defun map-contains-key (map key &optional testfn) | 257 | (defun map-contains-key (map key &optional testfn) |
| 257 | "Return non-nil if MAP contain the key KEY, nil otherwise. | 258 | "Return non-nil if MAP contain KEY, nil otherwise. |
| 258 | Equality is defined by TESTFN if non-nil or by `equal' if nil. | 259 | Equality is defined by TESTFN if non-nil or by `equal' if nil. |
| 259 | 260 | ||
| 260 | MAP can be a list, hash-table or array." | 261 | MAP can be a list, hash-table or array." |
| @@ -284,7 +285,7 @@ MAP can be a list, hash-table or array." | |||
| 284 | t)) | 285 | t)) |
| 285 | 286 | ||
| 286 | (defun map-merge (type &rest maps) | 287 | (defun map-merge (type &rest maps) |
| 287 | "Merge into a map of type TYPE all the key/value pairs in the maps MAPS. | 288 | "Merge into a map of type TYPE all the key/value pairs in MAPS. |
| 288 | 289 | ||
| 289 | MAP can be a list, hash-table or array." | 290 | MAP can be a list, hash-table or array." |
| 290 | (let (result) | 291 | (let (result) |
diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index f5189c7dc97..d0c2d24b015 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el | |||
| @@ -61,305 +61,310 @@ | |||
| 61 | 61 | ||
| 62 | (defmacro seq-doseq (spec &rest body) | 62 | (defmacro seq-doseq (spec &rest body) |
| 63 | "Loop over a sequence. | 63 | "Loop over a sequence. |
| 64 | Similar to `dolist' but can be applied to lists, strings, and vectors. | 64 | Evaluate BODY with VAR bound to each element of SEQUENCE, in turn. |
| 65 | 65 | ||
| 66 | Evaluate BODY with VAR bound to each element of SEQ, in turn. | 66 | Similar to `dolist' but can be applied to lists, strings, and vectors. |
| 67 | 67 | ||
| 68 | \(fn (VAR SEQ) BODY...)" | 68 | \(fn (VAR SEQUENCE) BODY...)" |
| 69 | (declare (indent 1) (debug ((symbolp form &optional form) body))) | 69 | (declare (indent 1) (debug ((symbolp form &optional form) body))) |
| 70 | `(seq-do (lambda (,(car spec)) | 70 | `(seq-do (lambda (,(car spec)) |
| 71 | ,@body) | 71 | ,@body) |
| 72 | ,(cadr spec))) | 72 | ,(cadr spec))) |
| 73 | 73 | ||
| 74 | (pcase-defmacro seq (&rest patterns) | 74 | (pcase-defmacro seq (&rest patterns) |
| 75 | "pcase pattern matching sequence elements. | 75 | "Build a `pcase' pattern that matches elements of SEQUENCE. |
| 76 | 76 | ||
| 77 | Matches if the object is a sequence (list, string or vector), and | 77 | The `pcase' pattern will match each element of PATTERNS against the |
| 78 | each PATTERN matches the corresponding element of the sequence. | 78 | corresponding element of SEQUENCE. |
| 79 | 79 | ||
| 80 | Supernumerary elements of the sequence are ignored if fewer | 80 | Extra elements of the sequence are ignored if fewer PATTERNS are |
| 81 | PATTERNS are given, and the match does not fail." | 81 | given, and the match does not fail." |
| 82 | `(and (pred seq-p) | 82 | `(and (pred seq-p) |
| 83 | ,@(seq--make-pcase-bindings patterns))) | 83 | ,@(seq--make-pcase-bindings patterns))) |
| 84 | 84 | ||
| 85 | (defmacro seq-let (args seq &rest body) | 85 | (defmacro seq-let (args sequence &rest body) |
| 86 | "Bind the variables in ARGS to the elements of SEQ then evaluate BODY. | 86 | "Bind the variables in ARGS to the elements of SEQUENCE, then evaluate BODY. |
| 87 | 87 | ||
| 88 | ARGS can also include the `&rest' marker followed by a variable | 88 | ARGS can also include the `&rest' marker followed by a variable |
| 89 | name to be bound to the rest of SEQ." | 89 | name to be bound to the rest of SEQUENCE." |
| 90 | (declare (indent 2) (debug t)) | 90 | (declare (indent 2) (debug t)) |
| 91 | `(pcase-let ((,(seq--make-pcase-patterns args) ,seq)) | 91 | `(pcase-let ((,(seq--make-pcase-patterns args) ,sequence)) |
| 92 | ,@body)) | 92 | ,@body)) |
| 93 | 93 | ||
| 94 | 94 | ||
| 95 | ;;; Basic seq functions that have to be implemented by new seq types | 95 | ;;; Basic seq functions that have to be implemented by new sequence types |
| 96 | (cl-defgeneric seq-elt (seq n) | 96 | (cl-defgeneric seq-elt (sequence n) |
| 97 | "Return the element of SEQ at index N." | 97 | "Return Nth element of SEQUENCE." |
| 98 | (elt seq n)) | 98 | (elt sequence n)) |
| 99 | 99 | ||
| 100 | ;; Default gv setters for `seq-elt'. | 100 | ;; Default gv setters for `seq-elt'. |
| 101 | ;; It can be a good idea for new sequence implementations to provide a | 101 | ;; It can be a good idea for new sequence implementations to provide a |
| 102 | ;; "gv-setter" for `seq-elt'. | 102 | ;; "gv-setter" for `seq-elt'. |
| 103 | (cl-defmethod (setf seq-elt) (store (seq array) n) | 103 | (cl-defmethod (setf seq-elt) (store (sequence array) n) |
| 104 | (aset seq n store)) | 104 | (aset sequence n store)) |
| 105 | 105 | ||
| 106 | (cl-defmethod (setf seq-elt) (store (seq cons) n) | 106 | (cl-defmethod (setf seq-elt) (store (sequence cons) n) |
| 107 | (setcar (nthcdr n seq) store)) | 107 | (setcar (nthcdr n sequence) store)) |
| 108 | 108 | ||
| 109 | (cl-defgeneric seq-length (seq) | 109 | (cl-defgeneric seq-length (sequence) |
| 110 | "Return the length of the sequence SEQ." | 110 | "Return the number of elements of SEQUENCE." |
| 111 | (length seq)) | 111 | (length sequence)) |
| 112 | 112 | ||
| 113 | (cl-defgeneric seq-do (function seq) | 113 | (cl-defgeneric seq-do (function sequence) |
| 114 | "Apply FUNCTION to each element of SEQ, presumably for side effects. | 114 | "Apply FUNCTION to each element of SEQUENCE, presumably for side effects. |
| 115 | Return SEQ." | 115 | Return SEQUENCE." |
| 116 | (mapc function seq)) | 116 | (mapc function sequence)) |
| 117 | 117 | ||
| 118 | (defalias 'seq-each #'seq-do) | 118 | (defalias 'seq-each #'seq-do) |
| 119 | 119 | ||
| 120 | (cl-defgeneric seq-p (seq) | 120 | (cl-defgeneric seq-p (sequence) |
| 121 | "Return non-nil if SEQ is a sequence, nil otherwise." | 121 | "Return non-nil if SEQUENCE is a sequence, nil otherwise." |
| 122 | (sequencep seq)) | 122 | (sequencep sequence)) |
| 123 | 123 | ||
| 124 | (cl-defgeneric seq-copy (seq) | 124 | (cl-defgeneric seq-copy (sequence) |
| 125 | "Return a shallow copy of SEQ." | 125 | "Return a shallow copy of SEQUENCE." |
| 126 | (copy-sequence seq)) | 126 | (copy-sequence sequence)) |
| 127 | 127 | ||
| 128 | (cl-defgeneric seq-subseq (seq start &optional end) | 128 | (cl-defgeneric seq-subseq (sequence start &optional end) |
| 129 | "Return the subsequence of SEQ from START to END. | 129 | "Return the sequence of elements of SEQUENCE from START to END. |
| 130 | If END is omitted, it defaults to the length of the sequence. | 130 | END is inclusive. |
| 131 | If START or END is negative, it counts from the end. | 131 | |
| 132 | Signal an error if START or END are outside of the sequence (i.e | 132 | If END is omitted, it defaults to the length of the sequence. If |
| 133 | too large if positive or too small if negative)." | 133 | START or END is negative, it counts from the end. Signal an |
| 134 | (cl-subseq seq start end)) | 134 | error if START or END are outside of the sequence (i.e too large |
| 135 | if positive or too small if negative)." | ||
| 136 | (cl-subseq sequence start end)) | ||
| 135 | 137 | ||
| 136 | 138 | ||
| 137 | (cl-defgeneric seq-map (function seq) | 139 | (cl-defgeneric seq-map (function sequence) |
| 138 | "Return the result of applying FUNCTION to each element of SEQ." | 140 | "Return the result of applying FUNCTION to each element of SEQUENCE." |
| 139 | (let (result) | 141 | (let (result) |
| 140 | (seq-do (lambda (elt) | 142 | (seq-do (lambda (elt) |
| 141 | (push (funcall function elt) result)) | 143 | (push (funcall function elt) result)) |
| 142 | seq) | 144 | sequence) |
| 143 | (nreverse result))) | 145 | (nreverse result))) |
| 144 | 146 | ||
| 145 | ;; faster implementation for sequences (sequencep) | 147 | ;; faster implementation for sequences (sequencep) |
| 146 | (cl-defmethod seq-map (function (seq sequence)) | 148 | (cl-defmethod seq-map (function (sequence sequence)) |
| 147 | (mapcar function seq)) | 149 | (mapcar function sequence)) |
| 148 | 150 | ||
| 149 | (cl-defgeneric seq-drop (seq n) | 151 | (cl-defgeneric seq-drop (sequence n) |
| 150 | "Return a subsequence of SEQ without its first N elements. | 152 | "Remove the first N elements of SEQUENCE and return the result. |
| 151 | The result is a sequence of the same type as SEQ. | 153 | The result is a sequence of the same type as SEQUENCE. |
| 152 | 154 | ||
| 153 | If N is a negative integer or zero, SEQ is returned." | 155 | If N is a negative integer or zero, SEQUENCE is returned." |
| 154 | (if (<= n 0) | 156 | (if (<= n 0) |
| 155 | seq | 157 | sequence |
| 156 | (let ((length (seq-length seq))) | 158 | (let ((length (seq-length sequence))) |
| 157 | (seq-subseq seq (min n length) length)))) | 159 | (seq-subseq sequence (min n length) length)))) |
| 158 | 160 | ||
| 159 | (cl-defgeneric seq-take (seq n) | 161 | (cl-defgeneric seq-take (sequence n) |
| 160 | "Return a subsequence of SEQ with its first N elements. | 162 | "Take the first N elements of SEQUENCE and return the result. |
| 161 | The result is a sequence of the same type as SEQ. | 163 | The result is a sequence of the same type as SEQUENCE. |
| 162 | 164 | ||
| 163 | If N is a negative integer or zero, an empty sequence is | 165 | If N is a negative integer or zero, an empty sequence is |
| 164 | returned." | 166 | returned." |
| 165 | (seq-subseq seq 0 (min (max n 0) (seq-length seq)))) | 167 | (seq-subseq sequence 0 (min (max n 0) (seq-length sequence)))) |
| 166 | 168 | ||
| 167 | (cl-defgeneric seq-drop-while (pred seq) | 169 | (cl-defgeneric seq-drop-while (pred sequence) |
| 168 | "Return a sequence from the first element for which (PRED element) is nil in SEQ. | 170 | "Remove the successive elements of SEQUENCE for which PRED returns non-nil. |
| 169 | The result is a sequence of the same type as SEQ." | 171 | PRED is a function of one argument. The result is a sequence of |
| 170 | (seq-drop seq (seq--count-successive pred seq))) | 172 | the same type as SEQUENCE." |
| 171 | 173 | (seq-drop sequence (seq--count-successive pred sequence))) | |
| 172 | (cl-defgeneric seq-take-while (pred seq) | 174 | |
| 173 | "Return the successive elements for which (PRED element) is non-nil in SEQ. | 175 | (cl-defgeneric seq-take-while (pred sequence) |
| 174 | The result is a sequence of the same type as SEQ." | 176 | "Take the successive elements of SEQUENCE for which PRED returns non-nil. |
| 175 | (seq-take seq (seq--count-successive pred seq))) | 177 | PRED is a function of one argument. The result is a sequence of |
| 176 | 178 | the same type as SEQUENCE." | |
| 177 | (cl-defgeneric seq-empty-p (seq) | 179 | (seq-take sequence (seq--count-successive pred sequence))) |
| 178 | "Return non-nil if the sequence SEQ is empty, nil otherwise." | 180 | |
| 179 | (= 0 (seq-length seq))) | 181 | (cl-defgeneric seq-empty-p (sequence) |
| 180 | 182 | "Return non-nil if the SEQUENCE is empty, nil otherwise." | |
| 181 | (cl-defgeneric seq-sort (pred seq) | 183 | (= 0 (seq-length sequence))) |
| 182 | "Return a sorted sequence comparing using PRED the elements of SEQ. | 184 | |
| 183 | The result is a sequence of the same type as SEQ." | 185 | (cl-defgeneric seq-sort (pred sequence) |
| 184 | (let ((result (seq-sort pred (append seq nil)))) | 186 | "Sort SEQUENCE using PRED as comparison function. |
| 185 | (seq-into result (type-of seq)))) | 187 | The result is a sequence of the same type as SEQUENCE." |
| 188 | (let ((result (seq-sort pred (append sequence nil)))) | ||
| 189 | (seq-into result (type-of sequence)))) | ||
| 186 | 190 | ||
| 187 | (cl-defmethod seq-sort (pred (list list)) | 191 | (cl-defmethod seq-sort (pred (list list)) |
| 188 | (sort (seq-copy list) pred)) | 192 | (sort (seq-copy list) pred)) |
| 189 | 193 | ||
| 190 | (cl-defgeneric seq-reverse (seq) | 194 | (cl-defgeneric seq-reverse (sequence) |
| 191 | "Return the reversed shallow copy of SEQ." | 195 | "Return a sequence with elements of SEQUENCE in reverse order." |
| 192 | (let ((result '())) | 196 | (let ((result '())) |
| 193 | (seq-map (lambda (elt) | 197 | (seq-map (lambda (elt) |
| 194 | (push elt result)) | 198 | (push elt result)) |
| 195 | seq) | 199 | sequence) |
| 196 | (seq-into result (type-of seq)))) | 200 | (seq-into result (type-of sequence)))) |
| 197 | 201 | ||
| 198 | ;; faster implementation for sequences (sequencep) | 202 | ;; faster implementation for sequences (sequencep) |
| 199 | (cl-defmethod seq-reverse ((seq sequence)) | 203 | (cl-defmethod seq-reverse ((sequence sequence)) |
| 200 | (reverse seq)) | 204 | (reverse sequence)) |
| 201 | 205 | ||
| 202 | (cl-defgeneric seq-concatenate (type &rest seqs) | 206 | (cl-defgeneric seq-concatenate (type &rest sequences) |
| 203 | "Concatenate, into a sequence of type TYPE, the sequences SEQS. | 207 | "Concatenate SEQUENCES into a single sequence of type TYPE. |
| 204 | TYPE must be one of following symbols: vector, string or list. | 208 | TYPE must be one of following symbols: vector, string or list. |
| 205 | 209 | ||
| 206 | \n(fn TYPE SEQUENCE...)" | 210 | \n(fn TYPE SEQUENCE...)" |
| 207 | (apply #'cl-concatenate type (seq-map #'seq-into-sequence seqs))) | 211 | (apply #'cl-concatenate type (seq-map #'seq-into-sequence sequences))) |
| 208 | 212 | ||
| 209 | (cl-defgeneric seq-into-sequence (seq) | 213 | (cl-defgeneric seq-into-sequence (sequence) |
| 210 | "Convert SEQ into a sequence. | 214 | "Convert SEQUENCE into a sequence. |
| 211 | 215 | ||
| 212 | The default implementation is to signal an error if SEQ is not a | 216 | The default implementation is to signal an error if SEQUENCE is not a |
| 213 | sequence, specific functions should be implemented for new types | 217 | sequence, specific functions should be implemented for new types |
| 214 | of seq." | 218 | of sequence." |
| 215 | (unless (sequencep seq) | 219 | (unless (sequencep sequence) |
| 216 | (error "Cannot convert %S into a sequence" seq)) | 220 | (error "Cannot convert %S into a sequence" sequence)) |
| 217 | seq) | 221 | sequence) |
| 218 | 222 | ||
| 219 | (cl-defgeneric seq-into (seq type) | 223 | (cl-defgeneric seq-into (sequence type) |
| 220 | "Convert the sequence SEQ into a sequence of type TYPE. | 224 | "Concatenate the elements of SEQUENCE into a sequence of type TYPE. |
| 221 | TYPE can be one of the following symbols: vector, string or list." | 225 | TYPE can be one of the following symbols: vector, string or |
| 226 | list." | ||
| 222 | (pcase type | 227 | (pcase type |
| 223 | (`vector (vconcat seq)) | 228 | (`vector (vconcat sequence)) |
| 224 | (`string (concat seq)) | 229 | (`string (concat sequence)) |
| 225 | (`list (append seq nil)) | 230 | (`list (append sequence nil)) |
| 226 | (_ (error "Not a sequence type name: %S" type)))) | 231 | (_ (error "Not a sequence type name: %S" type)))) |
| 227 | 232 | ||
| 228 | (cl-defgeneric seq-filter (pred seq) | 233 | (cl-defgeneric seq-filter (pred sequence) |
| 229 | "Return a list of all the elements for which (PRED element) is non-nil in SEQ." | 234 | "Return a list of all the elements for which (PRED element) is non-nil in SEQUENCE." |
| 230 | (let ((exclude (make-symbol "exclude"))) | 235 | (let ((exclude (make-symbol "exclude"))) |
| 231 | (delq exclude (seq-map (lambda (elt) | 236 | (delq exclude (seq-map (lambda (elt) |
| 232 | (if (funcall pred elt) | 237 | (if (funcall pred elt) |
| 233 | elt | 238 | elt |
| 234 | exclude)) | 239 | exclude)) |
| 235 | seq)))) | 240 | sequence)))) |
| 236 | 241 | ||
| 237 | (cl-defgeneric seq-remove (pred seq) | 242 | (cl-defgeneric seq-remove (pred sequence) |
| 238 | "Return a list of all the elements for which (PRED element) is nil in SEQ." | 243 | "Return a list of all the elements for which (PRED element) is nil in SEQUENCE." |
| 239 | (seq-filter (lambda (elt) (not (funcall pred elt))) | 244 | (seq-filter (lambda (elt) (not (funcall pred elt))) |
| 240 | seq)) | 245 | sequence)) |
| 241 | 246 | ||
| 242 | (cl-defgeneric seq-reduce (function seq initial-value) | 247 | (cl-defgeneric seq-reduce (function sequence initial-value) |
| 243 | "Reduce the function FUNCTION across SEQ, starting with INITIAL-VALUE. | 248 | "Reduce the function FUNCTION across SEQUENCE, starting with INITIAL-VALUE. |
| 244 | 249 | ||
| 245 | Return the result of calling FUNCTION with INITIAL-VALUE and the | 250 | Return the result of calling FUNCTION with INITIAL-VALUE and the |
| 246 | first element of SEQ, then calling FUNCTION with that result and | 251 | first element of SEQUENCE, then calling FUNCTION with that result and |
| 247 | the second element of SEQ, then with that result and the third | 252 | the second element of SEQUENCE, then with that result and the third |
| 248 | element of SEQ, etc. | 253 | element of SEQUENCE, etc. |
| 249 | 254 | ||
| 250 | If SEQ is empty, return INITIAL-VALUE and FUNCTION is not called." | 255 | If SEQUENCE is empty, return INITIAL-VALUE and FUNCTION is not called." |
| 251 | (if (seq-empty-p seq) | 256 | (if (seq-empty-p sequence) |
| 252 | initial-value | 257 | initial-value |
| 253 | (let ((acc initial-value)) | 258 | (let ((acc initial-value)) |
| 254 | (seq-doseq (elt seq) | 259 | (seq-doseq (elt sequence) |
| 255 | (setq acc (funcall function acc elt))) | 260 | (setq acc (funcall function acc elt))) |
| 256 | acc))) | 261 | acc))) |
| 257 | 262 | ||
| 258 | (cl-defgeneric seq-every-p (pred seq) | 263 | (cl-defgeneric seq-every-p (pred sequence) |
| 259 | "Return non-nil if (PRED element) is non-nil for all elements of the sequence SEQ." | 264 | "Return non-nil if (PRED element) is non-nil for all elements of SEQUENCE." |
| 260 | (catch 'seq--break | 265 | (catch 'seq--break |
| 261 | (seq-doseq (elt seq) | 266 | (seq-doseq (elt sequence) |
| 262 | (or (funcall pred elt) | 267 | (or (funcall pred elt) |
| 263 | (throw 'seq--break nil))) | 268 | (throw 'seq--break nil))) |
| 264 | t)) | 269 | t)) |
| 265 | 270 | ||
| 266 | (cl-defgeneric seq-some (pred seq) | 271 | (cl-defgeneric seq-some (pred sequence) |
| 267 | "Return the first value for which if (PRED element) is non-nil for in SEQ." | 272 | "Return the first value for which if (PRED element) is non-nil for in SEQUENCE." |
| 268 | (catch 'seq--break | 273 | (catch 'seq--break |
| 269 | (seq-doseq (elt seq) | 274 | (seq-doseq (elt sequence) |
| 270 | (let ((result (funcall pred elt))) | 275 | (let ((result (funcall pred elt))) |
| 271 | (when result | 276 | (when result |
| 272 | (throw 'seq--break result)))) | 277 | (throw 'seq--break result)))) |
| 273 | nil)) | 278 | nil)) |
| 274 | 279 | ||
| 275 | (cl-defgeneric seq-find (pred seq &optional default) | 280 | (cl-defgeneric seq-find (pred sequence &optional default) |
| 276 | "Return the first element for which (PRED element) is non-nil in SEQ. | 281 | "Return the first element for which (PRED element) is non-nil in SEQUENCE. |
| 277 | If no element is found, return DEFAULT. | 282 | If no element is found, return DEFAULT. |
| 278 | 283 | ||
| 279 | Note that `seq-find' has an ambiguity if the found element is | 284 | Note that `seq-find' has an ambiguity if the found element is |
| 280 | identical to DEFAULT, as it cannot be known if an element was | 285 | identical to DEFAULT, as it cannot be known if an element was |
| 281 | found or not." | 286 | found or not." |
| 282 | (catch 'seq--break | 287 | (catch 'seq--break |
| 283 | (seq-doseq (elt seq) | 288 | (seq-doseq (elt sequence) |
| 284 | (when (funcall pred elt) | 289 | (when (funcall pred elt) |
| 285 | (throw 'seq--break elt))) | 290 | (throw 'seq--break elt))) |
| 286 | default)) | 291 | default)) |
| 287 | 292 | ||
| 288 | (cl-defgeneric seq-count (pred seq) | 293 | (cl-defgeneric seq-count (pred sequence) |
| 289 | "Return the number of elements for which (PRED element) is non-nil in SEQ." | 294 | "Return the number of elements for which (PRED element) is non-nil in SEQUENCE." |
| 290 | (let ((count 0)) | 295 | (let ((count 0)) |
| 291 | (seq-doseq (elt seq) | 296 | (seq-doseq (elt sequence) |
| 292 | (when (funcall pred elt) | 297 | (when (funcall pred elt) |
| 293 | (setq count (+ 1 count)))) | 298 | (setq count (+ 1 count)))) |
| 294 | count)) | 299 | count)) |
| 295 | 300 | ||
| 296 | (cl-defgeneric seq-contains (seq elt &optional testfn) | 301 | (cl-defgeneric seq-contains (sequence elt &optional testfn) |
| 297 | "Return the first element in SEQ that is equal to ELT. | 302 | "Return the first element in SEQUENCE that is equal to ELT. |
| 298 | Equality is defined by TESTFN if non-nil or by `equal' if nil." | 303 | Equality is defined by TESTFN if non-nil or by `equal' if nil." |
| 299 | (seq-some (lambda (e) | 304 | (seq-some (lambda (e) |
| 300 | (funcall (or testfn #'equal) elt e)) | 305 | (funcall (or testfn #'equal) elt e)) |
| 301 | seq)) | 306 | sequence)) |
| 302 | 307 | ||
| 303 | (cl-defgeneric seq-position (seq elt &optional testfn) | 308 | (cl-defgeneric seq-position (sequence elt &optional testfn) |
| 304 | "Return the index of the first element in SEQ that is equal to ELT. | 309 | "Return the index of the first element in SEQUENCE that is equal to ELT. |
| 305 | Equality is defined by TESTFN if non-nil or by `equal' if nil." | 310 | Equality is defined by TESTFN if non-nil or by `equal' if nil." |
| 306 | (let ((index 0)) | 311 | (let ((index 0)) |
| 307 | (catch 'seq--break | 312 | (catch 'seq--break |
| 308 | (seq-doseq (e seq) | 313 | (seq-doseq (e sequence) |
| 309 | (when (funcall (or testfn #'equal) e elt) | 314 | (when (funcall (or testfn #'equal) e elt) |
| 310 | (throw 'seq--break index)) | 315 | (throw 'seq--break index)) |
| 311 | (setq index (1+ index))) | 316 | (setq index (1+ index))) |
| 312 | nil))) | 317 | nil))) |
| 313 | 318 | ||
| 314 | (cl-defgeneric seq-uniq (seq &optional testfn) | 319 | (cl-defgeneric seq-uniq (sequence &optional testfn) |
| 315 | "Return a list of the elements of SEQ with duplicates removed. | 320 | "Return a list of the elements of SEQUENCE with duplicates removed. |
| 316 | TESTFN is used to compare elements, or `equal' if TESTFN is nil." | 321 | TESTFN is used to compare elements, or `equal' if TESTFN is nil." |
| 317 | (let ((result '())) | 322 | (let ((result '())) |
| 318 | (seq-doseq (elt seq) | 323 | (seq-doseq (elt sequence) |
| 319 | (unless (seq-contains result elt testfn) | 324 | (unless (seq-contains result elt testfn) |
| 320 | (setq result (cons elt result)))) | 325 | (setq result (cons elt result)))) |
| 321 | (nreverse result))) | 326 | (nreverse result))) |
| 322 | 327 | ||
| 323 | (cl-defgeneric seq-mapcat (function seq &optional type) | 328 | (cl-defgeneric seq-mapcat (function sequence &optional type) |
| 324 | "Concatenate the result of applying FUNCTION to each element of SEQ. | 329 | "Concatenate the result of applying FUNCTION to each element of SEQUENCE. |
| 325 | The result is a sequence of type TYPE, or a list if TYPE is nil." | 330 | The result is a sequence of type TYPE, or a list if TYPE is nil." |
| 326 | (apply #'seq-concatenate (or type 'list) | 331 | (apply #'seq-concatenate (or type 'list) |
| 327 | (seq-map function seq))) | 332 | (seq-map function sequence))) |
| 328 | 333 | ||
| 329 | (cl-defgeneric seq-partition (seq n) | 334 | (cl-defgeneric seq-partition (sequence n) |
| 330 | "Return a list of the elements of SEQ grouped into sub-sequences of length N. | 335 | "Return a list of the elements of SEQUENCE grouped into sub-sequences of length N. |
| 331 | The last sequence may contain less than N elements. If N is a | 336 | The last sequence may contain less than N elements. If N is a |
| 332 | negative integer or 0, nil is returned." | 337 | negative integer or 0, nil is returned." |
| 333 | (unless (< n 1) | 338 | (unless (< n 1) |
| 334 | (let ((result '())) | 339 | (let ((result '())) |
| 335 | (while (not (seq-empty-p seq)) | 340 | (while (not (seq-empty-p sequence)) |
| 336 | (push (seq-take seq n) result) | 341 | (push (seq-take sequence n) result) |
| 337 | (setq seq (seq-drop seq n))) | 342 | (setq sequence (seq-drop sequence n))) |
| 338 | (nreverse result)))) | 343 | (nreverse result)))) |
| 339 | 344 | ||
| 340 | (cl-defgeneric seq-intersection (seq1 seq2 &optional testfn) | 345 | (cl-defgeneric seq-intersection (sequence1 sequence2 &optional testfn) |
| 341 | "Return a list of the elements that appear in both SEQ1 and SEQ2. | 346 | "Return a list of the elements that appear in both SEQUENCE1 and SEQUENCE2. |
| 342 | Equality is defined by TESTFN if non-nil or by `equal' if nil." | 347 | Equality is defined by TESTFN if non-nil or by `equal' if nil." |
| 343 | (seq-reduce (lambda (acc elt) | 348 | (seq-reduce (lambda (acc elt) |
| 344 | (if (seq-contains seq2 elt testfn) | 349 | (if (seq-contains sequence2 elt testfn) |
| 345 | (cons elt acc) | 350 | (cons elt acc) |
| 346 | acc)) | 351 | acc)) |
| 347 | (seq-reverse seq1) | 352 | (seq-reverse sequence1) |
| 348 | '())) | 353 | '())) |
| 349 | 354 | ||
| 350 | (cl-defgeneric seq-difference (seq1 seq2 &optional testfn) | 355 | (cl-defgeneric seq-difference (sequence1 sequence2 &optional testfn) |
| 351 | "Return a list of the elements that appear in SEQ1 but not in SEQ2. | 356 | "Return a list of the elements that appear in SEQUENCE1 but not in SEQUENCE2. |
| 352 | Equality is defined by TESTFN if non-nil or by `equal' if nil." | 357 | Equality is defined by TESTFN if non-nil or by `equal' if nil." |
| 353 | (seq-reduce (lambda (acc elt) | 358 | (seq-reduce (lambda (acc elt) |
| 354 | (if (not (seq-contains seq2 elt testfn)) | 359 | (if (not (seq-contains sequence2 elt testfn)) |
| 355 | (cons elt acc) | 360 | (cons elt acc) |
| 356 | acc)) | 361 | acc)) |
| 357 | (seq-reverse seq1) | 362 | (seq-reverse sequence1) |
| 358 | '())) | 363 | '())) |
| 359 | 364 | ||
| 360 | (cl-defgeneric seq-group-by (function seq) | 365 | (cl-defgeneric seq-group-by (function sequence) |
| 361 | "Apply FUNCTION to each element of SEQ. | 366 | "Apply FUNCTION to each element of SEQUENCE. |
| 362 | Separate the elements of SEQ into an alist using the results as | 367 | Separate the elements of SEQUENCE into an alist using the results as |
| 363 | keys. Keys are compared using `equal'." | 368 | keys. Keys are compared using `equal'." |
| 364 | (seq-reduce | 369 | (seq-reduce |
| 365 | (lambda (acc elt) | 370 | (lambda (acc elt) |
| @@ -369,25 +374,25 @@ keys. Keys are compared using `equal'." | |||
| 369 | (setcdr cell (push elt (cdr cell))) | 374 | (setcdr cell (push elt (cdr cell))) |
| 370 | (push (list key elt) acc)) | 375 | (push (list key elt) acc)) |
| 371 | acc)) | 376 | acc)) |
| 372 | (seq-reverse seq) | 377 | (seq-reverse sequence) |
| 373 | nil)) | 378 | nil)) |
| 374 | 379 | ||
| 375 | (cl-defgeneric seq-min (seq) | 380 | (cl-defgeneric seq-min (sequence) |
| 376 | "Return the smallest element of SEQ. | 381 | "Return the smallest element of SEQUENCE. |
| 377 | SEQ must be a sequence of numbers or markers." | 382 | SEQUENCE must be a sequence of numbers or markers." |
| 378 | (apply #'min (seq-into seq 'list))) | 383 | (apply #'min (seq-into sequence 'list))) |
| 379 | 384 | ||
| 380 | (cl-defgeneric seq-max (seq) | 385 | (cl-defgeneric seq-max (sequence) |
| 381 | "Return the largest element of SEQ. | 386 | "Return the largest element of SEQUENCE. |
| 382 | SEQ must be a sequence of numbers or markers." | 387 | SEQUENCE must be a sequence of numbers or markers." |
| 383 | (apply #'max (seq-into seq 'list))) | 388 | (apply #'max (seq-into sequence 'list))) |
| 384 | 389 | ||
| 385 | (defun seq--count-successive (pred seq) | 390 | (defun seq--count-successive (pred sequence) |
| 386 | "Return the number of successive elements for which (PRED element) is non-nil in SEQ." | 391 | "Return the number of successive elements for which (PRED element) is non-nil in SEQUENCE." |
| 387 | (let ((n 0) | 392 | (let ((n 0) |
| 388 | (len (seq-length seq))) | 393 | (len (seq-length sequence))) |
| 389 | (while (and (< n len) | 394 | (while (and (< n len) |
| 390 | (funcall pred (seq-elt seq n))) | 395 | (funcall pred (seq-elt sequence n))) |
| 391 | (setq n (+ 1 n))) | 396 | (setq n (+ 1 n))) |
| 392 | n)) | 397 | n)) |
| 393 | 398 | ||
| @@ -419,10 +424,10 @@ SEQ must be a sequence of numbers or markers." | |||
| 419 | args))) | 424 | args))) |
| 420 | 425 | ||
| 421 | ;; TODO: make public? | 426 | ;; TODO: make public? |
| 422 | (defun seq--elt-safe (seq n) | 427 | (defun seq--elt-safe (sequence n) |
| 423 | "Return element of SEQ at the index N. | 428 | "Return element of SEQUENCE at the index N. |
| 424 | If no element is found, return nil." | 429 | If no element is found, return nil." |
| 425 | (ignore-errors (seq-elt seq n))) | 430 | (ignore-errors (seq-elt sequence n))) |
| 426 | 431 | ||
| 427 | 432 | ||
| 428 | ;;; Optimized implementations for lists | 433 | ;;; Optimized implementations for lists |
diff --git a/lisp/emacs-lisp/thunk.el b/lisp/emacs-lisp/thunk.el index d07b25736aa..0c5816a616d 100644 --- a/lisp/emacs-lisp/thunk.el +++ b/lisp/emacs-lisp/thunk.el | |||
| @@ -57,8 +57,8 @@ | |||
| 57 | ,forced | 57 | ,forced |
| 58 | (unless ,forced | 58 | (unless ,forced |
| 59 | (setf ,val (progn ,@body)) | 59 | (setf ,val (progn ,@body)) |
| 60 | (setf ,forced t))) | 60 | (setf ,forced t)) |
| 61 | ,val)))) | 61 | ,val))))) |
| 62 | 62 | ||
| 63 | (defun thunk-force (delayed) | 63 | (defun thunk-force (delayed) |
| 64 | "Force the evaluation of DELAYED. | 64 | "Force the evaluation of DELAYED. |
diff --git a/lisp/filenotify.el b/lisp/filenotify.el index 55d9028f252..6a180a86570 100644 --- a/lisp/filenotify.el +++ b/lisp/filenotify.el | |||
| @@ -48,32 +48,33 @@ The value in the hash table is a list | |||
| 48 | Several values for a given DIR happen only for `inotify', when | 48 | Several values for a given DIR happen only for `inotify', when |
| 49 | different files from the same directory are watched.") | 49 | different files from the same directory are watched.") |
| 50 | 50 | ||
| 51 | (defun file-notify--rm-descriptor (descriptor) | 51 | (defun file-notify--rm-descriptor (descriptor &optional what) |
| 52 | "Remove DESCRIPTOR from `file-notify-descriptors'. | 52 | "Remove DESCRIPTOR from `file-notify-descriptors'. |
| 53 | DESCRIPTOR should be an object returned by `file-notify-add-watch'. | 53 | DESCRIPTOR should be an object returned by `file-notify-add-watch'. |
| 54 | If it is registered in `file-notify-descriptors', a stopped event is sent." | 54 | If it is registered in `file-notify-descriptors', a stopped event is sent. |
| 55 | WHAT is a file or directory name to be removed, needed just for `inotify'." | ||
| 55 | (let* ((desc (if (consp descriptor) (car descriptor) descriptor)) | 56 | (let* ((desc (if (consp descriptor) (car descriptor) descriptor)) |
| 56 | (file (if (consp descriptor) (cdr descriptor))) | 57 | (file (if (consp descriptor) (cdr descriptor))) |
| 57 | (registered (gethash desc file-notify-descriptors)) | 58 | (registered (gethash desc file-notify-descriptors)) |
| 58 | (dir (car registered))) | 59 | (dir (car registered))) |
| 59 | 60 | ||
| 60 | (when (consp registered) | 61 | (when (and (consp registered) (or (null what) (string-equal dir what))) |
| 61 | ;; Send `stopped' event. | 62 | ;; Send `stopped' event. |
| 62 | (dolist (entry (cdr registered)) | 63 | (dolist (entry (cdr registered)) |
| 63 | (funcall (cdr entry) | 64 | (funcall (cdr entry) |
| 64 | `(,(file-notify--descriptor desc) stopped | 65 | `(,(file-notify--descriptor desc) stopped |
| 65 | ,(or (and (stringp (car entry)) | 66 | ,(or (and (stringp (car entry)) |
| 66 | (expand-file-name (car entry) dir)) | 67 | (expand-file-name (car entry) dir)) |
| 67 | dir)))) | 68 | dir)))) |
| 68 | 69 | ||
| 69 | ;; Modify `file-notify-descriptors'. | 70 | ;; Modify `file-notify-descriptors'. |
| 70 | (if (not file) | 71 | (if (not file) |
| 71 | (remhash desc file-notify-descriptors) | 72 | (remhash desc file-notify-descriptors) |
| 72 | (setcdr registered | 73 | (setcdr registered |
| 73 | (delete (assoc file (cdr registered)) (cdr registered))) | 74 | (delete (assoc file (cdr registered)) (cdr registered))) |
| 74 | (if (null (cdr registered)) | 75 | (if (null (cdr registered)) |
| 75 | (remhash desc file-notify-descriptors) | 76 | (remhash desc file-notify-descriptors) |
| 76 | (puthash desc registered file-notify-descriptors)))))) | 77 | (puthash desc registered file-notify-descriptors)))))) |
| 77 | 78 | ||
| 78 | ;; This function is used by `gfilenotify', `inotify' and `w32notify' events. | 79 | ;; This function is used by `gfilenotify', `inotify' and `w32notify' events. |
| 79 | ;;;###autoload | 80 | ;;;###autoload |
| @@ -85,6 +86,7 @@ If EVENT is a filewatch event, call its callback. It has the format | |||
| 85 | 86 | ||
| 86 | Otherwise, signal a `file-notify-error'." | 87 | Otherwise, signal a `file-notify-error'." |
| 87 | (interactive "e") | 88 | (interactive "e") |
| 89 | ;;(message "file-notify-handle-event %S" event) | ||
| 88 | (if (and (eq (car event) 'file-notify) | 90 | (if (and (eq (car event) 'file-notify) |
| 89 | (>= (length event) 3)) | 91 | (>= (length event) 3)) |
| 90 | (funcall (nth 2 event) (nth 1 event)) | 92 | (funcall (nth 2 event) (nth 1 event)) |
| @@ -224,6 +226,7 @@ EVENT is the cadr of the event in `file-notify-handle-event' | |||
| 224 | (setq pending-event nil)) | 226 | (setq pending-event nil)) |
| 225 | 227 | ||
| 226 | ;; Check for stopped. | 228 | ;; Check for stopped. |
| 229 | ;;(message "file-notify-callback %S %S" file registered) | ||
| 227 | (setq | 230 | (setq |
| 228 | stopped | 231 | stopped |
| 229 | (or | 232 | (or |
| @@ -232,7 +235,9 @@ EVENT is the cadr of the event in `file-notify-handle-event' | |||
| 232 | (memq action '(deleted renamed)) | 235 | (memq action '(deleted renamed)) |
| 233 | (= (length (cdr registered)) 1) | 236 | (= (length (cdr registered)) 1) |
| 234 | (string-equal | 237 | (string-equal |
| 235 | (or (file-name-nondirectory file) "") (car (cadr registered)))))) | 238 | (file-name-nondirectory file) |
| 239 | (or (file-name-nondirectory (car registered)) | ||
| 240 | (car (cadr registered))))))) | ||
| 236 | 241 | ||
| 237 | ;; Apply callback. | 242 | ;; Apply callback. |
| 238 | (when (and action | 243 | (when (and action |
| @@ -257,7 +262,7 @@ EVENT is the cadr of the event in `file-notify-handle-event' | |||
| 257 | 262 | ||
| 258 | ;; Modify `file-notify-descriptors'. | 263 | ;; Modify `file-notify-descriptors'. |
| 259 | (when stopped | 264 | (when stopped |
| 260 | (file-notify--rm-descriptor (file-notify--descriptor desc)))))) | 265 | (file-notify--rm-descriptor (file-notify--descriptor desc) file))))) |
| 261 | 266 | ||
| 262 | ;; `gfilenotify' and `w32notify' return a unique descriptor for every | 267 | ;; `gfilenotify' and `w32notify' return a unique descriptor for every |
| 263 | ;; `file-notify-add-watch', while `inotify' returns a unique | 268 | ;; `file-notify-add-watch', while `inotify' returns a unique |
| @@ -324,8 +329,8 @@ FILE is the name of the file whose event is being reported." | |||
| 324 | (setq desc (funcall | 329 | (setq desc (funcall |
| 325 | handler 'file-notify-add-watch dir flags callback)) | 330 | handler 'file-notify-add-watch dir flags callback)) |
| 326 | 331 | ||
| 327 | ;; Check, whether Emacs has been compiled with file | 332 | ;; Check, whether Emacs has been compiled with file notification |
| 328 | ;; notification support. | 333 | ;; support. |
| 329 | (unless file-notify--library | 334 | (unless file-notify--library |
| 330 | (signal 'file-notify-error | 335 | (signal 'file-notify-error |
| 331 | '("No file notification package available"))) | 336 | '("No file notification package available"))) |
| @@ -344,7 +349,8 @@ FILE is the name of the file whose event is being reported." | |||
| 344 | (setq | 349 | (setq |
| 345 | l-flags | 350 | l-flags |
| 346 | (cond | 351 | (cond |
| 347 | ((eq file-notify--library 'inotify) '(create modify move delete)) | 352 | ((eq file-notify--library 'inotify) |
| 353 | '(create delete delete-self modify move-self move)) | ||
| 348 | ((eq file-notify--library 'w32notify) | 354 | ((eq file-notify--library 'w32notify) |
| 349 | '(file-name directory-name size last-write-time))))) | 355 | '(file-name directory-name size last-write-time))))) |
| 350 | (when (memq 'attribute-change flags) | 356 | (when (memq 'attribute-change flags) |
diff --git a/lisp/gnus/gnus-topic.el b/lisp/gnus/gnus-topic.el index 7c6e1098100..b9897832517 100644 --- a/lisp/gnus/gnus-topic.el +++ b/lisp/gnus/gnus-topic.el | |||
| @@ -508,7 +508,6 @@ articles in the topic and its subtopics." | |||
| 508 | (all-entries entries) | 508 | (all-entries entries) |
| 509 | (point-max (point-max)) | 509 | (point-max (point-max)) |
| 510 | (unread 0) | 510 | (unread 0) |
| 511 | (topic (car type)) | ||
| 512 | info entry end active tick) | 511 | info entry end active tick) |
| 513 | ;; Insert any sub-topics. | 512 | ;; Insert any sub-topics. |
| 514 | (while topicl | 513 | (while topicl |
| @@ -586,7 +585,7 @@ articles in the topic and its subtopics." | |||
| 586 | (goto-char end) | 585 | (goto-char end) |
| 587 | unread)) | 586 | unread)) |
| 588 | 587 | ||
| 589 | (defun gnus-topic-remove-topic (&optional insert total-remove hide in-level) | 588 | (defun gnus-topic-remove-topic (&optional insert total-remove _hide in-level) |
| 590 | "Remove the current topic." | 589 | "Remove the current topic." |
| 591 | (let ((topic (gnus-group-topic-name)) | 590 | (let ((topic (gnus-group-topic-name)) |
| 592 | (level (gnus-group-topic-level)) | 591 | (level (gnus-group-topic-level)) |
| @@ -631,6 +630,8 @@ articles in the topic and its subtopics." | |||
| 631 | (or insert (not (gnus-topic-visible-p))) nil nil 9) | 630 | (or insert (not (gnus-topic-visible-p))) nil nil 9) |
| 632 | (gnus-topic-enter-dribble))))))) | 631 | (gnus-topic-enter-dribble))))))) |
| 633 | 632 | ||
| 633 | (defvar gnus-tmp-header) | ||
| 634 | |||
| 634 | (defun gnus-topic-insert-topic-line (name visiblep shownp level entries | 635 | (defun gnus-topic-insert-topic-line (name visiblep shownp level entries |
| 635 | &optional unread) | 636 | &optional unread) |
| 636 | (let* ((visible (if visiblep "" "...")) | 637 | (let* ((visible (if visiblep "" "...")) |
| @@ -694,8 +695,7 @@ articles in the topic and its subtopics." | |||
| 694 | (let* ((topic (gnus-group-topic group)) | 695 | (let* ((topic (gnus-group-topic group)) |
| 695 | (groups (cdr (assoc topic gnus-topic-alist))) | 696 | (groups (cdr (assoc topic gnus-topic-alist))) |
| 696 | (g (cdr (member group groups))) | 697 | (g (cdr (member group groups))) |
| 697 | (unfound t) | 698 | (unfound t)) |
| 698 | entry) | ||
| 699 | ;; Try to jump to a visible group. | 699 | ;; Try to jump to a visible group. |
| 700 | (while (and g | 700 | (while (and g |
| 701 | (not (gnus-group-goto-group (car g) t))) | 701 | (not (gnus-group-goto-group (car g) t))) |
| @@ -1454,7 +1454,7 @@ If NON-RECURSIVE (which is the prefix) is t, don't mark its subtopics." | |||
| 1454 | (funcall (if unmark 'gnus-group-remove-mark 'gnus-group-set-mark) | 1454 | (funcall (if unmark 'gnus-group-remove-mark 'gnus-group-set-mark) |
| 1455 | (gnus-info-group (nth 2 (pop groups))))))))) | 1455 | (gnus-info-group (nth 2 (pop groups))))))))) |
| 1456 | 1456 | ||
| 1457 | (defun gnus-topic-unmark-topic (topic &optional dummy non-recursive) | 1457 | (defun gnus-topic-unmark-topic (topic &optional _dummy non-recursive) |
| 1458 | "Remove the process mark from all groups in the TOPIC. | 1458 | "Remove the process mark from all groups in the TOPIC. |
| 1459 | If NON-RECURSIVE (which is the prefix) is t, don't unmark its subtopics." | 1459 | If NON-RECURSIVE (which is the prefix) is t, don't unmark its subtopics." |
| 1460 | (interactive (list (gnus-group-topic-name) | 1460 | (interactive (list (gnus-group-topic-name) |
| @@ -1488,15 +1488,14 @@ If NON-RECURSIVE (which is the prefix) is t, don't unmark its subtopics." | |||
| 1488 | (gnus-group-mark-regexp regexp) | 1488 | (gnus-group-mark-regexp regexp) |
| 1489 | (gnus-topic-move-group nil topic copyp)) | 1489 | (gnus-topic-move-group nil topic copyp)) |
| 1490 | 1490 | ||
| 1491 | (defun gnus-topic-copy-matching (regexp topic &optional copyp) | 1491 | (defun gnus-topic-copy-matching (regexp topic &optional _copyp) |
| 1492 | "Copy all groups that match REGEXP to some topic." | 1492 | "Copy all groups that match REGEXP to some topic." |
| 1493 | (interactive | 1493 | (interactive |
| 1494 | (let (topic) | 1494 | (let ((topic (gnus-completing-read "Copy to topic" |
| 1495 | (mapcar #'car gnus-topic-alist) t))) | ||
| 1495 | (nreverse | 1496 | (nreverse |
| 1496 | (list | 1497 | (list topic |
| 1497 | (setq topic (gnus-completing-read "Copy to topic" | 1498 | (read-string (format "Copy to %s (regexp): " topic)))))) |
| 1498 | (mapcar 'car gnus-topic-alist) t)) | ||
| 1499 | (read-string (format "Copy to %s (regexp): " topic)))))) | ||
| 1500 | (gnus-topic-move-matching regexp topic t)) | 1499 | (gnus-topic-move-matching regexp topic t)) |
| 1501 | 1500 | ||
| 1502 | (defun gnus-topic-delete (topic) | 1501 | (defun gnus-topic-delete (topic) |
diff --git a/lisp/help.el b/lisp/help.el index 3387628fb8a..c558b652b7e 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -1394,9 +1394,10 @@ ARGLIST can also be t or a string of the form \"(FUN ARG1 ARG2 ...)\"." | |||
| 1394 | (if (string-match "\n?\n\\'" docstring) | 1394 | (if (string-match "\n?\n\\'" docstring) |
| 1395 | (if (< (- (match-end 0) (match-beginning 0)) 2) "\n" "") | 1395 | (if (< (- (match-end 0) (match-beginning 0)) 2) "\n" "") |
| 1396 | "\n\n") | 1396 | "\n\n") |
| 1397 | (if (and (stringp arglist) | 1397 | (if (stringp arglist) |
| 1398 | (string-match "\\`([^ ]+\\(.*\\))\\'" arglist)) | 1398 | (if (string-match "\\`[^ ]+\\(.*\\))\\'" arglist) |
| 1399 | (concat "(fn" (match-string 1 arglist) ")") | 1399 | (concat "(fn" (match-string 1 arglist) ")") |
| 1400 | (error "Unrecognized usage format")) | ||
| 1400 | (help--make-usage-docstring 'fn arglist))))) | 1401 | (help--make-usage-docstring 'fn arglist))))) |
| 1401 | 1402 | ||
| 1402 | (defun help-function-arglist (def &optional preserve-names) | 1403 | (defun help-function-arglist (def &optional preserve-names) |
diff --git a/lisp/international/ccl.el b/lisp/international/ccl.el index daba2b6ed09..2fcbc884b35 100644 --- a/lisp/international/ccl.el +++ b/lisp/international/ccl.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; ccl.el --- CCL (Code Conversion Language) compiler | 1 | ;;; ccl.el --- CCL (Code Conversion Language) compiler -*- lexical-binding:t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1997-1998, 2001-2015 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1997-1998, 2001-2015 Free Software Foundation, Inc. |
| 4 | ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, | 4 | ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
| @@ -479,8 +479,7 @@ If READ-FLAG is non-nil, this statement has the form | |||
| 479 | (let ((condition (nth 1 cmd)) | 479 | (let ((condition (nth 1 cmd)) |
| 480 | (true-cmds (nth 2 cmd)) | 480 | (true-cmds (nth 2 cmd)) |
| 481 | (false-cmds (nth 3 cmd)) | 481 | (false-cmds (nth 3 cmd)) |
| 482 | jump-cond-address | 482 | jump-cond-address) |
| 483 | false-ic) | ||
| 484 | (if (and (listp condition) | 483 | (if (and (listp condition) |
| 485 | (listp (car condition))) | 484 | (listp (car condition))) |
| 486 | ;; If CONDITION is a nested expression, the inner expression | 485 | ;; If CONDITION is a nested expression, the inner expression |
| @@ -678,8 +677,7 @@ is a list of CCL-BLOCKs." | |||
| 678 | (ccl-embed-code 'write-const-jump 0 ccl-loop-head) | 677 | (ccl-embed-code 'write-const-jump 0 ccl-loop-head) |
| 679 | (ccl-embed-data arg)) | 678 | (ccl-embed-data arg)) |
| 680 | ((stringp arg) | 679 | ((stringp arg) |
| 681 | (let ((len (length arg)) | 680 | (let ((len (length arg))) |
| 682 | (i 0)) | ||
| 683 | (ccl-embed-code 'write-string-jump 0 ccl-loop-head) | 681 | (ccl-embed-code 'write-string-jump 0 ccl-loop-head) |
| 684 | (ccl-embed-data len) | 682 | (ccl-embed-data len) |
| 685 | (ccl-embed-string len arg))) | 683 | (ccl-embed-string len arg))) |
| @@ -920,8 +918,7 @@ is a list of CCL-BLOCKs." | |||
| 920 | (error "CCL: Invalid number of arguments: %s" cmd)) | 918 | (error "CCL: Invalid number of arguments: %s" cmd)) |
| 921 | (let ((RRR (nth 1 cmd)) | 919 | (let ((RRR (nth 1 cmd)) |
| 922 | (rrr (nth 2 cmd)) | 920 | (rrr (nth 2 cmd)) |
| 923 | (map (nth 3 cmd)) | 921 | (map (nth 3 cmd))) |
| 924 | id) | ||
| 925 | (ccl-check-register rrr cmd) | 922 | (ccl-check-register rrr cmd) |
| 926 | (ccl-check-register RRR cmd) | 923 | (ccl-check-register RRR cmd) |
| 927 | (ccl-embed-extended-command 'map-single rrr RRR 0) | 924 | (ccl-embed-extended-command 'map-single rrr RRR 0) |
| @@ -962,10 +959,11 @@ is a list of CCL-BLOCKs." | |||
| 962 | (defvar ccl-code) | 959 | (defvar ccl-code) |
| 963 | 960 | ||
| 964 | ;;;###autoload | 961 | ;;;###autoload |
| 965 | (defun ccl-dump (ccl-code) | 962 | (defun ccl-dump (code) |
| 966 | "Disassemble compiled CCL-CODE." | 963 | "Disassemble compiled CCL-code CODE." |
| 967 | (let ((len (length ccl-code)) | 964 | (let* ((ccl-code code) |
| 968 | (buffer-mag (aref ccl-code 0))) | 965 | (len (length ccl-code)) |
| 966 | (buffer-mag (aref ccl-code 0))) | ||
| 969 | (cond ((= buffer-mag 0) | 967 | (cond ((= buffer-mag 0) |
| 970 | (insert (substitute-command-keys "Don't output anything.\n"))) | 968 | (insert (substitute-command-keys "Don't output anything.\n"))) |
| 971 | ((= buffer-mag 1) | 969 | ((= buffer-mag 1) |
| @@ -1005,7 +1003,7 @@ is a list of CCL-BLOCKs." | |||
| 1005 | (defun ccl-dump-set-short-const (rrr cc) | 1003 | (defun ccl-dump-set-short-const (rrr cc) |
| 1006 | (insert (format "r%d = %d\n" rrr cc))) | 1004 | (insert (format "r%d = %d\n" rrr cc))) |
| 1007 | 1005 | ||
| 1008 | (defun ccl-dump-set-const (rrr ignore) | 1006 | (defun ccl-dump-set-const (rrr _ignore) |
| 1009 | (insert (format "r%d = %d\n" rrr (ccl-get-next-code)))) | 1007 | (insert (format "r%d = %d\n" rrr (ccl-get-next-code)))) |
| 1010 | 1008 | ||
| 1011 | (defun ccl-dump-set-array (rrr cc) | 1009 | (defun ccl-dump-set-array (rrr cc) |
| @@ -1019,7 +1017,7 @@ is a list of CCL-BLOCKs." | |||
| 1019 | (setq i (1+ i))) | 1017 | (setq i (1+ i))) |
| 1020 | (insert "\n"))) | 1018 | (insert "\n"))) |
| 1021 | 1019 | ||
| 1022 | (defun ccl-dump-jump (ignore cc &optional address) | 1020 | (defun ccl-dump-jump (_ignore cc &optional address) |
| 1023 | (insert (format "jump to %d(" (+ (or address ccl-current-ic) cc))) | 1021 | (insert (format "jump to %d(" (+ (or address ccl-current-ic) cc))) |
| 1024 | (if (>= cc 0) | 1022 | (if (>= cc 0) |
| 1025 | (insert "+")) | 1023 | (insert "+")) |
| @@ -1042,13 +1040,13 @@ is a list of CCL-BLOCKs." | |||
| 1042 | (defun ccl-extract-arith-op (cc) | 1040 | (defun ccl-extract-arith-op (cc) |
| 1043 | (aref ccl-arith-table (ash cc -6))) | 1041 | (aref ccl-arith-table (ash cc -6))) |
| 1044 | 1042 | ||
| 1045 | (defun ccl-dump-write-expr-const (ignore cc) | 1043 | (defun ccl-dump-write-expr-const (_ignore cc) |
| 1046 | (insert (format "write (r%d %s %d)\n" | 1044 | (insert (format "write (r%d %s %d)\n" |
| 1047 | (logand cc 7) | 1045 | (logand cc 7) |
| 1048 | (ccl-extract-arith-op cc) | 1046 | (ccl-extract-arith-op cc) |
| 1049 | (ccl-get-next-code)))) | 1047 | (ccl-get-next-code)))) |
| 1050 | 1048 | ||
| 1051 | (defun ccl-dump-write-expr-register (ignore cc) | 1049 | (defun ccl-dump-write-expr-register (_ignore cc) |
| 1052 | (insert (format "write (r%d %s r%d)\n" | 1050 | (insert (format "write (r%d %s r%d)\n" |
| 1053 | (logand cc 7) | 1051 | (logand cc 7) |
| 1054 | (ccl-extract-arith-op cc) | 1052 | (ccl-extract-arith-op cc) |
| @@ -1059,7 +1057,7 @@ is a list of CCL-BLOCKs." | |||
| 1059 | ((= cc ?\n) (insert " \"^J\"")) | 1057 | ((= cc ?\n) (insert " \"^J\"")) |
| 1060 | (t (insert (format " \"%c\"" cc))))) | 1058 | (t (insert (format " \"%c\"" cc))))) |
| 1061 | 1059 | ||
| 1062 | (defun ccl-dump-write-const-jump (ignore cc) | 1060 | (defun ccl-dump-write-const-jump (_ignore cc) |
| 1063 | (let ((address ccl-current-ic)) | 1061 | (let ((address ccl-current-ic)) |
| 1064 | (insert "write char") | 1062 | (insert "write char") |
| 1065 | (ccl-dump-insert-char (ccl-get-next-code)) | 1063 | (ccl-dump-insert-char (ccl-get-next-code)) |
| @@ -1075,7 +1073,7 @@ is a list of CCL-BLOCKs." | |||
| 1075 | (ccl-get-next-code) ; Skip dummy READ-JUMP | 1073 | (ccl-get-next-code) ; Skip dummy READ-JUMP |
| 1076 | )) | 1074 | )) |
| 1077 | 1075 | ||
| 1078 | (defun ccl-dump-write-string-jump (ignore cc) | 1076 | (defun ccl-dump-write-string-jump (_ignore cc) |
| 1079 | (let ((address ccl-current-ic) | 1077 | (let ((address ccl-current-ic) |
| 1080 | (len (ccl-get-next-code)) | 1078 | (len (ccl-get-next-code)) |
| 1081 | (i 0)) | 1079 | (i 0)) |
| @@ -1125,7 +1123,7 @@ is a list of CCL-BLOCKs." | |||
| 1125 | (defun ccl-dump-write-register (rrr cc) | 1123 | (defun ccl-dump-write-register (rrr cc) |
| 1126 | (insert (format "write r%d (%d remaining)\n" rrr cc))) | 1124 | (insert (format "write r%d (%d remaining)\n" rrr cc))) |
| 1127 | 1125 | ||
| 1128 | (defun ccl-dump-call (ignore cc) | 1126 | (defun ccl-dump-call (_ignore _cc) |
| 1129 | (let ((subroutine (car (ccl-get-next-code)))) | 1127 | (let ((subroutine (car (ccl-get-next-code)))) |
| 1130 | (insert (format-message "call subroutine `%s'\n" subroutine)))) | 1128 | (insert (format-message "call subroutine `%s'\n" subroutine)))) |
| 1131 | 1129 | ||
| @@ -1160,7 +1158,7 @@ is a list of CCL-BLOCKs." | |||
| 1160 | (setq i (1+ i))) | 1158 | (setq i (1+ i))) |
| 1161 | (insert "\n"))) | 1159 | (insert "\n"))) |
| 1162 | 1160 | ||
| 1163 | (defun ccl-dump-end (&rest ignore) | 1161 | (defun ccl-dump-end (&rest _ignore) |
| 1164 | (insert "end\n")) | 1162 | (insert "end\n")) |
| 1165 | 1163 | ||
| 1166 | (defun ccl-dump-set-assign-expr-const (rrr cc) | 1164 | (defun ccl-dump-set-assign-expr-const (rrr cc) |
| @@ -1213,9 +1211,10 @@ is a list of CCL-BLOCKs." | |||
| 1213 | (insert (format "read r%d, " rrr)) | 1211 | (insert (format "read r%d, " rrr)) |
| 1214 | (ccl-dump-jump-cond-expr-register rrr cc)) | 1212 | (ccl-dump-jump-cond-expr-register rrr cc)) |
| 1215 | 1213 | ||
| 1216 | (defun ccl-dump-binary (ccl-code) | 1214 | (defun ccl-dump-binary (code) |
| 1217 | (let ((len (length ccl-code)) | 1215 | (let* ((ccl-code code) |
| 1218 | (i 2)) | 1216 | (len (length ccl-code)) |
| 1217 | (i 2)) | ||
| 1219 | (while (< i len) | 1218 | (while (< i len) |
| 1220 | (let ((code (aref ccl-code i)) | 1219 | (let ((code (aref ccl-code i)) |
| 1221 | (j 27)) | 1220 | (j 27)) |
| @@ -1235,28 +1234,28 @@ is a list of CCL-BLOCKs." | |||
| 1235 | (insert (format "<%s> " ex-op)) | 1234 | (insert (format "<%s> " ex-op)) |
| 1236 | (funcall (get ex-op 'ccl-dump-function) rrr RRR Rrr))) | 1235 | (funcall (get ex-op 'ccl-dump-function) rrr RRR Rrr))) |
| 1237 | 1236 | ||
| 1238 | (defun ccl-dump-read-multibyte-character (rrr RRR Rrr) | 1237 | (defun ccl-dump-read-multibyte-character (rrr RRR _Rrr) |
| 1239 | (insert (format "read-multibyte-character r%d r%d\n" RRR rrr))) | 1238 | (insert (format "read-multibyte-character r%d r%d\n" RRR rrr))) |
| 1240 | 1239 | ||
| 1241 | (defun ccl-dump-write-multibyte-character (rrr RRR Rrr) | 1240 | (defun ccl-dump-write-multibyte-character (rrr RRR _Rrr) |
| 1242 | (insert (format "write-multibyte-character r%d r%d\n" RRR rrr))) | 1241 | (insert (format "write-multibyte-character r%d r%d\n" RRR rrr))) |
| 1243 | 1242 | ||
| 1244 | (defun ccl-dump-translate-character (rrr RRR Rrr) | 1243 | (defun ccl-dump-translate-character (rrr RRR Rrr) |
| 1245 | (insert (format "translation table(r%d) r%d r%d\n" Rrr RRR rrr))) | 1244 | (insert (format "translation table(r%d) r%d r%d\n" Rrr RRR rrr))) |
| 1246 | 1245 | ||
| 1247 | (defun ccl-dump-translate-character-const-tbl (rrr RRR Rrr) | 1246 | (defun ccl-dump-translate-character-const-tbl (rrr RRR _Rrr) |
| 1248 | (let ((tbl (ccl-get-next-code))) | 1247 | (let ((tbl (ccl-get-next-code))) |
| 1249 | (insert (format "translation table(%S) r%d r%d\n" tbl RRR rrr)))) | 1248 | (insert (format "translation table(%S) r%d r%d\n" tbl RRR rrr)))) |
| 1250 | 1249 | ||
| 1251 | (defun ccl-dump-lookup-int-const-tbl (rrr RRR Rrr) | 1250 | (defun ccl-dump-lookup-int-const-tbl (rrr RRR _Rrr) |
| 1252 | (let ((tbl (ccl-get-next-code))) | 1251 | (let ((tbl (ccl-get-next-code))) |
| 1253 | (insert (format "hash table(%S) r%d r%d\n" tbl RRR rrr)))) | 1252 | (insert (format "hash table(%S) r%d r%d\n" tbl RRR rrr)))) |
| 1254 | 1253 | ||
| 1255 | (defun ccl-dump-lookup-char-const-tbl (rrr RRR Rrr) | 1254 | (defun ccl-dump-lookup-char-const-tbl (rrr RRR _Rrr) |
| 1256 | (let ((tbl (ccl-get-next-code))) | 1255 | (let ((tbl (ccl-get-next-code))) |
| 1257 | (insert (format "hash table(%S) r%d r%d\n" tbl RRR rrr)))) | 1256 | (insert (format "hash table(%S) r%d r%d\n" tbl RRR rrr)))) |
| 1258 | 1257 | ||
| 1259 | (defun ccl-dump-iterate-multiple-map (rrr RRR Rrr) | 1258 | (defun ccl-dump-iterate-multiple-map (rrr RRR _Rrr) |
| 1260 | (let ((notbl (ccl-get-next-code)) | 1259 | (let ((notbl (ccl-get-next-code)) |
| 1261 | (i 0) id) | 1260 | (i 0) id) |
| 1262 | (insert (format "iterate-multiple-map r%d r%d\n" RRR rrr)) | 1261 | (insert (format "iterate-multiple-map r%d r%d\n" RRR rrr)) |
| @@ -1267,7 +1266,7 @@ is a list of CCL-BLOCKs." | |||
| 1267 | (setq i (1+ i))) | 1266 | (setq i (1+ i))) |
| 1268 | (insert "]\n"))) | 1267 | (insert "]\n"))) |
| 1269 | 1268 | ||
| 1270 | (defun ccl-dump-map-multiple (rrr RRR Rrr) | 1269 | (defun ccl-dump-map-multiple (rrr RRR _Rrr) |
| 1271 | (let ((notbl (ccl-get-next-code)) | 1270 | (let ((notbl (ccl-get-next-code)) |
| 1272 | (i 0) id) | 1271 | (i 0) id) |
| 1273 | (insert (format "map-multiple r%d r%d\n" RRR rrr)) | 1272 | (insert (format "map-multiple r%d r%d\n" RRR rrr)) |
| @@ -1280,7 +1279,7 @@ is a list of CCL-BLOCKs." | |||
| 1280 | (setq i (1+ i))) | 1279 | (setq i (1+ i))) |
| 1281 | (insert "]\n"))) | 1280 | (insert "]\n"))) |
| 1282 | 1281 | ||
| 1283 | (defun ccl-dump-map-single (rrr RRR Rrr) | 1282 | (defun ccl-dump-map-single (rrr RRR _Rrr) |
| 1284 | (let ((id (ccl-get-next-code))) | 1283 | (let ((id (ccl-get-next-code))) |
| 1285 | (insert (format "map-single r%d r%d map(%S)\n" RRR rrr id)))) | 1284 | (insert (format "map-single r%d r%d map(%S)\n" RRR rrr id)))) |
| 1286 | 1285 | ||
diff --git a/lisp/json.el b/lisp/json.el index e2c7cc77222..b23d12ad0ed 100644 --- a/lisp/json.el +++ b/lisp/json.el | |||
| @@ -358,7 +358,7 @@ Please see the documentation of `json-object-type'." | |||
| 358 | (cond ((eq json-object-type 'hash-table) | 358 | (cond ((eq json-object-type 'hash-table) |
| 359 | (make-hash-table :test 'equal)) | 359 | (make-hash-table :test 'equal)) |
| 360 | (t | 360 | (t |
| 361 | (list)))) | 361 | ()))) |
| 362 | 362 | ||
| 363 | (defun json-add-to-object (object key value) | 363 | (defun json-add-to-object (object key value) |
| 364 | "Add a new KEY -> VALUE association to OBJECT. | 364 | "Add a new KEY -> VALUE association to OBJECT. |
diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 6a315496fe0..5748e88bbca 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el | |||
| @@ -1501,7 +1501,7 @@ If CHARSET is nil then use UTF-8." | |||
| 1501 | (setq start (point) | 1501 | (setq start (point) |
| 1502 | title (plist-get bookmark :title)) | 1502 | title (plist-get bookmark :title)) |
| 1503 | (when (> (length title) width) | 1503 | (when (> (length title) width) |
| 1504 | (setq title (substring title 0 width))) | 1504 | (setq title (truncate-string-to-width title width))) |
| 1505 | (insert (format format title (plist-get bookmark :url)) "\n") | 1505 | (insert (format format title (plist-get bookmark :url)) "\n") |
| 1506 | (put-text-property start (1+ start) 'eww-bookmark bookmark)) | 1506 | (put-text-property start (1+ start) 'eww-bookmark bookmark)) |
| 1507 | (goto-char (point-min)))) | 1507 | (goto-char (point-min)))) |
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 5910d1fd3a4..c0a6b6afa6d 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -649,8 +649,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 649 | (directory &optional full match nosort) | 649 | (directory &optional full match nosort) |
| 650 | "Like `directory-files' for Tramp files." | 650 | "Like `directory-files' for Tramp files." |
| 651 | (let ((result (mapcar 'directory-file-name | 651 | (let ((result (mapcar 'directory-file-name |
| 652 | (file-name-all-completions "" directory))) | 652 | (file-name-all-completions "" directory)))) |
| 653 | res) | ||
| 654 | ;; Discriminate with regexp. | 653 | ;; Discriminate with regexp. |
| 655 | (when match | 654 | (when match |
| 656 | (setq result | 655 | (setq result |
| @@ -665,9 +664,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 665 | result))) | 664 | result))) |
| 666 | ;; Sort them if necessary. | 665 | ;; Sort them if necessary. |
| 667 | (unless nosort (setq result (sort result 'string-lessp))) | 666 | (unless nosort (setq result (sort result 'string-lessp))) |
| 668 | ;; Remove double entries. | 667 | (delete-dups result))) |
| 669 | (dolist (elt result res) | ||
| 670 | (add-to-list 'res elt 'append)))) | ||
| 671 | 668 | ||
| 672 | (defun tramp-smb-handle-expand-file-name (name &optional dir) | 669 | (defun tramp-smb-handle-expand-file-name (name &optional dir) |
| 673 | "Like `expand-file-name' for Tramp files." | 670 | "Like `expand-file-name' for Tramp files." |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 30a7269240e..2f811bb73ca 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -4043,6 +4043,7 @@ Return the local name of the temporary file." | |||
| 4043 | 'tramp-delete-temp-file-function))) | 4043 | 'tramp-delete-temp-file-function))) |
| 4044 | 4044 | ||
| 4045 | ;;; Auto saving to a special directory: | 4045 | ;;; Auto saving to a special directory: |
| 4046 | (defvar auto-save-file-name-transforms) | ||
| 4046 | 4047 | ||
| 4047 | (defun tramp-handle-make-auto-save-file-name () | 4048 | (defun tramp-handle-make-auto-save-file-name () |
| 4048 | "Like `make-auto-save-file-name' for Tramp files. | 4049 | "Like `make-auto-save-file-name' for Tramp files. |
diff --git a/lisp/obsolete/vc-arch.el b/lisp/obsolete/vc-arch.el index bdb69757d35..e6540ce74d9 100644 --- a/lisp/obsolete/vc-arch.el +++ b/lisp/obsolete/vc-arch.el | |||
| @@ -310,6 +310,10 @@ Only the value `maybe' can be trusted :-(." | |||
| 310 | 'up-to-date | 310 | 'up-to-date |
| 311 | 'edited))))))))) | 311 | 'edited))))))))) |
| 312 | 312 | ||
| 313 | ;; dir-status-files called from vc-dir, which loads vc, | ||
| 314 | ;; which loads vc-dispatcher. | ||
| 315 | (declare-function vc-exec-after "vc-dispatcher" (code)) | ||
| 316 | |||
| 313 | (defun vc-arch-dir-status-files (dir _files callback) | 317 | (defun vc-arch-dir-status-files (dir _files callback) |
| 314 | "Run `tla inventory' for DIR and pass results to CALLBACK. | 318 | "Run `tla inventory' for DIR and pass results to CALLBACK. |
| 315 | CALLBACK expects (ENTRIES &optional MORE-TO-COME); see | 319 | CALLBACK expects (ENTRIES &optional MORE-TO-COME); see |
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 45afafc2381..0b13759b9bc 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -3410,18 +3410,24 @@ There might be text before point." | |||
| 3410 | "A `prettify-symbols-alist' usable for (La)TeX modes.") | 3410 | "A `prettify-symbols-alist' usable for (La)TeX modes.") |
| 3411 | 3411 | ||
| 3412 | (defun tex--prettify-symbols-compose-p (_start end _match) | 3412 | (defun tex--prettify-symbols-compose-p (_start end _match) |
| 3413 | (let* ((after-char (char-after end)) | 3413 | (or |
| 3414 | (after-syntax (char-syntax after-char))) | 3414 | ;; If the matched symbol doesn't end in a word character, then we |
| 3415 | (not (or | 3415 | ;; simply allow composition. The symbol is probably something like |
| 3416 | ;; Don't compose \alpha@foo. | 3416 | ;; \|, \(, etc. |
| 3417 | (eq after-char ?@) | 3417 | (not (eq ?w (char-syntax (char-before end)))) |
| 3418 | ;; The \alpha in \alpha2 or \alpha-\beta may be composed but | 3418 | ;; Else we look at what follows the match in order to decide. |
| 3419 | ;; of course \alphax may not. | 3419 | (let* ((after-char (char-after end)) |
| 3420 | (and (eq after-syntax ?w) | 3420 | (after-syntax (char-syntax after-char))) |
| 3421 | (not (memq after-char | 3421 | (not (or |
| 3422 | '(?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9 ?+ ?- ?' ?\")))) | 3422 | ;; Don't compose \alpha@foo. |
| 3423 | ;; Don't compose inside verbatim blocks. | 3423 | (eq after-char ?@) |
| 3424 | (eq 2 (nth 7 (syntax-ppss))))))) | 3424 | ;; The \alpha in \alpha2 or \alpha-\beta may be composed but |
| 3425 | ;; of course \alphax may not. | ||
| 3426 | (and (eq after-syntax ?w) | ||
| 3427 | (not (memq after-char | ||
| 3428 | '(?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9 ?+ ?- ?' ?\")))) | ||
| 3429 | ;; Don't compose inside verbatim blocks. | ||
| 3430 | (eq 2 (nth 7 (syntax-ppss)))))))) | ||
| 3425 | 3431 | ||
| 3426 | (run-hooks 'tex-mode-load-hook) | 3432 | (run-hooks 'tex-mode-load-hook) |
| 3427 | 3433 | ||
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index 40f251654f2..9b2711d8146 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el | |||
| @@ -331,6 +331,7 @@ in the repository root directory of FILE." | |||
| 331 | "Value of `compilation-error-regexp-alist' in *vc-bzr* buffers.") | 331 | "Value of `compilation-error-regexp-alist' in *vc-bzr* buffers.") |
| 332 | 332 | ||
| 333 | ;; To be called via vc-pull from vc.el, which requires vc-dispatcher. | 333 | ;; To be called via vc-pull from vc.el, which requires vc-dispatcher. |
| 334 | (declare-function vc-exec-after "vc-dispatcher" (code)) | ||
| 334 | (declare-function vc-set-async-update "vc-dispatcher" (process-buffer)) | 335 | (declare-function vc-set-async-update "vc-dispatcher" (process-buffer)) |
| 335 | (declare-function vc-compilation-mode "vc-dispatcher" (backend)) | 336 | (declare-function vc-compilation-mode "vc-dispatcher" (backend)) |
| 336 | 337 | ||
diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index c0a199dc078..5f5807fb3c6 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el | |||
| @@ -543,6 +543,8 @@ Will fail unless you have administrative privileges on the repo." | |||
| 543 | ;;; | 543 | ;;; |
| 544 | 544 | ||
| 545 | (declare-function vc-rcs-print-log-cleanup "vc-rcs" ()) | 545 | (declare-function vc-rcs-print-log-cleanup "vc-rcs" ()) |
| 546 | ;; Follows vc-cvs-command, which uses vc-do-command from vc-dispatcher. | ||
| 547 | (declare-function vc-exec-after "vc-dispatcher" (code)) | ||
| 546 | 548 | ||
| 547 | (defun vc-cvs-print-log (files buffer &optional _shortlog _start-revision limit) | 549 | (defun vc-cvs-print-log (files buffer &optional _shortlog _start-revision limit) |
| 548 | "Print commit log associated with FILES into specified BUFFER. | 550 | "Print commit log associated with FILES into specified BUFFER. |
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 0e33896a715..27898a991a0 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el | |||
| @@ -461,6 +461,8 @@ or an empty string if none." | |||
| 461 | 461 | ||
| 462 | ;; Follows vc-git-command (or vc-do-async-command), which uses vc-do-command | 462 | ;; Follows vc-git-command (or vc-do-async-command), which uses vc-do-command |
| 463 | ;; from vc-dispatcher. | 463 | ;; from vc-dispatcher. |
| 464 | (declare-function vc-exec-after "vc-dispatcher" (code)) | ||
| 465 | ;; Follows vc-exec-after. | ||
| 464 | (declare-function vc-set-async-update "vc-dispatcher" (process-buffer)) | 466 | (declare-function vc-set-async-update "vc-dispatcher" (process-buffer)) |
| 465 | 467 | ||
| 466 | (defun vc-git-dir-status-goto-stage (stage files update-function) | 468 | (defun vc-git-dir-status-goto-stage (stage files update-function) |
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index c4d6092d100..f9957c1afff 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el | |||
| @@ -259,6 +259,14 @@ highlighting the Log View buffer." | |||
| 259 | (defvar vc-hg-log-graph nil | 259 | (defvar vc-hg-log-graph nil |
| 260 | "If non-nil, use `--graph' in the short log output.") | 260 | "If non-nil, use `--graph' in the short log output.") |
| 261 | 261 | ||
| 262 | (defvar vc-hg-log-format (concat "changeset: {rev}:{node|short}\n" | ||
| 263 | "{tags % 'tag: {tag}\n'}" | ||
| 264 | "{if(parents, 'parents: {parents}\n')}" | ||
| 265 | "user: {author}\n" | ||
| 266 | "Date: {date|date}\n" | ||
| 267 | "summary: {desc|tabindent}\n\n") | ||
| 268 | "Mercurial log template for `vc-hg-print-log' long format.") | ||
| 269 | |||
| 262 | (defun vc-hg-print-log (files buffer &optional shortlog start-revision limit) | 270 | (defun vc-hg-print-log (files buffer &optional shortlog start-revision limit) |
| 263 | "Print commit log associated with FILES into specified BUFFER. | 271 | "Print commit log associated with FILES into specified BUFFER. |
| 264 | If SHORTLOG is non-nil, use a short format based on `vc-hg-root-log-format'. | 272 | If SHORTLOG is non-nil, use a short format based on `vc-hg-root-log-format'. |
| @@ -276,9 +284,11 @@ If LIMIT is non-nil, show no more than this many entries." | |||
| 276 | (nconc | 284 | (nconc |
| 277 | (when start-revision (list (format "-r%s:0" start-revision))) | 285 | (when start-revision (list (format "-r%s:0" start-revision))) |
| 278 | (when limit (list "-l" (format "%s" limit))) | 286 | (when limit (list "-l" (format "%s" limit))) |
| 279 | (when shortlog `(,@(if vc-hg-log-graph '("--graph")) | 287 | (if shortlog |
| 280 | "--template" | 288 | `(,@(if vc-hg-log-graph '("--graph")) |
| 281 | ,(car vc-hg-root-log-format))) | 289 | "--template" |
| 290 | ,(car vc-hg-root-log-format)) | ||
| 291 | `("--template" ,vc-hg-log-format)) | ||
| 282 | vc-hg-log-switches))))) | 292 | vc-hg-log-switches))))) |
| 283 | 293 | ||
| 284 | (defvar log-view-message-re) | 294 | (defvar log-view-message-re) |
| @@ -295,6 +305,7 @@ If LIMIT is non-nil, show no more than this many entries." | |||
| 295 | (if (eq vc-log-view-type 'short) | 305 | (if (eq vc-log-view-type 'short) |
| 296 | (cadr vc-hg-root-log-format) | 306 | (cadr vc-hg-root-log-format) |
| 297 | "^changeset:[ \t]*\\([0-9]+\\):\\(.+\\)")) | 307 | "^changeset:[ \t]*\\([0-9]+\\):\\(.+\\)")) |
| 308 | (set (make-local-variable 'tab-width) 2) | ||
| 298 | ;; Allow expanding short log entries | 309 | ;; Allow expanding short log entries |
| 299 | (when (eq vc-log-view-type 'short) | 310 | (when (eq vc-log-view-type 'short) |
| 300 | (setq truncate-lines t) | 311 | (setq truncate-lines t) |
| @@ -345,7 +356,7 @@ If LIMIT is non-nil, show no more than this many entries." | |||
| 345 | 356 | ||
| 346 | (defun vc-hg-expanded-log-entry (revision) | 357 | (defun vc-hg-expanded-log-entry (revision) |
| 347 | (with-temp-buffer | 358 | (with-temp-buffer |
| 348 | (vc-hg-command t nil nil "log" "-r" revision) | 359 | (vc-hg-command t nil nil "log" "-r" revision "--template" vc-hg-log-format) |
| 349 | (goto-char (point-min)) | 360 | (goto-char (point-min)) |
| 350 | (unless (eobp) | 361 | (unless (eobp) |
| 351 | ;; Indent the expanded log entry. | 362 | ;; Indent the expanded log entry. |
| @@ -620,6 +631,8 @@ REV is the revision to check out into WORKFILE." | |||
| 620 | 631 | ||
| 621 | ;; Follows vc-hg-command (or vc-do-async-command), which uses vc-do-command | 632 | ;; Follows vc-hg-command (or vc-do-async-command), which uses vc-do-command |
| 622 | ;; from vc-dispatcher. | 633 | ;; from vc-dispatcher. |
| 634 | (declare-function vc-exec-after "vc-dispatcher" (code)) | ||
| 635 | ;; Follows vc-exec-after. | ||
| 623 | (declare-function vc-set-async-update "vc-dispatcher" (process-buffer)) | 636 | (declare-function vc-set-async-update "vc-dispatcher" (process-buffer)) |
| 624 | 637 | ||
| 625 | (defun vc-hg-dir-status-files (dir files update-function) | 638 | (defun vc-hg-dir-status-files (dir files update-function) |
diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el index 3197d606061..b56a08f2a9e 100644 --- a/lisp/vc/vc-mtn.el +++ b/lisp/vc/vc-mtn.el | |||
| @@ -138,6 +138,10 @@ switches." | |||
| 138 | ((match-end 2) (push (list (match-string 3) 'added) result)))) | 138 | ((match-end 2) (push (list (match-string 3) 'added) result)))) |
| 139 | (funcall update-function result))) | 139 | (funcall update-function result))) |
| 140 | 140 | ||
| 141 | ;; dir-status-files called from vc-dir, which loads vc, | ||
| 142 | ;; which loads vc-dispatcher. | ||
| 143 | (declare-function vc-exec-after "vc-dispatcher" (code)) | ||
| 144 | |||
| 141 | (defun vc-mtn-dir-status-files (dir _files update-function) | 145 | (defun vc-mtn-dir-status-files (dir _files update-function) |
| 142 | (vc-mtn-command (current-buffer) 'async dir "status") | 146 | (vc-mtn-command (current-buffer) 'async dir "status") |
| 143 | (vc-run-delayed | 147 | (vc-run-delayed |
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index 2ec65a1ad07..4ef63a23db5 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el | |||
| @@ -208,6 +208,10 @@ switches." | |||
| 208 | (setq result (cons (list filename state) result))))) | 208 | (setq result (cons (list filename state) result))))) |
| 209 | (funcall callback result))) | 209 | (funcall callback result))) |
| 210 | 210 | ||
| 211 | ;; dir-status-files called from vc-dir, which loads vc, | ||
| 212 | ;; which loads vc-dispatcher. | ||
| 213 | (declare-function vc-exec-after "vc-dispatcher" (code)) | ||
| 214 | |||
| 211 | (autoload 'vc-expand-dirs "vc") | 215 | (autoload 'vc-expand-dirs "vc") |
| 212 | 216 | ||
| 213 | (defun vc-svn-dir-status-files (_dir files callback) | 217 | (defun vc-svn-dir-status-files (_dir files callback) |
diff --git a/src/lread.c b/src/lread.c index a98fa6199f1..1119f3fdfd4 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -4479,8 +4479,10 @@ were read in. */); | |||
| 4479 | 4479 | ||
| 4480 | DEFVAR_LISP ("load-path", Vload_path, | 4480 | DEFVAR_LISP ("load-path", Vload_path, |
| 4481 | doc: /* List of directories to search for files to load. | 4481 | doc: /* List of directories to search for files to load. |
| 4482 | Each element is a string (directory name) or nil (meaning `default-directory'). | 4482 | Each element is a string (directory file name) or nil (meaning |
| 4483 | Initialized during startup as described in Info node `(elisp)Library Search'. */); | 4483 | `default-directory'). Initialized during startup as described in Info |
| 4484 | node `(elisp)Library Search'. Use `directory-file-name' when adding items | ||
| 4485 | to this path. */); | ||
| 4484 | 4486 | ||
| 4485 | DEFVAR_LISP ("load-suffixes", Vload_suffixes, | 4487 | DEFVAR_LISP ("load-suffixes", Vload_suffixes, |
| 4486 | doc: /* List of suffixes for (compiled or source) Emacs Lisp files. | 4488 | doc: /* List of suffixes for (compiled or source) Emacs Lisp files. |
diff --git a/src/nsfns.m b/src/nsfns.m index 1ed3e23cba5..c24344436ad 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -1298,6 +1298,8 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 1298 | = [NSCursor arrowCursor]; | 1298 | = [NSCursor arrowCursor]; |
| 1299 | f->output_data.ns->current_pointer = f->output_data.ns->text_cursor; | 1299 | f->output_data.ns->current_pointer = f->output_data.ns->text_cursor; |
| 1300 | 1300 | ||
| 1301 | f->output_data.ns->in_animation = NO; | ||
| 1302 | |||
| 1301 | [[EmacsView alloc] initFrameFromEmacs: f]; | 1303 | [[EmacsView alloc] initFrameFromEmacs: f]; |
| 1302 | 1304 | ||
| 1303 | x_icon (f, parms); | 1305 | x_icon (f, parms); |
diff --git a/src/nsmenu.m b/src/nsmenu.m index 2ef12234960..ddc5dc20a82 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m | |||
| @@ -998,10 +998,20 @@ free_frame_tool_bar (struct frame *f) | |||
| 998 | -------------------------------------------------------------------------- */ | 998 | -------------------------------------------------------------------------- */ |
| 999 | { | 999 | { |
| 1000 | EmacsView *view = FRAME_NS_VIEW (f); | 1000 | EmacsView *view = FRAME_NS_VIEW (f); |
| 1001 | |||
| 1002 | NSTRACE ("free_frame_tool_bar"); | ||
| 1003 | |||
| 1001 | block_input (); | 1004 | block_input (); |
| 1002 | view->wait_for_tool_bar = NO; | 1005 | view->wait_for_tool_bar = NO; |
| 1003 | [[view toolbar] setVisible: NO]; | 1006 | |
| 1004 | FRAME_TOOLBAR_HEIGHT (f) = 0; | 1007 | FRAME_TOOLBAR_HEIGHT (f) = 0; |
| 1008 | |||
| 1009 | /* Note: This trigger an animation, which calls windowDidResize | ||
| 1010 | repeatedly. */ | ||
| 1011 | f->output_data.ns->in_animation = 1; | ||
| 1012 | [[view toolbar] setVisible: NO]; | ||
| 1013 | f->output_data.ns->in_animation = 0; | ||
| 1014 | |||
| 1005 | unblock_input (); | 1015 | unblock_input (); |
| 1006 | } | 1016 | } |
| 1007 | 1017 | ||
| @@ -1017,6 +1027,8 @@ update_frame_tool_bar (struct frame *f) | |||
| 1017 | EmacsToolbar *toolbar = [view toolbar]; | 1027 | EmacsToolbar *toolbar = [view toolbar]; |
| 1018 | int oldh; | 1028 | int oldh; |
| 1019 | 1029 | ||
| 1030 | NSTRACE ("update_frame_tool_bar"); | ||
| 1031 | |||
| 1020 | if (view == nil || toolbar == nil) return; | 1032 | if (view == nil || toolbar == nil) return; |
| 1021 | block_input (); | 1033 | block_input (); |
| 1022 | 1034 | ||
| @@ -1096,7 +1108,11 @@ update_frame_tool_bar (struct frame *f) | |||
| 1096 | } | 1108 | } |
| 1097 | 1109 | ||
| 1098 | if (![toolbar isVisible]) | 1110 | if (![toolbar isVisible]) |
| 1111 | { | ||
| 1112 | f->output_data.ns->in_animation = 1; | ||
| 1099 | [toolbar setVisible: YES]; | 1113 | [toolbar setVisible: YES]; |
| 1114 | f->output_data.ns->in_animation = 0; | ||
| 1115 | } | ||
| 1100 | 1116 | ||
| 1101 | #ifdef NS_IMPL_COCOA | 1117 | #ifdef NS_IMPL_COCOA |
| 1102 | if ([toolbar changed]) | 1118 | if ([toolbar changed]) |
| @@ -1150,6 +1166,8 @@ update_frame_tool_bar (struct frame *f) | |||
| 1150 | 1166 | ||
| 1151 | - initForView: (EmacsView *)view withIdentifier: (NSString *)identifier | 1167 | - initForView: (EmacsView *)view withIdentifier: (NSString *)identifier |
| 1152 | { | 1168 | { |
| 1169 | NSTRACE ("[EmacsToolbar initForView: withIdentifier:]"); | ||
| 1170 | |||
| 1153 | self = [super initWithIdentifier: identifier]; | 1171 | self = [super initWithIdentifier: identifier]; |
| 1154 | emacsView = view; | 1172 | emacsView = view; |
| 1155 | [self setDisplayMode: NSToolbarDisplayModeIconOnly]; | 1173 | [self setDisplayMode: NSToolbarDisplayModeIconOnly]; |
| @@ -1164,6 +1182,8 @@ update_frame_tool_bar (struct frame *f) | |||
| 1164 | 1182 | ||
| 1165 | - (void)dealloc | 1183 | - (void)dealloc |
| 1166 | { | 1184 | { |
| 1185 | NSTRACE ("[EmacsToolbar dealloc]"); | ||
| 1186 | |||
| 1167 | [prevIdentifiers release]; | 1187 | [prevIdentifiers release]; |
| 1168 | [activeIdentifiers release]; | 1188 | [activeIdentifiers release]; |
| 1169 | [identifierToItem release]; | 1189 | [identifierToItem release]; |
| @@ -1172,6 +1192,8 @@ update_frame_tool_bar (struct frame *f) | |||
| 1172 | 1192 | ||
| 1173 | - (void) clearActive | 1193 | - (void) clearActive |
| 1174 | { | 1194 | { |
| 1195 | NSTRACE ("[EmacsToolbar clearActive]"); | ||
| 1196 | |||
| 1175 | [prevIdentifiers release]; | 1197 | [prevIdentifiers release]; |
| 1176 | prevIdentifiers = [activeIdentifiers copy]; | 1198 | prevIdentifiers = [activeIdentifiers copy]; |
| 1177 | [activeIdentifiers removeAllObjects]; | 1199 | [activeIdentifiers removeAllObjects]; |
| @@ -1181,6 +1203,8 @@ update_frame_tool_bar (struct frame *f) | |||
| 1181 | 1203 | ||
| 1182 | - (void) clearAll | 1204 | - (void) clearAll |
| 1183 | { | 1205 | { |
| 1206 | NSTRACE ("[EmacsToolbar clearAll]"); | ||
| 1207 | |||
| 1184 | [self clearActive]; | 1208 | [self clearActive]; |
| 1185 | while ([[self items] count] > 0) | 1209 | while ([[self items] count] > 0) |
| 1186 | [self removeItemAtIndex: 0]; | 1210 | [self removeItemAtIndex: 0]; |
| @@ -1188,6 +1212,8 @@ update_frame_tool_bar (struct frame *f) | |||
| 1188 | 1212 | ||
| 1189 | - (BOOL) changed | 1213 | - (BOOL) changed |
| 1190 | { | 1214 | { |
| 1215 | NSTRACE ("[EmacsToolbar changed]"); | ||
| 1216 | |||
| 1191 | return [activeIdentifiers isEqualToArray: prevIdentifiers] && | 1217 | return [activeIdentifiers isEqualToArray: prevIdentifiers] && |
| 1192 | enablement == prevEnablement ? NO : YES; | 1218 | enablement == prevEnablement ? NO : YES; |
| 1193 | } | 1219 | } |
| @@ -1198,6 +1224,8 @@ update_frame_tool_bar (struct frame *f) | |||
| 1198 | helpText: (const char *)help | 1224 | helpText: (const char *)help |
| 1199 | enabled: (BOOL)enabled | 1225 | enabled: (BOOL)enabled |
| 1200 | { | 1226 | { |
| 1227 | NSTRACE ("[EmacsToolbar addDisplayItemWithImage: ...]"); | ||
| 1228 | |||
| 1201 | /* 1) come up w/identifier */ | 1229 | /* 1) come up w/identifier */ |
| 1202 | NSString *identifier | 1230 | NSString *identifier |
| 1203 | = [NSString stringWithFormat: @"%lu", (unsigned long)[img hash]]; | 1231 | = [NSString stringWithFormat: @"%lu", (unsigned long)[img hash]]; |
| @@ -1231,6 +1259,7 @@ update_frame_tool_bar (struct frame *f) | |||
| 1231 | all items to enabled state (for some reason). */ | 1259 | all items to enabled state (for some reason). */ |
| 1232 | - (void)validateVisibleItems | 1260 | - (void)validateVisibleItems |
| 1233 | { | 1261 | { |
| 1262 | NSTRACE ("[EmacsToolbar validateVisibleItems]"); | ||
| 1234 | } | 1263 | } |
| 1235 | 1264 | ||
| 1236 | 1265 | ||
| @@ -1240,12 +1269,16 @@ update_frame_tool_bar (struct frame *f) | |||
| 1240 | itemForItemIdentifier: (NSString *)itemIdentifier | 1269 | itemForItemIdentifier: (NSString *)itemIdentifier |
| 1241 | willBeInsertedIntoToolbar: (BOOL)flag | 1270 | willBeInsertedIntoToolbar: (BOOL)flag |
| 1242 | { | 1271 | { |
| 1272 | NSTRACE ("[EmacsToolbar toolbar: ...]"); | ||
| 1273 | |||
| 1243 | /* look up NSToolbarItem by identifier and return... */ | 1274 | /* look up NSToolbarItem by identifier and return... */ |
| 1244 | return [identifierToItem objectForKey: itemIdentifier]; | 1275 | return [identifierToItem objectForKey: itemIdentifier]; |
| 1245 | } | 1276 | } |
| 1246 | 1277 | ||
| 1247 | - (NSArray *)toolbarDefaultItemIdentifiers: (NSToolbar *)toolbar | 1278 | - (NSArray *)toolbarDefaultItemIdentifiers: (NSToolbar *)toolbar |
| 1248 | { | 1279 | { |
| 1280 | NSTRACE ("[EmacsToolbar toolbarDefaultItemIdentifiers:]"); | ||
| 1281 | |||
| 1249 | /* return entire set.. */ | 1282 | /* return entire set.. */ |
| 1250 | return activeIdentifiers; | 1283 | return activeIdentifiers; |
| 1251 | } | 1284 | } |
| @@ -1253,6 +1286,8 @@ update_frame_tool_bar (struct frame *f) | |||
| 1253 | /* for configuration palette (not yet supported) */ | 1286 | /* for configuration palette (not yet supported) */ |
| 1254 | - (NSArray *)toolbarAllowedItemIdentifiers: (NSToolbar *)toolbar | 1287 | - (NSArray *)toolbarAllowedItemIdentifiers: (NSToolbar *)toolbar |
| 1255 | { | 1288 | { |
| 1289 | NSTRACE ("[EmacsToolbar toolbarAllowedItemIdentifiers:]"); | ||
| 1290 | |||
| 1256 | /* return entire set... */ | 1291 | /* return entire set... */ |
| 1257 | return activeIdentifiers; | 1292 | return activeIdentifiers; |
| 1258 | //return [identifierToItem allKeys]; | 1293 | //return [identifierToItem allKeys]; |
diff --git a/src/nsterm.h b/src/nsterm.h index 8d52dc642ed..3fb8cfc9cd8 100644 --- a/src/nsterm.h +++ b/src/nsterm.h | |||
| @@ -65,9 +65,12 @@ typedef float EmacsCGFloat; | |||
| 65 | 65 | ||
| 66 | ========================================================================== */ | 66 | ========================================================================== */ |
| 67 | 67 | ||
| 68 | /* Uncomment the following line to enable trace. */ | 68 | /* Uncomment the following line to enable trace. |
| 69 | 69 | ||
| 70 | /* #define NSTRACE_ENABLED 1 */ | 70 | Hint: keep the trailing whitespace -- the version control system |
| 71 | will reject accidental commits. */ | ||
| 72 | |||
| 73 | /* #define NSTRACE_ENABLED 1 */ | ||
| 71 | 74 | ||
| 72 | 75 | ||
| 73 | /* Print a call tree containing all annotated functions. | 76 | /* Print a call tree containing all annotated functions. |
| @@ -913,6 +916,9 @@ struct ns_output | |||
| 913 | 916 | ||
| 914 | /* Non-zero if we are zooming (maximizing) the frame. */ | 917 | /* Non-zero if we are zooming (maximizing) the frame. */ |
| 915 | int zooming; | 918 | int zooming; |
| 919 | |||
| 920 | /* Non-zero if we are doing an animation, e.g. toggling the tool bar. */ | ||
| 921 | int in_animation; | ||
| 916 | }; | 922 | }; |
| 917 | 923 | ||
| 918 | /* this dummy decl needed to support TTYs */ | 924 | /* this dummy decl needed to support TTYs */ |
diff --git a/src/nsterm.m b/src/nsterm.m index be860610b47..925e9af30a7 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -1501,7 +1501,7 @@ x_set_window_size (struct frame *f, | |||
| 1501 | if (view == nil) | 1501 | if (view == nil) |
| 1502 | return; | 1502 | return; |
| 1503 | 1503 | ||
| 1504 | NSTRACE_RECT ("input", wr); | 1504 | NSTRACE_RECT ("current", wr); |
| 1505 | 1505 | ||
| 1506 | /*fprintf (stderr, "\tsetWindowSize: %d x %d, pixelwise %d, font size %d x %d\n", width, height, pixelwise, FRAME_COLUMN_WIDTH (f), FRAME_LINE_HEIGHT (f));*/ | 1506 | /*fprintf (stderr, "\tsetWindowSize: %d x %d, pixelwise %d, font size %d x %d\n", width, height, pixelwise, FRAME_COLUMN_WIDTH (f), FRAME_LINE_HEIGHT (f));*/ |
| 1507 | 1507 | ||
| @@ -1563,7 +1563,6 @@ x_set_window_size (struct frame *f, | |||
| 1563 | make_number (FRAME_NS_TITLEBAR_HEIGHT (f)), | 1563 | make_number (FRAME_NS_TITLEBAR_HEIGHT (f)), |
| 1564 | make_number (FRAME_TOOLBAR_HEIGHT (f)))); | 1564 | make_number (FRAME_TOOLBAR_HEIGHT (f)))); |
| 1565 | 1565 | ||
| 1566 | [view setRows: rows andColumns: cols]; | ||
| 1567 | NSTRACE_RECT ("setFrame", wr); | 1566 | NSTRACE_RECT ("setFrame", wr); |
| 1568 | [window setFrame: wr display: YES]; | 1567 | [window setFrame: wr display: YES]; |
| 1569 | 1568 | ||
| @@ -6171,6 +6170,8 @@ not_in_argv (NSString *arg) | |||
| 6171 | NSTRACE ("updateFrameSize"); | 6170 | NSTRACE ("updateFrameSize"); |
| 6172 | NSTRACE_SIZE ("Original size", NSMakeSize (oldw, oldh)); | 6171 | NSTRACE_SIZE ("Original size", NSMakeSize (oldw, oldh)); |
| 6173 | NSTRACE_RECT ("Original frame", wr); | 6172 | NSTRACE_RECT ("Original frame", wr); |
| 6173 | NSTRACE_MSG ("Original columns: %d", cols); | ||
| 6174 | NSTRACE_MSG ("Original rows: %d", rows); | ||
| 6174 | 6175 | ||
| 6175 | if (! [self isFullscreen]) | 6176 | if (! [self isFullscreen]) |
| 6176 | { | 6177 | { |
| @@ -6187,13 +6188,19 @@ not_in_argv (NSString *arg) | |||
| 6187 | if (wait_for_tool_bar) | 6188 | if (wait_for_tool_bar) |
| 6188 | { | 6189 | { |
| 6189 | if (FRAME_TOOLBAR_HEIGHT (emacsframe) == 0) | 6190 | if (FRAME_TOOLBAR_HEIGHT (emacsframe) == 0) |
| 6190 | return; | 6191 | { |
| 6192 | NSTRACE_MSG ("Waiting for toolbar"); | ||
| 6193 | return; | ||
| 6194 | } | ||
| 6191 | wait_for_tool_bar = NO; | 6195 | wait_for_tool_bar = NO; |
| 6192 | } | 6196 | } |
| 6193 | 6197 | ||
| 6194 | neww = (int)wr.size.width - emacsframe->border_width; | 6198 | neww = (int)wr.size.width - emacsframe->border_width; |
| 6195 | newh = (int)wr.size.height - extra; | 6199 | newh = (int)wr.size.height - extra; |
| 6196 | 6200 | ||
| 6201 | NSTRACE_SIZE ("New size", NSMakeSize (neww, newh)); | ||
| 6202 | NSTRACE_MSG ("tool_bar_height: %d", emacsframe->tool_bar_height); | ||
| 6203 | |||
| 6197 | cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (emacsframe, neww); | 6204 | cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (emacsframe, neww); |
| 6198 | rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (emacsframe, newh); | 6205 | rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (emacsframe, newh); |
| 6199 | 6206 | ||
| @@ -6203,6 +6210,9 @@ not_in_argv (NSString *arg) | |||
| 6203 | if (rows < MINHEIGHT) | 6210 | if (rows < MINHEIGHT) |
| 6204 | rows = MINHEIGHT; | 6211 | rows = MINHEIGHT; |
| 6205 | 6212 | ||
| 6213 | NSTRACE_MSG ("New columns: %d", cols); | ||
| 6214 | NSTRACE_MSG ("New rows: %d", rows); | ||
| 6215 | |||
| 6206 | if (oldr != rows || oldc != cols || neww != oldw || newh != oldh) | 6216 | if (oldr != rows || oldc != cols || neww != oldw || newh != oldh) |
| 6207 | { | 6217 | { |
| 6208 | NSView *view = FRAME_NS_VIEW (emacsframe); | 6218 | NSView *view = FRAME_NS_VIEW (emacsframe); |
| @@ -6220,6 +6230,10 @@ not_in_argv (NSString *arg) | |||
| 6220 | [view setFrame: wr]; | 6230 | [view setFrame: wr]; |
| 6221 | [self windowDidMove:nil]; // Update top/left. | 6231 | [self windowDidMove:nil]; // Update top/left. |
| 6222 | } | 6232 | } |
| 6233 | else | ||
| 6234 | { | ||
| 6235 | NSTRACE_MSG ("No change"); | ||
| 6236 | } | ||
| 6223 | } | 6237 | } |
| 6224 | 6238 | ||
| 6225 | - (NSSize)windowWillResize: (NSWindow *)sender toSize: (NSSize)frameSize | 6239 | - (NSSize)windowWillResize: (NSWindow *)sender toSize: (NSSize)frameSize |
| @@ -6328,6 +6342,12 @@ not_in_argv (NSString *arg) | |||
| 6328 | { | 6342 | { |
| 6329 | NSTRACE ("windowDidResize"); | 6343 | NSTRACE ("windowDidResize"); |
| 6330 | 6344 | ||
| 6345 | if (emacsframe->output_data.ns->in_animation) | ||
| 6346 | { | ||
| 6347 | NSTRACE_MSG ("Ignored (in animation)"); | ||
| 6348 | return; | ||
| 6349 | } | ||
| 6350 | |||
| 6331 | if (! [self fsIsNative]) | 6351 | if (! [self fsIsNative]) |
| 6332 | { | 6352 | { |
| 6333 | NSWindow *theWindow = [notification object]; | 6353 | NSWindow *theWindow = [notification object]; |
| @@ -7425,6 +7445,7 @@ not_in_argv (NSString *arg) | |||
| 7425 | 7445 | ||
| 7426 | - (void) setRows: (int) r andColumns: (int) c | 7446 | - (void) setRows: (int) r andColumns: (int) c |
| 7427 | { | 7447 | { |
| 7448 | NSTRACE ("[EmacsView setRows:%d andColumns:%d]", r, c); | ||
| 7428 | rows = r; | 7449 | rows = r; |
| 7429 | cols = c; | 7450 | cols = c; |
| 7430 | } | 7451 | } |
diff --git a/src/process.c b/src/process.c index dc93b86cee2..ed1d59d01b0 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -7176,8 +7176,10 @@ setup_process_coding_systems (Lisp_Object process) | |||
| 7176 | } | 7176 | } |
| 7177 | 7177 | ||
| 7178 | DEFUN ("get-buffer-process", Fget_buffer_process, Sget_buffer_process, 1, 1, 0, | 7178 | DEFUN ("get-buffer-process", Fget_buffer_process, Sget_buffer_process, 1, 1, 0, |
| 7179 | doc: /* Return the (or a) process associated with BUFFER. | 7179 | doc: /* Return the (or a) live process associated with BUFFER. |
| 7180 | BUFFER may be a buffer or the name of one. */) | 7180 | BUFFER may be a buffer or the name of one. |
| 7181 | Return nil if all processes associated with BUFFER have been | ||
| 7182 | deleted or killed. */) | ||
| 7181 | (register Lisp_Object buffer) | 7183 | (register Lisp_Object buffer) |
| 7182 | { | 7184 | { |
| 7183 | #ifdef subprocesses | 7185 | #ifdef subprocesses |
diff --git a/test/automated/auto-revert-tests.el b/test/automated/auto-revert-tests.el index 86184d613fc..7cabc5c3e66 100644 --- a/test/automated/auto-revert-tests.el +++ b/test/automated/auto-revert-tests.el | |||
| @@ -136,8 +136,6 @@ | |||
| 136 | buf) | 136 | buf) |
| 137 | (unwind-protect | 137 | (unwind-protect |
| 138 | (progn | 138 | (progn |
| 139 | (with-current-buffer (get-buffer-create "*Messages*") | ||
| 140 | (narrow-to-region (point-max) (point-max))) | ||
| 141 | (setq buf (dired-noselect temporary-file-directory)) | 139 | (setq buf (dired-noselect temporary-file-directory)) |
| 142 | (with-current-buffer buf | 140 | (with-current-buffer buf |
| 143 | ;; `buffer-stale--default-function' checks for | 141 | ;; `buffer-stale--default-function' checks for |
| @@ -151,6 +149,8 @@ | |||
| 151 | 149 | ||
| 152 | ;; Delete file. We wait for a second, in order to have | 150 | ;; Delete file. We wait for a second, in order to have |
| 153 | ;; another timestamp. | 151 | ;; another timestamp. |
| 152 | (with-current-buffer (get-buffer-create "*Messages*") | ||
| 153 | (narrow-to-region (point-max) (point-max))) | ||
| 154 | (sleep-for 1) | 154 | (sleep-for 1) |
| 155 | (delete-file tmpfile) | 155 | (delete-file tmpfile) |
| 156 | 156 | ||
diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el index 56b4f69597d..222bdc52928 100644 --- a/test/automated/file-notify-tests.el +++ b/test/automated/file-notify-tests.el | |||
| @@ -61,6 +61,8 @@ | |||
| 61 | (defvar file-notify--test-results nil) | 61 | (defvar file-notify--test-results nil) |
| 62 | (defvar file-notify--test-event nil) | 62 | (defvar file-notify--test-event nil) |
| 63 | (defvar file-notify--test-events nil) | 63 | (defvar file-notify--test-events nil) |
| 64 | (defvar file-notify--test-expected-events nil) | ||
| 65 | |||
| 64 | (defun file-notify--test-timeout () | 66 | (defun file-notify--test-timeout () |
| 65 | "Timeout to wait for arriving events, in seconds." | 67 | "Timeout to wait for arriving events, in seconds." |
| 66 | (if (file-remote-p temporary-file-directory) 6 3)) | 68 | (if (file-remote-p temporary-file-directory) 6 3)) |
| @@ -71,12 +73,12 @@ | |||
| 71 | 73 | ||
| 72 | (when (and file-notify--test-tmpfile | 74 | (when (and file-notify--test-tmpfile |
| 73 | (file-exists-p file-notify--test-tmpfile)) | 75 | (file-exists-p file-notify--test-tmpfile)) |
| 74 | (if (directory-name-p file-notify--test-tmpfile) | 76 | (if (file-directory-p file-notify--test-tmpfile) |
| 75 | (delete-directory file-notify--test-tmpfile 'recursive) | 77 | (delete-directory file-notify--test-tmpfile 'recursive) |
| 76 | (delete-file file-notify--test-tmpfile))) | 78 | (delete-file file-notify--test-tmpfile))) |
| 77 | (when (and file-notify--test-tmpfile1 | 79 | (when (and file-notify--test-tmpfile1 |
| 78 | (file-exists-p file-notify--test-tmpfile1)) | 80 | (file-exists-p file-notify--test-tmpfile1)) |
| 79 | (if (directory-name-p file-notify--test-tmpfile1) | 81 | (if (file-directory-p file-notify--test-tmpfile1) |
| 80 | (delete-directory file-notify--test-tmpfile1 'recursive) | 82 | (delete-directory file-notify--test-tmpfile1 'recursive) |
| 81 | (delete-file file-notify--test-tmpfile1))) | 83 | (delete-file file-notify--test-tmpfile1))) |
| 82 | (when (file-remote-p temporary-file-directory) | 84 | (when (file-remote-p temporary-file-directory) |
| @@ -87,7 +89,8 @@ | |||
| 87 | file-notify--test-tmpfile1 nil | 89 | file-notify--test-tmpfile1 nil |
| 88 | file-notify--test-desc nil | 90 | file-notify--test-desc nil |
| 89 | file-notify--test-results nil | 91 | file-notify--test-results nil |
| 90 | file-notify--test-events nil) | 92 | file-notify--test-events nil |
| 93 | file-notify--test-expected-events nil) | ||
| 91 | (when file-notify--test-event | 94 | (when file-notify--test-event |
| 92 | (error "file-notify--test-event should not be set but bound dynamically"))) | 95 | (error "file-notify--test-event should not be set but bound dynamically"))) |
| 93 | 96 | ||
| @@ -226,13 +229,16 @@ being the result.") | |||
| 226 | "Ert test function to be called by `file-notify--test-event-handler'. | 229 | "Ert test function to be called by `file-notify--test-event-handler'. |
| 227 | We cannot pass arguments, so we assume that `file-notify--test-event' | 230 | We cannot pass arguments, so we assume that `file-notify--test-event' |
| 228 | is bound somewhere." | 231 | is bound somewhere." |
| 229 | ;;(message "Event %S" file-notify--test-event) | ||
| 230 | ;; Check the descriptor. | 232 | ;; Check the descriptor. |
| 231 | (should (equal (car file-notify--test-event) file-notify--test-desc)) | 233 | (should (equal (car file-notify--test-event) file-notify--test-desc)) |
| 232 | ;; Check the file name. | 234 | ;; Check the file name. |
| 233 | (should | 235 | (should |
| 234 | (string-equal (file-notify--event-file-name file-notify--test-event) | 236 | (or (string-equal (file-notify--event-file-name file-notify--test-event) |
| 235 | file-notify--test-tmpfile)) | 237 | file-notify--test-tmpfile) |
| 238 | (string-equal (directory-file-name | ||
| 239 | (file-name-directory | ||
| 240 | (file-notify--event-file-name file-notify--test-event))) | ||
| 241 | file-notify--test-tmpfile))) | ||
| 236 | ;; Check the second file name if exists. | 242 | ;; Check the second file name if exists. |
| 237 | (when (eq (nth 1 file-notify--test-event) 'renamed) | 243 | (when (eq (nth 1 file-notify--test-event) 'renamed) |
| 238 | (should | 244 | (should |
| @@ -247,10 +253,15 @@ and the event to `file-notify--test-events'." | |||
| 247 | (let* ((file-notify--test-event event) | 253 | (let* ((file-notify--test-event event) |
| 248 | (result | 254 | (result |
| 249 | (ert-run-test (make-ert-test :body 'file-notify--test-event-test)))) | 255 | (ert-run-test (make-ert-test :body 'file-notify--test-event-test)))) |
| 250 | (setq file-notify--test-events | 256 | ;; Do not add temporary files, this would confuse the checks. |
| 251 | (append file-notify--test-events `(,file-notify--test-event)) | 257 | (unless (string-match |
| 252 | file-notify--test-results | 258 | (regexp-quote ".#") |
| 253 | (append file-notify--test-results `(,result))))) | 259 | (file-notify--event-file-name file-notify--test-event)) |
| 260 | ;;(message "file-notify--test-event-handler %S" file-notify--test-event) | ||
| 261 | (setq file-notify--test-events | ||
| 262 | (append file-notify--test-events `(,file-notify--test-event)) | ||
| 263 | file-notify--test-results | ||
| 264 | (append file-notify--test-results `(,result)))))) | ||
| 254 | 265 | ||
| 255 | (defun file-notify--test-make-temp-name () | 266 | (defun file-notify--test-make-temp-name () |
| 256 | "Create a temporary file name for test." | 267 | "Create a temporary file name for test." |
| @@ -270,6 +281,8 @@ Don't wait longer than TIMEOUT seconds for the events to be delivered." | |||
| 270 | (declare (indent 2)) | 281 | (declare (indent 2)) |
| 271 | (let ((outer (make-symbol "outer"))) | 282 | (let ((outer (make-symbol "outer"))) |
| 272 | `(let ((,outer file-notify--test-events)) | 283 | `(let ((,outer file-notify--test-events)) |
| 284 | (setq file-notify--test-expected-events | ||
| 285 | (append file-notify--test-expected-events ,events)) | ||
| 273 | (let (file-notify--test-events) | 286 | (let (file-notify--test-events) |
| 274 | ,@body | 287 | ,@body |
| 275 | (file-notify--wait-for-events | 288 | (file-notify--wait-for-events |
| @@ -281,21 +294,47 @@ Don't wait longer than TIMEOUT seconds for the events to be delivered." | |||
| 281 | (ert-deftest file-notify-test02-events () | 294 | (ert-deftest file-notify-test02-events () |
| 282 | "Check file creation/change/removal notifications." | 295 | "Check file creation/change/removal notifications." |
| 283 | (skip-unless (file-notify--test-local-enabled)) | 296 | (skip-unless (file-notify--test-local-enabled)) |
| 297 | |||
| 298 | (setq file-notify--test-tmpfile (file-notify--test-make-temp-name) | ||
| 299 | file-notify--test-tmpfile1 (file-notify--test-make-temp-name)) | ||
| 300 | |||
| 284 | (unwind-protect | 301 | (unwind-protect |
| 285 | (progn | 302 | (progn |
| 286 | ;; Check creation, change, and deletion. | 303 | ;; Check creation, change and deletion. |
| 287 | (setq file-notify--test-tmpfile (file-notify--test-make-temp-name) | 304 | (setq file-notify--test-desc |
| 288 | file-notify--test-tmpfile1 (file-notify--test-make-temp-name) | ||
| 289 | file-notify--test-desc | ||
| 290 | (file-notify-add-watch | 305 | (file-notify-add-watch |
| 291 | file-notify--test-tmpfile | 306 | file-notify--test-tmpfile |
| 292 | '(change) 'file-notify--test-event-handler)) | 307 | '(change) 'file-notify--test-event-handler)) |
| 293 | (file-notify--test-with-events | 308 | (file-notify--test-with-events |
| 294 | (file-notify--test-timeout) '(created changed deleted stopped) | 309 | (file-notify--test-timeout) '(created changed deleted) |
| 295 | (write-region | 310 | (write-region |
| 296 | "any text" nil file-notify--test-tmpfile nil 'no-message) | 311 | "any text" nil file-notify--test-tmpfile nil 'no-message) |
| 297 | (delete-file file-notify--test-tmpfile)) | 312 | (delete-file file-notify--test-tmpfile)) |
| 298 | (file-notify-rm-watch file-notify--test-desc) | 313 | ;; `file-notify-rm-watch' fires the `stopped' event. Suppress it. |
| 314 | (let (file-notify--test-events) | ||
| 315 | (file-notify-rm-watch file-notify--test-desc)) | ||
| 316 | |||
| 317 | ;; Check creation, change and deletion. There must be a | ||
| 318 | ;; `stopped' event when deleting the directory. It doesn't | ||
| 319 | ;; work for w32notify. | ||
| 320 | (unless (eq file-notify--library 'w32notify) | ||
| 321 | (make-directory file-notify--test-tmpfile) | ||
| 322 | (setq file-notify--test-desc | ||
| 323 | (file-notify-add-watch | ||
| 324 | file-notify--test-tmpfile | ||
| 325 | '(change) 'file-notify--test-event-handler)) | ||
| 326 | (file-notify--test-with-events | ||
| 327 | (file-notify--test-timeout) | ||
| 328 | ;; There are two `deleted' events, for the file and for | ||
| 329 | ;; the directory. | ||
| 330 | '(created changed deleted deleted stopped) | ||
| 331 | (write-region | ||
| 332 | "any text" nil (expand-file-name "foo" file-notify--test-tmpfile) | ||
| 333 | nil 'no-message) | ||
| 334 | (delete-directory file-notify--test-tmpfile 'recursive)) | ||
| 335 | ;; `file-notify-rm-watch' fires the `stopped' event. Suppress it. | ||
| 336 | (let (file-notify--test-events) | ||
| 337 | (file-notify-rm-watch file-notify--test-desc))) | ||
| 299 | 338 | ||
| 300 | ;; Check copy. | 339 | ;; Check copy. |
| 301 | (setq file-notify--test-desc | 340 | (setq file-notify--test-desc |
| @@ -308,8 +347,8 @@ Don't wait longer than TIMEOUT seconds for the events to be delivered." | |||
| 308 | ;; w32notify does not distinguish between `changed' and | 347 | ;; w32notify does not distinguish between `changed' and |
| 309 | ;; `attribute-changed'. | 348 | ;; `attribute-changed'. |
| 310 | (if (eq file-notify--library 'w32notify) | 349 | (if (eq file-notify--library 'w32notify) |
| 311 | '(created changed changed deleted stopped) | 350 | '(created changed changed deleted) |
| 312 | '(created changed deleted stopped)) | 351 | '(created changed deleted)) |
| 313 | (write-region | 352 | (write-region |
| 314 | "any text" nil file-notify--test-tmpfile nil 'no-message) | 353 | "any text" nil file-notify--test-tmpfile nil 'no-message) |
| 315 | (copy-file file-notify--test-tmpfile file-notify--test-tmpfile1) | 354 | (copy-file file-notify--test-tmpfile file-notify--test-tmpfile1) |
| @@ -319,7 +358,9 @@ Don't wait longer than TIMEOUT seconds for the events to be delivered." | |||
| 319 | (set-file-times file-notify--test-tmpfile '(0 0)) | 358 | (set-file-times file-notify--test-tmpfile '(0 0)) |
| 320 | (delete-file file-notify--test-tmpfile) | 359 | (delete-file file-notify--test-tmpfile) |
| 321 | (delete-file file-notify--test-tmpfile1)) | 360 | (delete-file file-notify--test-tmpfile1)) |
| 322 | (file-notify-rm-watch file-notify--test-desc) | 361 | ;; `file-notify-rm-watch' fires the `stopped' event. Suppress it. |
| 362 | (let (file-notify--test-events) | ||
| 363 | (file-notify-rm-watch file-notify--test-desc)) | ||
| 323 | 364 | ||
| 324 | ;; Check rename. | 365 | ;; Check rename. |
| 325 | (setq file-notify--test-desc | 366 | (setq file-notify--test-desc |
| @@ -328,13 +369,15 @@ Don't wait longer than TIMEOUT seconds for the events to be delivered." | |||
| 328 | '(change) 'file-notify--test-event-handler)) | 369 | '(change) 'file-notify--test-event-handler)) |
| 329 | (should file-notify--test-desc) | 370 | (should file-notify--test-desc) |
| 330 | (file-notify--test-with-events | 371 | (file-notify--test-with-events |
| 331 | (file-notify--test-timeout) '(created changed renamed stopped) | 372 | (file-notify--test-timeout) '(created changed renamed) |
| 332 | (write-region | 373 | (write-region |
| 333 | "any text" nil file-notify--test-tmpfile nil 'no-message) | 374 | "any text" nil file-notify--test-tmpfile nil 'no-message) |
| 334 | (rename-file file-notify--test-tmpfile file-notify--test-tmpfile1) | 375 | (rename-file file-notify--test-tmpfile file-notify--test-tmpfile1) |
| 335 | ;; After the rename, we won't get events anymore. | 376 | ;; After the rename, we won't get events anymore. |
| 336 | (delete-file file-notify--test-tmpfile1)) | 377 | (delete-file file-notify--test-tmpfile1)) |
| 337 | (file-notify-rm-watch file-notify--test-desc) | 378 | ;; `file-notify-rm-watch' fires the `stopped' event. Suppress it. |
| 379 | (let (file-notify--test-events) | ||
| 380 | (file-notify-rm-watch file-notify--test-desc)) | ||
| 338 | 381 | ||
| 339 | ;; Check attribute change. It doesn't work for w32notify. | 382 | ;; Check attribute change. It doesn't work for w32notify. |
| 340 | (unless (eq file-notify--library 'w32notify) | 383 | (unless (eq file-notify--library 'w32notify) |
| @@ -359,29 +402,16 @@ Don't wait longer than TIMEOUT seconds for the events to be delivered." | |||
| 359 | (set-file-times file-notify--test-tmpfile '(0 0)) | 402 | (set-file-times file-notify--test-tmpfile '(0 0)) |
| 360 | (read-event nil nil 0.1) | 403 | (read-event nil nil 0.1) |
| 361 | (delete-file file-notify--test-tmpfile)) | 404 | (delete-file file-notify--test-tmpfile)) |
| 362 | (file-notify-rm-watch file-notify--test-desc)) | 405 | ;; `file-notify-rm-watch' fires the `stopped' event. Suppress it. |
| 406 | (let (file-notify--test-events) | ||
| 407 | (file-notify-rm-watch file-notify--test-desc))) | ||
| 363 | 408 | ||
| 364 | ;; Check the global sequence again just to make sure that | 409 | ;; Check the global sequence again just to make sure that |
| 365 | ;; `file-notify--test-events' has been set correctly. | 410 | ;; `file-notify--test-events' has been set correctly. |
| 366 | (should (equal | 411 | (should (equal (mapcar #'cadr file-notify--test-events) |
| 367 | (mapcar #'cadr file-notify--test-events) | 412 | file-notify--test-expected-events)) |
| 368 | (if (eq file-notify--library 'w32notify) | ||
| 369 | '(created changed deleted stopped | ||
| 370 | created changed changed deleted stopped | ||
| 371 | created changed renamed stopped) | ||
| 372 | (if (file-remote-p temporary-file-directory) | ||
| 373 | '(created changed deleted stopped | ||
| 374 | created changed deleted stopped | ||
| 375 | created changed renamed stopped | ||
| 376 | attribute-changed attribute-changed | ||
| 377 | attribute-changed stopped) | ||
| 378 | '(created changed deleted stopped | ||
| 379 | created changed deleted stopped | ||
| 380 | created changed renamed stopped | ||
| 381 | attribute-changed attribute-changed stopped))))) | ||
| 382 | (should file-notify--test-results) | 413 | (should file-notify--test-results) |
| 383 | (dolist (result file-notify--test-results) | 414 | (dolist (result file-notify--test-results) |
| 384 | ;;(message "%s" (ert-test-result-messages result)) | ||
| 385 | (when (ert-test-failed-p result) | 415 | (when (ert-test-failed-p result) |
| 386 | (ert-fail | 416 | (ert-fail |
| 387 | (cadr (ert-test-result-with-condition-condition result)))))) | 417 | (cadr (ert-test-result-with-condition-condition result)))))) |
| @@ -429,8 +459,10 @@ Don't wait longer than TIMEOUT seconds for the events to be delivered." | |||
| 429 | (should auto-revert-use-notify) | 459 | (should auto-revert-use-notify) |
| 430 | (should auto-revert-notify-watch-descriptor) | 460 | (should auto-revert-notify-watch-descriptor) |
| 431 | 461 | ||
| 432 | ;; Modify file. We wait for a second, in order to | 462 | ;; Modify file. We wait for a second, in order to have |
| 433 | ;; have another timestamp. | 463 | ;; another timestamp. |
| 464 | (with-current-buffer (get-buffer-create "*Messages*") | ||
| 465 | (narrow-to-region (point-max) (point-max))) | ||
| 434 | (sleep-for 1) | 466 | (sleep-for 1) |
| 435 | (write-region | 467 | (write-region |
| 436 | "another text" nil file-notify--test-tmpfile nil 'no-message) | 468 | "another text" nil file-notify--test-tmpfile nil 'no-message) |
| @@ -442,9 +474,34 @@ Don't wait longer than TIMEOUT seconds for the events to be delivered." | |||
| 442 | (string-match | 474 | (string-match |
| 443 | (format-message "Reverting buffer `%s'." (buffer-name buf)) | 475 | (format-message "Reverting buffer `%s'." (buffer-name buf)) |
| 444 | (buffer-string)))) | 476 | (buffer-string)))) |
| 445 | (should (string-match "another text" (buffer-string))))) | 477 | (should (string-match "another text" (buffer-string))) |
| 478 | |||
| 479 | ;; Stop file notification. Autorevert shall still work via polling. | ||
| 480 | (file-notify-rm-watch auto-revert-notify-watch-descriptor) | ||
| 481 | (file-notify--wait-for-events | ||
| 482 | timeout (null auto-revert-use-notify)) | ||
| 483 | (should-not auto-revert-use-notify) | ||
| 484 | (should-not auto-revert-notify-watch-descriptor) | ||
| 485 | |||
| 486 | ;; Modify file. We wait for two seconds, in order to have | ||
| 487 | ;; another timestamp. One second seems to be too short. | ||
| 488 | (with-current-buffer (get-buffer-create "*Messages*") | ||
| 489 | (narrow-to-region (point-max) (point-max))) | ||
| 490 | (sleep-for 2) | ||
| 491 | (write-region | ||
| 492 | "foo bla" nil file-notify--test-tmpfile nil 'no-message) | ||
| 493 | |||
| 494 | ;; Check, that the buffer has been reverted. | ||
| 495 | (with-current-buffer (get-buffer-create "*Messages*") | ||
| 496 | (file-notify--wait-for-events | ||
| 497 | timeout | ||
| 498 | (string-match | ||
| 499 | (format-message "Reverting buffer `%s'." (buffer-name buf)) | ||
| 500 | (buffer-string)))) | ||
| 501 | (should (string-match "foo bla" (buffer-string))))) | ||
| 446 | 502 | ||
| 447 | ;; Cleanup. | 503 | ;; Cleanup. |
| 504 | (with-current-buffer "*Messages*" (widen)) | ||
| 448 | (ignore-errors (kill-buffer buf)) | 505 | (ignore-errors (kill-buffer buf)) |
| 449 | (file-notify--test-cleanup)))) | 506 | (file-notify--test-cleanup)))) |
| 450 | 507 | ||
| @@ -463,41 +520,16 @@ Don't wait longer than TIMEOUT seconds for the events to be delivered." | |||
| 463 | file-notify--test-tmpfile | 520 | file-notify--test-tmpfile |
| 464 | '(change) #'file-notify--test-event-handler)) | 521 | '(change) #'file-notify--test-event-handler)) |
| 465 | (file-notify--test-with-events | 522 | (file-notify--test-with-events |
| 466 | (file-notify--test-timeout) '(created changed) | 523 | (file-notify--test-timeout) '(created changed deleted) |
| 467 | (should (file-notify-valid-p file-notify--test-desc)) | 524 | (should (file-notify-valid-p file-notify--test-desc)) |
| 468 | (write-region | 525 | (write-region |
| 469 | "any text" nil file-notify--test-tmpfile nil 'no-message) | 526 | "any text" nil file-notify--test-tmpfile nil 'no-message) |
| 470 | (should (file-notify-valid-p file-notify--test-desc))) | 527 | (delete-file file-notify--test-tmpfile)) |
| 471 | ;; After removing the watch, the descriptor must not be valid | 528 | ;; After deleting the file, the descriptor is still valid. |
| 529 | (should (file-notify-valid-p file-notify--test-desc)) | ||
| 530 | ;; After removing the watch, the descriptor must not be valid | ||
| 472 | ;; anymore. | 531 | ;; anymore. |
| 473 | (file-notify-rm-watch file-notify--test-desc) | 532 | (file-notify-rm-watch file-notify--test-desc) |
| 474 | (file-notify--wait-for-events | ||
| 475 | (file-notify--test-timeout) | ||
| 476 | (not (file-notify-valid-p file-notify--test-desc))) | ||
| 477 | (should-not (file-notify-valid-p file-notify--test-desc))) | ||
| 478 | |||
| 479 | ;; Cleanup. | ||
| 480 | (file-notify--test-cleanup)) | ||
| 481 | |||
| 482 | (unwind-protect | ||
| 483 | (progn | ||
| 484 | (setq file-notify--test-tmpfile (file-notify--test-make-temp-name) | ||
| 485 | file-notify--test-desc | ||
| 486 | (file-notify-add-watch | ||
| 487 | file-notify--test-tmpfile | ||
| 488 | '(change) #'file-notify--test-event-handler)) | ||
| 489 | (file-notify--test-with-events | ||
| 490 | (file-notify--test-timeout) '(created changed) | ||
| 491 | (should (file-notify-valid-p file-notify--test-desc)) | ||
| 492 | (write-region | ||
| 493 | "any text" nil file-notify--test-tmpfile nil 'no-message) | ||
| 494 | (should (file-notify-valid-p file-notify--test-desc))) | ||
| 495 | ;; After deleting the file, the descriptor must not be valid | ||
| 496 | ;; anymore. | ||
| 497 | (delete-file file-notify--test-tmpfile) | ||
| 498 | (file-notify--wait-for-events | ||
| 499 | (file-notify--test-timeout) | ||
| 500 | (not (file-notify-valid-p file-notify--test-desc))) | ||
| 501 | (should-not (file-notify-valid-p file-notify--test-desc))) | 533 | (should-not (file-notify-valid-p file-notify--test-desc))) |
| 502 | 534 | ||
| 503 | ;; Cleanup. | 535 | ;; Cleanup. |
| @@ -506,26 +538,23 @@ Don't wait longer than TIMEOUT seconds for the events to be delivered." | |||
| 506 | (unwind-protect | 538 | (unwind-protect |
| 507 | ;; The batch-mode operation of w32notify is fragile (there's no | 539 | ;; The batch-mode operation of w32notify is fragile (there's no |
| 508 | ;; input threads to send the message to). | 540 | ;; input threads to send the message to). |
| 509 | (unless (and noninteractive (eq file-notify--library 'w32notify)) | 541 | ;(unless (and noninteractive (eq file-notify--library 'w32notify)) |
| 510 | (let ((temporary-file-directory (make-temp-file | 542 | (unless (eq file-notify--library 'w32notify) |
| 511 | "file-notify-test-parent" t))) | 543 | (let ((temporary-file-directory |
| 544 | (make-temp-file "file-notify-test-parent" t))) | ||
| 512 | (setq file-notify--test-tmpfile (file-notify--test-make-temp-name) | 545 | (setq file-notify--test-tmpfile (file-notify--test-make-temp-name) |
| 513 | file-notify--test-desc | 546 | file-notify--test-desc |
| 514 | (file-notify-add-watch | 547 | (file-notify-add-watch |
| 515 | file-notify--test-tmpfile | 548 | file-notify--test-tmpfile |
| 516 | '(change) #'file-notify--test-event-handler)) | 549 | '(change) #'file-notify--test-event-handler)) |
| 517 | (file-notify--test-with-events | 550 | (file-notify--test-with-events |
| 518 | (file-notify--test-timeout) '(created changed) | 551 | (file-notify--test-timeout) '(created changed deleted stopped) |
| 519 | (should (file-notify-valid-p file-notify--test-desc)) | 552 | (should (file-notify-valid-p file-notify--test-desc)) |
| 520 | (write-region | 553 | (write-region |
| 521 | "any text" nil file-notify--test-tmpfile nil 'no-message) | 554 | "any text" nil file-notify--test-tmpfile nil 'no-message) |
| 522 | (should (file-notify-valid-p file-notify--test-desc))) | 555 | (delete-directory temporary-file-directory t)) |
| 523 | ;; After deleting the parent, the descriptor must not be | 556 | ;; After deleting the parent directory, the descriptor must |
| 524 | ;; valid anymore. | 557 | ;; not be valid anymore. |
| 525 | (delete-directory temporary-file-directory t) | ||
| 526 | (file-notify--wait-for-events | ||
| 527 | (file-notify--test-timeout) | ||
| 528 | (not (file-notify-valid-p file-notify--test-desc))) | ||
| 529 | (should-not (file-notify-valid-p file-notify--test-desc)))) | 558 | (should-not (file-notify-valid-p file-notify--test-desc)))) |
| 530 | 559 | ||
| 531 | ;; Cleanup. | 560 | ;; Cleanup. |
| @@ -540,8 +569,8 @@ Don't wait longer than TIMEOUT seconds for the events to be delivered." | |||
| 540 | 569 | ||
| 541 | (unwind-protect | 570 | (unwind-protect |
| 542 | (progn | 571 | (progn |
| 543 | (setq file-notify--test-tmpfile (file-name-as-directory | 572 | (setq file-notify--test-tmpfile |
| 544 | (file-notify--test-make-temp-name))) | 573 | (file-name-as-directory (file-notify--test-make-temp-name))) |
| 545 | (make-directory file-notify--test-tmpfile) | 574 | (make-directory file-notify--test-tmpfile) |
| 546 | (setq file-notify--test-desc | 575 | (setq file-notify--test-desc |
| 547 | (file-notify-add-watch | 576 | (file-notify-add-watch |
| @@ -551,6 +580,9 @@ Don't wait longer than TIMEOUT seconds for the events to be delivered." | |||
| 551 | ;; After removing the watch, the descriptor must not be valid | 580 | ;; After removing the watch, the descriptor must not be valid |
| 552 | ;; anymore. | 581 | ;; anymore. |
| 553 | (file-notify-rm-watch file-notify--test-desc) | 582 | (file-notify-rm-watch file-notify--test-desc) |
| 583 | (file-notify--wait-for-events | ||
| 584 | (file-notify--test-timeout) | ||
| 585 | (not (file-notify-valid-p file-notify--test-desc))) | ||
| 554 | (should-not (file-notify-valid-p file-notify--test-desc))) | 586 | (should-not (file-notify-valid-p file-notify--test-desc))) |
| 555 | 587 | ||
| 556 | ;; Cleanup. | 588 | ;; Cleanup. |
| @@ -560,8 +592,8 @@ Don't wait longer than TIMEOUT seconds for the events to be delivered." | |||
| 560 | ;; The batch-mode operation of w32notify is fragile (there's no | 592 | ;; The batch-mode operation of w32notify is fragile (there's no |
| 561 | ;; input threads to send the message to). | 593 | ;; input threads to send the message to). |
| 562 | (unless (and noninteractive (eq file-notify--library 'w32notify)) | 594 | (unless (and noninteractive (eq file-notify--library 'w32notify)) |
| 563 | (setq file-notify--test-tmpfile (file-name-as-directory | 595 | (setq file-notify--test-tmpfile |
| 564 | (file-notify--test-make-temp-name))) | 596 | (file-name-as-directory (file-notify--test-make-temp-name))) |
| 565 | (make-directory file-notify--test-tmpfile) | 597 | (make-directory file-notify--test-tmpfile) |
| 566 | (setq file-notify--test-desc | 598 | (setq file-notify--test-desc |
| 567 | (file-notify-add-watch | 599 | (file-notify-add-watch |
| @@ -589,5 +621,10 @@ Don't wait longer than TIMEOUT seconds for the events to be delivered." | |||
| 589 | (ert-run-tests-interactively "^file-notify-") | 621 | (ert-run-tests-interactively "^file-notify-") |
| 590 | (ert-run-tests-batch "^file-notify-"))) | 622 | (ert-run-tests-batch "^file-notify-"))) |
| 591 | 623 | ||
| 624 | ;; TODO: | ||
| 625 | |||
| 626 | ;; * It does not work yet for local gfilenotify and remote inotifywait. | ||
| 627 | ;; * For w32notify, no stopped events arrive when a directory is removed. | ||
| 628 | |||
| 592 | (provide 'file-notify-tests) | 629 | (provide 'file-notify-tests) |
| 593 | ;;; file-notify-tests.el ends here | 630 | ;;; file-notify-tests.el ends here |
diff --git a/test/automated/simple-test.el b/test/automated/simple-test.el index a9c4d67556e..8da575d5d97 100644 --- a/test/automated/simple-test.el +++ b/test/automated/simple-test.el | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | (debug t)) | 26 | (debug t)) |
| 27 | `(with-temp-buffer | 27 | `(with-temp-buffer |
| 28 | (emacs-lisp-mode) | 28 | (emacs-lisp-mode) |
| 29 | (setq indent-tabs-mode nil) | ||
| 29 | (insert "(a b") | 30 | (insert "(a b") |
| 30 | (save-excursion (insert " c d)")) | 31 | (save-excursion (insert " c d)")) |
| 31 | ,@body | 32 | ,@body |