[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/ffap.el [lexbind]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/ffap.el [lexbind] |
Date: |
Tue, 14 Oct 2003 19:51:55 -0400 |
Index: emacs/lisp/ffap.el
diff -c emacs/lisp/ffap.el:1.31.2.1 emacs/lisp/ffap.el:1.31.2.2
*** emacs/lisp/ffap.el:1.31.2.1 Fri Apr 4 01:20:05 2003
--- emacs/lisp/ffap.el Tue Oct 14 19:51:02 2003
***************
*** 3,8 ****
--- 3,9 ----
;; Copyright (C) 1995, 96, 97, 2000 Free Software Foundation, Inc.
;;
;; Author: Michelangelo Grigni <address@hidden>
+ ;; Maintainer: Rajesh Vaidheeswarran <address@hidden>
;; Created: 29 Mar 1993
;; Keywords: files, hypermedia, matching, mouse, convenience
;; X-URL: ftp://ftp.mathcs.emory.edu/pub/mic/emacs/
***************
*** 65,70 ****
--- 66,72 ----
;; (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 ****
--- 122,139 ----
(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 ****
--- 1123,1133 ----
;; 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)))
***************
*** 1230,1238 ****
;; This code assumes that you load ffap.el after complete.el.
;;
;; We must inform complete about whether our completion function
! ;; will do filename style completion. For earlier versions of
! ;; complete.el, this requires a defadvice. For recent versions
! ;; there may be a special variable for this purpose.
(defun ffap-complete-as-file-p nil
;; Will `minibuffer-completion-table' complete the minibuffer
--- 1249,1255 ----
;; This code assumes that you load ffap.el after complete.el.
;;
;; We must inform complete about whether our completion function
! ;; will do filename style completion.
(defun ffap-complete-as-file-p nil
;; Will `minibuffer-completion-table' complete the minibuffer
***************
*** 1246,1260 ****
(featurep 'complete)
(if (boundp 'PC-completion-as-file-name-predicate)
;; modern version of complete.el, just set the variable:
! (setq PC-completion-as-file-name-predicate 'ffap-complete-as-file-p)
! (require 'advice)
! (defadvice PC-do-completion (around ffap-fix act)
! "Work with ffap."
! (let ((minibuffer-completion-table
! (if (eq t (ffap-complete-as-file-p))
! 'read-file-name-internal
! minibuffer-completion-table)))
! ad-do-it))))
;;; Highlighting (`ffap-highlight'):
--- 1263,1269 ----
(featurep 'complete)
(if (boundp 'PC-completion-as-file-name-predicate)
;; modern version of complete.el, just set the variable:
! (setq PC-completion-as-file-name-predicate 'ffap-complete-as-file-p)))
;;; Highlighting (`ffap-highlight'):
***************
*** 1704,1707 ****
--- 1713,1718 ----
(eval (cons 'progn ffap-bindings)))
+
+ ;;; arch-tag: 9dd3e88a-5dec-4607-bd57-60ae9ede8ebc
;;; ffap.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/ffap.el [lexbind],
Miles Bader <=