1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-03 08:30:09 +00:00

merge from trunk

This commit is contained in:
Joakim Verona 2013-09-16 08:27:23 +02:00
commit df15e4f639
38 changed files with 13619 additions and 285 deletions

View File

@ -1,3 +1,7 @@
2013-09-15 Jan Djärv <jan.h.d@swipnet.se>
* configure.ac: Add check for OSX 10.5, required for macfont.o.
2013-09-09 Glenn Morris <rgm@gnu.org>
* configure.ac (LDFLAGS_NOCOMBRELOC): New variable.

View File

@ -1625,7 +1625,10 @@ fail;
[AC_MSG_ERROR([`--with-ns' was specified, but the include
files are missing or cannot be compiled.])])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AppKit/AppKit.h>],
macfont_file=""
if test "${NS_IMPL_COCOA}" = "yes"; then
AC_MSG_CHECKING([for OSX 10.4 or newer])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AppKit/AppKit.h>],
[
#ifdef MAC_OS_X_VERSION_MAX_ALLOWED
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
@ -1637,13 +1640,33 @@ fail;
])],
ns_osx_have_104=yes,
ns_osx_have_104=no)
AC_MSG_RESULT([$ns_osx_have_104])
if test $ns_osx_have_104 = no; then
AC_MSG_ERROR([`OSX 10.4 or newer is required']);
fi
AC_MSG_CHECKING([for OSX 10.5 or newer])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AppKit/AppKit.h>],
[
#ifdef MAC_OS_X_VERSION_MAX_ALLOWED
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
; /* OK */
#else
#error "OSX 10.5 not found"
#endif
#endif
])],
ns_osx_have_105=yes,
ns_osx_have_105=no)
AC_MSG_RESULT([$ns_osx_have_105])
if test $ns_osx_have_105 = yes; then
macfont_file="macfont.o"
fi
fi
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <Foundation/NSObjCRuntime.h>],
[NSInteger i;])],
ns_have_nsinteger=yes,
ns_have_nsinteger=no)
if test $ns_osx_have_104 = no; then
AC_MSG_ERROR([`OSX 10.4 or newer is required']);
fi
if test $ns_have_nsinteger = yes; then
AC_DEFINE(NS_HAVE_NSINTEGER, 1, [Define to 1 if `NSInteger' is defined.])
fi
@ -1679,7 +1702,8 @@ if test "${HAVE_NS}" = yes; then
leimdir="\${ns_appresdir}/leim"
INSTALL_ARCH_INDEP_EXTRA=
fi
NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o"
NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o $macfont_file"
fi
CFLAGS="$tmp_CFLAGS"
CPPFLAGS="$tmp_CPPFLAGS"

View File

@ -4190,8 +4190,8 @@ variables:
@defvar left-margin-width
This variable specifies the width of the left margin, in character
cell units. It is buffer-local in all buffers. A value of @code{nil}
means no left marginal area.
cell (a.k.a.@: ``column'') units. It is buffer-local in all buffers.
A value of @code{nil} means no left marginal area.
@end defvar
@defvar right-margin-width
@ -4209,17 +4209,16 @@ Thus, you can make changes take effect by calling
@defun set-window-margins window left &optional right
This function specifies the margin widths for window @var{window}, in
character cell (a.k.a.@: ``column''), units. The argument @var{left}
controls the left margin and @var{right} controls the right margin
(default @code{0}).
character cell units. The argument @var{left} controls the left
margin, and @var{right} controls the right margin (default @code{0}).
@end defun
@defun window-margins &optional window
This function returns the width of the left and right margins of
@var{window} as a cons cell of the form @w{@code{(@var{left}
. @var{right})}}. If one of the two marginal areas does not exist,
its width is returned as @code{nil}; if none of the two margins exist,
the function returns @code{nil}. If @var{window} is @code{nil}, the
its width is returned as @code{nil}; if neither of the two margins exist,
the function returns @code{(nil)}. If @var{window} is @code{nil}, the
selected window is used.
@end defun

View File

@ -1,3 +1,7 @@
2013-09-14 Glenn Morris <rgm@gnu.org>
* eshell.texi: Markup fixes.
2013-09-11 Xue Fuqiao <xfq.free@gmail.com>
* ido.texi (Interactive Substring Matching): Use @key{RET} instead

View File

@ -353,7 +353,7 @@ sudo is an alias, defined as "*sudo $*"
@vindex eshell-prefer-lisp-functions
If you would prefer to use the built-in commands instead of the external
commands, set @var{eshell-prefer-lisp-functions} to @code{t}.
commands, set @code{eshell-prefer-lisp-functions} to @code{t}.
Some of the built-in commands have different behaviour from their
external counterparts, and some have no external counterpart. Most of
@ -515,7 +515,7 @@ Aliases are commands that expand to a longer input line. For example,
with the command invocation @samp{alias ll ls -l}; with this defined,
running @samp{ll foo} in Eshell will actually run @samp{ls -l foo}.
Aliases defined (or deleted) by the @command{alias} command are
automatically written to the file named by @var{eshell-aliases-file},
automatically written to the file named by @code{eshell-aliases-file},
which you can also edit directly (although you will have to manually
reload it).
@ -539,7 +539,7 @@ by @code{!foo:n}.
The history ring is loaded from a file at the start of every session,
and written back to the file at the end of every session. The file path
is specified in @var{eshell-history-file-name}. Unlike other shells,
is specified in @code{eshell-history-file-name}. Unlike other shells,
such as Bash, Eshell can not be configured to keep a history ring of a
different size than that of the history file.
@ -721,11 +721,11 @@ terminal emulator.
Programs that need a terminal to display output properly are referred
to in this manual as ``visual commands,'' because they are not simply
line-oriented. You must tell Eshell which commands are visual, by
adding them to @var{eshell-visual-commands}; for commands that are
adding them to @code{eshell-visual-commands}; for commands that are
visual for only certain @emph{sub}-commands -- e.g. @samp{git log} but
not @samp{git status} -- use @var{eshell-visual-subcommands}; and for
not @samp{git status} -- use @code{eshell-visual-subcommands}; and for
commands that are visual only when passed certain options, use
@var{eshell-visual-options}.
@code{eshell-visual-options}.
@section Redirection
Redirection is mostly the same in Eshell as it is in other command
@ -740,16 +740,16 @@ on the right-hand side, into which it inserts the output of the
left-hand side. e.g., @samp{echo hello >>> #<buffer *scratch*>}
inserts the string @code{"hello"} into the @code{*scratch*} buffer.
@var{eshell-virtual-targets} is a list of mappings of virtual device
@code{eshell-virtual-targets} is a list of mappings of virtual device
names to functions. Eshell comes with two virtual devices:
@file{/dev/kill}, which sends the text to the kill ring, and
@file{/dev/clip}, which sends text to the clipboard.
You can, of course, define your own virtual targets. They are defined
by adding a list of the form @code{("/dev/name" function mode)} to
@var{eshell-virtual-targets}. The first element is the device name;
@code{function} may be either a lambda or a function name. If
@code{mode} is nil, then the function is the output function; if it is
by adding a list of the form @samp{("/dev/name" @var{function} @var{mode})} to
@code{eshell-virtual-targets}. The first element is the device name;
@var{function} may be either a lambda or a function name. If
@var{mode} is nil, then the function is the output function; if it is
non-nil, then the function is passed the redirection mode as a
symbol--@code{overwrite} for @code{>}, @code{append} for @code{>>}, or
@code{insert} for @code{>>>}--and the function is expected to return
@ -774,7 +774,7 @@ Eshell module.} You also need to load the following as shown:
@example
(eval-when-compile
(require 'cl)
(require 'cl-lib)
(require 'esh-mode)
(require 'eshell))

View File

@ -1,3 +1,7 @@
2013-09-15 Jan Djärv <jan.h.d@swipnet.se>
* NEWS: Mention the macfont backend.
2013-09-09 Glenn Morris <rgm@gnu.org>
* refcards/Makefile (PS_ENGLISH, PS_CZECH, PS_FRENCH, PS_GERMAN)

View File

@ -54,6 +54,11 @@ and zlib-format compressed data.
** Emacs for NS (OSX, GNUStep) can be built with ImageMagick support.
pkg-config is required to find ImageMagick libraries.
** For OSX >= 10.5, the Core text based font backend from the Mac port is used.
For GNUStep and OSX 10.4 the old backend is used.
To use the old backend by default, do on the command line:
% defaults write org.gnu.Emacs FontBackend ns
* Startup Changes in Emacs 24.4

View File

@ -1,3 +1,27 @@
2013-09-15 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/ruby-mode.el (ruby-operator-re): Consider line
continuation character an operator, as far as indentation is
concerned (Bug#15369).
2013-09-15 Martin Rudalics <rudalics@gmx.at>
* window.el (window--state-put-2): Don't process buffer state
when buffer doesn't exist any more (Bug#15382).
2013-09-15 Glenn Morris <rgm@gnu.org>
* eshell/em-unix.el (eshell/rm):
Make -f ignore missing files. (Bug#15373)
* eshell/esh-cmd.el (eshell--local-vars): New variable. (Bug#15372)
(eshell-rewrite-for-command): Add for loop vars to eshell--local-vars.
* eshell/esh-var.el (eshell-get-variable): Respect eshell--local-vars.
2013-09-14 Glenn Morris <rgm@gnu.org>
* eshell/esh-var.el (eshell-variable-aliases-list): Fix doc typo.
2013-09-13 Glenn Morris <rgm@gnu.org>
* dired-x.el (dired-guess-shell-alist-user): Doc fix.

View File

@ -4352,7 +4352,7 @@ instead.
;;;***
;;;### (autoloads nil "dired-x" "dired-x.el" "11fd4a8afa32507cc32d4a04d852587f")
;;;### (autoloads nil "dired-x" "dired-x.el" "732d08c173295dd14a0736fa222f532a")
;;; Generated autoloads from dired-x.el
(autoload 'dired-jump "dired-x" "\

View File

@ -1,3 +1,8 @@
2013-09-14 Vivek Dasmohapatra <vivek@etla.org>
* erc.el (erc-update-mode-line-buffer):
Handle absent topic. (Bug#15377)
2013-09-13 Glenn Morris <rgm@gnu.org>
* erc-desktop-notifications.el (dbus-debug): Declare.

View File

@ -6189,7 +6189,7 @@ if `erc-away' is non-nil."
?m (erc-format-channel-modes)
?n (or (erc-current-nick) "")
?N (erc-format-network)
?o (erc-controls-strip erc-channel-topic)
?o (or (erc-controls-strip erc-channel-topic) "")
?p (erc-port-to-string erc-session-port)
?s (erc-format-target-and/or-server)
?S (erc-format-target-and/or-network)

View File

@ -284,18 +284,21 @@ Remove (unlink) the FILE(s).")
entry)))))
(eshell-funcalln 'unintern entry)))
((stringp entry)
(if (and (file-directory-p entry)
(not (file-symlink-p entry)))
(if (or em-recursive
eshell-rm-removes-directories)
(if (or em-preview
(not em-interactive)
(y-or-n-p
(format "rm: descend into directory `%s'? "
entry)))
;; -f should silently ignore missing files (bug#15373).
(unless (and force-removal
(not (file-exists-p entry)))
(if (and (file-directory-p entry)
(not (file-symlink-p entry)))
(if (or em-recursive
eshell-rm-removes-directories)
(if (or em-preview
(not em-interactive)
(y-or-n-p
(format "rm: descend into directory `%s'? "
entry)))
(eshell-remove-entries nil (list entry) t))
(eshell-error (format "rm: %s: is a directory\n" entry)))
(eshell-remove-entries nil (list entry) t)))))
(eshell-error (format "rm: %s: is a directory\n" entry)))
(eshell-remove-entries nil (list entry) t))))))
(setq args (cdr args)))
nil))

View File

@ -473,6 +473,8 @@ the second is ignored."
arg))
(defvar eshell-last-command-status) ;Define in esh-io.el.
(defvar eshell--local-vars nil
"List of locally bound vars that should take precedence over env-vars.")
(defun eshell-rewrite-for-command (terms)
"Rewrite a `for' command into its equivalent Eshell command form.
@ -495,7 +497,9 @@ implemented via rewriting, rather than as a function."
(eshell-command-body '(nil))
(eshell-test-body '(nil)))
(while (car for-items)
(let ((,(intern (cadr terms)) (car for-items)))
(let ((,(intern (cadr terms)) (car for-items))
(eshell--local-vars (cons ',(intern (cadr terms))
eshell--local-vars)))
(eshell-protect
,(eshell-invokify-arg body t)))
(setcar for-items (cadr for-items))

View File

@ -184,9 +184,9 @@ if they are quoted with a backslash."
indices)))))
"This list provides aliasing for variable references.
It is very similar in concept to what `eshell-user-aliases-list' does
for commands. Each member of this defines defines the name of a
command, and the Lisp value to return for that variable if it is
accessed via the syntax '$NAME'.
for commands. Each member of this defines the name of a command,
and the Lisp value to return for that variable if it is accessed
via the syntax '$NAME'.
If the value is a function, that function will be called with two
arguments: the list of the indices that was used in the reference, and
@ -502,6 +502,7 @@ Possible options are:
(let ((sym (intern-soft var)))
(if (and sym (boundp sym)
(or eshell-prefer-lisp-variables
(memq sym eshell--local-vars) ; bug#15372
(not (getenv var))))
(symbol-value sym)
(getenv var))))

View File

@ -132,7 +132,7 @@ This should only be called after matching against `ruby-here-doc-beg-re'."
ruby-block-end-re "\\|}\\|\\]\\)")
"Regexp to match where the indentation gets shallower.")
(defconst ruby-operator-re "[-,.+*/%&|^~=<>:]"
(defconst ruby-operator-re "[-,.+*/%&|^~=<>:]\\|\\\\$"
"Regexp to match operators.")
(defconst ruby-symbol-chars "a-zA-Z0-9_"

View File

@ -4464,62 +4464,66 @@ value can be also stored on disk and read back in a new session."
(set-window-parameter window (car parameter) (cdr parameter))))
;; Process buffer related state.
(when state
;; We don't want to raise an error in case the buffer does not
;; exist anymore, so we switch to a previous one and save the
;; window with the intention of deleting it later if possible.
(let ((buffer (get-buffer (car state))))
(if buffer
(set-window-buffer window buffer)
(with-current-buffer buffer
(set-window-buffer window buffer)
(set-window-hscroll window (cdr (assq 'hscroll state)))
(apply 'set-window-fringes
(cons window (cdr (assq 'fringes state))))
(let ((margins (cdr (assq 'margins state))))
(set-window-margins window (car margins) (cdr margins)))
(let ((scroll-bars (cdr (assq 'scroll-bars state))))
(set-window-scroll-bars
window (car scroll-bars) (nth 2 scroll-bars)
(nth 3 scroll-bars)))
(set-window-vscroll window (cdr (assq 'vscroll state)))
;; Adjust vertically.
(if (memq window-size-fixed '(t height))
;; A fixed height window, try to restore the
;; original size.
(let ((delta (- (cdr (assq 'total-height item))
(window-total-height window)))
window-size-fixed)
(when (window-resizable-p window delta)
(window-resize window delta)))
;; Else check whether the window is not high enough.
(let* ((min-size (window-min-size window nil ignore))
(delta (- min-size (window-total-size window))))
(when (and (> delta 0)
(window-resizable-p window delta nil ignore))
(window-resize window delta nil ignore))))
;; Adjust horizontally.
(if (memq window-size-fixed '(t width))
;; A fixed width window, try to restore the original
;; size.
(let ((delta (- (cdr (assq 'total-width item))
(window-total-width window)))
window-size-fixed)
(when (window-resizable-p window delta)
(window-resize window delta)))
;; Else check whether the window is not wide enough.
(let* ((min-size (window-min-size window t ignore))
(delta (- min-size (window-total-size window t))))
(when (and (> delta 0)
(window-resizable-p window delta t ignore))
(window-resize window delta t ignore))))
;; Set dedicated status.
(set-window-dedicated-p window (cdr (assq 'dedicated state)))
;; Install positions (maybe we should do this after all
;; windows have been created and sized).
(ignore-errors
(set-window-start window (cdr (assq 'start state)))
(set-window-point window (cdr (assq 'point state))))
;; Select window if it's the selected one.
(when (cdr (assq 'selected state))
(select-window window)))
;; We don't want to raise an error in case the buffer does
;; not exist anymore, so we switch to a previous one and
;; save the window with the intention of deleting it later
;; if possible.
(switch-to-prev-buffer window)
(push window window-state-put-stale-windows)))
(with-current-buffer (window-buffer window)
(set-window-hscroll window (cdr (assq 'hscroll state)))
(apply 'set-window-fringes
(cons window (cdr (assq 'fringes state))))
(let ((margins (cdr (assq 'margins state))))
(set-window-margins window (car margins) (cdr margins)))
(let ((scroll-bars (cdr (assq 'scroll-bars state))))
(set-window-scroll-bars
window (car scroll-bars) (nth 2 scroll-bars) (nth 3 scroll-bars)))
(set-window-vscroll window (cdr (assq 'vscroll state)))
;; Adjust vertically.
(if (memq window-size-fixed '(t height))
;; A fixed height window, try to restore the original size.
(let ((delta (- (cdr (assq 'total-height item))
(window-total-height window)))
window-size-fixed)
(when (window-resizable-p window delta)
(window-resize window delta)))
;; Else check whether the window is not high enough.
(let* ((min-size (window-min-size window nil ignore))
(delta (- min-size (window-total-size window))))
(when (and (> delta 0)
(window-resizable-p window delta nil ignore))
(window-resize window delta nil ignore))))
;; Adjust horizontally.
(if (memq window-size-fixed '(t width))
;; A fixed width window, try to restore the original size.
(let ((delta (- (cdr (assq 'total-width item))
(window-total-width window)))
window-size-fixed)
(when (window-resizable-p window delta)
(window-resize window delta)))
;; Else check whether the window is not wide enough.
(let* ((min-size (window-min-size window t ignore))
(delta (- min-size (window-total-size window t))))
(when (and (> delta 0)
(window-resizable-p window delta t ignore))
(window-resize window delta t ignore))))
;; Set dedicated status.
(set-window-dedicated-p window (cdr (assq 'dedicated state)))
;; Install positions (maybe we should do this after all windows
;; have been created and sized).
(ignore-errors
(set-window-start window (cdr (assq 'start state)))
(set-window-point window (cdr (assq 'point state))))
;; Select window if it's the selected one.
(when (cdr (assq 'selected state))
(select-window window)))))))
(push window window-state-put-stale-windows)))))))
(defun window-state-put (state &optional window ignore)
"Put window state STATE into WINDOW.

View File

@ -1,3 +1,69 @@
2013-09-15 Jan Djärv <jan.h.d@swipnet.se>
* nsfns.m (Fx_create_frame): Fix font driver registration for
GNUStep.
* font.c (syms_of_font): Check MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
for syms_of_macfont.
* nsterm.m: Include macfont.h.
(ns_tmp_flags, ns_tmp_font): Remove.
(ns_compute_glyph_string_overhangs): Check for driver Qns.
(ns_draw_glyph_string): Use local variables instead of ns_tmp_flags,
ns_tmp_font. Call ns_draw_text_decoration here instead of nsfont.m.
(changeFont:): Fix code style. Check for font driver type when
getiing font.
* nsterm.h (FONT_DESCENT, FONT_ASCENT): Define to (f)->ascent and
(f)->descent.
* nsfont.m (ns_tmp_flags, ns_tmp_font): Remove.
(nsfont_open): Set font driver type.
Set font->ascent and font->descent. Figure out font instead of
ns_tmp_font, and flags instead of ns_tmp_flags.
Fix indentation. Remove call to ns_draw_text_decoration,
moved to nsterm.
* nsfns.m: Include macfont.h.
(Fx_create_frame): Register macfont driver, make a better default font.
(Fns_popup_font_panel): Get font from macfont driver, if used.
* macfont.m, macfont.h, maccuvs.h: New files.
* font.h: Declare syms_of_macfont.
* font.c (syms_of_font): Call syms_of_macfont.
* Makefile.in (NS_OBJ, SOME_MACHINE_OBJECTS): Add macfont.o.
2013-09-15 Dmitry Antipov <dmantipov@yandex.ru>
Drop VERTICAL_SCROLL_BAR_WIDTH_TRIM. For X, it is zero since 1999,
and it is always zero for others, so I assume that this is an ancient
leftover which nobody will want to change any more.
* xterm.h, w32term.h, nsterm.h (VERTICAL_SCROLL_BAR_WIDTH_TRIM): Remove.
(VERTICAL_SCROLL_BAR_INSIDE_WIDTH):
* frame.c (x_set_scroll_bar_width):
* w32fns.c (w32_createscrollbar):
* w32term.c (w32_set_vertical_scroll_bar):
* xfns.c (x_set_scroll_bar_default_width):
* xterm.c (XTflash, x_scroll_bar_create, XTset_vertical_scroll_bar)
(x_scroll_bar_expose): Related users changed.
2013-09-15 Dmitry Antipov <dmantipov@yandex.ru>
* xterm.h (FRAME_X_SCREEN_NUMBER): Add comment.
(BLACK_PIX_DEFAULT, WHITE_PIX_DEFAULT): Use FRAME_X_SCREEN_NUMBER.
(SCROLL_BAR_X_WIDGET, SET_SCROLL_BAR_X_WIDGET) [USE_X_TOOLKIT]:
Define as such.
* frame.h (FRAME_SMALLEST_CHAR_WIDTH, FRAME_SMALLEST_FONT_HEIGHT):
Define once here...
* nsterm.h, w32term.h, xterm.h: ...and not here.
* w32term.h (SCROLL_BAR_X_WIDGET, SET_SCROLL_BAR_X_WIDGET):
Remove unused Xisms.
* xterm.c, xfns.c (toplevel): Remove #ifdef HAVE_X_WINDOWS because
these modules are never compiled otherwise.
2013-09-14 Eli Zaretskii <eliz@gnu.org>
* buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>:

View File

@ -272,7 +272,7 @@ MSDOS_OBJ =
MSDOS_X_OBJ =
NS_OBJ=@NS_OBJ@
## nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o if HAVE_NS.
## nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o macfont.o if HAVE_NS.
NS_OBJC_OBJ=@NS_OBJC_OBJ@
## Only set if NS_IMPL_GNUSTEP.
GNU_OBJC_CFLAGS=@GNU_OBJC_CFLAGS@
@ -397,7 +397,7 @@ xwidget.o: xwidget.c xwidget.h
SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
fontset.o dbusbind.o cygw32.o \
nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \
nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o macfont.o \
w32.o w32console.o w32fns.o w32heap.o w32inevt.o w32notify.o \
w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
w16select.o widget.o xfont.o ftfont.o xftfont.o ftxfont.o gtkutil.o \

View File

@ -5199,6 +5199,9 @@ EMACS_FONT_LOG is set. Otherwise, it is set to t. */);
#endif /* HAVE_NTGUI */
#ifdef HAVE_NS
syms_of_nsfont ();
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
syms_of_macfont ();
#endif
#endif /* HAVE_NS */
#endif /* HAVE_WINDOW_SYSTEM */
}

View File

@ -825,6 +825,7 @@ extern void syms_of_w32font (void);
extern Lisp_Object Qfontsize;
extern struct font_driver nsfont_driver;
extern void syms_of_nsfont (void);
extern void syms_of_macfont (void);
#endif /* HAVE_NS */
#ifndef FONT_DEBUG

View File

@ -3369,9 +3369,6 @@ x_set_scroll_bar_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
else if (RANGED_INTEGERP (1, arg, INT_MAX)
&& XFASTINT (arg) != FRAME_CONFIG_SCROLL_BAR_WIDTH (f))
{
if (XFASTINT (arg) <= 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM)
XSETINT (arg, 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM + 1);
FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = XFASTINT (arg);
FRAME_CONFIG_SCROLL_BAR_COLS (f) = (XFASTINT (arg) + wid-1) / wid;
if (FRAME_X_WINDOW (f))

View File

@ -1131,6 +1131,15 @@ extern Lisp_Object selected_frame;
(FRAME_PIXEL_Y_TO_LINE (f, ((height) \
- FRAME_INTERNAL_BORDER_WIDTH (f))))
/* Value is the smallest width of any character in any font on frame F. */
#define FRAME_SMALLEST_CHAR_WIDTH(f) \
FRAME_DISPLAY_INFO (f)->smallest_char_width
/* Value is the smallest height of any font on frame F. */
#define FRAME_SMALLEST_FONT_HEIGHT(f) \
FRAME_DISPLAY_INFO (f)->smallest_font_height
/***********************************************************************
Frame Parameters

144
src/macfont.h Normal file
View File

@ -0,0 +1,144 @@
/* Interface definition for Mac OSX Core text font backend.
Copyright (C) 2009-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
Original author: YAMAMOTO Mitsuharu
*/
/* Structure used by Mac `shape' functions for storing layout
information for each glyph. */
struct mac_glyph_layout
{
/* Range of indices of the characters composed into the group of
glyphs that share the cursor position with this glyph. The
members `location' and `length' are in UTF-16 indices. */
CFRange comp_range;
/* UTF-16 index in the source string for the first character
associated with this glyph. */
CFIndex string_index;
/* Horizontal and vertical adjustments of glyph position. The
coordinate space is that of Core Text. So, the `baseline_delta'
value is negative if the glyph should be placed below the
baseline. */
CGFloat advance_delta, baseline_delta;
/* Typographical width of the glyph. */
CGFloat advance;
/* Glyph ID of the glyph. */
CGGlyph glyph_id;
};
typedef CTFontDescriptorRef FontDescriptorRef;
typedef CTFontRef FontRef;
typedef CTFontSymbolicTraits FontSymbolicTraits;
typedef CTCharacterCollection CharacterCollection;
#define MAC_FONT_NAME_ATTRIBUTE kCTFontNameAttribute
#define MAC_FONT_FAMILY_NAME_ATTRIBUTE kCTFontFamilyNameAttribute
#define MAC_FONT_TRAITS_ATTRIBUTE kCTFontTraitsAttribute
#define MAC_FONT_SIZE_ATTRIBUTE kCTFontSizeAttribute
#define MAC_FONT_CASCADE_LIST_ATTRIBUTE kCTFontCascadeListAttribute
#define MAC_FONT_CHARACTER_SET_ATTRIBUTE kCTFontCharacterSetAttribute
#define MAC_FONT_LANGUAGES_ATTRIBUTE kCTFontLanguagesAttribute
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
#define MAC_FONT_FORMAT_ATTRIBUTE kCTFontFormatAttribute
#else
#define MAC_FONT_FORMAT_ATTRIBUTE (CFSTR ("NSCTFontFormatAttribute"))
#endif
#define MAC_FONT_SYMBOLIC_TRAIT kCTFontSymbolicTrait
#define MAC_FONT_WEIGHT_TRAIT kCTFontWeightTrait
#define MAC_FONT_WIDTH_TRAIT kCTFontWidthTrait
#define MAC_FONT_SLANT_TRAIT kCTFontSlantTrait
enum {
MAC_FONT_TRAIT_ITALIC = kCTFontItalicTrait,
MAC_FONT_TRAIT_BOLD = kCTFontBoldTrait,
MAC_FONT_TRAIT_MONO_SPACE = kCTFontMonoSpaceTrait,
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
MAC_FONT_TRAIT_COLOR_GLYPHS = kCTFontColorGlyphsTrait
#else
MAC_FONT_TRAIT_COLOR_GLYPHS = (1 << 13)
#endif
};
enum {
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
MAC_FONT_FORMAT_BITMAP = kCTFontFormatBitmap
#else
MAC_FONT_FORMAT_BITMAP = 5
#endif
};
enum {
MAC_CHARACTER_COLLECTION_IDENTITY_MAPPING = kCTIdentityMappingCharacterCollection,
MAC_CHARACTER_COLLECTION_ADOBE_JAPAN1 = kCTAdobeJapan1CharacterCollection
};
#define mac_font_descriptor_create_with_attributes \
CTFontDescriptorCreateWithAttributes
#define mac_font_descriptor_create_matching_font_descriptors \
CTFontDescriptorCreateMatchingFontDescriptors
#define mac_font_descriptor_create_matching_font_descriptor \
CTFontDescriptorCreateMatchingFontDescriptor
#define mac_font_descriptor_copy_attribute CTFontDescriptorCopyAttribute
#define mac_font_descriptor_supports_languages \
mac_ctfont_descriptor_supports_languages
#define mac_font_create_with_name(name, size) \
CTFontCreateWithName (name, size, NULL)
#define mac_font_get_size CTFontGetSize
#define mac_font_copy_family_name CTFontCopyFamilyName
#define mac_font_copy_character_set CTFontCopyCharacterSet
#define mac_font_get_glyphs_for_characters CTFontGetGlyphsForCharacters
#define mac_font_get_ascent CTFontGetAscent
#define mac_font_get_descent CTFontGetDescent
#define mac_font_get_leading CTFontGetLeading
#define mac_font_get_underline_position CTFontGetUnderlinePosition
#define mac_font_get_underline_thickness CTFontGetUnderlineThickness
#define mac_font_copy_graphics_font(font) CTFontCopyGraphicsFont (font, NULL)
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
#define mac_font_copy_non_synthetic_table(font, table) \
CTFontCopyTable (font, table, kCTFontTableOptionNoOptions)
#else
#define mac_font_copy_non_synthetic_table(font, table) \
CTFontCopyTable (font, table, kCTFontTableOptionExcludeSynthetic)
#endif
#define mac_font_create_preferred_family_for_attributes \
mac_ctfont_create_preferred_family_for_attributes
#define mac_font_get_advance_width_for_glyph \
mac_ctfont_get_advance_width_for_glyph
#define mac_font_get_bounding_rect_for_glyph \
mac_ctfont_get_bounding_rect_for_glyph
#define mac_font_create_available_families mac_ctfont_create_available_families
#define mac_font_shape mac_ctfont_shape
#if USE_CT_GLYPH_INFO
#define mac_font_get_glyph_for_cid mac_ctfont_get_glyph_for_cid
#endif
#define mac_nsctfont_copy_font_descriptor CTFontCopyFontDescriptor
#define MAC_FONT_CHARACTER_SET_STRING_ATTRIBUTE \
(CFSTR ("MAC_FONT_CHARACTER_SET_STRING_ATTRIBUTE"))
typedef const struct _EmacsScreenFont *ScreenFontRef; /* opaque */
extern void mac_register_font_driver (struct frame *f);
extern void *macfont_get_nsctfont (struct font *font);

3858
src/macfont.m Normal file

File diff suppressed because it is too large Load Diff

9215
src/macuvs.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -46,6 +46,9 @@ Updated by Christian Limpach (chris@nice.ch)
#ifdef NS_IMPL_COCOA
#include <IOKit/graphics/IOGraphicsLib.h>
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
#include "macfont.h"
#endif
#endif
#if 0
@ -1171,7 +1174,16 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
}
block_input ();
#ifdef NS_IMPL_COCOA
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
if (CTGetCoreTextVersion != NULL
&& CTGetCoreTextVersion () >= kCTVersionNumber10_5)
mac_register_font_driver (f);
#endif
#endif
register_font_driver (&nsfont_driver, f);
x_default_parameter (f, parms, Qfont_backend, Qnil,
"fontBackend", "FontBackend", RES_TYPE_STRING);
@ -1181,8 +1193,13 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
x_default_parameter (f, parms, Qfontsize,
make_number (0 /*(int)[font pointSize]*/),
"fontSize", "FontSize", RES_TYPE_NUMBER);
// Remove ' Regular', not handled by backends.
char *fontname = xstrdup ([[font displayName] UTF8String]);
int len = strlen (fontname);
if (len > 8 && strcmp (fontname + len - 8, " Regular") == 0)
fontname[len-8] = '\0';
x_default_parameter (f, parms, Qfont,
build_string ([[font fontName] UTF8String]),
build_string (fontname),
"font", "Font", RES_TYPE_STRING);
}
unblock_input ();
@ -1362,9 +1379,15 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
{
struct frame *f = decode_window_system_frame (frame);
id fm = [NSFontManager sharedFontManager];
[fm setSelectedFont: ((struct nsfont_info *)f->output_data.ns->font)->nsfont
isMultiple: NO];
struct font *font = f->output_data.ns->font;
NSFont *nsfont;
if (EQ (font->driver->type, Qns))
nsfont = ((struct nsfont_info *)font)->nsfont;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
else
nsfont = (NSFont *) macfont_get_nsctfont (font);
#endif
[fm setSelectedFont: nsfont isMultiple: NO];
[fm orderFrontFontPanel: NSApp];
return Qnil;
}

View File

@ -51,8 +51,6 @@
static Lisp_Object Qcondensed, Qexpanded;
extern Lisp_Object Qappend;
extern float ns_antialias_threshold;
extern int ns_tmp_flags;
extern struct nsfont_info *ns_tmp_font;
/* font glyph and metrics caching functions, implemented at end */
@ -798,6 +796,7 @@ when setting family in ns_spec_to_descriptor(). */
font_object = font_make_object (VECSIZE (struct nsfont_info),
font_entity, pixel_size);
ASET (font_object, FONT_TYPE_INDEX, nsfont_driver.type);
font_info = (struct nsfont_info *) XFONT_OBJECT (font_object);
font = (struct font *) font_info;
if (!font)
@ -871,10 +870,11 @@ when setting family in ns_spec_to_descriptor(). */
font_info->size = font->pixel_size;
/* max bounds */
font_info->max_bounds.ascent = lrint ([sfont ascender]);
font->ascent = font_info->max_bounds.ascent = lrint ([sfont ascender]);
/* Descender is usually negative. Use floor to avoid
clipping descenders. */
font_info->max_bounds.descent = -lrint (floor(adjusted_descender));
font->descent =
font_info->max_bounds.descent = -lrint (floor(adjusted_descender));
font_info->height =
font_info->max_bounds.ascent + font_info->max_bounds.descent;
font_info->max_bounds.width = lrint (font_info->width);
@ -1051,16 +1051,26 @@ is false when (FROM > 0 || TO < S->nchars). */
#endif
struct face *face;
NSRect r;
struct nsfont_info *font = ns_tmp_font;
struct nsfont_info *font;
NSColor *col, *bgCol;
unsigned short *t = s->char2b;
int i, len;
int i, len, flags;
char isComposite = s->first_glyph->type == COMPOSITE_GLYPH;
int end = isComposite ? s->cmp_to : s->nchars;
block_input ();
font = (struct nsfont_info *)s->face->font;
if (font == NULL)
font = (struct nsfont_info *)FRAME_FONT (s->f);
/* Select face based on input flags */
switch (ns_tmp_flags)
flags = s->hl == DRAW_CURSOR ? NS_DUMPGLYPH_CURSOR :
(s->hl == DRAW_MOUSE_FACE ? NS_DUMPGLYPH_MOUSEFACE :
(s->for_overlaps ? NS_DUMPGLYPH_FOREGROUND :
NS_DUMPGLYPH_NORMAL));
switch (flags)
{
case NS_DUMPGLYPH_CURSOR:
face = s->face;
@ -1188,8 +1198,8 @@ is false when (FROM > 0 || TO < S->nchars). */
col = (NS_FACE_FOREGROUND (face) != 0
? ns_lookup_indexed_color (NS_FACE_FOREGROUND (face), s->f)
: FRAME_FOREGROUND_COLOR (s->f));
/* FIXME: find another way to pass this */
bgCol = (ns_tmp_flags != NS_DUMPGLYPH_FOREGROUND ? nil
bgCol = (flags != NS_DUMPGLYPH_FOREGROUND ? nil
: (NS_FACE_BACKGROUND (face) != 0
? ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f)
: FRAME_BACKGROUND_COLOR (s->f)));
@ -1264,22 +1274,19 @@ is false when (FROM > 0 || TO < S->nchars). */
CGContextSetTextPosition (gcontext, r.origin.x, r.origin.y);
CGContextShowGlyphsWithAdvances (gcontext, s->char2b + s->cmp_from,
advances, len);
advances, len);
if (face->overstrike)
{
CGContextSetTextPosition (gcontext, r.origin.x+0.5, r.origin.y);
CGContextShowGlyphsWithAdvances (gcontext, s->char2b + s->cmp_from,
advances, len);
advances, len);
}
CGContextRestoreGState (gcontext);
}
#endif /* NS_IMPL_COCOA */
/* Draw underline, overline, strike-through. */
ns_draw_text_decoration (s, face, col, r.size.width, r.origin.x);
unblock_input ();
return to-from;
}

View File

@ -701,10 +701,8 @@ struct x_output
#define FONT_WIDTH(f) ((f)->max_width)
#define FONT_HEIGHT(f) ((f)->height)
/*#define FONT_BASE(f) ((f)->ascent) */
#define FONT_BASE(f) (((struct nsfont_info *)f)->max_bounds.ascent)
/*#define FONT_DESCENT(f) ((f)->descent) */
#define FONT_DESCENT(f) (((struct nsfont_info *)f)->max_bounds.descent)
#define FONT_BASE(f) ((f)->ascent)
#define FONT_DESCENT(f) ((f)->descent)
#define FRAME_DEFAULT_FACE(f) FACE_FROM_ID (f, DEFAULT_FACE_ID)
@ -746,10 +744,6 @@ struct x_output
#define FRAME_FONTSET(f) ((f)->output_data.ns->fontset)
#define FRAME_SMALLEST_CHAR_WIDTH(f) \
(FRAME_DISPLAY_INFO (f)->smallest_char_width)
#define FRAME_SMALLEST_FONT_HEIGHT(f) \
(FRAME_DISPLAY_INFO (f)->smallest_font_height)
#define FRAME_BASELINE_OFFSET(f) ((f)->output_data.ns->baseline_offset)
#define BLACK_PIX_DEFAULT(f) 0x000000
#define WHITE_PIX_DEFAULT(f) 0xFFFFFF
@ -904,8 +898,4 @@ extern char gnustep_base_version[]; /* version tracking */
? (min) : (((x)>(max)) ? (max) : (x)))
#define SCREENMAXBOUND(x) (IN_BOUND (-SCREENMAX, x, SCREENMAX))
/* needed somewhere... */
#define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0)
#endif /* HAVE_NS */

View File

@ -64,6 +64,12 @@ Updated by Christian Limpach (chris@nice.ch)
#include "process.h"
#endif
#ifdef NS_IMPL_COCOA
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
#include "macfont.h"
#endif
#endif
/* call tracing */
#if 0
int term_trace_num = 0;
@ -198,8 +204,6 @@ Updated by Christian Limpach (chris@nice.ch)
#endif
static BOOL gsaved = NO;
static BOOL ns_fake_keydown = NO;
int ns_tmp_flags; /* FIXME */
struct nsfont_info *ns_tmp_font; /* FIXME */
#ifdef NS_IMPL_COCOA
static BOOL ns_menu_bar_is_hidden = NO;
#endif
@ -2158,8 +2162,11 @@ Free a pool and temporary objects it refers to (callable from C)
else
{
s->left_overhang = 0;
s->right_overhang = ((struct nsfont_info *)font)->ital ?
FONT_HEIGHT (font) * 0.2 : 0;
if (EQ (font->driver->type, Qns))
s->right_overhang = ((struct nsfont_info *)font)->ital ?
FONT_HEIGHT (font) * 0.2 : 0;
else
s->right_overhang = 0;
}
}
@ -3133,8 +3140,10 @@ overwriting cursor (usually when cursor on a tab) */
{
/* TODO (optimize): focus for box and contents draw */
NSRect r[2];
int n;
int n, flags;
char box_drawn_p = 0;
struct font *font = s->face->font;
if (! font) font = FRAME_FONT (s->f);
NSTRACE (ns_draw_glyph_string);
@ -3201,13 +3210,10 @@ overwriting cursor (usually when cursor on a tab) */
ns_maybe_dumpglyphs_background
(s, s->first_glyph->type == COMPOSITE_GLYPH);
ns_tmp_flags = s->hl == DRAW_CURSOR ? NS_DUMPGLYPH_CURSOR :
(s->hl == DRAW_MOUSE_FACE ? NS_DUMPGLYPH_MOUSEFACE :
(s->for_overlaps ? NS_DUMPGLYPH_FOREGROUND :
NS_DUMPGLYPH_NORMAL));
ns_tmp_font = (struct nsfont_info *)s->face->font;
if (ns_tmp_font == NULL)
ns_tmp_font = (struct nsfont_info *)FRAME_FONT (s->f);
flags = s->hl == DRAW_CURSOR ? NS_DUMPGLYPH_CURSOR :
(s->hl == DRAW_MOUSE_FACE ? NS_DUMPGLYPH_MOUSEFACE :
(s->for_overlaps ? NS_DUMPGLYPH_FOREGROUND :
NS_DUMPGLYPH_NORMAL));
if (s->hl == DRAW_CURSOR && s->w->phys_cursor_type == FILLED_BOX_CURSOR)
{
@ -3216,10 +3222,21 @@ overwriting cursor (usually when cursor on a tab) */
NS_FACE_FOREGROUND (s->face) = tmp;
}
ns_tmp_font->font.driver->draw
font->driver->draw
(s, 0, s->nchars, s->x, s->y,
(ns_tmp_flags == NS_DUMPGLYPH_NORMAL && !s->background_filled_p)
|| ns_tmp_flags == NS_DUMPGLYPH_MOUSEFACE);
(flags == NS_DUMPGLYPH_NORMAL && !s->background_filled_p)
|| flags == NS_DUMPGLYPH_MOUSEFACE);
{
NSColor *col = (NS_FACE_FOREGROUND (s->face) != 0
? ns_lookup_indexed_color (NS_FACE_FOREGROUND (s->face),
s->f)
: FRAME_FOREGROUND_COLOR (s->f));
[col set];
/* Draw underline, overline, strike-through. */
ns_draw_text_decoration (s, s->face, col, s->width, s->x);
}
if (s->hl == DRAW_CURSOR && s->w->phys_cursor_type == FILLED_BOX_CURSOR)
{
@ -3959,7 +3976,7 @@ static Lisp_Object ns_string_to_lispmod (const char *s)
0, /* define_fringe_bitmap */ /* FIXME: simplify ns_draw_fringe_bitmap */
0, /* destroy_fringe_bitmap */
ns_compute_glyph_string_overhangs,
ns_draw_glyph_string, /* interface to nsfont.m */
ns_draw_glyph_string,
ns_define_frame_cursor,
ns_clear_frame_area,
ns_draw_window_cursor,
@ -4809,17 +4826,26 @@ - (void)dealloc
/* called on font panel selection */
- (void)changeFont: (id)sender
{
NSEvent *e =[[self window] currentEvent];
struct face *face =FRAME_DEFAULT_FACE (emacsframe);
NSEvent *e = [[self window] currentEvent];
struct face *face = FRAME_DEFAULT_FACE (emacsframe);
struct font *font = face->font;
id newFont;
CGFloat size;
NSFont *nsfont;
NSTRACE (changeFont);
if (!emacs_event)
return;
if ((newFont = [sender convertFont:
((struct nsfont_info *)face->font)->nsfont]))
if (EQ (font->driver->type, Qns))
nsfont = ((struct nsfont_info *)font)->nsfont;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
else
nsfont = (NSFont *) macfont_get_nsctfont (font);
#endif
if ((newFont = [sender convertFont: nsfont]))
{
SET_FRAME_GARBAGED (emacsframe); /* now needed as of 2008/10 */

View File

@ -1890,16 +1890,11 @@ w32_init_class (HINSTANCE hinst)
static HWND
w32_createscrollbar (struct frame *f, struct scroll_bar * bar)
{
return (CreateWindow ("SCROLLBAR", "", SBS_VERT | WS_CHILD | WS_VISIBLE,
/* Position and size of scroll bar. */
XINT (bar->left) + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
XINT (bar->top),
XINT (bar->width) - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
XINT (bar->height),
FRAME_W32_WINDOW (f),
NULL,
hinst,
NULL));
return CreateWindow ("SCROLLBAR", "", SBS_VERT | WS_CHILD | WS_VISIBLE,
/* Position and size of scroll bar. */
XINT (bar->left), XINT (bar->top),
XINT (bar->width), XINT (bar->height),
FRAME_W32_WINDOW (f), NULL, hinst, NULL);
}
static void

View File

@ -3866,8 +3866,7 @@ w32_set_vertical_scroll_bar (struct window *w,
/* Make sure scroll bar is "visible" before moving, to ensure the
area of the parent window now exposed will be refreshed. */
my_show_window (f, hwnd, SW_HIDE);
MoveWindow (hwnd, sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
top, sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
MoveWindow (hwnd, sb_left, top, sb_width,
max (height, 1), TRUE);
si.cbSize = sizeof (si);

View File

@ -382,16 +382,6 @@ extern struct w32_output w32term_display;
/* This is the `Display *' which frame F is on. */
#define FRAME_X_DISPLAY(f) (0)
/* Value is the smallest width of any character in any font on frame F. */
#define FRAME_SMALLEST_CHAR_WIDTH(F) \
FRAME_DISPLAY_INFO(F)->smallest_char_width
/* Value is the smallest height of any font on frame F. */
#define FRAME_SMALLEST_FONT_HEIGHT(F) \
FRAME_DISPLAY_INFO(F)->smallest_font_height
#define FRAME_NORMAL_PLACEMENT(F) ((F)->output_data.w32->normal_placement)
#define FRAME_PREV_FSMODE(F) ((F)->output_data.w32->prev_fsmode)
@ -483,21 +473,12 @@ struct scroll_bar {
#define SET_SCROLL_BAR_W32_WINDOW(ptr, id) \
(SCROLL_BAR_UNPACK ((ptr)->w32_window_low, (ptr)->w32_window_high, (intptr_t) id))
/* Extract the X widget of the scroll bar from a struct scroll_bar. */
#define SCROLL_BAR_X_WIDGET(ptr) \
((Widget) SCROLL_BAR_PACK ((ptr)->x_widget_low, (ptr)->x_widget_high))
/* Store a widget id in a struct scroll_bar. */
#define SET_SCROLL_BAR_X_WIDGET(ptr, w) \
(SCROLL_BAR_UNPACK ((ptr)->x_widget_low, (ptr)->x_widget_high, (int) w))
/* Return the inside width of a vertical scroll bar, given the outside
width. */
#define VERTICAL_SCROLL_BAR_INSIDE_WIDTH(f,width) \
((width) \
- VERTICAL_SCROLL_BAR_LEFT_BORDER \
- VERTICAL_SCROLL_BAR_RIGHT_BORDER \
- VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2)
- VERTICAL_SCROLL_BAR_RIGHT_BORDER)
/* Return the length of the rectangle within which the top of the
handle must stay. This isn't equivalent to the inside height,
@ -534,11 +515,6 @@ struct scroll_bar {
/* Minimum lengths for scroll bar handles, in pixels. */
#define VERTICAL_SCROLL_BAR_MIN_HANDLE (vertical_scroll_bar_min_handle)
/* Trimming off a few pixels from each side prevents
text from glomming up against the scroll bar */
#define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0)
struct frame; /* from frame.h */
extern void w32_fill_rect (struct frame *, HDC, COLORREF, RECT *);

View File

@ -42,8 +42,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "termchar.h"
#include "font.h"
#ifdef HAVE_X_WINDOWS
#include <sys/types.h>
#include <sys/stat.h>
@ -1470,9 +1468,8 @@ x_set_scroll_bar_default_width (struct frame *f)
int minw = 16;
#endif
/* A minimum width of 14 doesn't look good for toolkit scroll bars. */
int 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;
FRAME_CONFIG_SCROLL_BAR_COLS (f) = (minw + wid - 1) / wid;
FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = minw;
#else
/* Make the actual width at least 14 pixels and a multiple of a
character width. */
@ -6186,5 +6183,3 @@ When using Gtk+ tooltips, the tooltip face is not used. */);
defsubr (&Sx_select_font);
#endif
}
#endif /* HAVE_X_WINDOWS */

View File

@ -23,8 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
#ifdef HAVE_X_WINDOWS
#include "lisp.h"
#include "blockinput.h"
#include "syssignal.h"
@ -3030,26 +3028,7 @@ XTflash (struct frame *f)
/* These will be the left and right margins of the rectangles. */
int flash_left = FRAME_INTERNAL_BORDER_WIDTH (f);
int flash_right = FRAME_PIXEL_WIDTH (f) - FRAME_INTERNAL_BORDER_WIDTH (f);
int width;
/* Don't flash the area between a scroll bar and the frame
edge it is next to. */
switch (FRAME_VERTICAL_SCROLL_BAR_TYPE (f))
{
case vertical_scroll_bar_left:
flash_left += VERTICAL_SCROLL_BAR_WIDTH_TRIM;
break;
case vertical_scroll_bar_right:
flash_right -= VERTICAL_SCROLL_BAR_WIDTH_TRIM;
break;
default:
break;
}
width = flash_right - flash_left;
int width = flash_right - flash_left;
/* If window is tall, flash top and bottom line. */
if (height > 3 * FRAME_LINE_HEIGHT (f))
@ -5064,12 +5043,9 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
window = XCreateWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
/* Position and size of scroll bar. */
left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
top,
width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
height,
left, top, width, height,
/* Border width, depth, class, and visual. */
0,
0,
CopyFromParent,
CopyFromParent,
CopyFromParent,
@ -5104,19 +5080,11 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
#ifdef USE_TOOLKIT_SCROLL_BARS
{
#ifdef USE_GTK
xg_update_scrollbar_pos (f,
bar->x_window,
top,
left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
max (height, 1));
xg_update_scrollbar_pos (f, bar->x_window, top,
left,width, max (height, 1));
#else /* not USE_GTK */
Widget scroll_bar = SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar);
XtConfigureWidget (scroll_bar,
left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
top,
width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
max (height, 1), 0);
XtConfigureWidget (scroll_bar, left, top, width, max (height, 1), 0);
XtMapWidget (scroll_bar);
#endif /* not USE_GTK */
}
@ -5364,33 +5332,15 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
left, top, width, height);
}
#ifdef USE_GTK
xg_update_scrollbar_pos (f,
bar->x_window,
top,
sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM *2,
max (height, 1));
xg_update_scrollbar_pos (f, bar->x_window, top,
sb_left, sb_width, max (height, 1));
#else /* not USE_GTK */
XtConfigureWidget (SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar),
sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
top,
sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
max (height, 1), 0);
sb_left, top, sb_width, max (height, 1), 0);
#endif /* not USE_GTK */
}
#else /* not USE_TOOLKIT_SCROLL_BARS */
/* Clear areas not covered by the scroll bar because of
VERTICAL_SCROLL_BAR_WIDTH_TRIM. */
if (VERTICAL_SCROLL_BAR_WIDTH_TRIM)
{
x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
left, top, VERTICAL_SCROLL_BAR_WIDTH_TRIM, height);
x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
left + width - VERTICAL_SCROLL_BAR_WIDTH_TRIM,
top, VERTICAL_SCROLL_BAR_WIDTH_TRIM, height);
}
/* Clear areas not covered by the scroll bar because it's not as
wide as the area reserved for it. This makes sure a
previous mode line display is cleared after C-x 2 C-x 1, for
@ -5414,9 +5364,9 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
{
XWindowChanges wc;
wc.x = sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM;
wc.x = sb_left;
wc.y = top;
wc.width = sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2;
wc.width = sb_width;
wc.height = height;
XConfigureWindow (FRAME_X_DISPLAY (f), bar->x_window,
mask, &wc);
@ -5579,7 +5529,6 @@ x_scroll_bar_expose (struct scroll_bar *bar, XEvent *event)
Window w = bar->x_window;
struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
GC gc = f->output_data.x->normal_gc;
int width_trim = VERTICAL_SCROLL_BAR_WIDTH_TRIM;
block_input ();
@ -5592,11 +5541,8 @@ x_scroll_bar_expose (struct scroll_bar *bar, XEvent *event)
/* Draw a one-pixel border just inside the edges of the scroll bar. */
XDrawRectangle (FRAME_X_DISPLAY (f), w, gc,
/* x, y, width, height */
0, 0,
bar->width - 1 - width_trim - width_trim,
bar->height - 1);
0, 0, bar->width - 1, bar->height - 1);
/* Restore the foreground color of the GC if we changed it above. */
if (f->output_data.x->scroll_bar_foreground_pixel != -1)
@ -10883,5 +10829,3 @@ default is nil, which is the same as `super'. */);
make_float (DEFAULT_REHASH_THRESHOLD),
Qnil);
}
#endif /* HAVE_X_WINDOWS */

View File

@ -78,10 +78,11 @@ typedef GtkWidget *xt_or_gtk_widget;
#include "dispextern.h"
#include "termhooks.h"
#define BLACK_PIX_DEFAULT(f) BlackPixel (FRAME_X_DISPLAY (f), \
XScreenNumberOfScreen (FRAME_X_SCREEN (f)))
#define WHITE_PIX_DEFAULT(f) WhitePixel (FRAME_X_DISPLAY (f), \
XScreenNumberOfScreen (FRAME_X_SCREEN (f)))
/* Black and white pixel values for the screen which frame F is on. */
#define BLACK_PIX_DEFAULT(f) \
BlackPixel (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f))
#define WHITE_PIX_DEFAULT(f) \
WhitePixel (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f))
#define FONT_WIDTH(f) ((f)->max_width)
#define FONT_HEIGHT(f) ((f)->ascent + (f)->descent)
@ -707,6 +708,8 @@ enum
/* This is the `Screen *' which frame F is on. */
#define FRAME_X_SCREEN(f) (FRAME_DISPLAY_INFO (f)->screen)
/* This is the screen index number of screen which frame F is on. */
#define FRAME_X_SCREEN_NUMBER(f) XScreenNumberOfScreen (FRAME_X_SCREEN (f))
/* This is the Visual which frame F is on. */
@ -731,16 +734,6 @@ enum
#define FRAME_XIC_STYLE(f) ((f)->output_data.x->xic_style)
#define FRAME_XIC_FONTSET(f) ((f)->output_data.x->xic_xfs)
/* Value is the smallest width of any character in any font on frame F. */
#define FRAME_SMALLEST_CHAR_WIDTH(F) \
FRAME_DISPLAY_INFO(F)->smallest_char_width
/* Value is the smallest height of any font on frame F. */
#define FRAME_SMALLEST_FONT_HEIGHT(F) \
FRAME_DISPLAY_INFO(F)->smallest_font_height
/* X-specific scroll bar stuff. */
/* We represent scroll bars as lisp vectors. This allows us to place
@ -803,6 +796,7 @@ struct scroll_bar
/* Turning a lisp vector value into a pointer to a struct scroll_bar. */
#define XSCROLL_BAR(vec) ((struct scroll_bar *) XVECTOR (vec))
#ifdef USE_X_TOOLKIT
/* Extract the X widget of the scroll bar from a struct scroll_bar.
XtWindowToWidget should be fast enough since Xt uses a hash table
@ -819,14 +813,14 @@ struct scroll_bar
ptr->x_window = window; \
} while (0)
#endif /* USE_X_TOOLKIT */
/* Return the inside width of a vertical scroll bar, given the outside
width. */
#define VERTICAL_SCROLL_BAR_INSIDE_WIDTH(f, width) \
((width) \
- VERTICAL_SCROLL_BAR_LEFT_BORDER \
- VERTICAL_SCROLL_BAR_RIGHT_BORDER \
- VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2)
- VERTICAL_SCROLL_BAR_RIGHT_BORDER)
/* Return the length of the rectangle within which the top of the
handle must stay. This isn't equivalent to the inside height,
@ -863,11 +857,6 @@ struct scroll_bar
/* Minimum lengths for scroll bar handles, in pixels. */
#define VERTICAL_SCROLL_BAR_MIN_HANDLE (5)
/* Trimming off a few pixels from each side prevents
text from glomming up against the scroll bar */
#define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0)
/* If a struct input_event has a kind which is SELECTION_REQUEST_EVENT
or SELECTION_CLEAR_EVENT, then its contents are really described
by this structure. */

View File

@ -1,3 +1,9 @@
2013-09-15 Glenn Morris <rgm@gnu.org>
* automated/eshell.el (eshell-test/for-name-shadow-loop):
New test. (Bug#15372)
(eshell-test/for-loop, eshell-test/for-name-loop): Doc fix.
2013-09-13 Glenn Morris <rgm@gnu.org>
* automated/eshell.el (with-temp-eshell):

View File

@ -75,17 +75,23 @@
(should (equal (eshell-test-command-result "(+ 1 2)") 3)))
(ert-deftest eshell-test/for-loop ()
"Test `eshell-command-result' with an elisp command."
"Test `eshell-command-result' with a for loop.."
(let ((process-environment (cons "foo" process-environment)))
(should (equal (eshell-test-command-result
"for foo in 5 { echo $foo }") 5))))
(ert-deftest eshell-test/for-name-loop () ;Bug#15231
"Test `eshell-command-result' with an elisp command."
"Test `eshell-command-result' with a for loop using `name'."
(let ((process-environment (cons "name" process-environment)))
(should (equal (eshell-test-command-result
"for name in 3 { echo $name }") 3))))
(ert-deftest eshell-test/for-name-shadow-loop () ; bug#15372
"Test `eshell-command-result' with a for loop using an env-var."
(let ((process-environment (cons "name=env-value" process-environment)))
(should (equal (eshell-test-command-result
"for name in 3 { echo $name }") 3))))
(ert-deftest eshell-test/lisp-command-args ()
"Test `eshell-command-result' with elisp and trailing args.
Test that trailing arguments outside the S-expression are

View File

@ -71,3 +71,7 @@ def test2 (arg)
if something == :==
do_something
end
# Bug#15369
MSG = 'Separate every 3 digits in the integer portion of a number' \
'with underscores(_).'