[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs lisp/ChangeLog lisp/term/ns-win.el src/Ch...
From: |
David Reitter |
Subject: |
[Emacs-diffs] emacs lisp/ChangeLog lisp/term/ns-win.el src/Ch... |
Date: |
Sat, 14 Mar 2009 21:20:13 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: David Reitter <davidswelt> 09/03/14 21:20:12
Modified files:
lisp : ChangeLog
lisp/term : ns-win.el
src : ChangeLog nsfns.m nsfont.m nsterm.h nsterm.m
Log message:
Unify shutdown handling under NS, via ns-power-off key event (where
appropriate) and save-buffers-kill-emacs.
remove NS-specific preferences window that used to show NS-specific
preferences.
Integrate preferences in Lisp accessible customization system where
possible.
Remove ns-expand-space, because it can be set only during fontloading
(i.e. not at runtime),
and because of redundancy with line-spacing frame parameter.
Remove loading of most and saving of all NS resources (from
org.gnu.Emacs.plist).
nsterm.m (ns_shutdown_properly, -terminate): remove global state
variable as it was never reset
(ns_term_init): remove initialization of Lisp-settable defaults and
ns_expand_space
(-setPanelFromDefaultValues): remove ns_expand_space.
(-showPreferencesWindow): send new KEY_NS_SHOW_PREFS key.
nsfont.m (nsfont_open): remove ns_expand_space, assume -0.5 i.e. no
additional spacing, similar to Carbon port.
nsterm.h: define KEY_NS_SHOW_PREFS key.
nsfns.m (ns-popup-prefs-panel): remove.
term/ns-win.el (ns-expand-space): remove.
(ns-show-prefs event): run `customize'.
(ns-power-off): run `save-buffers-kill-emacs', but ask user whether to
save files (as is standard)
(clipboard-yank, clipboard-kill-ring-save, clipboard-kill-region)
(menu-bar-enable-clipboard): do not undefine these.
(ns-save-preferences,ns-save-options,ns-show-preferences-help): remove.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.15475&r2=1.15476
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/term/ns-win.el?cvsroot=emacs&r1=1.37&r2=1.38
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ChangeLog?cvsroot=emacs&r1=1.7426&r2=1.7427
http://cvs.savannah.gnu.org/viewcvs/emacs/src/nsfns.m?cvsroot=emacs&r1=1.40&r2=1.41
http://cvs.savannah.gnu.org/viewcvs/emacs/src/nsfont.m?cvsroot=emacs&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/emacs/src/nsterm.h?cvsroot=emacs&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/emacs/src/nsterm.m?cvsroot=emacs&r1=1.66&r2=1.67
Patches:
Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.15475
retrieving revision 1.15476
diff -u -b -r1.15475 -r1.15476
--- lisp/ChangeLog 14 Mar 2009 21:04:43 -0000 1.15475
+++ lisp/ChangeLog 14 Mar 2009 21:19:56 -0000 1.15476
@@ -1,3 +1,13 @@
+2009-03-14 David Reitter <address@hidden>
+
+ * term/ns-win.el (ns-expand-space): remove.
+ (ns-show-prefs event): run `customize'.
+ (ns-power-off): run `save-buffers-kill-emacs', but ask user
+ whether to save files (as is standard)
+ (clipboard-yank, clipboard-kill-ring-save, clipboard-kill-region)
+ (menu-bar-enable-clipboard): do not undefine these.
+ (ns-save-preferences,ns-save-options,ns-show-preferences-help): remove.
+
2009-03-14 Glenn Morris <address@hidden>
* mail/sendmail.el (mail-interactive): Doc fix.
Index: lisp/term/ns-win.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/term/ns-win.el,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- lisp/term/ns-win.el 24 Feb 2009 21:11:56 -0000 1.37
+++ lisp/term/ns-win.el 14 Mar 2009 21:20:00 -0000 1.38
@@ -283,8 +283,7 @@
;; Special Nextstep-generated events are converted to function keys. Here
;; are the bindings for them.
-(define-key global-map [ns-power-off]
- (lambda () (interactive) (save-buffers-kill-emacs t)))
+(define-key global-map [ns-power-off] 'save-buffers-kill-emacs)
(define-key global-map [ns-open-file] 'ns-find-file)
(define-key global-map [ns-open-temp-file] [ns-open-file])
(define-key global-map [ns-drag-file] 'ns-insert-file)
@@ -296,7 +295,7 @@
(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)
+(define-key global-map [ns-show-prefs] 'customize)
;; Functions to set environment variables by running a subshell.
@@ -406,7 +405,7 @@
(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 0 16) 14) 'ns-show-prefs)
(cons (logior (lsh 1 16) 32) 'f1)
(cons (logior (lsh 1 16) 33) 'f2)
(cons (logior (lsh 1 16) 34) 'f3)
@@ -494,10 +493,10 @@
;; Must come after keybindings.
-(fmakunbound 'clipboard-yank)
-(fmakunbound 'clipboard-kill-ring-save)
-(fmakunbound 'clipboard-kill-region)
-(fmakunbound 'menu-bar-enable-clipboard)
+;; (fmakunbound 'clipboard-yank)
+;; (fmakunbound 'clipboard-kill-ring-save)
+;; (fmakunbound 'clipboard-kill-region)
+;; (fmakunbound 'menu-bar-enable-clipboard)
;; Add a couple of menus and rearrange some others; easiest just to redo toplvl
;; Note keymap defns must be given last-to-first
@@ -985,135 +984,10 @@
(t (read res)))))
;; nsterm.m
-(defvar ns-command-modifier)
-(defvar ns-control-modifier)
-(defvar ns-function-modifier)
-(defvar ns-antialias-text)
-(defvar ns-use-qd-smoothing)
-(defvar ns-use-system-highlight-color)
-(defvar ns-confirm-quit)
-(declare-function ns-set-resource "nsfns.m" (owner name value))
-(declare-function ns-font-name "nsfns.m" (name))
(declare-function ns-read-file-name "nsfns.m"
(prompt &optional dir isLoad init))
-(defun ns-save-preferences ()
- "Set all the defaults."
- (interactive)
- ;; Global preferences
- (ns-set-resource nil "AlternateModifier" (symbol-name ns-alternate-modifier))
- (ns-set-resource nil "CommandModifier" (symbol-name ns-command-modifier))
- (ns-set-resource nil "ControlModifier" (symbol-name ns-control-modifier))
- (ns-set-resource nil "FunctionModifier" (symbol-name ns-function-modifier))
- (ns-set-resource nil "ExpandSpace"
- (if ns-expand-space
- (number-to-string ns-expand-space)
- "NO"))
- (ns-set-resource nil "GSFontAntiAlias" (if ns-antialias-text "YES" "NO"))
- (ns-set-resource nil "UseQuickdrawSmoothing"
- (if ns-use-qd-smoothing "YES" "NO"))
- (ns-set-resource nil "UseSystemHighlightColor"
- (if ns-use-system-highlight-color "YES" "NO"))
- (ns-set-resource nil "ConfirmQuit"
- (if ns-confirm-quit "YES" "NO"))
- ;; Default frame parameters
- (let ((p (frame-parameters))
- v)
- (if (setq v (assq 'font p))
- (ns-set-resource nil "Font" (ns-font-name (cdr v))))
- (if (setq v (assq 'fontsize p))
- (ns-set-resource nil "FontSize" (number-to-string (cdr v))))
- (if (setq v (assq 'foreground-color p))
- (ns-set-resource nil "Foreground" (cdr v)))
- (if (setq v (assq 'background-color p))
- (ns-set-resource nil "Background" (cdr v)))
- (if (setq v (assq 'cursor-color p))
- (ns-set-resource nil "CursorColor" (cdr v)))
- (if (setq v (assq 'cursor-type p))
- (ns-set-resource nil "CursorType" (if (symbolp (cdr v))
- (symbol-name (cdr v))
- (cdr v))))
- (if (setq v (assq 'underline p))
- (ns-set-resource nil "Underline"
- (case (cdr v)
- ((t) "YES")
- ((nil) "NO")
- (t (cdr v)))))
- (if (setq v (assq 'internal-border-width p))
- (ns-set-resource nil "InternalBorderWidth"
- (number-to-string (cdr v))))
- (if (setq v (assq 'vertical-scroll-bars p))
- (ns-set-resource nil "VerticalScrollBars"
- (case (cdr v)
- ((t) "YES")
- ((nil) "NO")
- ((left) "left")
- ((right) "right")
- (t nil))))
- (if (setq v (assq 'height p))
- (ns-set-resource nil "Height" (number-to-string (cdr v))))
- (if (setq v (assq 'width p))
- (ns-set-resource nil "Width" (number-to-string (cdr v))))
- (if (setq v (assq 'top p))
- (ns-set-resource nil "Top" (number-to-string (cdr v))))
- (if (setq v (assq 'left p))
- (ns-set-resource nil "Left" (number-to-string (cdr v))))
- ;; These not fully supported
- (if (setq v (assq 'auto-raise p))
- (ns-set-resource nil "AutoRaise" (if (cdr v) "YES" "NO")))
- (if (setq v (assq 'auto-lower p))
- (ns-set-resource nil "AutoLower" (if (cdr v) "YES" "NO")))
- (if (setq v (assq 'menu-bar-lines p))
- (ns-set-resource nil "Menus" (if (cdr v) "YES" "NO")))
- )
- (let ((fl (face-list)))
- (while (consp fl)
- (or (eq 'default (car fl))
- ;; dont save Default* since it causes all created faces to
- ;; inherit its values. The properties of the default face
- ;; have already been saved from the frame-parameters anyway.
- (let* ((name (symbol-name (car fl)))
- (font (face-font (car fl)))
- ;; (fontsize (face-fontsize (car fl)))
- (foreground (face-foreground (car fl)))
- (background (face-background (car fl)))
- (underline (face-underline-p (car fl)))
- (italic (face-italic-p (car fl)))
- (bold (face-bold-p (car fl)))
- (stipple (face-stipple (car fl))))
- ;; (ns-set-resource nil (concat name ".attributeFont")
- ;; (if font font nil))
- ;; (ns-set-resource nil (concat name ".attributeFontSize")
- ;; (if fontsize (number-to-string fontsize) nil))
- (ns-set-resource nil (concat name ".attributeForeground")
- (if foreground foreground nil))
- (ns-set-resource nil (concat name ".attributeBackground")
- (if background background nil))
- (ns-set-resource nil (concat name ".attributeUnderline")
- (if underline "YES" nil))
- (ns-set-resource nil (concat name ".attributeItalic")
- (if italic "YES" nil))
- (ns-set-resource nil (concat name ".attributeBold")
- (if bold "YES" nil))
- (and stipple
- (or (stringp stipple)
- (setq stipple (prin1-to-string stipple))))
- (ns-set-resource nil (concat name ".attributeStipple")
- (if stipple stipple nil))))
- (setq fl (cdr fl)))))
-
-(declare-function menu-bar-options-save-orig "ns-win" () t)
-
-;; call ns-save-preferences when menu-bar-options-save is called
-(fset 'menu-bar-options-save-orig (symbol-function 'menu-bar-options-save))
-(defun ns-save-options ()
- (interactive)
- (menu-bar-options-save-orig)
- (ns-save-preferences))
-(fset 'menu-bar-options-save (symbol-function 'ns-save-options))
-
-
;;;; File handling.
(defun ns-open-file-using-panel ()
@@ -1242,11 +1116,6 @@
;;;; 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."
Index: src/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/src/ChangeLog,v
retrieving revision 1.7426
retrieving revision 1.7427
diff -u -b -r1.7426 -r1.7427
--- src/ChangeLog 14 Mar 2009 15:19:04 -0000 1.7426
+++ src/ChangeLog 14 Mar 2009 21:20:00 -0000 1.7427
@@ -1,3 +1,17 @@
+2009-03-14 David Reitter <address@hidden>
+
+ * nsterm.m (ns_shutdown_properly, -terminate): remove global state
+ variable as it was never reset
+ (ns_term_init): remove initialization of Lisp-settable defaults
+ and ns_expand_space
+ (-setPanelFromDefaultValues): remove ns_expand_space.
+ (-showPreferencesWindow): send new KEY_NS_SHOW_PREFS key.
+ * nsfont.m (nsfont_open): remove ns_expand_space, assume -0.5
+ i.e. no additional spacing, similar to Carbon port.
+
+ * nsterm.h: define KEY_NS_SHOW_PREFS key.
+ * nsfns.m (ns-popup-prefs-panel): remove.
+
2009-03-14 Jan Djärv <address@hidden>
* sound.c (alsa_configure): Remove call to deprecated
Index: src/nsfns.m
===================================================================
RCS file: /sources/emacs/emacs/src/nsfns.m,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -b -r1.40 -r1.41
--- src/nsfns.m 12 Mar 2009 14:14:36 -0000 1.40
+++ src/nsfns.m 14 Mar 2009 21:20:06 -0000 1.41
@@ -1379,17 +1379,6 @@
}
-DEFUN ("ns-popup-prefs-panel", Fns_popup_prefs_panel, Sns_popup_prefs_panel,
- 0, 0, "",
- doc: /* Pop up the preferences panel. */)
- ()
-{
- check_ns ();
- [(EmacsApp *)NSApp showPreferencesWindow: NSApp];
- return Qnil;
-}
-
-
DEFUN ("ns-popup-font-panel", Fns_popup_font_panel, Sns_popup_font_panel,
0, 1, "",
doc: /* Pop up the font panel. */)
@@ -2729,7 +2718,6 @@
defsubr (&Sns_perform_service);
defsubr (&Sns_convert_utf8_nfd_to_nfc);
defsubr (&Sx_focus_frame);
- defsubr (&Sns_popup_prefs_panel);
defsubr (&Sns_popup_font_panel);
defsubr (&Sns_popup_color_panel);
Index: src/nsfont.m
===================================================================
RCS file: /sources/emacs/emacs/src/nsfont.m,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- src/nsfont.m 4 Mar 2009 21:21:32 -0000 1.19
+++ src/nsfont.m 14 Mar 2009 21:20:07 -0000 1.20
@@ -42,7 +42,6 @@
extern Lisp_Object Qns;
extern Lisp_Object Qnormal, Qbold, Qitalic, Qcondensed, Qexpanded;
static Lisp_Object Qapple, Qroman, Qmedium;
-extern Lisp_Object ns_expand_space;
extern Lisp_Object Qappend;
extern int ns_antialias_text, ns_use_qd_smoothing;
extern float ns_antialias_threshold;
@@ -658,12 +657,12 @@
min_height = [sfont ascender] - [sfont descender];
hd = full_height - min_height;
- if (!NUMBERP (ns_expand_space))
- error ("No expand space defined");
-
- /* ns_expand_space = 0.0 is use standard height; less shrink, more expand
*/
- expand = XFLOATINT (ns_expand_space) + 0.5;
+ /* standard height, similar to Carbon. Emacs.app: was 0.5 by default. */
+ expand = 0.0;
+ shrink = 1.0;
+ hshrink = 1.0;
+ /*
if (expand < 0.0)
{
shrink = 1 + expand;
@@ -672,6 +671,7 @@
}
else
shrink = hshrink = 1.0;
+ */
font_info->underpos = 2; /*[sfont underlinePosition] is often clipped out
*/
font_info->underwidth = [sfont underlineThickness];
Index: src/nsterm.h
===================================================================
RCS file: /sources/emacs/emacs/src/nsterm.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- src/nsterm.h 29 Jan 2009 10:35:55 -0000 1.23
+++ src/nsterm.h 14 Mar 2009 21:20:08 -0000 1.24
@@ -317,52 +317,6 @@
@end
#endif /* NS_IMPL_COCOA */
-
-/* ==========================================================================
-
- Running the preferences window
-
- ==========================================================================
*/
-
address@hidden EmacsPrefsController : NSObject
-{
- struct frame *frame;
- IBOutlet NSWindow *prefsWindow;
- IBOutlet NSPopUpButton *alternateModMenu;
- IBOutlet NSPopUpButton *commandModMenu;
-#ifdef NS_IMPL_COCOA
- IBOutlet NSPopUpButton *controlModMenu;
- IBOutlet NSPopUpButton *functionModMenu;
-#endif
- IBOutlet NSMatrix *cursorTypeMatrix;
- IBOutlet NSSlider *expandSpaceSlider;
-#ifdef NS_IMPL_COCOA
- IBOutlet NSButton *smoothFontsCheck;
- IBOutlet NSButton *useQuickdrawCheck;
- IBOutlet NSButton *useSysHiliteCheck;
- IBOutlet NSButton *confirmQuitCheck;
- Lisp_Object prevUseHighlightColor;
-#endif
- float prevExpandSpace;
-#ifdef NS_IMPL_GNUSTEP
- /* TODO: remove as soon as someone can edit the .nib to replace the
- cursor-blink widget with checkbox conn to confirmQuitCheck */
- IBOutlet NSSlider *cursorBlinkSlider;
-#endif
-}
-- (IBAction)cancel: (id)sender;
-- (IBAction)ok: (id)sender;
-- (IBAction)resetToDefaults: (id)sender;
-- (IBAction)runHelp: (id)sender;
-- (IBAction)setColors: (id)sender;
-- (IBAction)setDefaultFont: (id)sender;
-
-- (void) showForFrame: (struct frame *)f;
-- (void) setPanelFromValues;
-- (void) setPanelFromDefaultValues;
-- (void) setValuesFromPanel;
address@hidden
-
extern NSArray *ns_send_types, *ns_return_types;
extern EmacsMenu *mainMenu, *svcsMenu, *dockMenu;
@@ -402,7 +356,7 @@
#define KEY_NS_SPI_SERVICE_CALL ((1<<28)|(0<<16)|11)
#define KEY_NS_NEW_FRAME ((1<<28)|(0<<16)|12)
#define KEY_NS_TOGGLE_TOOLBAR ((1<<28)|(0<<16)|13)
-#define KEY_NS_INFO_PREFS ((1<<28)|(0<<16)|14)
+#define KEY_NS_SHOW_PREFS ((1<<28)|(0<<16)|14)
/* could use list to store these, but rest of emacs has a big infrastructure
for managing a table of bitmap "records" */
Index: src/nsterm.m
===================================================================
RCS file: /sources/emacs/emacs/src/nsterm.m,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -b -r1.66 -r1.67
--- src/nsterm.m 12 Mar 2009 01:57:50 -0000 1.66
+++ src/nsterm.m 14 Mar 2009 21:20:09 -0000 1.67
@@ -136,15 +136,9 @@
extern Lisp_Object Qcursor_color, Qcursor_type, Qns;
-EmacsPrefsController *prefsController;
-
-/* Preferences equivalent to those set by X resources under X are managed
- through the OpenStep defaults system. These pertain to behavior of the
- graphical interface components. The one difference from X is that the
- values below are SET when the user chooses save-options. This makes
- things easier for users, but sometimes violates expectations when some
- user-set options appear when running under -q/Q. Therefore we depart
- from X behavior and refuse to read defaults when started under these
+/* Some preferences equivalent to those set by X resources under X are
+ managed through the OpenStep defaults system. We depart from X
+ behavior and refuse to read defaults when started under these
options. */
/* Set in emacs.c. */
@@ -166,11 +160,6 @@
the Function modifer (laptops). May be any of the modifier lisp symbols. */
Lisp_Object ns_function_modifier;
-/* A floating point value specifying vertical stretch (positive) or shrink
- (negative) of text line spacing. Zero means default spacing.
- YES indicates 0.5, NO indicates 0.0. */
-Lisp_Object ns_expand_space;
-
/* Control via default 'GSFontAntiAlias' on OS X and GNUstep. */
Lisp_Object ns_antialias_text;
@@ -234,7 +223,6 @@
static struct timeval select_timeout;
static int select_nfds;
static NSAutoreleasePool *outerpool;
-static BOOL ns_shutdown_properly = NO;
static struct input_event *emacs_event = NULL;
static struct input_event *q_event_ptr = NULL;
static int n_emacs_events_pending = 0;
@@ -3563,7 +3551,6 @@
ns_command_modifier = Qsuper;
ns_control_modifier = Qcontrol;
ns_function_modifier = Qnone;
- ns_expand_space = make_float (0.0);
ns_antialias_text = Qt;
ns_antialias_threshold = 10.0; /* not exposed to lisp side */
ns_use_qd_smoothing = Qnil;
@@ -3838,47 +3825,19 @@
ns_set_default_prefs ();
if (!ns_no_defaults)
{
- ns_default ("AlternateModifier", &ns_alternate_modifier,
- Qnil, Qnil, NO, YES);
- if (NILP (ns_alternate_modifier))
- ns_alternate_modifier = Qmeta;
- ns_default ("CommandModifier", &ns_command_modifier,
- Qnil, Qnil, NO, YES);
- if (NILP (ns_command_modifier))
- ns_command_modifier = Qsuper;
- ns_default ("ControlModifier", &ns_control_modifier,
- Qnil, Qnil, NO, YES);
- if (NILP (ns_control_modifier))
- ns_control_modifier = Qcontrol;
- ns_default ("FunctionModifier", &ns_function_modifier,
- Qnil, Qnil, NO, YES);
- if (NILP (ns_function_modifier))
- ns_function_modifier = Qnone;
- ns_default ("ExpandSpace", &ns_expand_space,
- make_float (0.5), make_float (0.0), YES, NO);
ns_default ("GSFontAntiAlias", &ns_antialias_text,
Qt, Qnil, NO, NO);
tmp = Qnil;
+ /* this is a standard variable */
ns_default ("AppleAntiAliasingThreshold", &tmp,
make_float (10.0), make_float (6.0), YES, NO);
ns_antialias_threshold = NILP (tmp) ? 10.0 : XFLOATINT (tmp);
- ns_default ("UseQuickdrawSmoothing", &ns_use_qd_smoothing,
- Qt, Qnil, NO, NO);
- ns_default ("UseSystemHighlightColor", &ns_use_system_highlight_color,
- Qt, Qnil, NO, NO);
- ns_default ("ConfirmQuit", &ns_confirm_quit,
- Qt, Qnil, NO, NO);
}
- if (EQ (ns_use_system_highlight_color, Qt))
- {
ns_selection_color = [[NSUserDefaults standardUserDefaults]
stringForKey: @"AppleHighlightColor"];
if (ns_selection_color == nil)
ns_selection_color = NS_SELECTION_COLOR_DEFAULT;
- }
- else
- ns_selection_color = NS_SELECTION_COLOR_DEFAULT;
{
NSColorList *cl = [NSColorList colorListNamed: @"Emacs"];
@@ -4008,7 +3967,6 @@
if (sig == 0 || sig == SIGTERM)
{
- ns_shutdown_properly = YES;
[NSApp terminate: NSApp];
}
else // force a stack trace to happen
@@ -4104,9 +4062,15 @@
- (void)showPreferencesWindow: (id)sender
{
- if (prefsController == nil)
- prefsController = [[EmacsPrefsController alloc] init];
- [prefsController showForFrame: SELECTED_FRAME ()];
+ struct frame *emacsframe = SELECTED_FRAME ();
+ NSEvent *theEvent = [NSApp currentEvent];
+
+ if (!emacs_event)
+ return;
+ emacs_event->kind = NS_NONKEY_EVENT;
+ emacs_event->code = KEY_NS_SHOW_PREFS;
+ emacs_event->modifiers = 0;
+ EV_TRAILER (theEvent);
}
@@ -4161,47 +4125,38 @@
}
-/* Termination sequences (ns_shutdown_properly):
+/* Termination sequences:
C-x C-c:
Cmd-Q:
MenuBar | File | Exit:
- ns_term_shutdown: 0
- -terminate: 1
- -appShouldTerminate: 1
-
Select Quit from App menubar:
- received -terminate: 0
- ns_term_shutdown: 0
- -terminate: 1
- -appShouldTerminate: 1
+ -terminate
+ KEY_NS_POWER_OFF, (save-buffers-kill-emacs)
+ ns_term_shutdown()
Select Quit from Dock menu:
Logout attempt:
- -appShouldTerminate: 0
+ -appShouldTerminate
Cancel -> Nothing else
Accept ->
- -terminate: 0
- ns_term_shutdown: 0
- -terminate: 1
- -appShouldTerminate: 1
+
+ -terminate
+ KEY_NS_POWER_OFF, (save-buffers-kill-emacs)
+ ns_term_shutdown()
+
*/
- (void) terminate: (id)sender
{
- if (ns_shutdown_properly)
- [super terminate: sender];
- else
- {
struct frame *emacsframe = SELECTED_FRAME ();
if (!emacs_event)
return;
- ns_shutdown_properly = YES;
- emacs_event->kind = NON_ASCII_KEYSTROKE_EVENT;
+ emacs_event->kind = NS_NONKEY_EVENT;
emacs_event->code = KEY_NS_POWER_OFF;
+ emacs_event->arg = Qt; /* mark as non-key event */
EV_TRAILER ((id)nil);
- }
}
@@ -4209,7 +4164,7 @@
{
int ret;
- if (ns_shutdown_properly || NILP (ns_confirm_quit))
+ if (NILP (ns_confirm_quit)) // || ns_shutdown_properly --> TO DO
return NSTerminateNow;
ret = NSRunAlertPanel([[NSProcessInfo processInfo] processName],
@@ -6133,203 +6088,6 @@
-/* ==========================================================================
-
- EmacsPrefsController implementation
-
- ==========================================================================
*/
-
-
address@hidden EmacsPrefsController
-
-/* in Tiger+, can just do [popup selectItemWithTag: tag]; */
-static void selectItemWithTag (NSPopUpButton *popup, int tag)
-{
- NSEnumerator *items = [[popup itemArray] objectEnumerator];
- NSMenuItem *item;
- while (item = [items nextObject])
- {
- if ([item tag] == tag)
- {
- [popup selectItem: item];
- return;
- }
- }
-}
-
-- init
-{
- [NSBundle loadNibNamed: @"preferences" owner: self];
- return self;
-}
-
-
-- (void) showForFrame: (struct frame *)f
-{
- frame = f;
- [self setPanelFromValues];
- [prefsWindow makeKeyAndOrderFront: self];
- [prefsWindow display];
-}
-
-
-/* If you change this, change setPanelFromDefaultValues too. */
-- (void) setPanelFromValues
-{
- int cursorType
- = ns_lisp_to_cursor_type (get_frame_param (frame, Qcursor_type));
- prevExpandSpace = XFLOATINT (ns_expand_space);
-
-#ifdef NS_IMPL_COCOA
- prevUseHighlightColor = ns_use_system_highlight_color;
-#endif
-
- [expandSpaceSlider setFloatValue: prevExpandSpace];
- [cursorTypeMatrix selectCellWithTag: (cursorType == FILLED_BOX_CURSOR ? 1 :
- (cursorType == BAR_CURSOR ? 2 :
- (cursorType == HBAR_CURSOR ? 3 :
4)))];
- selectItemWithTag (alternateModMenu,
- parse_solitary_modifier (ns_alternate_modifier));
- selectItemWithTag (commandModMenu,
- parse_solitary_modifier (ns_command_modifier));
-#ifdef NS_IMPL_COCOA
- selectItemWithTag (controlModMenu,
- parse_solitary_modifier (ns_control_modifier));
- selectItemWithTag (functionModMenu,
- parse_solitary_modifier (ns_function_modifier));
- [smoothFontsCheck setState: (NILP (ns_antialias_text) ? NO : YES)];
- [useQuickdrawCheck setState: (NILP (ns_use_qd_smoothing) ? NO : YES)];
- [useSysHiliteCheck setState: (NILP (prevUseHighlightColor) ? NO : YES)];
- [confirmQuitCheck setState: (NILP (ns_confirm_quit) ? NO : YES)];
-#endif
-}
-
-
-/* This and ns_set_default_prefs should be changed together. */
-- (void) setPanelFromDefaultValues
-{
- [expandSpaceSlider setFloatValue: 0.0];
- [cursorTypeMatrix selectCellWithTag: 1]; /* filled box */
- selectItemWithTag (alternateModMenu, meta_modifier);
- selectItemWithTag (commandModMenu, super_modifier);
-#ifdef NS_IMPL_COCOA
- selectItemWithTag (controlModMenu, ctrl_modifier);
- selectItemWithTag (functionModMenu, 0); /* none */
- [smoothFontsCheck setState: YES];
- [useQuickdrawCheck setState: NO];
- [useSysHiliteCheck setState: YES];
-#endif
-}
-
-
-- (void) setValuesFromPanel
-{
- int altTag = [[alternateModMenu selectedItem] tag];
- int cmdTag = [[commandModMenu selectedItem] tag];
-#ifdef NS_IMPL_COCOA
- int ctrlTag = [[controlModMenu selectedItem] tag];
- int fnTag = [[functionModMenu selectedItem] tag];
-#endif
- float expandSpace = [expandSpaceSlider floatValue];
- int cursorTag = [[cursorTypeMatrix selectedCell] tag];
- Lisp_Object cursor_type = ns_cursor_type_to_lisp
- ( cursorTag == 1 ? FILLED_BOX_CURSOR
- : cursorTag == 2 ? BAR_CURSOR
- : cursorTag == 3 ? HBAR_CURSOR : HOLLOW_BOX_CURSOR);
-
- if (expandSpace != prevExpandSpace)
- {
- ns_expand_space = make_float (expandSpace);
- /* TODO: more needed: store needed metrics in nsfont_info, update
- frame default font max_bounds and fontp, recompute faces */
-/* FRAME_LINE_HEIGHT (frame) *= (expandSpace / prevExpandSpace);
- x_set_window_size (frame, 0, frame->text_cols, frame->text_lines);
*/
- prevExpandSpace = expandSpace;
- }
-
- store_frame_param (frame, Qcursor_type, cursor_type);
- x_set_cursor_type (frame, cursor_type, Qnil); /* FIXME: do only if changed
*/
-
- ns_alternate_modifier = ns_mod_to_lisp (altTag);
- ns_command_modifier = ns_mod_to_lisp (cmdTag);
-#ifdef NS_IMPL_COCOA
- ns_control_modifier = ns_mod_to_lisp (ctrlTag);
- ns_function_modifier = ns_mod_to_lisp (fnTag);
- ns_antialias_text = [smoothFontsCheck state] ? Qt : Qnil;
- ns_use_qd_smoothing = [useQuickdrawCheck state] ? Qt : Qnil;
- ns_use_system_highlight_color = [useSysHiliteCheck state] ? Qt : Qnil;
- ns_confirm_quit = [confirmQuitCheck state] ? Qt : Qnil;
- if (! EQ (ns_use_system_highlight_color, prevUseHighlightColor))
- {
- prevUseHighlightColor = ns_use_system_highlight_color;
- if (EQ (ns_use_system_highlight_color, Qt))
- {
- ns_selection_color = [[NSUserDefaults standardUserDefaults]
- stringForKey: @"AppleHighlightColor"];
- if (ns_selection_color == nil)
- ns_selection_color = NS_SELECTION_COLOR_DEFAULT;
- }
- else
- ns_selection_color = NS_SELECTION_COLOR_DEFAULT;
- }
-#endif /* NS_IMPL_COCOA */
- Fcall_interactively (intern ("ns-save-preferences"), Qnil, Qnil);
-}
-
-
-/* buttons */
-- (IBAction)cancel: (id)sender
-{
- [prefsWindow close];
-}
-
-
-- (IBAction)ok: (id)sender
-{
- [self setValuesFromPanel];
- [prefsWindow close];
-}
-
-
-- (IBAction)resetToDefaults: (id)sender
-{
- [self setPanelFromDefaultValues];
-}
-
-
-- (IBAction)runHelp: (id)sender
-{
- struct frame *emacsframe = frame;
- if (!emacs_event)
- return;
- ns_raise_frame(frame);
- emacs_event->kind = NS_NONKEY_EVENT;
- emacs_event->code = KEY_NS_INFO_PREFS;
- EV_TRAILER ((id)nil);
-}
-
-
-- (IBAction)setColors: (id)sender
-{
- Lisp_Object lispFrame;
- XSETFRAME (lispFrame, frame);
- ns_raise_frame(frame);
- Fns_popup_color_panel (lispFrame);
-}
-
-
-- (IBAction)setDefaultFont: (id)sender
-{
- Lisp_Object lispFrame;
- XSETFRAME (lispFrame, frame);
- ns_raise_frame(frame);
- Fns_popup_font_panel (lispFrame);
-}
-
address@hidden /* EmacsPrefsController */
-
-
-
/* ==========================================================================
@@ -6492,11 +6250,6 @@
Set to none means that the function key is not interpreted by Emacs at all,\n\
allowing it to be used at a lower level for accented character entry.");
- DEFVAR_LISP ("ns-expand-space", &ns_expand_space,
- "Amount by which spacing between lines is expanded (positive)\n\
-or shrunk (negative). Zero (the default) means standard line height.\n\
-(This variable should only be read, never set.)");
-
DEFVAR_LISP ("ns-antialias-text", &ns_antialias_text,
"Non-nil (the default) means to render text antialiased. Only
has an effect on OS X Panther and above.");
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs lisp/ChangeLog lisp/term/ns-win.el src/Ch...,
David Reitter <=