GNU bug report logs - #26190
25.1; ffap problem with curly braces

Previous Next

Package: emacs;

Reported by: wyousef <at> fcih.net

Date: Mon, 20 Mar 2017 11:53:01 UTC

Severity: minor

Tags: fixed

Found in version 25.1

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 26190 in the body.
You can then email your comments to 26190 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#26190; Package emacs. (Mon, 20 Mar 2017 11:53:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to wyousef <at> fcih.net:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 20 Mar 2017 11:53:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: wyousef <at> fcih.net
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1; ffap problem with curly braces
Date: Mon, 20 Mar 2017 13:52:11 +0200
In scratch buffer with cursor on {/etc} do M-: (ffap-guesser) RET

With emacs-25 => nil
With emacs-24.5 => "/etc"


Thanks



In GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.7)
 of 2017-02-07 built on arojas
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=gtk3 --with-xft
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe
 -fstack-protector-strong' CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

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

Major mode: LaTeX/FMPS

Minor modes in effect:
  TeX-fold-mode: t
  flyspell-mode: t
  LaTeX-math-mode: t
  TeX-PDF-mode: t
  TeX-source-correlate-mode: t
  magic-latex-buffer: t
  pdf-occur-global-minor-mode: t
  helm-mode: t
  delete-selection-mode: t
  show-paren-mode: t
  show-smartparens-global-mode: t
  show-smartparens-mode: t
  smartparens-global-mode: t
  smartparens-global-strict-mode: t
  smartparens-strict-mode: t
  smartparens-mode: t
  guide-key-mode: t
  async-bytecomp-package-mode: t
  reftex-mode: t
  outline-minor-mode: t
  shell-dirtrack-mode: t
  winner-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  auto-fill-function: do-auto-fill
  global-visual-line-mode: t
  transient-mark-mode: t

Recent messages:
Removing duplicates... done
Applying style hooks... done
Mark saved where search started
Compiling label environment definitions...done
cite: info not available, use ‘C-c &’ to get it.
Scanning entire document...
Scanning file /home/wyousef/MyDocuments/Teaching/FCIH/Courses/DataVisualization/LectureNotes/LectureNotesCS495.tex
Scanning file FrontMatter/FrontMatter.tex
Scanning chapter * ... [3 times]
Scanning document... done

Load-path shadows:
~/.emacs.d/loadpath/ps-mule hides /usr/share/emacs/25.1/lisp/ps-mule
~/.emacs.d/loadpath/subr-x hides /usr/share/emacs/25.1/lisp/emacs-lisp/subr-x

Features:
(shadow sort org-rmail org-mhe org-irc org-info org-gnus org-docview
org-bbdb org-w3m org-table mail-extr emacsbug sendmail helm-command
helm-elisp helm-eval edebug reftex-ref reftex-parse gnus-dired
autorevert filenotify ace-window avy misearch multi-isearch texmathp
preview prv-emacs tex-fold reftex-toc reftex-dcr reftex-auc flyspell
ispell tex-buf font-latex latex tex-ispell tex-style tex dbus latexenc
smartparens-lua lua-mode helm-sage auto-complete-sage sage-shell-mode
deferred magic-latex-buffer iimage smartparens-latex tex-mode dired-tar
dired+ image-file bbdb-vcard bbdb-com crm vcard bbdb bbdb-site
impatient-mode htmlize cl simple-httpd w3m doc-view w3m-hist w3m-fb
bookmark-w3m w3m-ems w3m-ccl ccl w3m-favicon w3m-image w3m-proc w3m-util
pdftools pdf-occur ibuf-ext ibuffer tablist tablist-filter
semantic/wisent/comp semantic/wisent semantic/wisent/wisent
semantic/util-modes semantic/util semantic semantic/tag semantic/lex
semantic/fw mode-local cedet pdf-isearch pdf-misc imenu pdf-tools
cus-edit cus-start cus-load wid-edit pdf-view jka-compr pdf-cache
pdf-info tq pdf-util image-mode helm-mode helm-files image-dired tramp
tramp-compat tramp-loaddefs trampver dired-x dired-aux ffap helm-buffers
helm-elscreen helm-tags helm-bookmark helm-adaptive helm-info bookmark
pp helm-locate helm-grep helm-regexp helm-external helm-utils compile
helm-types delsel paren smartparens-config smartparens thingatpt
guide-key popwin re-builder auto-complete popup org-ref
org-ref-helm-bibtex org-ref-helm helm-bibtex bibtex-completion biblio
biblio-download biblio-dissemin biblio-hal biblio-dblp biblio-crossref
biblio-arxiv timezone biblio-doi biblio-core let-alist url-queue ido
hl-line helm-net browse-url xml helm-help helm helm-source eieio-compat
helm-multi-match helm-lib helm-config helm-easymenu async-bytecomp async
org-ref-core reftex-cite reftex reftex-vars parsebib subr-x ox-latex
ox-icalendar ox-html ox-ascii ox-publish ox org-ref-glossary
org-ref-bibtex org-ref-citeproc org-element message idna dired rfc822
mml mml-sec epg mm-decode mm-bodies mm-encode mailabbrev mail-utils
gmm-utils mailheader key-chord hydra lv doi-utils org-ref-utils
org-ref-pdf url-http tls gnutls url url-proxy url-privacy url-expand
url-methods url-history mailcap url-auth mail-parse rfc2231 rfc2047
rfc2045 ietf-drums url-cookie url-domsuf url-util url-parse auth-source
eieio eieio-core cl-macs gnus-util mm-util help-fns mail-prsvr
password-cache url-gw url-vars org-bibtex org org-macro org-footnote
org-pcomplete org-list org-faces org-entities noutline outline
org-version ob-sh shell pcomplete ob-ditaa ob-python ob-matlab ob-octave
ob-latex ob-gnuplot ob-emacs-lisp ob-calc calc-store calc-trail calc-ext
calc calc-loaddefs calc-macs ob-R ob-C cc-mode cc-fonts cc-guess
cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs ob
ob-tangle ob-ref ob-lob ob-table ob-exp org-src ob-keys ob-comint comint
ansi-color ob-core ob-eval org-compat org-macs org-loaddefs format-spec
find-func cal-menu calendar cal-loaddefs json map bibtex f s
ucs-normalize dash cl-seq smart-mode-line-dark-theme smart-mode-line
rich-minority winner ring edmacro kmacro use-package diminish bind-key
easy-mmode finder-inf tex-site info rx package epg-config seq byte-opt
gv bytecomp byte-compile cl-extra help-mode easymenu cconv
benchmark-init advice cl-loaddefs pcase cl-lib benchmark-init-loaddefs
time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote dbusbind inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 708416 37642)
 (symbols 48 64308 0)
 (miscs 40 918 1645)
 (strings 32 189143 16449)
 (string-bytes 1 6235080)
 (vectors 16 85592)
 (vector-slots 8 1257701 56480)
 (floats 8 1110 1034)
 (intervals 56 3818 245)
 (buffers 976 32))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26190; Package emacs. (Fri, 26 Jul 2019 11:27:02 GMT) Full text and rfc822 format available.

Message #8 received at 26190 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: wyousef <at> fcih.net
Cc: 26190 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#26190: 25.1; ffap problem with curly braces
Date: Fri, 26 Jul 2019 13:26:50 +0200
wyousef <at> fcih.net writes:

> In scratch buffer with cursor on {/etc} do M-: (ffap-guesser) RET
>
> With emacs-25 => nil
> With emacs-24.5 => "/etc"

The regression occurred with this commit:

commit ba6c32b6decaa2a72a3d5f854efd513e8e82c118
Author: Dmitry Gutov <dgutov <at> yandex.ru>
Date:   Wed Apr 8 03:18:38 2015 +0300

    ffap: Support environment variable expansion in file names
    
    Fixes: debbugs:19839
    
    * lisp/ffap.el (ffap-string-at-point-mode-alist): Support
    environment variable expansion in file names.

diff --git a/lisp/ffap.el b/lisp/ffap.el
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -1007,1 +1007,1 @@
-    (file "--:\\\\$+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:")
+    (file "--:\\\\$\\{\\}+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:")

Which is slightly confusing since \\{ and \\} are number repetition
things while {} are literal braces, but I guess Emacs will interpret
them the same way here when they can't be repetition arguments in this
form.

So this means that the braces are now part of the file name, and since
"{/etc}" doesn't exist, you get nil.

This was intended to make ffap work better with files that have curly
braces in the file names.  I guess "{/etc}" could be a valid file name?
But it's an odd one, and I'd guess that it would more commonly refer to
/etc.  So I think the right thing here is to revert this patch and just
accept that we can't guess right on file names with weird characters in
them.

Opinions?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26190; Package emacs. (Fri, 26 Jul 2019 11:39:01 GMT) Full text and rfc822 format available.

Message #11 received at 26190 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: wyousef <at> fcih.net
Cc: 26190 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#26190: 25.1; ffap problem with curly braces
Date: Fri, 26 Jul 2019 13:38:03 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> This was intended to make ffap work better with files that have curly
> braces in the file names.  I guess "{/etc}" could be a valid file name?
> But it's an odd one, and I'd guess that it would more commonly refer to
> /etc.  So I think the right thing here is to revert this patch and just
> accept that we can't guess right on file names with weird characters in
> them.

On the other hand, we could just strip the "{" from the front and "}"
from the end, which will restore the previous behaviour and possibly
still work with other files?  I've installed this on the trunk:

diff --git a/lisp/ffap.el b/lisp/ffap.el
index 47ceed47e3..33854a6c0d 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -1081,9 +1081,9 @@ ffap-string-at-point-mode-alist
   '(
     ;; The default, used when the `major-mode' is not found.
     ;; Slightly controversial decisions:
-    ;; * strip trailing "@" and ":"
+    ;; * strip trailing "@", ":" and enclosing "{"/"}".
     ;; * no commas (good for latex)
-    (file "--:\\\\${}+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:")
+    (file "--:\\\\${}+<>@-Z_[:alpha:]~*?" "{<@" "@>;.,!:}")
     ;; An url, or maybe an email/news message-id:
     (url "--:=&?$+@-Z_[:alpha:]~#,%;*()!'" "^[0-9a-zA-Z]" ":;.,!?")
     ;; Find a string that does *not* contain a colon:


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 26 Jul 2019 11:40:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 26190 <at> debbugs.gnu.org and wyousef <at> fcih.net Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 26 Jul 2019 11:40:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 24 Aug 2019 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 240 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.