Mercurial > emacs
changeset 111130:7be880404309
Avoid redefining some C defcustoms.
* lisp/frame.el (show-trailing-whitespace, auto-hscroll-mode)
(display-hourglass, hourglass-delay, cursor-in-non-selected-windows):
Don't redefine things that are defined in C.
* lisp/cus-start.el: Also handle :risky, :safe, :set, and :tag.
(show-trailing-whitespace, auto-hscroll-mode)
(display-hourglass, hourglass-delay, cursor-in-non-selected-windows):
Set up the appropriate custom properties.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Sat, 23 Oct 2010 17:58:22 -0700 |
parents | 2d713b285a70 |
children | e530bc6df030 |
files | lisp/ChangeLog lisp/cus-start.el lisp/frame.el |
diffstat | 3 files changed, 40 insertions(+), 51 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Sun Oct 24 00:29:21 2010 +0000 +++ b/lisp/ChangeLog Sat Oct 23 17:58:22 2010 -0700 @@ -1,3 +1,13 @@ +2010-10-24 Glenn Morris <rgm@gnu.org> + + * frame.el (show-trailing-whitespace, auto-hscroll-mode) + (display-hourglass, hourglass-delay, cursor-in-non-selected-windows): + Don't redefine things that are defined in C. + * cus-start.el: Also handle :risky, :safe, :set, and :tag. + (show-trailing-whitespace, auto-hscroll-mode) + (display-hourglass, hourglass-delay, cursor-in-non-selected-windows): + Set up the appropriate custom properties. + 2010-10-24 Chong Yidong <cyd@stupidchicken.com> Bind "C-c ]" to ...
--- a/lisp/cus-start.el Sun Oct 24 00:29:21 2010 +0000 +++ b/lisp/cus-start.el Sat Oct 23 17:58:22 2010 -0700 @@ -96,6 +96,11 @@ "21.1") (line-spacing display (choice (const :tag "none" nil) integer) "22.1") + (cursor-in-non-selected-windows + cursor boolean nil t :tag "Cursor In Non-selected Windows" + :set #'(lambda (symbol value) + (set-default symbol value) + (force-mode-line-update t))) ;; callint.c (mark-even-if-inactive editing-basics boolean) ;; callproc.c @@ -327,6 +332,8 @@ (other :tag "Always" t)) "23.1") ;; xdisp.c + (show-trailing-whitespace whitespace-faces boolean nil nil + :safe booleanp) (scroll-step windows integer) (scroll-conservatively windows integer) (scroll-margin windows integer) @@ -362,6 +369,9 @@ (const :tag "Text-image-horiz" :value text-image-horiz) (const :tag "System default" :value nil)) "23.3") (tool-bar-max-label-size frames integer "23.3") + (auto-hscroll-mode scrolling boolean "21.1") + (display-hourglass cursor boolean) + (hourglass-delay cursor number) ;; xfaces.c (scalable-fonts-allowed display boolean "22.1") @@ -379,7 +389,7 @@ (x-stretch-cursor display boolean "21.1") ;; xsettings.c (font-use-system-font font-selection boolean "23.2"))) - this symbol group type standard version native-p + this symbol group type standard version native-p rest prop propval ;; This function turns a value ;; into an expression which produces that value. (quoter (lambda (sexp) @@ -404,6 +414,7 @@ (nth 4 this) (when (default-boundp symbol) (funcall quoter (default-value symbol)))) + rest (nthcdr 5 this) ;; Don't complain about missing variables which are ;; irrelevant to this platform. native-p (save-match-data @@ -436,6 +447,11 @@ ;; Save the standard value, unless we already did. (or (get symbol 'standard-value) (put symbol 'standard-value (list standard))) + ;; We need these properties independent of whether cus-start is loaded. + (if (setq prop (memq :safe rest)) + (put symbol 'safe-local-variable (cadr prop))) + (if (setq prop (memq :risky rest)) + (put symbol 'risky-local-variable (cadr prop))) ;; If this is NOT while dumping Emacs, ;; set up the rest of the customization info. (unless purify-flag @@ -443,18 +459,25 @@ (custom-add-to-group group symbol 'custom-variable) ;; Set the type. (put symbol 'custom-type type) - (put symbol 'custom-version version))))) + (put symbol 'custom-version version) + (while rest + (setq prop (car rest) + propval (cadr rest) + rest (nthcdr 2 rest)) + (cond ((memq prop '(:risky :safe))) ; handled above + ((eq prop :set) + (put symbol 'custom-set propval)) + ((eq prop :tag) + (put symbol 'custom-tag propval)))))))) (custom-add-to-group 'iswitchb 'read-buffer-function 'custom-variable) (custom-add-to-group 'font-lock 'open-paren-in-column-0-is-defun-start 'custom-variable) -;; Record cus-start as loaded -;; if we have set up all the info that we can set up. -;; Don't record cus-start as loaded -;; if we have set up only the standard values. +;; Record cus-start as loaded if we have set up all the info that we can. +;; Don't record it as loaded if we have only set up the standard values +;; and safe/risky properties. (unless purify-flag (provide 'cus-start)) -;; arch-tag: 4502730d-bcb3-4f5e-99a3-a86f2d54af60 ;;; cus-start.el ends here
--- a/lisp/frame.el Sun Oct 24 00:29:21 2010 +0000 +++ b/lisp/frame.el Sat Oct 23 17:58:22 2010 -0700 @@ -1467,14 +1467,6 @@ (make-variable-buffer-local 'show-trailing-whitespace) -(defcustom show-trailing-whitespace nil - "Non-nil means highlight trailing whitespace. -This is done in the face `trailing-whitespace'." - :type 'boolean - :safe 'booleanp - :group 'whitespace-faces) - - ;; Scrolling @@ -1483,13 +1475,6 @@ :version "21.1" :group 'frames) -(defcustom auto-hscroll-mode t - "Allow or disallow automatic horizontal scrolling of windows. -If non-nil, windows are automatically scrolled horizontally to make -point visible." - :version "21.1" - :type 'boolean - :group 'scrolling) (defvaralias 'automatic-hscrolling 'auto-hscroll-mode) @@ -1576,35 +1561,6 @@ 'blink-cursor-start)))) (define-obsolete-variable-alias 'blink-cursor 'blink-cursor-mode "22.1") - -;; Hourglass pointer - -(defcustom display-hourglass t - "Non-nil means show an hourglass pointer, when Emacs is busy. -This feature only works when on a window system that can change -cursor shapes." - :type 'boolean - :group 'cursor) - -(defcustom hourglass-delay 1 - "Seconds to wait before displaying an hourglass pointer when Emacs is busy." - :type 'number - :group 'cursor) - - -(defcustom cursor-in-non-selected-windows t - "Non-nil means show a cursor in non-selected windows. -If nil, only shows a cursor in the selected window. -If t, displays a cursor related to the usual cursor type -\(a solid box becomes hollow, a bar becomes a narrower bar). -You can also specify the cursor type as in the `cursor-type' variable. -Use Custom to set this variable and update the display." - :tag "Cursor In Non-selected Windows" - :type 'boolean - :group 'cursor - :set #'(lambda (symbol value) - (set-default symbol value) - (force-mode-line-update t))) ;;;; Key bindings