[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/ffap.el
From: |
Rajesh Vaidheeswarran |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/ffap.el |
Date: |
Mon, 29 Sep 2003 14:05:32 -0400 |
Index: emacs/lisp/ffap.el
diff -c emacs/lisp/ffap.el:1.37 emacs/lisp/ffap.el:1.38
*** emacs/lisp/ffap.el:1.37 Mon Sep 1 11:45:12 2003
--- emacs/lisp/ffap.el Mon Sep 29 14:05:30 2003
***************
*** 65,70 ****
--- 65,71 ----
;; (setq ffap-alist nil) ; faster, dumber prompting
;; (setq ffap-machine-p-known 'accept) ; no pinging
;; (setq ffap-url-regexp nil) ; disable URL features in ffap
+ ;; (setq ffap-shell-prompt-regexp nil) ; disable shell prompt stripping
;;
;; ffap uses `browse-url' (if found, else `w3-fetch') to fetch URL's.
;; For a hairier `ffap-url-fetcher', try ffap-url.el (same ftp site).
***************
*** 120,125 ****
--- 121,138 ----
(let ((sym (intern-soft name)))
(if (and sym (boundp sym)) (symbol-value sym) default)))
+ (defcustom ffap-shell-prompt-regexp
+ ;; This used to test for some shell prompts that don't have a space
+ ;; after them. The common root shell prompt (#) is not listed since it
+ ;; also doubles up as a valid URL character.
+ "[$%><]*"
+ "Paths matching this regexp are stripped off the shell prompt
+ If nil, ffap doesn't do shell prompt stripping."
+ :type '(choice (const :tag "Disable" nil)
+ (const :tag "Standard" "[$%><]*")
+ regexp)
+ :group 'ffap)
+
(defcustom ffap-ftp-regexp
;; This used to test for ange-ftp or efs being present, but it should be
;; harmless (and simpler) to give it this value unconditionally.
***************
*** 1109,1114 ****
--- 1122,1132 ----
;; Try stripping off line numbers; good for compilation/grep output.
((and (not abs) (string-match ":[0-9]" name)
(ffap-file-exists-string (substring name 0 (match-beginning
0)))))
+ ;; Try stripping off prominent (non-root - #) shell prompts
+ ;; if the ffap-shell-prompt-regexp is non-nil.
+ ((and ffap-shell-prompt-regexp
+ (not abs) (string-match ffap-shell-prompt-regexp name)
+ (ffap-file-exists-string (substring name (match-end 0)))))
;; Immediately test local filenames. If default-directory is
;; remote, you probably already have a connection.
((and (not abs) (ffap-file-exists-string name)))