unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* "C-c C-c" binding for "submission" in server edit buffers
@ 2009-04-14  8:00 Miles Bader
  2009-04-14 12:52 ` Stefan Monnier
  2009-04-14 13:11 ` Jason Rumney
  0 siblings, 2 replies; 11+ messages in thread
From: Miles Bader @ 2009-04-14  8:00 UTC (permalink / raw)
  To: emacs-devel

I'm so used to using "C-c C-c" to mean "submit" in many emacs modes,
that I find myself getting a bit flummoxed when it doesn't do that in
buffers created by emacsclient.

The following patch seems to make things work more or less as my fingers
expect them too (maybe it should automatically save the buffer first, as
most uses of C-c C-c seem to do that); what do people think (of the
idea anyway ... maybe the implementation has some problem)?

-Miles


diff --git a/lisp/server.el b/lisp/server.el
index 10b08ad..e977dfe 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -194,6 +194,16 @@ in this way."
 (or (assq 'server-buffer-clients minor-mode-alist)
     (push '(server-buffer-clients " Server") minor-mode-alist))
 
+(defvar server-buffer-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map "\C-c\C-c" 'server-done)
+    map)
+  "Local keymap for emacs-server created buffers")
+
+(or (assq 'server-buffer-clients minor-mode-map-alist)
+    (push (cons 'server-buffer-clients server-buffer-map)
+	  minor-mode-map-alist))
+
 (defvar server-existing-buffer nil
   "Non-nil means the buffer existed before the server was asked to visit it.
 This means that the server should not kill the buffer when you say you
@@ -1228,6 +1238,7 @@ of the form (NEXT-BUFFER KILLED).  NEXT-BUFFER is another server buffer,
 as a suggestion for what to select next, or nil.
 KILLED is t if we killed BUFFER, which happens if it was created
 specifically for the clients and did not exist before their request for it."
+  (interactive)
   (when server-buffer-clients
     (if (server-temp-file-p)
 	;; For a temp file, save, and do make a non-numeric backup



-- 
My books focus on timeless truths.  -- Donald Knuth




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

end of thread, other threads:[~2009-04-15  3:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-14  8:00 "C-c C-c" binding for "submission" in server edit buffers Miles Bader
2009-04-14 12:52 ` Stefan Monnier
2009-04-14 13:52   ` Miles Bader
2009-04-14 17:00     ` Stefan Monnier
2009-04-14 18:26       ` Chong Yidong
2009-04-14 18:32         ` Lennart Borgman
2009-04-14 22:17           ` Miles Bader
2009-04-14 22:41             ` Lennart Borgman
2009-04-15  0:25               ` Miles Bader
2009-04-15  3:49             ` Stefan Monnier
2009-04-14 13:11 ` Jason Rumney

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).