comparison lisp/simple.el @ 265:8efd647ea9ca r20-5b31

Import from CVS: tag r20-5b31
author cvs
date Mon, 13 Aug 2007 10:25:37 +0200
parents 11cf20601dec
children 966663fcf606
comparison
equal deleted inserted replaced
264:682d2a9d41a5 265:8efd647ea9ca
1684 (widen)) 1684 (widen))
1685 (goto-char position) 1685 (goto-char position)
1686 (switch-to-buffer buffer))) 1686 (switch-to-buffer buffer)))
1687 1687
1688 1688
1689 (defcustom signal-error-on-buffer-boundary t
1690 "*Non-nil value causes XEmacs to beep or signal an error when certain interactive commands would move point past (point-min) or (point-max).
1691 The commands that honor this variable are
1692
1693 forward-char-command
1694 backward-char-command
1695 next-line
1696 previous-line
1697 scroll-up-command
1698 scroll-down-command"
1699 :type 'boolean
1700 :group 'editing-basics)
1701
1689 ;;; After 8 years of waiting ... -sb 1702 ;;; After 8 years of waiting ... -sb
1690 (defcustom next-line-add-newlines nil ; XEmacs 1703 (defcustom next-line-add-newlines nil ; XEmacs
1691 "*If non-nil, `next-line' inserts newline when the point is at end of buffer. 1704 "*If non-nil, `next-line' inserts newline when the point is at end of buffer.
1692 This behavior used to be the default, and is still default in FSF Emacs. 1705 This behavior used to be the default, and is still default in FSF Emacs.
1693 We think it is an unnecessary and unwanted side-effect." 1706 We think it is an unnecessary and unwanted side-effect."
1694 :type 'boolean 1707 :type 'boolean
1695 :group 'editing-basics) 1708 :group 'editing-basics)
1709
1710 (defun forward-char-command (&optional arg buffer)
1711 "Move point right ARG characters (left if ARG negative) in BUFFER.
1712 On attempt to pass end of buffer, stop and signal `end-of-buffer'.
1713 On attempt to pass beginning of buffer, stop and signal `beginning-of-buffer'.
1714 Error signaling is suppressed if `signal-error-on-buffer-boundary'
1715 is nil. If BUFFER is nil, the current buffer is assumed."
1716 (interactive "_p")
1717 (if signal-error-on-buffer-boundary
1718 (forward-char arg buffer)
1719 (condition-case nil
1720 (forward-char arg buffer)
1721 (beginning-of-buffer nil)
1722 (end-of-buffer nil))))
1723
1724 (defun backward-char-command (&optional arg buffer)
1725 "Move point left ARG characters (right if ARG negative) in BUFFER.
1726 On attempt to pass end of buffer, stop and signal `end-of-buffer'.
1727 On attempt to pass beginning of buffer, stop and signal `beginning-of-buffer'.
1728 Error signaling is suppressed if `signal-error-on-buffer-boundary'
1729 is nil. If BUFFER is nil, the current buffer is assumed."
1730 (interactive "_p")
1731 (if signal-error-on-buffer-boundary
1732 (backward-char arg buffer)
1733 (condition-case nil
1734 (backward-char arg buffer)
1735 (beginning-of-buffer nil)
1736 (end-of-buffer nil))))
1737
1738 (defun scroll-up-command (&optional n)
1739 "Scroll text of current window upward ARG lines; or near full screen if no ARG.
1740 A near full screen is `next-screen-context-lines' less than a full screen.
1741 Negative ARG means scroll downward.
1742 When calling from a program, supply a number as argument or nil.
1743 On attempt to scroll past end of buffer, `end-of-buffer' is signaled.
1744 On attempt to scroll past beginning of buffer, `beginning-of-buffer' is
1745 signaled.
1746
1747 If `signal-error-on-buffer-boundary' is nil, attempts to scroll past buffer
1748 boundaries do not cause an error to be signaled."
1749 (interactive "_P")
1750 (if signal-error-on-buffer-boundary
1751 (scroll-up n)
1752 (condition-case nil
1753 (scroll-up n)
1754 (beginning-of-buffer nil)
1755 (end-of-buffer nil))))
1756
1757 (defun scroll-down-command (&optional n)
1758 "Scroll text of current window downward ARG lines; or near full screen if no ARG.
1759 A near full screen is `next-screen-context-lines' less than a full screen.
1760 Negative ARG means scroll upward.
1761 When calling from a program, supply a number as argument or nil.
1762 On attempt to scroll past end of buffer, `end-of-buffer' is signaled.
1763 On attempt to scroll past beginning of buffer, `beginning-of-buffer' is
1764 signaled.
1765
1766 If `signal-error-on-buffer-boundary' is nil, attempts to scroll past buffer
1767 boundaries do not cause an error to be signaled."
1768 (interactive "_P")
1769 (if signal-error-on-buffer-boundary
1770 (scroll-down n)
1771 (condition-case nil
1772 (scroll-down n)
1773 (beginning-of-buffer nil)
1774 (end-of-buffer nil))))
1696 1775
1697 (defun next-line (arg) 1776 (defun next-line (arg)
1698 "Move cursor vertically down ARG lines. 1777 "Move cursor vertically down ARG lines.
1699 If there is no character in the target line exactly under the current column, 1778 If there is no character in the target line exactly under the current column,
1700 the cursor is positioned after the character in that line which spans this 1779 the cursor is positioned after the character in that line which spans this
2393 "*Mode-specific function which line breaks and continues a comment. 2472 "*Mode-specific function which line breaks and continues a comment.
2394 2473
2395 This function is only called during auto-filling of a comment section. 2474 This function is only called during auto-filling of a comment section.
2396 The function should take a single optional argument which is a flag 2475 The function should take a single optional argument which is a flag
2397 indicating whether soft newlines should be inserted.") 2476 indicating whether soft newlines should be inserted.")
2477
2478 ;; defined in mule-base/mule-category.el
2479 (defvar word-across-newline)
2398 2480
2399 ;; This function is the auto-fill-function of a buffer 2481 ;; This function is the auto-fill-function of a buffer
2400 ;; when Auto-Fill mode is enabled. 2482 ;; when Auto-Fill mode is enabled.
2401 ;; It returns t if it really did any work. 2483 ;; It returns t if it really did any work.
2402 ;; XEmacs: This function is totally different. 2484 ;; XEmacs: This function is totally different.