I have the following code to store the position where to put the initial frame (fxpos and fypos).
My problem is that when I run a new emacs session, the defcustom commands are resetting the values back to 8. Mhat What can I do to avoid this?
(defgroup frame-pos nil "Set position of frame." :group 'convenience) (defcustom fxpos 8 "X position of initial frame." :type 'integer :group 'frame-pos) (defcustom fypos 8 "Y position of initial frame." :type 'integer :group 'frame-pos) (defun frame-shift (frame) (let* ( (lft (car (frame-position))) (top (cdr (frame-position))) (wdt (frame-outer-width frame)) (hgt (frame-outer-height frame)) (fxmid (+ lft (/ wdt 2))) (fymid (+ top (/ hgt 2))) (mgm (cdr (assq 'geometry (frame-monitor-attributes frame)))) (mxmid (+ (nth 0 mgm) (/ (nth 2 mgm) 2))) (mymid (+ (nth 1 mgm) (/ (nth 3 mgm) 2))) (nlft (+ lft (- mxmid fxmid))) (ntop (+ top (- mymid fymid))) ) (custom-declare-variable 'fxpos nlft) (custom-declare-variable 'fypos ntop)))