summaryrefslogtreecommitdiff
path: root/lisp/filenotify.el
diff options
context:
space:
mode:
authorMark Oteiza <mvoteiza@udel.edu>2017-09-12 13:08:47 -0400
committerMark Oteiza <mvoteiza@udel.edu>2017-09-12 13:18:10 -0400
commit370d0e7aa7309b25fb9e974164261077b326e8e2 (patch)
tree47b2bbce79feb9a889a06f67b650a892c95ccc4d /lisp/filenotify.el
parent4612b2a2b37026bef5a9b8e92878a15dabb9b261 (diff)
downloademacs-370d0e7aa7309b25fb9e974164261077b326e8e2.tar.gz
Update uses of if-let and when-let
* lisp/dom.el (dom-previous-sibling): * lisp/emacs-lisp/package.el (package--with-work-buffer): (package--sort-deps-in-alist, package--sort-by-dependence): (package-install-from-archive, package-install): (package-menu-execute, package-menu--populate-new-package-list): * lisp/filenotify.el (file-notify--rm-descriptor): (file-notify--event-watched-file, file-notify--event-file-name): (file-notify--event-file1-name, file-notify-rm-watch): (file-notify-valid-p): * lisp/gnus/message.el (message-toggle-image-thumbnails): * lisp/gnus/nnimap.el (nnimap-request-move-article): * lisp/ibuf-ext.el (ibuffer-repair-saved-filters): * lisp/mpc.el (mpc-format): * lisp/net/eww.el (eww-tag-meta, eww-process-text-input): (eww-save-history): * lisp/net/shr.el (shr-tag-base, shr-tag-object, shr-make-table-1): * lisp/progmodes/prog-mode.el (prettify-symbols--post-command-hook): * lisp/svg.el (svg-remove): * lisp/textmodes/css-mode.el (css--named-color): (css--colon-inside-funcall): * lisp/textmodes/sgml-mode.el (html-current-buffer-classes): (html-current-buffer-ids): Use if-let* and when-let* instead.
Diffstat (limited to 'lisp/filenotify.el')
-rw-r--r--lisp/filenotify.el12
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index 64cfab143ec..6a3b9e17439 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -71,7 +71,7 @@ struct.")
"Remove DESCRIPTOR from `file-notify-descriptors'.
DESCRIPTOR should be an object returned by `file-notify-add-watch'.
If it is registered in `file-notify-descriptors', a stopped event is sent."
- (when-let (watch (gethash descriptor file-notify-descriptors))
+ (when-let* ((watch (gethash descriptor file-notify-descriptors)))
;; Send `stopped' event.
(unwind-protect
(funcall
@@ -106,12 +106,12 @@ It is a form ((DESCRIPTOR ACTION FILE [FILE1-OR-COOKIE]) CALLBACK).")
(defun file-notify--event-watched-file (event)
"Return file or directory being watched.
Could be different from the directory watched by the backend library."
- (when-let (watch (gethash (car event) file-notify-descriptors))
+ (when-let* ((watch (gethash (car event) file-notify-descriptors)))
(file-notify--watch-absolute-filename watch)))
(defun file-notify--event-file-name (event)
"Return file name of file notification event, or nil."
- (when-let (watch (gethash (car event) file-notify-descriptors))
+ (when-let* ((watch (gethash (car event) file-notify-descriptors)))
(directory-file-name
(expand-file-name
(or (and (stringp (nth 2 event)) (nth 2 event)) "")
@@ -121,7 +121,7 @@ Could be different from the directory watched by the backend library."
(defun file-notify--event-file1-name (event)
"Return second file name of file notification event, or nil.
This is available in case a file has been moved."
- (when-let (watch (gethash (car event) file-notify-descriptors))
+ (when-let* ((watch (gethash (car event) file-notify-descriptors)))
(and (stringp (nth 3 event))
(directory-file-name
(expand-file-name
@@ -375,7 +375,7 @@ FILE is the name of the file whose event is being reported."
(defun file-notify-rm-watch (descriptor)
"Remove an existing watch specified by its DESCRIPTOR.
DESCRIPTOR should be an object returned by `file-notify-add-watch'."
- (when-let (watch (gethash descriptor file-notify-descriptors))
+ (when-let* ((watch (gethash descriptor file-notify-descriptors)))
(let ((handler (find-file-name-handler
(file-notify--watch-directory watch)
'file-notify-rm-watch)))
@@ -399,7 +399,7 @@ DESCRIPTOR should be an object returned by `file-notify-add-watch'."
(defun file-notify-valid-p (descriptor)
"Check a watch specified by its DESCRIPTOR.
DESCRIPTOR should be an object returned by `file-notify-add-watch'."
- (when-let (watch (gethash descriptor file-notify-descriptors))
+ (when-let* ((watch (gethash descriptor file-notify-descriptors)))
(let ((handler (find-file-name-handler
(file-notify--watch-directory watch)
'file-notify-valid-p)))