commit ac9a931d595dd83ebac61c6c9cf7388985fee277 (HEAD, refs/remotes/origin/master) Author: Glenn Morris Date: Fri Mar 4 13:36:12 2016 -0500 * lisp/files.el: Fix recent typo. diff --git a/lisp/files.el b/lisp/files.el index c892ab4..9b045a8 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -7098,44 +7098,44 @@ symbolic link, or nil." This is either a string or a number. If a string value cannot be looked up, a numeric value, either an integer or a float, is returned." - (ntf 2 attributes)) + (nth 2 attributes)) (defsubst file-attribute-group-id (attributes) "The GID field in ATTRIBUTES returned by `file-attribute'. This is either a string or a number. If a string value cannot be looked up, a numeric value, either an integer or a float, is returned." - (ntf 3 attributes)) + (nth 3 attributes)) (defsubst file-attribute-access-time (attributes) "The last access time in ATTRIBUTES returned by `file-attribute'. This a list of integers (HIGH LOW USEC PSEC) in the same style as (current-time)." - (ntf 4 attributes)) + (nth 4 attributes)) (defsubst file-attribute-modification-time (attributes) "The modification time in ATTRIBUTES returned by `file-attribute'. This is the time of the last change to the file's contents, and is a list of integers (HIGH LOW USEC PSEC) in the same style as (current-time)." - (ntf 5 attributes)) + (nth 5 attributes)) (defsubst file-attribute-status-change-time (attributes) "The status modification time in ATTRIBUTES returned by `file-attribute'. This is the time of last change to the file's attributes: owner and group, access mode bits, etc, and is a list of integers (HIGH LOW USEC PSEC) in the same style as (current-time)." - (ntf 6 attributes)) + (nth 6 attributes)) (defsubst file-attribute-size (attributes) "The size (in bytes) in ATTRIBUTES returned by `file-attribute'. This is a floating point number if the size is too large for an integer." - (ntf 7 attributes)) + (nth 7 attributes)) (defsubst file-attribute-modes (attributes) "The file modes in ATTRIBUTES returned by `file-attribute'. This is a string of ten letters or dashes as in ls -l." - (ntf 8 attributes)) + (nth 8 attributes)) (defsubst file-attribute-inode-number (attributes) "The inode number in ATTRIBUTES returned by `file-attribute'. @@ -7144,7 +7144,7 @@ the form (HIGH . LOW): first the high bits, then the low 16 bits. If even HIGH is too large for an Emacs integer, this is instead of the form (HIGH MIDDLE . LOW): first the high bits, then the middle 24 bits, and finally the low 16 bits." - (ntf 10 attributes)) + (nth 10 attributes)) (defsubst file-attribute-device-number (attributes) "The file system device number in ATTRIBUTES returned by `file-attribute'. @@ -7153,7 +7153,7 @@ the form (HIGH . LOW): first the high bits, then the low 16 bits. If even HIGH is too large for an Emacs integer, this is instead of the form (HIGH MIDDLE . LOW): first the high bits, then the middle 24 bits, and finally the low 16 bits." - (ntf 11 attributes)) + (nth 11 attributes)) (define-key ctl-x-map "\C-f" 'find-file) commit 0cfdf1e83df2e73a80d7a4909b68fb1aa907c509 Author: Glenn Morris Date: Fri Mar 4 13:34:51 2016 -0500 * lisp/subr.el (read-multiple-choice): Avoid free variable. diff --git a/lisp/subr.el b/lisp/subr.el index 7b0850f..fb1e029 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2296,7 +2296,7 @@ Usage example: altered-name)) (append choices '((?? "?"))) ", "))) - tchar buf wrong-char) + tchar buf wrong-char answer) (save-window-excursion (save-excursion (while (not tchar) commit 9f9b4fa783ef94d41c7c5410efc15e9b26865577 Author: Glenn Morris Date: Fri Mar 4 12:41:14 2016 -0500 * doc/lispref/files.texi (File Attributes): Fix typo. diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 8a6cb7b..f3650a4 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -1237,7 +1237,7 @@ the file's contents were modified. @item The time of last status change as a list of four integers (as above) -(code{file-attribute-status-change-time}). This is the time of the +(@code{file-attribute-status-change-time}). This is the time of the last change to the file's access mode bits, its owner and group, and other information recorded in the filesystem for the file, beyond the file's contents. commit 1ba03225ad7a9228d5ceee14dcf6669c6a32babb Author: Lars Ingebrigtsen Date: Fri Mar 4 14:09:02 2016 +0000 Make the describe-key prompts clearer * lisp/help.el (describe-key-briefly): Make the prompt clearer (bug#14854). (describe-key): Ditto. diff --git a/lisp/help.el b/lisp/help.el index ce68cea..baccf59 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -615,7 +615,7 @@ temporarily enables it to allow getting help on disabled items and buttons." (menu-bar-update-yank-menu "(any string)" nil)) (while (progn - (setq key (read-key-sequence "Describe key (or click or menu item): ")) + (setq key (read-key-sequence "Describe the following key, mouse click, or menu item: ")) (and (vectorp key) (consp (aref key 0)) (symbolp (car (aref key 0))) @@ -760,7 +760,7 @@ temporarily enables it to allow getting help on disabled items and buttons." (menu-bar-update-yank-menu "(any string)" nil)) (while (progn - (setq key (read-key-sequence "Describe key (or click or menu item): ")) + (setq key (read-key-sequence "Describe the following key, mouse click, or menu item: ")) (and (vectorp key) (consp (aref key 0)) (symbolp (car (aref key 0))) commit cede502627415df2e5f30ad0f3600236f9603158 Author: Lars Ingebrigtsen Date: Fri Mar 4 14:02:11 2016 +0000 Allow scrolling while querying multiple choice * lisp/subr.el (read-multiple-choice): Allow scrolling the buffer while querying (bug#22827). diff --git a/lisp/subr.el b/lisp/subr.el index 6eea54f..7b0850f 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2244,6 +2244,14 @@ might be shortened), and the third, optional entry is a longer explanation that will be displayed in a help buffer if the user requests more help. +This function translates user input into responses by consulting +the bindings in `query-replace-map'; see the documentation of +that variable for more information. In this case, the useful +bindings are `recenter', `scroll-up', and `scroll-down'. If the +user enters `recenter', `scroll-up', or `scroll-down' responses, +perform the requested window recentering or scrolling and ask +again. + The return value is the matching entry from the CHOICES list. Usage example: @@ -2314,9 +2322,27 @@ Usage example: (let ((cursor-in-echo-area t)) (read-char)) (error nil)))) + (setq answer (lookup-key query-replace-map (vector tchar) t)) + (setq tchar + (cond + ((eq answer 'recenter) + (recenter) t) + ((eq answer 'scroll-up) + (ignore-errors (scroll-up-command)) t) + ((eq answer 'scroll-down) + (ignore-errors (scroll-down-command)) t) + ((eq answer 'scroll-other-window) + (ignore-errors (scroll-other-window)) t) + ((eq answer 'scroll-other-window-down) + (ignore-errors (scroll-other-window-down)) t) + (t tchar))) + (when (eq tchar t) + (setq wrong-char nil + tchar nil)) ;; The user has entered an invalid choice, so display the ;; help messages. - (when (not (assq tchar choices)) + (when (and (not (eq tchar nil)) + (not (assq tchar choices))) (setq wrong-char (not (memq tchar '(?? ?\C-h))) tchar nil) (when wrong-char commit 2d5b20f68c194e7fec7b9602935fd95149e9b7c6 Author: Lars Ingebrigtsen Date: Fri Mar 4 13:39:07 2016 +0000 Add accessors for `file-attributes' * doc/lispref/files.texi (File Attributes): Mention the accessors. * lisp/files.el (file-attribute-type) (file-attribute-link-number, file-attribute-user-id) (file-attribute-group-id, file-attribute-access-time) (file-attribute-modification-time) (file-attribute-change-time, file-attribute-size) (file-attribute-modes, file-attribute-inode-number) (file-attribute-device-number): New functions. * src/dired.c (Ffile_attributes): Mention the accessors (bug#22890). diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 6b7ee19..8a6cb7b 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -1195,73 +1195,83 @@ the default, but we plan to change that, so you should specify a non-@code{nil} value for @var{id-format} if you use the returned @acronym{UID} or @acronym{GID}. +Accessor functions are provided to access the elements in this list. +The accessors are mentioned along with the descriptions of the +elements below. + The elements of the list, in order, are: @enumerate 0 @item @code{t} for a directory, a string for a symbolic link (the name -linked to), or @code{nil} for a text file. +linked to), or @code{nil} for a text file +(@code{file-attribute-type}). @c Wordy so as to prevent an overfull hbox. --rjc 15mar92 @item -The number of names the file has. Alternate names, also known as hard -links, can be created by using the @code{add-name-to-file} function -(@pxref{Changing Files}). +The number of names the file has (@code{file-attribute-link-number}). +Alternate names, also known as hard links, can be created by using the +@code{add-name-to-file} function (@pxref{Changing Files}). @item -The file's @acronym{UID}, normally as a string. However, if it does -not correspond to a named user, the value is a number. +The file's @acronym{UID}, normally as a string +(@code{file-attribute-user-id}). However, if it does not correspond +to a named user, the value is a number. @item -The file's @acronym{GID}, likewise. +The file's @acronym{GID}, likewise (@code{file-attribute-group-id}). @item -The time of last access, as a list of four integers @code{(@var{sec-high} -@var{sec-low} @var{microsec} @var{picosec})}. (This is similar to the -value of @code{current-time}; see @ref{Time of Day}.) Note that on -some FAT-based filesystems, only the date of last access is recorded, -so this time will always hold the midnight of the day of last access. +The time of last access, as a list of four integers +@code{(@var{sec-high} @var{sec-low} @var{microsec} @var{picosec})} +(@code{file-attribute-access-time}). (This is similar to the value of +@code{current-time}; see @ref{Time of Day}.) Note that on some +FAT-based filesystems, only the date of last access is recorded, so +this time will always hold the midnight of the day of last access. @cindex modification time of file @item -The time of last modification as a list of four integers (as above). -This is the last time when the file's contents were modified. +The time of last modification as a list of four integers (as above) +(@code{file-attribute-modification-time}). This is the last time when +the file's contents were modified. @item -The time of last status change as a list of four integers (as above). -This is the time of the last change to the file's access mode bits, -its owner and group, and other information recorded in the filesystem -for the file, beyond the file's contents. +The time of last status change as a list of four integers (as above) +(code{file-attribute-status-change-time}). This is the time of the +last change to the file's access mode bits, its owner and group, and +other information recorded in the filesystem for the file, beyond the +file's contents. @item -The size of the file in bytes. This is floating point if the size is -too large to fit in a Lisp integer. +The size of the file in bytes (@code{file-attribute-size}). This is +floating point if the size is too large to fit in a Lisp integer. @item -The file's modes, as a string of ten letters or dashes, -as in @samp{ls -l}. +The file's modes, as a string of ten letters or dashes, as in +@samp{ls -l} (@code{file-attribute-modes}). @item An unspecified value, present for backward compatibility. @item -The file's inode number. If possible, this is an integer. If the -inode number is too large to be represented as an integer in Emacs -Lisp but dividing it by @math{2^{16}} yields a representable integer, -then the value has the +The file's inode number (@code{file-attribute-inode-number}). If +possible, this is an integer. If the inode number is too large to be +represented as an integer in Emacs Lisp but dividing it by +@math{2^{16}} yields a representable integer, then the value has the form @code{(@var{high} . @var{low})}, where @var{low} holds the low 16 -bits. If the inode number is too wide for even that, the value is of the form -@code{(@var{high} @var{middle} . @var{low})}, where @code{high} holds -the high bits, @var{middle} the middle 24 bits, and @var{low} the low -16 bits. +bits. If the inode number is too wide for even that, the value is of +the form @code{(@var{high} @var{middle} . @var{low})}, where +@code{high} holds the high bits, @var{middle} the middle 24 bits, and +@var{low} the low 16 bits. @item -The filesystem number of the device that the file is on. Depending on -the magnitude of the value, this can be either an integer or a cons -cell, in the same manner as the inode number. This element and the -file's inode number together give enough information to distinguish -any two files on the system---no two files can have the same values -for both of these numbers. +The filesystem number of the device that the file is on +@code{file-attribute-device-number}). Depending on the magnitude of +the value, this can be either an integer or a cons cell, in the same +manner as the inode number. This element and the file's inode number +together give enough information to distinguish any two files on the +system---no two files can have the same values for both of these +numbers. @end enumerate For example, here are the file attributes for @file{files.texi}: diff --git a/etc/NEWS b/etc/NEWS index d7e1b83..b29d460 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -40,6 +40,16 @@ erc-emacs-build-time. * Changes in Emacs 25.2 ++++ +** A number of accessors for the value returned by `file-attributes' +has been added. They are: `file-attribute-type', +`file-attribute-link-number', `file-attribute-user-id', +`file-attribute-group-id', `file-attribute-access-time', +`file-attribute-modification-time', +`file-attribute-status-change-time', `file-attribute-size', +`file-attribute-modes', `file-attribute-inode-number', and +`file-attribute-device-number' + --- ** `align-regexp' has a separate history for its interactive argument `align-regexp' no longer shares its history with all other diff --git a/lisp/files.el b/lisp/files.el index aca7b35..c892ab4 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -7083,6 +7083,78 @@ Otherwise, trash FILENAME using the freedesktop.org conventions, (let ((delete-by-moving-to-trash nil)) (rename-file fn new-fn))))))))) +(defsubst file-attribute-type (attributes) + "The type field in ATTRIBUTES returned by `file-attribute'. +The value is either t for directory, string (name linked to) for +symbolic link, or nil." + (nth 0 attributes)) + +(defsubst file-attribute-link-number (attributes) + "Return the number of links in ATTRIBUTES returned by `file-attribute'." + (nth 1 attributes)) + +(defsubst file-attribute-user-id (attributes) + "The UID field in ATTRIBUTES returned by `file-attribute'. +This is either a string or a number. If a string value cannot be +looked up, a numeric value, either an integer or a float, is +returned." + (ntf 2 attributes)) + +(defsubst file-attribute-group-id (attributes) + "The GID field in ATTRIBUTES returned by `file-attribute'. +This is either a string or a number. If a string value cannot be +looked up, a numeric value, either an integer or a float, is +returned." + (ntf 3 attributes)) + +(defsubst file-attribute-access-time (attributes) + "The last access time in ATTRIBUTES returned by `file-attribute'. +This a list of integers (HIGH LOW USEC PSEC) in the same style +as (current-time)." + (ntf 4 attributes)) + +(defsubst file-attribute-modification-time (attributes) + "The modification time in ATTRIBUTES returned by `file-attribute'. +This is the time of the last change to the file's contents, and +is a list of integers (HIGH LOW USEC PSEC) in the same style +as (current-time)." + (ntf 5 attributes)) + +(defsubst file-attribute-status-change-time (attributes) + "The status modification time in ATTRIBUTES returned by `file-attribute'. +This is the time of last change to the file's attributes: owner +and group, access mode bits, etc, and is a list of integers (HIGH +LOW USEC PSEC) in the same style as (current-time)." + (ntf 6 attributes)) + +(defsubst file-attribute-size (attributes) + "The size (in bytes) in ATTRIBUTES returned by `file-attribute'. +This is a floating point number if the size is too large for an integer." + (ntf 7 attributes)) + +(defsubst file-attribute-modes (attributes) + "The file modes in ATTRIBUTES returned by `file-attribute'. +This is a string of ten letters or dashes as in ls -l." + (ntf 8 attributes)) + +(defsubst file-attribute-inode-number (attributes) + "The inode number in ATTRIBUTES returned by `file-attribute'. +If it is larger than what an Emacs integer can hold, this is of +the form (HIGH . LOW): first the high bits, then the low 16 bits. +If even HIGH is too large for an Emacs integer, this is instead +of the form (HIGH MIDDLE . LOW): first the high bits, then the +middle 24 bits, and finally the low 16 bits." + (ntf 10 attributes)) + +(defsubst file-attribute-device-number (attributes) + "The file system device number in ATTRIBUTES returned by `file-attribute'. +If it is larger than what an Emacs integer can hold, this is of +the form (HIGH . LOW): first the high bits, then the low 16 bits. +If even HIGH is too large for an Emacs integer, this is instead +of the form (HIGH MIDDLE . LOW): first the high bits, then the +middle 24 bits, and finally the low 16 bits." + (ntf 11 attributes)) + (define-key ctl-x-map "\C-f" 'find-file) (define-key ctl-x-map "\C-r" 'find-file-read-only) diff --git a/src/dired.c b/src/dired.c index 97fefae..fd5f142 100644 --- a/src/dired.c +++ b/src/dired.c @@ -861,6 +861,14 @@ below) - valid values are `string' and `integer'. The latter is the default, but we plan to change that, so you should specify a non-nil value for ID-FORMAT if you use the returned uid or gid. +To access the elements returned, the following access functions are +provided: `file-attribute-type', `file-attribute-link-number', +`file-attribute-user-id', `file-attribute-group-id', +`file-attribute-access-time', `file-attribute-modification-time', +`file-attribute-status-change-time', `file-attribute-size', +`file-attribute-modes', `file-attribute-inode-number', and +`file-attribute-device-number'. + Elements of the attribute list are: 0. t for directory, string (name linked to) for symbolic link, or nil. 1. Number of links to file. commit 484967796755051c4045cdcc26b0d3d129cc72ad Author: Michael Albinus Date: Fri Mar 4 14:01:36 2016 +0000 Fix Bug#22814 * lisp/autorevert.el (global-auto-revert-mode): Do not set `auto-revert-use-notify' to nil. * etc/NEWS: Mention this. * etc/PROBLEMS: Remove problem Bug#22814. * src/kqueue.c: Include . (Fkqueue_add_watch): Limit the number of used file descriptors. (Bug#22814) * test/lisp/filenotify-tests.el (file-notify--test-remote-enabled) (file-notify-test00-availability, file-notify-test01-add-watch) (file-notify-test02-events, file-notify-test06-many-events): Use #' read syntax for functions. (file-notify-test05-dir-validity) (file-notify-test06-many-events): Simplify directory creation. (file-notify-test09-sufficient-ressources): New test. diff --git a/etc/NEWS b/etc/NEWS index 1725776..d7e1b83 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -114,6 +114,9 @@ different group ID. +++ *** New connection method "doas" for OpenBSD hosts. +--- +** `auto-revert-use-notify' is set back to t in `global-auto-revert-mode'. + * New Modes and Packages in Emacs 25.2 diff --git a/etc/PROBLEMS b/etc/PROBLEMS index d531367..7d78037 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -600,17 +600,6 @@ you have a personal configuration file (normally ~/.aspell.conf), it can cause this error. Remove that file, execute 'ispell-kill-ispell' in Emacs, and then try spell-checking again. -*** Emacs eats all file descriptors when using kqueue file notifications. -See . - -When you have a large number of buffers running auto-revert-mode, and -Emacs is configured to use the kqueue file notification library, it -uses an own file descriptor for every watched file. On systems with a -small limit of file descriptors allowed per process, like OS X, you -could run out of file descriptors. You won't be able to open new files. - -auto-revert-use-notify is set to nil in global-auto-revert-mode, therefore. - * Runtime problems related to font handling ** Characters are displayed as empty boxes or with wrong font under X. diff --git a/lisp/autorevert.el b/lisp/autorevert.el index bde8eb8..14e39bd 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -458,11 +458,7 @@ specifies in the mode line." :global t :group 'auto-revert :lighter global-auto-revert-mode-text (auto-revert-set-timer) (if global-auto-revert-mode - (progn - ;; We disable file notification because it could use too many - ;; ressources. See . - (setq auto-revert-use-notify nil) - (auto-revert-buffers)) + (auto-revert-buffers) (dolist (buf (buffer-list)) (with-current-buffer buf (when auto-revert-use-notify diff --git a/src/kqueue.c b/src/kqueue.c index a69d06d..7e3bfdd 100644 --- a/src/kqueue.c +++ b/src/kqueue.c @@ -29,6 +29,10 @@ along with GNU Emacs. If not, see . */ #include "keyboard.h" #include "process.h" +#ifdef HAVE_SYS_RESOURCE_H +#include +#endif /* HAVE_SYS_RESOURCE_H */ + /* File handle for kqueue. */ static int kqueuefd = -1; @@ -368,9 +372,12 @@ only when the upper directory of the renamed file is watched. */) (Lisp_Object file, Lisp_Object flags, Lisp_Object callback) { Lisp_Object watch_object, dir_list; - int fd, oflags; + int maxfd, fd, oflags; u_short fflags = 0; struct kevent kev; +#ifdef HAVE_GETRLIMIT + struct rlimit rlim; +#endif /* HAVE_GETRLIMIT */ /* Check parameters. */ CHECK_STRING (file); @@ -383,6 +390,21 @@ only when the upper directory of the renamed file is watched. */) if (! FUNCTIONP (callback)) wrong_type_argument (Qinvalid_function, callback); + /* Check available file descriptors. */ +#ifdef HAVE_GETRLIMIT + if (! getrlimit (RLIMIT_NOFILE, &rlim)) + maxfd = rlim.rlim_cur; + else +#endif /* HAVE_GETRLIMIT */ + maxfd = 256; + + /* We assume 50 file descriptors are sufficient for the rest of Emacs. */ + if ((maxfd - 50) < XINT (Flength (watch_list))) + xsignal2 + (Qfile_notify_error, + build_string ("File watching not possible, no file descriptor left"), + Flength (watch_list)); + if (kqueuefd < 0) { /* Create kqueue descriptor. */ diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index 9f0c0ed..d3610f0 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el @@ -140,7 +140,7 @@ being the result.") (setq desc (file-notify-add-watch file-notify-test-remote-temporary-file-directory - '(change) 'ignore)))) + '(change) #'ignore)))) (setq file-notify--test-remote-enabled-checked (cons t desc)) (when desc (file-notify-rm-watch desc)))) ;; Return result. @@ -180,7 +180,7 @@ remote host, or nil." (message "Library: `%s'" (file-notify--test-library)) (should (setq file-notify--test-desc - (file-notify-add-watch temporary-file-directory '(change) 'ignore))) + (file-notify-add-watch temporary-file-directory '(change) #'ignore))) ;; Cleanup. (file-notify--test-cleanup)) @@ -199,23 +199,23 @@ remote host, or nil." ;; Check, that different valid parameters are accepted. (should (setq file-notify--test-desc - (file-notify-add-watch temporary-file-directory '(change) 'ignore))) + (file-notify-add-watch temporary-file-directory '(change) #'ignore))) (file-notify-rm-watch file-notify--test-desc) (should (setq file-notify--test-desc (file-notify-add-watch - temporary-file-directory '(attribute-change) 'ignore))) + temporary-file-directory '(attribute-change) #'ignore))) (file-notify-rm-watch file-notify--test-desc) (should (setq file-notify--test-desc (file-notify-add-watch - temporary-file-directory '(change attribute-change) 'ignore))) + temporary-file-directory '(change attribute-change) #'ignore))) (file-notify-rm-watch file-notify--test-desc) (write-region "any text" nil file-notify--test-tmpfile nil 'no-message) (should (setq file-notify--test-desc (file-notify-add-watch - file-notify--test-tmpfile '(change attribute-change) 'ignore))) + file-notify--test-tmpfile '(change attribute-change) #'ignore))) (file-notify-rm-watch file-notify--test-desc) (delete-file file-notify--test-tmpfile) @@ -238,7 +238,7 @@ remote host, or nil." (should (equal (should-error (file-notify-add-watch - file-notify--test-tmpfile1 '(change attribute-change) 'ignore)) + file-notify--test-tmpfile1 '(change attribute-change) #'ignore)) `(file-notify-error "Directory does not exist" ,file-notify--test-tmpfile))) @@ -361,7 +361,7 @@ longer than timeout seconds for the events to be delivered." (setq file-notify--test-desc (file-notify-add-watch file-notify--test-tmpfile - '(change) 'file-notify--test-event-handler))) + '(change) #'file-notify--test-event-handler))) (file-notify--test-with-events (cond ;; cygwin recognizes only `deleted' and `stopped' events. @@ -381,7 +381,7 @@ longer than timeout seconds for the events to be delivered." (setq file-notify--test-desc (file-notify-add-watch file-notify--test-tmpfile - '(change) 'file-notify--test-event-handler))) + '(change) #'file-notify--test-event-handler))) (file-notify--test-with-events (cond ;; cygwin recognizes only `deleted' and `stopped' events. @@ -414,7 +414,7 @@ longer than timeout seconds for the events to be delivered." file-notify--test-desc (file-notify-add-watch temporary-file-directory - '(change) 'file-notify--test-event-handler))) + '(change) #'file-notify--test-event-handler))) (file-notify--test-with-events (cond ;; w32notify does not raise `deleted' and `stopped' @@ -445,7 +445,7 @@ longer than timeout seconds for the events to be delivered." file-notify--test-desc (file-notify-add-watch temporary-file-directory - '(change) 'file-notify--test-event-handler))) + '(change) #'file-notify--test-event-handler))) (file-notify--test-with-events (cond ;; w32notify does not distinguish between `changed' and @@ -487,7 +487,7 @@ longer than timeout seconds for the events to be delivered." file-notify--test-desc (file-notify-add-watch temporary-file-directory - '(change) 'file-notify--test-event-handler))) + '(change) #'file-notify--test-event-handler))) (file-notify--test-with-events (cond ;; w32notify does not raise `deleted' and `stopped' @@ -521,7 +521,7 @@ longer than timeout seconds for the events to be delivered." (setq file-notify--test-desc (file-notify-add-watch file-notify--test-tmpfile - '(attribute-change) 'file-notify--test-event-handler))) + '(attribute-change) #'file-notify--test-event-handler))) (file-notify--test-with-events (cond ;; w32notify does not distinguish between `changed' and @@ -743,9 +743,9 @@ longer than timeout seconds for the events to be delivered." (unwind-protect (progn - (setq file-notify--test-tmpfile - (file-name-as-directory (file-notify--test-make-temp-name))) - (make-directory file-notify--test-tmpfile) + (should + (setq file-notify--test-tmpfile + (make-temp-file "file-notify-test-parent" t))) (should (setq file-notify--test-desc (file-notify-add-watch @@ -765,9 +765,9 @@ longer than timeout seconds for the events to be delivered." (unwind-protect (progn - (setq file-notify--test-tmpfile - (file-name-as-directory (file-notify--test-make-temp-name))) - (make-directory file-notify--test-tmpfile) + (should + (setq file-notify--test-tmpfile + (make-temp-file "file-notify-test-parent" t))) (should (setq file-notify--test-desc (file-notify-add-watch @@ -795,13 +795,14 @@ longer than timeout seconds for the events to be delivered." ;; Under cygwin events arrive in random order. Impossible to define a test. (skip-unless (not (eq system-type 'cygwin))) - (setq file-notify--test-tmpfile (file-notify--test-make-temp-name)) - (make-directory file-notify--test-tmpfile) + (should + (setq file-notify--test-tmpfile + (make-temp-file "file-notify-test-parent" t))) (should (setq file-notify--test-desc (file-notify-add-watch file-notify--test-tmpfile - '(change) 'file-notify--test-event-handler))) + '(change) #'file-notify--test-event-handler))) (unwind-protect (let ((n 1000) source-file-list target-file-list @@ -1058,6 +1059,47 @@ the file watch." (file-notify--deftest-remote file-notify-test08-watched-file-in-watched-dir "Check `file-notify-test08-watched-file-in-watched-dir' for remote files.") +(ert-deftest file-notify-test09-sufficient-ressources () + "Check that file notification does not use too many ressources." + :tags '(:expensive-test) + (skip-unless (file-notify--test-local-enabled)) + ;; This test is intended for kqueue only. + (skip-unless (string-equal (file-notify--test-library) "kqueue")) + + (should + (setq file-notify--test-tmpfile + (make-temp-file "file-notify-test-parent" t))) + (unwind-protect + (let ((temporary-file-directory file-notify--test-tmpfile) + descs) + (should-error + (while t + ;; We watch directories, because we want to reach the upper + ;; limit. Watching a file might not be sufficient, because + ;; most of the libraries implement this as watching the + ;; upper directory. + (setq file-notify--test-tmpfile1 + (make-temp-file "file-notify-test-parent" t) + descs + (cons + (should + (file-notify-add-watch + file-notify--test-tmpfile1 '(change) #'ignore)) + descs))) + :type 'file-notify-error) + ;; Remove watches. If we don't do it prior removing + ;; directories, Emacs crashes in batch mode. + (dolist (desc descs) + (file-notify-rm-watch desc)) + ;; Remove directories. + (delete-directory file-notify--test-tmpfile 'recursive)) + + ;; Cleanup. + (file-notify--test-cleanup))) + +(file-notify--deftest-remote file-notify-test09-sufficient-ressources + "Check `file-notify-test09-sufficient-ressources' for remote files.") + (defun file-notify-test-all (&optional interactive) "Run all tests for \\[file-notify]." (interactive "p") commit ca4e30058eba0531f38fff75f14734acffab84ea Author: Lars Ingebrigtsen Date: Fri Mar 4 11:52:26 2016 +0000 Fix insertion of edited servers in the dribble file * lisp/gnus/gnus-srvr.el (gnus-server-update-server): Don't insert explicit newlines, because they're quoted (bug#22903). diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el index 35a3882..30c7deb 100644 --- a/lisp/gnus/gnus-srvr.el +++ b/lisp/gnus/gnus-srvr.el @@ -387,7 +387,7 @@ The following commands are available: (when entry (gnus-dribble-enter (concat "(gnus-server-set-info \"" server "\" '" - (gnus-prin1-to-string (cdr entry)) ")\n") + (gnus-prin1-to-string (cdr entry)) ")") (concat "^(gnus-server-set-info \"" (regexp-quote server) "\""))) (when (or entry oentry) ;; Buffer may be narrowed. commit 5671c32c133cc745b908abf3a6891bd8f6d658b5 Author: Lars Ingebrigtsen Date: Fri Mar 4 09:11:26 2016 +0000 Move cl-seq-tests to the right place after the merge diff --git a/test/automated/cl-seq-tests.el b/test/automated/cl-seq-tests.el deleted file mode 100644 index d2eb412..0000000 --- a/test/automated/cl-seq-tests.el +++ /dev/null @@ -1,42 +0,0 @@ -;;; cl-seq-tests.el --- Tests for cl-seq.el functionality -*- lexical-binding: t; -*- - -;; Copyright (C) 2015-2016 Free Software Foundation, Inc. - -;; Author: Nicolas Richard - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - -;;; Commentary: - -;;; Code: - -(require 'ert) -(require 'cl-seq) - -(ert-deftest cl-union-test-00 () - (let ((str1 "foo") - (str2 (make-string 3 ?o))) - ;; Emacs may make two string literals eql when reading. - (aset str2 0 ?f) - (should (not (eql str1 str2))) - (should (equal str1 str2)) - (should (equal (cl-union (list str1) (list str2)) - (list str2))) - (should (equal (cl-union (list str1) (list str2) :test 'eql) - (list str1 str2))))) - -(provide 'cl-seq-tests) -;;; cl-seq-tests.el ends here