diff options
author | Eli Zaretskii <eliz@gnu.org> | 2015-05-16 12:33:12 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2015-05-16 12:33:12 +0300 |
commit | da4a31b1b1af919f0473dffa86b46beec5ca5541 (patch) | |
tree | 90abc1a14c215cd6efa3a492400a39dbd356602a | |
parent | 91a274810ff17403f37bde512716b180c9ab75ef (diff) | |
parent | a96731d7f0f0616e500583a1d3eaa912a7f0ec16 (diff) | |
download | emacs-da4a31b1b1af919f0473dffa86b46beec5ca5541.tar.gz |
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
-rw-r--r-- | admin/charsets/cp51932.awk | 2 | ||||
-rw-r--r-- | admin/charsets/eucjp-ms.awk | 2 | ||||
-rw-r--r-- | configure.ac | 22 | ||||
-rw-r--r-- | doc/lispref/modes.texi | 6 | ||||
-rw-r--r-- | etc/NEWS | 4 | ||||
-rw-r--r-- | lib-src/etags.c | 4 | ||||
-rw-r--r-- | lisp/cus-start.el | 1 | ||||
-rw-r--r-- | lisp/emacs-lisp/generator.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/tabulated-list.el | 24 | ||||
-rw-r--r-- | lisp/international/cp51932.el | 2 | ||||
-rw-r--r-- | lisp/international/eucjp-ms.el | 2 | ||||
-rw-r--r-- | lisp/language/japanese.el | 4 | ||||
-rw-r--r-- | lisp/loadup.el | 2 | ||||
-rw-r--r-- | lwlib/Makefile.in | 20 | ||||
-rw-r--r-- | lwlib/autodeps.mk | 5 | ||||
-rw-r--r-- | lwlib/deps.mk | 2 | ||||
-rw-r--r-- | oldXMenu/Makefile.in | 20 | ||||
-rw-r--r-- | oldXMenu/autodeps.mk | 5 | ||||
-rw-r--r-- | oldXMenu/deps.mk | 2 | ||||
-rw-r--r-- | src/Makefile.in | 25 | ||||
-rw-r--r-- | src/autodeps.mk | 5 | ||||
-rw-r--r-- | src/deps.mk | 2 | ||||
-rw-r--r-- | src/lisp.mk | 6 | ||||
-rw-r--r-- | src/macfont.h | 6 | ||||
-rw-r--r-- | src/nsfns.m | 31 | ||||
-rw-r--r-- | src/nsimage.m | 9 | ||||
-rw-r--r-- | src/nsmenu.m | 6 | ||||
-rw-r--r-- | src/nsterm.h | 1 | ||||
-rw-r--r-- | src/nsterm.m | 106 |
29 files changed, 193 insertions, 135 deletions
diff --git a/admin/charsets/cp51932.awk b/admin/charsets/cp51932.awk index c8879b30200..f59e91cdb9c 100644 --- a/admin/charsets/cp51932.awk +++ b/admin/charsets/cp51932.awk @@ -52,4 +52,6 @@ END { print " (setcar x (cdr x)) (setcdr x tmp)))"; print " map)"; print " (define-translation-table 'cp51932-encode map))"; + print ""; + print "(provide 'cp51932)"; } diff --git a/admin/charsets/eucjp-ms.awk b/admin/charsets/eucjp-ms.awk index 18c19f5fb55..f17222d901e 100644 --- a/admin/charsets/eucjp-ms.awk +++ b/admin/charsets/eucjp-ms.awk @@ -106,5 +106,7 @@ END { print " (setcar x (cdr x)) (setcdr x tmp)))"; print " map)"; print " (define-translation-table 'eucjp-ms-encode map))"; + print ""; + print "(provide 'eucjp-ms)"; } diff --git a/configure.ac b/configure.ac index 90a40552a35..1cddeb1e45f 100644 --- a/configure.ac +++ b/configure.ac @@ -1661,9 +1661,7 @@ dnl AC_C_BIGENDIAN is done by gnulib. dnl check for Make feature -DEPFLAGS= -MKDEPDIR=":" -deps_frag=deps.mk +AUTO_DEPEND=no dnl check if we have GCC and autodepend is on. if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then AC_MSG_CHECKING([whether gcc understands -MMD -MF]) @@ -1675,24 +1673,10 @@ if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then rm -rf deps.d AC_MSG_RESULT([$ac_enable_autodepend]) if test $ac_enable_autodepend = yes; then - DEPFLAGS='-MMD -MF ${DEPDIR}/$*.d -MP' - ## MKDIR_P is documented (see AC_PROG_MKDIR_P) to be parallel-safe. - MKDEPDIR='${MKDIR_P} ${DEPDIR}' - deps_frag=autodeps.mk + AUTO_DEPEND=yes fi fi -lwlib_deps_frag=$srcdir/lwlib/$deps_frag -oldxmenu_deps_frag=$srcdir/oldXMenu/$deps_frag -deps_frag=$srcdir/src/$deps_frag -AC_SUBST(MKDEPDIR) -AC_SUBST(DEPFLAGS) -AC_SUBST_FILE(deps_frag) -AC_SUBST_FILE(lwlib_deps_frag) -AC_SUBST_FILE(oldxmenu_deps_frag) - -lisp_frag=$srcdir/src/lisp.mk -AC_SUBST_FILE(lisp_frag) - +AC_SUBST(AUTO_DEPEND) dnl checks for operating system services AC_SYS_LONG_FILE_NAMES diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 8cb0f3db246..c325506da11 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -958,9 +958,9 @@ Menu,,, emacs, The GNU Emacs Manual}). way, specifying @code{tabulated-list-mode} as the second argument (@pxref{Derived Modes}). The body of the @code{define-derived-mode} form should specify the format of the tabulated data, by assigning -values to the variables documented below; then, it should call the -function @code{tabulated-list-init-header} to initialize the header -line. +values to the variables documented below; optionally, it can then call +the function @code{tabulated-list-init-header}, which will populate a +header with the names of the columns. The derived mode should also define a @dfn{listing command}. This, not the mode command, is what the user calls (e.g., @kbd{M-x @@ -205,6 +205,10 @@ font, and (iii) the specified window. `message' and related functions from displaying messages the Echo Area. The output is still logged to the *Messages* buffer. +** It is now safe for a mode that derives `tabulated-list-mode' to not +call `tabulated-list-init-header', in which case it will have no +header. + * Editing Changes in Emacs 25.1 diff --git a/lib-src/etags.c b/lib-src/etags.c index f2438213d04..7bacbd3e619 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -68,8 +68,8 @@ University of California, as described above. */ * 1994 Line-by-line regexp tags by Tom Tromey. * 2001 Nested classes by Francesco Potortì (concept by Mykola Dzyuba). * 2002 #line directives by Francesco Potortì. - * - * Francesco Potortì <pot@gnu.org> has maintained and improved it since 1993. + * Francesco Potortì maintained and improved it for many years + starting in 1993. */ /* diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 071aaa6850f..b4d2139022c 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -438,6 +438,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of (const super)) "23.1") (ns-antialias-text ns boolean "23.1") (ns-auto-hide-menu-bar ns boolean "24.1") + (ns-confirm-quit ns boolean "25.1") (ns-use-native-fullscreen ns boolean "24.4") (ns-use-fullscreen-animation ns boolean "25.1") (ns-use-srgb-colorspace ns boolean "24.4") diff --git a/lisp/emacs-lisp/generator.el b/lisp/emacs-lisp/generator.el index 65def39bf2e..8251682590e 100644 --- a/lisp/emacs-lisp/generator.el +++ b/lisp/emacs-lisp/generator.el @@ -90,7 +90,7 @@ ;; Change this function to use `cl-gensym' if you want the generated ;; code to be easier to read and debug. ;; (cl-gensym (apply #'format fmt args)) - `(make-symbol (format ,fmt . ,args))) + `(make-symbol ,fmt)) (defvar cps--dynamic-wrappers '(identity) "List of transformer functions to apply to atomic forms we diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index b12edc8c595..5d10b55d14c 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -179,7 +179,9 @@ If ADVANCE is non-nil, move forward by one line afterwards." table) "The `glyphless-char-display' table in Tabulated List buffers.") -(defvar tabulated-list--header-string nil) +(defvar tabulated-list--header-string nil + "Holds the header if `tabulated-list-use-header-line' is nil. +Populated by `tabulated-list-init-header'.") (defvar tabulated-list--header-overlay nil) (defun tabulated-list-init-header () @@ -243,15 +245,17 @@ If ADVANCE is non-nil, move forward by one line afterwards." (setq-local tabulated-list--header-string cols)))) (defun tabulated-list-print-fake-header () - "Insert a fake Tabulated List \"header line\" at the start of the buffer." - (goto-char (point-min)) - (let ((inhibit-read-only t)) - (insert tabulated-list--header-string "\n") - (if tabulated-list--header-overlay - (move-overlay tabulated-list--header-overlay (point-min) (point)) - (setq-local tabulated-list--header-overlay - (make-overlay (point-min) (point)))) - (overlay-put tabulated-list--header-overlay 'face 'underline))) + "Insert a fake Tabulated List \"header line\" at the start of the buffer. +Do nothing if `tabulated-list--header-string' is nil." + (when tabulated-list--header-string + (goto-char (point-min)) + (let ((inhibit-read-only t)) + (insert tabulated-list--header-string "\n") + (if tabulated-list--header-overlay + (move-overlay tabulated-list--header-overlay (point-min) (point)) + (setq-local tabulated-list--header-overlay + (make-overlay (point-min) (point)))) + (overlay-put tabulated-list--header-overlay 'face 'underline)))) (defun tabulated-list-revert (&rest ignored) "The `revert-buffer-function' for `tabulated-list-mode'. diff --git a/lisp/international/cp51932.el b/lisp/international/cp51932.el index a6489268578..cb72356fea0 100644 --- a/lisp/international/cp51932.el +++ b/lisp/international/cp51932.el @@ -468,3 +468,5 @@ (setcar x (cdr x)) (setcdr x tmp))) map) (define-translation-table 'cp51932-encode map)) + +(provide 'cp51932) diff --git a/lisp/international/eucjp-ms.el b/lisp/international/eucjp-ms.el index 6e4e1e798b0..efb0a2b2d75 100644 --- a/lisp/international/eucjp-ms.el +++ b/lisp/international/eucjp-ms.el @@ -2085,3 +2085,5 @@ (setcar x (cdr x)) (setcdr x tmp))) map) (define-translation-table 'eucjp-ms-encode map)) + +(provide 'eucjp-ms) diff --git a/lisp/language/japanese.el b/lisp/language/japanese.el index ce480252e7c..38159d7b458 100644 --- a/lisp/language/japanese.el +++ b/lisp/language/japanese.el @@ -34,8 +34,8 @@ ;;; Code: ;;; Load translation tables for CP932. -(load "international/cp51932") -(load "international/eucjp-ms") +(require 'cp51932) +(require 'eucjp-ms) (define-coding-system 'iso-2022-jp "ISO 2022 based 7bit encoding for Japanese (MIME:ISO-2022-JP)." diff --git a/lisp/loadup.el b/lisp/loadup.el index 828b19e85e3..525cbad9db7 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -178,6 +178,8 @@ (load "language/romanian") (load "language/greek") (load "language/hebrew") +(load "international/cp51932") +(load "international/eucjp-ms") (load "language/japanese") (load "language/korean") (load "language/lao") diff --git a/lwlib/Makefile.in b/lwlib/Makefile.in index 1f332e92939..2fd59598e3e 100644 --- a/lwlib/Makefile.in +++ b/lwlib/Makefile.in @@ -70,10 +70,15 @@ am__v_at_0 = @ am__v_at_1 = DEPDIR = deps -## -MMD -MF $(DEPDIR)/$*.d if AUTO_DEPEND; else empty. -DEPFLAGS = @DEPFLAGS@ -## ${MKDIR_P} ${DEPDIR} (if AUTO_DEPEND); else ':'. -MKDEPDIR = @MKDEPDIR@ +AUTO_DEPEND = @AUTO_DEPEND@ + +ifeq ($(AUTO_DEPEND),yes) +DEPFLAGS = -MMD -MF ${DEPDIR}/$*.d -MP +MKDEPDIR = ${MKDIR_P} ${DEPDIR} +else +DEPFLAGS = +MKDEPDIR = : +endif ## ../src is where the generated file (config.h, globals.h) are. ## $(srcdir)/../src is where the non-generated files (lisp.h) are. @@ -102,8 +107,11 @@ globals_h = ../src/globals.h $(globals_h): $(MAKE) -C ../src globals.h -## Insert either autodeps.mk (if AUTO_DEPEND), else deps.mk. -@lwlib_deps_frag@ +ifeq ($(AUTO_DEPEND),yes) +-include $(ALLOBJS:%.o=${DEPDIR}/%.d) +else +include $(srcdir)/deps.mk +endif .PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean diff --git a/lwlib/autodeps.mk b/lwlib/autodeps.mk deleted file mode 100644 index f7109295ce2..00000000000 --- a/lwlib/autodeps.mk +++ /dev/null @@ -1,5 +0,0 @@ -### autodeps.mk --- lwlib/Makefile fragment for GNU Emacs - -## This is inserted in lwlib/Makefile if AUTO_DEPEND=yes. - --include $(ALLOBJS:%.o=${DEPDIR}/%.d) diff --git a/lwlib/deps.mk b/lwlib/deps.mk index 11cc0567428..a19e51f34d1 100644 --- a/lwlib/deps.mk +++ b/lwlib/deps.mk @@ -20,7 +20,7 @@ ### Commentary: -## This file is inserted in lwlib/Makefile if AUTO_DEPEND=no. +## This file is included in lwlib/Makefile if AUTO_DEPEND=no. ## It defines static dependencies between the various source files. ### Code: diff --git a/oldXMenu/Makefile.in b/oldXMenu/Makefile.in index ef2a3600a6b..de5b8e1114c 100644 --- a/oldXMenu/Makefile.in +++ b/oldXMenu/Makefile.in @@ -112,10 +112,15 @@ am__v_at_0 = @ am__v_at_1 = DEPDIR = deps -## -MMD -MF $(DEPDIR)/$*.d if AUTO_DEPEND; else empty. -DEPFLAGS = @DEPFLAGS@ -## ${MKDIR_P} ${DEPDIR} (if AUTO_DEPEND); else ':'. -MKDEPDIR = @MKDEPDIR@ +AUTO_DEPEND = @AUTO_DEPEND@ + +ifeq ($(AUTO_DEPEND),yes) +DEPFLAGS = -MMD -MF ${DEPDIR}/$*.d -MP +MKDEPDIR = ${MKDIR_P} ${DEPDIR} +else +DEPFLAGS = +MKDEPDIR = : +endif ALL_CFLAGS=$(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \ $(C_SWITCH_X_SITE) $(DEPFLAGS) \ @@ -132,8 +137,11 @@ libXMenu11.a: $(OBJS) $(EXTRA) $(AM_V_at)$(AR) $(ARFLAGS) $@ $(OBJS) $(EXTRA) $(AM_V_at)$(RANLIB) $@ -## Insert either autodeps.mk (if AUTO_DEPEND), else deps.mk. -@oldxmenu_deps_frag@ +ifeq ($(AUTO_DEPEND),yes) +-include $(ALLOBJS:%.o=${DEPDIR}/%.d) +else +include $(srcdir)/deps.mk +endif .PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean diff --git a/oldXMenu/autodeps.mk b/oldXMenu/autodeps.mk deleted file mode 100644 index f7109295ce2..00000000000 --- a/oldXMenu/autodeps.mk +++ /dev/null @@ -1,5 +0,0 @@ -### autodeps.mk --- lwlib/Makefile fragment for GNU Emacs - -## This is inserted in lwlib/Makefile if AUTO_DEPEND=yes. - --include $(ALLOBJS:%.o=${DEPDIR}/%.d) diff --git a/oldXMenu/deps.mk b/oldXMenu/deps.mk index cdb89f9ead9..54ce3587574 100644 --- a/oldXMenu/deps.mk +++ b/oldXMenu/deps.mk @@ -32,7 +32,7 @@ ### Commentary: -## This file is inserted in oldXMenu/Makefile if AUTO_DEPEND=no. +## This file is included in oldXMenu/Makefile if AUTO_DEPEND=no. ## It defines static dependencies between the various source files. ### Code: diff --git a/src/Makefile.in b/src/Makefile.in index 1c03b27c2c3..51a5b982474 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -323,10 +323,15 @@ am__v_at_0 = @ am__v_at_1 = DEPDIR=deps -## -MMD -MF $(DEPDIR)/$*.d if AUTO_DEPEND; else empty. -DEPFLAGS=@DEPFLAGS@ -## ${MKDIR_P} ${DEPDIR} (if AUTO_DEPEND); else ':'. -MKDEPDIR=@MKDEPDIR@ +AUTO_DEPEND = @AUTO_DEPEND@ + +ifeq ($(AUTO_DEPEND),yes) +DEPFLAGS = -MMD -MF ${DEPDIR}/$*.d -MP +MKDEPDIR = ${MKDIR_P} ${DEPDIR} +else +DEPFLAGS = +MKDEPDIR = : +endif ## DO NOT use -R. There is a special hack described in lastfile.c ## which is used instead. Some initialized data areas are modified @@ -413,9 +418,7 @@ otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \ FIRSTFILE_OBJ=@FIRSTFILE_OBJ@ ALLOBJS = $(FIRSTFILE_OBJ) $(VMLIMIT_OBJ) $(obj) $(otherobj) -## Configure inserts the file lisp.mk at this point, defining $lisp. -@lisp_frag@ - +include $(srcdir)/lisp.mk ## Construct full set of libraries to be linked. LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \ @@ -667,8 +670,10 @@ endif @: Compile some files earlier to speed up further compilation. $(MAKE) -C ../lisp compile-first EMACS="$(bootstrap_exe)" -## Insert either autodeps.mk (if AUTO_DEPEND), else deps.mk. -@deps_frag@ - +ifeq ($(AUTO_DEPEND),yes) +-include $(ALLOBJS:%.o=${DEPDIR}/%.d) +else +include $(srcdir)/deps.mk +endif ### Makefile.in ends here diff --git a/src/autodeps.mk b/src/autodeps.mk deleted file mode 100644 index 8b014a7508c..00000000000 --- a/src/autodeps.mk +++ /dev/null @@ -1,5 +0,0 @@ -### autodeps.mk --- src/Makefile fragment for GNU Emacs - -## This is inserted in src/Makefile if AUTO_DEPEND=yes. - --include $(ALLOBJS:%.o=${DEPDIR}/%.d) diff --git a/src/deps.mk b/src/deps.mk index 71a5f42d22e..23789384fdb 100644 --- a/src/deps.mk +++ b/src/deps.mk @@ -20,7 +20,7 @@ ## Commentary: ## -## This file is inserted in src/Makefile if AUTO_DEPEND=no. +## This file is included in src/Makefile if AUTO_DEPEND=no. ## It defines static dependencies between the various source files. ## FIXME some of these dependencies are platform-specific. diff --git a/src/lisp.mk b/src/lisp.mk index 8eb86b7429e..0a431a59d7d 100644 --- a/src/lisp.mk +++ b/src/lisp.mk @@ -34,10 +34,6 @@ ## that does not have an explicit .el extension, but beware of any ## no-byte-compile ones. -## Confusingly, international/cp51932 and international/eucjp-ms are -## unconditionally loaded from language/japanese, instead of being -## loaded directly from loadup.el; FIXME. - ## Note that this list should not include lisp files which might not ## be present, like site-load.el and site-init.el; this makefile ## expects them all to be either present or buildable. @@ -96,9 +92,9 @@ lisp = \ $(lispsource)/language/romanian.elc \ $(lispsource)/language/greek.elc \ $(lispsource)/language/hebrew.elc \ - $(lispsource)/language/japanese.elc \ $(lispsource)/international/cp51932.el \ $(lispsource)/international/eucjp-ms.el \ + $(lispsource)/language/japanese.elc \ $(lispsource)/language/korean.elc \ $(lispsource)/language/lao.elc \ $(lispsource)/language/tai-viet.elc \ diff --git a/src/macfont.h b/src/macfont.h index f311577f051..403be94e332 100644 --- a/src/macfont.h +++ b/src/macfont.h @@ -48,7 +48,7 @@ struct mac_glyph_layout typedef CTFontDescriptorRef FontDescriptorRef; typedef CTFontRef FontRef; typedef CTFontSymbolicTraits FontSymbolicTraits; -typedef CTCharacterCollection CharacterCollection; +typedef NSCharacterCollection CharacterCollection; #define MAC_FONT_NAME_ATTRIBUTE kCTFontNameAttribute #define MAC_FONT_FAMILY_NAME_ATTRIBUTE kCTFontFamilyNameAttribute @@ -79,8 +79,8 @@ enum { }; enum { - MAC_CHARACTER_COLLECTION_IDENTITY_MAPPING = kCTIdentityMappingCharacterCollection, - MAC_CHARACTER_COLLECTION_ADOBE_JAPAN1 = kCTAdobeJapan1CharacterCollection + MAC_CHARACTER_COLLECTION_IDENTITY_MAPPING = NSIdentityMappingCharacterCollection, + MAC_CHARACTER_COLLECTION_ADOBE_JAPAN1 = NSAdobeJapan1CharacterCollection }; #define mac_font_descriptor_create_with_attributes \ diff --git a/src/nsfns.m b/src/nsfns.m index f8863e6d400..8a3c6ccf2b0 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -1075,7 +1075,6 @@ This function is an internal primitive--use `make-frame' instead. */) Lisp_Object name; int minibuffer_only = 0; long window_prompting = 0; - int width, height; ptrdiff_t count = specpdl_ptr - specpdl; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; Lisp_Object display; @@ -1455,6 +1454,15 @@ ns_run_file_dialog (void) ns_fd_data.panel = nil; } +#ifdef NS_IMPL_COCOA +#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_9 +#define MODAL_OK_RESPONSE NSModalResponseOK +#endif +#endif +#ifndef MODAL_OK_RESPONSE +#define MODAL_OK_RESPONSE NSOKButton +#endif + DEFUN ("ns-read-file-name", Fns_read_file_name, Sns_read_file_name, 1, 5, 0, doc: /* Use a graphical panel to read a file name, using prompt PROMPT. Optional arg DIR, if non-nil, supplies a default directory. @@ -1466,10 +1474,9 @@ Optional arg DIR_ONLY_P, if non-nil, means choose only directories. */) Lisp_Object init, Lisp_Object dir_only_p) { static id fileDelegate = nil; - BOOL ret; BOOL isSave = NILP (mustmatch) && NILP (dir_only_p); id panel; - Lisp_Object fname; + Lisp_Object fname = Qnil; NSString *promptS = NILP (prompt) || !STRINGP (prompt) ? nil : [NSString stringWithUTF8String: SSDATA (prompt)]; @@ -1549,20 +1556,17 @@ Optional arg DIR_ONLY_P, if non-nil, means choose only directories. */) while (ns_fd_data.panel != nil) [NSApp run]; - ret = (ns_fd_data.ret == NSOKButton); - - if (ret) + if (ns_fd_data.ret == MODAL_OK_RESPONSE) { NSString *str = ns_filename_from_panel (panel); if (! str) str = ns_directory_from_panel (panel); - if (! str) ret = NO; - else fname = build_string ([str UTF8String]); + if (str) fname = build_string ([str UTF8String]); } [[FRAME_NS_VIEW (SELECTED_FRAME ()) window] makeKeyWindow]; unblock_input (); - return ret ? fname : Qnil; + return fname; } const char * @@ -2677,7 +2681,16 @@ compute_tip_xy (struct frame *f, pt.y = dpyinfo->last_mouse_motion_y; /* Convert to screen coordinates */ pt = [view convertPoint: pt toView: nil]; +#if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 pt = [[view window] convertBaseToScreen: pt]; +#else + { + NSRect r = NSMakeRect (pt.x, pt.y, 0, 0); + r = [[view window] convertRectToScreen: r]; + pt.x = r.origin.x; + pt.y = r.origin.y; + } +#endif } else { diff --git a/src/nsimage.m b/src/nsimage.m index 3e90226cbf6..9302cd2f212 100644 --- a/src/nsimage.m +++ b/src/nsimage.m @@ -187,7 +187,11 @@ ns_set_alpha (void *img, int x, int y, unsigned char a) /* The next two lines cause the DPI of the image to be ignored. This seems to be the behavior users expect. */ +#ifdef NS_IMPL_COCOA +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 [image setScalesWhenResized: YES]; +#endif +#endif [image setSize: NSMakeSize([imgRep pixelsWide], [imgRep pixelsHigh])]; [image setName: [NSString stringWithUTF8String: SSDATA (file)]]; @@ -207,7 +211,6 @@ ns_set_alpha (void *img, int x, int y, unsigned char a) - initFromXBM: (unsigned char *)bits width: (int)w height: (int)h fg: (unsigned long)fg bg: (unsigned long)bg { - int bpr = (w + 7) / 8; unsigned char *planes[5]; [self initWithSize: NSMakeSize (w, h)]; @@ -353,7 +356,11 @@ ns_set_alpha (void *img, int x, int y, unsigned char a) /* The next two lines cause the DPI of the image to be ignored. This seems to be the behavior users expect. */ +#ifdef NS_IMPL_COCOA +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 [self setScalesWhenResized: YES]; +#endif +#endif [self setSize: NSMakeSize([bmr pixelsWide], [bmr pixelsHigh])]; break; diff --git a/src/nsmenu.m b/src/nsmenu.m index 26fe26e5e0d..b5cb64d68e5 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -1418,7 +1418,7 @@ Lisp_Object ns_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents) { id dialog; - Lisp_Object window, tem, title; + Lisp_Object tem, title; NSPoint p; BOOL isQ; NSAutoreleasePool *pool; @@ -1506,7 +1506,11 @@ ns_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents) area.size.width = ICONSIZE; area.size.height= ICONSIZE; img = [[NSImage imageNamed: @"NSApplicationIcon"] copy]; +#ifdef NS_IMPL_COCOA +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 [img setScalesWhenResized: YES]; +#endif +#endif [img setSize: NSMakeSize (ICONSIZE, ICONSIZE)]; imgView = [[NSImageView alloc] initWithFrame: area]; [imgView setImage: img]; diff --git a/src/nsterm.h b/src/nsterm.h index d8ffd93a71b..c06b7c49a6d 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -396,6 +396,7 @@ typedef float EmacsCGFloat; - condemn; - reprieve; - (bool)judge; ++ (CGFloat)scrollerWidth; @end diff --git a/src/nsterm.m b/src/nsterm.m index 6a4d0a6ad23..67a03898d13 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -1538,7 +1538,7 @@ ns_get_color (const char *name, NSColor **col) { NSColor *new = nil; static char hex[20]; - int scaling; + int scaling = 0; float r = -1.0, g, b; NSString *nsname = [NSString stringWithUTF8String: name]; @@ -2093,6 +2093,18 @@ ns_clear_frame_area (struct frame *f, int x, int y, int width, int height) return; } +static void +ns_copy_bits (struct frame *f, NSRect src, NSRect dest) +{ + if (FRAME_NS_VIEW (f)) + { + ns_focus (f, &dest, 1); + [FRAME_NS_VIEW (f) scrollRect: src + by: NSMakeSize (dest.origin.x - src.origin.x, + dest.origin.y - src.origin.y)]; + ns_unfocus (f); + } +} static void ns_scroll_run (struct window *w, struct run *run) @@ -2145,11 +2157,8 @@ ns_scroll_run (struct window *w, struct run *run) { NSRect srcRect = NSMakeRect (x, from_y, width, height); NSRect dstRect = NSMakeRect (x, to_y, width, height); - NSPoint dstOrigin = NSMakePoint (x, to_y); - ns_focus (f, &dstRect, 1); - NSCopyBits (0, srcRect , dstOrigin); - ns_unfocus (f); + ns_copy_bits (f, srcRect , dstRect); } unblock_input (); @@ -2205,13 +2214,10 @@ ns_shift_glyphs_for_insert (struct frame *f, { NSRect srcRect = NSMakeRect (x, y, width, height); NSRect dstRect = NSMakeRect (x+shift_by, y, width, height); - NSPoint dstOrigin = dstRect.origin; NSTRACE (ns_shift_glyphs_for_insert); - ns_focus (f, &dstRect, 1); - NSCopyBits (0, srcRect, dstOrigin); - ns_unfocus (f); + ns_copy_bits (f, srcRect, dstRect); } @@ -2459,6 +2465,7 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, switch (cursor_type) { + case DEFAULT_CURSOR: case NO_CURSOR: break; case FILLED_BOX_CURSOR: @@ -3957,7 +3964,6 @@ ns_set_horizontal_scroll_bar (struct window *window, EmacsScroller *bar; int top, height, left, width; int window_x, window_width; - int pixel_width = WINDOW_PIXEL_WIDTH (window); BOOL update_p = YES; /* optimization; display engine sends WAY too many of these.. */ @@ -4315,6 +4321,7 @@ ns_create_terminal (struct ns_display_info *dpyinfo) terminal->menu_show_hook = ns_menu_show; terminal->popup_dialog_hook = ns_popup_dialog; terminal->set_vertical_scroll_bar_hook = ns_set_vertical_scroll_bar; + terminal->set_horizontal_scroll_bar_hook = ns_set_horizontal_scroll_bar; terminal->condemn_scroll_bars_hook = ns_condemn_scroll_bars; terminal->redeem_scroll_bar_hook = ns_redeem_scroll_bar; terminal->judge_scroll_bars_hook = ns_judge_scroll_bars; @@ -4599,7 +4606,7 @@ ns_term_shutdown (int sig) - (id)init { - if (self = [super init]) + if ((self = [super init])) { #ifdef NS_IMPL_COCOA self->isFirst = YES; @@ -4886,21 +4893,43 @@ ns_term_shutdown (int sig) EV_TRAILER ((id)nil); } +static bool +runAlertPanel(NSString *title, + NSString *msgFormat, + NSString *defaultButton, + NSString *alternateButton) +{ +#if !defined (NS_IMPL_COCOA) || \ + MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_9 + return NSRunAlertPanel(title, msgFormat, defaultButton, alternateButton, nil) + == NSAlertDefaultReturn; +#else + NSAlert *alert = [[NSAlert alloc] init]; + [alert setAlertStyle: NSCriticalAlertStyle]; + [alert setMessageText: msgFormat]; + [alert addButtonWithTitle: defaultButton]; + [alert addButtonWithTitle: alternateButton]; + NSInteger ret = [alert runModal]; + [alert release]; + return ret == NSAlertFirstButtonReturn; +#endif +} + - (NSApplicationTerminateReply)applicationShouldTerminate: (id)sender { - int ret; + bool ret; if (NILP (ns_confirm_quit)) // || ns_shutdown_properly --> TO DO return NSTerminateNow; - ret = NSRunAlertPanel(ns_app_name, - @"Exit requested. Would you like to Save Buffers and Exit, or Cancel the request?", - @"Save Buffers and Exit", @"Cancel", nil); + ret = runAlertPanel(ns_app_name, + @"Exit requested. Would you like to Save Buffers and Exit, or Cancel the request?", + @"Save Buffers and Exit", @"Cancel"); - if (ret == NSAlertDefaultReturn) + if (ret) return NSTerminateNow; - else if (ret == NSAlertAlternateReturn) + else return NSTerminateCancel; return NSTerminateNow; /* just in case */ } @@ -5244,9 +5273,6 @@ not_in_argv (NSString *arg) int code; unsigned fnKeysym = 0; static NSMutableArray *nsEvArray; -#ifdef NS_IMPL_GNUSTEP - static BOOL firstTime = YES; -#endif int left_is_none; unsigned int flags = [theEvent modifierFlags]; @@ -5475,18 +5501,6 @@ not_in_argv (NSString *arg) } -#ifdef NS_IMPL_GNUSTEP - /* if we get here we should send the key for input manager processing */ - /* Disable warning, there is nothing a user can do about it anyway, and - it does not seem to matter. */ -#if 0 - if (firstTime && [[NSInputManager currentInputManager] - wantsToDelayTextChangeNotifications] == NO) - fprintf (stderr, - "Emacs: WARNING: TextInput mgr wants marked text to be permanent!\n"); -#endif - firstTime = NO; -#endif if (NS_KEYLOG && !processingCompose) fprintf (stderr, "keyDown: Begin compose sequence.\n"); @@ -6251,8 +6265,10 @@ if (cols > 0 && rows > 0) [win setAcceptsMouseMovedEvents: YES]; [win setDelegate: self]; +#if !defined (NS_IMPL_COCOA) || \ + MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_9 [win useOptimizedDrawing: YES]; - +#endif sz.width = frame_resize_pixelwise ? 1 : FRAME_COLUMN_WIDTH (f); sz.height = frame_resize_pixelwise ? 1 : FRAME_LINE_HEIGHT (f); [win setResizeIncrements: sz]; @@ -6313,8 +6329,10 @@ if (cols > 0 && rows > 0) if ([col alphaComponent] != (EmacsCGFloat) 1.0) [win setOpaque: NO]; +#if !defined (NS_IMPL_COCOA) || \ + MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_9 [self allocateGState]; - +#endif [NSApp registerServicesMenuSendTypes: ns_send_types returnTypes: nil]; @@ -6369,7 +6387,7 @@ if (cols > 0 && rows > 0) } else if (next_maximized == FULLSCREEN_HEIGHT || (next_maximized == -1 - && abs (defaultFrame.size.height - result.size.height) + && abs ((int)(defaultFrame.size.height - result.size.height)) > FRAME_LINE_HEIGHT (emacsframe))) { /* first click */ @@ -6392,7 +6410,7 @@ if (cols > 0 && rows > 0) } else if (next_maximized == FULLSCREEN_MAXIMIZED || (next_maximized == -1 - && abs (defaultFrame.size.width - result.size.width) + && abs ((int)(defaultFrame.size.width - result.size.width)) > FRAME_COLUMN_WIDTH (emacsframe))) { result = defaultFrame; /* second click */ @@ -6639,7 +6657,10 @@ if (cols > 0 && rows > 0) [fw setTitle:[w title]]; [fw setDelegate:self]; [fw setAcceptsMouseMovedEvents: YES]; +#if !defined (NS_IMPL_COCOA) || \ + MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_9 [fw useOptimizedDrawing: YES]; +#endif [fw setResizeIncrements: sz]; [fw setBackgroundColor: col]; if ([col alphaComponent] != (EmacsCGFloat) 1.0) @@ -6882,7 +6903,7 @@ if (cols > 0 && rows > 0) /* NSDraggingDestination protocol methods. Actually this is not really a protocol, but a category of Object. O well... */ --(NSUInteger) draggingEntered: (id <NSDraggingInfo>) sender +-(NSDragOperation) draggingEntered: (id <NSDraggingInfo>) sender { NSTRACE (draggingEntered); return NSDragOperationGeneric; @@ -7167,7 +7188,6 @@ if (cols > 0 && rows > 0) one screen, we want to constrain. Other times not. */ NSArray *screens = [NSScreen screens]; NSUInteger nr_screens = [screens count], nr_eff_screens = 0, i; - struct frame *f = ((EmacsView *)[self delegate])->emacsframe; NSTRACE (constrainFrameRect); NSTRACE_RECT ("input", frameRect); @@ -7263,7 +7283,15 @@ if (cols > 0 && rows > 0) { /* TODO: if we want to allow variable widths, this is the place to do it, however neither GNUstep nor Cocoa support it very well */ - return [NSScroller scrollerWidth]; + CGFloat r; +#if !defined (NS_IMPL_COCOA) || \ + MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 + r = [NSScroller scrollerWidth]; +#else + r = [NSScroller scrollerWidthForControlSize: NSRegularControlSize + scrollerStyle: NSScrollerStyleLegacy]; +#endif + return r; } |