diff options
| author | Lars Magne Ingebrigtsen | 2013-06-26 18:59:21 +0200 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2013-06-26 18:59:21 +0200 |
| commit | a285ce999ffde46c4a5c53a38229c81f516af4f7 (patch) | |
| tree | c8bee62017fc096fc6cab874de1941474c4a3738 | |
| parent | 2b4f050643e66bbbe681a7e7e82dbdc5bf80fc7e (diff) | |
| download | emacs-a285ce999ffde46c4a5c53a38229c81f516af4f7.tar.gz emacs-a285ce999ffde46c4a5c53a38229c81f516af4f7.zip | |
(eww-add-bookmark): Remove newlines from the title.
| -rw-r--r-- | lisp/ChangeLog | 1 | ||||
| -rw-r--r-- | lisp/net/eww.el | 10 |
2 files changed, 7 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ea99e5c126a..24cc16ee0e7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | (eww-mode-map): Add a menu bar. | 5 | (eww-mode-map): Add a menu bar. |
| 6 | (eww-add-bookmark): New command. | 6 | (eww-add-bookmark): New command. |
| 7 | (eww-bookmark-mode): New mode and commands. | 7 | (eww-bookmark-mode): New mode and commands. |
| 8 | (eww-add-bookmark): Remove newlines from the title. | ||
| 8 | 9 | ||
| 9 | 2013-06-26 Glenn Morris <rgm@gnu.org> | 10 | 2013-06-26 Glenn Morris <rgm@gnu.org> |
| 10 | 11 | ||
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." | |||
| 950 | (when (equal eww-current-url | 950 | (when (equal eww-current-url |
| 951 | (plist-get bookmark :url)) | 951 | (plist-get bookmark :url)) |
| 952 | (error "Already bookmarked"))) | 952 | (error "Already bookmarked"))) |
| 953 | (push (list :url eww-current-url | 953 | (let ((title (replace-regexp-in-string "[\n\t\r]" " " eww-current-title))) |
| 954 | :title eww-current-title | 954 | (setq title (replace-regexp-in-string "\\` +\\| +\\'" "" title)) |
| 955 | :time (current-time-string)) | 955 | (push (list :url eww-current-url |
| 956 | eww-bookmarks) | 956 | :title title |
| 957 | :time (current-time-string)) | ||
| 958 | eww-bookmarks)) | ||
| 957 | (eww-write-bookmarks) | 959 | (eww-write-bookmarks) |
| 958 | (message "Bookmarked %s (%s)" eww-current-url eww-current-title)) | 960 | (message "Bookmarked %s (%s)" eww-current-url eww-current-title)) |
| 959 | 961 | ||