🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #87457

19.26: jka-compr patch

#87457
From: Jay Adams
Date: Thu, 15 Sep 1994 04:58
64 lines
2475 bytes

Please apply this patch to the 19.26 version of jka-compr.  It fixes
two bugs in jka-compr-insert-file-contents relating to running the
after-insert-file-functions:

- they should be run after the visited file name of the buffer is set,
  the file is unlocked, and so on (as they are in the real
  insert-file-contents). 

- you need to check the return value of the function to make sure it
  is an integer.



*** jka-compr.el	Thu Sep 15 00:41:48 1994
--- jka-compr.el	Thu Sep 15 00:43:48 1994
***************
*** 529,543 ****
  						nil
  						uncompress-args))
  		      (setq size (- (point) start))
! 		      (goto-char start)
! 		      ;; Run the functions that insert-file-contents would.
! 		      (let ((list after-insert-file-functions)
! 			    (value size))
! 			(while list
! 			  (setq value (funcall (car list) size))
! 			  (if value
! 			      (setq size value))
! 			  (setq list (cdr list)))))
  
  		  (error
  		   (if (and (eq (car error-code) 'file-error)
--- 529,535 ----
  						nil
  						uncompress-args))
  		      (setq size (- (point) start))
! 		      (goto-char start))
  
  		  (error
  		   (if (and (eq (car error-code) 'file-error)
***************
*** 570,575 ****
--- 562,580 ----
  	   notfound
  	   (signal 'file-error
  		   (cons "Opening input file" (nth 2 notfound))))
+ 
+ 	  ;; Run the functions that insert-file-contents would.
+ 	  (let ((p after-insert-file-functions)
+ 		(insval size))
+ 	    (while p
+ 	      (setq insval (funcall (car p) size))
+ 	      (if insval
+ 		  (progn
+ 		    (or (integerp insval)
+ 			(signal 'wrong-type-argument
+ 				(list 'integerp insval)))
+ 		    (setq size insval)))
+ 	      (setq p (cdr p))))
  
  	  (list filename size))
  
Technical Details
Message-ID: <199409150455.AAA07757@mustang.ece.cmu.edu>
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!deathstar.cris.com!news1.oakland.edu!vtc.tacom.army.mil!ulowell!europa.eng.gtefsd.com!emory!swrinde!cs.utexas.edu!uunet!cis.ohio-state.edu!ece.cmu.edu!jka

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,f85922bfd68182f3,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1994-09-16 14:28:36 PST
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!deathstar.cris.com!news1.oakland.edu!vtc.tacom.army.mil!ulowell!europa.eng.gtefsd.com!emory!swrinde!cs.utexas.edu!uunet!cis.ohio-state.edu!ece.cmu.edu!jka
From: jka@ece.cmu.edu (Jay Adams)
Newsgroups: gnu.emacs.bug
Subject: 19.26: jka-compr patch
Date: 15 Sep 1994 00:58:10 -0400
Organization: GNUs Not Usenet
Lines: 64
Sender: daemon@cis.ohio-state.edu
Approved: bug-gnu-emacs@prep.ai.mit.edu
Distribution: gnu
Message-ID: <199409150455.AAA07757@mustang.ece.cmu.edu>