all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* saveplace does not work with emacsclient
@ 2008-01-06  3:48 P G L Porta Mana
  2008-01-07 16:41 ` Karl Fogel
  0 siblings, 1 reply; 6+ messages in thread
From: P G L Porta Mana @ 2008-01-06  3:48 UTC (permalink / raw
  To: emacs-pretest-bug

Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the emacs-pretest-bug@gnu.org mailing list.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

Although saveplace-mode is activated by default, in files opened through
emacsclientw the point appears at the beginning of buffer.

This was tested with the following simple .emacs file:

 (server-start)
 (setq-default save-place t)
 (require 'saveplace)


If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
c:/Program Files/Emacs/etc/DEBUG for instructions.

In GNU Emacs 22.1.50.1 (i386-mingw-nt5.1.2600)
 of 2007-07-07 on NEUTRINO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --cflags -Ic:/Programme/GnuWin32/include'

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ENG
  locale-coding-system: cp1252
  default-enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  encoded-kbd-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent input:
n <help-echo> <down-mouse-1> <mouse-1> <drag-n-drop> 
<next> <next> <next> <next> <next> <next> <next> <next> 
<next> C-x k <return> <drag-n-drop> C-x k <return> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <menu-bar> <help-menu> <re
port-emacs-bug>

Recent messages:
Loading places from c:/Documents and Settings/All Users/Desktop/work/.emacs-places...done
For information about the GNU Project and its goals, type C-h C-p.
Loading bibtex...
Loading easymenu...done
Loading regexp-opt...done
Loading bibtex...done
Please type y, n, or !: 
For information about the GNU Project and its goals, type C-h C-p.
Loading url-util...done
Loading emacsbug...done

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: saveplace does not work with emacsclient
  2008-01-07 16:41 ` Karl Fogel
@ 2008-01-07 14:55   ` Juanma Barranquero
  2008-01-07 15:01   ` P G L Porta Mana
  1 sibling, 0 replies; 6+ messages in thread
From: Juanma Barranquero @ 2008-01-07 14:55 UTC (permalink / raw
  To: Karl Fogel; +Cc: emacs-pretest-bug, P G L Porta Mana

On Jan 7, 2008 5:41 PM, Karl Fogel <kfogel@red-bean.com> wrote:

> Is "emacsclientw" a typo for "emacsclient", or is there some wrapper
> script going on here that I don't know about?

On Windows, emacsclient.c is built as emacsclient.exe (a console app)
and emacsclientw.exe (a Windows app). The latter is useful from
desktop shortcuts, because error messages are shown in a dialog,
instead of going to stdout/stderr.

             Juanma

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: saveplace does not work with emacsclient
  2008-01-07 16:41 ` Karl Fogel
  2008-01-07 14:55   ` Juanma Barranquero
@ 2008-01-07 15:01   ` P G L Porta Mana
  2008-01-07 19:02     ` P G L Porta Mana
  1 sibling, 1 reply; 6+ messages in thread
From: P G L Porta Mana @ 2008-01-07 15:01 UTC (permalink / raw
  To: Karl Fogel; +Cc: emacs-pretest-bug

Thanks for your answer. I use a precompiled version of Emacs (got from
AucTeX website) on a Windows XP machine. There is both an emacsclient.exe
and an emacsclientw.exe binary there. The second eliminates the
appearance of a cmd shell. More can't I say since I don't understand more
than that.

I have temporarily fixed the bug now, by setting

(setq server-visit-hook (quote (save-place-find-file-hook)))

in my .emacs file. I must yet see whether this interferes with inverse
search, ie when emacsclient(w) is called with the +[line] option.

- Luca


On Mon, 07 Jan 2008 08:41:33 -0800
Karl Fogel <kfogel@red-bean.com> wrote:

> P G L  Porta Mana <porta.mana@gmail.com> writes:
> > Although saveplace-mode is activated by default, in files opened
> > through emacsclientw the point appears at the beginning of buffer.
> >
> > This was tested with the following simple .emacs file:
> >
> >  (server-start)
> >  (setq-default save-place t)
> >  (require 'saveplace)
> 
> Is "emacsclientw" a typo for "emacsclient", or is there some wrapper
> script going on here that I don't know about?
> 
> I will reproduce and debug/fix when I get a chance.  Thanks for the
> report.
> 
> -Karl

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: saveplace does not work with emacsclient
  2008-01-06  3:48 saveplace does not work with emacsclient P G L Porta Mana
@ 2008-01-07 16:41 ` Karl Fogel
  2008-01-07 14:55   ` Juanma Barranquero
  2008-01-07 15:01   ` P G L Porta Mana
  0 siblings, 2 replies; 6+ messages in thread
From: Karl Fogel @ 2008-01-07 16:41 UTC (permalink / raw
  To: P G L Porta Mana; +Cc: emacs-pretest-bug

P G L  Porta Mana <porta.mana@gmail.com> writes:
> Although saveplace-mode is activated by default, in files opened through
> emacsclientw the point appears at the beginning of buffer.
>
> This was tested with the following simple .emacs file:
>
>  (server-start)
>  (setq-default save-place t)
>  (require 'saveplace)

Is "emacsclientw" a typo for "emacsclient", or is there some wrapper
script going on here that I don't know about?

I will reproduce and debug/fix when I get a chance.  Thanks for the report.

-Karl

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: saveplace does not work with emacsclient
  2008-01-07 15:01   ` P G L Porta Mana
@ 2008-01-07 19:02     ` P G L Porta Mana
  2008-01-15 21:50       ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: P G L Porta Mana @ 2008-01-07 19:02 UTC (permalink / raw
  To: emacs-pretest-bug

I wrote:

> I have temporarily fixed the bug now, by setting
> 
> (setq server-visit-hook (quote (save-place-find-file-hook)))
> 
> in my .emacs file. I must yet see whether this interferes with inverse
> search, ie when emacsclient(w) is called with the +[line] option.

No, it doesn't interfere, so it's a good solution for the moment.
Something similar should preferably be present either in saveplace.el or
in server.el.

Cordially,
Piero

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: saveplace does not work with emacsclient
  2008-01-07 19:02     ` P G L Porta Mana
@ 2008-01-15 21:50       ` Stefan Monnier
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2008-01-15 21:50 UTC (permalink / raw
  To: P G L Porta Mana; +Cc: emacs-pretest-bug

>> I have temporarily fixed the bug now, by setting
>> 
>> (setq server-visit-hook (quote (save-place-find-file-hook)))
>> 
>> in my .emacs file. I must yet see whether this interferes with inverse
>> search, ie when emacsclient(w) is called with the +[line] option.

> No, it doesn't interfere, so it's a good solution for the moment.
> Something similar should preferably be present either in saveplace.el or
> in server.el.

Can you try the patch below (and remove your temporary workaround of
course) and tell us if it fixes the problem?


        Stefan


--- orig/lisp/server.el
+++ mod/lisp/server.el
@@ -805,8 +805,8 @@
                 (tty-name nil)       ;nil, `window-system', or the tty name.
                 tty-type             ;string.
 		(files nil)
-		(lineno 1)
-		(columnno 0)
+		(lineno nil)
+		(columnno nil)
 		command-line-args-left
 		arg)
 	    ;; Remove this line from STRING.
@@ -889,9 +889,10 @@
 		    (setq file (command-line-normalize-file-name file))
 		    (push (list file lineno columnno) files)
 		    (server-log (format "New file: %s (%d:%d)"
-                                        file lineno columnno) proc))
-		  (setq lineno 1
-			columnno 0))
+                                        file (or lineno 0) (or columnno 0))
+                                proc))
+		  (setq lineno nil
+			columnno nil))
 
 		 ;; -eval EXPR:  Evaluate a Lisp expression.
 		 ((and (equal "-eval" arg)
@@ -901,8 +902,8 @@
 			(setq expr (decode-coding-string expr coding-system)))
                     (push (lambda () (server-eval-and-print expr proc))
                           commands)
-		    (setq lineno 1
-			  columnno 0)))
+		    (setq lineno nil
+			  columnno nil)))
 
 		 ;; -env NAME=VALUE:  An environment variable.
 		 ((and (equal "-env" arg) command-line-args-left)
@@ -995,10 +996,11 @@
   "Move point to the position indicated in FILE-LINE-COL.
 FILE-LINE-COL should be a three-element list as described in
 `server-visit-files'."
-  (goto-line (nth 1 file-line-col))
-  (let ((column-number (nth 2 file-line-col)))
-    (when (> column-number 0)
-      (move-to-column (1- column-number)))))
+  (when (nth 1 file-line-col)
+    (goto-line (nth 1 file-line-col))
+    (let ((column-number (nth 2 file-line-col)))
+      (when (> column-number 0)
+        (move-to-column (1- column-number))))))
 
 (defun server-visit-files (files proc &optional nowait)
   "Find FILES and return a list of buffers created.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-01-15 21:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-06  3:48 saveplace does not work with emacsclient P G L Porta Mana
2008-01-07 16:41 ` Karl Fogel
2008-01-07 14:55   ` Juanma Barranquero
2008-01-07 15:01   ` P G L Porta Mana
2008-01-07 19:02     ` P G L Porta Mana
2008-01-15 21:50       ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.