changeset 38463:2e3306c6ed15

(command-line-1): Add support for +LINE:COLUMN command line argument.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 17 Jul 2001 10:56:35 +0000
parents a7043adf8855
children efc4642cfb1a
files lisp/startup.el
diffstat 1 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/startup.el	Tue Jul 17 10:55:28 2001 +0000
+++ b/lisp/startup.el	Tue Jul 17 10:56:35 2001 +0000
@@ -1436,7 +1436,8 @@
 		   (mapcar (lambda (elt)
 			     (list (concat "-" (car elt))))
 			   command-switch-alist)))
-	  (line 0))
+	  (line 0)
+	  (column 0))
 
       ;; Add the long X options to longopts.
       (setq tem command-line-x-option-alist)
@@ -1545,6 +1546,10 @@
 		((string-match "^\\+[0-9]+\\'" argi)
 		 (setq line (string-to-int argi)))
 		
+		((string-match "^\\+\\([0-9]+\\):\\([0-9]+\\)\\'" argi)
+		 (setq line (string-to-int (match-string 1 argi))
+		       column (string-to-int (match-string 2 argi))))
+
 		((setq tem (assoc argi command-line-x-option-alist))
 		 ;; Ignore X-windows options and their args if not using X.
 		 (setq command-line-args-left
@@ -1568,7 +1573,10 @@
 		     (find-file-other-window file)))
 		 (or (zerop line)
 		     (goto-line line))
-		 (setq line 0))
+		 (setq line 0)
+		 (unless (< column 1)
+		   (move-to-column (1- column)))
+		 (setq column 0))
 		
 		((equal argi "--")
 		 (setq just-files t))
@@ -1595,7 +1603,10 @@
 			     (find-file-other-window file)))
 			 (or (zerop line)
 			     (goto-line line))
-			 (setq line 0))))))))
+			 (setq line 0)
+			 (unless (< column 1)
+			   (move-to-column (1- column)))
+			 (setq column 0))))))))
       ;; If 3 or more files visited, and not all visible,
       ;; show user what they all are.  But leave the last one current.
       (and (> file-count 2)