[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ffap vs. arrows

From: Kevin Rodgers
Subject: Re: ffap vs. arrows
Date: Wed, 08 Dec 2004 11:05:40 -0700
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

Dan Jacobson wrote:
> ffap can't detect the file name with the cursor upon it in the former:
> echo>>/etc/motd
> echo>> /etc/motd
> Only the latter. Nor with single >.

Although valid, that is terrrible style.  You should use whitespace
before any redirection operator for readability:

echo >>/etc/motd

That can be made to work when editing shell scripts with this (as long
as point is within the file name itself, of course):

;; In sh-mode, add the ">" redirection operator to the characters
;; stripped from the beginning of a file name:
(let ((chars-beg-end (cdr (assq 'file ffap-string-at-point-mode-alist))))
  (setq ffap-string-at-point-mode-alist
        (cons (list 'sh-mode
                    (nth 0 chars-beg-end) ; chars
                    (concat (nth 1 chars-beg-end) ">") ; beg
                    (nth 2 chars-beg-end)) ; end

> Didn't test <.

It works with "<" (again, as long as point is within the file name).

Kevin Rodgers

reply via email to

[Prev in Thread] Current Thread [Next in Thread]