comparison lisp/savehist.el @ 85688:b210bba3f477

Merge from emacs--rel--22 Patches applied: * emacs--rel--22 (patch 131-137) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 261-262) - Update from CVS Revision: emacs@sv.gnu.org/emacs--devo--0--patch-908
author Miles Bader <miles@gnu.org>
date Sat, 27 Oct 2007 09:07:17 +0000
parents b98604865ea0 a1c08bc44c8a
children d3e87ee5aa0e
comparison
equal deleted inserted replaced
85687:666ace46440f 85688:b210bba3f477
307 ',savehist-minibuffer-history-variables) 307 ',savehist-minibuffer-history-variables)
308 (current-buffer)) 308 (current-buffer))
309 (insert ?\n) 309 (insert ?\n)
310 (dolist (symbol savehist-minibuffer-history-variables) 310 (dolist (symbol savehist-minibuffer-history-variables)
311 (when (boundp symbol) 311 (when (boundp symbol)
312 (let ((value (savehist-trim-history (symbol-value symbol)))) 312 (let ((value (savehist-trim-history (symbol-value symbol)))
313 (when value ; don't save empty histories 313 excess-space)
314 (prin1 `(setq ,symbol ',value) (current-buffer)) 314 (when value ; Don't save empty histories.
315 (insert ?\n)))))) 315 (insert "(setq ")
316 (prin1 symbol (current-buffer))
317 (insert " '(")
318 ;; We will print an extra space before the first element.
319 ;; Record where that is.
320 (setq excess-space (point))
321 ;; Print elements of VALUE one by one, carefully.
322 (dolist (elt value)
323 (let ((start (point)))
324 (insert " ")
325 (prin1 elt (current-buffer))
326 ;; Try to read the element we just printed.
327 (condition-case nil
328 (save-excursion
329 (goto-char start)
330 (read (current-buffer)))
331 (error
332 ;; If reading it gets an error, comment it out.
333 (goto-char start)
334 (insert "\n")
335 (while (not (eobp))
336 (insert ";;; ")
337 (forward-line 1))
338 (insert "\n")))
339 (goto-char (point-max))))
340 ;; Delete the extra space before the first element.
341 (save-excursion
342 (goto-char excess-space)
343 (if (eq (following-char) ?\s)
344 (delete-region (point) (1+ (point)))))
345 (insert "))\n"))))))
316 ;; Save the additional variables. 346 ;; Save the additional variables.
317 (dolist (symbol savehist-additional-variables) 347 (dolist (symbol savehist-additional-variables)
318 (when (boundp symbol) 348 (when (boundp symbol)
319 (let ((value (symbol-value symbol))) 349 (let ((value (symbol-value symbol)))
320 (when (savehist-printable value) 350 (when (savehist-printable value)