*** cus-edit.el.~1.364.~ 2009-07-27 08:09:05.997162900 +0200 --- cus-edit.el 2009-08-11 10:51:21.812500000 +0200 *************** *** 4338,4374 **** This function does not save the buffer." (goto-char (point-min)) ! ;; Skip all whitespace and comments. ! (while (forward-comment 1)) ! (or (eobp) ! (save-excursion (forward-sexp (buffer-size)))) ; Test for scan errors. ! (let (first) ! (catch 'found ! (while t ;; We exit this loop only via throw. ! ;; Skip all whitespace and comments. ! (while (forward-comment 1)) ! (let ((start (point)) ! (sexp (condition-case nil ! (read (current-buffer)) ! (end-of-file (throw 'found nil))))) ! (when (and (listp sexp) ! (eq (car sexp) symbol)) ! (delete-region start (point)) ! (unless first ! (setq first (point))))))) ! (if first ! (goto-char first) ! ;; Move in front of local variables, otherwise long Custom ! ;; entries would make them ineffective. ! (let ((pos (point-max)) ! (case-fold-search t)) ! (save-excursion ! (goto-char (point-max)) ! (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) ! 'move) ! (when (search-forward "Local Variables:" nil t) ! (setq pos (line-beginning-position)))) ! (goto-char pos))))) (defun custom-save-variables () "Save all customized variables in `custom-file'." --- 4338,4364 ---- This function does not save the buffer." (goto-char (point-min)) ! (if (re-search-forward (concat "^(" (symbol-name symbol))) ! (let ((from (goto-char (match-beginning 0))) ! (to (condition-case nil ! (progn ! (forward-sexp) ! (point)) ! (error nil)))) ! (if to ! (delete-region from to) ! (error "Malformed %s expression" symbol))) ! ;; Move in front of local variables, otherwise long Custom ! ;; entries would make them ineffective. ! (let ((pos (point-max)) ! (case-fold-search t)) ! (save-excursion ! (goto-char (point-max)) ! (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) ! 'move) ! (when (search-forward "Local Variables:" nil t) ! (setq pos (line-beginning-position)))) ! (goto-char pos)))) (defun custom-save-variables () "Save all customized variables in `custom-file'."