0

Verilog/SystemVerilog でコーディングするために emacs を使用していますが、コメント行は . で始まります//

私は「ido find files at point」を使用するのが好きなので'(ido-use-filename-at-point (quote guess))custom-set-variables.

カーソルが のようなコメントの最初の単語にあるときに別のファイルを開こうとしている場合を除いて、完全に機能します//Revision Control:。パスで Revision というファイルを見つけようとします//

/ルートと//パスの ido ffap 機能を無効にするにはどうすればよいですか? 機能を提供する別の方法は、 で始まる行で ido ffap が自動的に無効になる場合//です。

4

1 に答える 1

0

次のコードにverilog-modeまだ特別な ffap ハンドラがないと仮定すると、うまくいくはずです。ffap-alist

(defun ffap-verilog (name)
  (let ((inhibit-changing-match-data t) ;; string-match should not change match data
    (ppss (syntax-ppss)))
    (if (and (eq (syntax-ppss-context ppss) 'comment) ;; we are inside a comment
         (= (line-number-at-pos (nth 8 ppss)) (line-number-at-pos (point))) ;; limit the match to the line starting the comment
         (string-match "/[/*]\\([[:alnum:]_.]\\)+$"
               (buffer-substring-no-properties (nth 8 ppss) (point))))
    ""
      name)))


(add-to-list 'ffap-alist '(verilog-mode . ffap-verilog) 'append)

//特殊なケースとして、コメントの先頭または直後に、URL またはワイルドカードを含むパスとして誤って/*解釈される可能性のある文字列が続くことがチェックされます。ffapただし、 で始まるコメント内の他の文字列は、\\実際には URL である可能性があるため、処理されないことに注意してください。

于 2013-11-10T11:41:22.450 に答える