[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: address@hidden: ffap-string-at-point-mode-alist error?]
From: |
Glenn Morris |
Subject: |
Re: address@hidden: ffap-string-at-point-mode-alist error?] |
Date: |
Fri, 06 Apr 2007 04:36:48 -0400 |
User-agent: |
Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) |
Richard Stallman wrote:
> Would someone please try to fix this problem in ffap?
>
> From: Stephen Berman <address@hidden>
> Subject: ffap-string-at-point-mode-alist error?
> To: address@hidden
> Date: Wed, 04 Apr 2007 23:58:32 +0200
> cc-cmds.el:1626:4:Warning: value returned from form is not used.
[ffap]
> Find file or URL: /cc-cmds.el:1626:4:Warning
It's because "cc-cmds.el:1626:4:Warning:" matches
ffap-ftp-sans-slash-regexp in ffap-file-at-point. One can customize
ffap-ftp-regexp to nil to prevent such matches being checked for.
Maybe this is the best solution.
Other possible solutions:
1. Before the ftp regexp is checked, ffap-file-at-point checks for
existence of a file in default-directory. It could look elsewhere
as well. Ie:
*** ffap.el 10 Jan 2007 15:48:04 -0800 1.61
--- ffap.el 06 Apr 2007 01:29:39 -0700
***************
*** 1157,1163 ****
((and (not abs) (ffap-file-exists-string name)))
;; 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
--- 1157,1165 ----
((and (not abs) (ffap-file-exists-string name)))
;; Try stripping off line numbers; good for
compilation/grep output.
((and (not abs) (string-match ":[0-9]" name)
! (let ((sub (substring name 0 (match-beginning 0))))
! (or (ffap-file-exists-string sub)
! (ffap-locate-file sub)))))
;; Try stripping off prominent (non-root - #) shell prompts
;; if the ffap-shell-prompt-regexp is non-nil.
((and ffap-shell-prompt-regexp
2. Can a URL ever contain something like ":1626:4:"? If not, could
prevent such things from matching the ftp test:
***************
*** 1170,1175 ****
--- 1172,1178 ----
(and
ffap-ftp-sans-slash-regexp
(string-match ffap-ftp-sans-slash-regexp name)
+ (not (string-match ":[0-9]+:[0-9]+:" name))
(ffap-file-remote-p (concat "/" name)))))
;; Ok, not remote, try the existence test even if it is
absolute:
((and abs (ffap-file-exists-string name)))