emacs-devel
[Top][All Lists]
Advanced

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

saveplace: don't ask for coding system


From: David Reitter
Subject: saveplace: don't ask for coding system
Date: Wed, 28 Nov 2007 14:46:08 +0000

Can I suggest the following two changes to saveplace.el?

- set the coding system so that the user isn't asked about a coding system for the places file every time they quit Emacs (when file names contain non-standard characters).

- do not show a message about saving - it's not useful information for most users and contributes to information overload!
  (if the function was interactive, this would be a different story.)


I have no write access to CVS, so if people like such changes, somebody will have to commit them.



*** lisp/saveplace.el   25 Jul 2007 05:47:04 +0100      1.37.2.1
--- lisp/saveplace.el   28 Nov 2007 14:40:39 +0000      
***************
*** 207,213 ****
  (defun save-place-alist-to-file ()
    (let ((file (expand-file-name save-place-file)))
      (save-excursion
!       (message "Saving places to %s..." file)
        (set-buffer (get-buffer-create " *Saved Places*"))
        (delete-region (point-min) (point-max))
        (when save-place-forget-unreadable-files
--- 207,213 ----
  (defun save-place-alist-to-file ()
    (let ((file (expand-file-name save-place-file)))
      (save-excursion
!       ;; (message "Saving places to %s..." file)
        (set-buffer (get-buffer-create " *Saved Places*"))
        (delete-region (point-min) (point-max))
        (when save-place-forget-unreadable-files
***************
*** 224,233 ****
                 t))))
        (condition-case nil
            ;; Don't use write-file; we don't want this buffer to visit it.
!           (write-region (point-min) (point-max) file)
!         (file-error (message "Can't write %s" file)))
          (kill-buffer (current-buffer))
!         (message "Saving places to %s...done" file)))))

  (defun load-save-place-alist-from-file ()
    (if (not save-place-loaded)
--- 224,235 ----
                 t))))
        (condition-case nil
            ;; Don't use write-file; we don't want this buffer to visit it.
!           (let ((coding-system-for-write 'utf-8))
!             (write-region (point-min) (point-max) file))
!         (file-error (message "Saving places: Can't write %s" file)))
          (kill-buffer (current-buffer))
!         ;;(message "Saving places to %s...done" file)
!       ))))

  (defun load-save-place-alist-from-file ()
    (if (not save-place-loaded)





reply via email to

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