From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.devel Subject: Re: [Stephen.Berman@gmx.net: ffap-string-at-point-mode-alist error?] Date: Fri, 06 Apr 2007 04:36:48 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1175848798 24196 80.91.229.12 (6 Apr 2007 08:39:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 6 Apr 2007 08:39:58 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 06 10:39:26 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HZjyd-00067f-6F for ged-emacs-devel@m.gmane.org; Fri, 06 Apr 2007 10:39:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HZk23-0003RD-88 for ged-emacs-devel@m.gmane.org; Fri, 06 Apr 2007 04:42:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HZk20-0003OB-8o for emacs-devel@gnu.org; Fri, 06 Apr 2007 04:42:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HZk1z-0003Li-LS for emacs-devel@gnu.org; Fri, 06 Apr 2007 04:42:51 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HZk1z-0003LM-Gj for emacs-devel@gnu.org; Fri, 06 Apr 2007 04:42:51 -0400 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HZjyV-0003se-8u for emacs-devel@gnu.org; Fri, 06 Apr 2007 04:39:15 -0400 Original-Received: from [127.0.0.1] (helo=localhost) by fencepost.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HZjwC-0008Uo-Mf; Fri, 06 Apr 2007 04:36:52 -0400 X-Spook: Clinton ASIO Mafia CDC chameleon man bomb Fortezza JFK X-Ran: KTmijCufi/OdweY<9S",w$/p?C[fkU^Ja~;PY#>arL.#`@I8hnC8rd/oLOOS*P^^~Kl?}r X-Hue: yellow X-Attribution: GM User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:69114 Archived-At: Richard Stallman wrote: > Would someone please try to fix this problem in ffap? > > From: Stephen Berman > Subject: ffap-string-at-point-mode-alist error? > To: emacs-pretest-bug@gnu.org > 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)))