changeset 85800:0810efbbb396

(image-forward-hscroll, image-next-line, image-eol) (image-eob, image-mode, image-minor-mode, image-toggle-display-text) (image-toggle-display): Take overlays into account and don't assume point-min==1.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 30 Oct 2007 17:09:41 +0000
parents 10f70d5f0ff3
children 9b97166d0c6c
files lisp/ChangeLog lisp/image-mode.el
diffstat 2 files changed, 47 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Oct 30 13:57:17 2007 +0000
+++ b/lisp/ChangeLog	Tue Oct 30 17:09:41 2007 +0000
@@ -1,3 +1,10 @@
+2007-10-30  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* image-mode.el (image-forward-hscroll, image-next-line, image-eol)
+	(image-eob, image-mode, image-minor-mode, image-toggle-display-text)
+	(image-toggle-display): Take overlays into account and don't assume
+	point-min==1.
+
 2007-10-30  Thien-Thi Nguyen  <ttn@gnuvola.org>
 
 	* vc.el (vc-annotate): Fix omission bug:
@@ -76,8 +83,8 @@
 	Replace uses of edt-x-emacs19-p and edt-gnu-emacs19-p with feature
 	tests.
 
-	* textmodes/reftex-index.el (reftex-index-selection-or-word): Use
-	feature test instead of boundp test so it can be resolved at
+	* textmodes/reftex-index.el (reftex-index-selection-or-word):
+	Use feature test instead of boundp test so it can be resolved at
 	compile time.
 
 	* net/newsticker.el (replace-regexp-in-string): Only define for
@@ -103,41 +110,41 @@
 
 2007-10-29  Ken Manheimer  <ken.manheimer@gmail.com>
 
-        * allout.el (allout-command-prefix, allout-inhibit-auto-fill):
+	* allout.el (allout-command-prefix, allout-inhibit-auto-fill):
 	Relocate in file.
-        (allout-doublecheck-at-and-shallower): Increase to include
+	(allout-doublecheck-at-and-shallower): Increase to include
 	slightly greater depths, since yank interaction is now ok.  Also,
 	elaborate the docstring to explain the situation.
-        (produce-allout-mode-map, allout-hotspot-key-handler): Use vconcat
+	(produce-allout-mode-map, allout-hotspot-key-handler): Use vconcat
 	instead of concat, so we accommodate key sequences expressed as
 	vectors as well as strings and lists.
-        (allout-flag-region, allout-hide-by-annotation): Make the
+	(allout-flag-region, allout-hide-by-annotation): Make the
 	hidden-text overlays 'front-advance.
-        (allout-overlay-insert-in-front-handler): Correct docstring's
+	(allout-overlay-insert-in-front-handler): Correct docstring's
 	grammar.
-        (allout-aberrant-container-p, allout-on-current-heading-p)
-        (allout-e-o-prefix-p, allout-next-heading)
-        (allout-previous-heading, allout-goto-prefix)
-        (allout-end-of-prefix, allout-next-sibling-leap)
-        (allout-next-visible-heading, allout-auto-fill)
-        (allout-rebullet-heading, allout-kill-line, allout-kill-topic)
-        (allout-yank-processing, allout-resolve-xref)
-        (allout-current-topic-collapsed-p, allout-hide-region-body)
-        (allout-latex-verbatim-quote-curr-line, allout-encrypt-string)
-        (allout-encrypted-topic-p, allout-next-topic-pending-encryption)
-        (count-trailing-whitespace-region): Preserve match data, so allout
+	(allout-aberrant-container-p, allout-on-current-heading-p)
+	(allout-e-o-prefix-p, allout-next-heading)
+	(allout-previous-heading, allout-goto-prefix)
+	(allout-end-of-prefix, allout-next-sibling-leap)
+	(allout-next-visible-heading, allout-auto-fill)
+	(allout-rebullet-heading, allout-kill-line, allout-kill-topic)
+	(allout-yank-processing, allout-resolve-xref)
+	(allout-current-topic-collapsed-p, allout-hide-region-body)
+	(allout-latex-verbatim-quote-curr-line, allout-encrypt-string)
+	(allout-encrypted-topic-p, allout-next-topic-pending-encryption)
+	(count-trailing-whitespace-region): Preserve match data, so allout
 	outline navigation doesn't disrupt other emacs operations.
-        (allout-beginning-of-line): Retreat to the beginning of the hidden
+	(allout-beginning-of-line): Retreat to the beginning of the hidden
 	text, so fields are respected (for submodes that care).
-        (allout-end-of-line): Preserve mark activation status when
+	(allout-end-of-line): Preserve mark activation status when
 	jumping.
-        (allout-open-topic): Account for opening after a child that
+	(allout-open-topic): Account for opening after a child that
 	contains a hidden trailing newline.  Preserve match data.  Run
 	allout-structure-added-hook
-        (allout-encrypt-decrypted): Preserve match data.
-        (allout-toggle-current-subtree-exposure): Add new interactive
+	(allout-encrypt-decrypted): Preserve match data.
+	(allout-toggle-current-subtree-exposure): Add new interactive
 	function for toggle subtree exposure - suggested by tassilo.
-        (move-beginning-of-line, move-end-of-line): Don't use
+	(move-beginning-of-line, move-end-of-line): Don't use
 	line-move-invisible-p, it's obsolete - substitute the code,
 	instead.
 
@@ -582,7 +589,7 @@
 
 	* savehist.el (savehist-save): Omit unreadable elements.
 
-	* loadhist.el (unload-function-defs-list): Renamed from
+	* loadhist.el (unload-function-defs-list): Rename from
 	unload-function-features-list.
 	(unload-feature-special-hooks, unload-feature): Doc fixes.
 
@@ -749,13 +756,13 @@
 2007-10-22  Bastien Guerry  <Bastien.Guerry@ens.fr>
 
 	* org-export-latex.el (org-export-latex-protect-string):
-        Renaming of `org-latex-protect'.
+	Renaming of `org-latex-protect'.
 	(org-export-latex-emphasis-alist): By default, don't protect
-        any emphasis formatter from further conversion.
-	(org-export-latex-tables): honor column grouping for tables.
+	any emphasis formatter from further conversion.
+	(org-export-latex-tables): Honor column grouping for tables.
 	(org-export-latex-title-command): New option.
-        (org-export-latex-treat-backslash-char): Use \textbackslash{} to
-        export backslash character.
+	(org-export-latex-treat-backslash-char): Use \textbackslash{} to
+	export backslash character.
 
 2007-10-22  Carsten Dominik  <dominik@science.uva.nl>
 
--- a/lisp/image-mode.el	Tue Oct 30 13:57:17 2007 +0000
+++ b/lisp/image-mode.el	Tue Oct 30 17:09:41 2007 +0000
@@ -59,7 +59,7 @@
 	 (set-window-hscroll (selected-window)
 			     (max 0 (+ (window-hscroll) n))))
 	(t
-	 (let* ((image (get-text-property 1 'display))
+	 (let* ((image (get-char-property (point-min) 'display))
 		(edges (window-inside-edges))
 		(win-width (- (nth 2 edges) (nth 0 edges)))
 		(img-width (ceiling (car (image-size image)))))
@@ -82,7 +82,7 @@
 	 (set-window-vscroll (selected-window)
 			     (max 0 (+ (window-vscroll) n))))
 	(t
-	 (let* ((image (get-text-property 1 'display))
+	 (let* ((image (get-char-property (point-min) 'display))
 		(edges (window-inside-edges))
 		(win-height (- (nth 3 edges) (nth 1 edges)))
 		(img-height (ceiling (cdr (image-size image)))))
@@ -156,7 +156,7 @@
   (and arg
        (/= (setq arg (prefix-numeric-value arg)) 1)
        (image-next-line (- arg 1)))
-  (let* ((image (get-text-property 1 'display))
+  (let* ((image (get-char-property (point-min) 'display))
 	 (edges (window-inside-edges))
 	 (win-width (- (nth 2 edges) (nth 0 edges)))
 	 (img-width (ceiling (car (image-size image)))))
@@ -172,7 +172,7 @@
 (defun image-eob ()
   "Scroll to the bottom-right corner of the image in the current window."
   (interactive)
-  (let* ((image (get-text-property 1 'display))
+  (let* ((image (get-char-property (point-min) 'display))
 	 (edges (window-inside-edges))
 	 (win-width (- (nth 2 edges) (nth 0 edges)))
 	 (img-width (ceiling (car (image-size image))))
@@ -221,7 +221,7 @@
   (setq major-mode 'image-mode)
   (add-hook 'change-major-mode-hook 'image-toggle-display-text nil t)
   (if (and (display-images-p)
-	   (not (get-text-property (point-min) 'display)))
+	   (not (get-char-property (point-min) 'display)))
       (image-toggle-display)
     ;; Set next vars when image is already displayed but local
     ;; variables were cleared by kill-all-local-variables
@@ -232,7 +232,7 @@
       (message "%s" (concat
 		     (substitute-command-keys
 		      "Type \\[image-toggle-display] to view as ")
-		     (if (get-text-property (point-min) 'display)
+		     (if (get-char-property (point-min) 'display)
 			 "text" "an image") "."))))
 
 ;;;###autoload
@@ -245,13 +245,13 @@
   :version "22.1"
   (if (not image-minor-mode)
       (image-toggle-display-text)
-    (if (get-text-property (point-min) 'display)
+    (if (get-char-property (point-min) 'display)
 	(setq cursor-type nil truncate-lines t)
       (setq image-type "text"))
     (add-hook 'change-major-mode-hook (lambda () (image-minor-mode -1)) nil t)
     (message "%s" (concat (substitute-command-keys
 		      "Type \\[image-toggle-display] to view the image as ")
-		     (if (get-text-property (point-min) 'display)
+		     (if (get-char-property (point-min) 'display)
 			 "text" "an image") "."))))
 
 ;;;###autoload
@@ -281,7 +281,7 @@
 
 (defun image-toggle-display-text ()
   "Showing the text of the image file."
-  (if (get-text-property (point-min) 'display)
+  (if (get-char-property (point-min) 'display)
       (image-toggle-display)))
 
 (defvar archive-superior-buffer)
@@ -292,7 +292,7 @@
 This command toggles between showing the text of the image file
 and showing the image as an image."
   (interactive)
-  (if (get-text-property (point-min) 'display)
+  (if (get-char-property (point-min) 'display)
       (let ((inhibit-read-only t)
 	    (buffer-undo-list t)
 	    (modified (buffer-modified-p)))