all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: rms@gnu.org
Cc: emacs-devel@gnu.org
Subject: rfn-eshadow (Was: [jidanni@jidanni.org: ffap; prompt turns color misleadingly])
Date: Thu, 03 Jan 2008 23:42:07 +0200	[thread overview]
Message-ID: <87k5mq60y8.fsf@jurta.org> (raw)
In-Reply-To: <E1JAMjL-00019Y-1Z@fencepost.gnu.org> (Richard Stallman's message of "Thu, 03 Jan 2008 04:51:15 -0500")

> I doubt that Michelangelo Grigni is still involved in ffap.el.
> Someone else interested in ffap.el might want to work on this.

ffap.el mentions FSF as a maintainer, but actually this bug has nothing
to do with ffap.

The problem is that even if ffap is disabled, when typing an URL in the
minibuffer, rfn-eshadow.el threats it as a file name, and puts a shadow
over the `http:' part because it contains double slashes //.

I think the right way to fix this problem is the following patch that
prevents handling of URLs by file-name-shadow-mode:

Index: lisp/rfn-eshadow.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/rfn-eshadow.el,v
retrieving revision 1.26
diff -u -w -b -r1.26 rfn-eshadow.el
--- lisp/rfn-eshadow.el	21 Sep 2007 05:24:05 -0000	1.26
+++ lisp/rfn-eshadow.el	3 Jan 2008 21:36:44 -0000
@@ -177,7 +177,10 @@
 `file-name-shadow-mode'; the minibuffer should have already
 been set up by `rfn-eshadow-setup-minibuffer'."
   (condition-case nil
-      (let ((goal (substitute-in-file-name (minibuffer-contents)))
+      (let* ((mc (minibuffer-contents))
+	     (goal (if (string-match-p "\\`\\(https?\\|ftp\\|file\\)://" mc)
+		       mc
+		     (substitute-in-file-name mc)))
             (mid (overlay-end rfn-eshadow-overlay))
             (start (minibuffer-prompt-end))
             (end (point-max)))

> From: jidanni@jidanni.org
> Subject: ffap; prompt turns color misleadingly
> To: Michelangelo Grigni <mic@mathcs.emory.edu>
> Cc: bug-gnu-emacs@gnu.org
> Date: Mon, 31 Dec 2007 07:45:50 +0800
>
> $ emacs -Q file_with_url_in_it
> Put the cursor on the URL, do M-x ffap.
> Now add some slashes at the end of the URL. The preceding part of the URL
> changes color, making us think that we are now just referring to the local
> file system as the usual shortcut: /wrong//right, but in fact it is all
> appended to the URL anyway!
>
> Also please use a third color for the "http:/" and "ftp:/", or use the
> same color as the rest of the URL. Currently you use the "discarded
> text" color, which is not exactly right, as it is indeed part of the URL.

-- 
Juri Linkov
http://www.jurta.org/emacs/

  reply	other threads:[~2008-01-03 21:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-03  9:51 [jidanni@jidanni.org: ffap; prompt turns color misleadingly] Richard Stallman
2008-01-03 21:42 ` Juri Linkov [this message]
2008-01-03 22:12   ` rfn-eshadow Michael Albinus
2008-01-03 22:28     ` rfn-eshadow Juri Linkov
2008-01-04  2:51   ` rfn-eshadow Stefan Monnier
2008-01-04  9:51     ` rfn-eshadow Juri Linkov
2008-01-04 12:11       ` rfn-eshadow Michael Albinus
2008-01-04 21:52         ` rfn-eshadow Juri Linkov
2008-01-04 22:23           ` rfn-eshadow Michael Albinus
2008-01-05 10:36             ` rfn-eshadow Juri Linkov
2008-01-05 22:34               ` rfn-eshadow Stefan Monnier
2008-01-06 14:08                 ` rfn-eshadow Michael Albinus
2008-01-06 21:54                   ` rfn-eshadow Juri Linkov
2008-01-07  6:57                     ` rfn-eshadow Michael Albinus
2008-01-09  0:59                       ` rfn-eshadow Juri Linkov
2008-01-09  2:17                         ` rfn-eshadow Stefan Monnier
2008-01-09  8:13                           ` rfn-eshadow Michael Albinus
2008-01-05  5:54     ` rfn-eshadow Richard Stallman

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=87k5mq60y8.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    --cc=rms@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.