summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Rudalics <rudalics@gmx.at>2011-06-06 08:57:59 +0200
committerMartin Rudalics <rudalics@gmx.at>2011-06-06 08:57:59 +0200
commit1d00388aae9e39ceb8e520b5f227c21fdd219a20 (patch)
tree0fae32c463f63162d608b9038dd63fe73b9dfb59
parent348f5121cd84ade8ce29d557e7f1215694027b05 (diff)
parent4d09bcf621ec32e17fdb8dd2ea08344486f7aeef (diff)
downloademacs-old-branches/window-pub.tar.gz
Merge from trunkold-branches/window-pub
-rw-r--r--lisp/ChangeLog16
-rw-r--r--lisp/comint.el6
-rw-r--r--lisp/net/rcirc.el21
-rw-r--r--src/ChangeLog27
-rw-r--r--src/alloc.c15
-rw-r--r--src/editfns.c5
-rw-r--r--src/gtkutil.c19
-rw-r--r--src/gtkutil.h1
-rw-r--r--src/xfns.c8
9 files changed, 98 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2785d5ed315..e153fc7da77 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -21,6 +21,22 @@
customization groups. Initialize value to 'unset.
(display-buffer-reuse-window): Quote lambda with #'.
+2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
+
+ * comint.el (comint-dynamic-complete-as-filename)
+ (comint-dynamic-complete-filename): Correctly call
+ completion-in-region.
+
+2011-06-05 Deniz Dogan <deniz@dogan.se>
+
+ * net/rcirc.el (rcirc-prompt-for-encryption): Fix bug introduced
+ in last change.
+
+2011-06-05 Deniz Dogan <deniz@dogan.se>
+
+ * net/rcirc.el (rcirc-prompt-for-encryption): New function.
+ (rcirc): Use it to prompt for encryption.
+
2011-06-05 Roland Winkler <winkler@gnu.org>
* textmodes/bibtex.el (bibtex-search-buffer): New variable.
diff --git a/lisp/comint.el b/lisp/comint.el
index e4bc530f361..5548d19ad30 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -3035,7 +3035,8 @@ Returns t if successful."
(when (comint--match-partial-filename)
(unless (window-minibuffer-p (selected-window))
(message "Completing file name..."))
- (apply #'completion-in-region (comint--complete-file-name-data))))
+ (let ((data (comint--complete-file-name-data)))
+ (completion-in-region (nth 0 data) (nth 1 data) (nth 2 data)))))
(defun comint-filename-completion ()
"Return completion data for filename at point, if any."
@@ -3152,7 +3153,8 @@ in the same way as TABLE completes strings of the form (concat S2 S)."
(defun comint-dynamic-complete-as-filename ()
"Dynamically complete at point as a filename.
See `comint-dynamic-complete-filename'. Returns t if successful."
- (apply #'completion-in-region (comint--complete-file-name-data)))
+ (let ((data (comint--complete-file-name-data)))
+ (completion-in-region (nth 0 data) (nth 1 data) (nth 2 data))))
(make-obsolete 'comint-dynamic-complete-as-filename
'comint-filename-completion "24.1")
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index bd9d6846a4b..70190867e89 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -455,15 +455,7 @@ If ARG is non-nil, instead prompt for connection parameters."
:channels)
" "))
"[, ]+" t))
- (encryption
- (intern (completing-read "Encryption (default plain): "
- '("plain" "tls")
- nil t
- (let ((choice (plist-get server-plist
- :encryption)))
- (when choice
- (symbol-name choice)))
- nil "plain"))))
+ (encryption (rcirc-prompt-for-encryption server-plist)))
(rcirc-connect server port nick user-name
rcirc-default-full-name
channels password encryption))
@@ -596,6 +588,17 @@ If ARG is non-nil, instead prompt for connection parameters."
(time-to-seconds (current-time))
(float-time)))
+(defun rcirc-prompt-for-encryption (server-plist)
+ "Prompt the user for the encryption method to use.
+SERVER-PLIST is the property list for the server."
+ (let ((msg "Encryption (default %s): ")
+ (choices '("plain" "tls"))
+ (default (or (plist-get server-plist :encryption)
+ 'plain)))
+ (intern
+ (completing-read (format msg default)
+ choices nil t nil nil (symbol-name default)))))
+
(defun rcirc-keepalive ()
"Send keep alive pings to active rcirc processes.
Kill processes that have not received a server message since the
diff --git a/src/ChangeLog b/src/ChangeLog
index 0cc2af13e6a..1932453bb79 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,30 @@
+2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
+
+ * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
+ Do not assume that spare memory exists; that assumption is valid
+ only if SYSTEM_MALLOC.
+ (LARGE_REQUEST): New macro, so that the issue of large requests
+ is separated from the issue of spare memory.
+
+2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
+
+ * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
+ format. (Bug#8806)
+
+ * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
+
+ * xfns.c (x_set_scroll_bar_default_width): Move declarations
+ before statements.
+
+2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
+
+ * gtkutil.c (xg_get_default_scrollbar_width): New function.
+
+ * gtkutil.h: Declare xg_get_default_scrollbar_width.
+
+ * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
+ min width by calling x_set_scroll_bar_default_width (Bug#8505).
+
2011-06-05 Juanma Barranquero <lekktu@gmail.com>
* xdisp.c (single_display_spec_intangible_p): Remove declaration.
diff --git a/src/alloc.c b/src/alloc.c
index 0c18fca1755..8d0fdd125dc 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -196,6 +196,12 @@ static char *spare_memory[7];
#define SPARE_MEMORY (1 << 14)
#endif
+#ifdef SYSTEM_MALLOC
+# define LARGE_REQUEST (1 << 14)
+#else
+# define LARGE_REQUEST SPARE_MEMORY
+#endif
+
/* Number of extra blocks malloc should get when it needs more core. */
static int malloc_hysteresis;
@@ -3283,15 +3289,12 @@ memory_full (size_t nbytes)
{
/* Do not go into hysterics merely because a large request failed. */
int enough_free_memory = 0;
- if (SPARE_MEMORY < nbytes)
+ if (LARGE_REQUEST < nbytes)
{
- void *p = malloc (SPARE_MEMORY);
+ void *p = malloc (LARGE_REQUEST);
if (p)
{
- if (spare_memory[0])
- free (p);
- else
- spare_memory[0] = p;
+ free (p);
enough_free_memory = 1;
}
}
diff --git a/src/editfns.c b/src/editfns.c
index 0e40fde9ca4..b961e602e4c 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -4083,7 +4083,10 @@ usage: (format STRING &rest OBJECTS) */)
int exponent_bytes = 0;
int signedp = src0 == '-' || src0 == '+' || src0 == ' ';
int significand_bytes;
- if (zero_flag && '0' <= src[signedp] && src[signedp] <= '9')
+ if (zero_flag
+ && ((src[signedp] >= '0' && src[signedp] <= '9')
+ || (src[signedp] >= 'a' && src[signedp] <= 'f')
+ || (src[signedp] >= 'A' && src[signedp] <= 'F')))
{
leading_zeros += padding;
padding = 0;
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 6e54006d913..dedb39a7a40 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -3326,6 +3326,25 @@ xg_get_widget_from_map (int idx)
return 0;
}
+int
+xg_get_default_scrollbar_width (FRAME_PTR f)
+{
+#ifdef HAVE_GTK3
+ GtkAdjustment *vadj;
+#else
+ GtkObject *vadj;
+#endif
+ GtkWidget *wscroll;
+ int w = 0, b = 0;
+ vadj = gtk_adjustment_new (XG_SB_MIN, XG_SB_MIN, XG_SB_MAX, 0.1, 0.1, 0.1);
+ wscroll = gtk_vscrollbar_new (GTK_ADJUSTMENT (vadj));
+ gtk_widget_style_get (wscroll, "slider-width", &w, "trough-border", &b, NULL);
+ gtk_widget_destroy (wscroll);
+ w += 2*b;
+ if (w < 16) w = 16;
+ return w;
+}
+
/* Return the scrollbar id for X Window WID on display DPY.
Return -1 if WID not in id_to_widget. */
diff --git a/src/gtkutil.h b/src/gtkutil.h
index 3dc0a1dd150..cf58d03b0ce 100644
--- a/src/gtkutil.h
+++ b/src/gtkutil.h
@@ -135,6 +135,7 @@ extern void xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
int position,
int whole);
extern int xg_event_is_for_scrollbar (FRAME_PTR f, XEvent *event);
+extern int xg_get_default_scrollbar_width (FRAME_PTR f);
extern void update_frame_tool_bar (FRAME_PTR f);
extern void free_frame_tool_bar (FRAME_PTR f);
diff --git a/src/xfns.c b/src/xfns.c
index ab66ddf1845..3507a13d517 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1699,10 +1699,14 @@ void
x_set_scroll_bar_default_width (struct frame *f)
{
int wid = FRAME_COLUMN_WIDTH (f);
-
+ int minw = 16;
+ int width;
#ifdef USE_TOOLKIT_SCROLL_BARS
+#ifdef USE_GTK
+ minw = xg_get_default_scrollbar_width (f);
+#endif
/* A minimum width of 14 doesn't look good for toolkit scroll bars. */
- int width = 16 + 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM;
+ width = minw + 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM;
FRAME_CONFIG_SCROLL_BAR_COLS (f) = (width + wid - 1) / wid;
FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = width;
#else