From: Lars Magne Ingebrigtsen Date: Wed, 26 Jun 2013 16:59:21 +0000 (+0200) Subject: (eww-add-bookmark): Remove newlines from the title. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1992^2~24 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a285ce999ffde46c4a5c53a38229c81f516af4f7;p=emacs.git (eww-add-bookmark): Remove newlines from the title. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ea99e5c126a..24cc16ee0e7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -5,6 +5,7 @@ (eww-mode-map): Add a menu bar. (eww-add-bookmark): New command. (eww-bookmark-mode): New mode and commands. + (eww-add-bookmark): Remove newlines from the title. 2013-06-26 Glenn Morris diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 0fd6591e053..cee2146296d 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -950,10 +950,12 @@ The browser to used is specified by the `shr-external-browser' variable." (when (equal eww-current-url (plist-get bookmark :url)) (error "Already bookmarked"))) - (push (list :url eww-current-url - :title eww-current-title - :time (current-time-string)) - eww-bookmarks) + (let ((title (replace-regexp-in-string "[\n\t\r]" " " eww-current-title))) + (setq title (replace-regexp-in-string "\\` +\\| +\\'" "" title)) + (push (list :url eww-current-url + :title title + :time (current-time-string)) + eww-bookmarks)) (eww-write-bookmarks) (message "Bookmarked %s (%s)" eww-current-url eww-current-title))