README 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. NS -- the Cocoa interface for OS X and compatible systems
  2. ---------------------------------------------------------
  3. This directory contains files needed to build Emacs on system based on
  4. NextStep (NS), including OS X (Mac) and GNUstep, using the Cocoa API.
  5. HISTORY
  6. The Nextstep (NS) interface of GNU Emacs was originally written in
  7. 1994 for NeXTSTEP systems running Emacs 19 and subsequently ported to
  8. OpenStep and then Rhapsody, which became Mac OS X. In 2004 it was
  9. adapted to GNUstep, a free OpenStep implementation, and in 2008 it was
  10. merged to the GNU Emacs trunk and released with Emacs 23. Around the
  11. same time a separate Mac-only port using the Carbon APIs and
  12. descending from a 2001 MacOS 8/9 port of Emacs 21 was removed. (It
  13. remains available externally under the name "mac".)
  14. OVERVIEW OF COCOA AND OBJECTIVE-C
  15. Cocoa is an API for the Objective-C language, an objective oriented
  16. superset of C. Anybody with experience with iOS or modern OS X
  17. application development should feel at home.
  18. A method call in Objective-C differs from most other languages in the
  19. fact that it doesn't have a normal name. Instead, the method name is
  20. made up of the name of each parameter. An exception to this rule are
  21. methods without parameters.
  22. The following calls a method in the object 'anObject'.
  23. [anObject alpha:1 beta:2 gamma:3];
  24. Classes are declared like the following:
  25. @interface AClassName
  26. {
  27. // A class method.
  28. + (TYPE)name1:(TYPE)param1
  29. // An object method.
  30. - (TYPE)name1:(TYPE)param1 name2:(TYPE)param2;
  31. }
  32. @end
  33. GUIDELINES
  34. * Adhere the to the FSF philosophy that a feature in GNU software
  35. should not only be available on non-free systems.
  36. * People with varying Cocoa and Objective-C skills will read and
  37. modify the NS code over a long period of time. Keep the code simple
  38. and avoid language constructs that makes the code hard to maintain.
  39. * Don't use macros and types intended for the XCode Interface Builder,
  40. like 'IBAction'.
  41. * The NS interface should work on all version of OS X from 10.6.8
  42. (Snow Leopard) to the latest official release.
  43. * Under OS X, it is possible to build Emacs using NS, X11, or console
  44. only. A new OS X feature should work in all appropriate builds.
  45. TRACING SUPPORT
  46. The NS interface features a printf-based trace package that prints the
  47. call tree of selected functions in the Cocoa interface, plus various
  48. extra information. It can be enabled by uncommenting the line
  49. defining 'NSTRACE_ENABLED' in "nsterm.h". To enable more output,
  50. uncomment the lines defining symbols starting with 'NSTRACE_GROUP'.
  51. GNUSTEP AND OTHER COMPATIBLE SYSTEMS
  52. The NS interface works on system compatible with OS X, for example
  53. GNUstep. Even though they are less frequently used, this is important
  54. for a number of reasons:
  55. * It supports the GNUstep project and provides an Emacs with the same
  56. look-and-feel as the rest of the system.
  57. * This allows other Emacs developers to test their changes on the NS
  58. interface without having access to an OS X machine.
  59. * If a feature in the NS interface work on free systems like GNUstep,
  60. this meets the FSF requirement that features in GNU software should
  61. not only be available on non-free systems.
  62. SEE ALSO
  63. The src/ns... files contains the C and Objective-C parts.
  64. The lisp/term/ns-win.el file contains the lisp part of the NS
  65. interface.
  66. The INSTALL file in this directory for compilation instructions.
  67. The Nextstep section in the etc/TODO file for a list of ideas for
  68. future development.
  69. ----------------------------------------------------------------------
  70. Copyright 2008-2016 Free Software Foundation, Inc.
  71. This file is part of GNU Emacs.
  72. GNU Emacs is free software: you can redistribute it and/or modify
  73. it under the terms of the GNU General Public License as published by
  74. the Free Software Foundation, either version 3 of the License, or
  75. (at your option) any later version.
  76. GNU Emacs is distributed in the hope that it will be useful,
  77. but WITHOUT ANY WARRANTY; without even the implied warranty of
  78. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  79. GNU General Public License for more details.
  80. You should have received a copy of the GNU General Public License
  81. along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.