File: emacsclient.patch

package info (click to toggle)
lilypond 2.2.6-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 11,260 kB
  • ctags: 7,622
  • sloc: cpp: 47,787; lisp: 11,217; python: 11,203; sh: 3,290; yacc: 2,011; lex: 831; perl: 373; ansic: 309; makefile: 132; csh: 8
file content (148 lines) | stat: -rw-r--r-- 5,078 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
diff -ur emacs-20.5/lib-src/ChangeLog emacs-hanwen/lib-src/ChangeLog
--- emacs-20.5/lib-src/ChangeLog	Fri Dec 10 17:25:36 1999
+++ emacs-hanwen/lib-src/ChangeLog	Sun Jul 16 23:00:54 2000
@@ -1,3 +1,7 @@
+2000-07-16  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+	
+	* emacsclient.c: Added support for +LINE:COLUMN style arguments.
+
 1999-12-04  Gerd Moellmann  <gerd@gnu.org>
 
 	* Version 20.5 released.
Only in emacs-hanwen/lib-src: ChangeLog~
diff -ur emacs-20.5/lib-src/emacsclient.c emacs-hanwen/lib-src/emacsclient.c
--- emacs-20.5/lib-src/emacsclient.c	Wed Nov  3 14:12:46 1999
+++ emacs-hanwen/lib-src/emacsclient.c	Sun Jul 16 22:10:35 2000
@@ -27,6 +27,7 @@
 #undef close
 #undef signal
 
+#include <ctype.h> 
 #include <stdio.h>
 #include <getopt.h>
 #ifdef STDC_HEADERS
@@ -323,7 +324,7 @@
       if (*argv[i] == '+')
 	{
 	  char *p = argv[i] + 1;
-	  while (*p >= '0' && *p <= '9') p++;
+	  while (isdigit (*p) || *p == ':') p++;
 	  if (*p != 0)
 	    fprintf (out, "%s/", quote_file_name (cwd));
 	}
@@ -466,7 +467,8 @@
       if (*modified_arg == '+')
 	{
 	  char *p = modified_arg + 1;
-	  while (*p >= '0' && *p <= '9') p++;
+	  while (isdigit (*p) || *p == ':')
+	    p++;
 	  if (*p != 0)
 	    need_cwd = 1;
 	}
Only in emacs-hanwen/lib-src: emacsclient.c~
diff -ur emacs-20.5/lib-src/emacsserver.c emacs-hanwen/lib-src/emacsserver.c
--- emacs-20.5/lib-src/emacsserver.c	Mon Feb 22 21:44:14 1999
+++ emacs-hanwen/lib-src/emacsserver.c	Sun Jul 16 22:09:52 2000
@@ -61,6 +61,7 @@
 #include <errno.h>
 #include <sys/stat.h>
 
+
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
Only in emacs-hanwen/lib-src: emacsserver.c~
Only in emacs-hanwen/lib-src: suf.el~
diff -ur emacs-20.5/lisp/ChangeLog emacs-hanwen/lisp/ChangeLog
--- emacs-20.5/lisp/ChangeLog	Fri Dec 10 17:25:02 1999
+++ emacs-hanwen/lisp/ChangeLog	Sun Jul 16 23:00:04 2000
@@ -1,3 +1,8 @@
+2000-07-16  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+	* server.el (server-process-filter,server-visit-files): add support for "LINE:COLUMN"
+	style emacsclient calls.
+
 1999-12-04  Gerd Moellmann  <gerd@gnu.org>
 
 	* Version 20.5 released.
Only in emacs-hanwen/lisp: ChangeLog~
diff -ur emacs-20.5/lisp/server.el emacs-hanwen/lisp/server.el
--- emacs-20.5/lisp/server.el	Sat Mar 13 01:20:25 1999
+++ emacs-hanwen/lisp/server.el	Sun Jul 16 23:04:41 2000
@@ -215,7 +215,8 @@
 				  default-file-name-coding-system)))
 	  client nowait
 	  (files nil)
-	  (lineno 1))
+	  (lineno 1)
+	  (columnno 0))
       ;; Remove this line from STRING.
       (setq string (substring string (match-end 0)))	  
       (if (string-match "^Error: " request)
@@ -232,9 +233,17 @@
 		  (setq request (substring request (match-end 0)))
 		  (if (string-match "\\`-nowait" arg)
 		      (setq nowait t)
-		    (if (string-match "\\`\\+[0-9]+\\'" arg)
-			;; ARG is a line number option.
-			(setq lineno (read (substring arg 1)))
+		    (cond
+    			;; ARG is a line number option.
+		     ((string-match "\\`\\+[0-9]+\\'" arg)
+		      (setq lineno (read (substring arg 1)))
+		      )
+		     ;; ARG is line number / column option. 
+		     ((string-match "\\`\\+[0-9]+:[0-9]+\\'" arg)
+		      (setq lineno (read (substring arg 1 (string-match ":" arg))))
+		      (setq columnno (read (substring arg (+ 1 (string-match ":" arg)))))
+		      )
+		     (t
 		      ;; ARG is a file name.
 		      ;; Collapse multiple slashes to single slashes.
 		      (setq arg (command-line-normalize-file-name arg))
@@ -253,9 +262,11 @@
 		      (if coding-system
 			  (setq arg (decode-coding-string arg coding-system)))
 		      (setq files
-			    (cons (list arg lineno)
+			    (cons (list arg lineno columnno)
 				  files))
-		      (setq lineno 1)))))
+		      (setq lineno 1)
+		      (setq columnno 0)
+		      )))))
 	      (server-visit-files files client nowait)
 	      ;; CLIENT is now a list (CLIENTNUM BUFFERS...)
 	      (or nowait
@@ -267,9 +278,11 @@
   ;; Save for later any partial line that remains.
   (setq server-previous-string string))
 
+
+
 (defun server-visit-files (files client &optional nowait)
   "Finds FILES and returns the list CLIENT with the buffers nconc'd.
-FILES is an alist whose elements are (FILENAME LINENUMBER).
+FILES is an alist whose elements are (FILENAME LINENUMBER COLUMNNUMBER).
 NOWAIT non-nil means this client is not waiting for the results,
 so don't mark these buffers specially, just visit them normally."
   ;; Bind last-nonmenu-event to force use of keyboard, not mouse, for queries.
@@ -297,6 +310,7 @@
 	      (set-buffer (find-file-noselect filen))
 	      (run-hooks 'server-visit-hook)))
 	  (goto-line (nth 1 (car files)))
+	  (move-to-column (nth 2 (car files)))
 	  (if (not nowait)
 	      (setq server-buffer-clients
 		    (cons (car client) server-buffer-clients)))
@@ -304,6 +318,7 @@
 	  (setq files (cdr files)))
       (set-buffer obuf))
     (nconc client client-record)))
+
 
 (defun server-buffer-done (buffer &optional for-killing)
   "Mark BUFFER as \"done\" for its client(s).
Only in emacs-hanwen/lisp: server.el.orig
Only in emacs-hanwen/lisp: server.el~