all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kaushal <kaushal.modi@gmail.com>
To: 19839@debbugs.gnu.org
Subject: bug#19839: 24.4; ffap does not detect file paths with curly braced shell variables
Date: Wed, 11 Feb 2015 14:23:14 -0500	[thread overview]
Message-ID: <CAFyQvY2rXUexJMXb0dTPM3xH3tk8Y05o0RM_7dP8b5+YS-wtsQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1659 bytes --]

Hi,

The ffap gives an error if I try to do =C-x C-f= while the path is on a
path containing curly braces wrapped shell variable.

e.g. ${PRJ_HOME}/dir1/file1.el

I traced the problem to the ffap-string-at-point-mode-alist variable in
lisp/ffap.el.

The fix is to replace

    (file "--:\\\\$+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:") ; broken

with

    (file "--:\\\\$\\{\\}+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:") ; fixed


I added "\\{\\}" to the regexp for 'file'.

---

*Original* lisp/ffap.el in emacs 24.4

(defvar ffap-string-at-point-mode-alist
  '(
    ;; The default, used when the `major-mode' is not found.
    ;; Slightly controversial decisions:
    ;; * strip trailing "@" and ":"
    ;; * no commas (good for latex)
    (file "--:\\\\$+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:")
    ;; An url, or maybe a email/news message-id:
    (url "--:=&?$+@-Z_[:alpha:]~#,%;*()!'" "^[0-9a-zA-Z]" ":;.,!?")
    ;; Find a string that does *not* contain a colon:
    (nocolon "--9$+<>@-Z_[:alpha:]~" "<@" "@>;.,!?")
    ;; A machine:
    (machine "-[:alnum:]." "" ".")
    ;; Mathematica paths: allow backquotes
    (math-mode ",-:$+<>@-Z_[:lower:]~`" "<" "@>;.,!?`:")
    )


In GNU Emacs 24.4.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.10.4)
 of 2015-01-29 on ulcf20.cld.MYCOMPANY.com
Windowing system distributor `The X.Org Foundation', version 11.0.60900000
System Description: Red Hat Enterprise Linux Client release 5.10 (Tikanga)

Configured using:
 `configure --prefix=/home/kmodi/usr_local/apps/emacs/24.4
 CPPFLAGS=-fgnu89-inline'

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp



--
Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 7178 bytes --]

             reply	other threads:[~2015-02-11 19:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-11 19:23 Kaushal [this message]
2015-04-06 19:13 ` bug#19839: 24.4; ffap does not detect file paths with curly braced shell variables Kaushal
2015-04-06 23:53 ` Dmitry Gutov
2015-04-07  0:00   ` Dmitry Gutov
2015-04-07  2:26     ` Kaushal
2015-04-08  0:22       ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFyQvY2rXUexJMXb0dTPM3xH3tk8Y05o0RM_7dP8b5+YS-wtsQ@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=19839@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.