summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2005-12-21 17:33:40 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2005-12-21 17:33:40 +0000
commita425bd036ee1f22e6f7f4c4f7222371b10ff189f (patch)
treeba834189ddccc455048ac28ba767f627cbf9ee69
parentaa0b0cd9bcc6ace7a4673064db8f3e44c278c2e9 (diff)
downloademacs-a425bd036ee1f22e6f7f4c4f7222371b10ff189f.tar.gz
emacs-a425bd036ee1f22e6f7f4c4f7222371b10ff189f.tar.bz2
emacs-a425bd036ee1f22e6f7f4c4f7222371b10ff189f.zip
(Fdisplay_completion_list): Use XCAR/XCDR.
(Fminibuffer_completion_help): Remove duplicates before display.
-rw-r--r--src/ChangeLog28
-rw-r--r--src/minibuf.c22
2 files changed, 33 insertions, 17 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c82e24b8754..17acc9670cd 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2005-12-21 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * minibuf.c (Fdisplay_completion_list): Use XCAR/XCDR.
+ (Fminibuffer_completion_help): Remove duplicates before display.
+
2005-12-21 L$,1 q(Brentey K,Aa(Broly <lorentey@elte.hu>
* print.c (print_preprocess): Don't loose print_depth levels while
@@ -61,15 +66,15 @@
(x_use_underline_position_properties): Undo 2005-07-13 change.
(syms_of_macterm) <x-use-underline-position-properties>: Likewise.
(mac_use_core_graphics, mac_wheel_button_is_mouse_2)
- (mac_pass_command_to_system, mac_pass_control_to_system): New
- boolean variables renamed from Lisp_Object ones
+ (mac_pass_command_to_system, mac_pass_control_to_system):
+ New boolean variables renamed from Lisp_Object ones
Vmac_use_core_graphics, Vmac_wheel_button_is_mouse_2,
- Vmac_pass_command_to_system, and Vmac_pass_control_to_system. All
- uses changed.
+ Vmac_pass_command_to_system, and Vmac_pass_control_to_system.
+ All uses changed.
(syms_of_macterm): DEFVAR_BOOL them. Remove previous DEFVAR_LISPs.
Make them user options.
- (mac_handle_command_event, mac_store_services_event): Call
- create_apple_event_from_event_ref without 5th argument.
+ (mac_handle_command_event, mac_store_services_event):
+ Call create_apple_event_from_event_ref without 5th argument.
(backtranslate_modified_keycode): Mask off modifier keys that are
mapped to some Emacs modifiers before passing it to KeyTranslate.
(syms_of_macterm): Make variables `mac-emulate-three-button-mouse',
@@ -77,8 +82,8 @@
Fix docstrings of `mac-*-modifier'.
* mac.c (create_apple_event_from_event_ref): Remove arg `types'.
- (do_applescript): Change argument types to Lisp_Object. All uses
- changed.
+ (do_applescript): Change argument types to Lisp_Object.
+ All uses changed.
* macterm.h (create_apple_event_from_event_ref): Remove 5th
argument from extern.
@@ -121,9 +126,9 @@
* xfns.c (compute_tip_xy): Handle negative dx and dy.
- * w32fns.c (compute_tip_xy): Ditto
+ * w32fns.c (compute_tip_xy): Ditto.
- * macfns.c (compute_tip_xy): Ditto
+ * macfns.c (compute_tip_xy): Ditto.
2005-12-14 Chong Yidong <cyd@stupidchicken.com>
@@ -201,8 +206,7 @@
* mac.c (Qundecoded_file_name): New variable.
(syms_of_mac): Initialize it.
(mac_aelist_to_lisp, mac_aedesc_to_lisp): New functions.
- [TARGET_API_MAC_CARBON] (create_apple_event_from_event_ref): New
- function.
+ [TARGET_API_MAC_CARBON] (create_apple_event_from_event_ref): New fun.
(Fmac_coerce_ae_data): New defun.
(syms_of_mac): Defsubr it.
diff --git a/src/minibuf.c b/src/minibuf.c
index 4016d57c0c1..17d4fc9c1a5 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -2404,7 +2404,7 @@ during running `completion-setup-hook'. */)
else
{
write_string ("Possible completions are:", -1);
- for (tail = completions, i = 0; !NILP (tail); tail = Fcdr (tail), i++)
+ for (tail = completions, i = 0; CONSP (tail); tail = XCDR (tail), i++)
{
Lisp_Object tem, string;
int length;
@@ -2412,7 +2412,7 @@ during running `completion-setup-hook'. */)
startpos = Qnil;
- elt = Fcar (tail);
+ elt = XCAR (tail);
if (SYMBOLP (elt))
elt = SYMBOL_NAME (elt);
/* Compute the length of this element. */
@@ -2588,9 +2588,21 @@ DEFUN ("minibuffer-completion-help", Fminibuffer_completion_help, Sminibuffer_co
temp_echo_area_glyphs (build_string (" [No completions]"));
}
else
- internal_with_output_to_temp_buffer ("*Completions*",
- display_completion_list_1,
- Fsort (completions, Qstring_lessp));
+ {
+ /* Sort and remove duplicates. */
+ Lisp_Object tmp = completions = Fsort (completions, Qstring_lessp);
+ while (CONSP (tmp))
+ {
+ if (CONSP (XCDR (tmp))
+ && !NILP (Fequal (XCAR (tmp), XCAR (XCDR (tmp)))))
+ XSETCDR (tmp, XCDR (XCDR (tmp)));
+ else
+ tmp = XCDR (tmp);
+ }
+ internal_with_output_to_temp_buffer ("*Completions*",
+ display_completion_list_1,
+ completions);
+ }
return Qnil;
}