* eshell/em-term.el (cl-lib): Require `cl-lib'.
[bpt/emacs.git] / lisp / subr.el
index 9b2c815..f30e6db 100644 (file)
@@ -2717,8 +2717,9 @@ customize the variable `user-emacs-directory-warning'."
   "Return non-nil if the current buffer is narrowed."
   (/= (- (point-max) (point-min)) (buffer-size)))
 
   "Return non-nil if the current buffer is narrowed."
   (/= (- (point-max) (point-min)) (buffer-size)))
 
-(defun find-tag-default ()
-  "Determine default tag to search for, based on text at point.
+(defun find-tag-default-bounds ()
+  "Determine the boundaries of the default tag, based on text at point.
+Return a cons cell with the beginning and end of the found tag.
 If there is no plausible default, return nil."
   (let (from to bound)
     (when (or (progn
 If there is no plausible default, return nil."
   (let (from to bound)
     (when (or (progn
@@ -2742,7 +2743,14 @@ If there is no plausible default, return nil."
                     (< (setq from (point)) bound)
                     (skip-syntax-forward "w_")
                     (setq to (point)))))
                     (< (setq from (point)) bound)
                     (skip-syntax-forward "w_")
                     (setq to (point)))))
-      (buffer-substring-no-properties from to))))
+      (cons from to))))
+
+(defun find-tag-default ()
+  "Determine default tag to search for, based on text at point.
+If there is no plausible default, return nil."
+  (let ((bounds (find-tag-default-bounds)))
+    (when bounds
+      (buffer-substring-no-properties (car bounds) (cdr bounds)))))
 
 (defun find-tag-default-as-regexp ()
   "Return regexp that matches the default tag at point.
 
 (defun find-tag-default-as-regexp ()
   "Return regexp that matches the default tag at point.
@@ -4432,32 +4440,16 @@ convenience wrapper around `make-progress-reporter' and friends.
 \f
 ;;;; Support for watching filesystem events.
 
 \f
 ;;;; Support for watching filesystem events.
 
-(defun inotify-event-p (event)
-  "Check if EVENT is an inotify event."
-  (and (listp event)
-       (>= (length event) 3)
-       (eq (car event) 'file-inotify)))
-
-;;;###autoload
-(defun inotify-handle-event (event)
-  "Handle inotify file system monitoring event.
-If EVENT is an inotify filewatch event, call its callback.
-Otherwise, signal a `filewatch-error'."
-  (interactive "e")
-  (unless (inotify-event-p event)
-    (signal 'filewatch-error (cons "Not a valid inotify event" event)))
-  (funcall (nth 2 event) (nth 1 event)))
-
-(defun w32notify-handle-event (event)
-  "Handle MS-Windows file system monitoring event.
-If EVENT is an MS-Windows filewatch event, call its callback.
+(defun file-notify-handle-event (event)
+  "Handle file system monitoring event.
+If EVENT is a filewatch event, call its callback.
 Otherwise, signal a `filewatch-error'."
   (interactive "e")
 Otherwise, signal a `filewatch-error'."
   (interactive "e")
-  (if (and (eq (car event) 'file-w32notify)
-          (= (length event) 3))
+  (if (and (eq (car event) 'file-notify)
+          (>= (length event) 3))
       (funcall (nth 2 event) (nth 1 event))
     (signal 'filewatch-error
       (funcall (nth 2 event) (nth 1 event))
     (signal 'filewatch-error
-           (cons "Not a valid MS-Windows file-notify event" event))))
+           (cons "Not a valid file-notify event" event))))
 
 \f
 ;;;; Comparing version strings.
 
 \f
 ;;;; Comparing version strings.
@@ -4697,14 +4689,14 @@ as alpha versions."
 
 ;; This is used in lisp/Makefile.in and in leim/Makefile.in to
 ;; generate file names for autoloads, custom-deps, and finder-data.
 
 ;; This is used in lisp/Makefile.in and in leim/Makefile.in to
 ;; generate file names for autoloads, custom-deps, and finder-data.
-(defun reveal-filename (file)
-  "Produce the real file name for FILE.
+(defun unmsys--file-name (file)
+  "Produce the canonical file name for FILE from its MSYS form.
 
 On systems other than MS-Windows, just returns FILE.
 On MS-Windows, converts /d/foo/bar form of file names
 passed by MSYS Make into d:/foo/bar that Emacs can grok.
 
 
 On systems other than MS-Windows, just returns FILE.
 On MS-Windows, converts /d/foo/bar form of file names
 passed by MSYS Make into d:/foo/bar that Emacs can grok.
 
-This function is called from lisp/Makefile."
+This function is called from lisp/Makefile and leim/Makefile."
   (when (and (eq system-type 'windows-nt)
             (string-match "\\`/[a-zA-Z]/" file))
     (setq file (concat (substring file 1 2) ":" (substring file 2))))
   (when (and (eq system-type 'windows-nt)
             (string-match "\\`/[a-zA-Z]/" file))
     (setq file (concat (substring file 1 2) ":" (substring file 2))))