bug-gnu-emacs
[Top][All Lists]
Advanced

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

Isearch setting of inhibit-point-motion-hooks too inflexible


From: Gregor Schmid
Subject: Isearch setting of inhibit-point-motion-hooks too inflexible
Date: Sun, 27 Oct 2002 12:45:50 +0100

Dear emacs maintainers,

since emacs version 20 isearch has had new capabilities for optionally
matching invisible text, plus additional features that work well with
outline and hideout. This mechanism requires setting
`inhibit-point-motion-hooks' to the value of `search-invisible' in
`isearch-search'.

However, I'm using a homegrown folding mode that makes use of the
'invisible text property and depends on the point motion hooks _not_
being inhibited. It works well with isearch, provided that
`search-invisible' is t and `inhibit-point-motion-hooks' is nil during 
`isearch-search'. With the current implementation of `isearch-search' 
this is not possible.

The following patch against emacs 21.2 will add a new variable
`isearch-inhibit-point-motion-hooks' and change `isearch-search' to
make use of it. Comments should be self-explanatory. The default
settings will maintain the current behaviour.

Best regards,
     Greg

----------ChangeLog-----------------------------------------


2002-10-27  Gregor Schmid <gs@qfs.de>

        * isearch.el (isearch-inhibit-point-motion-hooks): New variable
        (isearch-search): Make use of isearch-inhibit-point-motion-hooks


----------Patch---------------------------------------------
cd /usr/local/share/emacs/21.2/lisp/
diff -c -p -w /usr/local/share/emacs/21.2/lisp/isearch.el\~ 
/usr/local/share/emacs/21.2/lisp/isearch.el
*** /usr/local/share/emacs/21.2/lisp/isearch.el~        Thu Oct 18 12:06:56 2001
--- /usr/local/share/emacs/21.2/lisp/isearch.el Sun Oct 27 12:05:37 2002
*************** Ordinarily the text becomes invisible ag
*** 186,191 ****
--- 186,199 ----
    :type 'boolean
    :group 'isearch)
  
+ (defvar isearch-inhibit-point-motion-hooks 'search-invisible
+   "If t `inhibit-point-motion-hooks' is set during search.
+ nil means don't set `inhibit-point-motion-hooks'.
+ For any other value (the default) `inhibit-point-motion-hooks' is set to
+ the value of `search-invisible'.
+ This variable only needs to be changed for custom modes that use
+ invisible text and depend on point motion hooks for operation.")
+ 
  (defvar isearch-mode-hook nil
    "Function(s) to call after starting up an incremental search.")
  
*************** If there is no completion possible, say 
*** 1577,1583 ****
        (setq isearch-case-fold-search
            (isearch-no-upper-case-p isearch-string isearch-regexp)))
    (condition-case lossage
!       (let ((inhibit-point-motion-hooks search-invisible)
            (inhibit-quit nil)
            (case-fold-search isearch-case-fold-search)
            (retry t))
--- 1585,1597 ----
        (setq isearch-case-fold-search
            (isearch-no-upper-case-p isearch-string isearch-regexp)))
    (condition-case lossage
!       (let ((inhibit-point-motion-hooks
!            (cond
!                 ((null isearch-inhibit-point-motion-hooks)
!                  nil)
!                 ((eq isearch-inhibit-point-motion-hooks t)
!                  t)
!                 (t search-invisible)))
            (inhibit-quit nil)
            (case-fold-search isearch-case-fold-search)
            (retry t))

Diff finished at Sun Oct 27 12:20:01
------------------------------------------------------------





reply via email to

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