changeset 112375:b7555c0e51fe

Merge from mainline.
author Paul Eggert <eggert@cs.ucla.edu>
date Wed, 19 Jan 2011 15:02:04 -0800
parents 47cb827a3b2a (current diff) f279fb6c0f32 (diff)
children aa320544d768
files
diffstat 11 files changed, 241 insertions(+), 159 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Wed Jan 19 13:54:19 2011 -0800
+++ b/lisp/gnus/ChangeLog	Wed Jan 19 15:02:04 2011 -0800
@@ -1,3 +1,20 @@
+2011-01-19  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-art.el (gnus-article-highlight): Remove argument passed to
+	gnus-article-add-buttons.
+
+2011-01-19  Tom Rauchenwald  <sehnsucht.nach.unendlichkeit@quantentunnel.de>  (tiny change)
+
+	* spam.el (spam-spamassassin-register-with-sa-learn): Insert a full
+	From header with a date and "nobody" as the sender.
+
+2011-01-19  Julien Danjou  <julien@danjou.info>
+
+	* gnus-art.el (gnus-article-add-buttons): Simplify condition.
+	(gnus-button-push): Remove gnus-button-entry function, it fails heavily
+	if you have the same regexp several times.
+	(gnus-button-push): Fix matching when regexp is symbol.
+
 2011-01-15  Glenn Morris  <rgm@gnu.org>
 
 	* message.el (message-mail): A compose-mail function should
--- a/lisp/gnus/gnus-art.el	Wed Jan 19 13:54:19 2011 -0800
+++ b/lisp/gnus/gnus-art.el	Wed Jan 19 15:02:04 2011 -0800
@@ -4413,7 +4413,6 @@
   (gnus-update-format-specifications nil 'article-mode)
   (set (make-local-variable 'page-delimiter) gnus-page-delimiter)
   (set (make-local-variable 'gnus-page-broken) nil)
-  (make-local-variable 'gnus-button-marker-list)
   (make-local-variable 'gnus-article-current-summary)
   (make-local-variable 'gnus-article-mime-handles)
   (make-local-variable 'gnus-article-decoded-p)
@@ -4436,10 +4435,6 @@
   (mm-enable-multibyte)
   (gnus-run-mode-hooks 'gnus-article-mode-hook))
 
-(defvar gnus-button-marker-list nil
-  "Regexp matching any of the regexps from `gnus-button-alist'.
-Internal variable.")
-
 (defun gnus-article-setup-buffer ()
   "Initialize the article buffer."
   (let* ((name (if gnus-single-article-buffer "*Article*"
@@ -4483,8 +4478,6 @@
 	  (setq gnus-article-mime-handle-alist nil)
 	  (buffer-disable-undo)
 	  (setq buffer-read-only t)
-	  ;; This list just keeps growing if we don't reset it.
-	  (setq gnus-button-marker-list nil)
 	  (unless (eq major-mode 'gnus-article-mode)
 	    (gnus-article-mode))
 	  (setq truncate-lines gnus-article-truncate-lines)
@@ -7658,7 +7651,7 @@
   (gnus-article-highlight-headers)
   (gnus-article-highlight-citation force)
   (gnus-article-highlight-signature)
-  (gnus-article-add-buttons force)
+  (gnus-article-add-buttons)
   (gnus-article-add-buttons-to-head))
 
 (defun gnus-article-highlight-some (&optional force)
@@ -7726,28 +7719,16 @@
   "Say whether PROP exists in the region."
   (text-property-not-all b e prop nil))
 
-(defun gnus-article-add-buttons (&optional force)
+(defun gnus-article-add-buttons ()
   "Find external references in the article and make buttons of them.
 \"External references\" are things like Message-IDs and URLs, as
 specified by `gnus-button-alist'."
-  (interactive (list 'force))
+  (interactive)
   (gnus-with-article-buffer
     (let ((inhibit-point-motion-hooks t)
 	  (case-fold-search t)
 	  (alist gnus-button-alist)
 	  beg entry regexp)
-      ;; Remove all old markers.
-      (let (marker entry new-list)
-	(while (setq marker (pop gnus-button-marker-list))
-	  (if (or (< marker (point-min)) (>= marker (point-max)))
-	      (push marker new-list)
-	    (goto-char marker)
-	    (when (setq entry (gnus-button-entry))
-	      (put-text-property (match-beginning (nth 1 entry))
-				 (match-end (nth 1 entry))
-				 'gnus-callback nil))
-	    (set-marker marker nil)))
-	(setq gnus-button-marker-list new-list))
       ;; We skip the headers.
       (article-goto-body)
       (setq beg (point))
@@ -7758,18 +7739,16 @@
 	  (let ((start (match-beginning (nth 1 entry)))
 		(end (match-end (nth 1 entry)))
 		(from (match-beginning 0)))
-	    (when (and (or (eq t (nth 2 entry))
-			   (eval (nth 2 entry)))
+	    (when (and (eval (nth 2 entry))
 		       (not (gnus-button-in-region-p
 			     start end 'gnus-callback)))
 	      ;; That optional form returned non-nil, so we add the
 	      ;; button.
 	      (setq from (set-marker (make-marker) from))
-	      (push from gnus-button-marker-list)
 	      (unless (and (eq (car entry) 'gnus-button-url-regexp)
 			   (gnus-article-extend-url-button from start end))
 		(gnus-article-add-button start end
-					 'gnus-button-push from)
+					 'gnus-button-push (list from entry))
 		(gnus-put-text-property
 		 start end
 		 'gnus-string (buffer-substring-no-properties
@@ -7916,41 +7895,38 @@
     (let ((gnus-article-mime-handle-alist-1 gnus-article-mime-handle-alist))
       (gnus-set-mode-line 'article))))
 
-(defun gnus-button-entry ()
-  ;; Return the first entry in `gnus-button-alist' matching this place.
-  (let ((alist gnus-button-alist)
-	(entry nil))
-    (while alist
-      (setq entry (pop alist))
-      (if (looking-at (eval (car entry)))
-	  (setq alist nil)
-	(setq entry nil)))
-    entry))
-
-(defun gnus-button-push (marker)
+(defun gnus-button-push (marker-and-entry)
   ;; Push button starting at MARKER.
   (save-excursion
-    (goto-char marker)
-    (let* ((entry (gnus-button-entry))
-	   (inhibit-point-motion-hooks t)
-	   (fun (nth 3 entry))
-	   (args (or (and (eq (car entry) 'gnus-button-url-regexp)
-			  (get-char-property marker 'gnus-button-url))
-		     (mapcar (lambda (group)
-			       (let ((string (match-string group)))
-				 (set-text-properties
-				  0 (length string) nil string)
-				 string))
-			     (nthcdr 4 entry)))))
-      (cond
-       ((fboundp fun)
-	(apply fun args))
-       ((and (boundp fun)
-	     (fboundp (symbol-value fun)))
-	(apply (symbol-value fun) args))
-       (t
-	(gnus-message 1 "You must define `%S' to use this button"
-		      (cons fun args)))))))
+    (let* ((marker (car marker-and-entry))
+           (entry (cadr marker-and-entry))
+           (regexp (car entry))
+           (inhibit-point-motion-hooks t))
+      (goto-char marker)
+      ;; This is obviously true, or something bad is happening :)
+      ;; But we need it to have the match-data
+      (when (looking-at (or (if (symbolp regexp)
+                                (symbol-value regexp)
+                              regexp)))
+        (let ((fun (nth 3 entry))
+              (args (or (and (eq (car entry) 'gnus-button-url-regexp)
+                             (get-char-property marker 'gnus-button-url))
+                        (mapcar (lambda (group)
+                                  (let ((string (match-string group)))
+                                    (set-text-properties
+                                     0 (length string) nil string)
+                                    string))
+                                (nthcdr 4 entry)))))
+
+          (cond
+           ((fboundp fun)
+            (apply fun args))
+           ((and (boundp fun)
+                 (fboundp (symbol-value fun)))
+            (apply (symbol-value fun) args))
+           (t
+            (gnus-message 1 "You must define `%S' to use this button"
+                          (cons fun args)))))))))
 
 (defun gnus-parse-news-url (url)
   (let (scheme server port group message-id articles)
--- a/lisp/gnus/spam.el	Wed Jan 19 13:54:19 2011 -0800
+++ b/lisp/gnus/spam.el	Wed Jan 19 15:02:04 2011 -0800
@@ -2726,9 +2726,8 @@
               (with-current-buffer summary-buffer-name
                 (setq article-string (spam-get-article-as-string article)))
               (when (stringp article-string)
-                (insert "From \n") ; mbox separator (sa-learn only checks the
-                                   ; first five chars, so we can get away with
-                                   ; a bogus line))
+                ;; mbox separator
+                (insert (concat "From nobody " (current-time-string) "\n"))
                 (insert article-string)
                 (insert "\n"))))
           ;; call sa-learn on all messages at the same time
--- a/src/ChangeLog	Wed Jan 19 13:54:19 2011 -0800
+++ b/src/ChangeLog	Wed Jan 19 15:02:04 2011 -0800
@@ -1,3 +1,46 @@
+2011-01-19  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* unexmacosx.c: Include config.h before unistd.h (Bug#7859).
+
+	* nsterm.m (ns_input_file, ns_input_font, ns_input_fontsize)
+	(ns_input_line, ns_input_color, ns_input_text, ns_working_text)
+	(ns_input_spi_name, ns_input_spi_arg)
+	(ns_alternate_modifier, ns_right_alternate_modifier)
+	(ns_command_modifier, ns_right_command_modifier, ns_control_modifier)
+	(ns_right_control_modifier, ns_function_modifier)
+	(ns_antialias_text, ns_confirm_quit): Move to globals.h.
+	(Vx_toolkit_scroll_bars, x_use_underline_position_properties)
+	(x_underline_at_descent_line): Remove declaration.
+	(syms_of_nsterm): Remove & from DEFVAR_LISP and DEFVAR_BOOL.
+
+	* nsselect.m (Vns_sent_selection_hooks, Vns_lost_selection_hooks
+	(Vselection_alist, Vselection_converter_alist): Move to globals.h.
+	(syms_of_nsselect): Remove & from DEFVAR_LISP.
+
+	* nsmenu.m (Voverriding_local_map, Voverriding_local_map_menu_flag):
+	Remove declaration.
+
+	* nsfont.m (Vns_reg_to_script, ns_antialias_text): Move to
+	globals.h.
+	(syms_of_nsfont): Remove & from DEFVAR_LISP.
+
+	* nsfns.m (Vmenu_bar_mode, Vtool_bar_mode): Remove declaration.
+	(Vns_icon_type_alist, Vns_version_string): Move to globals.h.
+	(syms_of_nsfns): Remove & from DEFVAR_LISP calls.
+
+	* globals.h (struct emacs_globals): Add f_ns_input_file,
+	f_ns_input_font, f_ns_input_fontsize, f_ns_input_line,
+	f_ns_input_color, f_ns_input_text, f_ns_working_text,
+	f_ns_input_spi_name, f_ns_input_spi_arg, f_ns_alternate_modifier,
+	f_ns_right_alternate_modifier, f_ns_command_modifier,
+	f_ns_right_command_modifier, f_ns_control_modifier,
+	f_ns_right_control_modifier, f_ns_function_modifier,
+	f_ns_antialias_text, f_ns_confirm_quit, f_Vns_icon_type_alist,
+	f_Vns_version_string, f_Vns_sent_selection_hooks,
+	f_Vns_lost_selection_hooks, f_Vselection_alist, f_Vns_reg_to_script
+	and corresponding defines.
+
+
 2011-01-19  Sam Steingold  <sds@gnu.org>
 
 	* w32.c (check_windows_init_file): Remove declarations of
--- a/src/globals.h	Wed Jan 19 13:54:19 2011 -0800
+++ b/src/globals.h	Wed Jan 19 15:02:04 2011 -0800
@@ -1695,6 +1695,67 @@
   Lisp_Object f_Vx_super_keysym;
 
   Lisp_Object f_Vx_keysym_table;
+
+  /* Lisp communications */
+  Lisp_Object f_ns_input_file, f_ns_input_font, f_ns_input_fontsize,
+    f_ns_input_line;
+  Lisp_Object f_ns_input_color, f_ns_input_text, f_ns_working_text;
+  Lisp_Object f_ns_input_spi_name, f_ns_input_spi_arg;
+  
+  /* Specifies which emacs modifier should be generated when NS receives
+     the Alternate modifier.  May be Qnone or any of the modifier lisp symbols.
+  */
+  Lisp_Object f_ns_alternate_modifier;
+
+  /* Specifies which emacs modifier should be generated when NS receives
+     the right Alternate modifier.  Has same values as ns_alternate_modifier
+     plus the value Qleft which means whatever value ns_alternate_modifier has.
+  */
+  Lisp_Object f_ns_right_alternate_modifier;
+
+  /* Specifies which emacs modifier should be generated when NS receives
+     the Command modifier.  May be any of the modifier lisp symbols. */
+  Lisp_Object f_ns_command_modifier;
+
+  /* Specifies which emacs modifier should be generated when NS receives
+     the right Command modifier.  Has same values as ns_command_modifier plus
+     the value Qleft which means whatever value ns_command_modifier has.  */
+  Lisp_Object f_ns_right_command_modifier;
+
+  /* Specifies which emacs modifier should be generated when NS receives
+     the Control modifier.  May be any of the modifier lisp symbols. */
+  Lisp_Object f_ns_control_modifier;
+
+  /* Specifies which emacs modifier should be generated when NS receives
+     the right Control modifier.  Has same values as ns_control_modifier plus
+     the value Qleft which means whatever value ns_control_modifier has.  */
+  Lisp_Object f_ns_right_control_modifier;
+
+  /* Specifies which emacs modifier should be generated when NS receives
+     the Function modifier (laptops).  May be any of the modifier lisp symbols.
+  */
+  Lisp_Object f_ns_function_modifier;
+
+  /* Control via default 'GSFontAntiAlias' on OS X and GNUstep. */
+  Lisp_Object f_ns_antialias_text;
+
+  /* Confirm on exit. */
+  Lisp_Object f_ns_confirm_quit;
+
+  /* Alist of elements (REGEXP . IMAGE) for images of icons associated
+     to frames.*/
+  Lisp_Object f_Vns_icon_type_alist;
+
+  /* Toolkit version support. */
+  Lisp_Object f_Vns_version_string;
+
+  Lisp_Object f_Vns_sent_selection_hooks;
+  Lisp_Object f_Vns_lost_selection_hooks;
+  Lisp_Object f_Vselection_alist;
+
+  Lisp_Object f_Vns_reg_to_script;
+
+
 };
 
 extern struct emacs_globals globals;
@@ -2773,3 +2834,53 @@
     globals.f_x_underline_at_descent_line
 #define x_use_underline_position_properties \
     globals.f_x_use_underline_position_properties
+#define ns_input_file \
+    globals.f_ns_input_file
+#define ns_input_font \
+    globals.f_ns_input_font
+#define ns_input_fontsize \
+    globals.f_ns_input_fontsize
+#define ns_input_line \
+    globals.f_ns_input_line
+#define ns_input_color \
+    globals.f_ns_input_color
+#define ns_input_text \
+    globals.f_ns_input_text
+#define ns_working_text \
+    globals.f_ns_working_text
+#define ns_input_spi_name \
+    globals.f_ns_input_spi_name
+#define ns_input_spi_arg \
+    globals.f_ns_input_spi_arg
+#define ns_alternate_modifier \
+    globals.f_ns_alternate_modifier
+#define ns_right_alternate_modifier \
+    globals.f_ns_right_alternate_modifier
+#define ns_command_modifier \
+    globals.f_ns_command_modifier
+#define ns_right_command_modifier \
+    globals.f_ns_right_command_modifier
+#define ns_control_modifier \
+    globals.f_ns_control_modifier
+#define ns_right_control_modifier \
+    globals.f_ns_right_control_modifier
+#define ns_function_modifier \
+    globals.f_ns_function_modifier
+#define ns_antialias_text \
+    globals.f_ns_antialias_text
+#define ns_confirm_quit \
+    globals.f_ns_confirm_quit
+#define Vns_icon_type_alist \
+    globals.f_Vns_icon_type_alist
+#define Vns_version_string \
+    globals.f_Vns_version_string
+#define Vns_sent_selection_hooks \
+    globals.f_Vns_sent_selection_hooks
+#define Vns_lost_selection_hooks \
+    globals.f_Vns_lost_selection_hooks
+#define Vselection_alist \
+    globals.f_Vselection_alist
+#define Vns_reg_to_script \
+    globals.f_Vns_reg_to_script
+
+
--- a/src/nsfns.m	Wed Jan 19 13:54:19 2011 -0800
+++ b/src/nsfns.m	Wed Jan 19 15:02:04 2011 -0800
@@ -82,11 +82,7 @@
 extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth;
 extern Lisp_Object Qunsplittable, Qmenu_bar_lines, Qbuffer_predicate, Qtitle;
 extern Lisp_Object Qnone;
-extern Lisp_Object Vframe_title_format, Vicon_title_format;
-
-/* The below are defined in frame.c.  */
-
-extern Lisp_Object Vmenu_bar_mode, Vtool_bar_mode;
+
 
 Lisp_Object Qbuffered;
 Lisp_Object Qfontsize;
@@ -94,13 +90,6 @@
 /* hack for OS X file panels */
 char panelOK = 0;
 
-/* Alist of elements (REGEXP . IMAGE) for images of icons associated
-   to frames.*/
-static Lisp_Object Vns_icon_type_alist;
-
-/* Toolkit version support. */
-static Lisp_Object Vns_version_string;
-
 EmacsTooltip *ns_tooltip;
 
 /* Need forward declaration here to preserve organizational integrity of file */
@@ -2593,7 +2582,7 @@
   Qfontsize = intern_c_string ("fontsize");
   staticpro (&Qfontsize);
 
-  DEFVAR_LISP ("ns-icon-type-alist", &Vns_icon_type_alist,
+  DEFVAR_LISP ("ns-icon-type-alist", Vns_icon_type_alist,
                doc: /* Alist of elements (REGEXP . IMAGE) for images of icons associated to frames.
 If the title of a frame matches REGEXP, then IMAGE.tiff is
 selected as the image of the icon representing the frame when it's
@@ -2614,7 +2603,7 @@
 be used as the image of the icon representing the frame.  */);
   Vns_icon_type_alist = Fcons (Qt, Qnil);
 
-  DEFVAR_LISP ("ns-version-string", &Vns_version_string,
+  DEFVAR_LISP ("ns-version-string", Vns_version_string,
                doc: /* Toolkit version for NS Windowing.  */);
   Vns_version_string = ns_appkit_version_str ();
 
--- a/src/nsfont.m	Wed Jan 19 13:54:19 2011 -0800
+++ b/src/nsfont.m	Wed Jan 19 15:02:04 2011 -0800
@@ -48,10 +48,8 @@
 
 extern Lisp_Object Qns;
 extern Lisp_Object Qnormal, Qbold, Qitalic, Qcondensed, Qexpanded;
-static Lisp_Object Vns_reg_to_script;
 static Lisp_Object Qapple, Qroman, Qmedium;
 extern Lisp_Object Qappend;
-extern Lisp_Object ns_antialias_text;
 extern float ns_antialias_threshold;
 extern int ns_tmp_flags;
 extern struct nsfont_info *ns_tmp_font;
@@ -1517,7 +1515,7 @@
   DEFSYM (Qapple, "apple");
   DEFSYM (Qroman, "roman");
   DEFSYM (Qmedium, "medium");
-  DEFVAR_LISP ("ns-reg-to-script", &Vns_reg_to_script,
+  DEFVAR_LISP ("ns-reg-to-script", Vns_reg_to_script,
                doc: /* Internal use: maps font registry to unicode script. */);
 }
 
--- a/src/nsmenu.m	Wed Jan 19 13:54:19 2011 -0800
+++ b/src/nsmenu.m	Wed Jan 19 15:02:04 2011 -0800
@@ -65,8 +65,7 @@
 extern Lisp_Object QCtoggle, QCradio;
 
 Lisp_Object Qdebug_on_next_call;
-extern Lisp_Object Voverriding_local_map, Voverriding_local_map_menu_flag,
-		   Qoverriding_local_map, Qoverriding_terminal_local_map;
+extern Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map;
 
 extern long context_menu_value;
 EmacsMenu *mainMenu, *svcsMenu, *dockMenu;
--- a/src/nsselect.m	Wed Jan 19 13:54:19 2011 -0800
+++ b/src/nsselect.m	Wed Jan 19 15:02:04 2011 -0800
@@ -39,11 +39,6 @@
 
 Lisp_Object QCLIPBOARD, QSECONDARY, QTEXT, QFILE_NAME;
 
-static Lisp_Object Vns_sent_selection_hooks;
-static Lisp_Object Vns_lost_selection_hooks;
-static Lisp_Object Vselection_alist;
-static Lisp_Object Vselection_converter_alist;
-
 static Lisp_Object Qforeign_selection;
 
 /* NSGeneralPboard is pretty much analogous to X11 CLIPBOARD */
@@ -568,7 +563,7 @@
   Vselection_alist = Qnil;
   staticpro (&Vselection_alist);
 
-  DEFVAR_LISP ("ns-sent-selection-hooks", &Vns_sent_selection_hooks,
+  DEFVAR_LISP ("ns-sent-selection-hooks", Vns_sent_selection_hooks,
                "A list of functions to be called when Emacs answers a selection request.\n\
 The functions are called with four arguments:\n\
   - the selection name (typically `PRIMARY', `SECONDARY', or `CLIPBOARD');\n\
@@ -582,7 +577,7 @@
 it merely informs you that they have happened.");
   Vns_sent_selection_hooks = Qnil;
 
-  DEFVAR_LISP ("selection-converter-alist", &Vselection_converter_alist,
+  DEFVAR_LISP ("selection-converter-alist", Vselection_converter_alist,
                "An alist associating X Windows selection-types with functions.\n\
 These functions are called to convert the selection, with three args:\n\
 the name of the selection (typically `PRIMARY', `SECONDARY', or `CLIPBOARD');\n\
@@ -597,7 +592,7 @@
 and there is no meaningful selection value.");
   Vselection_converter_alist = Qnil;
 
-  DEFVAR_LISP ("ns-lost-selection-hooks", &Vns_lost_selection_hooks,
+  DEFVAR_LISP ("ns-lost-selection-hooks", Vns_lost_selection_hooks,
                "A list of functions to be called when Emacs loses an X selection.\n\
 \(This happens when some other X client makes its own selection\n\
 or when a Lisp program explicitly clears the selection.)\n\
--- a/src/nsterm.m	Wed Jan 19 13:54:19 2011 -0800
+++ b/src/nsterm.m	Wed Jan 19 15:02:04 2011 -0800
@@ -135,49 +135,10 @@
 };
 
 
-/* Lisp communications */
-Lisp_Object ns_input_file, ns_input_font, ns_input_fontsize, ns_input_line;
-Lisp_Object ns_input_color, ns_input_text, ns_working_text;
-Lisp_Object ns_input_spi_name, ns_input_spi_arg;
-Lisp_Object Vx_toolkit_scroll_bars;
 static Lisp_Object Qmodifier_value;
 Lisp_Object Qalt, Qcontrol, Qhyper, Qmeta, Qsuper, Qnone;
 extern Lisp_Object Qcursor_color, Qcursor_type, Qns, Qleft;
 
-/* Specifies which emacs modifier should be generated when NS receives
-   the Alternate modifier.  May be Qnone or any of the modifier lisp symbols. */
-Lisp_Object ns_alternate_modifier;
-
-/* Specifies which emacs modifier should be generated when NS receives
-   the right Alternate modifier.  Has same values as ns_alternate_modifier plus
-   the value Qleft which means whatever value ns_alternate_modifier has.  */
-Lisp_Object ns_right_alternate_modifier;
-
-/* Specifies which emacs modifier should be generated when NS receives
-   the Command modifier.  May be any of the modifier lisp symbols. */
-Lisp_Object ns_command_modifier;
-
-/* Specifies which emacs modifier should be generated when NS receives
-   the right Command modifier.  Has same values as ns_command_modifier plus
-   the value Qleft which means whatever value ns_command_modifier has.  */
-Lisp_Object ns_right_command_modifier;
-
-/* Specifies which emacs modifier should be generated when NS receives
-   the Control modifier.  May be any of the modifier lisp symbols. */
-Lisp_Object ns_control_modifier;
-
-/* Specifies which emacs modifier should be generated when NS receives
-   the right Control modifier.  Has same values as ns_control_modifier plus
-   the value Qleft which means whatever value ns_control_modifier has.  */
-Lisp_Object ns_right_control_modifier;
-
-/* Specifies which emacs modifier should be generated when NS receives
-   the Function modifier (laptops).  May be any of the modifier lisp symbols. */
-Lisp_Object ns_function_modifier;
-
-/* Control via default 'GSFontAntiAlias' on OS X and GNUstep. */
-Lisp_Object ns_antialias_text;
-
 /* On OS X picks up the default NSGlobalDomain AppleAntiAliasingThreshold,
    the maximum font size to NOT antialias.  On GNUstep there is currently
    no way to control this behavior. */
@@ -186,9 +147,6 @@
 /* Used to pick up AppleHighlightColor on OS X */
 NSString *ns_selection_color;
 
-/* Confirm on exit. */
-Lisp_Object ns_confirm_quit;
-
 NSArray *ns_send_types =0, *ns_return_types =0, *ns_drag_types =0;
 NSString *ns_app_name = @"Emacs";  /* default changed later */
 
@@ -303,8 +261,6 @@
 static void ns_judge_scroll_bars (struct frame *f);
 void x_set_frame_alpha (struct frame *f);
 
-/* unused variables needed for compatibility reasons */
-int x_use_underline_position_properties, x_underline_at_descent_line;
 /* FIXME: figure out what to do with underline_minimum_offset. */
 
 
@@ -3980,7 +3936,6 @@
 }
 
 
-extern Lisp_Object Vauto_save_list_file_name;
 void
 ns_term_shutdown (int sig)
 {
@@ -6295,50 +6250,50 @@
   Fput (Qsuper, Qmodifier_value, make_number (super_modifier));
   Fput (Qcontrol, Qmodifier_value, make_number (ctrl_modifier));
 
-  DEFVAR_LISP ("ns-input-file", &ns_input_file,
+  DEFVAR_LISP ("ns-input-file", ns_input_file,
               "The file specified in the last NS event.");
   ns_input_file =Qnil;
 
-  DEFVAR_LISP ("ns-input-text", &ns_input_text,
+  DEFVAR_LISP ("ns-input-text", ns_input_text,
               "The data received in the last NS text drag event.");
   ns_input_text =Qnil;
 
-  DEFVAR_LISP ("ns-working-text", &ns_working_text,
+  DEFVAR_LISP ("ns-working-text", ns_working_text,
               "String for visualizing working composition sequence.");
   ns_working_text =Qnil;
 
-  DEFVAR_LISP ("ns-input-font", &ns_input_font,
+  DEFVAR_LISP ("ns-input-font", ns_input_font,
               "The font specified in the last NS event.");
   ns_input_font =Qnil;
 
-  DEFVAR_LISP ("ns-input-fontsize", &ns_input_fontsize,
+  DEFVAR_LISP ("ns-input-fontsize", ns_input_fontsize,
               "The fontsize specified in the last NS event.");
   ns_input_fontsize =Qnil;
 
-  DEFVAR_LISP ("ns-input-line", &ns_input_line,
+  DEFVAR_LISP ("ns-input-line", ns_input_line,
                "The line specified in the last NS event.");
   ns_input_line =Qnil;
 
-  DEFVAR_LISP ("ns-input-color", &ns_input_color,
+  DEFVAR_LISP ("ns-input-color", ns_input_color,
                "The color specified in the last NS event.");
   ns_input_color =Qnil;
 
-  DEFVAR_LISP ("ns-input-spi-name", &ns_input_spi_name,
+  DEFVAR_LISP ("ns-input-spi-name", ns_input_spi_name,
                "The service name specified in the last NS event.");
   ns_input_spi_name =Qnil;
 
-  DEFVAR_LISP ("ns-input-spi-arg", &ns_input_spi_arg,
+  DEFVAR_LISP ("ns-input-spi-arg", ns_input_spi_arg,
                "The service argument specified in the last NS event.");
   ns_input_spi_arg =Qnil;
 
-  DEFVAR_LISP ("ns-alternate-modifier", &ns_alternate_modifier,
+  DEFVAR_LISP ("ns-alternate-modifier", ns_alternate_modifier,
                "This variable describes the behavior of the alternate or option key.\n\
 Set to control, meta, alt, super, or hyper means it is taken to be that key.\n\
 Set to none means that the alternate / option key is not interpreted by Emacs\n\
 at all, allowing it to be used at a lower level for accented character entry.");
   ns_alternate_modifier = Qmeta;
 
-  DEFVAR_LISP ("ns-right-alternate-modifier", &ns_right_alternate_modifier,
+  DEFVAR_LISP ("ns-right-alternate-modifier", ns_right_alternate_modifier,
                "This variable describes the behavior of the right alternate or option key.\n\
 Set to control, meta, alt, super, or hyper means it is taken to be that key.\n\
 Set to left means be the same key as `ns-alternate-modifier'.\n\
@@ -6346,12 +6301,12 @@
 at all, allowing it to be used at a lower level for accented character entry.");
   ns_right_alternate_modifier = Qleft;
 
-  DEFVAR_LISP ("ns-command-modifier", &ns_command_modifier,
+  DEFVAR_LISP ("ns-command-modifier", ns_command_modifier,
                "This variable describes the behavior of the command key.\n\
 Set to control, meta, alt, super, or hyper means it is taken to be that key.");
   ns_command_modifier = Qsuper;
 
-  DEFVAR_LISP ("ns-right-command-modifier", &ns_right_command_modifier,
+  DEFVAR_LISP ("ns-right-command-modifier", ns_right_command_modifier,
                "This variable describes the behavior of the right command key.\n\
 Set to control, meta, alt, super, or hyper means it is taken to be that key.\n\
 Set to left means be the same key as `ns-command-modifier'.\n\
@@ -6359,12 +6314,12 @@
 at all, allowing it to be used at a lower level for accented character entry.");
   ns_right_command_modifier = Qleft;
 
-  DEFVAR_LISP ("ns-control-modifier", &ns_control_modifier,
+  DEFVAR_LISP ("ns-control-modifier", ns_control_modifier,
                "This variable describes the behavior of the control key.\n\
 Set to control, meta, alt, super, or hyper means it is taken to be that key.");
   ns_control_modifier = Qcontrol;
 
-  DEFVAR_LISP ("ns-right-control-modifier", &ns_right_control_modifier,
+  DEFVAR_LISP ("ns-right-control-modifier", ns_right_control_modifier,
                "This variable describes the behavior of the right control key.\n\
 Set to control, meta, alt, super, or hyper means it is taken to be that key.\n\
 Set to left means be the same key as `ns-control-modifier'.\n\
@@ -6372,18 +6327,18 @@
 at all, allowing it to be used at a lower level for accented character entry.");
   ns_right_control_modifier = Qleft;
 
-  DEFVAR_LISP ("ns-function-modifier", &ns_function_modifier,
+  DEFVAR_LISP ("ns-function-modifier", ns_function_modifier,
                "This variable describes the behavior of the function key (on laptops).\n\
 Set to control, meta, alt, super, or hyper means it is taken to be that key.\n\
 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.");
   ns_function_modifier = Qnone;
 
-  DEFVAR_LISP ("ns-antialias-text", &ns_antialias_text,
+  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.");
   ns_antialias_text = Qt;
 
-  DEFVAR_LISP ("ns-confirm-quit", &ns_confirm_quit,
+  DEFVAR_LISP ("ns-confirm-quit", ns_confirm_quit,
                "Whether to confirm application quit using dialog.");
   ns_confirm_quit = Qnil;
 
@@ -6394,7 +6349,7 @@
   last_mouse_motion_frame = Qnil;
 
   /* TODO: move to common code */
-  DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars,
+  DEFVAR_LISP ("x-toolkit-scroll-bars", Vx_toolkit_scroll_bars,
 	       doc: /* If not nil, Emacs uses toolkit scroll bars.  */);
 #ifdef USE_TOOLKIT_SCROLL_BARS
   Vx_toolkit_scroll_bars = Qt;
@@ -6405,7 +6360,7 @@
   /* these are unsupported but we need the declarations to avoid whining
      messages from cus-start.el */
   DEFVAR_BOOL ("x-use-underline-position-properties",
-	       &x_use_underline_position_properties,
+	       x_use_underline_position_properties,
      doc: /* NOT SUPPORTED UNDER NS.
 *Non-nil means make use of UNDERLINE_POSITION font properties.
 A value of nil means ignore them.  If you encounter fonts with bogus
@@ -6416,7 +6371,7 @@
   x_use_underline_position_properties = 0;
 
   DEFVAR_BOOL ("x-underline-at-descent-line",
-	       &x_underline_at_descent_line,
+	       x_underline_at_descent_line,
      doc: /* NOT SUPPORTED UNDER NS.
 *Non-nil means to draw the underline at the same place as the descent line.
 A value of nil means to draw the underline according to the value of the
--- a/src/unexmacosx.c	Wed Jan 19 13:54:19 2011 -0800
+++ b/src/unexmacosx.c	Wed Jan 19 15:02:04 2011 -0800
@@ -91,6 +91,10 @@
 #include <fcntl.h>
 #include <stdarg.h>
 #include <sys/types.h>
+#include <config.h>
+#undef malloc
+#undef realloc
+#undef free
 #include <unistd.h>
 #include <mach/mach.h>
 #include <mach-o/loader.h>
@@ -98,10 +102,6 @@
 #if defined (__ppc__)
 #include <mach-o/ppc/reloc.h>
 #endif
-#include <config.h>
-#undef malloc
-#undef realloc
-#undef free
 #ifdef HAVE_MALLOC_MALLOC_H
 #include <malloc/malloc.h>
 #else