[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Sun, 28 Sep 2003 11:58:18 -0400
Hello.. I had received a request from RMS to check out ffap and fix a bug
pointed out by a user (Dan Jacobson).
I am not sure what the usage was that exposed the original bug, but it
seemed to me like shell prompts without spaces, in general, could cause the
same bug. And it should be fixed for that case at least. This also happens
to fix the user's problem.
I have a generalized fix that works. I would like a review of this change
from the list (i.e., does someone have a better idea to fix it)... and Dan,
I would like you to check this out and see if it works for you. Once
everything is squared away, I'll install it.
RCS file: /cvsroot/emacs/emacs/lisp/ffap.el,v
retrieving revision 1.37
diff -c -w -r1.37 ffap.el
*** ffap.el 1 Sep 2003 15:45:12 -0000 1.37
--- ffap.el 24 Sep 2003 14:08:34 -0000
*** 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" "[$%><]*")
+ :group 'ffap)
;; 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
((and (not abs) (string-match ":[0-9]" name)
(ffap-file-exists-string (substring name 0 (match-beginning
+ ;; 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)))
> ----- Original Message -----
> From: "Richard Stallman" <address@hidden>
> To: "Rajesh Vaidheeswarran" <address@hidden>
> Sent: Tuesday, September 23, 2003 7:12 PM
> Subject: Re: ffap
> > What maintenance is required? It seems fully developed. If no one
> > interested, you can assign it to me.
> > There have been a few bug reports. For instance, want
> > to work on this one?
> > Subject: Re: Bug report for ffap
> > To: address@hidden
> > In-Reply-To: <address@hidden> from Richard Stallman
> > on Fri, 22 Aug 2003 23:59:28 -0400
> > From: "No Response Received" <address@hidden>
> > Sender: "RMS - Email Processing Account,,," <address@hidden>
> > Date: Sun, 21 Sep 2003 03:12:16 -0400
> > X-Spam-Status: No, hits=-1.0 required=5.0
> > tests=IN_REP_TO,REFERENCES
> > version=2.55
> > X-Spam-Level:
> > X-Spam-Checker-Version: SpamAssassin 2.55 (22.214.171.124-2003-05-19-exp)
> > This message has received no response, and the deadline has passed.
> > Below is the original message, followed by any referenced messages.
> > ############################### ORGINAL MESSAGE #####################
> > >From address@hidden Fri Aug 22 23:59:28 2003
> > Envelope-To: address@hidden, address@hidden
> > Delivery-Date: Fri, 22 Aug 2003 23:59:28 -0400
> > From: Richard Stallman <address@hidden>
> > To: address@hidden
> > Subject: Bug report for ffap
> > Reply-To: address@hidden
> > Message-Id: <address@hidden>
> > Date: Fri, 22 Aug 2003 23:59:28 -0400
> > Lines: 21
> > I don't know whether this is a bug; in any case, could you please DTRT?
> > To: address@hidden
> > From: Dan Jacobson <address@hidden>
> > Date: Thu, 21 Aug 2003 12:56:48 +0800
> > Subject: ffap doesn't recognize >/tmp/D.txt
> > Sender: address@hidden
> > Ffap users, do
> > $ touch /tmp/D.txt
> > then in emacs put the cursor on >/tmp/D.txt
> > and hit C-x C-f. Notice that you have to add a space after the ">"
> > to make ffap recognize it.
> > _______________________________________________
> > Bug-gnu-emacs mailing list
> > address@hidden
> > http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs
- ffap, Richard Stallman, 2003/09/21
- Fw: ffap,
Rajesh Vaidheeswarran <=