emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/dired-x.el


From: Dave Love
Subject: [Emacs-diffs] Changes to emacs/lisp/dired-x.el
Date: Mon, 27 Jan 2003 06:36:09 -0500

Index: emacs/lisp/dired-x.el
diff -c emacs/lisp/dired-x.el:1.46 emacs/lisp/dired-x.el:1.47
*** emacs/lisp/dired-x.el:1.46  Wed Jan 15 14:45:49 2003
--- emacs/lisp/dired-x.el       Mon Jan 27 06:36:08 2003
***************
*** 1561,1576 ****
  
  ;;; Internal functions.
  
! ;; Fixme: This should probably be replaced with `thing-at-point', but
! ;; that needs checking for compatibility.  -- fx
  (defun dired-filename-at-point ()
    "Get the filename closest to point, but do not change position.
  Has a preference for looking backward when not directly on a symbol.  Not
  perfect - point must be in middle of or end of filename."
  
    (let ((filename-chars "-.[:alnum:]_/:$+@")
-         (bol (save-excursion (beginning-of-line) (point)))
-         (eol (save-excursion (end-of-line) (point)))
          start end filename prefix)
  
      (save-excursion
--- 1561,1573 ----
  
  ;;; Internal functions.
  
! ;; Fixme: This should probably use `thing-at-point'.  -- fx
  (defun dired-filename-at-point ()
    "Get the filename closest to point, but do not change position.
  Has a preference for looking backward when not directly on a symbol.  Not
  perfect - point must be in middle of or end of filename."
  
    (let ((filename-chars "-.[:alnum:]_/:$+@")
          start end filename prefix)
  
      (save-excursion
***************
*** 1585,1600 ****
        (if (string-match (concat "[" filename-chars "]")
                          (char-to-string (following-char)))
            (progn
!             (skip-chars-backward filename-chars)
              (setq start (point))
            (setq prefix
!                 (and (string-match "^\\w+@" 
!                                    (buffer-substring start eol))
                       "/"))
              (goto-char start)
              (if (string-match "[/~]" (char-to-string (preceding-char)))
                  (setq start (1- start)))
!             (skip-chars-forward filename-chars))
  
          (error "No file found around point!"))
  
--- 1582,1600 ----
        (if (string-match (concat "[" filename-chars "]")
                          (char-to-string (following-char)))
            (progn
!             (if (re-search-backward (concat "[^" filename-chars "]") nil t)
!               (forward-char)
!             (goto-char (point-min)))
              (setq start (point))
            (setq prefix
!                 (and (string-match
!                       "^\\w+@"
!                       (buffer-substring start (line-beginning-position)))
                       "/"))
              (goto-char start)
              (if (string-match "[/~]" (char-to-string (preceding-char)))
                  (setq start (1- start)))
!             (re-search-forward (concat "\\=[" filename-chars "]*") nil t))
  
          (error "No file found around point!"))
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]