Mercurial > hg > xemacs-beta
comparison lisp/prim/simple.el @ 201:eb5470882647 r20-3b27
Import from CVS: tag r20-3b27
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:01:22 +0200 |
parents | 169c0442b401 |
children | e45d5e7c476e |
comparison
equal
deleted
inserted
replaced
200:f0deb0c0e6be | 201:eb5470882647 |
---|---|
77 | 77 |
78 (defgroup paren-matching nil | 78 (defgroup paren-matching nil |
79 "Highlight (un)matching of parens and expressions." | 79 "Highlight (un)matching of parens and expressions." |
80 :prefix "paren-" | 80 :prefix "paren-" |
81 :group 'matching) | 81 :group 'matching) |
82 | |
83 (defgroup log-message nil | |
84 "Messages logging and display customizations." | |
85 :group 'minibuffer) | |
86 | |
87 (defgroup warnings nil | |
88 "Warnings customizations." | |
89 :group 'minibuffer) | |
82 | 90 |
83 | 91 |
84 (defun newline (&optional arg) | 92 (defun newline (&optional arg) |
85 "Insert a newline, and move to left margin of the new line if it's blank. | 93 "Insert a newline, and move to left margin of the new line if it's blank. |
86 The newline is marked with the text-property `hard'. | 94 The newline is marked with the text-property `hard'. |
874 (setq overriding-terminal-local-map universal-argument-map)) | 882 (setq overriding-terminal-local-map universal-argument-map)) |
875 | 883 |
876 ;; A subsequent C-u means to multiply the factor by 4 if we've typed | 884 ;; A subsequent C-u means to multiply the factor by 4 if we've typed |
877 ;; nothing but C-u's; otherwise it means to terminate the prefix arg. | 885 ;; nothing but C-u's; otherwise it means to terminate the prefix arg. |
878 (defun universal-argument-more (arg) | 886 (defun universal-argument-more (arg) |
879 (interactive "P") | 887 (interactive "_P") ; XEmacs |
880 (if (consp arg) | 888 (if (consp arg) |
881 (setq prefix-arg (list (* 4 (car arg)))) | 889 (setq prefix-arg (list (* 4 (car arg)))) |
882 (setq prefix-arg arg) | 890 (setq prefix-arg arg) |
883 (setq overriding-terminal-local-map nil)) | 891 (setq overriding-terminal-local-map nil)) |
884 (setq zmacs-region-stays t) ; XEmacs | |
885 (setq universal-argument-num-events (length (this-command-keys)))) | 892 (setq universal-argument-num-events (length (this-command-keys)))) |
886 | 893 |
887 (defun negative-argument (arg) | 894 (defun negative-argument (arg) |
888 "Begin a negative numeric argument for the next command. | 895 "Begin a negative numeric argument for the next command. |
889 \\[universal-argument] following digits or minus sign ends the argument." | 896 \\[universal-argument] following digits or minus sign ends the argument." |
890 (interactive "P") | 897 (interactive "_P") ; XEmacs |
891 (cond ((integerp arg) | 898 (cond ((integerp arg) |
892 (setq prefix-arg (- arg))) | 899 (setq prefix-arg (- arg))) |
893 ((eq arg '-) | 900 ((eq arg '-) |
894 (setq prefix-arg nil)) | 901 (setq prefix-arg nil)) |
895 (t | 902 (t |
896 (setq prefix-arg '-))) | 903 (setq prefix-arg '-))) |
897 (setq zmacs-region-stays t) ; XEmacs | |
898 (setq universal-argument-num-events (length (this-command-keys))) | 904 (setq universal-argument-num-events (length (this-command-keys))) |
899 (setq overriding-terminal-local-map universal-argument-map)) | 905 (setq overriding-terminal-local-map universal-argument-map)) |
900 | 906 |
901 ;; XEmacs: This function not synched with FSF | 907 ;; XEmacs: This function not synched with FSF |
902 (defun digit-argument (arg) | 908 (defun digit-argument (arg) |
903 "Part of the numeric argument for the next command. | 909 "Part of the numeric argument for the next command. |
904 \\[universal-argument] following digits or minus sign ends the argument." | 910 \\[universal-argument] following digits or minus sign ends the argument." |
905 (interactive "P") | 911 (interactive "_P") ; XEmacs |
906 (let* ((event last-command-event) | 912 (let* ((event last-command-event) |
907 (key (and (key-press-event-p event) | 913 (key (and (key-press-event-p event) |
908 (event-key event))) | 914 (event-key event))) |
909 (digit (and key (characterp key) (>= key ?0) (<= key ?9) | 915 (digit (and key (characterp key) (>= key ?0) (<= key ?9) |
910 (- key ?0)))) | 916 (- key ?0)))) |
916 ((eq arg '-) | 922 ((eq arg '-) |
917 ;; Treat -0 as just -, so that -01 will work. | 923 ;; Treat -0 as just -, so that -01 will work. |
918 (setq prefix-arg (if (zerop digit) '- (- digit)))) | 924 (setq prefix-arg (if (zerop digit) '- (- digit)))) |
919 (t | 925 (t |
920 (setq prefix-arg digit))) | 926 (setq prefix-arg digit))) |
921 (setq zmacs-region-stays t) | |
922 (setq universal-argument-num-events (length (this-command-keys))) | 927 (setq universal-argument-num-events (length (this-command-keys))) |
923 (setq overriding-terminal-local-map universal-argument-map)))) | 928 (setq overriding-terminal-local-map universal-argument-map)))) |
924 | 929 |
925 ;; For backward compatibility, minus with no modifiers is an ordinary | 930 ;; For backward compatibility, minus with no modifiers is an ordinary |
926 ;; command if digits have already been entered. | 931 ;; command if digits have already been entered. |
931 (negative-argument arg))) | 936 (negative-argument arg))) |
932 | 937 |
933 ;; Anything else terminates the argument and is left in the queue to be | 938 ;; Anything else terminates the argument and is left in the queue to be |
934 ;; executed as a command. | 939 ;; executed as a command. |
935 (defun universal-argument-other-key (arg) | 940 (defun universal-argument-other-key (arg) |
936 (interactive "P") | 941 (interactive "_P") ; XEmacs |
937 (setq prefix-arg arg) | 942 (setq prefix-arg arg) |
938 (setq zmacs-region-stays t) ; XEmacs | |
939 (let* ((key (this-command-keys)) | 943 (let* ((key (this-command-keys)) |
940 ;; FSF calls silly function `listify-key-sequence' here. | 944 ;; FSF calls silly function `listify-key-sequence' here. |
941 (keylist (append key nil))) | 945 (keylist (append key nil))) |
942 (setq unread-command-events | 946 (setq unread-command-events |
943 (append (nthcdr universal-argument-num-events keylist) | 947 (append (nthcdr universal-argument-num-events keylist) |
944 unread-command-events))) | 948 unread-command-events))) |
945 (reset-this-command-lengths) | 949 (reset-this-command-lengths) |
946 (setq overriding-terminal-local-map nil)) | 950 (setq overriding-terminal-local-map nil)) |
947 | 951 |
948 | 952 |
949 ;; XEmacs -- shouldn't these functions keep the zmacs region active? | 953 ;; XEmacs -- keep zmacs-region active. |
950 (defun forward-to-indentation (arg) | 954 (defun forward-to-indentation (arg) |
951 "Move forward ARG lines and position at first nonblank character." | 955 "Move forward ARG lines and position at first nonblank character." |
952 (interactive "_p") | 956 (interactive "_p") |
953 (forward-line arg) | 957 (forward-line arg) |
954 (skip-chars-forward " \t")) | 958 (skip-chars-forward " \t")) |
1010 ;;; than interprogram-cut-function (from FSFmacs). I don't like the behavior | 1014 ;;; than interprogram-cut-function (from FSFmacs). I don't like the behavior |
1011 ;;; of interprogram-paste-function: ^Y should always come from the kill ring, | 1015 ;;; of interprogram-paste-function: ^Y should always come from the kill ring, |
1012 ;;; not the X selection. But if that were provided, it should be called (and | 1016 ;;; not the X selection. But if that were provided, it should be called (and |
1013 ;;; behave as) yank-hooks instead. -- jwz | 1017 ;;; behave as) yank-hooks instead. -- jwz |
1014 | 1018 |
1015 ;(defvar interprogram-cut-function nil | 1019 ;; [... code snipped ...] |
1016 ; "Function to call to make a killed region available to other programs. | |
1017 ; | |
1018 ;Most window systems provide some sort of facility for cutting and | |
1019 ;pasting text between the windows of different programs. | |
1020 ;This variable holds a function that XEmacs calls whenever text | |
1021 ;is put in the kill ring, to make the new kill available to other | |
1022 ;programs. | |
1023 ; | |
1024 ;The function takes one or two arguments. | |
1025 ;The first argument, TEXT, is a string containing | |
1026 ;the text which should be made available. | |
1027 ;The second, PUSH, if non-nil means this is a \"new\" kill; | |
1028 ;nil means appending to an \"old\" kill.") | |
1029 ; | |
1030 ;(defvar interprogram-paste-function nil | |
1031 ; "Function to call to get text cut from other programs. | |
1032 ; | |
1033 ;Most window systems provide some sort of facility for cutting and | |
1034 ;pasting text between the windows of different programs. | |
1035 ;This variable holds a function that Emacs calls to obtain | |
1036 ;text that other programs have provided for pasting. | |
1037 ; | |
1038 ;The function should be called with no arguments. If the function | |
1039 ;returns nil, then no other program has provided such text, and the top | |
1040 ;of the Emacs kill ring should be used. If the function returns a | |
1041 ;string, that string should be put in the kill ring as the latest kill. | |
1042 ; | |
1043 ;Note that the function should return a string only if a program other | |
1044 ;than Emacs has provided a string for pasting; if Emacs provided the | |
1045 ;most recent string, the function should return nil. If it is | |
1046 ;difficult to tell whether Emacs or some other program provided the | |
1047 ;current string, it is probably good enough to return nil if the string | |
1048 ;is equal (according to `string=') to the last text Emacs provided.") | |
1049 | 1020 |
1050 (defcustom kill-hooks nil | 1021 (defcustom kill-hooks nil |
1051 "*Functions run when something is added to the XEmacs kill ring. | 1022 "*Functions run when something is added to the XEmacs kill ring. |
1052 These functions are called with one argument, the string most recently | 1023 These functions are called with one argument, the string most recently |
1053 cut or copied. You can use this to, for example, make the most recent | 1024 cut or copied. You can use this to, for example, make the most recent |
1116 | 1087 |
1117 | 1088 |
1118 | 1089 |
1119 ;;;; Commands for manipulating the kill ring. | 1090 ;;;; Commands for manipulating the kill ring. |
1120 | 1091 |
1121 ;;FSFmacs | 1092 ;; In FSF killing read-only text just pastes it into kill-ring. Which |
1093 ;; is a very bad idea -- see Jamie's comment below. | |
1094 | |
1122 ;(defvar kill-read-only-ok nil | 1095 ;(defvar kill-read-only-ok nil |
1123 ; "*Non-nil means don't signal an error for killing read-only text.") | 1096 ; "*Non-nil means don't signal an error for killing read-only text.") |
1124 | |
1125 ;(put 'text-read-only 'error-conditions | |
1126 ; '(text-read-only buffer-read-only error)) | |
1127 ;(put 'text-read-only 'error-message "Text is read-only") | |
1128 | 1097 |
1129 (defun kill-region (beg end &optional verbose) ; verbose is XEmacs addition | 1098 (defun kill-region (beg end &optional verbose) ; verbose is XEmacs addition |
1130 "Kill between point and mark. | 1099 "Kill between point and mark. |
1131 The text is deleted but saved in the kill ring. | 1100 The text is deleted but saved in the kill ring. |
1132 The command \\[yank] can retrieve it from there. | 1101 The command \\[yank] can retrieve it from there. |
1326 (t (1- arg))))) | 1295 (t (1- arg))))) |
1327 (if (consp arg) | 1296 (if (consp arg) |
1328 ;; This is like exchange-point-and-mark, but doesn't activate the mark. | 1297 ;; This is like exchange-point-and-mark, but doesn't activate the mark. |
1329 ;; It is cleaner to avoid activation, even though the command | 1298 ;; It is cleaner to avoid activation, even though the command |
1330 ;; loop would deactivate the mark because we inserted text. | 1299 ;; loop would deactivate the mark because we inserted text. |
1331 ;; (But doesn't work in XEmacs) | 1300 ;; (But it's an unnecessary kludge in XEmacs.) |
1332 ;(goto-char (prog1 (mark t) | 1301 ;(goto-char (prog1 (mark t) |
1333 ;(set-marker (mark-marker) (point) (current-buffer))))) | 1302 ;(set-marker (mark-marker) (point) (current-buffer))))) |
1334 (exchange-point-and-mark t)) | 1303 (exchange-point-and-mark t)) |
1335 ;; If we do get all the way thru, make this-command indicate that. | 1304 ;; If we do get all the way thru, make this-command indicate that. |
1336 (setq this-command 'yank) | 1305 (setq this-command 'yank) |
1641 (switch-to-buffer buffer))) | 1610 (switch-to-buffer buffer))) |
1642 | 1611 |
1643 | 1612 |
1644 ;;; After 8 years of waiting ... -sb | 1613 ;;; After 8 years of waiting ... -sb |
1645 (defcustom next-line-add-newlines nil ; XEmacs | 1614 (defcustom next-line-add-newlines nil ; XEmacs |
1646 "*If non-nil, `next-line' inserts newline to avoid `end of buffer' error." | 1615 "*If non-nil, `next-line' inserts newline when the point is at end of buffer. |
1616 This behavior used to be the default, and is still default in FSF Emacs. | |
1617 We think it is an unnecessary and unwanted side-effect." | |
1647 :type 'boolean | 1618 :type 'boolean |
1648 :group 'editing-basics) | 1619 :group 'editing-basics) |
1649 | 1620 |
1650 (defun next-line (arg) | 1621 (defun next-line (arg) |
1651 "Move cursor vertically down ARG lines. | 1622 "Move cursor vertically down ARG lines. |
1714 :type 'boolean | 1685 :type 'boolean |
1715 :group 'editing-basics) | 1686 :group 'editing-basics) |
1716 | 1687 |
1717 (defcustom goal-column nil | 1688 (defcustom goal-column nil |
1718 "*Semipermanent goal column for vertical motion, as set by \\[set-goal-column], or nil." | 1689 "*Semipermanent goal column for vertical motion, as set by \\[set-goal-column], or nil." |
1719 :type '(choice integer (const nil)) | 1690 :type '(choice integer (const :tag "None" nil)) |
1720 :group 'editing-basics) | 1691 :group 'editing-basics) |
1721 (make-variable-buffer-local 'goal-column) | 1692 (make-variable-buffer-local 'goal-column) |
1722 | 1693 |
1723 (defvar temporary-goal-column 0 | 1694 (defvar temporary-goal-column 0 |
1724 "Current goal column for vertical motion. | 1695 "Current goal column for vertical motion. |
1815 (goto-char new))) | 1786 (goto-char new))) |
1816 nil) | 1787 nil) |
1817 | 1788 |
1818 ;;; Many people have said they rarely use this feature, and often type | 1789 ;;; Many people have said they rarely use this feature, and often type |
1819 ;;; it by accident. Maybe it shouldn't even be on a key. | 1790 ;;; it by accident. Maybe it shouldn't even be on a key. |
1820 (put 'set-goal-column 'disabled t) | 1791 ;; It's not on a key, as of 20.2. So no need for this. |
1792 ;(put 'set-goal-column 'disabled t) | |
1821 | 1793 |
1822 (defun set-goal-column (arg) | 1794 (defun set-goal-column (arg) |
1823 "Set the current horizontal position as a goal for \\[next-line] and \\[previous-line]. | 1795 "Set the current horizontal position as a goal for \\[next-line] and \\[previous-line]. |
1824 Those commands will move to this position in the line moved to | 1796 Those commands will move to this position in the line moved to |
1825 rather than trying to keep the same horizontal position. | 1797 rather than trying to keep the same horizontal position. |
2547 (setq give-up t))) | 2519 (setq give-up t))) |
2548 ;; No place to break => stop trying. | 2520 ;; No place to break => stop trying. |
2549 (setq give-up t)))) | 2521 (setq give-up t)))) |
2550 ;; Justify last line. | 2522 ;; Justify last line. |
2551 (justify-current-line justify t t) | 2523 (justify-current-line justify t t) |
2552 t))) | 2524 t))) |
2553 | 2525 |
2554 (defvar normal-auto-fill-function 'do-auto-fill | 2526 (defvar normal-auto-fill-function 'do-auto-fill |
2555 "The function to use for `auto-fill-function' if Auto Fill mode is turned on. | 2527 "The function to use for `auto-fill-function' if Auto Fill mode is turned on. |
2556 Some major modes set this.") | 2528 Some major modes set this.") |
2557 | 2529 |
3189 ;;; are the variables zmacs-regions, zmacs-region-active-p and | 3161 ;;; are the variables zmacs-regions, zmacs-region-active-p and |
3190 ;;; zmacs-region-stays plus the function zmacs_update_region which | 3162 ;;; zmacs-region-stays plus the function zmacs_update_region which |
3191 ;;; calls the lisp level zmacs-update-region. It must remain since it | 3163 ;;; calls the lisp level zmacs-update-region. It must remain since it |
3192 ;;; must be called by core C code. | 3164 ;;; must be called by core C code. |
3193 ;;; | 3165 ;;; |
3166 ;;; Huh? Why couldn't "core C code" just use | |
3167 ;;; call0(Qzmacs_update_region)??? -hniksic | |
3194 | 3168 |
3195 (defvar zmacs-activate-region-hook nil | 3169 (defvar zmacs-activate-region-hook nil |
3196 "Function or functions called when the region becomes active; | 3170 "Function or functions called when the region becomes active; |
3197 see the variable `zmacs-regions'.") | 3171 see the variable `zmacs-regions'.") |
3198 | 3172 |
3372 "A function or list of functions to be called when a message is removed | 3346 "A function or list of functions to be called when a message is removed |
3373 from the echo area at the bottom of the frame. The label of the removed | 3347 from the echo area at the bottom of the frame. The label of the removed |
3374 message is passed as the first argument, and the text of the message | 3348 message is passed as the first argument, and the text of the message |
3375 as the second argument.") | 3349 as the second argument.") |
3376 | 3350 |
3377 (defvar log-message-max-size 50000 | 3351 (defcustom log-message-max-size 50000 |
3378 "Maximum size of the \" *Message-Log*\" buffer. See `log-message'.") | 3352 "Maximum size of the \" *Message-Log*\" buffer. See `log-message'." |
3353 :type 'integer | |
3354 :group 'log-message) | |
3379 (make-compatible-variable 'message-log-max 'log-message-max-size) | 3355 (make-compatible-variable 'message-log-max 'log-message-max-size) |
3380 | 3356 |
3381 ;; We used to reject quite a lot of stuff here, but it was a bad idea, | 3357 ;; We used to reject quite a lot of stuff here, but it was a bad idea, |
3382 ;; for two reasons: | 3358 ;; for two reasons: |
3383 ;; | 3359 ;; |
3390 ;; b) It slowed things down. Yes, visibly. | 3366 ;; b) It slowed things down. Yes, visibly. |
3391 ;; | 3367 ;; |
3392 ;; So, I left only a few of the really useless ones on this kill-list. | 3368 ;; So, I left only a few of the really useless ones on this kill-list. |
3393 ;; | 3369 ;; |
3394 ;; --hniksic | 3370 ;; --hniksic |
3395 (defvar log-message-ignore-regexps | 3371 (defcustom log-message-ignore-regexps |
3396 '(;; Note: adding entries to this list slows down messaging | 3372 '(;; Note: adding entries to this list slows down messaging |
3397 ;; significantly. Wherever possible, use message lables. | 3373 ;; significantly. Wherever possible, use message lables. |
3398 | 3374 |
3399 ;; Often-seen messages | 3375 ;; Often-seen messages |
3400 "\\`\\'" ; empty message | 3376 "\\`\\'" ; empty message |
3419 "List of regular expressions matching messages which shouldn't be logged. | 3395 "List of regular expressions matching messages which shouldn't be logged. |
3420 See `log-message'. | 3396 See `log-message'. |
3421 | 3397 |
3422 Ideally, packages which generate messages which might need to be ignored | 3398 Ideally, packages which generate messages which might need to be ignored |
3423 should label them with 'progress, 'prompt, or 'no-log, so they can be | 3399 should label them with 'progress, 'prompt, or 'no-log, so they can be |
3424 filtered by the log-message-ignore-labels.") | 3400 filtered by the log-message-ignore-labels." |
3425 | 3401 :type '(repeat regexp) |
3426 (defvar log-message-ignore-labels | 3402 :group 'log-message) |
3403 | |
3404 (defcustom log-message-ignore-labels | |
3427 '(help-echo command progress prompt no-log garbage-collecting auto-saving) | 3405 '(help-echo command progress prompt no-log garbage-collecting auto-saving) |
3428 "List of symbols indicating labels of messages which shouldn't be logged. | 3406 "List of symbols indicating labels of messages which shouldn't be logged. |
3429 See `display-message' for some common labels. See also `log-message'.") | 3407 See `display-message' for some common labels. See also `log-message'." |
3408 :type '(repeat (symbol :tag "Label")) | |
3409 :group 'log-message) | |
3430 | 3410 |
3431 ;;Subsumed by view-lossage | 3411 ;;Subsumed by view-lossage |
3432 ;; Not really, I'm adding it back by popular demand. -slb | 3412 ;; Not really, I'm adding it back by popular demand. -slb |
3433 (defun show-message-log () | 3413 (defun show-message-log () |
3434 "Show the \" *Message-Log*\" buffer, which contains old messages and errors." | 3414 "Show the \" *Message-Log*\" buffer, which contains old messages and errors." |
3604 The FRAME argument is currently unused." | 3584 The FRAME argument is currently unused." |
3605 (cdr (car message-stack))) | 3585 (cdr (car message-stack))) |
3606 | 3586 |
3607 ;;; may eventually be frame-dependent | 3587 ;;; may eventually be frame-dependent |
3608 (defun current-message-label (&optional frame) | 3588 (defun current-message-label (&optional frame) |
3609 (if message-stack | 3589 (car (car message-stack))) |
3610 (car (car message-stack)) | |
3611 nil)) | |
3612 | 3590 |
3613 (defun message (fmt &rest args) | 3591 (defun message (fmt &rest args) |
3614 "Print a one-line message at the bottom of the frame. | 3592 "Print a one-line message at the bottom of the frame. |
3615 The arguments are the same as to `format'. | 3593 The arguments are the same as to `format'. |
3616 | 3594 |
3629 | 3607 |
3630 ;;;;;; | 3608 ;;;;;; |
3631 ;;;;;; warning stuff | 3609 ;;;;;; warning stuff |
3632 ;;;;;; | 3610 ;;;;;; |
3633 | 3611 |
3634 (defvar log-warning-minimum-level 'info | 3612 (defcustom log-warning-minimum-level 'info |
3635 "Minimum level of warnings that should be logged. | 3613 "Minimum level of warnings that should be logged. |
3636 The warnings in levels below this are completely ignored, as if they never | 3614 The warnings in levels below this are completely ignored, as if they never |
3637 happened. | 3615 happened. |
3638 | 3616 |
3639 The recognized warning levels, in decreasing order of priority, are | 3617 The recognized warning levels, in decreasing order of priority, are |
3642 | 3620 |
3643 See also `display-warning-minimum-level'. | 3621 See also `display-warning-minimum-level'. |
3644 | 3622 |
3645 You can also control which warnings are displayed on a class-by-class | 3623 You can also control which warnings are displayed on a class-by-class |
3646 basis. See `display-warning-suppressed-classes' and | 3624 basis. See `display-warning-suppressed-classes' and |
3647 `log-warning-suppressed-classes'.") | 3625 `log-warning-suppressed-classes'." |
3648 | 3626 :type '(choice (const emergency) (const alert) (const critical) |
3649 (defvar display-warning-minimum-level 'info | 3627 (const error) (const warning) (const notice) |
3628 (const info) (const debug)) | |
3629 :group 'warnings) | |
3630 | |
3631 (defcustom display-warning-minimum-level 'info | |
3650 "Minimum level of warnings that should be displayed. | 3632 "Minimum level of warnings that should be displayed. |
3651 The warnings in levels below this are completely ignored, as if they never | 3633 The warnings in levels below this are completely ignored, as if they never |
3652 happened. | 3634 happened. |
3653 | 3635 |
3654 The recognized warning levels, in decreasing order of priority, are | 3636 The recognized warning levels, in decreasing order of priority, are |
3657 | 3639 |
3658 See also `log-warning-minimum-level'. | 3640 See also `log-warning-minimum-level'. |
3659 | 3641 |
3660 You can also control which warnings are displayed on a class-by-class | 3642 You can also control which warnings are displayed on a class-by-class |
3661 basis. See `display-warning-suppressed-classes' and | 3643 basis. See `display-warning-suppressed-classes' and |
3662 `log-warning-suppressed-classes'.") | 3644 `log-warning-suppressed-classes'." |
3645 :type '(choice (const emergency) (const alert) (const critical) | |
3646 (const error) (const warning) (const notice) | |
3647 (const info) (const debug)) | |
3648 :group 'warnings) | |
3663 | 3649 |
3664 (defvar log-warning-suppressed-classes nil | 3650 (defvar log-warning-suppressed-classes nil |
3665 "List of classes of warnings that shouldn't be logged or displayed. | 3651 "List of classes of warnings that shouldn't be logged or displayed. |
3666 If any of the CLASS symbols associated with a warning is the same as | 3652 If any of the CLASS symbols associated with a warning is the same as |
3667 any of the symbols listed here, the warning will be completely ignored, | 3653 any of the symbols listed here, the warning will be completely ignored, |
3671 Set `display-warning-suppressed-classes' instead. That way the suppressed | 3657 Set `display-warning-suppressed-classes' instead. That way the suppressed |
3672 warnings are not displayed but are still unobtrusively logged. | 3658 warnings are not displayed but are still unobtrusively logged. |
3673 | 3659 |
3674 See also `log-warning-minimum-level' and `display-warning-minimum-level'.") | 3660 See also `log-warning-minimum-level' and `display-warning-minimum-level'.") |
3675 | 3661 |
3676 (defvar display-warning-suppressed-classes nil | 3662 (defcustom display-warning-suppressed-classes nil |
3677 "List of classes of warnings that shouldn't be displayed. | 3663 "List of classes of warnings that shouldn't be displayed. |
3678 If any of the CLASS symbols associated with a warning is the same as | 3664 If any of the CLASS symbols associated with a warning is the same as |
3679 any of the symbols listed here, the warning will not be displayed. | 3665 any of the symbols listed here, the warning will not be displayed. |
3680 The warning will still logged in the *Warnings* buffer (unless also | 3666 The warning will still logged in the *Warnings* buffer (unless also |
3681 contained in `log-warning-suppressed-classes'), but the buffer will | 3667 contained in `log-warning-suppressed-classes'), but the buffer will |
3682 not be automatically popped up. | 3668 not be automatically popped up. |
3683 | 3669 |
3684 See also `log-warning-minimum-level' and `display-warning-minimum-level'.") | 3670 See also `log-warning-minimum-level' and `display-warning-minimum-level'." |
3671 :type '(repeat symbol) | |
3672 :group 'warnings) | |
3685 | 3673 |
3686 (defvar warning-count 0 | 3674 (defvar warning-count 0 |
3687 "Count of the number of warning messages displayed so far.") | 3675 "Count of the number of warning messages displayed so far.") |
3688 | 3676 |
3689 (defconst warning-level-alist '((emergency . 8) | 3677 (defconst warning-level-alist '((emergency . 8) |
3795 (set-marker warning-marker 1 buffer))) | 3783 (set-marker warning-marker 1 buffer))) |
3796 (set-window-start (display-buffer buffer) warning-marker) | 3784 (set-window-start (display-buffer buffer) warning-marker) |
3797 (set-marker warning-marker (point-max buffer) buffer))) | 3785 (set-marker warning-marker (point-max buffer) buffer))) |
3798 | 3786 |
3799 (defun emacs-name () | 3787 (defun emacs-name () |
3800 "Return the printable name of this instance of GNU Emacs." | 3788 "Return the printable name of this instance of Emacs." |
3801 (cond ((featurep 'infodock) "InfoDock") | 3789 (cond ((featurep 'infodock) "InfoDock") |
3802 ((featurep 'xemacs) "XEmacs") | 3790 ((featurep 'xemacs) "XEmacs") |
3803 (t "Emacs"))) | 3791 (t "Emacs"))) |
3804 | 3792 |
3805 ;;; simple.el ends here | 3793 ;;; simple.el ends here |