unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* Isearch setting of inhibit-point-motion-hooks too inflexible
@ 2002-10-27 11:45 Gregor Schmid
  0 siblings, 0 replies; only message in thread
From: Gregor Schmid @ 2002-10-27 11:45 UTC (permalink / raw)



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
------------------------------------------------------------

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-10-27 11:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-27 11:45 Isearch setting of inhibit-point-motion-hooks too inflexible Gregor Schmid

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).