* eshell/esh-mode.el (eshell-mode): Fix key bindings.
[bpt/emacs.git] / lisp / subr.el
index 23684f0..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)))
 
-(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
@@ -2742,7 +2743,14 @@ If there is no plausible default, return nil."
                     (< (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.
@@ -4432,32 +4440,16 @@ convenience wrapper around `make-progress-reporter' and friends.
 \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")
-  (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
-           (cons "Not a valid MS-Windows file-notify event" event))))
+           (cons "Not a valid file-notify event" event))))
 
 \f
 ;;;; Comparing version strings.