emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r113190: (eww-add-bookmark): Remove newlines from th


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] trunk r113190: (eww-add-bookmark): Remove newlines from the title.
Date: Wed, 26 Jun 2013 16:59:25 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113190
revision-id: address@hidden
parent: address@hidden
committer: Lars Magne Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Wed 2013-06-26 18:59:21 +0200
message:
  (eww-add-bookmark): Remove newlines from the title.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/net/eww.el                eww.el-20130610114603-80ap3gwnw4x4m5ix-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-06-26 16:54:48 +0000
+++ b/lisp/ChangeLog    2013-06-26 16:59:21 +0000
@@ -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  <address@hidden>
 

=== modified file 'lisp/net/eww.el'
--- a/lisp/net/eww.el   2013-06-26 16:54:48 +0000
+++ b/lisp/net/eww.el   2013-06-26 16:59:21 +0000
@@ -950,10 +950,12 @@
     (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))
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]