1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-25 10:47:00 +00:00

* simple.el (delete-trailing-whitespace): New interactive function.

* progmodes/ada-mode.el (ada-mode): Use it instead of
`ada-remove-trailing-spaces'
(ada-remove-trailing-spaces): Removed.
* textmodes/two-column.el (2C-merge): Recommend it in the doc.
* textmodes/picture.el (picture-mode-exit): Call it instead of
`picture-clean'.
(picture-clean): Removed.
This commit is contained in:
Sam Steingold 2000-11-22 20:59:39 +00:00
parent e053c60feb
commit eaae8106d7
5 changed files with 143 additions and 139 deletions

View File

@ -1,3 +1,14 @@
2000-11-22 Sam Steingold <sds@gnu.org>
* simple.el (delete-trailing-whitespace): New interactive function.
* progmodes/ada-mode.el (ada-mode): Use it instead of
`ada-remove-trailing-spaces'
(ada-remove-trailing-spaces): Removed.
* textmodes/two-column.el (2C-merge): Recommend it in the doc.
* textmodes/picture.el (picture-mode-exit): Call it instead of
`picture-clean'.
(picture-clean): Removed.
2000-11-22 Gerd Moellmann <gerd@gnu.org>
* frame.el (show-cursor-in-non-selected-windows): Doc fix.
@ -36,12 +47,12 @@
* recentf.el (recentf-menu-items-for-commands)
(recentf-make-menu-items, recentf-make-menu-item)
(recentf-filter-changer): Added :help and :active menu-item properties.
(recentf-build-dir-rules, recentf-dump-variable)
(recentf-edit-list, recentf-open-files-item)
(recentf-open-files): Replaced unnecessary `mapcar' with new
built-in `mapc'.
2000-11-23 Miles Bader <miles@gnu.org>
* faces.el (menu): Make inverse-video on ttys too.
@ -66,7 +77,7 @@
2000-11-22 Andre Spiegel <spiegel@gnu.org>
* ediff-util.el (ediff-file-checked-out-p)
(ediff-file-checked-in-p): Call vc-state instead of
(ediff-file-checked-in-p): Call vc-state instead of
vc-locking-user, which no longer exists.
* emulation/viper-util.el (viper-file-checked-in-p): Same as above.
@ -78,7 +89,7 @@
2000-11-22 Miles Bader <miles@gnu.org>
* textmodes/refill.el (refill-adjust-ignorable-overlay)
* textmodes/refill.el (refill-adjust-ignorable-overlay)
(refill-fill-paragraph-at): Remove debugging code.
* calendar/calendar.el (generate-calendar-window): When we don't
@ -176,18 +187,18 @@
* font-lock.el (java-keywords): Add MATCH-HIGHLIGHT part for
javadoc tags.
2000-11-20 Andre Spiegel <spiegel@gnu.org>
* vc.el, vc-hooks.el: Undo prev change (moved functions back to
vc.el).
* vc-rcs.el (vc-rcs-state): Before calling vc-workfile-unchanged-p,
* vc-rcs.el (vc-rcs-state): Before calling vc-workfile-unchanged-p,
require vc.
* vc-cvs.el (vc-cvs-checkout): Fix bug that broke C-x v ~-style
* vc-cvs.el (vc-cvs-checkout): Fix bug that broke C-x v ~-style
checkouts.
2000-11-20 Dave Love <fx@gnu.org>
* Makefile.in (DONTCOMPILE): Omit bindings.el.
@ -204,15 +215,15 @@
2000-11-19 Andre Spiegel <spiegel@gnu.org>
* vc-rcs.el (vc-rcs-state): Call vc-workfile-unchanged-p only here,
* vc-rcs.el (vc-rcs-state): Call vc-workfile-unchanged-p only here,
and differentiate according to checkout model.
(vc-rcs-fetch-master-state): Don't call vc-workfile-unchanged-p,
since this function is only concerned with master state.
* vc-hooks.el (vc-workfile-unchanged-p,
* vc-hooks.el (vc-workfile-unchanged-p,
vc-default-workfile-unchanged-p): Moved here from vc.el.
* vc.el (vc-workfile-unchanged-p,
* vc.el (vc-workfile-unchanged-p,
vc-default-workfile-unchanged-p): See above.
2000-11-19 Miles Bader <miles@gnu.org>
@ -223,12 +234,12 @@
2000-11-18 Gerd Moellmann <gerd@gnu.org>
* ps-print.el: Update copyright notice.
* tooltip.el (tooltip-x-offset, tooltip-y-offset): New user-options.
(tooltip-show): Use the offsets.
* bindings.el (mode-line-modified): Fix a typo.
(mode-line-toggle-modified, mode-line-widen)
(mode-line-toggle-modified, mode-line-widen)
(mode-line-abbrev-mode, mode-line-auto-fill-mode): Fix typos.
2000-11-17 Gerd Moellmann <gerd@gnu.org>
@ -255,24 +266,24 @@
(vc-default-check-headers): New function.
* vc-{cvs,rcs,sccs}.el: Functions reordered.
* vc.el (vc-revert-buffer): Ask for confirmation if file seems
* vc.el (vc-revert-buffer): Ask for confirmation if file seems
up-to-date.
(vc-do-command): In the asynchronous case, output messages only if
(vc-do-command): In the asynchronous case, output messages only if
the minibuffer is not active.
* vc-cvs.el (vc-cvs-revert): Use `cvs unedit' only if
* vc-cvs.el (vc-cvs-revert): Use `cvs unedit' only if
`vc-cvs-use-edit' is on.
(vc-cvs-checkout): When this is used for reverting the workfile,
make a backup of the original contents and revert to that in case
(vc-cvs-checkout): When this is used for reverting the workfile,
make a backup of the original contents and revert to that in case
of error.
(vc-cvs-print-log, vc-cvs-diff): Use asynchronous mode only for
(vc-cvs-print-log, vc-cvs-diff): Use asynchronous mode only for
remote repositories.
* vc.el (vc-annotate): Changed handling of prefix arg; now asks
for both version and ratio in the minibuffer.
* vc-cvs.el (vc-cvs-annotate-command): New optional arg VERSION.
* vc-cvs.el (vc-cvs-annotate-command): New optional arg VERSION.
Use vc-do-command to perform the annotation, not call-process.
2000-11-16 Kenichi Handa <handa@etl.go.jp>
@ -291,7 +302,7 @@
2000-11-16 Gerd Moellmann <gerd@gnu.org>
* net/ange-ftp.el (ange-ftp-file-writable-p)
* net/ange-ftp.el (ange-ftp-file-writable-p)
(ange-ftp-file-readable-p, ange-ftp-file-executable-p): Bind
ange-ftp-process-verbose to nil.
@ -445,7 +456,7 @@
available, using :enable to (de)activate them.
(gud-minor-mode-map): New map. Add it to minor-mode-map-alist.
(gud-mode-map): New map.
(gud-gdb-find-file, gud-sdb-find-file, gud-dbx-find-file)
(gud-gdb-find-file, gud-sdb-find-file, gud-dbx-find-file)
(gud-xdb-find-file, gud-perldb-find-file, gud-pdb-find-file):
Don't set up gud's menu (it's done by the minor-mode).
(gud-minibuffer-local-map): New.
@ -651,7 +662,7 @@
(texinfo-update-menu-higher-regexps, texinfo-update-menu-lower-regexps)
(texinfo-update-the-node, texinfo-sequentially-update-the-node)
(texinfo-update-menu-same-level-regexps): Update.
(texinfo-update-node, texinfo-every-node-update)
(texinfo-update-node, texinfo-every-node-update)
(texinfo-sequential-node-update): Remove autoload cookie.
* textmodes/texinfo.el (texinfo-section-list): Change majorheading.
@ -680,7 +691,7 @@
(make-mode-line-mouse2-map): Rewritten.
(mode-line-modified, mode-line-format, minor-mode-alist): Use new
functions so that C-h k can show something with a doc string.
* startup.el (fancy-splash-delay): Set to 10 seconds.
(fancy-splash-max-time): New user-option.
(fancy-splash-stop-time): New variable.
@ -785,20 +796,20 @@
* frame.el (after-setting-font-hook): Rename hooks -> hook.
(set-frame-font): Use the new name (and the old for compatibility).
* toolbar/tool-bar.el (tool-bar-mode):
* time.el (display-time-mode):
* recentf.el (recentf-mode):
* paren.el (show-paren-mode):
* mwheel.el (mouse-wheel-mode):
* msb.el (msb-mode):
* jka-compr.el (auto-compression-mode):
* image-file.el (auto-image-file-mode):
* hl-line.el (hl-line-mode):
* delsel.el (delete-selection-mode):
* autoinsert.el (auto-insert-mode):
* toolbar/tool-bar.el (tool-bar-mode):
* time.el (display-time-mode):
* recentf.el (recentf-mode):
* paren.el (show-paren-mode):
* mwheel.el (mouse-wheel-mode):
* msb.el (msb-mode):
* jka-compr.el (auto-compression-mode):
* image-file.el (auto-image-file-mode):
* hl-line.el (hl-line-mode):
* delsel.el (delete-selection-mode):
* autoinsert.el (auto-insert-mode):
* complete.el (partial-completion-mode): Drop unneeded positional args.
* info.el (Info-mode):
* info.el (Info-mode):
* comint.el (comint-mode): Don't both with make-local-hook.
* log-edit.el (log-edit-menu): New menu.
@ -839,7 +850,7 @@
2000-11-02 Miles Bader <miles@gnu.org>
* calendar/calendar.el (diary-face, calendar-today-face)
* calendar/calendar.el (diary-face, calendar-today-face)
(holiday-face): Remove dependency on `window-system'.
2000-11-02 Ken Raeburn <raeburn@gnu.org>

View File

@ -6,7 +6,7 @@
;; Markus Heritsch <Markus.Heritsch@studbox.uni-stuttgart.de>
;; Emmanuel Briot <briot@gnat.com>
;; Maintainer: Emmanuel Briot <briot@gnat.com>
;; Ada Core Technologies's version: $Revision: 1.34 $
;; Ada Core Technologies's version: $Revision: 1.35 $
;; Keywords: languages ada
;; This file is not part of GNU Emacs
@ -1179,7 +1179,7 @@ If you use ada-xref.el:
(if ada-clean-buffer-before-saving
(progn
;; remove all spaces at the end of lines in the whole buffer.
(add-hook 'local-write-file-hooks 'ada-remove-trailing-spaces)
(add-hook 'local-write-file-hooks 'delete-trailing-whitespace)
;; convert all tabs to the correct number of spaces.
(add-hook 'local-write-file-hooks
(lambda () (untabify (point-min) (point-max))))))
@ -1975,7 +1975,7 @@ offset."
(current-column))
tmp-indent (cdr cur-indent))
(setq prev-indent 0 tmp-indent '()))
(while (not (null tmp-indent))
(cond
((numberp (car tmp-indent))
@ -2025,11 +2025,11 @@ offset."
;;-----------------------------
;; in open parenthesis, but not in parameter-list
;;-----------------------------
((and ada-indent-to-open-paren
(not (ada-in-paramlist-p))
(setq column (ada-in-open-paren-p)))
;; check if we have something like this (Table_Component_Type =>
;; Source_File_Record)
(save-excursion
@ -2047,22 +2047,22 @@ offset."
((not (char-after))
(ada-indent-on-previous-lines nil orgpoint orgpoint))
;;---------------------------
;; starting with e
;;---------------------------
((= (char-after) ?e)
(cond
;; ------- end ------
((looking-at "end\\>")
(let ((label 0)
limit)
(save-excursion
(ada-goto-matching-start 1)
;;
;; found 'loop' => skip back to 'while' or 'for'
;; if 'loop' is not on a separate line
@ -2085,18 +2085,18 @@ offset."
(beginning-of-line)
(if (looking-at ada-named-block-re)
(setq label (- ada-label-indent))))))))
(list (+ (save-excursion (back-to-indentation) (point)) label) 0))))
;; ------ exception ----
((looking-at "exception\\>")
(save-excursion
(ada-goto-matching-start 1)
(list (save-excursion (back-to-indentation) (point)) 0)))
;; else
((looking-at "else\\>")
(if (save-excursion (ada-goto-previous-word)
(looking-at "\\<or\\>"))
@ -2106,7 +2106,7 @@ offset."
(list (progn (back-to-indentation) (point)) 0))))
;; elsif
((looking-at "elsif\\>")
(save-excursion
(ada-goto-matching-start 1 nil t)
@ -2117,7 +2117,7 @@ offset."
;;---------------------------
;; starting with w (when)
;;---------------------------
((and (= (char-after) ?w)
(looking-at "when\\>"))
(save-excursion
@ -2144,7 +2144,7 @@ offset."
;;---------------------------
;; starting with l (loop)
;;---------------------------
((and (= (char-after) ?l)
(looking-at "loop\\>"))
(setq pos (point))
@ -2177,7 +2177,7 @@ offset."
((and (= (char-after) ?i)
(looking-at "is\\>"))
(if (and ada-indent-is-separate
(save-excursion
(goto-char (match-end 0))
@ -2200,7 +2200,7 @@ offset."
(cond
;; ----- record ------
((looking-at "record\\>")
(save-excursion
(ada-search-ignore-string-comment
@ -2223,12 +2223,12 @@ offset."
(= (char-after (car pos)) ?r))
(goto-char (car pos)))
(setq var 'ada-indent-renames)))
(forward-comment -1000)
(if (= (char-before) ?\))
(forward-sexp -1)
(forward-word -1))
;; If there is a parameter list, and we have a function declaration
;; or a access to subprogram declaration
(let ((num-back 1))
@ -2241,13 +2241,13 @@ offset."
(backward-word 1)
(setq num-back 2)
(looking-at "function\\>")))))
;; The indentation depends of the value of ada-indent-return
(if (<= (eval var) 0)
(list (point) (list '- var))
(list (progn (backward-word num-back) (point))
var))
;; Else there is no parameter list, but we have a function
;; Only do something special if the user want to indent
;; relative to the "function" keyword
@ -2255,11 +2255,11 @@ offset."
(save-excursion (forward-word -1)
(looking-at "function\\>")))
(list (progn (forward-word -1) (point)) var)
;; Else...
(ada-indent-on-previous-lines nil orgpoint orgpoint)))))))
))
;;--------------------------------
;; starting with 'o' or 'p'
;; 'or' as statement-start
@ -2295,7 +2295,7 @@ offset."
;; We must use a search-forward (even if the code is more complex),
;; since we want to find the beginning of the comment.
(let (pos)
(if (and ada-indent-align-comments
(save-excursion
(forward-line -1)
@ -2309,7 +2309,7 @@ offset."
(setq pos (point))))
pos))
(list (- pos 2) 0)
;; Else always on previous line
(ada-indent-on-previous-lines nil orgpoint orgpoint)))
@ -2338,7 +2338,7 @@ offset."
;;---------------------------------
;; new/abstract/separate
;;---------------------------------
((looking-at "\\(new\\|abstract\\|separate\\)\\>")
(ada-indent-on-previous-lines nil orgpoint orgpoint))
@ -2355,20 +2355,20 @@ offset."
(while (and (not found)
(ada-search-ignore-string-comment
"\\<\\(generic\\|end\\|begin\\|package\\|procedure\\|function\\)\\>" t))
;; avoid "with procedure"... in generic parts
(save-excursion
(forward-word -1)
(setq found (not (looking-at "with"))))))
(if (looking-at "generic")
(list (progn (back-to-indentation) (point)) 0)
(ada-indent-on-previous-lines nil orgpoint orgpoint))))
;;---------------------------------
;; label
;;---------------------------------
((looking-at "\\(\\sw\\|_\\)+[ \t\n]*:[^=]")
(if (ada-in-decl-p)
(ada-indent-on-previous-lines nil orgpoint orgpoint)
@ -2979,7 +2979,7 @@ open parenthesis."
(setq match-dat (ada-search-prev-end-stmt))
(if match-dat
;;
;; found a previous end-statement => check if anything follows
;;
@ -3000,7 +3000,7 @@ open parenthesis."
(goto-char (cdr match-dat)))
(ada-goto-next-non-ws)
))
;;
;; no previous end-statement => we are at the beginning of the
;; accessible part of the buffer
@ -3248,7 +3248,7 @@ If NOERROR is non-nil, it only returns nil if no match was found."
(progn
(setq nest-count (1- nest-count))
(setq first nil)))))
;;
((looking-at "declare\\|generic")
(setq nest-count (1- nest-count))
@ -3639,7 +3639,7 @@ Returns nil if the private is part of the package name, as in
;; Make sure this is the start of a private section (ie after
;; a semicolon or just after the package declaration, but not
;; after a 'type ... is private' or 'is new ... with private'
(progn (forward-comment -1000)
(progn (forward-comment -1000)
(or (= (char-before) ?\;)
(and (forward-word -3)
(looking-at "\\<package\\>")))))))
@ -3775,17 +3775,6 @@ of the region. Otherwise, operates only on the current line."
;; -- Miscellaneous
;; ------------------------------------------------------------
(defun ada-remove-trailing-spaces ()
"Remove trailing spaces in the whole buffer."
(interactive)
(save-match-data
(save-excursion
(save-restriction
(widen)
(goto-char (point-min))
(while (re-search-forward "[ \t]+$" (point-max) t)
(replace-match "" nil nil))))))
(defun ada-gnat-style ()
"Clean up comments, `(' and `,' for GNAT style checking switch."
(interactive)
@ -4213,7 +4202,7 @@ The paragraph is indented on the first line."
(goto-char (+ from 2))
(while (re-search-forward "^-- *" to t)
(replace-match " "))
(goto-char (1- to))
(setq to (point-marker))
@ -4302,11 +4291,11 @@ otherwise."
(setq is-body t
name (match-string 1 name)))
(setq suffixes (cdr suffixes)))))
;; If this wasn't in either list, return name itself
(if (not (or is-spec is-body))
name
;; Else find the other possible names
(if is-spec
(setq suffixes ada-body-suffixes)

View File

@ -47,7 +47,7 @@
Other major modes are defined by comparison with this one."
(interactive)
(kill-all-local-variables))
;; Making and deleting lines.
(defun newline (&optional arg)
@ -132,7 +132,7 @@ In Auto Fill mode, if no numeric arg, break the preceding line if it's long."
(if (and (listp sticky) (not (memq 'hard sticky)))
(put-text-property from (point) 'rear-nonsticky
(cons 'hard sticky)))))
(defun open-line (arg)
"Insert a newline and leave point before it.
If there is a fill prefix and/or a left-margin, insert them on the new line
@ -184,7 +184,7 @@ With argument, join this line to following line."
(fixup-whitespace))))
(defalias 'join-line #'delete-indentation) ; easier to find
(defun delete-blank-lines ()
"On blank line, delete all surrounding blank lines, leaving just one.
On isolated blank line, delete that one.
@ -225,6 +225,17 @@ On nonblank line, delete any immediately following blank lines."
(if (looking-at "^[ \t]*\n\\'")
(delete-region (point) (point-max)))))
(defun delete-trailing-whitespace ()
"Delete all the trailing whitespace across the current buffer.
All whitespace after the last non-whitespace character in a line is deleted.
This respects narrowing, created by \\[narrow-to-region] and friends."
(interactive "*")
(save-match-data
(save-excursion
(goto-char (point-min))
(while (re-search-forward "\\s-+$" nil t)
(delete-region (match-beginning 0) (match-end 0))))))
(defun newline-and-indent ()
"Insert a newline, then indent according to major mode.
Indentation is done using the value of `indent-line-function'.
@ -249,7 +260,7 @@ column specified by the function `current-left-margin'."
(indent-according-to-mode))
(newline)
(indent-according-to-mode))
(defun quoted-insert (arg)
"Read next input character and insert it.
This is useful for inserting control characters.
@ -287,7 +298,7 @@ useful for editing binary files."
(while (> arg 0)
(insert-and-inherit char)
(setq arg (1- arg)))))
(defun forward-to-indentation (arg)
"Move forward ARG lines and position at first nonblank character."
(interactive "p")
@ -333,7 +344,7 @@ Leave one space or none, according to the context."
(insert ? ))
(delete-region (point) (progn (skip-chars-forward " \t") (point))))
(defun beginning-of-buffer (&optional arg)
"Move point to the beginning of the buffer; leave mark at previous position.
With arg N, put point N/10 of the way from the beginning.
@ -395,7 +406,7 @@ that uses or sets the mark."
(push-mark (point-max) nil t)
(goto-char (point-min)))
;; Counting lines, one way or another.
(defun goto-line (arg)
@ -455,7 +466,7 @@ and the greater of them is not at the start of a line."
(1+ done)
done)))
(- (buffer-size) (forward-line (buffer-size)))))))
(defun what-cursor-position (&optional detail)
"Print info on cursor position (on screen and within buffer).
Also describe the character after point, and give its character code
@ -520,7 +531,7 @@ in *Help* buffer. See also the command `describe-char-after'."
(single-key-description char)
(buffer-substring-no-properties (point) (1+ (point))))
encoding-msg pos total percent col hscroll))))))
(defvar read-expression-map
(let ((m (make-sparse-keymap)))
(define-key m "\M-\t" 'lisp-complete-symbol)
@ -560,7 +571,7 @@ Value is also consed on to front of the variable `values'."
nil read-expression-map t
'read-expression-history)
current-prefix-arg))
(if (null eval-expression-debug-on-error)
(setq values (cons (eval eval-expression-arg) values))
(let ((old-value (make-symbol "t")) new-value)
@ -573,7 +584,7 @@ Value is also consed on to front of the variable `values'."
;; propagate that change to the global binding.
(unless (eq old-value new-value)
(setq debug-on-error new-value))))
(let ((print-length eval-expression-print-length)
(print-level eval-expression-print-level))
(prin1 (car values)
@ -631,7 +642,7 @@ to get different commands to edit and resubmit."
(setq command-history (cons newcmd command-history)))
(eval newcmd))
(ding))))
(defvar minibuffer-history nil
"Default minibuffer history list.
This is used for all minibuffer input
@ -874,7 +885,7 @@ Return 0 if current buffer is not a mini-buffer."
Return 0 if current buffer is not a mini-buffer."
(field-beginning (point-max)))
;Put this on C-x u, so we can force that rather than C-_ into startup msg
(defalias 'advertised-undo 'undo)
@ -1096,7 +1107,7 @@ is not *inside* the region START...END."
(t
'(0 . 0)))
'(0 . 0)))
(defvar shell-command-history nil
"History list for some commands that read shell commands.")
@ -1227,7 +1238,7 @@ specifies the value of ERROR-BUFFER."
))
(shell-command-on-region (point) (point) command
output-buffer nil error-buffer)))))))
(defun display-message-or-buffer (message
&optional buffer-name not-this-window frame)
"Display MESSAGE in the echo area if possible, otherwise in a pop-up buffer.
@ -1456,7 +1467,7 @@ specifies the value of ERROR-BUFFER."
(with-current-buffer
standard-output
(call-process shell-file-name nil t nil shell-command-switch command))))
(defvar universal-argument-map
(let ((map (make-sparse-keymap)))
(define-key map [t] 'universal-argument-other-key)
@ -1572,7 +1583,7 @@ These commands include \\[set-mark-command] and \\[start-kbd-macro]."
unread-command-events)))
(reset-this-command-lengths)
(setq overriding-terminal-local-map nil))
;;;; Window system cut and paste hooks.
(defvar interprogram-cut-function nil
@ -1611,7 +1622,7 @@ current string, it is probably good enough to return nil if the string
is equal (according to `string=') to the last text Emacs provided.")
;;;; The kill ring data structure.
(defvar kill-ring nil
@ -1686,7 +1697,7 @@ yanking point; just return the Nth kill forward."
(car ARGth-kill-element)))))
;;;; Commands for manipulating the kill ring.
(defcustom kill-read-only-ok nil
@ -1804,7 +1815,7 @@ The argument is used for internal purposes; do not supply one."
(setq this-command 'kill-region)
(message "If the next command is a kill, it will append"))
(setq last-command 'kill-region)))
;; Yanking.
(defun yank-pop (arg)
@ -1875,7 +1886,7 @@ See also the command \\[yank-pop]."
With argument, rotate that many kills forward (or backward, if negative)."
(interactive "p")
(current-kill arg))
;; Some kill commands.
;; Internal subroutine of delete-char
@ -1938,7 +1949,7 @@ Goes backward if ARG is negative; error if CHAR not found."
(search-forward (char-to-string char) nil nil arg)
; (goto-char (if (> arg 0) (1- (point)) (1+ (point))))
(point))))
;; kill-line and its subroutines.
(defcustom kill-whole-line nil
@ -2048,7 +2059,7 @@ If ARG is zero, move to the beginning of the current line."
(goto-char (next-single-property-change (point) 'invisible))
(goto-char (next-overlay-change (point))))
(end-of-line)))
(defun insert-buffer (buffer)
"Insert after point the contents of BUFFER.
Puts mark after the inserted text.
@ -2130,7 +2141,7 @@ START and END specify the portion of the current buffer to be copied."
(erase-buffer)
(save-excursion
(insert-buffer-substring oldbuf start end)))))
(put 'mark-inactive 'error-conditions '(mark-inactive error))
(put 'mark-inactive 'error-message "The mark is not active now")
@ -2323,7 +2334,7 @@ incremental search, \\[beginning-of-buffer], and \\[end-of-buffer]."
(widen))
(goto-char position)
(switch-to-buffer buffer)))
(defcustom next-line-add-newlines t
"*If non-nil, `next-line' inserts newline to avoid `end of buffer' error."
:type 'boolean
@ -2387,7 +2398,7 @@ to use and more reliable (no dependence on goal column, etc.)."
((beginning-of-buffer end-of-buffer) (ding)))
(line-move (- arg)))
nil)
(defcustom track-eol nil
"*Non-nil means vertical motion starting at end of line keeps to ends of lines.
This means moving to the end of each line moved onto.
@ -2549,7 +2560,7 @@ The goal column is stored in the variable `goal-column'."
"Goal column %d (use \\[set-goal-column] with an arg to unset it)")
goal-column))
nil)
(defun scroll-other-window-down (lines)
"Scroll the \"other window\" down.
@ -2595,7 +2606,7 @@ With arg N, put point N/10 of the way from the true end."
(end-of-buffer arg)
(recenter '(t)))
(select-window orig-window))))
(defun transpose-chars (arg)
"Interchange characters around point, moving forward one character.
With prefix arg ARG, effect is to take character before point
@ -2702,7 +2713,7 @@ With argument 0, interchanges line point is in with line mark is in."
(+ transpose-subr-start1 (- len1 len2))))
(delete-region (point) (+ (point) len1))
(insert word2)))
(defun backward-word (arg)
"Move backward until encountering the end of a word.
With argument, do this that many times."
@ -2762,7 +2773,7 @@ or adjacent to a word."
(setq start (point)))
(buffer-substring-no-properties start end)))
(buffer-substring-no-properties start end)))))
(defcustom fill-prefix nil
"*String for filling to insert at front of new line, or nil for none.
Setting this variable automatically makes it local to the current buffer."
@ -2974,7 +2985,7 @@ Just \\[universal-argument] as argument means to use the current column."
(error "set-fill-column requires an explicit argument")
(message "Fill column set to %d (was %d)" arg fill-column)
(setq fill-column arg)))
(defun set-selective-display (arg)
"Set `selective-display' to ARG; clear it if no arg.
When the value of `selective-display' is a number > 0,
@ -3038,7 +3049,7 @@ specialization of overwrite-mode, entered by setting the
(> (prefix-numeric-value arg) 0))
'overwrite-mode-binary))
(force-mode-line-update))
(defcustom line-number-mode t
"*Non-nil means display line number in mode line."
:type 'boolean
@ -3251,7 +3262,7 @@ use either M-x customize or the function `set-input-mode'."
:version "21.1"
:link '(custom-manual "Single-Byte European Support")
:group 'keyboard)
(defcustom read-mail-command 'rmail
"*Your preference for a mail reading package.
This is used by some keybindings which support reading mail.
@ -3427,7 +3438,7 @@ Each action has the form (FUNCTION . ARGS)."
(list nil nil nil current-prefix-arg))
(compose-mail to subject other-headers continue
'switch-to-buffer-other-frame yank-action send-actions))
(defvar set-variable-value-history nil
"History of values entered with `set-variable'.")
@ -3471,7 +3482,7 @@ in the definition is used to check that VALUE is valid."
(error "Value `%S' does not match type %S of %S"
val (car type) var))))
(set var val))
;; Define the major mode for lists of completions.
(defvar completion-list-mode-map nil
@ -3713,7 +3724,7 @@ select the completion near point.\n\n")))))
(goto-char (point-min))
(search-forward "\n\n")
(forward-line 1))))
;; Support keyboard commands to turn on various modifiers.
;; These functions -- which are not commands -- each add one modifier
@ -3779,7 +3790,7 @@ PREFIX is the string that represents this modifier in an event type symbol."
(define-key function-key-map [?\C-x ?@ ?a] 'event-apply-alt-modifier)
(define-key function-key-map [?\C-x ?@ ?S] 'event-apply-shift-modifier)
(define-key function-key-map [?\C-x ?@ ?c] 'event-apply-control-modifier)
;;;; Keypad support.
;;; Make the keypad keys act like ordinary typing keys. If people add
@ -3944,7 +3955,7 @@ the front of the list of recently selected ones."
(define-key ctl-x-4-map "c" 'clone-indirect-buffer-other-window)
;;; Syntax stuff.
(defconst syntax-code-table
@ -3972,12 +3983,12 @@ corresponing syntax code as it is stored in a syntax cell, and
can be used as value of a `syntax-table' property.
DESCRIPTION is the descriptive string for the syntax.")
;;; Misc
(defun byte-compiling-files-p ()
"Return t if currently byte-compiling files."
(and (boundp 'byte-compile-current-file)
(stringp byte-compile-current-file)))
;;; simple.el ends here

View File

@ -24,7 +24,7 @@
;;; Commentary:
;; This code provides the picture-mode commands documented in the Emacs
;; This code provides the picture-mode commands documented in the Emacs
;; manual. The screen is treated as a semi-infinite quarter-plane with
;; support for rectangle operations and `etch-a-sketch' character
;; insertion in any of eight directions.
@ -735,7 +735,7 @@ With no argument strips whitespace from end of every line in Picture buffer
(interactive "P")
(if (not (eq major-mode 'picture-mode))
(error "You aren't editing a Picture.")
(if (not nostrip) (picture-clean))
(if (not nostrip) (delete-trailing-whitespace))
(setq mode-name picture-mode-old-mode-name)
(use-local-map picture-mode-old-local-map)
(setq major-mode picture-mode-old-major-mode)
@ -743,13 +743,6 @@ With no argument strips whitespace from end of every line in Picture buffer
(setq truncate-lines picture-mode-old-truncate-lines)
(force-mode-line-update)))
(defun picture-clean ()
"Eliminate whitespace at ends of lines."
(save-excursion
(goto-char (point-min))
(while (re-search-forward "[ \t][ \t]*$" nil t)
(delete-region (match-beginning 0) (point)))))
(provide 'picture)
;;; picture.el ends here

View File

@ -363,7 +363,7 @@ first and the associated buffer to its right."
(generate-new-buffer (concat "2C/" (buffer-name)))))
(or buffer
(run-hooks '2C-other-buffer-hook))))
(2C-mode (prog1 (point-marker)
(other-window -1)))))
@ -503,7 +503,7 @@ this one, then this one becomes the left column.
If you want `2C-separator' on empty lines in the second column,
you should put just one space in them. In the final result, you can strip
off trailing spaces with \\[beginning-of-buffer] \\[replace-regexp] [ SPC TAB ] + $ RET RET"
off trailing spaces with \\[delete-trailing-whitespace]."
(interactive)
(and (> (car (window-edges)) 0) ; not touching left edge of screen
(eq (window-buffer (previous-window))