/[emacs]/emacs/lisp/simple.el
ViewVC logotype

Diff of /emacs/lisp/simple.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.703 by jurta, Tue Mar 29 04:55:43 2005 UTC revision 1.704 by rms, Tue Mar 29 20:53:19 2005 UTC
# Line 35  Line 35 
35    (autoload 'widget-convert "wid-edit")    (autoload 'widget-convert "wid-edit")
36    (autoload 'shell-mode "shell"))    (autoload 'shell-mode "shell"))
37    
38    (defcustom idle-update-delay 0.5
39      "*Idle time delay before updating various things on the screen.
40    Various Emacs features that update auxiliary information when point moves
41    wait this many seconds after Emacs becomes idle before doing an update."
42      :type 'number
43      :group 'display
44      :version "22.1")
45    
46  (defgroup killing nil  (defgroup killing nil
47    "Killing and yanking commands."    "Killing and yanking commands."
# Line 2218  These commands include \\[set-mark-comma Line 2225  These commands include \\[set-mark-comma
2225    (reset-this-command-lengths)    (reset-this-command-lengths)
2226    (restore-overriding-map))    (restore-overriding-map))
2227    
2228    (defvar buffer-substring-filters nil
2229      "List of filter functions for `filter-buffer-substring'.
2230    Each function must accept a single argument, a string, and return
2231    a string.  The buffer substring is passed to the first function
2232    in the list, and the return value of each function is passed to
2233    the next.  The return value of the last function is used as the
2234    return value of `filter-buffer-substring'.
2235    
2236    If this variable is nil, no filtering is performed.")
2237    
2238    (defun filter-buffer-substring (beg end &optional delete)
2239      "Return the buffer substring between BEG and END, after filtering.
2240    The buffer substring is passed through each of the filter
2241    functions in `buffer-substring-filters', and the value from the
2242    last filter function is returned.  If `buffer-substring-filters'
2243    is nil, the buffer substring is returned unaltered.
2244    
2245    If DELETE is non-nil, the text between BEG and END is deleted
2246    from the buffer.
2247    
2248    Point is temporarily set to BEG before caling
2249    `buffer-substring-filters', in case the functions need to know
2250    where the text came from.
2251    
2252    This function should be used instead of `buffer-substring' or
2253    `delete-and-extract-region' when you want to allow filtering to
2254    take place.  For example, major or minor modes can use
2255    `buffer-substring-filters' to extract characters that are special
2256    to a buffer, and should not be copied into other buffers."
2257      (save-excursion
2258        (goto-char beg)
2259        (let ((string (if delete (delete-and-extract-region beg end)
2260                        (buffer-substring beg end))))
2261          (dolist (filter buffer-substring-filters string)
2262            (setq string (funcall filter string))))))
2263    
2264  ;;;; Window system cut and paste hooks.  ;;;; Window system cut and paste hooks.
2265    
2266  (defvar interprogram-cut-function nil  (defvar interprogram-cut-function nil
# Line 2394  specifies the yank-handler text property Line 2437  specifies the yank-handler text property
2437  text.  See `insert-for-yank'."  text.  See `insert-for-yank'."
2438    (interactive "r")    (interactive "r")
2439    (condition-case nil    (condition-case nil
2440        (let ((string (delete-and-extract-region beg end)))        (let ((string (filter-buffer-substring beg end t)))
2441          (when string                    ;STRING is nil if BEG = END          (when string                    ;STRING is nil if BEG = END
2442            ;; Add that string to the kill ring, one way or another.            ;; Add that string to the kill ring, one way or another.
2443            (if (eq last-command 'kill-region)            (if (eq last-command 'kill-region)
# Line 2430  If `interprogram-cut-function' is non-ni Line 2473  If `interprogram-cut-function' is non-ni
2473  system cut and paste."  system cut and paste."
2474    (interactive "r")    (interactive "r")
2475    (if (eq last-command 'kill-region)    (if (eq last-command 'kill-region)
2476        (kill-append (buffer-substring beg end) (< end beg))        (kill-append (filter-buffer-substring beg end) (< end beg))
2477      (kill-new (buffer-substring beg end)))      (kill-new (filter-buffer-substring beg end)))
2478    (if transient-mark-mode    (if transient-mark-mode
2479        (setq deactivate-mark t))        (setq deactivate-mark t))
2480    nil)    nil)
# Line 5184  See also `normal-erase-is-backspace'." Line 5227  See also `normal-erase-is-backspace'."
5227        (message "Delete key deletes %s"        (message "Delete key deletes %s"
5228                 (if normal-erase-is-backspace "forward" "backward"))))                 (if normal-erase-is-backspace "forward" "backward"))))
5229    
 (defcustom idle-update-delay 0.5  
   "*Idle time delay before updating various things on the screen.  
 Various Emacs features that update auxiliary information when point moves  
 wait this many seconds after Emacs becomes idle before doing an update."  
   :type 'number  
   :group 'display  
   :version "22.1")  
   
5230  (defvar vis-mode-saved-buffer-invisibility-spec nil  (defvar vis-mode-saved-buffer-invisibility-spec nil
5231    "Saved value of `buffer-invisibility-spec' when Visible mode is on.")    "Saved value of `buffer-invisibility-spec' when Visible mode is on.")
5232    

Legend:
Removed from v.1.703  
changed lines
  Added in v.1.704

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26