GNU bug report logs - #14950
24.3.50; gnus: Fontification of URLs is not satisfactory

Previous Next

Packages: emacs, gnus;

Reported by: Jambunathan K <kjambunathan <at> gmail.com>

Date: Thu, 25 Jul 2013 10:11:02 UTC

Severity: minor

Found in version 24.3.50

Done: Katsumi Yamaoka <yamaoka <at> jpl.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 14950 in the body.
You can then email your comments to 14950 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#14950; Package emacs. (Thu, 25 Jul 2013 10:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jambunathan K <kjambunathan <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 25 Jul 2013 10:11:02 GMT) Full text and rfc822 format available.

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

From: Jambunathan K <kjambunathan <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; gnus: Fontification of URLs is not satisfactory
Date: Thu, 25 Jul 2013 15:41:57 +0530
[Message part 1 (text/plain, inline)]
Gnus is from Emacs repo.

Within Gnus, 

  [Chicago Export filters for Org-mode]
  http://repo.or.cz/w/JabRefChicagoForOrgmode.git/blob_plain/HEAD:/net.sf.jabref.export.Chicago.ODF(English)-1.2.jar


How does the above URL below. Is it partly in bold and partly in default
font.  (See attached screenshot) Specifically, the URL is fontified only
till "1" (but doesn't include trailing ".2.jar" part).


,---- How "1" is fontified
| Character code properties: customize what to show
|   name: DIGIT ONE
|   general-category: Nd (Number, Decimal Digit)
|   decomposition: (49) ('1')
| 
| This is an active area of a link (widget)Top.
| 
| 
| There are 2 overlays here:
|  From 4589 to 4697
|   face                 gnus-button
|  From 4589 to 4697
|   button               link (widget)Top
|   evaporate            t
|   face                 widget-button
|   follow-link          mouse-face
|   help-echo            "Follow the link"
|   keymap               [Show]
|   mouse-face           (highlight)
|   pointer              hand
| 
| 
| There are text properties here:
|   gnus-callback        gnus-button-push
|   gnus-data            [Show]
|   gnus-string          [Show]
|   mouse-face           highlight
`----

,---- How "2" is fontified
| Character code properties: customize what to show
|   name: DIGIT TWO
|   general-category: Nd (Number, Decimal Digit)
|   decomposition: (50) ('2')
`----

In GNU Emacs 24.3.50.23 (i686-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2013-07-25 on debian-6.05
Bzr revision: 113532 eliz <at> gnu.org-20130724173642-f1rke7jwa9330n3t
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
Important settings:
  value of $LANG: en_IN
  locale-coding-system: iso-latin-1-unix
  default enable-multibyte-characters: t

Major mode: Article

[gnus-url-fontification-is-bad.png (image/png, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14950; Package emacs. (Thu, 25 Jul 2013 11:30:03 GMT) Full text and rfc822 format available.

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

From: Katsumi Yamaoka <yamaoka <at> jpl.org>
To: Jambunathan K <kjambunathan <at> gmail.com>
Cc: 14950 <at> debbugs.gnu.org
Subject: Re: bug#14950: 24.3.50;
 gnus: Fontification of URLs is not satisfactory
Date: Thu, 25 Jul 2013 20:29:13 +0900
Jambunathan K wrote:
> Gnus is from Emacs repo.

> Within Gnus,

>   [Chicago Export filters for Org-mode]
>   http://repo.or.cz/w/JabRefChicagoForOrgmode.git/blob_plain/HEAD:/net.sf.jabref.export.Chicago.ODF(English)-1.2.jar

> How does the above URL below. Is it partly in bold and partly in default
> font.  (See attached screenshot) Specifically, the URL is fontified only
> till "1" (but doesn't include trailing ".2.jar" part).

What should be improved is the default value of the user option
`gnus-button-url-regexp'.  But it is too complicated to let me
encourage to do it without enbugging.  Anyone?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14950; Package emacs. (Thu, 25 Jul 2013 12:14:02 GMT) Full text and rfc822 format available.

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

From: Jambunathan K <kjambunathan <at> gmail.com>
To: Katsumi Yamaoka <yamaoka <at> jpl.org>
Cc: 14950 <at> debbugs.gnu.org
Subject: Re: bug#14950: 24.3.50;
 gnus: Fontification of URLs is not satisfactory
Date: Thu, 25 Jul 2013 17:45:25 +0530
Katsumi Yamaoka <yamaoka <at> jpl.org> writes:

> Jambunathan K wrote:
>> Gnus is from Emacs repo.
>
>> Within Gnus,
>
>>   [Chicago Export filters for Org-mode]
>>   http://repo.or.cz/w/JabRefChicagoForOrgmode.git/blob_plain/HEAD:/net.sf.jabref.export.Chicago.ODF(English)-1.2.jar
>
>> How does the above URL below. Is it partly in bold and partly in default
>> font.  (See attached screenshot) Specifically, the URL is fontified only
>> till "1" (but doesn't include trailing ".2.jar" part).
>
> What should be improved is the default value of the user option
> `gnus-button-url-regexp'.  But it is too complicated to let me
> encourage to do it without enbugging.  Anyone?

I don't understand URLs.  

 (English)-1.2.jar
 ^       ^
 ^       ^

A quick X-ray operation with xr.el, suggested to me that the parenthesis
- () - around English could be the problem maker.  So I removed the ()
around English and re-builder matches the whole url.

Here is what xr.el reports.

xr.el is at http://debbugs.gnu.org/cgi/bugreport.cgi?msg=40;filename=xr.el;att=1;bug=13369

M-: (xr gnus-button-url-regexp)

--8<---------------cut here---------------start------------->8---

(seq
 word-boundary
 (group
  (group
   (or "www."
       (seq
	(group
	 (or
	  (seq
	   (opt "s")
	   "http"
	   (opt "s"))
	  "ftp" "file" "gopher" "nntp" "news" "telnet" "wais" "mailto" "info"))
	":")))
  (opt
   (group "//"
	  (one-or-more
	   (any "." "_" "0-9" "a-z" "-"))
	  ":"
	  (zero-or-more
	   (any "0-9"))))
  (or
   (seq
    (one-or-more
     (any "," "." ";" ":" "?" "!"
	  word "/" "\\" "+" "*" "&" "%" "~" "@" "$" "#" "=" "_" "0-9" "a-z" "-"))
    "("
    (one-or-more
     (any "," "." ";" ":" "?" "!"
	  word "/" "\\" "+" "*" "&" "%" "~" "@" "$" "#" "=" "_" "0-9" "a-z" "-"))
    (zero-or-more
     (any
      word "/" "\\" "+" "*" "&" "%" "~" "@" "$" "#" "=" "_" "0-9" "a-z" "-"))
    ")"
    (zero-or-more
     (any
      word "/" "\\" "+" "*" "&" "%" "~" "@" "$" "#" "=" "_" "0-9" "a-z" "-")))
   (seq
    (one-or-more
     (any "," "." ";" ":" "?" "!"
	  word "/" "\\" "+" "*" "&" "%" "~" "@" "$" "#" "=" "_" "0-9" "a-z" "-"))
    (any
     word "/" "\\" "+" "*" "&" "%" "~" "@" "$" "#" "=" "_" "0-9" "a-z" "-")))))

--8<---------------cut here---------------end--------------->8---


----------------------------------------------------------------

As an aside, 

If I do,
   
   M-x browse-url-emacs RET

with point on that link, I am prompted for the "whole" URL.  The
interactive spec for browse-url goes something like

  (interactive (browse-url-interactive-arg "URL: "))

which in turn relies on 

  (thing-at-point 'url t)

So may be Gnus, can fuzzily position itself on what looks like a URL and
then defer to `thing-at-point' to do the nasty work of identifying the
boundaries.  This way, atleast Gnus owners can blame someone else :-).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14950; Package emacs. (Thu, 25 Jul 2013 13:13:01 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Katsumi Yamaoka <yamaoka <at> jpl.org>
Cc: 14950 <at> debbugs.gnu.org, Jambunathan K <kjambunathan <at> gmail.com>
Subject: Re: bug#14950: 24.3.50;
 gnus: Fontification of URLs is not satisfactory
Date: Thu, 25 Jul 2013 15:11:59 +0200
Katsumi Yamaoka <yamaoka <at> jpl.org> writes:

> What should be improved is the default value of the user option
> `gnus-button-url-regexp'.  But it is too complicated to let me
> encourage to do it without enbugging.  Anyone?

How about this?

diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 31a108a..2433db2 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -7177,7 +7177,8 @@ groups."
 	  "\\(?:"
 	  ;; Match paired parentheses, e.g. in Wikipedia URLs:
 	  ;; http://thread.gmane.org/47B4E3B2.3050402 <at> gmail.com
-	  "[" chars punct "]+" "(" "[" chars punct "]+" "[" chars "]*)" "[" chars "]*"
+	  "[" chars punct "]+" "(" "[" chars punct "]+" "[" chars "]*)"
+	  "\\(?:" "[" chars punct "]+" "[" chars "]" "\\)?"
 	  "\\|"
 	  "[" chars punct     "]+" "[" chars "]"
 	  "\\)"))

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Reply sent to Katsumi Yamaoka <yamaoka <at> jpl.org>:
You have taken responsibility. (Thu, 25 Jul 2013 23:42:01 GMT) Full text and rfc822 format available.

Notification sent to Jambunathan K <kjambunathan <at> gmail.com>:
bug acknowledged by developer. (Thu, 25 Jul 2013 23:42:02 GMT) Full text and rfc822 format available.

Message #19 received at 14950-done <at> debbugs.gnu.org (full text, mbox):

From: Katsumi Yamaoka <yamaoka <at> jpl.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 14950-done <at> debbugs.gnu.org, Jambunathan K <kjambunathan <at> gmail.com>
Subject: Re: bug#14950: 24.3.50;
 gnus: Fontification of URLs is not satisfactory
Date: Fri, 26 Jul 2013 08:40:56 +0900
Andreas Schwab wrote:
> Katsumi Yamaoka <yamaoka <at> jpl.org> writes:

>> What should be improved is the default value of the user option
>> `gnus-button-url-regexp'.  But it is too complicated to let me
>> encourage to do it without enbugging.  Anyone?

> How about this?

> diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
> index 31a108a..2433db2 100644
> --- a/lisp/gnus/gnus-art.el
> +++ b/lisp/gnus/gnus-art.el
> @@ -7177,7 +7177,8 @@ groups."
>  	  "\\(?:"
>  	  ;; Match paired parentheses, e.g. in Wikipedia URLs:
>  	  ;; http://thread.gmane.org/47B4E3B2.3050402 <at> gmail.com
> - "[" chars punct "]+" "(" "[" chars punct "]+" "[" chars "]*)" "["
> chars "]*"
> +	  "[" chars punct "]+" "(" "[" chars punct "]+" "[" chars "]*)"
> +	  "\\(?:" "[" chars punct "]+" "[" chars "]" "\\)?"
>  	  "\\|"
>  	  "[" chars punct     "]+" "[" chars "]"
>  	  "\\)"))

Great!  I understood what what you changed meant.  Thanks.
The original one only matches the last part of a url like:

http://.../abc.def(ghi)jklmno

But yours matches:

http://.../abc.def(ghi)jkl.mno

Maybe making it match the one like

http://.../abc.def(ghi)jkl.mno/pqr(stu)vwx

is not necessary.  I've installed your patch.




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

This bug report was last modified 11 years and 299 days ago.

Previous Next


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