changeset 670:bff41708644e

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Tue, 02 Jun 1992 02:33:00 +0000
parents 4c64c671426f
children 21d23fa6fa2a
files lisp/hexl.el lisp/textmodes/fill.el
diffstat 2 files changed, 20 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/hexl.el	Mon Jun 01 08:28:58 1992 +0000
+++ b/lisp/hexl.el	Tue Jun 02 02:33:00 1992 +0000
@@ -68,6 +68,7 @@
 
 ;; routines
 
+;;;###autoload
 (defun hexl-mode (&optional arg)
   "\\<hexl-mode-map>
 A major mode for editting binary files in hex dump format.
@@ -131,11 +132,10 @@
 \\[hexl-insert-decimal-char] will insert a given decimal value (if it is between 0 and 255)
 into the buffer at the current point.
 
-\\[hexl-save-buffer] will save the buffer in is binary format.
-
 \\[hexl-mode-exit] will exit hexl-mode.
 
-Note: \\[write-file] will write the file out in HEXL FORMAT.
+Note: saving the file with any of the usual Emacs commands
+will actually convert it back to binary format while saving.
 
 You can use \\[hexl-find-file] to visit a file in hexl-mode.
 
@@ -156,6 +156,10 @@
     (setq hexl-mode-old-major-mode major-mode)
     (setq major-mode 'hexl-mode)
 
+    (make-local-variable 'write-contents-hooks)
+    (setq write-contents-hooks
+	  (cons 'hexl-save-buffer write-contents-hooks))
+
     (let ((modified (buffer-modified-p))
  	  (read-only buffer-read-only)
 	  (original-point (1- (point))))
@@ -191,8 +195,11 @@
 				 (kill-buffer buf)
 				 modified))
 			   (message "(No changes need to be saved)")
-			   nil)))
+			   nil))
+  ;; Return t to indicate we have saved t
+  t)
 
+;;;###autoload
 (defun hexl-find-file (filename)
   "Edit file FILENAME in hexl-mode.
 Switch to a buffer visiting file FILENAME, creating one in none exists."
@@ -202,7 +209,7 @@
       (hexl-mode)))
 
 (defun hexl-mode-exit (&optional arg)
-  "Exit hexl-mode returning to previous mode.
+  "Exit Hexl mode, returning to previous mode.
 With arg, don't unhexlify buffer."
   (interactive "p")
   (if (or (eq arg 1) (not arg))
@@ -623,11 +630,11 @@
     (define-key hexl-mode-map "\e\C-x" 'hexl-insert-hex-char)
     (define-key hexl-mode-map "\e\C-y" 'undefined)
 
-    (define-key hexl-mode-map "\ea" 'hexl-beginning-of-1k-page)
+    (define-key hexl-mode-map "\ea" 'undefined)
     (define-key hexl-mode-map "\eb" 'hexl-backward-word)
     (define-key hexl-mode-map "\ec" 'undefined)
     (define-key hexl-mode-map "\ed" 'undefined)
-    (define-key hexl-mode-map "\ee" 'hexl-end-of-1k-page)
+    (define-key hexl-mode-map "\ee" 'undefined)
     (define-key hexl-mode-map "\ef" 'hexl-forward-word)
     (define-key hexl-mode-map "\eg" 'hexl-goto-hex-address)
     (define-key hexl-mode-map "\eh" 'undefined)
@@ -652,6 +659,8 @@
 
     (define-key hexl-mode-map "\C-c\C-c" 'hexl-mode-exit)
 
+    (define-key hexl-mode-map "\C-x[" 'hexl-beginning-of-1k-page)
+    (define-key hexl-mode-map "\C-x]" 'hexl-end-of-1k-page)
     (define-key hexl-mode-map "\C-x\C-p" 'undefined)
     (define-key hexl-mode-map "\C-x\C-s" 'hexl-save-buffer)
     (define-key hexl-mode-map "\C-x\C-t" 'undefined))
--- a/lisp/textmodes/fill.el	Mon Jun 01 08:28:58 1992 +0000
+++ b/lisp/textmodes/fill.el	Tue Jun 02 02:33:00 1992 +0000
@@ -57,7 +57,8 @@
   ;; Don't let Adaptive Fill mode alter the fill prefix permanently.
   (let ((fill-prefix fill-prefix))
     ;; Figure out how this paragraph is indented, if desired.
-    (if adaptive-fill-mode
+    (if (and adaptive-fill-mode
+	     (or (null fill-prefix) (string= fill-prefix "")))
 	(save-excursion
 	  (goto-char (min from to))
 	  (if (eolp) (forward-line 1))
@@ -105,7 +106,7 @@
       ;; Make sure sentences ending at end of line get an extra space.
       ;; loses on split abbrevs ("Mr.\nSmith")
       (goto-char from)
-      (while (re-search-forward "[.?!][])\"']*$" nil t)
+      (while (re-search-forward "[.?!][])}\"']*$" nil t)
 	(insert ? ))
 
       ;; Then change all newlines to spaces.
@@ -123,7 +124,7 @@
 	(delete-region
 	 (+ (match-beginning 0)
 	    (if (save-excursion
-		  (skip-chars-backward " ])\"'")
+		  (skip-chars-backward " ]})\"'")
 		  (memq (preceding-char) '(?. ?? ?!)))
 		2 1))
 	 (match-end 0)))