"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
(< (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.
\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.
;; 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.
-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))))