Anonymous avatar Anonymous committed d00c072

- folding.el: Applied patch by Jeremy Hankins <nowan A T nowan org>,
Added VCS URL header to the beginning for canonnical location.
Updated maintainer section. Fixed Copyright years.

Comments (0)

Files changed (2)

+2006-11-18  root  <jari.aalto@cante.net>
+
+	* folding.el: Applied patch by Jeremy Hankins <nowan A T nowan org>,
+	which adds variable `folding-narrow-by-default'. The patch affects
+	mostly `folding-shift-in'. This makes it possible to
+	advise viper-search to open folds. Thanks.
+	Added VCS URL header to the beginning for canonnical location.
+	Updated maintainer section. Fixed Copyright years.
+
 2006-11-02  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.91 released.
 
 2005-09-14  Jari Aalto  <jari aalto A T cante net>
 
-	* folding.el 
+	* folding.el
 	(top level): Updated Copyright years and its information.
 	(folding-package-url-location): Updated URL
 	to point to XEmacs CVS server.
 	(folding-check-folded): Added check for \r character, which
 	signifies collapsed folds. This fixes bug (C-x s) where buffer's folds
 	were forced to closed state if folding mode was active in some other
- 	buffer. Function `folding-mode-write-file' did that, but the
+	buffer. Function `folding-mode-write-file' did that, but the
 	impulse came from `folding-check-folded'.
 
 2004-05-19  Norbert Koch  <viteno@xemacs.org>
 
 	-- Use spam protective addresses
 	-- Merged in changes made by 2003-11-12  Adrian Aichner
-   	from XEmacs tree 1.15; Typo fixes for docstrings and comments.
+	from XEmacs tree 1.15; Typo fixes for docstrings and comments.
 	-- Returned to old bug and solved it in a better way (preserve
 	region) by using different expansion macros for XEmacs and Emacs.
 	See See
 ;;; folding.el --- A folding-editor-like minor mode.
 
-;; Copyright (C) 2002-2006
-;;	     Jari Aalto
-;; Copyright (C) 1994-2001
+;; Copyright (C) 2000-2006
+;;           Jari Aalto
+;; Copyright (C) 1995-1999
 ;;           Jari Aalto, Anders Lindgren.
+;; Copyright (C) 1994
+;;           Jari Aalto
 ;; Copyright (C) 1992, 1993
 ;;           Jamie Lokier, All rights reserved.
 ;;
 ;;              Jari Aalto
 ;;              Anders Lindgren <andersl A T csd.uu dt se>
 ;; Maintainer:  Jari Aalto <jari aalto A T cante dt net>
-;;              Anders Lindgren <andersl A T csd.uu dt se>
 ;; Created:     1992
-;; Version:     2004.1125 (2.117+)
-;; RCS version: $Revision$
+;; Version:     2006.1118
+;; VCS version: $Revision$
+;; VCS URL:     http://tiny-tools.cvs.sourceforge.net/tiny-tools/tiny-tools/lisp/other/
 ;; Date:        $Date$
 ;; Keywords:    tools
 
 ;;{{{ History
 ;; [person version] = developer and his revision tree number.
 ;;
-;; Nov  25  2004  21.3             [jari 2004.1125]
+;; Nov  16  2006  21.4             [jari 3.36-3.37 2006.1118]
+;; - Jeremy Hankins <nowan A T nowan org> sent a patch, which
+;;   adds variable `folding-narrow-by-default'. The patch affects
+;;   mostly `folding-shift-in'. This makes it possible to
+;;   advise viper-search to open folds. Thanks.
+;; - Added VCS URL header to the beginning for canonnical location.
+;;   Updated maintainer section.
+;; - Fixed Copyright years.
+;;
+;; Nov  25  2004  21.3             [jari 3.35 2004.1125]
 ;; - non-ascii character removed from bibtex-mode.
 ;;   Changed bib-mode '@comment' => '%'. Closes Debian
 ;;   Bug#282388
 ;;
-;; Sep  10  2004  21.3             [jari 2.116-2004.0910]
+;; Sep  10  2004  21.3             [jari 2.116 2004.0910]
 ;; - (folding-fold-region): caused to indent bottom fold
 ;;   some 50 spaces forward in auctex:latex-mode. Disabled
 ;;   running `indent-according-to-mode' while in latex-mode.
 				     (folding-point-folded-p goal))
 				 (folding-shift-in t))
 			     (goto-char goal)))
-		    (folding-narrow-to-region (point-min) (point-max) t)))
+		    (folding-narrow-to-region
+		     (and folding-narrow-by-default (point-min))
+		     (point-max) t)))
 	      (if (or folding-stack (folding-point-folded-p (point)))
 		  (folding-open-buffer))))))))
 
 
 ;;; ........................................................ &v-Config ...
 
+(defvar folding-narrow-by-default t
+  "If t (default) things like isearch will enter folds.  If nil the
+folds will be opened, but not entered.")
+
 ;; Q: should this inherit mouse-yank-at-point's value? maybe not.
 (defvar folding-mouse-yank-at-point t
   "If non-nil, mouse activities are done at point instead of 'mouse cursor'.
 many folds as necessary are entered to make the surrounding text
 visible. This is useful after some commands eg., search commands."
   (interactive)
-  (let ((goal (point)))
-    (if (folding-skip-ellipsis-backward)
-	(while (prog2 (beginning-of-line)
-		      (folding-shift-in t)
-		      (goto-char goal)))
-      (let ((data (folding-show-current-entry noerror t)))
-	(and data
-	     (progn
-	       (setq folding-stack
-		     (if folding-stack
-			 (cons (cons (point-min-marker) (point-max-marker))
-			       folding-stack)
-		       '(folded)))
-	       (folding-set-mode-line)
-	       (folding-narrow-to-region (car data) (nth 1 data))
-	       (nth 2 data)))))))
+  (labels
+      ((open-fold nil
+		  (let ((data (folding-show-current-entry noerror t)))
+		    (and data
+			 (progn
+			   (when folding-narrow-by-default
+			     (setq folding-stack
+				   (if folding-stack
+				       (cons (cons (point-min-marker) (point-max-marker))
+					     folding-stack)
+				     '(folded)))
+			     (folding-set-mode-line))
+			   (folding-narrow-to-region (car data) (nth 1 data)))))))
+    (let ((goal (point)))
+      (while (folding-skip-ellipsis-backward)
+	(beginning-of-line)
+	(open-fold)
+	(goto-char goal))
+      (when (not folding-narrow-by-default)
+	(widen)))))
 
 ;;}}}
 ;;{{{ folding-shift-out
        (re-search-forward "[\n\C-m]" nil 0 (1- line)))
   (let ((goal (point)))
     (while (prog2 (beginning-of-line)
-		  (folding-shift-in t)
-		  (goto-char goal))))
-  (folding-narrow-to-region (point-min) (point-max) t))
+	       (folding-shift-in t)
+	     (goto-char goal))))
+  (folding-narrow-to-region
+   (and folding-narrow-by-default (point-min))
+   (point-max) t))
 
 ;;}}}
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.