all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#14950: 24.3.50; gnus: Fontification of URLs is not satisfactory
@ 2013-07-25 10:11 Jambunathan K
  2013-07-25 11:29 ` Katsumi Yamaoka
  0 siblings, 1 reply; 5+ messages in thread
From: Jambunathan K @ 2013-07-25 10:11 UTC (permalink / raw
  To: 14950

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


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@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


[-- Attachment #2: gnus-url-fontification-is-bad.png --]
[-- Type: image/png, Size: 17693 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#14950: 24.3.50; gnus: Fontification of URLs is not satisfactory
  2013-07-25 10:11 bug#14950: 24.3.50; gnus: Fontification of URLs is not satisfactory Jambunathan K
@ 2013-07-25 11:29 ` Katsumi Yamaoka
  2013-07-25 12:15   ` Jambunathan K
  2013-07-25 13:11   ` Andreas Schwab
  0 siblings, 2 replies; 5+ messages in thread
From: Katsumi Yamaoka @ 2013-07-25 11:29 UTC (permalink / raw
  To: Jambunathan K; +Cc: 14950

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?





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#14950: 24.3.50; gnus: Fontification of URLs is not satisfactory
  2013-07-25 11:29 ` Katsumi Yamaoka
@ 2013-07-25 12:15   ` Jambunathan K
  2013-07-25 13:11   ` Andreas Schwab
  1 sibling, 0 replies; 5+ messages in thread
From: Jambunathan K @ 2013-07-25 12:15 UTC (permalink / raw
  To: Katsumi Yamaoka; +Cc: 14950

Katsumi Yamaoka <yamaoka@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 :-).





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#14950: 24.3.50; gnus: Fontification of URLs is not satisfactory
  2013-07-25 11:29 ` Katsumi Yamaoka
  2013-07-25 12:15   ` Jambunathan K
@ 2013-07-25 13:11   ` Andreas Schwab
  2013-07-25 23:40     ` Katsumi Yamaoka
  1 sibling, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2013-07-25 13:11 UTC (permalink / raw
  To: Katsumi Yamaoka; +Cc: 14950, Jambunathan K

Katsumi Yamaoka <yamaoka@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@gmail.com
-	  "[" chars punct "]+" "(" "[" chars punct "]+" "[" chars "]*)" "[" chars "]*"
+	  "[" chars punct "]+" "(" "[" chars punct "]+" "[" chars "]*)"
+	  "\\(?:" "[" chars punct "]+" "[" chars "]" "\\)?"
 	  "\\|"
 	  "[" chars punct     "]+" "[" chars "]"
 	  "\\)"))

Andreas.

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





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#14950: 24.3.50; gnus: Fontification of URLs is not satisfactory
  2013-07-25 13:11   ` Andreas Schwab
@ 2013-07-25 23:40     ` Katsumi Yamaoka
  0 siblings, 0 replies; 5+ messages in thread
From: Katsumi Yamaoka @ 2013-07-25 23:40 UTC (permalink / raw
  To: Andreas Schwab; +Cc: 14950-done, Jambunathan K

Andreas Schwab wrote:
> Katsumi Yamaoka <yamaoka@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@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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-07-25 23:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-25 10:11 bug#14950: 24.3.50; gnus: Fontification of URLs is not satisfactory Jambunathan K
2013-07-25 11:29 ` Katsumi Yamaoka
2013-07-25 12:15   ` Jambunathan K
2013-07-25 13:11   ` Andreas Schwab
2013-07-25 23:40     ` Katsumi Yamaoka

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.