all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#37122: [PATCH] Remove support for upgrading from old bookmark file format
@ 2019-08-20 19:20 Stefan Kangas
  2019-08-23  3:47 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Kangas @ 2019-08-20 19:20 UTC (permalink / raw)
  To: 37122

[-- Attachment #1: Type: text/plain, Size: 375 bytes --]

The old bookmark file format has not been used in Emacs since at least
version 19.34, released in 1996.  And that's a conservative estimate
-- it's probably even older.  I suggest that we remove the support for
converting it to the new bookmark file format completely in order to
not have to maintain this ancient code.

Please see the attached patch.

Thanks,
Stefan Kangas

[-- Attachment #2: 0001-Remove-support-for-upgrading-from-old-bookmark-file-.patch --]
[-- Type: text/x-patch, Size: 6118 bytes --]

From e3570617e9ab4da50be854563e63d89dcdd2866f Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Mon, 1 Jul 2019 16:16:06 +0200
Subject: [PATCH] Remove support for upgrading from old bookmark file format

* lisp/bookmark.el (bookmark-alist-from-buffer): Remove support for
old bookmark file format.
(bookmark-upgrade-version-0-alist)
(bookmark-upgrade-file-format-from-0)
(bookmark-grok-file-format-version)
(bookmark-maybe-upgrade-file-format): Declare obsolete.
(bookmark-load): Don't call 'bookmark-maybe-upgrade-file-format'.
* etc/NEWS: Announce it.
---
 etc/NEWS         | 10 ++++++++++
 lisp/bookmark.el | 39 +++++++++++++++++++++------------------
 2 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 56e5fd2f83..e2ba7ee33a 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1792,6 +1792,16 @@ aliases of 'bookmark-default-file'.
 *** New user option 'bookmark-watch-bookmark-file'.
 When non-nil, watch whether the bookmark file has changed on disk.
 
+---
+*** The old bookmark file format is no longer supported.
+This bookmark file format has not been used in Emacs since at least
+version 19.34, released in 1996, and will no longer be automatically
+converted to the new bookmark file format.
+
+The following functions are now declared obsolete:
+bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format,
+bookmark-upgrade-file-format-from-0, bookmark-upgrade-version-0-alist
+
 ---
 ** The mantemp.el library is now marked obsolete.
 This library generates manual C++ template instantiations.  It should
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index f564cd6b43..e58e051a39 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -619,8 +619,8 @@ bookmark-make-record-default
 ;; was incorrect in Emacs 22 and Emacs 23.1.)
 ;;
 ;; To deal with the change from FIRST format to SECOND, conversion
-;; code was added, and it is still in use.  See
-;; `bookmark-maybe-upgrade-file-format'.
+;; code was added, which is no longer used and has been declared
+;; obsolete.  See `bookmark-maybe-upgrade-file-format'.
 ;;
 ;; No conversion from SECOND to CURRENT is done.  Instead, the code
 ;; handles both formats OK.  It must continue to do so.
@@ -640,7 +640,7 @@ bookmark-end-of-version-stamp-marker
 
 
 (defun bookmark-alist-from-buffer ()
-  "Return a `bookmark-alist' (in any format) from the current buffer.
+  "Return a `bookmark-alist' from the current buffer.
 The buffer must of course contain bookmark format information.
 Does not care from where in the buffer it is called, and does not
 affect point."
@@ -648,19 +648,13 @@ bookmark-alist-from-buffer
     (goto-char (point-min))
     (if (search-forward bookmark-end-of-version-stamp-marker nil t)
         (read (current-buffer))
-      ;; Else we're dealing with format version 0
-      (if (search-forward "(" nil t)
-          (progn
-            (forward-char -1)
-            (read (current-buffer)))
-        ;; Else no hope of getting information here.
-        (if buffer-file-name
-            (error "File not in bookmark format: %s" buffer-file-name)
-          (error "Buffer not in bookmark format: %s" (buffer-name)))))))
-
+      (if buffer-file-name
+          (error "File not in bookmark format: %s" buffer-file-name)
+        (error "Buffer not in bookmark format: %s" (buffer-name))))))
 
 (defun bookmark-upgrade-version-0-alist (old-list)
   "Upgrade a version 0 alist OLD-LIST to the current version."
+  (declare (obsolete nil "27.1"))
   (mapcar
    (lambda (bookmark)
      (let* ((name      (car bookmark))
@@ -683,11 +677,14 @@ bookmark-upgrade-version-0-alist
 (defun bookmark-upgrade-file-format-from-0 ()
   "Upgrade a bookmark file of format 0 (the original format) to format 1.
 This expects to be called from `point-min' in a bookmark file."
+  (declare (obsolete nil "27.1"))
   (let* ((reporter (make-progress-reporter
                     (format "Upgrading bookmark format from 0 to %d..."
-                     bookmark-file-format-version)))
+                            bookmark-file-format-version)))
          (old-list (bookmark-alist-from-buffer))
-         (new-list (bookmark-upgrade-version-0-alist old-list)))
+         (new-list (with-suppressed-warnings
+                       ((obsolete bookmark-upgrade-version-0-alist))
+                     (bookmark-upgrade-version-0-alist old-list))))
     (delete-region (point-min) (point-max))
     (bookmark-insert-file-format-version-stamp buffer-file-coding-system)
     (pp new-list (current-buffer))
@@ -699,6 +696,7 @@ bookmark-upgrade-file-format-from-0
 (defun bookmark-grok-file-format-version ()
   "Return an integer which is the file-format version of this bookmark file.
 This expects to be called from `point-min' in a bookmark file."
+  (declare (obsolete nil "27.1"))
   (if (looking-at "^;;;;")
       (save-excursion
         (save-match-data
@@ -714,12 +712,18 @@ bookmark-maybe-upgrade-file-format
   "Check the file-format version of this bookmark file.
 If the version is not up-to-date, upgrade it automatically.
 This expects to be called from `point-min' in a bookmark file."
-  (let ((version (bookmark-grok-file-format-version)))
+  (declare (obsolete nil "27.1"))
+  (let ((version
+         (with-suppressed-warnings
+             ((obsolete bookmark-grok-file-format-version))
+           (bookmark-grok-file-format-version))))
     (cond
      ((= version bookmark-file-format-version)
       ) ; home free -- version is current
      ((= version 0)
-      (bookmark-upgrade-file-format-from-0))
+      (with-suppressed-warnings
+          ((obsolete bookmark-upgrade-file-format-from-0))
+        (bookmark-upgrade-file-format-from-0)))
      (t
       (error "Bookmark file format version strangeness")))))
 
@@ -1541,7 +1545,6 @@ bookmark-load
       (with-current-buffer (let (enable-local-variables)
 			     (find-file-noselect file))
 	(goto-char (point-min))
-	(bookmark-maybe-upgrade-file-format)
 	(let ((blist (bookmark-alist-from-buffer)))
 	  (unless (listp blist)
 	    (error "Invalid bookmark list in %s" file))
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#37122: [PATCH] Remove support for upgrading from old bookmark file format
  2019-08-20 19:20 bug#37122: [PATCH] Remove support for upgrading from old bookmark file format Stefan Kangas
@ 2019-08-23  3:47 ` Lars Ingebrigtsen
  2019-09-08 20:51   ` Stefan Kangas
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2019-08-23  3:47 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 37122

Stefan Kangas <stefan@marxist.se> writes:

> The old bookmark file format has not been used in Emacs since at least
> version 19.34, released in 1996.  And that's a conservative estimate
> -- it's probably even older.  I suggest that we remove the support for
> converting it to the new bookmark file format completely in order to
> not have to maintain this ancient code.

I think that makes sense -- surely there can't be many people making the
jump from 19.34 to Emacs 27 these days.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#37122: [PATCH] Remove support for upgrading from old bookmark file format
  2019-08-23  3:47 ` Lars Ingebrigtsen
@ 2019-09-08 20:51   ` Stefan Kangas
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Kangas @ 2019-09-08 20:51 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 37122

close 37122 27.1
quit

Lars Ingebrigtsen <larsi@mouse.gnus.org> writes:

> > The old bookmark file format has not been used in Emacs since at least
> > version 19.34, released in 1996.  And that's a conservative estimate
> > -- it's probably even older.  I suggest that we remove the support for
> > converting it to the new bookmark file format completely in order to
> > not have to maintain this ancient code.
>
> I think that makes sense -- surely there can't be many people making the
> jump from 19.34 to Emacs 27 these days.

Thanks.  Since there has been no other comments nor objections in the
last two weeks, I've now installed this as commit e94d01f1ac.

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-08 20:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-20 19:20 bug#37122: [PATCH] Remove support for upgrading from old bookmark file format Stefan Kangas
2019-08-23  3:47 ` Lars Ingebrigtsen
2019-09-08 20:51   ` Stefan Kangas

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.