emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/replace.el


From: Juri Linkov
Subject: [Emacs-diffs] Changes to emacs/lisp/replace.el
Date: Wed, 09 Nov 2005 02:41:50 -0500

Index: emacs/lisp/replace.el
diff -c emacs/lisp/replace.el:1.229 emacs/lisp/replace.el:1.230
*** emacs/lisp/replace.el:1.229 Sat Nov  5 14:02:18 2005
--- emacs/lisp/replace.el       Wed Nov  9 07:41:48 2005
***************
*** 878,883 ****
--- 878,893 ----
    :type 'face
    :group 'matching)
  
+ (defcustom occur-excluded-properties
+   '(read-only invisible intangible field mouse-face help-echo local-map keymap
+     yank-handler follow-link)
+   "*Text properties to discard when copying lines to the *Occur* buffer.
+ The value should be a list of text properties to discard or t,
+ which means to discard all text properties."
+   :type '(choice (const :tag "All" t) (repeat symbol))
+   :group 'matching
+   :version "22.1")
+ 
  (defun occur-accumulate-lines (count &optional keep-props)
    (save-excursion
      (let ((forwardp (> count 0))
***************
*** 894,903 ****
            (if (fboundp 'jit-lock-fontify-now)
                (jit-lock-fontify-now beg end)))
        (push
!        (funcall (if keep-props
!                     #'buffer-substring
!                   #'buffer-substring-no-properties)
!                 beg end)
         result)
        (forward-line (if forwardp 1 -1)))
        (nreverse result))))
--- 904,915 ----
            (if (fboundp 'jit-lock-fontify-now)
                (jit-lock-fontify-now beg end)))
        (push
!        (if (and keep-props (not (eq occur-excluded-properties t)))
!            (let ((str (buffer-substring beg end)))
!              (remove-list-of-text-properties
!               0 (length str) occur-excluded-properties str)
!              str)
!          (buffer-substring-no-properties beg end))
         result)
        (forward-line (if forwardp 1 -1)))
        (nreverse result))))
***************
*** 1033,1039 ****
                      (and case-fold-search
                           (isearch-no-upper-case-p regexp t))
                      list-matching-lines-buffer-name-face
!                     nil list-matching-lines-face t)))
          (let* ((bufcount (length active-bufs))
                 (diff (- (length bufs) bufcount)))
            (message "Searched %d buffer%s%s; %s match%s for `%s'"
--- 1045,1052 ----
                      (and case-fold-search
                           (isearch-no-upper-case-p regexp t))
                      list-matching-lines-buffer-name-face
!                     nil list-matching-lines-face
!                     (not (eq occur-excluded-properties t)))))
          (let* ((bufcount (length active-bufs))
                 (diff (- (length bufs) bufcount)))
            (message "Searched %d buffer%s%s; %s match%s for `%s'"
***************
*** 1102,1114 ****
                             (text-property-not-all begpt endpt 'fontified t))
                        (if (fboundp 'jit-lock-fontify-now)
                            (jit-lock-fontify-now begpt endpt)))
!                   (setq curstring (buffer-substring begpt endpt))
!                   ;; Depropertize the string, and maybe
!                   ;; highlight the matches
                    (let ((len (length curstring))
                          (start 0))
-                     (unless keep-props
-                       (set-text-properties 0 len nil curstring))
                      (while (and (< start len)
                                  (string-match regexp curstring start))
                        (add-text-properties
--- 1115,1129 ----
                             (text-property-not-all begpt endpt 'fontified t))
                        (if (fboundp 'jit-lock-fontify-now)
                            (jit-lock-fontify-now begpt endpt)))
!                   (if (and keep-props (not (eq occur-excluded-properties t)))
!                       (progn
!                         (setq curstring (buffer-substring begpt endpt))
!                         (remove-list-of-text-properties
!                          0 (length curstring) occur-excluded-properties 
curstring))
!                     (setq curstring (buffer-substring-no-properties begpt 
endpt)))
!                   ;; Highlight the matches
                    (let ((len (length curstring))
                          (start 0))
                      (while (and (< start len)
                                  (string-match regexp curstring start))
                        (add-text-properties




reply via email to

[Prev in Thread] Current Thread [Next in Thread]