Changeset 18986 for lang/elisp

Show
Ignore:
Timestamp:
09/08/08 20:33:04 (2 months ago)
Author:
imakado
Message:

ミニバッファ内で使われるsyntax-tableをanything-current-bufferと同じに。

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/elisp/anything-c-moccur/trunk/anything-c-moccur.el

    r18859 r18986  
    124124 
    125125      (define-key map (kbd "C-M-f")  'anything-c-moccur-anything-next-file-matches) 
    126       (define-key map (kbd "C-M-b")  'anything-c-moccur-anything-previous-file-matches)) 
     126      (define-key map (kbd "C-M-b")  'anything-c-moccur-anything-previous-file-matches) 
     127 
     128      (define-key map (kbd "C-M-%")  'anything-c-moccur-query-replace-regexp) 
     129      ) 
    127130    map)) 
    128131 
     
    395398    (anything ";;; "))) 
    396399 
     400(defun anything-c-moccur-query-replace-regexp () 
     401  (interactive) 
     402  (lexical-let ((input-re (minibuffer-contents)) 
     403                (cur-point (first anything-current-position))) 
     404    (setq anything-saved-action (lambda (dummy) 
     405                                  (let ((to-string (read-from-minibuffer "to: " input-re))) 
     406                                    (unwind-protect 
     407                                        (perform-replace input-re to-string t t nil nil nil (point-min) (point-max)) 
     408                                      (goto-char cur-point))))) 
     409    (anything-exit-minibuffer))) 
     410 
    397411;;; dmoccur 
    398412(defvar anything-c-moccur-dmoccur-buffers nil) 
     
    538552  (anything-c-moccur-anything-try-execute-persistent-action)) 
    539553 
     554 
    540555(defun anything-c-moccur-wrap-word-internal (s1 s2) 
    541556  (ignore-errors 
    542     (save-excursion 
    543       (backward-sexp) 
    544       (insert s1)) 
    545     (insert s2))) 
     557    (let ((cur-syntax-table 
     558           (with-current-buffer anything-current-buffer 
     559             (syntax-table)))) 
     560      (when (syntax-table-p cur-syntax-table) 
     561        (with-syntax-table cur-syntax-table 
     562          (save-excursion 
     563            (backward-sexp) 
     564            (insert s1)) 
     565          (insert s2)))))) 
    546566 
    547567(defun anything-c-moccur-start-symbol ()