GNU bug report logs - #25365
25.1; Coding system for bookmarks and desktop

Previous Next

Package: emacs;

Reported by: Dmitri Paduchikh <dpaduchikh <at> gmail.com>

Date: Thu, 5 Jan 2017 12:38:02 UTC

Severity: minor

Found in version 25.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dmitri Paduchikh <dpaduchikh <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1; Coding system for bookmarks and desktop
Date: Thu, 05 Jan 2017 17:37:30 +0500
Hello,

It appears that all Cyrillic text in my bookmarks file has been
corrupted. I wasn't able to reproduce such a corruption using emacsĀ -Q,
so probably this is due to interference with my settings which I will
have to investigate. But in my opinion there is a problem with
bookmark.el as well since it ignores completely coding system when
saving bookmarks. Thus I have written the following two advices to fix
its behavior. It seems that they work as needed.

(advice-add 'bookmark-write-file :around
            #'(lambda (f &rest args)
                (let ((coding-system-for-write (or coding-system-for-write 'utf-8-emacs)))
                  (apply f args)))
            '((name . "coding")))

(advice-add 'bookmark-insert-file-format-version-stamp :before
            #'(lambda (&rest args)
                (when coding-system-for-write
                  (insert (format "\
;;;; Emacs Bookmark Format Version %d ;;;;
;;; -*- coding: %S -*-\n"
                                  bookmark-file-format-version
                                  coding-system-for-write))))
            '((name . "coding")))

Besides, although desktop.el specifies coding system in its file, it is
old one - emacs-mule. Shouldn't this be utf-8-emacs these days instead?

With best regards
Dmitri Paduchikh

In GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.5)
 of 2016-12-23 built on juergen




This bug report was last modified 8 years and 186 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.