emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/savehist.el


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/savehist.el
Date: Sun, 16 Oct 2005 11:22:37 -0400

Index: emacs/lisp/savehist.el
diff -c emacs/lisp/savehist.el:1.2 emacs/lisp/savehist.el:1.3
*** emacs/lisp/savehist.el:1.2  Sun Oct 16 15:02:39 2005
--- emacs/lisp/savehist.el      Sun Oct 16 15:22:37 2005
***************
*** 45,51 ****
  ;;; Code:
  
  (require 'custom)
- (require 'cl)
  
  ;; User variables
  
--- 45,50 ----
***************
*** 139,147 ****
    :type 'integer
    :group 'savehist)
  
! (defconst savehist-xemacs (string-match "XEmacs" emacs-version))
! 
! (defvar savehist-coding-system (if savehist-xemacs 'iso-2022-8 'utf-8)
    "The coding system savehist uses for saving the minibuffer history.
  Changing this value while Emacs is running is supported, but considered
  unwise, unless you know what you are doing.")
--- 138,144 ----
    :type 'integer
    :group 'savehist)
  
! (defvar savehist-coding-system (if (coding-system-p 'utf-8) 'utf-8 
'iso-2022-8)
    "The coding system savehist uses for saving the minibuffer history.
  Changing this value while Emacs is running is supported, but considered
  unwise, unless you know what you are doing.")
***************
*** 152,160 ****
  
  (defvar savehist-last-checksum nil)
  
! ;; Coding system without conversion, only used for calculating and
! ;; comparing checksums.
! (defconst savehist-no-conversion (if savehist-xemacs 'binary 'no-conversion))
  
  ;; Functions
  
--- 149,157 ----
  
  (defvar savehist-last-checksum nil)
  
! (defconst savehist-no-conversion (if (featurep 'xemacs) 'binary 
'no-conversion)
!   ;; FIXME: Why not use savehist-coding-system?
!   "Coding system without conversion, only used for calculating checksums.")
  
  ;; Functions
  
***************
*** 176,187 ****
      ;; executes in under 5 ms on my system.
      (unless savehist-timer
        (setq savehist-timer
!           (if savehist-xemacs
                (start-itimer
                 "savehist" 'savehist-autosave savehist-autosave-interval
                 savehist-autosave-interval)
!             (run-with-timer savehist-autosave-interval 
savehist-autosave-interval
!                             'savehist-autosave)))))
    ;; Don't set coding-system-for-read here.  We rely on autodetection
    ;; and the coding cookie to convey that information.  That way, if
    ;; the user changes the value of savehist-coding-system, we can
--- 173,184 ----
      ;; executes in under 5 ms on my system.
      (unless savehist-timer
        (setq savehist-timer
!           (if (fboundp 'start-itimer)
                (start-itimer
                 "savehist" 'savehist-autosave savehist-autosave-interval
                 savehist-autosave-interval)
!             (run-with-idle-timer savehist-autosave-interval 
savehist-autosave-interval
!                                    'savehist-autosave)))))
    ;; Don't set coding-system-for-read here.  We rely on autodetection
    ;; and the coding cookie to convey that information.  That way, if
    ;; the user changes the value of savehist-coding-system, we can
***************
*** 237,249 ****
    (cond
     ((listp value)
      (when (and savehist-length (> (length value) savehist-length))
!       (setq value (subseq value 0 savehist-length)))
!     (delete-if-not #'savehist-printable value))
     ((savehist-printable value) value)
     (t nil)))
  
  (defun savehist-printable (value)
!   "Returns non-nil if VALUE is printable."
    ;; Quick response for oft-encountered types known to be printable.
    (cond
     ((stringp value))
--- 234,247 ----
    (cond
     ((listp value)
      (when (and savehist-length (> (length value) savehist-length))
!       (setq value (copy-sequence value))
!       (setcdr (nthcdr savehist-length value) nil))
!     (delq nil (mapcar (lambda (x) (if (savehist-printable x) x)) value)))
     ((savehist-printable value) value)
     (t nil)))
  
  (defun savehist-printable (value)
!   "Return non-nil if VALUE is printable."
    ;; Quick response for oft-encountered types known to be printable.
    (cond
     ((stringp value))




reply via email to

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