• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/

Lines Matching +defs:beginning +defs:of +defs:buffer

9 ;; This file is part of GNU Emacs.
12 ;; it under the terms of the GNU General Public License as published by
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;; You should have received a copy of the GNU General Public License
28 ;; A grab-bag of basic Emacs commands not specifically related to some
52 "Highlight (un)matching of parens and expressions."
55 (defun get-next-valid-buffer (list &optional buffer visible-ok frame)
56 "Search LIST for a valid buffer to display in FRAME.
58 otherwise return the first suitable buffer in LIST.
63 If BUFFER is non-nil, ignore occurrences of that buffer in LIST."
64 ;; This logic is more or less copied from other-buffer.
66 (let ((pred (frame-parameter frame 'buffer-predicate))
70 (if (and (not (eq buffer buf))
71 (buffer-live-p buf)
73 (not (eq (aref (buffer-name buf) 0) ?\s))
74 (or visible-ok (null (get-buffer-window buf 'visible))))
79 (defun last-buffer (&optional buffer visible-ok frame)
80 "Return the last non-hidden displayable buffer in the buffer list.
81 If BUFFER is non-nil, last-buffer will ignore that buffer.
85 buffer list instead of the selected frame's buffer list.
86 If no other buffer exists, the buffer `*scratch*' is returned."
88 (or (get-next-valid-buffer (frame-parameter frame 'buried-buffer-list)
89 buffer visible-ok frame)
90 (get-next-valid-buffer (nreverse (buffer-list frame))
91 buffer visible-ok frame)
93 (set-buffer-major-mode (get-buffer-create "*scratch*"))
94 (get-buffer "*scratch*"))))
96 (defun next-buffer ()
97 "Switch to the next buffer in cyclic order."
99 (let ((buffer (current-buffer))
100 (bbl (frame-parameter nil 'buried-buffer-list)))
101 (switch-to-buffer (other-buffer buffer t))
102 (bury-buffer buffer)
103 (set-frame-parameter nil 'buried-buffer-list
104 (cons buffer (delq buffer bbl)))))
106 (defun previous-buffer ()
107 "Switch to the previous buffer in cyclic order."
109 (let ((buffer (last-buffer (current-buffer) t))
110 (bbl (frame-parameter nil 'buried-buffer-list)))
111 (switch-to-buffer buffer)
112 ;; Clean up buried-buffer-list up to and including the chosen buffer.
113 (while (and bbl (not (eq (car bbl) buffer)))
115 (set-frame-parameter nil 'buried-buffer-list bbl)))
133 "*Highlighting of locations in selected source buffers.
138 If nil, don't highlight the locus in the source buffer.
148 "*Highlighting of locations in `next-error-no-select'.
151 If nil, don't highlight the locus in the source buffer.
161 "*List of hook functions run by `next-error' after visiting source file."
171 (defvar next-error-last-buffer nil
172 "The most recent `next-error' buffer.
173 A buffer becomes most recent when its compilation, grep, or
178 "Function to use to find the next error in the current buffer.
181 RESET is a boolean which, if non-nil, says to go back to the beginning
182 of the errors before moving.
184 to indicate to `next-error' that this is a candidate buffer and how
187 (make-variable-buffer-local 'next-error-function)
189 (defsubst next-error-buffer-p (buffer
193 "Test if BUFFER is a `next-error' capable buffer.
195 If AVOID-CURRENT is non-nil, treat the current buffer
198 The function EXTRA-TEST-INCLUSIVE, if non-nil, is called in each buffer
199 that normally would not qualify. If it returns t, the buffer
202 The function EXTRA-TEST-EXCLUSIVE, if non-nil, is called in each buffer
204 that buffer is rejected."
205 (and (buffer-name buffer) ;First make sure it's live.
206 (not (and avoid-current (eq buffer (current-buffer))))
207 (with-current-buffer buffer
217 (defun next-error-find-buffer (&optional avoid-current
220 "Return a `next-error' capable buffer.
222 If AVOID-CURRENT is non-nil, treat the current buffer
225 The function EXTRA-TEST-INCLUSIVE, if non-nil, is called in each buffer
226 that normally would not qualify. If it returns t, the buffer
229 The function EXTRA-TEST-EXCLUSIVE, if non-nil, is called in each buffer
231 that buffer is rejected."
233 ;; 1. If one window on the selected frame displays such buffer, return it.
237 (if (next-error-buffer-p
238 (window-buffer w)
241 (window-buffer w)))
245 ;; 2. If next-error-last-buffer is an acceptable buffer, use that.
246 (if (and next-error-last-buffer
247 (next-error-buffer-p next-error-last-buffer avoid-current
249 next-error-last-buffer)
250 ;; 3. If the current buffer is acceptable, choose it.
251 (if (next-error-buffer-p (current-buffer) avoid-current
253 (current-buffer))
254 ;; 4. Look for any acceptable buffer.
255 (let ((buffers (buffer-list)))
257 (not (next-error-buffer-p
262 ;; 5. Use the current buffer as a last resort if it qualifies,
265 (next-error-buffer-p (current-buffer) nil
268 (message "This is the only buffer with error message locations")
269 (current-buffer)))
277 the message buffer is checked for new ones.
281 Just \\[universal-argument] as a prefix means reparse the error message buffer
284 The RESET argument specifies that we should restart from the beginning.
287 compilation, grep, or occur buffer. It can also operate on any
288 buffer with output from the \\[compile], \\[grep] commands, or,
289 more generally, on any buffer in Compilation mode or with
290 Compilation Minor mode enabled, or any buffer in which
292 To specify use of a particular buffer for error messages, type
293 \\[next-error] in that buffer when it is the only one displayed
296 Once \\[next-error] has chosen the buffer for error messages, it
297 runs `next-error-hook' with `run-hooks', and stays with that buffer
298 until you use it in some other buffer which uses Compilation mode
305 (when (setq next-error-last-buffer (next-error-find-buffer))
307 (with-current-buffer next-error-last-buffer
313 (setq next-error-last-buffer (current-buffer))
315 (with-current-buffer next-error-last-buffer
335 With prefix arg N, visit the source code of the Nth error.
341 "Move point to the next error in the `next-error' buffer and highlight match.
345 select the source buffer."
349 (pop-to-buffer next-error-last-buffer))
352 "Move point to the previous error in the `next-error' buffer and highlight match.
356 select the source buffer."
366 buffer causes automatic display of the corresponding source code
402 "Insert a newline, and move to left margin of the new line if it's blank.
407 than the value of `fill-column' and ARG is nil."
409 (barf-if-buffer-read-only)
410 ;; Inserting a newline at the end of a line produces better redisplay in
411 ;; try_window_id than inserting at the beginning of a line, and the textual
412 ;; result is the same. So, if we're at beginning of line, pretend to be at
413 ;; the end of the previous line.
417 ;; the range of the changes.
421 (not (buffer-has-markers-at (1- (point))))
422 (not (buffer-has-markers-at (point)))
467 (beginning-of-line)
470 (delete-region (point) (progn (end-of-line) (point))))))
472 ;; when we added the newline at the beginning of a line
506 (end-of-line)))
525 (beginning-of-line)
534 If there is a fill prefix, delete it from the beginning of this line.
537 (beginning-of-line)
547 (buffer-substring (point)
561 (beginning-of-line)
573 (beginning-of-line)
583 (end-of-line)
587 (progn (beginning-of-line) (point))
595 "Delete all the trailing whitespace across the current buffer.
613 Indentation is done using the value of `indent-line-function'.
624 Indentation of both lines is done according to the current major mode,
625 which means calling the current value of `indent-line-function'.
645 you should type a sequence of octal digits which specify a character code.
649 set it to 10 or 16 to use decimal or hex instead of octal.
694 (beginning-of-line 1)
743 (defun beginning-of-buffer (&optional arg)
744 "Move point to the beginning of the buffer; leave mark at previous position.
746 With numeric arg N, put point N/10 of the way from the beginning.
748 If the buffer is narrowed, this command uses the beginning and size
749 of the accessible part of the buffer.
761 ;; Avoid overflow for large buffer sizes!
768 (defun end-of-buffer (&optional arg)
769 "Move point to the end of the buffer; leave mark at previous position.
771 With numeric arg N, put point N/10 of the way from the end.
773 If the buffer is narrowed, this command uses the beginning and size
774 of the accessible part of the buffer.
786 ;; Avoid overflow for large buffer sizes!
791 ;; If we went to a place in the middle of the buffer,
792 ;; adjust it to the beginning of a line.
795 ;; If the end of the buffer is not already on the screen,
800 (defun mark-whole-buffer ()
801 "Put point at beginning and mark at end of buffer.
814 (defun goto-line (arg &optional buffer)
815 "Goto line ARG, counting from line 1 at beginning of buffer.
816 Normally, move point in the current buffer.
818 displayed other buffer, and switch to it. When called from Lisp code,
819 the optional argument BUFFER specifies a buffer to switch to.
821 If there's a number in the buffer at point, it is the default for ARG."
825 ;; Look for a default, a number in the buffer at point.
830 (buffer-substring-no-properties
835 (buffer
837 (other-buffer (current-buffer) t)))
838 (buffer-prompt
839 (if buffer
840 (concat " in " (buffer-name buffer))
845 buffer-prompt
850 buffer))))
851 ;; Switch to the desired buffer, one way or another.
852 (if buffer
853 (let ((window (get-buffer-window buffer)))
855 (switch-to-buffer-other-window buffer))))
856 ;; Move to the specified line number in that buffer.
865 "Print number of lines and characters in the region."
871 "Print the current buffer line number and narrowed line number of point."
884 "Return number of lines between START and END.
885 This is usually the number of newlines between them,
887 and the greater of them is not at the start of a line."
904 (- (buffer-size) (forward-line (buffer-size)))))))
907 "Return (narrowed) buffer line number at position POS.
908 If POS is nil, use current buffer location.
910 to the contents of the accessible portion of the buffer."
920 "Print info on cursor position (on screen and within buffer).
925 buffer's selected coding system if the coding system encodes the
931 in *Help* buffer. See also the command `describe-char'."
937 (total (buffer-size))
948 (message "point=%d of %d (%d%%) <%d-%d> column=%d%s"
950 (message "point=%d of %d (EOB) column=%d%s"
952 (let ((coding buffer-file-coding-system)
956 (setq coding default-buffer-file-coding-system))
962 ;; buffer substring covered by that property.
972 (concat (buffer-substring-no-properties pos to)
978 (format "(%d, #o%o, #x%x, part of display \"%s\")"
980 (format "(%d, #o%o, #x%x, part of display \"%s\"->\"%s\")"
993 (message "Char: %s %s point=%d of %d (%d%%) <%d-%d> column=%d%s"
996 (buffer-substring-no-properties (point) (1+ (point))))
998 (message "Char: %s %s point=%d of %d (%d%%) column=%d%s"
1002 (buffer-substring-no-properties (point) (1+ (point))))
1020 A value of nil means no limit."
1027 A value of nil means no limit."
1034 If nil, don't change the value of `debug-on-error'."
1040 "Format VALUE as a result of evaluated expression.
1043 display the result of expression evaluation."
1057 ;; for the sake of completion of names like eval-region, eval-buffer.
1061 Value is also consed on to front of the variable `values'.
1063 insert the result into the current buffer instead of printing it in
1083 ;; If evaled code has changed the value of debug-on-error,
1092 (let ((standard-output (current-buffer)))
1112 ;; get rid of that. We want only evaluable expressions there.
1116 ;; If command to be redone does not match front of history,
1128 it is added to the front of the command history.
1146 ;; string, get rid of that. We want only
1151 ;; If command to be redone does not match front of history,
1157 (error "Argument %d is beyond length of command history" arg)
1167 If the value of this variable equals current minibuffer depth,
1170 recursive uses of the minibuffer.)")
1178 in this use of the minibuffer.")
1186 "A point-motion hook for the minibuffer, that moves point out of the prompt."
1191 If a history variable is a member of this list, then the
1193 commands ignore case when searching it, regardless of `case-fold-search'."
1257 (match-beginning 1))))
1297 "Puts next element of the minibuffer history in the minibuffer.
1310 (error "End of history; no next item")
1311 (error "End of history; no default available")))
1313 (error "Beginning of history; no preceding item"))
1341 "Puts previous element of the minibuffer history in the minibuffer.
1348 The contents of the minibuffer after the point are deleted, and replaced
1354 "^" (regexp-quote (buffer-substring (minibuffer-prompt-end) (point))))
1357 ;; Move to the position we were at before changing the buffer contents.
1364 The contents of the minibuffer after the point are deleted, and replaced
1369 ;; For compatibility with the old subr of the same name.
1371 "Return the display width of the minibuffer prompt.
1372 Return 0 if current buffer is not a minibuffer."
1373 ;; Return the width of everything before the field at the end of
1374 ;; the buffer; this should be 0 for normal buffers.
1387 "Non-nil if `pending-undo-list' is not just a tail of `buffer-undo-list'.")
1393 "Within a run of consecutive undo commands, list remaining to be undone.
1394 If t, we undid all the way to the end of it.")
1407 ;; If we get to the end of the undo history and get an error,
1411 (let ((modified (buffer-modified-p))
1421 ;; If something (a timer or filter?) changed the buffer
1423 (let ((list buffer-undo-list))
1432 (undo-start (region-beginning) (region-end))
1434 ;; get rid of initial undo boundary
1460 (puthash buffer-undo-list
1465 (let ((tail buffer-undo-list)
1472 (setq buffer-undo-list (cdr tail)))
1478 (setq buffer-undo-list (cdr tail)))
1484 ;; so the next command can tell if the buffer was modified in between.
1485 (and modified (not (buffer-modified-p))
1491 (defun buffer-disable-undo (&optional buffer)
1493 No argument or nil as argument means do this for the current buffer."
1495 (with-current-buffer (if buffer (get-buffer buffer) (current-buffer))
1496 (setq buffer-undo-list t)))
1522 ;; Deep copy of a list
1524 "Make a copy of undo list LIST."
1533 "Set `pending-undo-list' to the front of the undo list.
1538 (if (eq buffer-undo-list t)
1539 (error "No undo information in this buffer"))
1543 buffer-undo-list)))
1548 "Return a list of undo elements for the region START to END.
1549 The elements come from `buffer-undo-list', but we keep only
1551 If we find an element that crosses an edge of this region,
1553 (let ((undo-list-copy (undo-copy-list buffer-undo-list))
1584 ;; Loop down the earlier events adjusting their buffer
1585 ;; positions to reflect the fact that a change to the buffer
1656 "Test whether UNDO-ELT crosses one edge of that region START ... END.
1670 ;; Return the first affected buffer position and the delta for an undo element
1671 ;; delta is defined as the change in subsequent buffer positions if we *did*
1703 "If non-nil, an extra level of size that's ok in an undo item.
1708 (make-variable-buffer-local 'undo-extra-outer-limit)
1714 ;; lot of consing.
1722 ;; Such a quit quits out of GC, but something else will call GC
1728 (buffer-name) size)))
1729 (progn (setq buffer-undo-list nil)
1736 (buffer-name) size)
1741 to the buffer. In that case, to prevent similar problems in the
1743 cover the maximum size of normal changes you expect a single
1750 You can disable the popping up of this buffer by adding the entry
1753 (setq buffer-undo-list nil)
1763 (defvar shell-command-default-error-buffer nil
1765 This buffer is used when `shell-command' or `shell-command-on-region'
1766 is run interactively. A value of nil means that output to stderr and
1769 (defun shell-command (command &optional output-buffer error-buffer)
1774 The output appears in the buffer `*Async Shell Command*'.
1775 That buffer is in shell mode.
1778 the buffer `*Shell Command Output*'. If the output is short enough to
1781 there, but it is nonetheless available in buffer `*Shell Command
1782 Output*' even though that buffer is not automatically displayed.
1792 says to put the output in some other buffer.
1793 If OUTPUT-BUFFER is a buffer or buffer name, put the output there.
1794 If OUTPUT-BUFFER is not a buffer and not nil,
1795 insert output in current buffer. (This cannot be done asynchronously.)
1799 and you did not specify \"insert it in the current buffer\",
1800 the output can be displayed in the echo area or in its buffer.
1804 the buffer containing the output is displayed.
1807 in the current buffer\", a message about the error goes at the end
1808 of the output.
1810 If there is no output, or if output is inserted in the current buffer,
1813 If the optional third argument ERROR-BUFFER is non-nil, it is a buffer
1814 or buffer name to which to direct the command's standard error output.
1816 In an interactive call, the variable `shell-command-default-error-buffer'
1817 specifies the value of ERROR-BUFFER."
1822 shell-command-default-error-buffer))
1828 (funcall handler 'shell-command command output-buffer error-buffer)
1829 (if (and output-buffer
1830 (not (or (bufferp output-buffer) (stringp output-buffer))))
1831 ;; Output goes in current buffer.
1833 (if error-buffer
1839 (barf-if-buffer-read-only)
1841 ;; We do not use -f for csh; we will not support broken use of
1853 (with-current-buffer (get-buffer-create error-buffer)
1863 (display-buffer (current-buffer))))
1871 (current-buffer)))))
1872 ;; Output goes in a separate buffer.
1877 (let ((buffer (get-buffer-create
1878 (or output-buffer "*Async Shell Command*")))
1882 (setq command (substring command 0 (match-beginning 0)))
1884 (setq proc (get-buffer-process buffer))
1889 (with-current-buffer buffer
1890 (setq buffer-read-only nil)
1891 (erase-buffer)
1892 (display-buffer buffer)
1894 (setq proc (start-process "Shell" buffer shell-file-name
1901 output-buffer nil error-buffer)))))))
1903 (defun display-message-or-buffer (message
1904 &optional buffer-name not-this-window frame)
1905 "Display MESSAGE in the echo area if possible, otherwise in a pop-up buffer.
1906 MESSAGE may be either a string or a buffer.
1908 A buffer is displayed using `display-buffer' if MESSAGE is too long for
1909 the maximum height of the echo area, as defined by `max-mini-window-height'
1913 buffer is used, the window used to display it.
1916 name of the buffer used to display it in the case where a pop-up buffer
1919 the contents are inserted into the buffer anyway.
1921 Optional arguments NOT-THIS-WINDOW and FRAME are as for `display-buffer',
1922 and only used if a buffer is displayed."
1932 (with-current-buffer
1935 (get-buffer-create (or buffer-name "*Message*")))
1938 (erase-buffer)
1942 (if (= (buffer-size) 0)
1957 ;; Don't use the echo area if the output buffer is
1959 (not (get-buffer-window (current-buffer))))
1964 (message "%s" (buffer-substring (point-min) (point))))
1968 (display-buffer (current-buffer)
1972 ;; We have a sentinel to prevent insertion of a termination message
1973 ;; in the buffer itself.
1981 &optional output-buffer replace
1982 error-buffer display-error-buffer)
1984 Normally display output (if any) in temp buffer `*Shell Command Output*';
1985 Prefix arg means replace the region with it. Return the exit code of
1990 before this command. By default, the input (from the current buffer)
1992 `buffer-file-coding-system'. If the output is going to replace the region,
2001 in the echo area or in a buffer.
2005 it is displayed in the buffer `*Shell Command Output*'. The output
2006 is available in that buffer in both cases.
2009 appears at the end of the output.
2011 If there is no output, or if output is inserted in the current buffer,
2015 that says to put the output in some other buffer.
2016 If OUTPUT-BUFFER is a buffer or buffer name, put the output there.
2017 If OUTPUT-BUFFER is not a buffer and not nil,
2018 insert output in the current buffer.
2022 the output in place of text from START to END, putting point and mark
2025 If optional sixth argument ERROR-BUFFER is non-nil, it is a buffer
2026 or buffer name to which to direct the command's standard error output.
2028 If DISPLAY-ERROR-BUFFER is non-nil, display the error buffer if there
2030 In an interactive call, the variable `shell-command-default-error-buffer'
2031 specifies the value of ERROR-BUFFER."
2035 ;; Do this before calling region-beginning
2041 ;; call-interactively recognizes region-beginning and
2043 (list (region-beginning) (region-end)
2047 shell-command-default-error-buffer
2050 (if error-buffer
2058 (and output-buffer
2059 (not (or (bufferp output-buffer) (stringp output-buffer)))))
2071 ;; It is rude to delete a buffer which the command is not using.
2072 ;; (let ((shell-buffer (get-buffer "*Shell Command Output*")))
2073 ;; (and shell-buffer (not (eq shell-buffer (current-buffer)))
2074 ;; (kill-buffer shell-buffer)))
2077 ;; No prefix argument: put the output in a temp buffer,
2079 (let ((buffer (get-buffer-create
2080 (or output-buffer "*Shell Command Output*"))))
2082 (if (eq buffer (current-buffer))
2083 ;; If the input is the same buffer as the output,
2086 (progn (setq buffer-read-only nil)
2097 ;; Clear the output buffer, then run the command with
2101 (set-buffer buffer)
2102 (setq buffer-read-only nil)
2103 (if (not output-buffer)
2105 (erase-buffer)))
2109 (list buffer error-file)
2110 buffer)
2113 (with-current-buffer buffer
2121 (if (with-current-buffer buffer (> (point-max) (point-min)))
2123 (display-message-or-buffer buffer)
2142 ;; (kill-buffer buffer)
2147 (with-current-buffer (get-buffer-create error-buffer)
2157 (and display-error-buffer
2158 (display-buffer (current-buffer)))))
2165 (with-current-buffer
2169 (defun process-file (program &optional infile buffer display &rest args)
2172 `default-directory'. The current working directory of the
2182 they might behave as if DISPLAY was nil, regardless of the actual
2187 (if fh (apply fh 'process-file program infile buffer display args)
2189 (setq stderr-file (when (and (consp buffer) (stringp (cadr buffer)))
2194 (if stderr-file (list (car buffer) stderr-file) buffer)
2196 (when stderr-file (copy-file stderr-file (cadr buffer)))))
2235 "Number of argument-specifying events read by `universal-argument'.
2243 "The saved value of `overriding-terminal-local-map'.
2300 "Part of the numeric argument for the next command.
2340 (defvar buffer-substring-filters nil
2341 "List of filter functions for `filter-buffer-substring'.
2343 a string. The buffer substring is passed to the first function
2344 in the list, and the return value of each function is passed to
2345 the next. The return value of the last function is used as the
2346 return value of `filter-buffer-substring'.
2350 (defun filter-buffer-substring (beg end &optional delete noprops)
2351 "Return the buffer substring between BEG and END, after filtering.
2352 The buffer substring is passed through each of the filter
2353 functions in `buffer-substring-filters', and the value from the
2354 last filter function is returned. If `buffer-substring-filters'
2355 is nil, the buffer substring is returned unaltered.
2358 from the buffer.
2362 includes text properties from the buffer text.
2365 `buffer-substring-filters', in case the functions need to know
2368 This function should be used instead of `buffer-substring',
2369 `buffer-substring-no-properties', or `delete-and-extract-region'
2371 major or minor modes can use `buffer-substring-filters' to
2372 extract characters that are special to a buffer, and should not
2375 ((or delete buffer-substring-filters)
2379 (buffer-substring beg end))))
2380 (dolist (filter buffer-substring-filters)
2386 (buffer-substring-no-properties beg end))
2388 (buffer-substring beg end))))
2396 Most window systems provide some sort of facility for cutting and
2397 pasting text between the windows of different programs.
2406 similar argument to `x-set-cut-buffer', which see.")
2411 Most window systems provide some sort of facility for cutting and
2412 pasting text between the windows of different programs.
2418 of the Emacs kill ring should be used. If the function returns a
2419 string, then the caller of the function \(usually `current-kill')
2435 "List of killed text sequences.
2437 facilities offered by window systems, use of this variable should
2441 interaction; you may want to use them instead of manipulating the kill
2445 "*Maximum length of kill ring before oldest elements are thrown away."
2450 "The tail of the kill ring whose car is the last thing yanked.")
2457 the front of the kill ring, rather than being added to the list.
2460 inserted into a buffer; see `insert-for-yank' for details.
2473 (signal 'args-out-of-range
2487 "Append STRING to the end of the latest kill in the kill ring.
2492 yank-handler property of the latest kill string, this function
2494 instead of replacing the last kill with it.
2505 returns a string, then that string is added to the front of the
2539 '(text-read-only buffer-read-only error))
2544 This deletes the text from the buffer and saves it in the kill ring.
2551 If the buffer is read-only, Emacs will beep and refrain from deleting
2553 you can use the killing commands to copy text from a read-only buffer.
2556 Supply two arguments, character positions indicating the stretch of text
2572 (let ((string (filter-buffer-substring beg end t)))
2581 ((buffer-read-only text-read-only)
2582 ;; The code above failed because the buffer, or some of the characters
2584 ;; We should beep, in case the user just isn't aware of this.
2593 ;; Signal an error if the buffer is read-only.
2594 (barf-if-buffer-read-only)
2595 ;; If the buffer isn't read-only, the text is.
2596 (signal 'text-read-only (list (current-buffer)))))))
2599 ;; to get two copies of the text when the user accidentally types M-w and
2608 (kill-append (filter-buffer-substring beg end) (< end beg))
2609 (kill-new (filter-buffer-substring beg end)))
2624 visual feedback indicating the extent of the region being copied."
2627 ;; This use of interactive-p is correct
2639 (set-marker (mark-marker) (point) (current-buffer))
2643 (set-marker (mark-marker) other-end (current-buffer))
2677 The value should be a list of text properties to discard or t,
2685 "If non-nil, function used by `yank-pop' to delete last stretch of yanked text.
2687 the value of the mark and point; it is guaranteed that START <= END.
2688 Normally set from the UNDO element of a yank-handler; see `insert-for-yank'.")
2691 "Replace just-yanked stretch of killed text with a different stretch.
2693 At such a time, the region contains a stretch of reinserted
2695 place a different stretch of killed text.
2701 The sequence of kills wraps around, so that after the oldest one
2704 When this command inserts killed text into the buffer, it honors
2718 (set-marker (mark-marker) (point) (current-buffer))
2728 (set-marker (mark-marker) (point) (current-buffer))))))
2732 "Reinsert (\"paste\") the last stretch of killed text.
2733 More precisely, reinsert the stretch of killed text most recently
2734 killed OR yanked. Put point at end, and set mark at beginning.
2735 With just \\[universal-argument] as argument, same but put point at beginning (and mark at end).
2736 With argument N, reinsert the Nth most recently killed stretch of killed
2739 When this command inserts killed text into the buffer, it honors
2759 (set-marker (mark-marker) (point) (current-buffer)))))
2774 ;; Internal subroutine of delete-char
2780 ;; Internal subroutine of backward-delete-char
2827 "Kill up to and including ARG'th occurrence of CHAR.
2828 Case is ignored if `case-fold-search' is non-nil in the current buffer.
2841 "*If non-nil, `kill-line' with no arg at beg of line kills the whole line."
2846 "Kill the rest of the current line; if no nonblanks there, kill thru newline.
2854 To kill a whole line, when point is not at the beginning, type \
2855 \\[move-beginning-of-line] \\[kill-line] \\[kill-line].
2858 including its terminating newline, when used at the beginning of a line
2860 by typing \\[move-beginning-of-line] \\[kill-line].
2865 If the buffer is read-only, Emacs will beep and refrain from deleting
2867 you can use this command to copy text from a read-only buffer.
2872 ;; It is better to move point to the other end of the kill
2873 ;; before killing. That way, in a read-only buffer, point
2876 ;; the value of point from before the command was run.
2881 (signal 'end-of-buffer nil))
2884 (end-of-visible-line) (point))))
2904 (signal 'end-of-buffer nil))
2905 (if (and (< arg 0) (bobp) (save-excursion (end-of-visible-line) (bobp)))
2906 (signal 'beginning-of-buffer nil))
2919 (kill-region (point) (progn (end-of-visible-line) (point))))
2922 (kill-region (point) (progn (end-of-visible-line) (point))))
2936 If ARG is zero, move to the beginning of the current line."
2942 (signal 'end-of-buffer nil))
2947 (if (if (eq buffer-invisibility-spec t)
2949 (or (memq prop buffer-invisibility-spec)
2950 (assq prop buffer-invisibility-spec)))
2953 ;; If invisible text follows, and it is a number of complete lines,
2959 (if (eq buffer-invisibility-spec t)
2961 (or (memq prop buffer-invisibility-spec)
2962 (assq prop buffer-invisibility-spec)))))
2973 (beginning-of-line)
2975 (signal 'beginning-of-buffer nil)))
2981 (unless (if (eq buffer-invisibility-spec t)
2983 (or (memq prop buffer-invisibility-spec)
2984 (assq prop buffer-invisibility-spec)))
2987 ;; If invisible text follows, and it is a number of complete lines,
2993 (if (eq buffer-invisibility-spec t)
2995 (or (memq prop buffer-invisibility-spec)
2996 (assq prop buffer-invisibility-spec)))))
3004 ((beginning-of-buffer end-of-buffer)
3007 (defun end-of-visible-line ()
3008 "Move to end of current visible line."
3009 (end-of-line)
3018 (if (eq buffer-invisibility-spec t)
3020 (or (memq prop buffer-invisibility-spec)
3021 (assq prop buffer-invisibility-spec))))))
3026 (end-of-line)))
3029 (defun insert-buffer (buffer)
3030 "Insert after point the contents of BUFFER.
3032 BUFFER may be a buffer or a buffer name.
3035 Don't call it from programs: use `insert-buffer-substring' instead!"
3039 (barf-if-buffer-read-only)
3040 (read-buffer "Insert buffer: "
3042 (other-buffer (current-buffer))
3043 (window-buffer (next-window (selected-window))))
3047 (insert-buffer-substring (get-buffer buffer))
3051 (defun append-to-buffer (buffer start end)
3052 "Append to specified buffer the text of the region.
3053 It is inserted into that buffer before its point.
3056 BUFFER (or buffer name), START and END.
3057 START and END specify the portion of the current buffer to be copied."
3059 (list (read-buffer "Append to buffer: " (other-buffer (current-buffer) t))
3060 (region-beginning) (region-end)))
3061 (let ((oldbuf (current-buffer)))
3063 (let* ((append-to (get-buffer-create buffer))
3064 (windows (get-buffer-window-list append-to t t))
3066 (set-buffer append-to)
3068 (barf-if-buffer-read-only)
3069 (insert-buffer-substring oldbuf start end)
3074 (defun prepend-to-buffer (buffer start end)
3075 "Prepend to specified buffer the text of the region.
3076 It is inserted into that buffer after its point.
3079 BUFFER (or buffer name), START and END.
3080 START and END specify the portion of the current buffer to be copied."
3081 (interactive "BPrepend to buffer: \nr")
3082 (let ((oldbuf (current-buffer)))
3084 (set-buffer (get-buffer-create buffer))
3085 (barf-if-buffer-read-only)
3087 (insert-buffer-substring oldbuf start end)))))
3089 (defun copy-to-buffer (buffer start end)
3090 "Copy to specified buffer the text of the region.
3091 It is inserted into that buffer, replacing existing text there.
3094 BUFFER (or buffer name), START and END.
3095 START and END specify the portion of the current buffer to be copied."
3096 (interactive "BCopy to buffer: \nr")
3097 (let ((oldbuf (current-buffer)))
3098 (with-current-buffer (get-buffer-create buffer)
3099 (barf-if-buffer-read-only)
3100 (erase-buffer)
3102 (insert-buffer-substring oldbuf start end)))))
3110 It is also run at the end of a command, if the mark is active and
3117 "Return this buffer's mark value as integer, or nil if never set.
3125 a mistake; see the documentation of `set-mark'."
3130 ;; Many places set mark-active directly, and several of them failed to also
3144 "Set this buffer's mark to POS. Don't use this function!
3164 (set-marker (mark-marker) pos (current-buffer)))
3173 "The list of former marks of the current buffer, most recent first.")
3174 (make-variable-buffer-local 'mark-ring)
3178 "*Maximum size of mark ring. Start discarding off end if gets this big."
3183 "The list of saved global marks, most recent first.")
3186 "*Maximum size of global mark ring. \
3196 (error "No mark set in this buffer")
3222 A value of nil means \\[set-mark-command]'s behavior does not change
3235 global mark ring, if the previous mark was set in another buffer.
3254 purposes. See the documentation of `set-mark' for more information."
3286 If the last global mark pushed was not in the current buffer,
3291 purposes. See the documentation of `set-mark' for more information.
3299 (set-marker (mark-marker) (or location (point)) (current-buffer))
3302 (eq (marker-buffer (car global-mark-ring)) (current-buffer)))
3303 ;; The last global mark pushed was in this same buffer.
3317 "Pop off mark ring into the buffer's actual mark.
3321 (set-marker (mark-marker) (+ 0 (car mark-ring)) (current-buffer))
3342 (error "No mark set in this buffer"))
3352 Changing the buffer \"deactivates\" the mark.
3355 incremental search, \\[beginning-of-buffer], and \\[end-of-buffer].
3361 and the mark is active, by acting on the region instead of their usual
3362 default part of the buffer's text. Examples of such commands include
3366 \"mark.*active\" at the prompt, to see the documentation of
3373 the current accessible part of the buffer.
3376 as a fallback, and won't change the buffer bounds.")
3382 (while (and global-mark-ring (not (marker-buffer (car global-mark-ring))))
3387 (buffer (marker-buffer marker))
3391 (set-buffer buffer)
3396 (error "Global mark position is outside accessible part of buffer")))
3398 (switch-to-buffer buffer)))
3402 "*If non-nil, `next-line' inserts newline to avoid `end of buffer' error."
3412 column, or at the end of the line if it is not long enough.
3413 If there is no line in the buffer after this one, behavior depends on the
3414 value of `next-line-add-newlines'. If non-nil, it inserts a newline character
3416 cursor to the end of the buffer.
3420 Then instead of trying to move exactly vertically (or as close as possible),
3425 If you are thinking of using this in a Lisp program, consider
3431 (if (save-excursion (end-of-line) (eobp))
3434 (end-of-line)
3440 ((beginning-of-buffer end-of-buffer) (ding)))
3449 column, or at the end of the line if it is not long enough.
3453 Then instead of trying to move exactly vertically (or as close as possible),
3458 If you are thinking of using this in a Lisp program, consider using
3466 ((beginning-of-buffer end-of-buffer) (ding)))
3471 "*Non-nil means vertical motion starting at end of line keeps to ends of lines.
3472 This means moving to the end of each line moved onto.
3473 The beginning of a blank line does not count as the end of a line."
3482 (make-variable-buffer-local 'goal-column)
3487 at the start of current run of vertical motion commands.
3500 (if (eq buffer-invisibility-spec t)
3502 (or (memq prop buffer-invisibility-spec)
3503 (assq prop buffer-invisibility-spec)))))
3528 ;; If last line of window is fully visible, move forward.
3541 ;; or clear vscroll and move forward at end of tall image.
3563 ;; vertical scrolling of tall images if appropriate.
3566 ;; a cleaner solution to the problem of making C-n do something
3579 ;; This is the guts of next-line and previous-line.
3581 ;; The value is t if we can move the specified number of lines.
3593 ;; Don't count beg of empty line as end of line
3594 ;; unless we just did explicit end-of-line.
3595 (or (not (bolp)) (eq last-command 'move-end-of-line)))
3605 ;; This way of moving forward ARG lines
3608 (end-of-line)
3616 'beginning-of-buffer
3617 'end-of-buffer)
3627 ;; We don't use `end-of-line', since we want to escape
3638 (signal 'end-of-buffer nil)
3649 (signal 'end-of-buffer nil)
3653 ;; The logic of this is the same as the loop above,
3657 ;; case, we should call beginning-of-line here.
3667 (signal 'beginning-of-buffer nil)
3675 (signal 'beginning-of-buffer nil)
3680 ;; if our target is the middle of this line.
3690 ;; at least go to end of line.
3691 (end-of-line))
3694 ;; at least go to beginning of line.
3695 (beginning-of-line))
3708 (line-beg (save-excursion (beginning-of-line) (point)))
3710 ;; Compute the end of the line
3713 ;; Like end-of-line but ignores fields.
3724 ;; the middle of a continued line. When we get to
3725 ;; line-move-finish, point is at the start of a new *screen*
3764 ;; As a last resort, use the end of the line.
3794 (beginning-of-line)
3814 ;; but with a more reasonable buffer position.
3816 (let ((line-beg (save-excursion (beginning-of-line) (point))))
3820 (defun move-end-of-line (arg)
3821 "Move point to end of current line as displayed.
3823 which are part of the text that the image rests on.)
3826 If point reaches the beginning or end of buffer, it stops there.
3854 (defun move-beginning-of-line (arg)
3855 "Move point to beginning of current line as displayed.
3857 which are part of the text that the image rests on.)
3860 If point reaches the beginning or end of buffer, it stops there.
3872 ;; Move to beginning-of-line, ignoring fields and invisibles.
3941 (defun beginning-of-buffer-other-window (arg)
3942 "Move point to the beginning of the buffer in the other window.
3944 With arg N, put point N/10 of the way from the true beginning."
3953 ;; Set point and mark in that window's buffer.
3955 (beginning-of-buffer arg))
3960 (defun end-of-buffer-other-window (arg)
3961 "Move point to the end of the buffer in the other window.
3963 With arg N, put point N/10 of the way from the true end."
3965 ;; See beginning-of-buffer-other-window for comments.
3972 (end-of-buffer arg))
3981 If no argument and at end of line, the previous two chars are exchanged."
3987 "Interchange words around point, leaving point at end of them.
3998 Does not work on a sexp that point is in the middle of
4003 ;; Here we should try to simulate the behavior of
4084 ;; FIXME: We first delete the two pieces of text, so markers that
4094 "Move backward until encountering the beginning of a word.
4125 "Kill characters forward until encountering the end of a word.
4131 "Kill characters backward until encountering the beginning of a word.
4156 (save-excursion (beginning-of-line)
4163 (save-excursion (end-of-line)
4173 (buffer-substring-no-properties start end)))))
4177 "*String for filling to insert at front of new line, or nil for none."
4181 (make-variable-buffer-local 'fill-prefix)
4193 This function is only called during auto-filling of a comment section.
4197 ;; This function is used as the auto-fill-function of a buffer
4210 (save-excursion (beginning-of-line)
4234 (beginning-of-line)
4247 ;; There is no use breaking at end of line.
4249 ;; It is futile to split at the end of the prefix
4256 (beginning-of-line)
4277 (end-of-line 0)
4279 ;; If making the new line didn't reduce the hpos of
4280 ;; the end of the line, then give up now;
4294 ;; Add a global minor mode version of it.
4301 The value of `normal-auto-fill-function' specifies the function to use
4314 "Automatically break line at a previous space, in insertion of text."
4343 When the value of `selective-display' is a number > 0,
4345 The variable `selective-display' has a separate value for each buffer."
4366 "Toggle whether to fold or truncate long lines for the current buffer.
4376 (let ((buffer (current-buffer)))
4378 (if (eq buffer (window-buffer window))
4394 end of a line, such characters extend the line. Before a tab,
4410 end of a line joins the line to the next, with the typed character
4417 specialization of overwrite mode, entered by setting the
4448 Size Indication mode is enabled, the size of the accessible part
4449 of the buffer appears in the mode line."
4454 "Blinking matching of parens and expressions."
4476 If nil, search stops at the beginning of the accessible portion of the buffer."
4488 it skips the contents of comments that end before point."
4493 "Move cursor momentarily to the beginning of the sexp before point."
4497 ;; Verify an even number of quoting characters precede the close.
4554 (buffer-substring (line-beginning-position)
4561 (buffer-substring blinkpos
4569 (buffer-substring (progn
4571 (line-beginning-position))
4572 (progn (end-of-line)
4577 (buffer-substring blinkpos (1+ blinkpos)))
4579 (buffer-substring blinkpos (1+ blinkpos)))))))
4588 ;; Quitting out of a program does not go through here;
4592 During execution of Lisp code, this character causes a quit directly.
4601 (defvar buffer-quit-function nil
4602 "Function to call to \"quit\" the current buffer, or nil if none.
4607 "Exit the current \"mode\" (in a generalized sense of the word).
4610 can get out of the minibuffer or other recursive edit,
4611 cancel the use of the current buffer (for special-purpose buffers),
4623 (buffer-quit-function
4624 (funcall buffer-quit-function))
4627 ((string-match "^ \\*" (buffer-name (current-buffer)))
4628 (bury-buffer))))
4632 VOLUME and DEVICE correspond to the keywords of the sound
4674 Additional valid symbols may be available; check with the author of
4703 (goto-char (match-beginning 0))))
4709 (let ((special-display-buffer-names nil)
4711 (same-window-buffer-names nil)
4750 switch to and display the buffer used for mail composition.
4753 to insert the raw text of the message being replied to.
4755 FUNCTION to ARGS, to insert the raw text of the original message.
4759 SEND-ACTIONS is a list of actions to call when the message is sent.
4773 'switch-to-buffer-other-window yank-action send-actions))
4782 'switch-to-buffer-other-frame yank-action send-actions))
4786 "History of values entered with `set-variable'.")
4801 With a prefix argument, set VARIABLE to VALUE buffer-locally."
4813 "(buffer-local)")
4816 "buffer-locally")
4845 (error "Value `%S' does not match type %S of %S"
4858 ;; Define the major mode for lists of completions.
4876 (defvar completion-reference-buffer nil
4877 "Record the buffer that was current when the completion list was requested.
4878 This is a local variable in the completion list buffer.
4887 "Number of chars at beginning of minibuffer not involved in completion.
4888 This is a local variable in the completion list buffer
4889 but it talks about the buffer in `completion-reference-buffer'.
4891 of the tail end of the buffer's text is involved in completion.")
4897 (let ((buf completion-reference-buffer))
4902 (if (get-buffer-window buf)
4903 (select-window (get-buffer-window buf))))))
4916 ;; If in a completion, move to the end of it.
4919 ;; Move to start of next one.
4925 ;; If in a completion, move to the start of it.
4929 ;; Move to end of the previous completion.
4933 ;; Move to the start of that one.
4941 (let (beg end completion (buffer completion-reference-buffer)
4951 (setq completion (buffer-substring-no-properties beg end))
4955 ;; This is a special buffer's frame
4958 (bury-buffer)))
4960 (choose-completion-string completion buffer base-size)))
4967 ;; Try moving back by the length of the string.
4976 (let ((tail (buffer-substring (point) opoint)))
4985 "Functions that may override the normal insertion of a completion choice.
4987 CHOICE - the string to insert in the buffer,
4988 BUFFER - the buffer in which the choice should be inserted,
4990 BASE-SIZE - the number of characters in BUFFER before
4998 the default method of inserting the completion in BUFFER.")
5000 (defun choose-completion-string (choice &optional buffer base-size)
5002 BASE-SIZE, if non-nil, says how many characters of BUFFER's text
5010 (let* ((buffer (or buffer completion-reference-buffer))
5011 (mini-p (minibufferp buffer)))
5016 (not (equal buffer
5017 (window-buffer (active-minibuffer-window))))))
5019 ;; Set buffer so buffer-local choose-completion-string-functions works.
5020 (set-buffer buffer)
5023 choice buffer mini-p base-size)
5024 ;; Insert the completion into the buffer where it was requested.
5035 (let ((window (get-buffer-window buffer t)))
5039 (equal buffer (window-buffer (minibuffer-window)))
5052 "Major mode for buffers showing lists of possible completions.
5067 "Finish setup of the completions buffer.
5068 Called from `temp-buffer-show-hook'."
5072 (add-hook 'temp-buffer-show-hook 'completion-list-mode-finish)
5075 "Normal hook run at the end of setting up a completion list buffer.
5076 When this hook is run, the current buffer is the one in which the
5077 command to display the completion list buffer was run.
5078 The completion list buffer is available as the value of `standard-output'.
5080 value of `completion-common-substring'. See also `display-completion-list'.")
5086 "Non-nil means show help message in *Completions* buffer."
5093 "Face put on the first uncommon character in completions in *Completions* buffer."
5098 "Face put on the common prefix substring in completions in *Completions* buffer.
5099 The idea of `completions-common-part' is that you can use it to
5101 of the differing parts is, by contrast, slightly highlighted."
5115 in the `*Completions*' buffer, the common prefix substring in completions
5117 of the minibuffer before point is always the common substring.)")
5120 ;; after the text of the completion list buffer is written.
5122 (let* ((mainbuf (current-buffer))
5127 ;; so it will get copied into the completion list buffer.
5129 (with-current-buffer mainbuf
5132 (with-current-buffer standard-output
5134 (set (make-local-variable 'completion-reference-buffer) mainbuf)
5139 ;; To compute base size, a function can use the global value of
5141 (with-current-buffer mainbuf
5145 ;; For file name completion, use the number of chars before
5146 ;; the start of the file name component at point.
5147 (with-current-buffer mainbuf
5186 "In this buffer, type \\[choose-completion] to \
5198 (or (get-buffer-window "*Completions*")
5200 (let ((window (get-buffer-window "*Completions*")))
5240 SYMBOL is the name of this modifier, as a symbol.
5241 LSHIFTBY is the numeric value of this modifier, in keyboard events.
5304 ;;;; forking a twin copy of a buffer.
5307 (defvar clone-buffer-hook nil
5308 "Normal hook to run in the new buffer at the end of `clone-buffer'.")
5311 "Create a twin copy of PROCESS.
5314 If PROCESS is associated with a buffer, the new process will be associated
5315 with the current buffer instead.
5319 (setq newname (substring newname 0 (match-beginning 0))))
5326 (setq args (plist-put args :buffer
5327 (if (process-buffer process)
5328 (current-buffer))))
5331 (if (process-buffer process) (current-buffer))
5345 (defun clone-buffer (&optional newname display-flag)
5346 "Create and return a twin copy of the current buffer.
5347 Unlike an indirect buffer, the new buffer can be edited
5348 independently of the old one (if it is not read-only).
5349 NEWNAME is the name of the new buffer. It may be modified by
5351 unique buffer name. If nil, it defaults to the name of the
5352 current buffer, with the proper suffix. If DISPLAY-FLAG is
5353 non-nil, the new buffer is shown with `pop-to-buffer'. Trying to
5354 clone a file-visiting buffer, or a buffer whose major mode symbol
5357 Interactively, DISPLAY-FLAG is t and NEWNAME is the name of the
5358 current buffer with appropriate suffix. However, if a prefix
5362 This runs the normal hook `clone-buffer-hook' in the new buffer
5366 (if buffer-file-name
5367 (error "Cannot clone a file-visiting buffer"))
5369 (error "Cannot clone a buffer in %s mode" mode-name))
5371 (read-buffer "Name of new cloned buffer: " (current-buffer)))
5373 (if buffer-file-name
5374 (error "Cannot clone a file-visiting buffer"))
5376 (error "Cannot clone a buffer in %s mode" mode-name))
5377 (setq newname (or newname (buffer-name)))
5379 (setq newname (substring newname 0 (match-beginning 0))))
5380 (let ((buf (current-buffer))
5385 (modified (buffer-modified-p))
5387 (lvars (buffer-local-variables))
5388 (process (get-buffer-process (current-buffer)))
5389 (new (generate-new-buffer (or newname (buffer-name)))))
5392 (with-current-buffer new
5393 (insert-buffer-substring buf)))
5394 (with-current-buffer new
5398 (set-buffer-modified-p modified)
5400 ;; Clone the old buffer's process, if any.
5417 (run-hooks 'clone-buffer-hook))
5419 ;; Presumably the current buffer is shown in the selected frame, so
5422 (same-window-buffer-names))
5423 (pop-to-buffer new)))
5427 (defun clone-indirect-buffer (newname display-flag &optional norecord)
5428 "Create an indirect buffer that is a twin copy of the current buffer.
5430 Give the indirect buffer name NEWNAME. Interactively, read NEWNAME
5433 buffer's name. The name is modified by adding a `<N>' suffix to it
5436 DISPLAY-FLAG non-nil means show the new buffer with `pop-to-buffer'.
5439 Optional third arg NORECORD non-nil means do not put this buffer at the
5440 front of the list of recently selected ones."
5444 (error "Cannot indirectly clone a buffer in %s mode" mode-name))
5446 (read-buffer "Name of indirect buffer: " (current-buffer)))
5449 (error "Cannot indirectly clone a buffer in %s mode" mode-name))
5450 (setq newname (or newname (buffer-name)))
5452 (setq newname (substring newname 0 (match-beginning 0))))
5453 (let* ((name (generate-new-buffer-name newname))
5454 (buffer (make-indirect-buffer (current-buffer) name t)))
5456 (pop-to-buffer buffer norecord))
5457 buffer))
5460 (defun clone-indirect-buffer-other-window (newname display-flag &optional norecord)
5461 "Like `clone-indirect-buffer' but display in another window."
5465 (error "Cannot indirectly clone a buffer in %s mode" mode-name))
5467 (read-buffer "Name of indirect buffer: " (current-buffer)))
5470 (clone-indirect-buffer newname display-flag norecord)))
5474 ;;; Handling of Backspace and Delete keys.
5490 On window systems, the default value of this option is chosen
5499 `keyboard-translate'. The former functionality of C-h is available on
5509 ;; The fboundp is because of a problem with :set when
5517 "Toggle the Erase and Delete mode of the Backspace and Delete keys.
5527 In addition, on window systems, the bindings of C-Delete, M-Delete,
5529 the global keymap in accordance with the functionality of Delete and
5541 former functionality of C-h is available on the F1 key. You should
5571 ;; Maybe swap bindings of C-delete and C-backspace, etc.
5597 (defvar vis-mode-saved-buffer-invisibility-spec nil
5598 "Saved value of `buffer-invisibility-spec' when Visible mode is on.")
5606 works by saving the value of `buffer-invisibility-spec' and setting it to nil."
5609 (when (local-variable-p 'vis-mode-saved-buffer-invisibility-spec)
5610 (setq buffer-invisibility-spec vis-mode-saved-buffer-invisibility-spec)
5611 (kill-local-variable 'vis-mode-saved-buffer-invisibility-spec))
5613 (set (make-local-variable 'vis-mode-saved-buffer-invisibility-spec)
5614 buffer-invisibility-spec)
5615 (setq buffer-invisibility-spec nil)))
5629 ; (when (consp buffer-undo-list)
5630 ; (setq buffer-undo-list (cddr buffer-undo-list)))