Fill titles
So they don't run on too long off the screen.
This commit is contained in:
parent
a382f10aac
commit
93461d87cd
1 changed files with 22 additions and 17 deletions
39
avandu.el
39
avandu.el
|
@ -272,28 +272,33 @@ with `auth-source-search' and then by asking the user."
|
||||||
(defun avandu--insert-article-title (id link title)
|
(defun avandu--insert-article-title (id link title)
|
||||||
"Insert a button with the label TITLE and store ID and LINK in
|
"Insert a button with the label TITLE and store ID and LINK in
|
||||||
the article-id and link properties, respectively."
|
the article-id and link properties, respectively."
|
||||||
(insert-button
|
(let ((pos (point)))
|
||||||
(avandu--oneline title)
|
(insert-button
|
||||||
'face 'avandu-overview-unread-article
|
(avandu--oneline title)
|
||||||
'article-id id
|
'face 'avandu-overview-unread-article
|
||||||
'link link
|
'article-id id
|
||||||
'keymap avandu-article-button-map
|
'link link
|
||||||
'action #'(lambda (button)
|
'keymap avandu-article-button-map
|
||||||
(message "%s" (button-get button 'link))))
|
'action #'(lambda (button)
|
||||||
(insert-char ?\n 1))
|
(message "%s" (button-get button 'link))))
|
||||||
|
(fill-region pos (point))
|
||||||
|
(insert-char ?\n 1)))
|
||||||
|
|
||||||
(defun avandu--insert-feed-title (id title)
|
(defun avandu--insert-feed-title (id title)
|
||||||
"Insert a button with the label TITLE and store ID in the
|
"Insert a button with the label TITLE and store ID in the
|
||||||
feed-id property."
|
feed-id property."
|
||||||
(unless (eq (point) (point-min)) (insert-char ?\n 1))
|
(unless (eq (point) (point-min)) (insert-char ?\n 1))
|
||||||
(insert-button
|
|
||||||
(avandu--oneline title)
|
(let ((pos (point)))
|
||||||
'face 'avandu-overview-feed
|
(insert-button
|
||||||
'feed-id id
|
(avandu--oneline title)
|
||||||
'keymap avandu-feed-button-map
|
'face 'avandu-overview-feed
|
||||||
'action #'(lambda (button)
|
'feed-id id
|
||||||
(message "%s" (button-label button))))
|
'keymap avandu-feed-button-map
|
||||||
(insert-char ?\n 2))
|
'action #'(lambda (button)
|
||||||
|
(message "%s" (button-label button))))
|
||||||
|
(fill-region pos (point))
|
||||||
|
(insert-char ?\n 2)))
|
||||||
|
|
||||||
(defun avandu--oneline (text)
|
(defun avandu--oneline (text)
|
||||||
"Make a single line out of and clean up TEXT."
|
"Make a single line out of and clean up TEXT."
|
||||||
|
|
Loading…
Reference in a new issue