changeset 107212:3417b6095672

Merge from trunk
author Jan D. <jan.h.d@swipnet.se>
date Sun, 14 Feb 2010 18:31:45 +0100
parents b5f6df970d0f (current diff) 541b767fb366 (diff)
children 4e1df9366cdd
files
diffstat 6 files changed, 109 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Feb 13 14:27:32 2010 +0100
+++ b/lisp/ChangeLog	Sun Feb 14 18:31:45 2010 +0100
@@ -1,3 +1,24 @@
+2010-02-14  Michael Albinus  <michael.albinus@gmx.de>
+
+	* files.el (insert-directory): When WILDCARD-REGEXP and
+	FULL-DIRECTORY-P are nil, insert the file entry instead of the
+	whole directory.  (Bug#5551)
+
+	* net/ange-ftp.el (ange-ftp-insert-directory): Insert "  " for
+	dired's alignment sanity.  (Bug#5516)
+
+2010-02-14  Juri Linkov  <juri@jurta.org>
+
+	* man.el (Man-fontify-manpage, Man-cleanup-manpage):
+	Remove remaining ^H with their preceding chars.  (Bug#5566)
+
+2010-02-13  Glenn Morris  <rgm@gnu.org>
+
+	* simple.el (transpose-subr): Give it a doc-string.
+
+	* textmodes/paragraphs.el (transpose-paragraphs, transpose-sentences):
+	Doc fixes.
+
 2010-02-12  Juri Linkov  <juri@jurta.org>
 
 	* arc-mode.el (archive-unique-fname): Make directories for nested
--- a/lisp/files.el	Sat Feb 13 14:27:32 2010 +0100
+++ b/lisp/files.el	Sun Feb 14 18:31:45 2010 +0100
@@ -5699,6 +5699,11 @@
 				 (shell-quote-wildcard-pattern pattern))))
 		    ;; SunOS 4.1.3, SVr4 and others need the "." to list the
 		    ;; directory if FILE is a symbolic link.
+ 		    (unless full-directory-p
+ 		      (setq switches
+ 			    (if (stringp switches)
+ 				(concat switches " -d")
+ 			      (add-to-list 'switches "-d" 'append))))
 		    (apply 'call-process
 			   insert-directory-program nil t nil
 			   (append
--- a/lisp/man.el	Sat Feb 13 14:27:32 2010 +0100
+++ b/lisp/man.el	Sun Feb 14 18:31:45 2010 +0100
@@ -1087,6 +1087,11 @@
     (while (re-search-forward "[-|]\\(\b[-|]\\)+" nil t)
       (replace-match "+")
       (put-text-property (1- (point)) (point) 'face 'bold))
+    ;; When the header is longer than the manpage name, groff tries to
+    ;; condense it to a shorter line interspered with ^H.  Remove ^H with
+    ;; their preceding chars (but don't put Man-overstrike-face).  (Bug#5566)
+    (goto-char (point-min))
+    (while (re-search-forward ".\b" nil t) (backward-delete-char 2))
     (goto-char (point-min))
     ;; Try to recognize common forms of cross references.
     (Man-highlight-references)
@@ -1174,6 +1179,11 @@
 	))
   (goto-char (point-min))
   (while (re-search-forward "[-|]\\(\b[-|]\\)+" nil t) (replace-match "+"))
+  ;; When the header is longer than the manpage name, groff tries to
+  ;; condense it to a shorter line interspered with ^H.  Remove ^H with
+  ;; their preceding chars (but don't put Man-overstrike-face).  (Bug#5566)
+  (goto-char (point-min))
+  (while (re-search-forward ".\b" nil t) (backward-delete-char 2))
   (Man-softhyphen-to-minus)
   (message "%s man page cleaned up" Man-arguments))
 
--- a/lisp/net/ange-ftp.el	Sat Feb 13 14:27:32 2010 +0100
+++ b/lisp/net/ange-ftp.el	Sun Feb 14 18:31:45 2010 +0100
@@ -4517,44 +4517,54 @@
     ;; because some FTP servers react to "ls foo" by listing the symlink foo
     ;; rather than the directory it points to.  Now that ange-ftp-ls uses
     ;; "cd foo; ls" instead, this is not necesssary any more.
-    (insert
-     (cond
-      (wildcard
-       (let ((default-directory (file-name-directory file)))
-         (ange-ftp-ls (file-name-nondirectory file) switches nil nil t)))
-      (full
-       (ange-ftp-ls file switches 'parse))
-      (t
-       ;; If `full' is nil we're going to do `ls' for a single file.
-       ;; Problem is that for various reasons, ange-ftp-ls needs to cd and
-       ;; then do an ls of current dir, which obviously won't work if we
-       ;; want to ls a file.  So instead, we get a full listing of the
-       ;; parent directory and extract the line corresponding to `file'.
-       (when (string-match "-?d\\'" switches)
-         ;; Remove "d" which dired added to `switches'.
-         (setq switches (substring switches 0 (match-beginning 0))))
-       (setq file (directory-file-name file))
-       (let* ((dirlist (ange-ftp-ls (or (file-name-directory file) ".")
-                                    switches 'parse))
-              (filename (file-name-nondirectory file))
-              (case-fold-search nil))
-         ;; FIXME: This presumes a particular output format, which is
-         ;; basically Unix.
-         (if (string-match (concat "^.+[^ ] " (regexp-quote filename)
-                                   "\\( -> .*\\)?[@/*=]?\n") dirlist)
-             (match-string 0 dirlist)
-           "")))))
-
-    ;; The inserted file could be from somewhere else.
-    (when (and (not wildcard) (not full)
-	       (search-backward
-		(if (zerop (length (file-name-nondirectory
-				    (expand-file-name file))))
-		    "."
-		  (file-name-nondirectory file))
-		nil 'noerror))
-      (replace-match (file-relative-name (expand-file-name file)) t)
-      (goto-char (point-max)))))
+    (let ((beg (point))
+	  (end (point-marker)))
+      (set-marker-insertion-type end t)
+      (insert
+       (cond
+	(wildcard
+	 (let ((default-directory (file-name-directory file)))
+	   (ange-ftp-ls (file-name-nondirectory file) switches nil nil t)))
+	(full
+	 (ange-ftp-ls file switches 'parse))
+	(t
+	 ;; If `full' is nil we're going to do `ls' for a single file.
+	 ;; Problem is that for various reasons, ange-ftp-ls needs to cd and
+	 ;; then do an ls of current dir, which obviously won't work if we
+	 ;; want to ls a file.  So instead, we get a full listing of the
+	 ;; parent directory and extract the line corresponding to `file'.
+	 (when (string-match "-?d\\'" switches)
+	   ;; Remove "d" which dired added to `switches'.
+	   (setq switches (substring switches 0 (match-beginning 0))))
+	 (setq file (directory-file-name file))
+	 (let* ((dirlist (ange-ftp-ls (or (file-name-directory file) ".")
+				      switches 'parse))
+		(filename (file-name-nondirectory file))
+		(case-fold-search nil))
+	   ;; FIXME: This presumes a particular output format, which is
+	   ;; basically Unix.
+	   (if (string-match (concat "^.+[^ ] " (regexp-quote filename)
+				     "\\( -> .*\\)?[@/*=]?\n") dirlist)
+	       (match-string 0 dirlist)
+	     "")))))
+
+      ;; Insert "  " for dired's alignment sanity.
+      (goto-char beg)
+      (while (re-search-forward "^\\(\\S-\\)" end 'move)
+	(replace-match "  \\1"))
+
+      ;; The inserted file could be from somewhere else.
+      (when (and (not wildcard) (not full)
+		 (search-backward
+		  (if (zerop (length (file-name-nondirectory
+				      (expand-file-name file))))
+		      "."
+		    (file-name-nondirectory file))
+		  nil 'noerror))
+	(replace-match (file-relative-name (expand-file-name file)) t)
+	(goto-char end))
+
+      (set-marker end nil))))
 
 (defun ange-ftp-dired-uncache (dir)
   (if (ange-ftp-ftp-name (expand-file-name dir))
--- a/lisp/simple.el	Sat Feb 13 14:27:32 2010 +0100
+++ b/lisp/simple.el	Sun Feb 14 18:31:45 2010 +0100
@@ -4854,7 +4854,18 @@
 		       (forward-line arg))))
 		  arg))
 
+;; FIXME seems to leave point BEFORE the current object when ARG = 0,
+;; which seems inconsistent with the ARG /= 0 case.
+;; FIXME document SPECIAL.
 (defun transpose-subr (mover arg &optional special)
+  "Subroutine to do the work of transposing objects.
+Works for lines, sentences, paragraphs, etc.  MOVER is a function that
+moves forward by units of the given object (e.g. forward-sentence,
+forward-paragraph).  If ARG is zero, exchanges the current object
+with the one containing mark.  If ARG is an integer, moves the
+current object past ARG following (if ARG is positive) or
+preceding (if ARG is negative) objects, leaving point after the
+current object."
   (let ((aux (if special mover
 	       (lambda (x)
 		 (cons (progn (funcall mover x) (point))
--- a/lisp/textmodes/paragraphs.el	Sat Feb 13 14:27:32 2010 +0100
+++ b/lisp/textmodes/paragraphs.el	Sun Feb 14 18:31:45 2010 +0100
@@ -1,7 +1,8 @@
 ;;; paragraphs.el --- paragraph and sentence parsing
 
 ;; Copyright (C) 1985, 1986, 1987, 1991, 1994, 1995, 1996, 1997, 1999, 2000,
-;;   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;;   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;;   Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: wp
@@ -409,7 +410,12 @@
   (kill-region (point) (progn (backward-paragraph arg) (point))))
 
 (defun transpose-paragraphs (arg)
-  "Interchange this (or next) paragraph with previous one."
+  "Interchange the current paragraph with the next one.
+With prefix argument ARG a non-zero integer, moves the current
+paragraph past ARG paragraphs, leaving point after the current paragraph.
+If ARG is positive, moves the current paragraph forwards, if
+ARG is negative moves it backwards.  If ARG is zero, exchanges
+the current paragraph with the one containing the mark."
   (interactive "*p")
   (transpose-subr 'forward-paragraph arg))
 
@@ -509,7 +515,12 @@
    nil t))
 
 (defun transpose-sentences (arg)
-  "Interchange this (next) and previous sentence."
+  "Interchange the current sentence with the next one.
+With prefix argument ARG a non-zero integer, moves the current
+sentence past ARG sentences, leaving point after the current sentence.
+If ARG is positive, moves the current sentence forwards, if
+ARG is negative moves it backwards.  If ARG is zero, exchanges
+the current sentence with the one containing the mark."
   (interactive "*p")
   (transpose-subr 'forward-sentence arg))