all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Isearch setting of inhibit-point-motion-hooks too inflexible
@ 2002-10-27 11:45 Gregor Schmid
  2002-10-28 19:20 ` Richard Stallman
  0 siblings, 1 reply; 8+ messages 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] 8+ messages in thread

end of thread, other threads:[~2002-10-31 17:27 UTC | newest]

Thread overview: 8+ messages (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
2002-10-28 19:20 ` Richard Stallman
2002-10-29  7:46   ` Gregor Schmid
2002-10-30 17:16     ` Richard Stallman
2002-10-30 18:34       ` Stefan Monnier
2002-10-31 17:27         ` Richard Stallman
2002-10-31  8:23       ` Gregor Schmid
2002-10-29 14:14   ` Stefan Monnier

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.