unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#35940: [PATCH] bookmark.el: Remove support for renaming ancient "~/.emacs-bkmrks" file
@ 2019-05-28  1:23 Stefan Kangas
  2019-05-30 12:08 ` Basil L. Contovounesios
  2019-06-09 23:49 ` bug#35940: " Paul Eggert
  0 siblings, 2 replies; 6+ messages in thread
From: Stefan Kangas @ 2019-05-28  1:23 UTC (permalink / raw)
  To: 35940

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

Since at least 1995, there has been a variable `bookmark-old-default-file'
referring to an old default file name "~/.emacs-bkmrks", and some
accompanying code to rename from the old file name to the new one.

Since it's extremely unlikely that someone has a need to recover this kind
of file from before 1995 and use it in a modern Emacs, I think it's about
time to retire this code.  Please see the attached patch for a suggestion.

Thanks,
Stefan Kangas

[-- Attachment #2: 0001-Make-bookmark-old-default-file-variable-obsolete.patch --]
[-- Type: application/octet-stream, Size: 2276 bytes --]

From dceeabd76a21483300eafa15ac74681fb766af87 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Tue, 28 May 2019 02:58:54 +0200
Subject: [PATCH] Make bookmark-old-default-file variable obsolete

* bookmark.el (bookmark-old-default-file): Redefine as obsolete
variable alias for `bookmark-default-file'.
(bookmark-maybe-load-default-file): Don't try to rename file
`bookmark-old-default-file' (~/.emacs-bkmrks) to new name.
---
 etc/NEWS         |  6 ++++++
 lisp/bookmark.el | 14 +-------------
 2 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 222b86ee2b..964ddd4893 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1478,6 +1478,12 @@ the new variable 'buffer-auto-revert-by-notification' to a non-nil
 value.  Auto Revert mode can use this information to avoid polling the
 buffer periodically when 'auto-revert-avoid-polling' is non-nil.
 
+** Bookmarks
+
+---
+*** 'bookmark-old-default-file' is now an obsolete alias of
+'bookmark-default-file'.
+
 \f
 * New Modes and Packages in Emacs 27.1
 
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index b1fe690dac..cfcfd0e6e8 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -78,8 +78,7 @@ bookmark-save-flag
   :group 'bookmark)
 
 
-(defconst bookmark-old-default-file "~/.emacs-bkmrks"
-  "The `.emacs.bmk' file used to be called this name.")
+(define-obsolete-variable-alias 'bookmark-old-default-file 'bookmark-default-file "27.1")
 
 
 ;; defvared to avoid a compilation warning:
@@ -1034,17 +1033,6 @@ bookmark-maybe-load-default-file
   "If bookmarks have not been loaded from the default place, load them."
   (and (not bookmarks-already-loaded)
        (null bookmark-alist)
-       (prog2
-           (and
-            ;; Possibly the old bookmark file, "~/.emacs-bkmrks", needs
-            ;; to be renamed.
-            (file-exists-p bookmark-old-default-file)
-            (not (file-exists-p bookmark-default-file))
-            (rename-file bookmark-old-default-file
-                         bookmark-default-file))
-           ;; return t so the `and' will continue...
-           t)
-
        (file-readable-p bookmark-default-file)
        (bookmark-load bookmark-default-file t t)
        (setq bookmarks-already-loaded t)))
-- 
2.21.0


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

* bug#35940: [PATCH] bookmark.el: Remove support for renaming ancient "~/.emacs-bkmrks" file
  2019-05-28  1:23 bug#35940: [PATCH] bookmark.el: Remove support for renaming ancient "~/.emacs-bkmrks" file Stefan Kangas
@ 2019-05-30 12:08 ` Basil L. Contovounesios
  2019-05-30 12:23   ` Stefan Kangas
  2019-06-09 23:49 ` bug#35940: " Paul Eggert
  1 sibling, 1 reply; 6+ messages in thread
From: Basil L. Contovounesios @ 2019-05-30 12:08 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 35940

Stefan Kangas <stefan@marxist.se> writes:

> Since at least 1995, there has been a variable `bookmark-old-default-file'
> referring to an old default file name "~/.emacs-bkmrks", and some
> accompanying code to rename from the old file name to the new one.
>
> Since it's extremely unlikely that someone has a need to recover this kind
> of file from before 1995 and use it in a modern Emacs, I think it's about
> time to retire this code.  Please see the attached patch for a suggestion.

Looks fine to me, but I suggest simultaneously making bookmark-file
(the old name of bookmark-default-file[1]) an obsolete varalias of
bookmark-default-file.

[1: e343798900]: Insure that all entry points call [...]
  1995-03-11 02:05:20 +0000
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=e34379890042bdb66263d962e845328ac0b63f67

Thanks,

-- 
Basil





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

* bug#35940: [PATCH] bookmark.el: Remove support for renaming ancient "~/.emacs-bkmrks" file
  2019-05-30 12:08 ` Basil L. Contovounesios
@ 2019-05-30 12:23   ` Stefan Kangas
  2019-05-30 12:50     ` Basil L. Contovounesios
  2019-06-05 11:02     ` Stefan Kangas
  0 siblings, 2 replies; 6+ messages in thread
From: Stefan Kangas @ 2019-05-30 12:23 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: 35940

Thank you for having a look.

Basil L. Contovounesios <contovob@tcd.ie> writes:
> Looks fine to me, but I suggest simultaneously making bookmark-file
> (the old name of bookmark-default-file[1]) an obsolete varalias of
> bookmark-default-file.

Agreed, I've actually already submitted a separate patch for that:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=35917

Thanks,
Stefan Kangas





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

* bug#35940: [PATCH] bookmark.el: Remove support for renaming ancient "~/.emacs-bkmrks" file
  2019-05-30 12:23   ` Stefan Kangas
@ 2019-05-30 12:50     ` Basil L. Contovounesios
  2019-06-05 11:02     ` Stefan Kangas
  1 sibling, 0 replies; 6+ messages in thread
From: Basil L. Contovounesios @ 2019-05-30 12:50 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 35940

Stefan Kangas <stefan@marxist.se> writes:

> Thank you for having a look.

Thank you for working on this.

> Basil L. Contovounesios <contovob@tcd.ie> writes:
>> Looks fine to me, but I suggest simultaneously making bookmark-file
>> (the old name of bookmark-default-file[1]) an obsolete varalias of
>> bookmark-default-file.
>
> Agreed, I've actually already submitted a separate patch for that:
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=35917

Right, I saw that just after I sent my previous message.

Both changes LGTM, so I'll push them in the coming week if there are no
other comments before then and no-one beats me to it.

But could you please first amend the commit messages to mention their
bug#numbers and list file names relative to the project root,
i.e. lisp/bookmark.el instead of bookmark.el?

Thanks,

-- 
Basil





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

* bug#35940: [PATCH] bookmark.el: Remove support for renaming ancient "~/.emacs-bkmrks" file
  2019-05-30 12:23   ` Stefan Kangas
  2019-05-30 12:50     ` Basil L. Contovounesios
@ 2019-06-05 11:02     ` Stefan Kangas
  1 sibling, 0 replies; 6+ messages in thread
From: Stefan Kangas @ 2019-06-05 11:02 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: 35940


[-- Attachment #1.1: Type: text/plain, Size: 565 bytes --]

[Accidentally sent this only to Basil - sorry about that. Resending.]

Basil L. Contovounesios <contovob@tcd.ie> writes:
> Both changes LGTM, so I'll push them in the coming week if there are no
> other comments before then and no-one beats me to it.

Very good, thanks.

> But could you please first amend the commit messages to mention their
> bug#numbers and list file names relative to the project root,
> i.e. lisp/bookmark.el instead of bookmark.el?

Sure, I've attached a fixed patch here and I'll send new versions of
the others too.

Thanks,
Stefan Kangas

[-- Attachment #1.2: Type: text/html, Size: 1025 bytes --]

[-- Attachment #2: 0001-Make-bookmark-old-default-file-variable-obsolete-2.patch --]
[-- Type: application/octet-stream, Size: 2294 bytes --]

From f4c4740c0a8ab5c4e79dcec81030f497842b1c9a Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Tue, 28 May 2019 02:58:54 +0200
Subject: [PATCH] Make bookmark-old-default-file variable obsolete

* lisp/bookmark.el (bookmark-old-default-file): Redefine as obsolete
variable alias for `bookmark-default-file'.
(bookmark-maybe-load-default-file): Don't try to rename file
`bookmark-old-default-file' (~/.emacs-bkmrks) to new
name.  (Bug#35940)
---
 etc/NEWS         |  6 ++++++
 lisp/bookmark.el | 14 +-------------
 2 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 8100427403..24cc8ce1fb 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1480,6 +1480,12 @@ the new variable 'buffer-auto-revert-by-notification' to a non-nil
 value.  Auto Revert mode can use this information to avoid polling the
 buffer periodically when 'auto-revert-avoid-polling' is non-nil.
 
+** Bookmarks
+
+---
+*** 'bookmark-old-default-file' is now an obsolete alias of
+'bookmark-default-file'.
+
 \f
 * New Modes and Packages in Emacs 27.1
 
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index b1fe690dac..cfcfd0e6e8 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -78,8 +78,7 @@ bookmark-save-flag
   :group 'bookmark)
 
 
-(defconst bookmark-old-default-file "~/.emacs-bkmrks"
-  "The `.emacs.bmk' file used to be called this name.")
+(define-obsolete-variable-alias 'bookmark-old-default-file 'bookmark-default-file "27.1")
 
 
 ;; defvared to avoid a compilation warning:
@@ -1034,17 +1033,6 @@ bookmark-maybe-load-default-file
   "If bookmarks have not been loaded from the default place, load them."
   (and (not bookmarks-already-loaded)
        (null bookmark-alist)
-       (prog2
-           (and
-            ;; Possibly the old bookmark file, "~/.emacs-bkmrks", needs
-            ;; to be renamed.
-            (file-exists-p bookmark-old-default-file)
-            (not (file-exists-p bookmark-default-file))
-            (rename-file bookmark-old-default-file
-                         bookmark-default-file))
-           ;; return t so the `and' will continue...
-           t)
-
        (file-readable-p bookmark-default-file)
        (bookmark-load bookmark-default-file t t)
        (setq bookmarks-already-loaded t)))
-- 
2.11.0


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

* bug#35940: bookmark.el: Remove support for renaming ancient "~/.emacs-bkmrks" file
  2019-05-28  1:23 bug#35940: [PATCH] bookmark.el: Remove support for renaming ancient "~/.emacs-bkmrks" file Stefan Kangas
  2019-05-30 12:08 ` Basil L. Contovounesios
@ 2019-06-09 23:49 ` Paul Eggert
  1 sibling, 0 replies; 6+ messages in thread
From: Paul Eggert @ 2019-06-09 23:49 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 35940-done

Thanks, I installed that.






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

end of thread, other threads:[~2019-06-09 23:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-28  1:23 bug#35940: [PATCH] bookmark.el: Remove support for renaming ancient "~/.emacs-bkmrks" file Stefan Kangas
2019-05-30 12:08 ` Basil L. Contovounesios
2019-05-30 12:23   ` Stefan Kangas
2019-05-30 12:50     ` Basil L. Contovounesios
2019-06-05 11:02     ` Stefan Kangas
2019-06-09 23:49 ` bug#35940: " Paul Eggert

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).