Dear Developers,
The problem is gnuclient will always set a point position weither if
the user request or not. This patch change the default point position
logic and if the user didn't request to move the startup-cursor
position we don't move it. This will let something like where-was-i-db
work for gnuclient started buffer.
Thanks,
FKtPp
lib-src/ChangeLog addition:
2009-08-15 It's me FKtPp ;) <m_pupil(a)yahoo.com.cn>
* gnuclient.c (main): Do not set start point position if user
didn't requested to do so
lisp/ChangeLog addition:
2009-08-15 It's me FKtPp ;) <m_pupil(a)yahoo.com.cn>
* gnuserv.el (gnuserv-edit-files): Don't run goto line if the
gnuclient request to open a file only (a linenumber of nil).
core-beta[XEmacs] source patch:
Diff command: hg diff -wbB
Files affected: lisp/gnuserv.el lib-src/gnuclient.c
diff -r e95ddfd6a409 lib-src/gnuclient.c
--- lib-src/gnuclient.c Mon Aug 03 10:30:47 2009 +0200
+++ lib-src/gnuclient.c Sat Aug 15 10:20:34 2009 +0800
@@ -299,7 +299,7 @@
int
main (int argc, char *argv[])
{
- int starting_line = 1; /* line to start editing at */
+ int starting_line = 0; /* line to start editing at */
char command[QXE_PATH_MAX+50];/* emacs command buffer */
char fullpath[QXE_PATH_MAX+1];/* full pathname to file */
char *eval_form = NULL; /* form to evaluate with `-eval' */
@@ -661,14 +661,10 @@
{
if (i < argc - 1 && *argv[i] == '+')
starting_line = atoi (argv[i++]);
- else
- starting_line = 1;
+
/* If the last argument is +something, treat it as a file. */
- if (i == argc)
- {
- starting_line = 1;
- --i;
- }
+ if (i == argc) --i;
+
filename_expand (fullpath, argv[i]);
#ifdef INTERNET_DOMAIN_SOCKETS
path = (char *) malloc (strlen (remotepath) + strlen (fullpath) +
1);
@@ -676,7 +672,12 @@
#else
path = my_strdup (fullpath);
#endif
- sprintf (command, "(%d . %s)", starting_line, clean_string (path));
+ if ( starting_line ) {
+ sprintf (command, "(%d . %s)", starting_line, clean_string
(path));
+ } else {
+ sprintf (command, "(nil . %s)", clean_string (path));
+ }
+
send_string (s, command);
free (path);
} /* for */
diff -r e95ddfd6a409 lisp/gnuserv.el
--- lisp/gnuserv.el Mon Aug 03 10:30:47 2009 +0200
+++ lisp/gnuserv.el Sat Aug 15 10:20:34 2009 +0800
@@ -481,7 +481,7 @@
gnuserv-view-file-function
gnuserv-find-file-function)
path)
- (goto-line line)
+ (when line (goto-line line))
;; Don't memorize the quick and view buffers.
(unless (or quick view)
(pushnew (current-buffer) (gnuclient-buffers client))
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches