aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2012-08-07 10:57:23 +0200
committerGravatar Tom Willemsen2012-08-07 10:57:23 +0200
commit93461d87cd66df2a4b31f0ae12593235e8867adb (patch)
treec50e8eae2528b1d8e8de34a7d4fb3aafba0fde6a
parenta382f10aac954e3921a4689b492c815a827838a1 (diff)
downloadavandu-93461d87cd66df2a4b31f0ae12593235e8867adb.tar.gz
avandu-93461d87cd66df2a4b31f0ae12593235e8867adb.zip
Fill titles
So they don't run on too long off the screen.
-rw-r--r--avandu.el39
1 files changed, 22 insertions, 17 deletions
diff --git a/avandu.el b/avandu.el
index 3edd1c8..5c952c8 100644
--- a/avandu.el
+++ b/avandu.el
@@ -272,28 +272,33 @@ with `auth-source-search' and then by asking the user."
(defun avandu--insert-article-title (id link title)
"Insert a button with the label TITLE and store ID and LINK in
the article-id and link properties, respectively."
- (insert-button
- (avandu--oneline title)
- 'face 'avandu-overview-unread-article
- 'article-id id
- 'link link
- 'keymap avandu-article-button-map
- 'action #'(lambda (button)
- (message "%s" (button-get button 'link))))
- (insert-char ?\n 1))
+ (let ((pos (point)))
+ (insert-button
+ (avandu--oneline title)
+ 'face 'avandu-overview-unread-article
+ 'article-id id
+ 'link link
+ 'keymap avandu-article-button-map
+ 'action #'(lambda (button)
+ (message "%s" (button-get button 'link))))
+ (fill-region pos (point))
+ (insert-char ?\n 1)))
(defun avandu--insert-feed-title (id title)
"Insert a button with the label TITLE and store ID in the
feed-id property."
(unless (eq (point) (point-min)) (insert-char ?\n 1))
- (insert-button
- (avandu--oneline title)
- 'face 'avandu-overview-feed
- 'feed-id id
- 'keymap avandu-feed-button-map
- 'action #'(lambda (button)
- (message "%s" (button-label button))))
- (insert-char ?\n 2))
+
+ (let ((pos (point)))
+ (insert-button
+ (avandu--oneline title)
+ 'face 'avandu-overview-feed
+ 'feed-id id
+ 'keymap avandu-feed-button-map
+ 'action #'(lambda (button)
+ (message "%s" (button-label button))))
+ (fill-region pos (point))
+ (insert-char ?\n 2)))
(defun avandu--oneline (text)
"Make a single line out of and clean up TEXT."