emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp/term ns-win.el


From: Adrian Robert
Subject: [Emacs-diffs] emacs/lisp/term ns-win.el
Date: Sun, 25 Jan 2009 19:49:07 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Adrian Robert <arobert> 09/01/25 19:49:07

Modified files:
        lisp/term      : ns-win.el 

Log message:
                * term/ns-win.el (ns-insert-working-text, 
ns-delete-working-text):
                Remove from global map and key definitions.
                (ns-toggle-toolbar, ns-info-prefs): Add to global map and key
                definitions.
                (ns-show-preferences-help, ns-unput-working-text): New 
functions.
                (ns-unecho-working-text): Update message.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/term/ns-win.el?cvsroot=emacs&r1=1.33&r2=1.34

Patches:
Index: ns-win.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/term/ns-win.el,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- ns-win.el   24 Jan 2009 10:27:05 -0000      1.33
+++ ns-win.el   25 Jan 2009 19:49:07 -0000      1.34
@@ -289,11 +289,10 @@
 (define-key global-map [ns-drag-text] 'ns-insert-text)
 (define-key global-map [ns-change-font] 'ns-respond-to-change-font)
 (define-key global-map [ns-open-file-line] 'ns-open-file-select-line)
-(define-key global-map [ns-insert-working-text] 'ns-insert-working-text)
-(define-key global-map [ns-delete-working-text] 'ns-delete-working-text)
 (define-key global-map [ns-spi-service-call] 'ns-spi-service-call)
 (define-key global-map [ns-new-frame] 'make-frame)
-
+(define-key global-map [ns-toggle-toolbar] 'ns-toggle-toolbar)
+(define-key global-map [ns-info-prefs] 'ns-show-preferences-help)
 
 
 ;; Functions to set environment variables by running a subshell.
@@ -398,10 +397,12 @@
              (cons (logior (lsh 0 16)   6) 'ns-drag-text)
              (cons (logior (lsh 0 16)   7) 'ns-change-font)
              (cons (logior (lsh 0 16)   8) 'ns-open-file-line)
-             (cons (logior (lsh 0 16)   9) 'ns-insert-working-text)
-             (cons (logior (lsh 0 16)  10) 'ns-delete-working-text)
+;             (cons (logior (lsh 0 16)   9) 'ns-insert-working-text)
+;             (cons (logior (lsh 0 16)  10) 'ns-delete-working-text)
              (cons (logior (lsh 0 16)  11) 'ns-spi-service-call)
              (cons (logior (lsh 0 16)  12) 'ns-new-frame)
+             (cons (logior (lsh 0 16)  13) 'ns-toggle-toolbar)
+             (cons (logior (lsh 0 16)  14) 'ns-info-prefs)
              (cons (logior (lsh 1 16)  32) 'f1)
              (cons (logior (lsh 1 16)  33) 'f2)
              (cons (logior (lsh 1 16)  34) 'f3)
@@ -684,7 +685,7 @@
   (interactive)
   (ns-arrange-frames nil))
 
-(defun ns-arrange-frames ( vis)
+(defun ns-arrange-frames (vis)
   (let ((frame (next-frame))
        (end-frame (selected-frame))
        (inc-x 20)                      ;relative position of frames
@@ -792,8 +793,10 @@
   "Length of working text during compose sequence insert.")
 (make-variable-buffer-local 'ns-working-overlay-len)
 
-;; Based on mac-win.el 2007/08/26 unicode-2.  This will fail if called
-;; from an "interactive" function.
+(defvar ns-working-text)               ; nsterm.m
+
+;; Test if in echo area, based on mac-win.el 2007/08/26 unicode-2.
+;; This will fail if called from a NONASCII_KEYSTROKE event on the global map.
 (defun ns-in-echo-area ()
   "Whether, for purposes of inserting working composition text, the minibuffer
 is currently being used."
@@ -812,16 +815,20 @@
 ;; The 'interactive' here stays for subinvocations, so the ns-in-echo-area
 ;; always returns nil for some reason.  If this WASN'T the case, we could
 ;; map this to [ns-insert-working-text] and eliminate Fevals in nsterm.m.
+;; These functions test whether in echo area and delegate accordingly.
 (defun ns-put-working-text ()
   (interactive)
   (if (ns-in-echo-area) (ns-echo-working-text) (ns-insert-working-text)))
-
-(defvar ns-working-text)               ; nsterm.m
+(defun ns-unput-working-text ()
+  (interactive)
+  (if (ns-in-echo-area) (ns-unecho-working-text) (ns-delete-working-text)))
 
 (defun ns-insert-working-text ()
   "Insert contents of ns-working-text as UTF8 string and mark with
 ns-working-overlay.  Any previously existing working text is cleared first.
 The overlay is assigned the face ns-working-text-face."
+;; FIXME: if buffer is read-only, don't try to insert anything
+;;  and if text is bound to a command, execute that instead (Bug#1453)
   (interactive)
   (if ns-working-overlay (ns-delete-working-text))
   (let ((start (point)))
@@ -857,6 +864,7 @@
   (let ((msg (current-message))
        message-log-max)
     (setq msg (substring msg 0 (- (length msg) ns-working-overlay-len)))
+    (message "%s" msg)
     (setq ns-working-overlay-len 0)
     (setq ns-working-overlay nil)))
 
@@ -1229,6 +1237,12 @@
 
 ;;;; Dialog-related functions.
 
+
+(defun ns-show-preferences-help ()
+ "Show NS Preferences panel section in the Emacs manual"
+  (interactive)
+  (info "(emacs)Mac / GNUstep Customization"))
+
 ;; Ask user for confirm before printing.  Due to Kevin Rodgers.
 (defun ns-print-buffer ()
   "Interactive front-end to `print-buffer': asks for user confirmation first."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]