unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#16398: 24.3.50; [PATCH] eww: Tiny fix to display bookmark list.
@ 2014-01-08  2:19 Kenjiro NAKAYAMA
  2014-01-08 15:53 ` Ted Zlatanov
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Kenjiro NAKAYAMA @ 2014-01-08  2:19 UTC (permalink / raw)
  To: 16398

(I sent this mail before, but since the mail did not receive mailing
list , I resend. Sorry if it is duplicated.)

Altough current eww bookmark list shows "URL" and "Title", it is better
that "Title" is left side and "URL" is right, in my opinion.
And it makes possible to display full URL withought clip.

This is the patch for it. Please review and install it to the official tree if appreciated.

Signed-off-by: Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com>

          * net/eww.el (eww-bookmark-prepare): Tiny fix to display
            bookmark list.

---
 lisp/net/eww.el | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 38726fd..a9f97bb 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -1140,19 +1140,24 @@ Differences in #targets are ignored."
     (user-error "No bookmarks are defined"))
   (set-buffer (get-buffer-create "*eww bookmarks*"))
   (eww-bookmark-mode)
-  (let ((format "%-40s %s")
-       (inhibit-read-only t)
-       start url)
+  (let ((inhibit-read-only t)
+       (domain-length 0)
+       (title-length 0)
+       start url title format)
     (erase-buffer)
-    (setq header-line-format (concat " " (format format "URL" "Title")))
+    (dolist (bookmark eww-bookmarks)
+      (setq start (point))
+      (setq domain-length (max domain-length (length (plist-get bookmark :url))))
+      (setq title-length (max title-length (length (plist-get bookmark :title)))))
+    (setq format (format "%%-%ds %%-%ds" title-length domain-length)
+         header-line-format
+         (concat " " (format format "Title" "URL")))
     (dolist (bookmark eww-bookmarks)
       (setq start (point))
       (setq url (plist-get bookmark :url))
-      (when (> (length url) 40)
-       (setq url (substring url 0 40)))
-      (insert (format format url
-                     (plist-get bookmark :title))
-             "\n")
+      (setq title (plist-get bookmark :title))
+      (insert (format format title url))
+      (insert "\n")
       (put-text-property start (1+ start) 'eww-bookmark bookmark))
     (goto-char (point-min))))


--
1.8.3.1

Kenjiro





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

* bug#16398: 24.3.50; [PATCH] eww: Tiny fix to display bookmark list.
  2014-01-08  2:19 bug#16398: 24.3.50; [PATCH] eww: Tiny fix to display bookmark list Kenjiro NAKAYAMA
@ 2014-01-08 15:53 ` Ted Zlatanov
  2014-01-18 18:32 ` Lars Ingebrigtsen
  2014-12-07 19:32 ` Lars Magne Ingebrigtsen
  2 siblings, 0 replies; 11+ messages in thread
From: Ted Zlatanov @ 2014-01-08 15:53 UTC (permalink / raw)
  To: Kenjiro NAKAYAMA; +Cc: 16398

On Wed, 08 Jan 2014 11:19:28 +0900 Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com> wrote: 

KN> (I sent this mail before, but since the mail did not receive mailing
KN> list , I resend. Sorry if it is duplicated.)

KN> Altough current eww bookmark list shows "URL" and "Title", it is better
KN> that "Title" is left side and "URL" is right, in my opinion.
KN> And it makes possible to display full URL withought clip.

KN> This is the patch for it. Please review and install it to the official tree if appreciated.

I think this is a bug fix but Lars should say, so I'm not pushing it.

IMO you should consider requesting Emacs committer access, considering
the volume and quality of your contributions.

Ted





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

* bug#16398: 24.3.50; [PATCH] eww: Tiny fix to display bookmark list.
  2014-01-08  2:19 bug#16398: 24.3.50; [PATCH] eww: Tiny fix to display bookmark list Kenjiro NAKAYAMA
  2014-01-08 15:53 ` Ted Zlatanov
@ 2014-01-18 18:32 ` Lars Ingebrigtsen
  2014-01-19  3:07   ` Stefan Monnier
  2014-12-07 19:32 ` Lars Magne Ingebrigtsen
  2 siblings, 1 reply; 11+ messages in thread
From: Lars Ingebrigtsen @ 2014-01-18 18:32 UTC (permalink / raw)
  To: Kenjiro NAKAYAMA; +Cc: 16398

Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com> writes:

> Altough current eww bookmark list shows "URL" and "Title", it is better
> that "Title" is left side and "URL" is right, in my opinion.
> And it makes possible to display full URL withought clip.

If one URL is long, won't this just push the display of all titles off
to the right?

I think titles are as important as the URLs in the display.  

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





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

* bug#16398: 24.3.50; [PATCH] eww: Tiny fix to display bookmark list.
  2014-01-18 18:32 ` Lars Ingebrigtsen
@ 2014-01-19  3:07   ` Stefan Monnier
  2014-01-19  5:55     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2014-01-19  3:07 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 16398, Kenjiro NAKAYAMA

>> Altough current eww bookmark list shows "URL" and "Title", it is better
>> that "Title" is left side and "URL" is right, in my opinion.
>> And it makes possible to display full URL withought clip.
> If one URL is long, won't this just push the display of all titles off
> to the right?
> I think titles are as important as the URLs in the display.  

The way I read the above, you seem to be in violent agreement.
What am I missing?


        Stefan





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

* bug#16398: 24.3.50; [PATCH] eww: Tiny fix to display bookmark list.
  2014-01-19  3:07   ` Stefan Monnier
@ 2014-01-19  5:55     ` Lars Ingebrigtsen
  2014-01-19  6:50       ` Kenjiro NAKAYAMA
  0 siblings, 1 reply; 11+ messages in thread
From: Lars Ingebrigtsen @ 2014-01-19  5:55 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 16398, Kenjiro NAKAYAMA

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>> Altough current eww bookmark list shows "URL" and "Title", it is better
>>> that "Title" is left side and "URL" is right, in my opinion.
>>> And it makes possible to display full URL withought clip.
>> If one URL is long, won't this just push the display of all titles off
>> to the right?
>> I think titles are as important as the URLs in the display.  
>
> The way I read the above, you seem to be in violent agreement.
> What am I missing?

Uhm, yeah.  I misread the patch.  But it doesn't seem to limit
anything.  If there's one title that's longer than 80 characters, normal
users won't see any URLs in the listing.

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





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

* bug#16398: 24.3.50; [PATCH] eww: Tiny fix to display bookmark list.
  2014-01-19  5:55     ` Lars Ingebrigtsen
@ 2014-01-19  6:50       ` Kenjiro NAKAYAMA
  2014-01-19 15:31         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 11+ messages in thread
From: Kenjiro NAKAYAMA @ 2014-01-19  6:50 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 16398, Kenjiro NAKAYAMA

They both don't have big problem.
Left side title cannot be longer than 80 characters,
right side title cannot copy its URL due to the clipping.

But we should be consistent in eww-list-bookmarks and eww-list-histories.
Lars, it depends on your taste. I will follow your judge.

Kenjiro

larsi@gnus.org writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>>>> Altough current eww bookmark list shows "URL" and "Title", it is better
>>>> that "Title" is left side and "URL" is right, in my opinion.
>>>> And it makes possible to display full URL withought clip.
>>> If one URL is long, won't this just push the display of all titles off
>>> to the right?
>>> I think titles are as important as the URLs in the display.  
>>
>> The way I read the above, you seem to be in violent agreement.
>> What am I missing?
>
> Uhm, yeah.  I misread the patch.  But it doesn't seem to limit
> anything.  If there's one title that's longer than 80 characters, normal
> users won't see any URLs in the listing.






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

* bug#16398: 24.3.50; [PATCH] eww: Tiny fix to display bookmark list.
  2014-01-19  6:50       ` Kenjiro NAKAYAMA
@ 2014-01-19 15:31         ` Lars Ingebrigtsen
  2014-01-20 16:09           ` Ted Zlatanov
  0 siblings, 1 reply; 11+ messages in thread
From: Lars Ingebrigtsen @ 2014-01-19 15:31 UTC (permalink / raw)
  To: Kenjiro NAKAYAMA; +Cc: 16398

Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com> writes:

> They both don't have big problem.
> Left side title cannot be longer than 80 characters,
> right side title cannot copy its URL due to the clipping.
>
> But we should be consistent in eww-list-bookmarks and eww-list-histories.

Yeah, we should be consistent, and I think cutting off one or the other
to display both is the way to go.  However, there should be a `w'
command in these buffers that copies the URL on the line to the kill
ring.

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





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

* bug#16398: 24.3.50; [PATCH] eww: Tiny fix to display bookmark list.
  2014-01-19 15:31         ` Lars Ingebrigtsen
@ 2014-01-20 16:09           ` Ted Zlatanov
  2014-01-20 20:24             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 11+ messages in thread
From: Ted Zlatanov @ 2014-01-20 16:09 UTC (permalink / raw)
  To: 16398

On Sun, 19 Jan 2014 07:31:08 -0800 Lars Ingebrigtsen <larsi@gnus.org> wrote: 

LI> Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com> writes:
>> They both don't have big problem.
>> Left side title cannot be longer than 80 characters,
>> right side title cannot copy its URL due to the clipping.
>> 
>> But we should be consistent in eww-list-bookmarks and eww-list-histories.

LI> Yeah, we should be consistent, and I think cutting off one or the other
LI> to display both is the way to go.  However, there should be a `w'
LI> command in these buffers that copies the URL on the line to the kill
LI> ring.

Could it use tabulated formatting, like `M-x list-packages'?

Ted






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

* bug#16398: 24.3.50; [PATCH] eww: Tiny fix to display bookmark list.
  2014-01-20 16:09           ` Ted Zlatanov
@ 2014-01-20 20:24             ` Lars Ingebrigtsen
  2014-02-10  2:04               ` Ted Zlatanov
  0 siblings, 1 reply; 11+ messages in thread
From: Lars Ingebrigtsen @ 2014-01-20 20:24 UTC (permalink / raw)
  To: 16398

Ted Zlatanov <tzz@lifelogs.com> writes:

By the way, you have a

Reply-to: bug-gnu-emacs@gnu.org

in your email here...

> Could it use tabulated formatting, like `M-x list-packages'?

Yeah, that would be nice.  Then we'd get sorting and stuff "for free".

But URLs (or titles) should still be displayed shortened.  >"?

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





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

* bug#16398: 24.3.50; [PATCH] eww: Tiny fix to display bookmark list.
  2014-01-20 20:24             ` Lars Ingebrigtsen
@ 2014-02-10  2:04               ` Ted Zlatanov
  0 siblings, 0 replies; 11+ messages in thread
From: Ted Zlatanov @ 2014-02-10  2:04 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 16398

On Mon, 20 Jan 2014 12:24:16 -0800 Lars Ingebrigtsen <larsi@gnus.org> wrote: 

LI> Ted Zlatanov <tzz@lifelogs.com> writes:
LI> By the way, you have a

LI> Reply-to: bug-gnu-emacs@gnu.org

LI> in your email here...

Yeah, I forgot to `r'eply and did `f'up instead :)

The weird Reply-to header is probably caused by:

Mail-Copies-To: never
Gmane-Reply-To-List: yes

>> Could it use tabulated formatting, like `M-x list-packages'?

LI> Yeah, that would be nice.  Then we'd get sorting and stuff "for free".

LI> But URLs (or titles) should still be displayed shortened.  >"?

According to the `tabulated-list-format' docstring you can specify a
width for all the columns except the last one.  I checked and it seems
to be enforced via `truncate-string-to-width'.

Ted





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

* bug#16398: 24.3.50; [PATCH] eww: Tiny fix to display bookmark list.
  2014-01-08  2:19 bug#16398: 24.3.50; [PATCH] eww: Tiny fix to display bookmark list Kenjiro NAKAYAMA
  2014-01-08 15:53 ` Ted Zlatanov
  2014-01-18 18:32 ` Lars Ingebrigtsen
@ 2014-12-07 19:32 ` Lars Magne Ingebrigtsen
  2 siblings, 0 replies; 11+ messages in thread
From: Lars Magne Ingebrigtsen @ 2014-12-07 19:32 UTC (permalink / raw)
  To: Kenjiro NAKAYAMA; +Cc: 16398

Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com> writes:

> Altough current eww bookmark list shows "URL" and "Title", it is better
> that "Title" is left side and "URL" is right, in my opinion.
> And it makes possible to display full URL withought clip.
>
> This is the patch for it. Please review and install it to the official tree if appreciated.

I did an alternate version of this that limits the title length instead.

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





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

end of thread, other threads:[~2014-12-07 19:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-08  2:19 bug#16398: 24.3.50; [PATCH] eww: Tiny fix to display bookmark list Kenjiro NAKAYAMA
2014-01-08 15:53 ` Ted Zlatanov
2014-01-18 18:32 ` Lars Ingebrigtsen
2014-01-19  3:07   ` Stefan Monnier
2014-01-19  5:55     ` Lars Ingebrigtsen
2014-01-19  6:50       ` Kenjiro NAKAYAMA
2014-01-19 15:31         ` Lars Ingebrigtsen
2014-01-20 16:09           ` Ted Zlatanov
2014-01-20 20:24             ` Lars Ingebrigtsen
2014-02-10  2:04               ` Ted Zlatanov
2014-12-07 19:32 ` Lars Magne Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).