Subject: bug#16785: 24.3.50; Highlighting bug with ffap on a url

From: Nicolas Richard <[email-masked]>
Date: Mon, 17 Feb 2014 19:43:40 +0100

Run this one :

emacs -Q --eval '(execute-kbd-macro (kbd "M-x f i n d - l i b r a r y <return> f f a p <return> C-s f f a p <return> M-x f f a p <return> <return> C-s f t p <return>"))'

and then type =M-x ffap=

That highlights the string ffap.el at the beginning of buffer instead of
highlighting the ftp URL (which is nevertheless suggested in the
prompt).

I had a quick look and found that the highlighting is done in
ffap-highlight, and obviously the variable ffap-string-at-point-region
is not updated when invoked on the ftp url, but I have no idea what
should be happening.

In GNU Emacs 24.3.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.20)
 of 2014-01-30 on LDLC-portable
Windowing system distributor `The X.Org Foundation', version 11.0.11405000
System Description:	Ubuntu 13.10

Configured using:
 `configure 'CFLAGS=-g3 -O2''

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

Major mode: Org

Minor modes in effect:
  TeX-PDF-mode: t
  org-indent-mode: t
  diff-auto-refine-mode: t
  global-semanticdb-minor-mode: t
  global-semantic-idle-scheduler-mode: t
  semantic-mode: t
  minibuffer-depth-indicate-mode: t
  projectile-global-mode: t
  projectile-mode: t
  dynamic-completion-mode: t
  shell-dirtrack-mode: t
  show-paren-mode: t
  recentf-mode: t
  winner-mode: t
  override-global-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-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: org-auto-fill-function
  visual-line-mode: t
  transient-mark-mode: t

Recent input:
SPC G i u l i a n a <return> g i u l i a n a _ g r 
@ i n w i n d . i t <return> <return> p h y s . S-SPC 
E n s . S-SPC à SPC l ' é c o l e SPC e u r o p é e 
n n e . S-SPC P h d D <S-backspace> <S-backspace> D 
S-SPC e t SPC p o s t d o c SPC e n SPC p h y s SPC 
n u c l é a i r e SPC A E S S S-SPC P h y s i q u e 
<return> <return> <M-return> P C-x C-s <backspace> 
O t t o SPC m a l i n g i C-x C-s M-> M-x g n u s <return> 
<return> C-n <return> n n C-x 1 C-n C-n C-n C-n C-n 
C-n C-n C-p C-p <return> C-x o C-x o C-n C-n C-n C-n 
C-n C-n C-p <return> C-x o C-n C-n C-p C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-p C-n M-e M-a C-n C-n C-n 
C-n C-e C-n C-n C-p C-M-u C-M-f C-n C-p C-n C-n C-l 
C-n C-n C-n C-M-u C-M-f C-n C-n C-n C-n C-a C-l C-n 
C-n C-p C-p C-n C-n C-n C-l C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-p C-p C-n C-l C-n 
C-x o M M u u C-p C-l C-p C-p C-p C-n C-n C-n C-p C-n 
<return> C-p <return> C-p <return> C-p <return> C-p 
C-p <return> C-p <return> C-p <return> C-p <return> 
M-< <return> q g <return> q q y C-c C-SPC M-x C-g M-x 
r e p o r t SPC e m <tab> <return>

Recent messages:
Reading active file via nndraft...done
Checking new news...done
Are you sure you want to quit reading news? (y or n)  y
Saving file /home/youngfrog/.newsrc...
Wrote /home/youngfrog/.newsrc
Saving /home/youngfrog/.newsrc.eld...
Saving file /home/youngfrog/.newsrc.eld...
Wrote /home/youngfrog/.newsrc.eld
Saving /home/youngfrog/.newsrc.eld...done
C-c C-SPC is undefined
Quit

Load-path shadows:
/home/youngfrog/.emacs.d/elpa/git-commit-mode-20130828.601/git-commit-mode hides ~/sourcetrees/git-modes/git-commit-mode
/home/youngfrog/.emacs.d/elpa/git-rebase-mode-20130828.242/git-rebase-mode hides ~/sourcetrees/git-modes/git-rebase-mode
/usr/local/texlive/2012/texmf/asymptote/asy-mode hides ~/.emacs.d/lisp/asy-mode
/home/youngfrog/.emacs.d/elpa/bind-key-20130427.1719/bind-key hides ~/sourcetrees/use-package/bind-key
~/sourcetrees/org-mode/lisp/ob-matlab hides /usr/local/share/emacs/24.3.50/lisp/org/ob-matlab
~/sourcetrees/org-mode/lisp/org-archive hides /usr/local/share/emacs/24.3.50/lisp/org/org-archive
~/sourcetrees/org-mode/lisp/ob-dot hides /usr/local/share/emacs/24.3.50/lisp/org/ob-dot
~/sourcetrees/org-mode/lisp/org-version hides /usr/local/share/emacs/24.3.50/lisp/org/org-version
~/sourcetrees/org-mode/lisp/org-capture hides /usr/local/share/emacs/24.3.50/lisp/org/org-capture
~/sourcetrees/org-mode/lisp/ox-texinfo hides /usr/local/share/emacs/24.3.50/lisp/org/ox-texinfo
~/sourcetrees/org-mode/lisp/ox hides /usr/local/share/emacs/24.3.50/lisp/org/ox
~/sourcetrees/org-mode/lisp/ob-ruby hides /usr/local/share/emacs/24.3.50/lisp/org/ob-ruby
~/sourcetrees/org-mode/lisp/org-ctags hides /usr/local/share/emacs/24.3.50/lisp/org/org-ctags
~/sourcetrees/org-mode/lisp/org-footnote hides /usr/local/share/emacs/24.3.50/lisp/org/org-footnote
~/sourcetrees/org-mode/lisp/ob-makefile hides /usr/local/share/emacs/24.3.50/lisp/org/ob-makefile
~/sourcetrees/org-mode/lisp/org-crypt hides /usr/local/share/emacs/24.3.50/lisp/org/org-crypt
~/sourcetrees/org-mode/lisp/ob-awk hides /usr/local/share/emacs/24.3.50/lisp/org/ob-awk
~/sourcetrees/org-mode/lisp/ob-calc hides /usr/local/share/emacs/24.3.50/lisp/org/ob-calc
~/sourcetrees/org-mode/lisp/ob-picolisp hides /usr/local/share/emacs/24.3.50/lisp/org/ob-picolisp
~/sourcetrees/org-mode/lisp/ob-sass hides /usr/local/share/emacs/24.3.50/lisp/org/ob-sass
~/sourcetrees/org-mode/lisp/ob-ref hides /usr/local/share/emacs/24.3.50/lisp/org/ob-ref
~/sourcetrees/org-mode/lisp/ob-lilypond hides /usr/local/share/emacs/24.3.50/lisp/org/ob-lilypond
~/sourcetrees/org-mode/lisp/org-docview hides /usr/local/share/emacs/24.3.50/lisp/org/org-docview
~/sourcetrees/org-mode/lisp/org-rmail hides /usr/local/share/emacs/24.3.50/lisp/org/org-rmail
~/sourcetrees/org-mode/lisp/ox-ascii hides /usr/local/share/emacs/24.3.50/lisp/org/ox-ascii
~/sourcetrees/org-mode/lisp/ob-keys hides /usr/local/share/emacs/24.3.50/lisp/org/ob-keys
~/sourcetrees/org-mode/lisp/ob-shen hides /usr/local/share/emacs/24.3.50/lisp/org/ob-shen
~/sourcetrees/org-mode/lisp/ob-octave hides /usr/local/share/emacs/24.3.50/lisp/org/ob-octave
~/sourcetrees/org-mode/lisp/org-info hides /usr/local/share/emacs/24.3.50/lisp/org/org-info
~/sourcetrees/org-mode/lisp/ox-man hides /usr/local/share/emacs/24.3.50/lisp/org/ox-man
~/sourcetrees/org-mode/lisp/org-feed hides /usr/local/share/emacs/24.3.50/lisp/org/org-feed
~/sourcetrees/org-mode/lisp/ox-odt hides /usr/local/share/emacs/24.3.50/lisp/org/ox-odt
~/sourcetrees/org-mode/lisp/ob-C hides /usr/local/share/emacs/24.3.50/lisp/org/ob-C
~/sourcetrees/org-mode/lisp/org-eshell hides /usr/local/share/emacs/24.3.50/lisp/org/org-eshell
~/sourcetrees/org-mode/lisp/org-list hides /usr/local/share/emacs/24.3.50/lisp/org/org-list
~/sourcetrees/org-mode/lisp/org-protocol hides /usr/local/share/emacs/24.3.50/lisp/org/org-protocol
~/sourcetrees/org-mode/lisp/ob-emacs-lisp hides /usr/local/share/emacs/24.3.50/lisp/org/ob-emacs-lisp
~/sourcetrees/org-mode/lisp/org-compat hides /usr/local/share/emacs/24.3.50/lisp/org/org-compat
~/sourcetrees/org-mode/lisp/ob-lisp hides /usr/local/share/emacs/24.3.50/lisp/org/ob-lisp
~/sourcetrees/org-mode/lisp/org-macs hides /usr/local/share/emacs/24.3.50/lisp/org/org-macs
~/sourcetrees/org-mode/lisp/ob-ditaa hides /usr/local/share/emacs/24.3.50/lisp/org/ob-ditaa
~/sourcetrees/org-mode/lisp/ob-mscgen hides /usr/local/share/emacs/24.3.50/lisp/org/ob-mscgen
~/sourcetrees/org-mode/lisp/ob hides /usr/local/share/emacs/24.3.50/lisp/org/ob
~/sourcetrees/org-mode/lisp/org-indent hides /usr/local/share/emacs/24.3.50/lisp/org/org-indent
~/sourcetrees/org-mode/lisp/ob-gnuplot hides /usr/local/share/emacs/24.3.50/lisp/org/ob-gnuplot
~/sourcetrees/org-mode/lisp/ob-maxima hides /usr/local/share/emacs/24.3.50/lisp/org/ob-maxima
~/sourcetrees/org-mode/lisp/ob-scheme hides /usr/local/share/emacs/24.3.50/lisp/org/ob-scheme
~/sourcetrees/org-mode/lisp/ob-table hides /usr/local/share/emacs/24.3.50/lisp/org/ob-table
~/sourcetrees/org-mode/lisp/org-inlinetask hides /usr/local/share/emacs/24.3.50/lisp/org/org-inlinetask
~/sourcetrees/org-mode/lisp/ox-org hides /usr/local/share/emacs/24.3.50/lisp/org/ox-org
~/sourcetrees/org-mode/lisp/org-macro hides /usr/local/share/emacs/24.3.50/lisp/org/org-macro
~/sourcetrees/org-mode/lisp/org-id hides /usr/local/share/emacs/24.3.50/lisp/org/org-id
~/sourcetrees/org-mode/lisp/ob-java hides /usr/local/share/emacs/24.3.50/lisp/org/ob-java
~/sourcetrees/org-mode/lisp/org-clock hides /usr/local/share/emacs/24.3.50/lisp/org/org-clock
~/sourcetrees/org-mode/lisp/ob-screen hides /usr/local/share/emacs/24.3.50/lisp/org/ob-screen
~/sourcetrees/org-mode/lisp/org-faces hides /usr/local/share/emacs/24.3.50/lisp/org/org-faces
~/sourcetrees/org-mode/lisp/ob-sql hides /usr/local/share/emacs/24.3.50/lisp/org/ob-sql
~/sourcetrees/org-mode/lisp/org-mhe hides /usr/local/share/emacs/24.3.50/lisp/org/org-mhe
~/sourcetrees/org-mode/lisp/ox-md hides /usr/local/share/emacs/24.3.50/lisp/org/ox-md
~/sourcetrees/org-mode/lisp/ob-tangle hides /usr/local/share/emacs/24.3.50/lisp/org/ob-tangle
~/sourcetrees/org-mode/lisp/org-irc hides /usr/local/share/emacs/24.3.50/lisp/org/org-irc
~/sourcetrees/org-mode/lisp/ob-ocaml hides /usr/local/share/emacs/24.3.50/lisp/org/ob-ocaml
~/sourcetrees/org-mode/lisp/org-loaddefs hides /usr/local/share/emacs/24.3.50/lisp/org/org-loaddefs
~/sourcetrees/org-mode/lisp/org-colview hides /usr/local/share/emacs/24.3.50/lisp/org/org-colview
~/sourcetrees/org-mode/lisp/org-w3m hides /usr/local/share/emacs/24.3.50/lisp/org/org-w3m
~/sourcetrees/org-mode/lisp/org-plot hides /usr/local/share/emacs/24.3.50/lisp/org/org-plot
~/sourcetrees/org-mode/lisp/ob-R hides /usr/local/share/emacs/24.3.50/lisp/org/ob-R
~/sourcetrees/org-mode/lisp/org-install hides /usr/local/share/emacs/24.3.50/lisp/org/org-install
~/sourcetrees/org-mode/lisp/ox-html hides /usr/local/share/emacs/24.3.50/lisp/org/ox-html
~/sourcetrees/org-mode/lisp/org-attach hides /usr/local/share/emacs/24.3.50/lisp/org/org-attach
~/sourcetrees/org-mode/lisp/org-mobile hides /usr/local/share/emacs/24.3.50/lisp/org/org-mobile
~/sourcetrees/org-mode/lisp/org-datetree hides /usr/local/share/emacs/24.3.50/lisp/org/org-datetree
~/sourcetrees/org-mode/lisp/org-mouse hides /usr/local/share/emacs/24.3.50/lisp/org/org-mouse
~/sourcetrees/org-mode/lisp/ob-org hides /usr/local/share/emacs/24.3.50/lisp/org/ob-org
~/sourcetrees/org-mode/lisp/org-bibtex hides /usr/local/share/emacs/24.3.50/lisp/org/org-bibtex
~/sourcetrees/org-mode/lisp/ox-beamer hides /usr/local/share/emacs/24.3.50/lisp/org/ox-beamer
~/sourcetrees/org-mode/lisp/org-gnus hides /usr/local/share/emacs/24.3.50/lisp/org/org-gnus
~/sourcetrees/org-mode/lisp/ob-plantuml hides /usr/local/share/emacs/24.3.50/lisp/org/ob-plantuml
~/sourcetrees/org-mode/lisp/ob-css hides /usr/local/share/emacs/24.3.50/lisp/org/ob-css
~/sourcetrees/org-mode/lisp/ob-perl hides /usr/local/share/emacs/24.3.50/lisp/org/ob-perl
~/sourcetrees/org-mode/lisp/ob-comint hides /usr/local/share/emacs/24.3.50/lisp/org/ob-comint
~/sourcetrees/org-mode/lisp/ob-python hides /usr/local/share/emacs/24.3.50/lisp/org/ob-python
~/sourcetrees/org-mode/lisp/ob-asymptote hides /usr/local/share/emacs/24.3.50/lisp/org/ob-asymptote
~/sourcetrees/org-mode/lisp/ob-io hides /usr/local/share/emacs/24.3.50/lisp/org/ob-io
~/sourcetrees/org-mode/lisp/ox-icalendar hides /usr/local/share/emacs/24.3.50/lisp/org/ox-icalendar
~/sourcetrees/org-mode/lisp/ob-scala hides /usr/local/share/emacs/24.3.50/lisp/org/ob-scala
~/sourcetrees/org-mode/lisp/ob-fortran hides /usr/local/share/emacs/24.3.50/lisp/org/ob-fortran
~/sourcetrees/org-mode/lisp/org-src hides /usr/local/share/emacs/24.3.50/lisp/org/org-src
~/sourcetrees/org-mode/lisp/org-table hides /usr/local/share/emacs/24.3.50/lisp/org/org-table
~/sourcetrees/org-mode/lisp/org-agenda hides /usr/local/share/emacs/24.3.50/lisp/org/org-agenda
~/sourcetrees/org-mode/lisp/org hides /usr/local/share/emacs/24.3.50/lisp/org/org
~/sourcetrees/org-mode/lisp/org-pcomplete hides /usr/local/share/emacs/24.3.50/lisp/org/org-pcomplete
~/sourcetrees/org-mode/lisp/org-bbdb hides /usr/local/share/emacs/24.3.50/lisp/org/org-bbdb
~/sourcetrees/org-mode/lisp/ob-clojure hides /usr/local/share/emacs/24.3.50/lisp/org/ob-clojure
~/sourcetrees/org-mode/lisp/ob-eval hides /usr/local/share/emacs/24.3.50/lisp/org/ob-eval
~/sourcetrees/org-mode/lisp/ob-js hides /usr/local/share/emacs/24.3.50/lisp/org/ob-js
~/sourcetrees/org-mode/lisp/org-timer hides /usr/local/share/emacs/24.3.50/lisp/org/org-timer
~/sourcetrees/org-mode/lisp/org-element hides /usr/local/share/emacs/24.3.50/lisp/org/org-element
~/sourcetrees/org-mode/lisp/ob-ledger hides /usr/local/share/emacs/24.3.50/lisp/org/ob-ledger
~/sourcetrees/org-mode/lisp/ob-haskell hides /usr/local/share/emacs/24.3.50/lisp/org/ob-haskell
~/sourcetrees/org-mode/lisp/ob-latex hides /usr/local/share/emacs/24.3.50/lisp/org/ob-latex
~/sourcetrees/org-mode/lisp/ox-publish hides /usr/local/share/emacs/24.3.50/lisp/org/ox-publish
~/sourcetrees/org-mode/lisp/ob-sqlite hides /usr/local/share/emacs/24.3.50/lisp/org/ob-sqlite
~/sourcetrees/org-mode/lisp/ox-latex hides /usr/local/share/emacs/24.3.50/lisp/org/ox-latex
~/sourcetrees/org-mode/lisp/ob-core hides /usr/local/share/emacs/24.3.50/lisp/org/ob-core
~/sourcetrees/org-mode/lisp/ob-lob hides /usr/local/share/emacs/24.3.50/lisp/org/ob-lob
~/sourcetrees/org-mode/lisp/ob-exp hides /usr/local/share/emacs/24.3.50/lisp/org/ob-exp
~/sourcetrees/org-mode/lisp/org-habit hides /usr/local/share/emacs/24.3.50/lisp/org/org-habit
~/sourcetrees/org-mode/lisp/org-entities hides /usr/local/share/emacs/24.3.50/lisp/org/org-entities
/mnt/gentoo-home/youngfrog/sourcetrees/sage-mode-from-hg/emacs/.dir-locals hides /usr/local/share/emacs/24.3.50/lisp/gnus/.dir-locals

Features:
(shadow emacsbug sendmail flow-fill gnus-cite smiley shr-color color shr
browse-url mm-archive mail-extr gnus-async gnus-bcklg qp sort gnus-ml
nndraft nnmh nnfolder nnmaildir gnus-agent gnus-srvr gnus-score
score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime
smime dig mailcap nntp gnus-cache gnus-sum nnoo gnus-group gnus-undo
nnmail mail-source gnus-start gnus-spec gnus-int gnus-range message
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus
gnus-ems nnheader mail-utils hippie-exp magit-key-mode magit tramp
tramp-compat tramp-loaddefs trampver epa epg epg-config autorevert
filenotify git-rebase-mode git-commit-mode pp misearch multi-isearch
eieio-opt speedbar sb-image dframe help-mode org-colview view cal-china
lunar solar cal-dst cal-bahai cal-islam cal-hebrew holidays hol-loaddefs
diary-lib diary-loaddefs cal-iso org-agenda mule-util cal-move
parse-time time-stamp reftex-dcr reftex-auc reftex reftex-vars preview
prv-emacs font-latex latex tex-style sage-latex tex-buf tex crm
org-indent disp-table org-rmail org-mhe org-irc org-info org-gnus
org-docview org-bibtex bibtex org-bbdb org-w3m vc-git server paredit
hideshow yf-asy asy-mode two-mode-mode cc-mode cc-fonts cc-guess
cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
multiple-cursors mc-separate-operations rectangular-region-mode
mc-mark-pop mc-mark-more mc-cycle-cursors mc-edit-lines
multiple-cursors-core rect sage sage-load rx preview-latex smerge-mode
diff-mode yf/makeadefun semantic/db-mode semantic/db eieio-base
semantic/idle semantic/format ezimage semantic/tag-ls semantic/find
semantic/ctxt semantic/util-modes semantic/util semantic semantic/tag
semantic/lex semantic/fw mode-local cedet mb-depth icomplete autoinsert
diminish projectile grep compile dash s warnings completion ert ewoc
debug pcase ob-R ob-shell shell windmove latexenc ox-icalendar ox-html
ox-beamer ox-latex ox-ascii ox-publish ox org-element avl-tree org
org-macro org-footnote org-pcomplete pcomplete org-list org-faces
org-entities noutline outline org-version ob-emacs-lisp ob ob-tangle
org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint comint
ansi-color ob-core ob-eval org-compat org-macs org-loaddefs format-spec
find-func paren doc-view jka-compr image-mode dired ido recentf
tree-widget wid-edit advice tex-site auto-loads ffap thingatpt url-parse
auth-source gnus-util mm-util mail-prsvr password-cache url-vars derived
winner ring cal-menu calendar cal-loaddefs edmacro kmacro
adaptive-wrap-autoloads bbdb-autoloads bind-key-autoloads
csv-mode-autoloads csv-nav-autoloads diminish-autoloads gist-autoloads
gh-autoloads eieio byte-opt eieio-core git-commit-mode-autoloads
git-rebase-mode-autoloads google-translate-autoloads help-fns cl-macs gv
cl cl-loaddefs cl-lib litable-autoloads logito-autoloads
markdown-mode-autoloads mode-compile-autoloads
multiple-cursors-autoloads paredit-autoloads pcache-autoloads
pcsv-autoloads pde-autoloads pov-mode-autoloads projectile-autoloads
s-autoloads sicp-autoloads smartparens-autoloads dash-autoloads
finder-inf workgroups-autoloads package wheatgrass-theme info easymenu
use-package bytecomp byte-compile cconv bind-key easy-mmode time-date
tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list
newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer 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 make-network-process
gfilenotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty emacs)