unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Adrian Robert <adrian.b.robert@gmail.com>
To: Dan Nicolaescu <dann@ics.uci.edu>
Cc: emacs- devel <emacs-devel@gnu.org>
Subject: Re: a review of the merge (Re: Emacs.app merged)
Date: Wed, 16 Jul 2008 21:25:34 -0400	[thread overview]
Message-ID: <D68874F1-3E18-41EC-9AFC-BC0EA5E91C19@gmail.com> (raw)
In-Reply-To: <200807160925.m6G9PuVj012462@sallyv1.ics.uci.edu>

[-- Attachment #1: Type: text/plain, Size: 15239 bytes --]


On Jul 16, 2008, at 5:25 AM, Dan Nicolaescu wrote:

> Adrian Robert <adrian.b.robert@gmail.com> writes:
>
>> http://cortex.med.cornell.edu/~arobert/emacs-app/ 
>> diffBeforeMerge.patch
>
> I looked over this patch and I wrote quite a few comments.  Can you
> please look over and try to address them?  It would be good if you  
> could
> find a system to keep track of these comments so that they don't get
> lost.  Some of the comments from the previous rounds have been  
> lost :-(.

Thanks for the comments and sorry if some previous ones have been  
inadvertently left unaddresses.



>> The newly-added 'nextstep' directory contains additional information.
>> FOR-RELEASE in that directory contains a list of TODOs before release
>> of 23.1.
>
> Why not just use admin/FOR-RELEASE? It's easier to look in just one  
> place.

This is up to the maintainers.  I thought while the port is settling  
down and there are a lot of issues, it might be good to keep them from  
cluttering up the admin file.



> Also please get rid of the nextstep/compile file, it's not a good idea
> to have to document another way of building emacs, especially since
> ./configure; make should be good enough for this platform.

I'm working on this...



> +2008-07-15  Adrian Robert <Adrian.B.Robert@gmail.com>
> +
> +	* Emacs.clr: New file, add support for X color names to NS display
> +	implementations.
>
> Is this really needed?  All other platforms do just fine by  
> definining x-colors in elisp.

Actually, the Carbon and Windows ports put these defs in source code,  
macfns.c and w32fns.c respectively.  Keeping them in a separate data  
file seems a little cleaner, and also fits well with the way color  
lists are handled in NeXTstep.  But the defs can be moved into source  
code if that is preferred.



> Index: lib-src/Makefile.in
> ===================================================================
> RCS file: /sources/emacs/emacs/lib-src/Makefile.in,v
> retrieving revision 1.163
> diff -a -u -r1.163 Makefile.in
> --- lib-src/Makefile.in	9 May 2008 23:19:10 -0000	1.163
> +++ lib-src/Makefile.in	15 Jul 2008 16:50:14 -0000
> @@ -144,0 +144,8 @@
> +#ifdef HAVE_NS
> +.m.o:
> +#ifdef GNUSTEP
> +	$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -fgnu-runtime -Wno-import - 
> fconstant-string-class=NSConstantString $<
> +#else
> +	$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
> +#endif
> +#endif
>
> No need for the extra HAVE_NS conditional.

Done.



> +#if defined(COCOA)
> +mac-fix-env: ${srcdir}/mac-fix-env.m
> +	$(CC) -o mac-fix-env ${srcdir}/mac-fix-env.m -prebind -framework  
> Foundation
> +#endif
>
> No need to make it conditional.  And shouldn't this use  
> NS_IMPL_COCOA instead of COCOA ?

GNUSTEP and COCOA were used instead of the NS_IMPL ones in configure.   
Changed everywhere for consistency.



> Index: lisp/facemenu.el
> ===================================================================
> RCS file: /sources/emacs/emacs/lisp/facemenu.el,v
> retrieving revision 1.104
> diff -a -u -r1.104 facemenu.el
> --- lisp/facemenu.el	6 May 2008 07:57:34 -0000	1.104
> +++ lisp/facemenu.el	15 Jul 2008 16:52:14 -0000
> @@ -460,10 +460,11 @@
> (defun facemenu-read-color (&optional prompt)
>   "Read a color using the minibuffer."
>   (let* ((completion-ignore-case t)
> +	 (require-match (not (eq window-system 'ns)))
> 	 (col (completing-read (or prompt "Color: ")
> 			       (or facemenu-color-alist
> 				   (defined-colors))
> -			       nil t)))
> +			       nil require-match)))
>     (if (equal "" col)
> 	nil
>       col)))
>
> Why do this?
>
> This does not seem specific to NS, if it is not, then it should be
> discussed and checked in separately.

This is so users can enter colors in numeric format, such as  
ARGBD0FFFFFF.  The NS port interprets such formats to allow alpha  
specification.



> Index: lisp/frame.el
> ...
>
> Is this necessary?  Can NS make frames on another display?  If not,
> then this should not be needed.

The problem this solves is requesting a GUI frame from a terminal  
session using make-frame-on-display.  As it was, only display formats  
compatible with X-Windows were accepted.  This allows anything non-nil  
to work, since right now only one display is supported under NS.



> Index: lisp/loadup.el
> ===================================================================
> RCS file: /sources/emacs/emacs/lisp/loadup.el,v
> retrieving revision 1.169
> diff -a -u -r1.169 loadup.el
> --- lisp/loadup.el	21 Jun 2008 01:38:37 -0000	1.169
> +++ lisp/loadup.el	15 Jul 2008 16:53:09 -0000
> @@ -212,3 +212,6 @@
> (if (featurep 'mac-carbon)
>     (progn
>       (load "term/mac-win")))
> +(if (featurep 'ns-windowing)
> +    (progn
> +      (load "emacs-lisp/easymenu")  ;; for platform-related menu  
> adjustments
>
> RMS was very much against having different platforms change the menus.
> Is that policy changed?  If not, then this should not be needed.
> And there's no need to use easymenu to modify menus.

This is not done by default, only when ns-extended-platform-support is  
turned on.  And it makes only very minor modifications, for purpose of  
enhancing platform consistency.  Anyway, if this is retained, one  
option would be to move it out into a separately-loaded file (not  
included in dumped emacs).  Another would be to manually do what  
easymenu does (but this would be ugly).



> +      (load "emacs-lisp/easy-mmode")
>
> Same as above, this is for adding platform specific behavior.

Removed as per other discussion.



> Index: lisp/startup.el
> ===================================================================
> RCS file: /sources/emacs/emacs/lisp/startup.el,v
> retrieving revision 1.494
> diff -a -u -r1.494 startup.el
> --- lisp/startup.el	2 Jul 2008 01:49:01 -0000	1.494
> +++ lisp/startup.el	15 Jul 2008 16:54:18 -0000
> @@ -182,3 +182,6 @@
> and VALUE is the value which is given to that frame parameter
> \(most options use the argument for this, so VALUE is not present).")
>
> +(defconst command-line-ns-option-alist
> +  '(("-NSAutoLaunch" 1 ns-ignore-1-arg)
> +    ("-NXAutoLaunch" 1 ns-ignore-1-arg)
> [snip]
>
> Can this be put somewhere else?  It would be better if all other  
> platforms
> do not have to load this definition.
> +      ;; Add the long NS options to longopts.
> +      (setq tem command-line-ns-option-alist)
> +      (while tem
> +	(if (string-match "^--" (car (car tem)))
> +	    (setq longopts (cons (list (car (car tem))) longopts)))
> +	(setq tem (cdr tem)))
>
> Can this be avoided and use the generic code for command line  
> processing?


NS has followed the X GUI in both these cases, using ns- prefix to  
distinguish variables for option lists, etc. that are specific to the  
NS platform, as X- is used to indicate X-windows.  I do realize that  
w32 and mac (Carbon) seem to deal with their arguments in ways not  
involving this file.  The question is, should every platform be done  
in the same way as X, or should X and NS be changed to whatever mac  
and w32 are doing?



> +#ifdef HAVE_NS
> +abbrev.o buffer.o callint.o cmds.o dispnew.o editfns.o fileio.o  
> frame.o \
> +  fontset.o indent.o insdel.o keyboard.o macros.o minibuf.o msdos.o  
> process.o \
> +  scroll.o sysdep.o term.o widget.o window.o xdisp.o xfaces.o  
> xfns.o \
> +  xterm.o xselect.o sound.o: nsgui.h
> +nsfns.o: nsfns.m charset.h nsterm.h nsgui.h frame.h window.h  
> buffer.h \
> +  dispextern.h nsgui.h fontset.h $(INTERVAL_SRC) keyboard.h  
> blockinput.h \
> +  atimer.h systime.h epaths.h termhooks.h coding.h systime.h $ 
> (config_h)
> +nsmenu.o: nsmenu.m termhooks.h frame.h window.h dispextern.h \
> +  nsgui.h keyboard.h blockinput.h atimer.h systime.h buffer.h \
> +  nsterm.h $(config_h)
> +nsterm.o: nsterm.m blockinput.h atimer.h systime.h syssignal.h  
> nsterm.h \
> +  nsgui.h frame.h charset.h ccl.h dispextern.h fontset.h  
> termhooks.h \
> +  termopts.h termchar.h disptab.h buffer.h window.h keyboard.h \
> +  $(INTERVAL_SRC) process.h coding.h $(config_h)
> +nsselect.o: nsselect.m blockinput.h nsterm.h nsgui.h frame.h $ 
> (config_h)
> +nsimage.o: nsimage.m nsterm.h
> +nsfont.o: nsterm.h dispextern.h frame.h lisp.h $(config_h)
>
> Better make this unconditional.

Here I aped what the Carbon port does just above these lines.  If it's  
wrong, which example should I follow?



> Index: src/frame.c
> ...
>   Fselect_window (XFRAME (frame)->selected_window, Qnil);
>
> +#ifdef NS_IMPL_COCOA
> +  /* term gets no other notification of this */
> +  if (for_deletion)
> +    Fraise_frame(Qnil);
> +#endif
>
> Why isn't his needed for other platforms too?

I don't know.  I would be happy to get rid of it if I knew.



> +#ifndef HAVE_NS  /* PENDING: ensure font attrs change goes through */
>
> Better use "FIXME" instead of "PENDING".

Are there other options besides FIXME?  I use PENDING to flag  
something that is not necessarily a bug or even needing change, but  
that needs to be considered.  What about TODO?



> Index: src/fringe.c
> ===================================================================
> RCS file: /sources/emacs/emacs/src/fringe.c,v
> retrieving revision 1.52
> diff -a -u -r1.52 fringe.c
> --- src/fringe.c	14 May 2008 07:49:32 -0000	1.52
> +++ src/fringe.c	15 Jul 2008 16:59:29 -0000
> @@ -482,4 +482,4 @@
> static Lisp_Object *fringe_faces;
> static int max_fringe_bitmaps;
>
> -static int max_used_fringe_bitmap = MAX_STANDARD_FRINGE_BITMAPS;
> +int max_used_fringe_bitmap = MAX_STANDARD_FRINGE_BITMAPS;
>
>
> Why? This is not in the ChangeLog?  Undo please if not needed.

Used for memory allocation handling in nsterm.m  
(ns_draw_fringe_bitmap(), from line 2163).  It is in the ChangeLog:

	* fringe.c (max_used_fringe_bitmap): Make public.



> Index: src/getloadavg.c
> ===================================================================
> RCS file: /sources/emacs/emacs/src/getloadavg.c,v
> retrieving revision 1.53
> diff -a -u -r1.53 getloadavg.c
> --- src/getloadavg.c	8 Jan 2008 20:44:33 -0000	1.53
> +++ src/getloadavg.c	15 Jul 2008 16:59:32 -0000
>
> This file comes from gnulib, we try not to change it here.  It  
> should go there first.
> Why wasn't this needed until now?  This should not have anything to  
> do with NS...

I don't know, probably it was never working.  I actually am not sure  
if it is now, but anyway the original is using #ifdef NeXT to check  
whether mach.h is in a subdirectory, but it seems all NeXT-derived  
systems put it in the same place (e.g., my OS X 10.5.4 machine here).

ACTUALLY, it looks like this file is not even used anymore (grep thru  
Makefile.in), so probably it should just be removed.



> Index: src/keyboard.c
> ===================================================================
> RCS file: /sources/emacs/emacs/src/keyboard.c,v
> retrieving revision 1.960
> diff -a -u -r1.960 keyboard.c
> --- src/keyboard.c	26 Jun 2008 04:24:36 -0000	1.960
> +++ src/keyboard.c	15 Jul 2008 17:00:59 -0000
> @@ -7305,3 +7312,7 @@
> void
> handle_async_input ()
> {
> +#ifdef BSD4_1
> +  extern int select_alarmed;
> +#endif
> +
>
> Please remove this or use HAVE_NS instead, BSD4_1 is not defined in
> the emacs tree anymore.  This probably causes big problems with the
> input if this code is needed.
>
> @@ -7317,6 +7328,9 @@
>       if (nread <= 0)
> 	break;
>
> +#ifdef BSD4_1
> +      select_alarmed = 1;  /* Force the select emulator back to  
> life */
> +#endif
>
> Same here.
>
> @@ -7335,3 +7349,6 @@
>   signal (signo, input_available_signal);
> #endif /* USG */
>
> +#ifdef BSD4_1
> +  sigisheld (SIGIO);
> +#endif
>
> Same here.
>
> @@ -7348,3 +7366,6 @@
>   handle_async_input ();
> #endif
>
> +#ifdef BSD4_1
> +  sigfree ();
> +#endif
>
> And here.

These all must be spurious merge conflicts.  Removed.  Sorry about this.



> @@ -8044,7 +8070,12 @@
> 	      && SYMBOLP (XSYMBOL (def)->function)
> 	      && ! NILP (Fget (def, Qmenu_alias)))
> 	    def = XSYMBOL (def)->function;
> +#ifdef HAVE_NS
> +          /* prefer 'super' bindings */
> +	  tem = Fwhere_is_internal (def, Qnil, Qsuper, Qt, Qt);
> +#else
> 	  tem = Fwhere_is_internal (def, Qnil, Qt, Qnil, Qt);
> +#endif
>
>
> Please run this by Stefan, not sure if we want to have a platform do
> something different here.

Yes, I was working to make this only happen when ns-extended-platform- 
support-mode is on, but it's a bit tricky since this only gets called  
once.



> Index: src/keymap.c
> ===================================================================
> RCS file: /sources/emacs/emacs/src/keymap.c,v
> retrieving revision 1.374
> diff -a -u -r1.374 keymap.c
> --- src/keymap.c	5 Jun 2008 05:44:11 -0000	1.374
> +++ src/keymap.c	15 Jul 2008 17:01:22 -0000
> @@ -111,3 +111,6 @@
>
> extern Lisp_Object Voverriding_local_map;
>
> +#ifdef HAVE_NS
> +extern Lisp_Object Qalt, Qcontrol, Qhyper, Qmeta, Qsuper;
> +#endif
>
> Please get the changes in this file approved by Stefan, they look a  
> bit suspicious.

OK, being worked on.



> Index: src/lisp.h
> ===================================================================
> RCS file: /sources/emacs/emacs/src/lisp.h,v
> retrieving revision 1.631
> diff -a -u -r1.631 lisp.h
> --- src/lisp.h	11 Jul 2008 14:20:06 -0000	1.631
> +++ src/lisp.h	15 Jul 2008 17:01:36 -0000
> @@ -28,3 +28,7 @@
> #define P_(proto) ()
> #endif
>
> +#ifdef NS_IMPL_GNUSTEP
> +/* This conflicts with functions in the GNUstep libraries. */
> +#define hash_remove emacs_hash_remove
> +#endif  /* NS_IMPL_GNUSTEP */
>
> Sounds odd, but if this is indeed true, better rename the function in
> emacs to avoid extra #ifdefs.

Yes, hash_put, hash_remove, etc. are all used in those libs.  Only  
hash_remove is declared so publicly within emacs though.



> Index: src/terminfo.c
> ===================================================================
> RCS file: /sources/emacs/emacs/src/terminfo.c,v
> retrieving revision 1.24
> diff -a -u -r1.24 terminfo.c
> --- src/terminfo.c	14 May 2008 07:49:52 -0000	1.24
> +++ src/terminfo.c	15 Jul 2008 17:03:07 -0000
> @@ -24,4 +24,7 @@
>    so that we do not need to conditionalize the places in Emacs
>    that set them.  */
>
> +/* Causes a conflict on OS X 10.3 .*/
> +#ifndef NS_IMPL_COCOA
> char *UP, *BC, PC;
> +#endif
>
> Does "emacs -nw" work after doing this?  How come this wasn't a  
> problem with the Carbon port?

Yes, and I don't know.  It's possible something is different in the  
includes brought in by Carbon vs. Cocoa.



> Index: src/xdisp.c
> ===================================================================
> RCS file: /sources/emacs/emacs/src/xdisp.c,v
> retrieving revision 1.1233
> diff -a -u -r1.1233 xdisp.c
> --- src/xdisp.c	15 Jul 2008 15:45:05 -0000	1.1233
> +++ src/xdisp.c	15 Jul 2008 17:05:45 -0000
> @@ -22539,7 +22576,10 @@
> /* Switch the display of W's cursor on or off, according to the value
>    of ON.  */
>
> -static void
> +#ifndef HAVE_NS
> +static
> +#endif
> +void
> update_window_cursor (w, on)
>      struct window *w;
>      int on;
>
> Why? It doesn't seem to be used outside this file.

nsterm.m uses it for cursor blink.  Yes, I know, it should use the  
generic mechanism for this, and that is a longstanding TODO.  Help  
with it is welcome.  Once that's done this can be removed.


thanks for the comments,
Adrian


[-- Attachment #2: Type: text/html, Size: 23193 bytes --]

  parent reply	other threads:[~2008-07-17  1:25 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-15 18:47 Emacs.app merged Adrian Robert
2008-07-15 18:49 ` İsmail Dönmez
2008-07-15 19:28 ` Chong Yidong
2008-07-15 22:32 ` Thomas Christensen
2008-07-15 23:29   ` Cezar Halmagean
2008-07-16  9:25 ` a review of the merge (Re: Emacs.app merged) Dan Nicolaescu
2008-07-16 10:00   ` Jason Rumney
2008-07-16 12:17     ` Adrian Robert
2008-07-16 16:15       ` Stefan Monnier
2008-07-16 16:21   ` Stefan Monnier
2008-07-16 21:23     ` Dan Nicolaescu
2008-07-20  1:27       ` Adrian Robert
2008-07-20 11:56         ` Dan Nicolaescu
2008-07-28 13:25           ` Adrian Robert
2008-07-28 19:00             ` Dan Nicolaescu
2008-08-01 10:48               ` Adrian Robert
2008-08-01 11:09                 ` Jason Rumney
2008-08-01 12:55                   ` Dan Nicolaescu
2008-08-01 13:36                     ` Eli Zaretskii
2008-08-01 13:49                     ` Jason Rumney
2008-08-01 14:23                       ` Dan Nicolaescu
2008-08-01 14:48                         ` Adrian Robert
2008-08-01 15:07                           ` Dan Nicolaescu
2008-07-17  1:25   ` Adrian Robert [this message]
2008-07-17  3:24     ` Dan Nicolaescu
2008-07-17  4:16       ` FOR-RELEASE [was Re: a review of the merge (Re: Emacs.app merged)] Glenn Morris
2008-07-17  4:19       ` a review of the merge (Re: Emacs.app merged) Glenn Morris
2008-07-17 17:22       ` Adrian Robert
2008-07-17 18:08         ` Dan Nicolaescu
2008-07-17  3:43     ` Stefan Monnier
2008-07-17  7:33       ` David De La Harpe Golden
2008-07-17  6:55   ` Dan Nicolaescu
2008-07-16 19:26 ` Emacs.app merged Stefan Monnier
2008-07-17  1:26   ` Adrian Robert
2008-07-27 20:12 ` some missing code? (was: Re: Emacs.app merged) Dan Nicolaescu
2008-07-27 22:18 ` observations for ns*.m files (Re: " Dan Nicolaescu
2008-07-28  1:54   ` Adrian Robert
2008-07-28  2:58     ` Dan Nicolaescu
2008-07-28  4:16       ` Stefan Monnier
2008-07-28 11:00         ` Miles Bader
2008-07-28  7:15       ` Jason Rumney
2008-07-28 13:29         ` Adrian Robert
2008-07-28 13:54           ` Chong Yidong
2008-07-28 15:10           ` Jason Rumney
2008-07-28 13:28       ` Adrian Robert
2008-07-28 14:35         ` Dan Nicolaescu
2008-08-05  5:13 ` build system observations (was " Dan Nicolaescu
2008-08-06 16:25   ` Adrian Robert
2008-08-06 17:29     ` build system observations Dan Nicolaescu
2008-08-07  1:36       ` Adrian Robert
2008-09-05 15:03         ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D68874F1-3E18-41EC-9AFC-BC0EA5E91C19@gmail.com \
    --to=adrian.b.robert@gmail.com \
    --cc=dann@ics.uci.edu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).