diff options
| author | Stefan Monnier | 2015-04-10 00:20:54 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2015-04-10 00:20:54 -0400 |
| commit | 519489089197ce2d41c72e20773438d415ce8564 (patch) | |
| tree | e26150e472b9f1230f8d9fe08e6636845e7ec1d6 | |
| parent | ee7df9f0c8e9dedfca46fe9456ca8463cda096df (diff) | |
| download | emacs-519489089197ce2d41c72e20773438d415ce8564.tar.gz emacs-519489089197ce2d41c72e20773438d415ce8564.zip | |
* vhdl-mode.el (vhdl-prepare-search-2): Use inhibit-point-motion-hooks
| -rw-r--r-- | lisp/progmodes/vhdl-mode.el | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index 8d6d2a29293..eb234944904 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el | |||
| @@ -2486,37 +2486,18 @@ consistent searching." | |||
| 2486 | 2486 | ||
| 2487 | (defmacro vhdl-prepare-search-2 (&rest body) | 2487 | (defmacro vhdl-prepare-search-2 (&rest body) |
| 2488 | "Enable case insensitive search, switch to syntax table that includes '_', | 2488 | "Enable case insensitive search, switch to syntax table that includes '_', |
| 2489 | and remove `intangible' overlays, then execute BODY, and finally restore the | 2489 | arrange to ignore `intangible' overlays, then execute BODY, and finally restore |
| 2490 | old environment. Used for consistent searching." | 2490 | the old environment. Used for consistent searching." |
| 2491 | ;; FIXME: Why not just let-bind `inhibit-point-motion-hooks'? --Stef | ||
| 2492 | `(let ((case-fold-search t) ; case insensitive search | 2491 | `(let ((case-fold-search t) ; case insensitive search |
| 2493 | (current-syntax-table (syntax-table)) | 2492 | (current-syntax-table (syntax-table)) |
| 2494 | overlay-all-list overlay-intangible-list overlay) | 2493 | (inhibit-point-motion-hooks t)) |
| 2495 | ;; use extended syntax table | 2494 | ;; use extended syntax table |
| 2496 | (set-syntax-table vhdl-mode-ext-syntax-table) | 2495 | (set-syntax-table vhdl-mode-ext-syntax-table) |
| 2497 | ;; remove `intangible' overlays | ||
| 2498 | (when (fboundp 'overlay-lists) | ||
| 2499 | (setq overlay-all-list (overlay-lists)) | ||
| 2500 | (setq overlay-all-list | ||
| 2501 | (append (car overlay-all-list) (cdr overlay-all-list))) | ||
| 2502 | (while overlay-all-list | ||
| 2503 | (setq overlay (car overlay-all-list)) | ||
| 2504 | (when (memq 'intangible (overlay-properties overlay)) | ||
| 2505 | (setq overlay-intangible-list | ||
| 2506 | (cons overlay overlay-intangible-list)) | ||
| 2507 | (overlay-put overlay 'intangible nil)) | ||
| 2508 | (setq overlay-all-list (cdr overlay-all-list)))) | ||
| 2509 | ;; execute BODY safely | 2496 | ;; execute BODY safely |
| 2510 | (unwind-protect | 2497 | (unwind-protect |
| 2511 | (progn ,@body) | 2498 | (progn ,@body) |
| 2512 | ;; restore syntax table | 2499 | ;; restore syntax table |
| 2513 | (set-syntax-table current-syntax-table) | 2500 | (set-syntax-table current-syntax-table)))) |
| 2514 | ;; restore `intangible' overlays | ||
| 2515 | (when (fboundp 'overlay-lists) | ||
| 2516 | (while overlay-intangible-list | ||
| 2517 | (overlay-put (car overlay-intangible-list) 'intangible t) | ||
| 2518 | (setq overlay-intangible-list | ||
| 2519 | (cdr overlay-intangible-list))))))) | ||
| 2520 | 2501 | ||
| 2521 | (defmacro vhdl-visit-file (file-name issue-error &rest body) | 2502 | (defmacro vhdl-visit-file (file-name issue-error &rest body) |
| 2522 | "Visit file FILE-NAME and execute BODY." | 2503 | "Visit file FILE-NAME and execute BODY." |