aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2001-07-17 10:56:35 +0000
committerGerd Moellmann2001-07-17 10:56:35 +0000
commit1a4d41fae9b3890cfbb66f1bb5393d29dff79b9a (patch)
tree3dbbf69ffb93474c0672a20d7e429ae6d1408d75
parent8c493570987eb732584e7363a67abf128ed73631 (diff)
downloademacs-1a4d41fae9b3890cfbb66f1bb5393d29dff79b9a.tar.gz
emacs-1a4d41fae9b3890cfbb66f1bb5393d29dff79b9a.zip
(command-line-1): Add support for +LINE:COLUMN
command line argument.
-rw-r--r--lisp/startup.el17
1 files changed, 14 insertions, 3 deletions
diff --git a/lisp/startup.el b/lisp/startup.el
index da0e718c716..b5b8089dfa9 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1436,7 +1436,8 @@ Type \\[describe-distribution] for information on getting the latest version."))
1436 (mapcar (lambda (elt) 1436 (mapcar (lambda (elt)
1437 (list (concat "-" (car elt)))) 1437 (list (concat "-" (car elt))))
1438 command-switch-alist))) 1438 command-switch-alist)))
1439 (line 0)) 1439 (line 0)
1440 (column 0))
1440 1441
1441 ;; Add the long X options to longopts. 1442 ;; Add the long X options to longopts.
1442 (setq tem command-line-x-option-alist) 1443 (setq tem command-line-x-option-alist)
@@ -1545,6 +1546,10 @@ Type \\[describe-distribution] for information on getting the latest version."))
1545 ((string-match "^\\+[0-9]+\\'" argi) 1546 ((string-match "^\\+[0-9]+\\'" argi)
1546 (setq line (string-to-int argi))) 1547 (setq line (string-to-int argi)))
1547 1548
1549 ((string-match "^\\+\\([0-9]+\\):\\([0-9]+\\)\\'" argi)
1550 (setq line (string-to-int (match-string 1 argi))
1551 column (string-to-int (match-string 2 argi))))
1552
1548 ((setq tem (assoc argi command-line-x-option-alist)) 1553 ((setq tem (assoc argi command-line-x-option-alist))
1549 ;; Ignore X-windows options and their args if not using X. 1554 ;; Ignore X-windows options and their args if not using X.
1550 (setq command-line-args-left 1555 (setq command-line-args-left
@@ -1568,7 +1573,10 @@ Type \\[describe-distribution] for information on getting the latest version."))
1568 (find-file-other-window file))) 1573 (find-file-other-window file)))
1569 (or (zerop line) 1574 (or (zerop line)
1570 (goto-line line)) 1575 (goto-line line))
1571 (setq line 0)) 1576 (setq line 0)
1577 (unless (< column 1)
1578 (move-to-column (1- column)))
1579 (setq column 0))
1572 1580
1573 ((equal argi "--") 1581 ((equal argi "--")
1574 (setq just-files t)) 1582 (setq just-files t))
@@ -1595,7 +1603,10 @@ Type \\[describe-distribution] for information on getting the latest version."))
1595 (find-file-other-window file))) 1603 (find-file-other-window file)))
1596 (or (zerop line) 1604 (or (zerop line)
1597 (goto-line line)) 1605 (goto-line line))
1598 (setq line 0)))))))) 1606 (setq line 0)
1607 (unless (< column 1)
1608 (move-to-column (1- column)))
1609 (setq column 0))))))))
1599 ;; If 3 or more files visited, and not all visible, 1610 ;; If 3 or more files visited, and not all visible,
1600 ;; show user what they all are. But leave the last one current. 1611 ;; show user what they all are. But leave the last one current.
1601 (and (> file-count 2) 1612 (and (> file-count 2)