comparison lisp/prim/simple.el @ 193:f53b5ca2e663 r20-3b23

Import from CVS: tag r20-3b23
author cvs
date Mon, 13 Aug 2007 09:58:30 +0200
parents 489f57a838ef
children a2f645c6b9f8
comparison
equal deleted inserted replaced
192:9d35321dd38c 193:f53b5ca2e663
756 ;; for the following command. 756 ;; for the following command.
757 (setq this-command t) 757 (setq this-command t)
758 (let ((modified (buffer-modified-p)) 758 (let ((modified (buffer-modified-p))
759 (recent-save (recent-auto-save-p))) 759 (recent-save (recent-auto-save-p)))
760 (or (eq (selected-window) (minibuffer-window)) 760 (or (eq (selected-window) (minibuffer-window))
761 (message "Undo!")) 761 (display-message 'command "Undo!"))
762 (or (and (eq last-command 'undo) 762 (or (and (eq last-command 'undo)
763 (eq (current-buffer) last-undo-buffer)) ; XEmacs 763 (eq (current-buffer) last-undo-buffer)) ; XEmacs
764 (progn (undo-start) 764 (progn (undo-start)
765 (undo-more 1))) 765 (undo-more 1)))
766 (undo-more (or arg 1)) 766 (undo-more (or arg 1))
1153 (if (markerp end) (setq end (marker-position end))) 1153 (if (markerp end) (setq end (marker-position end)))
1154 (or (and beg end) (if zmacs-regions ;; rewritten for I18N3 snarfing 1154 (or (and beg end) (if zmacs-regions ;; rewritten for I18N3 snarfing
1155 (error "The region is not active now") 1155 (error "The region is not active now")
1156 (error "The mark is not set now"))) 1156 (error "The mark is not set now")))
1157 (if verbose (if buffer-read-only 1157 (if verbose (if buffer-read-only
1158 (message "Copying %d characters" 1158 (display-message
1159 (- (max beg end) (min beg end))) 1159 'command
1160 (message "Killing %d characters" 1160 (format "Copying %d characters"
1161 (- (max beg end) (min beg end))))) 1161 (- (max beg end) (min beg end))))
1162 (display-message
1163 'command
1164 (format "Killing %d characters"
1165 (- (max beg end) (min beg end))))))
1162 (cond 1166 (cond
1163 1167
1164 ;; I don't like this large change in behavior -- jwz 1168 ;; I don't like this large change in behavior -- jwz
1165 ;; Read-Only text means it shouldn't be deleted, so I'm restoring 1169 ;; Read-Only text means it shouldn't be deleted, so I'm restoring
1166 ;; this code, but only for text-properties and not full extents. -sb 1170 ;; this code, but only for text-properties and not full extents. -sb
1265 ;; XEmacs 1269 ;; XEmacs
1266 (interactive "_") 1270 (interactive "_")
1267 (if (interactive-p) 1271 (if (interactive-p)
1268 (progn 1272 (progn
1269 (setq this-command 'kill-region) 1273 (setq this-command 'kill-region)
1270 (message "If the next command is a kill, it will append")) 1274 (display-message 'command
1275 "If the next command is a kill, it will append"))
1271 (setq last-command 'kill-region))) 1276 (setq last-command 'kill-region)))
1272 1277
1273 (defun yank-pop (arg) 1278 (defun yank-pop (arg)
1274 "Replace just-yanked stretch of killed text with a different stretch. 1279 "Replace just-yanked stretch of killed text with a different stretch.
1275 This command is allowed only immediately after a `yank' or a `yank-pop'. 1280 This command is allowed only immediately after a `yank' or a `yank-pop'.
1546 (progn 1551 (progn
1547 (move-marker (car (nthcdr global-mark-ring-max global-mark-ring)) 1552 (move-marker (car (nthcdr global-mark-ring-max global-mark-ring))
1548 nil buffer) 1553 nil buffer)
1549 (setcdr (nthcdr (1- global-mark-ring-max) global-mark-ring) nil))))) 1554 (setcdr (nthcdr (1- global-mark-ring-max) global-mark-ring) nil)))))
1550 (or nomsg executing-kbd-macro (> (minibuffer-depth) 0) 1555 (or nomsg executing-kbd-macro (> (minibuffer-depth) 0)
1551 (message "Mark set")) 1556 (display-message 'command "Mark set"))
1552 (if activate-region 1557 (if activate-region
1553 (progn 1558 (progn
1554 (setq zmacs-region-stays t) 1559 (setq zmacs-region-stays t)
1555 (zmacs-activate-region))) 1560 (zmacs-activate-region)))
1556 ; (if (or activate (not transient-mark-mode)) ; FSF 1561 ; (if (or activate (not transient-mark-mode)) ; FSF
1823 The goal column is stored in the variable `goal-column'." 1828 The goal column is stored in the variable `goal-column'."
1824 (interactive "_P") ; XEmacs 1829 (interactive "_P") ; XEmacs
1825 (if arg 1830 (if arg
1826 (progn 1831 (progn
1827 (setq goal-column nil) 1832 (setq goal-column nil)
1828 (message "No goal column")) 1833 (display-message 'command "No goal column"))
1829 (setq goal-column (current-column)) 1834 (setq goal-column (current-column))
1830 (message (substitute-command-keys 1835 (message (substitute-command-keys
1831 "Goal column %d (use \\[set-goal-column] with an arg to unset it)") 1836 "Goal column %d (use \\[set-goal-column] with an arg to unset it)")
1832 goal-column)) 1837 goal-column))
1833 nil) 1838 nil)
2128 (re-search-backward comment-start-skip) 2133 (re-search-backward comment-start-skip)
2129 (beginning-of-line) 2134 (beginning-of-line)
2130 (re-search-forward comment-start-skip) 2135 (re-search-forward comment-start-skip)
2131 (goto-char (match-beginning 0)) 2136 (goto-char (match-beginning 0))
2132 (setq comment-column (current-column)) 2137 (setq comment-column (current-column))
2133 (message "Comment column set to %d" comment-column)) 2138 (display-message
2139 'command
2140 (format "Comment column set to %d" comment-column)))
2134 (indent-for-comment)) 2141 (indent-for-comment))
2135 (setq comment-column (current-column)) 2142 (setq comment-column (current-column))
2136 (message "Comment column set to %d" comment-column)))) 2143 (display-message
2144 'command
2145 (format "Comment column set to %d" comment-column)))))
2137 2146
2138 (defun kill-comment (arg) 2147 (defun kill-comment (arg)
2139 "Kill the comment on this line, if any. 2148 "Kill the comment on this line, if any.
2140 With argument, kill comments on that many lines starting with this one." 2149 With argument, kill comments on that many lines starting with this one."
2141 ;; this function loses in a lot of situations. it incorrectly recognises 2150 ;; this function loses in a lot of situations. it incorrectly recognises
2582 ((consp arg) 2591 ((consp arg)
2583 (setq fill-column (current-column))) 2592 (setq fill-column (current-column)))
2584 ;; Disallow missing argument; it's probably a typo for C-x C-f. 2593 ;; Disallow missing argument; it's probably a typo for C-x C-f.
2585 (t 2594 (t
2586 (error "set-fill-column requires an explicit argument"))) 2595 (error "set-fill-column requires an explicit argument")))
2587 (message "fill-column set to %d" fill-column)) 2596 (display-message 'command "fill-column set to %d" fill-column))
2588 2597
2589 (defcustom comment-multi-line t ; XEmacs - this works well with adaptive fill 2598 (defcustom comment-multi-line t ; XEmacs - this works well with adaptive fill
2590 "*Non-nil means \\[indent-new-comment-line] should continue same comment 2599 "*Non-nil means \\[indent-new-comment-line] should continue same comment
2591 on new line, with no new terminator or starter. 2600 on new line, with no new terminator or starter.
2592 This is obsolete because you might as well use \\[newline-and-indent]." 2601 This is obsolete because you might as well use \\[newline-and-indent]."
2868 (and blink-matching-paren-on-screen 2877 (and blink-matching-paren-on-screen
2869 (progn 2878 (progn
2870 (auto-show-make-point-visible) 2879 (auto-show-make-point-visible)
2871 (sit-for blink-matching-delay))) 2880 (sit-for blink-matching-delay)))
2872 (goto-char blinkpos) 2881 (goto-char blinkpos)
2873 (message 2882 (display-message
2874 "Matches %s" 2883 'command
2875 ;; Show what precedes the open in its line, if anything. 2884 (format
2876 (if (save-excursion 2885 "Matches %s"
2877 (skip-chars-backward " \t") 2886 ;; Show what precedes the open in its line, if anything.
2878 (not (bolp))) 2887 (if (save-excursion
2879 (buffer-substring (progn (beginning-of-line) (point)) 2888 (skip-chars-backward " \t")
2880 (1+ blinkpos)) 2889 (not (bolp)))
2881 ;; Show what follows the open in its line, if anything. 2890 (buffer-substring (progn (beginning-of-line) (point))
2882 (if (save-excursion 2891 (1+ blinkpos))
2883 (forward-char 1) 2892 ;; Show what follows the open in its line, if anything.
2884 (skip-chars-forward " \t") 2893 (if (save-excursion
2885 (not (eolp))) 2894 (forward-char 1)
2886 (buffer-substring blinkpos 2895 (skip-chars-forward " \t")
2887 (progn (end-of-line) (point))) 2896 (not (eolp)))
2888 ;; Otherwise show the previous nonblank line, 2897 (buffer-substring blinkpos
2889 ;; if there is one. 2898 (progn (end-of-line) (point)))
2890 (if (save-excursion 2899 ;; Otherwise show the previous nonblank line,
2891 (skip-chars-backward "\n \t") 2900 ;; if there is one.
2892 (not (bobp))) 2901 (if (save-excursion
2893 (concat 2902 (skip-chars-backward "\n \t")
2894 (buffer-substring (progn 2903 (not (bobp)))
2895 (skip-chars-backward "\n \t") 2904 (concat
2896 (beginning-of-line) 2905 (buffer-substring (progn
2897 (point)) 2906 (skip-chars-backward "\n \t")
2898 (progn (end-of-line) 2907 (beginning-of-line)
2899 (skip-chars-backward " \t") 2908 (point))
2900 (point))) 2909 (progn (end-of-line)
2901 ;; Replace the newline and other whitespace with `...'. 2910 (skip-chars-backward " \t")
2902 "..." 2911 (point)))
2903 (buffer-substring blinkpos (1+ blinkpos))) 2912 ;; Replace the newline and other whitespace with `...'.
2904 ;; There is nothing to show except the char itself. 2913 "..."
2905 (buffer-substring blinkpos (1+ blinkpos)))))))) 2914 (buffer-substring blinkpos (1+ blinkpos)))
2915 ;; There is nothing to show except the char itself.
2916 (buffer-substring blinkpos (1+ blinkpos)))))))))
2906 (cond (mismatch 2917 (cond (mismatch
2907 (message "Mismatched parentheses")) 2918 (display-message 'no-log "Mismatched parentheses"))
2908 ((not blink-matching-paren-distance) 2919 ((not blink-matching-paren-distance)
2909 (message "Unmatched parenthesis")))))))) 2920 (display-message 'no-log "Unmatched parenthesis"))))))))
2910 2921
2911 ;Turned off because it makes dbx bomb out. 2922 ;Turned off because it makes dbx bomb out.
2912 (setq blink-paren-function 'blink-matching-open) 2923 (setq blink-paren-function 'blink-matching-open)
2913 2924
2914 (eval-when-compile (defvar myhelp)) ; suppress compiler warning 2925 (eval-when-compile (defvar myhelp)) ; suppress compiler warning
3234 ;; 3245 ;;
3235 ;; So, I left only a few of the really useless ones on this kill-list. 3246 ;; So, I left only a few of the really useless ones on this kill-list.
3236 ;; 3247 ;;
3237 ;; --hniksic 3248 ;; --hniksic
3238 (defvar log-message-ignore-regexps 3249 (defvar log-message-ignore-regexps
3239 '(;; Often-seen messages 3250 '(;; Note: adding entries to this list slows down messaging
3251 ;; significantly. Wherever possible, use message lables.
3252
3253 ;; Often-seen messages
3240 "\\`\\'" ; empty message 3254 "\\`\\'" ; empty message
3241 ;;"^Mark set$" 3255 "\\`\\(Beginning\\|End\\) of buffer\\'"
3242 ;;"^\\(Beginning\\|End\\) of buffer$"
3243 ;;"^Quit$" 3256 ;;"^Quit$"
3244 ;;"^Killing [0-9]+ characters$"
3245 ;; saving
3246 ;;"^Saving file .*\\.\\.\\.$" ; note: cannot ignore ^Wrote, because
3247 ; it would kill off too much stuff.
3248 ;;"^(No changes need to be saved)$"
3249 ;;"^(No files need saving)$"
3250 ;; undo, with the output of redo.el
3251 "\\`Undo[!.]+\\'"
3252 "\\`Redo[!.]+\\'"
3253 ;; M-x compile
3254 ;;"^Parsing error messages\\.\\.\\."
3255 ;; M-!
3256 ;;"^(Shell command completed with no output)"
3257 ;; font-lock
3258 "\\`Fontifying"
3259 ;; isearch
3260 ;;"^\\(Failing \\)?\\([Ww]rapped \\)?\\([Rr]egexp \\)?I-search\\( backward\\)?:"
3261 ;;"^Mark saved where search started$"
3262 ;; menus
3263 ;;"^Selecting menu item"
3264 ;; completions 3257 ;; completions
3258 ;; Many packages print this -- impossible to categorize
3265 ;;"^Making completion list" 3259 ;;"^Making completion list"
3266 ;;"^Matches " ; paren-matching message
3267 ;; help
3268 ;;"^Type .* to \\(remove help\\|restore the other\\) window."
3269 ;; VM
3270 ;;"^\\(Parsing messages\\|Reading attributes\\|Generating summary\\|Building threads\\|Converting\\)\\.\\.\\. [0-9]+$"
3271 ;;"^End of message" ; + Gnus
3272 ;; Gnus 3260 ;; Gnus
3273 ;;"^No news is no news$" 3261 ;; "^No news is no news$"
3274 ;;"^No more\\( unread\\)? newsgroups$" 3262 ;; "^No more\\( unread\\)? newsgroups$"
3275 ;;"^Opening [^ ]+ server\\.\\.\\." 3263 ;; "^Opening [^ ]+ server\\.\\.\\."
3276 ;;"^[^:]+: Reading incoming mail" 3264 ;; "^[^:]+: Reading incoming mail"
3277 ;;"^Getting mail from " 3265 ;; "^Getting mail from "
3278 ;;"^\\(Generating Summary\\|Sorting threads\\|Making sparse threads\\|Scoring\\|Checking new news\\|Expiring articles\\|Sending\\)\\.\\.\\." 3266 ;; "^\\(Generating Summary\\|Sorting threads\\|Making sparse threads\\|Scoring\\|Checking new news\\|Expiring articles\\|Sending\\)\\.\\.\\."
3279 ;;"^\\(Fetching headers for\\|Retrieving newsgroup\\|Reading active file\\)" 3267 ;; "^\\(Fetching headers for\\|Retrieving newsgroup\\|Reading active file\\)"
3280 ;;"^No more\\( unread\\)? articles" 3268 ;; "^No more\\( unread\\)? articles"
3281 ;;"^Deleting article " 3269 ;; "^Deleting article "
3282 ;; W3 3270 ;; W3
3283 ;;"^Parsed [0-9]+ of [0-9]+ ([0-9]+%)" 3271 ;; "^Parsed [0-9]+ of [0-9]+ ([0-9]+%)"
3284 ;; outl-mouse
3285 ;;"^Adding glyphs\\.\\.\\."
3286 ;; bbdb
3287 ;;"^->"
3288 ) 3272 )
3289 "List of regular expressions matching messages which shouldn't be logged. 3273 "List of regular expressions matching messages which shouldn't be logged.
3290 See `log-message'. 3274 See `log-message'.
3291 3275
3292 Ideally, packages which generate messages which might need to be ignored 3276 Ideally, packages which generate messages which might need to be ignored