2015-09-01 Paul Eggert <eggert@cs.ucla.edu>
- terminal-init-w32console mimicks command-line
+ terminal-init-w32console mimics command-line
Problem reported by Eli Zaretskii.
* lisp/startup.el (startup--setup-quote-display):
New function, refactored from a part of ‘command-line’.
@section Tooltips
@cindex tooltips
- @dfn{Tooltips} are small windows that display text information at
-the current mouse position. They activate when there is a pause in
-mouse movement over some significant piece of text in a window, or the
-mode line, or some other part of the Emacs frame such as a tool bar
-button or menu item.
+ @dfn{Tooltips} are small special frames that display text
+information at the current mouse position. They activate when there
+is a pause in mouse movement over some significant piece of text in a
+window, or the mode line, or some other part of the Emacs frame such
+as a tool bar button or menu item.
@findex tooltip-mode
You can toggle the use of tooltips with the command @kbd{M-x
displayed in the echo area instead. To control the use of tooltips at
startup, customize the variable @code{tooltip-mode}.
-@vindex tooltip-delay
- The variables @code{tooltip-delay} specifies how long Emacs should
-wait before displaying a tooltip. For additional customization
-options for displaying tooltips, use @kbd{M-x customize-group
-@key{RET} tooltip @key{RET}}.
+The following variables provide customization options for tooltip
+display:
+
+@vtable @code
+@item tooltip-delay
+This variable specifies how long Emacs should wait before displaying
+the first tooltip. The value is in seconds.
+
+@item tooltip-short-delay
+This variable specifies how long Emacs should wait before displaying
+subsequent tooltips on different items, having already displayed the
+first tooltip. The value is in seconds.
+
+@item tooltip-hide-delay
+The number of seconds since displaying a tooltip to hide it, if the
+mouse doesn't move.
+
+@item tooltip-x-offset
+@itemx tooltip-y-offset
+The X and Y offsets, in pixels, of the left top corner of the tooltip
+from the mouse pointer position. Note that these are ignored if
+@code{tooltip-frame-parameters} was customized to include,
+respectively, the @code{left} and @code{top} parameters. The values
+of the offsets should be chosen so that the tooltip doesn't cover the
+mouse pointer's hot spot, or it might interfere with clicking the
+mouse.
+
+@item tooltip-frame-parameters
+The frame parameters used for displaying tooltips. @xref{Frame
+Parameters,,, elisp, The Emacs Lisp Reference Manual}, and also
+@ref{Tooltips,,, elisp, The Emacs Lisp Reference Manual}.
+@end vtable
+
+For additional customization options for displaying tooltips, use
+@kbd{M-x customize-group @key{RET} tooltip @key{RET}}.
@vindex x-gtk-use-system-tooltips
If Emacs is built with GTK+ support, it displays tooltips via GTK+,
* Character Display:: How Emacs displays individual characters.
* Beeping:: Audible signal to the user.
* Window Systems:: Which window system is being used.
+* Tooltips:: Tooltip display in Emacs.
* Bidirectional Display:: Display of bidirectional scripts, such as
Arabic and Farsi.
@end menu
@code{display-graphic-p} or any of the other @code{display-*-p}
predicates described in @ref{Display Feature Testing}.
+@node Tooltips
+@section Tooltips
+@cindex tooltips
+@dfn{Tooltips} are special frames (@pxref{Frames}) that are used to
+display helpful hints (a.k.a.@: ``tips'') related to the current
+position of the mouse pointer. Emacs uses tooltips to display help
+strings about active portions of text (@pxref{Special Properties}) and
+about various UI elements, such as menu items (@pxref{Extended Menu
+Items}) and tool-bar buttons (@pxref{Tool Bar}).
+
+@defun tooltip-mode
+Tooltip Mode is a minor mode that enables display of tooltips.
+Turning off this mode causes the tooltips be displayed in the echo
+area. On text-mode (a.k.a.@: ``TTY'') frames, tooltips are always
+displayed in the echo area.
+@end defun
+
+@vindex x-gtk-use-system-tooltips
+When Emacs is built with GTK+ support, it by default displays tooltips
+using GTK+ functions, and the appearance of the tooltips is then
+controlled by GTK+ settings. GTK+ tooltips can be disabled by
+changing the value of the variable @code{x-gtk-use-system-tooltips} to
+@code{nil}. The rest of this subsection describes how to control
+non-GTK+ tooltips, which are presented by Emacs itself.
+
+Since tooltips are special frames, they have their frame parameters
+(@pxref{Frame Parameters}). Unlike other frames, the frame parameters
+for tooltips are stored in a special variable.
+
+@defvar tooltip-frame-parameters
+This customizable option holds the frame parameters used for
+displaying tooltips. Any font and color parameters are ignored, and
+the corresponding attributes of the @code{tooltip} face are used
+instead. If @code{left} or @code{top} parameters are included, they
+are used as absolute frame-relative coordinates where the tooltip
+should be shown. (Mouse-relative position of the tooltip can be
+customized using the variables described in @ref{Tooltips,,, emacs,
+The GNU Emacs Manual}.) Note that the @code{left} and @code{top}
+parameters, if present, override the values of mouse-relative offsets.
+@end defvar
+
+@vindex tooltip@r{ face}
+The @code{tooltip} face determines the appearance of text shown in
+tooltips. It should generally use a variable-pitch font of size that
+is preferably smaller than the default frame font.
+
+@findex tooltip-help-tips
+@defvar tooltip-functions
+This abnormal hook is a list of functions to call when Emacs needs to
+display a tooltip. Each function is called with a single argument
+@var{event} which is a copy of the last mouse movement event. If a
+function on this list actually displays the tooltip, it should return
+non-@code{nil}, and then the rest of the functions will not be
+called. The default value of this variable is a single function
+@code{tooltip-help-tips}.
+@end defvar
+
+If you write your own function to be put on the
+@code{tooltip-functions} list, you may need to know the buffer of the
+mouse event that triggered the tooltip display. The following
+function provides that information.
+
+@defun tooltip-event-buffer event
+This function returns the buffer over which @var{event} occurred.
+Call it with the argument of the function from
+@code{tooltip-functions} to obtain the buffer whose text triggered the
+tooltip. Note that the event might occur not over a buffer (e.g.,
+over the tool bar), in which case this function will return
+@code{nil}.
+@end defun
+
+Other aspects of tooltip display are controlled by several
+customizable settings; see @ref{Tooltips,,, emacs, The GNU Emacs
+Manual}.
+
@node Bidirectional Display
@section Bidirectional Display
@cindex bidirectional display
* Character Display:: How Emacs displays individual characters.
* Beeping:: Audible signal to the user.
* Window Systems:: Which window system is being used.
+* Tooltips:: Tooltip display in Emacs.
* Bidirectional Display:: Display of bidirectional scripts, such as
Arabic and Farsi.
@item help-echo
@kindex help-echo @r{(text property)}
-@cindex tooltip
+@cindex tooltip for help strings
@anchor{Text help-echo}
If text has a string as its @code{help-echo} property, then when you
move the mouse onto that text, Emacs displays that string in the echo
-area, or in the tooltip window (@pxref{Tooltips,,, emacs, The GNU Emacs
-Manual}).
+area, or in the tooltip window (@pxref{Tooltips}).
If the value of the @code{help-echo} property is a function, that
function is called with three arguments, @var{window}, @var{object} and
by adding @code{(add-hook 'shell-mode-hook
'ansi-color-for-comint-mode-on)} to your init file.
-In Emacs versions before 21.1, the @code{ansi-color} package is not
-included. In that case, you need to unalias @code{ls} for interactive
-shells running in Emacs; this can be done by checking the @code{EMACS}
-variable in the environment.
-
@node Fullscreen mode on MS-Windows
@section How can I start Emacs in fullscreen mode on MS-Windows?
@cindex Maximize frame
file:
@example
-if ($?EMACS) then
- if ("$EMACS" =~ /*) then
- if ($?tcsh) unset edit
- stty nl
- endif
+if ($?INSIDE_EMACS && $?tcsh)
+ unset edit
+ stty -icrnl -onlcr -echo susp ^Z
endif
@end example
@example
unset edit
-stty nl
+stty -icrnl -onlcr -echo susp ^Z
@end example
Alternatively, use @code{csh} in your shell buffers instead of
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
-\def\texinfoversion{2016-03-25.17}
+\def\texinfoversion{2016-03-29.15}
%
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
\fi
\turnoffactive
\makevalueexpandable
- % In the case of XeTeX, xdvipdfmx converts strings to UTF-16.
- % Therefore \txiescapepdf is not necessary.
+ \txiescapepdf\pdfdestname
\safewhatsit{\pdfdest name{\pdfdestname} xyz}%
}}
%
\fi
{
\turnoffactive
- % In the case of XeTeX, xdvipdfmx converts strings to UTF-16.
- % Therefore \txiescapepdf is not necessary.
- \special{pdf:out [-] #2 << /Title (#1) /A << /S /GoTo /D (name\pdfoutlinedest) >> >> }%
+ \txiescapepdf\pdfoutlinedest
+ \edef\pdfoutlinetext{#1}%
+ \txiescapepdf\pdfoutlinetext
+ %
+ \special{pdf:out [-] #2 << /Title (\pdfoutlinetext) /A
+ << /S /GoTo /D (name\pdfoutlinedest) >> >> }%
}
}
%
% ``\special{pdf:dest ...}'' can not handle non-ASCII strings.
% It fixed by xdvipdfmx 20160106 (TeX Live SVN r39753).
%
+ \def\skipspaces#1{\def\PP{#1}\def\D{|}%
+ \ifx\PP\D\let\nextsp\relax
+ \else\let\nextsp\skipspaces
+ \addtokens{\filename}{\PP}%
+ \advance\filenamelength by 1
+ \fi
+ \nextsp}
+ \def\getfilename#1{%
+ \filenamelength=0
+ % If we don't expand the argument now, \skipspaces will get
+ % snagged on things like "@value{foo}".
+ \edef\temp{#1}%
+ \expandafter\skipspaces\temp|\relax
+ }
% make a live url in pdf output.
\def\pdfurl#1{%
\begingroup
%
% Make link in pdf output.
\ifpdf
+ % For pdfTeX and LuaTeX
{\indexnofonts
\turnoffactive
\makevalueexpandable
\fi
}%
\setcolor{\linkcolor}%
+ \else
+ \ifx\XeTeXrevision\thisisundefined
+ \else
+ % For XeTeX
+ {\indexnofonts
+ \turnoffactive
+ \makevalueexpandable
+ % This expands tokens, so do it after making catcode changes, so _
+ % etc. don't get their TeX definitions. This ignores all spaces in
+ % #4, including (wrongly) those in the middle of the filename.
+ \getfilename{#4}%
+ %
+ % This (wrongly) does not take account of leading or trailing
+ % spaces in #1, which should be ignored.
+ \iftxiuseunicodedestname
+ \def\pdfxrefdest{#1}% Pass through Unicode characters.
+ \else
+ \edef\pdfxrefdest{#1}% Replace Unicode characters to ASCII.
+ \fi
+ \ifx\pdfxrefdest\empty
+ \def\pdfxrefdest{Top}% no empty targets
+ \else
+ \txiescapepdf\pdfxrefdest % escape PDF special chars
+ \fi
+ %
+ \leavevmode
+ \ifnum\filenamelength>0
+ % By the default settings,
+ % XeTeX (xdvipdfmx) replaces link destination names with integers.
+ % In this case, the replaced destination names of
+ % remote PDF cannot be known. In order to avoid replacement,
+ % you can use commandline option `-C 0x0010' for xdvipdfmx.
+ \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A
+ << /S /GoToR /F (\the\filename.pdf) /D (name\pdfxrefdest) >> >>}%
+ \else
+ \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A
+ << /S /GoTo /D (name\pdfxrefdest) >> >>}%
+ \fi
+ }%
+ \setcolor{\linkcolor}%
+ \fi
\fi
{%
% Have to otherify everything special to allow the \csname to
the color range from 'vc-annotate-color-map' is applied to the
background or to the foreground.
+---
+*** New options for customizing encoding of Git commit log messages.
+The new options `vc-git-commits-coding-system' and
+`vc-git-log-output-coding-system' allow to customize the encoding of
+the log messages sent to Git when committing, and the decoding of the
+log messages read from Git history commands. Both default to UTF-8;
+if you customize them, make sure they are consistent with the Git
+config variables i18n.commitEncoding and i18n.logOutputEncoding.
+(`vc-git-commits-coding-system' existed previously, but was a
+variable, not a user option.)
+
+++
*** 'compare-windows' now compares text with the most recently selected window
instead of the next window. If you want the previous behavior of
*** As a consequence, the second arg of 'indirect-function' is now obsolete.
+++
-** Although comint, term, and compile still set the EMACS variable,
-this is now considered deprecated and will be removed in a future release.
+** M-x shell and M-x compile no longer set the EMACS environment variable.
+This avoids clashing when other programs use the variable for other purposes.
+Although M-x term still sets EMACS for compatibility with Bash 4.3 and earlier,
+this is deprecated and will be phased out when Bash 4.4 or later takes over.
Use the INSIDE_EMACS environment variable instead.
** 'C-up', 'C-down', 'C-left' and 'C-right' are now defined in term
argument, has been extended to accept all the new forms.
*** Incompatible change in the third argument of 'format-time-string'.
-Previously, any non-nil argument was interpeted as specifying Universal Time.
+Previously, any non-nil argument was interpreted as specifying Universal Time.
This is no longer true; packages that want Universal Time should pass t
as the third argument.
on the flag to output ^M at the end of each line. You can fix the
problem by adding this to your .cshrc file:
- if ($?EMACS) then
- if ("$EMACS" =~ /*) then
- unset edit
- stty -icrnl -onlcr -echo susp ^Z
- endif
+ if ($?INSIDE_EMACS && $?tcsh)
+ unset edit
+ stty -icrnl -onlcr -echo susp ^Z
endif
*** Emacs startup on GNU/Linux systems (and possibly other systems) is slow.
picky compilers. */
#define _STDINT_MIN(signed, bits, zero) \
- ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero))
+ ((signed) ? ~ _STDINT_MAX (signed, bits, zero) : (zero))
#define _STDINT_MAX(signed, bits, zero) \
- ((signed) \
- ? ~ _STDINT_MIN (signed, bits, zero) \
- : /* The expression for the unsigned case. The subtraction of (signed) \
- is a nop in the unsigned case and avoids "signed integer overflow" \
- warnings in the signed case. */ \
- ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
+ (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
#if !GNULIB_defined_stdint_types
* epa.el (epa-passphrase-callback-function): Say what we're
querying the password for.
- * ibuffer.el (ibuffer-visit-buffer): To mimick list-buffers
+ * ibuffer.el (ibuffer-visit-buffer): To mimic list-buffers
behavior, don't bury the ibuffer buffer when visiting other buffers.
2010-10-08 Chong Yidong <cyd@stupidchicken.com>
(format "COLUMNS=%d" (window-width)))
(list "TERM=emacs"
(format "TERMCAP=emacs:co#%d:tc=unknown:" (window-width))))
-
- ;; This hack is for backward compatibility with Bash 4.3 and
- ;; earlier. It can break common uses of 'configure', so
- ;; remove it once Bash 4.4 or later is common.
- (unless (getenv "EMACS")
- (list "EMACS=t"))
-
(list (format "INSIDE_EMACS=%s,comint" emacs-version))
process-environment))
(default-directory
lisp-el-font-lock-keywords-1
`( ;; Regexp negated char group.
("\\[\\(\\^\\)" 1 font-lock-negation-char-face prepend)
+ ;; Erroneous structures.
+ (,(concat "(" el-errs-re "\\_>")
+ (1 font-lock-warning-face))
;; Control structures. Common Lisp forms.
(lisp--el-match-keyword . 1)
;; Exit/Feature symbols as constants.
"[ \t']*\\(" lisp-mode-symbol-regexp "\\)?")
(1 font-lock-keyword-face)
(2 font-lock-constant-face nil t))
- ;; Erroneous structures.
- (,(concat "(" el-errs-re "\\_>")
- (1 font-lock-warning-face prepend))
;; Words inside \\[] tend to be for `substitute-command-keys'.
(,(concat "\\\\\\\\\\[\\(" lisp-mode-symbol-regexp "\\)\\]")
(1 font-lock-constant-face prepend))
(eval-when-compile (require 'subr-x))
(eval-when-compile (require 'cl-lib))
(eval-when-compile (require 'epg)) ;For setf accessors.
+(require 'seq)
(require 'tabulated-list)
(require 'macroexp)
text-scale-mode-amount))))
(force-window-update (current-buffer)))
+(defun text-scale-min-amount ()
+ "Return the minimum amount of text-scaling we allow."
+ ;; When the resulting pixel-height of characters will become smaller
+ ;; than 1 pixel, we can expect trouble from the display engine.
+ ;; E.g., it requires that the character glyph's ascent is
+ ;; non-negative.
+ (log (/ 1.0 (frame-char-height)) text-scale-mode-step))
+
+(defun text-scale-max-amount ()
+ "Return the maximum amount of text-scaling we allow."
+ ;; The display engine uses a 16-bit short for pixel-width of
+ ;; characters, thus the 0xffff limitation. It also makes no sense
+ ;; to have characters wider than the display.
+ (log (/ (min (display-pixel-width) #xffff)
+ (frame-char-width))
+ text-scale-mode-step))
+
;;;###autoload
(defun text-scale-set (level)
"Set the scale factor of the default face in the current buffer to LEVEL.
`text-scale-mode-step' (a negative number decreases the height by
the same amount)."
(interactive "p")
- (setq text-scale-mode-amount level)
+ (setq text-scale-mode-amount
+ (max (min level (text-scale-max-amount)) (text-scale-min-amount)))
(text-scale-mode (if (zerop text-scale-mode-amount) -1 1)))
;;;###autoload
height by the same amount). As a special case, an argument of 0
will remove any scaling currently active."
(interactive "p")
- (setq text-scale-mode-amount
- (if (= inc 0) 0 (+ (if text-scale-mode text-scale-mode-amount 0) inc)))
+ (let* ((current-value (if text-scale-mode text-scale-mode-amount 0))
+ (new-value (if (= inc 0) 0 (+ current-value inc))))
+ (if (or (> new-value (text-scale-max-amount))
+ (< new-value (text-scale-min-amount)))
+ (user-error "Cannot %s the default face height more than it already is"
+ (if (> inc 0) "increase" "decrease")))
+ (setq text-scale-mode-amount new-value))
(text-scale-mode (if (zerop text-scale-mode-amount) -1 1)))
;;;###autoload
(defun ffap-guess-file-name-at-point ()
"Try to get a file name at point.
This hook is intended to be put in `file-name-at-point-functions'."
- (let ((guess (ffap-guesser)))
+ ;; ffap-guesser can signal an error, and we don't want that when,
+ ;; e.g., the user types M-n at the "C-x C-f" prompt.
+ (let ((guess (ignore-errors (ffap-guesser))))
(when (stringp guess)
(let ((url (ffap-url-p guess)))
(or url
(defcustom tramp-remote-process-environment
`("TMOUT=0" "LC_CTYPE=''"
,(format "TERM=%s" tramp-terminal-type)
- "EMACS=t" ;; Deprecated; remove this line once Bash 4.4-or-later is common.
,(format "INSIDE_EMACS='%s,tramp:%s'" emacs-version tramp-version)
"CDPATH=" "HISTORY=" "MAIL=" "MAILCHECK=" "MAILPATH=" "PAGER=cat"
"autocorrect=" "correct=")
(setq begin (point))
(while (and (<= (point) end)
(not (looking-at "\\W*\\'")))
- (forward-word 1)
- (backward-word 1)
+ (forward-word-strictly 1)
+ (backward-word-strictly 1)
(setq begin (max (point) begin))
- (forward-word 1)
+ (forward-word-strictly 1)
(let ((offset 0)
(word-end (min (point) end))
c)
"Studlify-case the current word, or COUNT words if given an argument."
(interactive "*p")
(let ((begin (point)) end rb re)
- (forward-word count)
+ (forward-word-strictly count)
(setq end (point))
(setq rb (min begin end) re (max begin end))
(studlify-region rb re)))
(list "TERM=emacs"
(format "TERMCAP=emacs:co#%d:tc=unknown:"
(window-width))))
-
- ;; Set the EMACS variable, but
- ;; don't override users' setting of $EMACS.
- ;; Remove this hack once Bash 4.4-or-later is common,
- ;; since it can break 'configure'.
- (unless (getenv "EMACS")
- (list "EMACS=t"))
-
(list (format "INSIDE_EMACS=%s,compile" emacs-version))
(copy-sequence process-environment))))
(set (make-local-variable 'compilation-arguments)
This gets tacked on the end of the generated expressions.")
;;;###autoload
-(defvar grep-program (purecopy "grep")
+(defcustom grep-program (purecopy "grep")
"The default grep program for `grep-command' and `grep-find-command'.
-This variable's value takes effect when `grep-compute-defaults' is called.")
+This variable's value takes effect when `grep-compute-defaults' is called."
+ :type 'string
+ :version "25.1"
+ :group 'grep)
;;;###autoload
-(defvar find-program (purecopy "find")
+(defcustom grep-find-program (purecopy "find")
"The default find program.
This is used by commands like `grep-find-command', `find-dired'
-and others.")
+and others."
+ :type 'string
+ :version "25.1"
+ :group 'grep)
+
+(define-obsolete-variable-alias 'find-program 'grep-find-program "25.1")
;;;###autoload
-(defvar xargs-program (purecopy "xargs")
+(defcustom grep-xargs-program (purecopy "xargs")
"The default xargs program for `grep-find-command'.
See `grep-find-use-xargs'.
-This variable's value takes effect when `grep-compute-defaults' is called.")
+This variable's value takes effect when `grep-compute-defaults' is called."
+ :type 'string
+ :version "25.1"
+ :group 'grep)
+
+(define-obsolete-variable-alias 'xargs-program 'grep-xargs-program "25.1")
;;;###autoload
(defvar grep-find-use-xargs nil
(unless grep-find-use-xargs
(setq grep-find-use-xargs
(cond
- ((grep-probe find-program
+ ((grep-probe grep-find-program
`(nil nil nil ,null-device "-exec" "echo"
"{}" "+"))
'exec-plus)
((and
- (grep-probe find-program `(nil nil nil ,null-device "-print0"))
- (grep-probe xargs-program `(nil nil nil "-0" "echo")))
+ (grep-probe grep-find-program
+ `(nil nil nil ,null-device "-print0"))
+ (grep-probe grep-xargs-program `(nil nil nil "-0" "echo")))
'gnu)
(t
'exec))))
;; after the pipe symbol be quoted if they use
;; forward slashes as directory separators.
(format "%s . -type f -print0 | \"%s\" -0 %s"
- find-program xargs-program grep-command))
+ grep-find-program grep-xargs-program
+ grep-command))
((memq grep-find-use-xargs '(exec exec-plus))
(let ((cmd0 (format "%s . -type f -exec %s"
- find-program grep-command))
+ grep-find-program grep-command))
(null (if grep-use-null-device
(format "%s " null-device)
"")))
(1+ (length cmd0)))))
(t
(format "%s . -type f -print | \"%s\" %s"
- find-program xargs-program grep-command)))))
+ grep-find-program grep-xargs-program
+ grep-command)))))
(unless grep-find-template
(setq grep-find-template
(let ((gcmd (format "%s <C> %s <R>"
"")))
(cond ((eq grep-find-use-xargs 'gnu)
(format "%s <D> <X> -type f <F> -print0 | \"%s\" -0 %s"
- find-program xargs-program gcmd))
+ grep-find-program grep-xargs-program gcmd))
((eq grep-find-use-xargs 'exec)
(format "%s <D> <X> -type f <F> -exec %s {} %s%s"
- find-program gcmd null
+ grep-find-program gcmd null
(shell-quote-argument ";")))
((eq grep-find-use-xargs 'exec-plus)
(format "%s <D> <X> -type f <F> -exec %s %s{} +"
- find-program gcmd null))
+ grep-find-program gcmd null))
(t
(format "%s <D> <X> -type f <F> -print | \"%s\" %s"
- find-program xargs-program gcmd))))))))
+ grep-find-program grep-xargs-program gcmd))))))))
;; Save defaults for this host.
(setq grep-host-defaults-alist
()
(with-current-buffer (get-buffer-create "*prolog*")
(prolog-inferior-mode)
- (apply 'make-comint-in-buffer "prolog" (current-buffer)
- (prolog-program-name) nil (prolog-program-switches))
+
+ ;; The "INFERIOR=yes" hack is for SWI-Prolog 7.2.3 and earlier,
+ ;; which assumes it is running under Emacs if either INFERIOR=yes or
+ ;; if EMACS is set to a nonempty value. The EMACS setting is
+ ;; obsolescent, so set INFERIOR. Newer versions of SWI-Prolog should
+ ;; know about INSIDE_EMACS (which replaced EMACS) and should not need
+ ;; this hack.
+ (let ((process-environment
+ (if (getenv "INFERIOR")
+ process-environment
+ (cons "INFERIOR=yes" process-environment))))
+ (apply 'make-comint-in-buffer "prolog" (current-buffer)
+ (prolog-program-name) nil (prolog-program-switches)))
+
(unless prolog-system
;; Setup auto-detection.
(setq-local
(defun rectangle--space-to (col)
(propertize " " 'display `(space :align-to ,col)))
-(defface rectangle-preview-face '((t :inherit region))
- "The face to use for the `string-rectangle' preview.")
+(defface rectangle-preview '((t :inherit region))
+ "The face to use for the `string-rectangle' preview."
+ :version "25.1")
(defcustom rectangle-preview t
"If non-nil, `string-rectangle' will show an-the-fly preview."
(aref keys 1)
key)))
(cancel-timer timer)
+ ;; For some reason, `read-key(-sequence)' leaves the prompt in the echo
+ ;; area, whereas `read-event' seems to empty it just before returning
+ ;; (bug#22714). So, let's mimic the behavior of `read-event'.
+ (message nil)
(use-global-map old-global-map))))
(defvar read-passwd-map
(defmacro with-eval-after-load (file &rest body)
"Execute BODY after FILE is loaded.
FILE is normally a feature name, but it can also be a file name,
-in case that file does not provide any feature."
+in case that file does not provide any feature. See `eval-after-load'
+for more details about the different forms of FILE and their semantics."
(declare (indent 1) (debug t))
`(eval-after-load ,file (lambda () ,@body)))
:type '(list string string (repeat sexp))
:version "24.1")
-(defvar vc-git-commits-coding-system 'utf-8
- "Default coding system for git commits.")
+(defcustom vc-git-commits-coding-system 'utf-8
+ "Default coding system for sending commit log messages to Git.
+
+Should be consistent with the Git config value i18n.commitEncoding,
+and should also be consistent with `locale-coding-system'."
+ :type '(coding-system :tag "Coding system to encode Git commit logs")
+ :version "25.1")
+
+(defcustom vc-git-log-output-coding-system 'utf-8
+ "Default coding system for receiving log output from Git.
+
+Should be consistent with the Git config value i18n.logOutputEncoding."
+ :type '(coding-system :tag "Coding system to decode Git log output")
+ :version "25.1")
;; History of Git commands.
(defvar vc-git-history nil)
(default-directory (expand-file-name root))
(only (or (cdr files)
(not (equal root (abbreviate-file-name file1)))))
- (coding-system-for-write vc-git-commits-coding-system))
+ (pcsw coding-system-for-write)
+ (coding-system-for-write
+ ;; On MS-Windows, we must encode command-line arguments in
+ ;; the system codepage.
+ (if (eq system-type 'windows-nt)
+ locale-coding-system
+ (or coding-system-for-write vc-git-commits-coding-system)))
+ (msg-file
+ ;; On MS-Windows, pass the commit log message through a
+ ;; file, to work around the limitation that command-line
+ ;; arguments must be in the system codepage, and therefore
+ ;; might not support the non-ASCII characters in the log
+ ;; message.
+ (if (eq system-type 'windows-nt) (make-temp-file "git-msg"))))
(cl-flet ((boolean-arg-fn
(argument)
(lambda (value) (when (equal value "yes") (list argument)))))
;; When operating on the whole tree, better pass "-a" than ".", since "."
;; fails when we're committing a merge.
(apply 'vc-git-command nil 0 (if only files)
- (nconc (list "commit" "-m")
- (log-edit-extract-headers
- `(("Author" . "--author")
- ("Date" . "--date")
- ("Amend" . ,(boolean-arg-fn "--amend"))
- ("Sign-Off" . ,(boolean-arg-fn "--signoff")))
- comment)
- (if only (list "--only" "--") '("-a")))))))
+ (nconc (if msg-file (list "commit" "-F" msg-file)
+ (list "commit" "-m"))
+ (let ((args
+ (log-edit-extract-headers
+ `(("Author" . "--author")
+ ("Date" . "--date")
+ ("Amend" . ,(boolean-arg-fn "--amend"))
+ ("Sign-Off" . ,(boolean-arg-fn "--signoff")))
+ comment)))
+ (when msg-file
+ (let ((coding-system-for-write
+ (or pcsw vc-git-commits-coding-system)))
+ (write-region (car args) nil msg-file))
+ (setq args (cdr args)))
+ args)
+ (if only (list "--only" "--") '("-a")))))
+ (if (and msg-file (file-exists-p msg-file)) (delete-file msg-file))))
(defun vc-git-find-revision (file rev buffer)
(let* (process-file-side-effects
If START-REVISION is non-nil, it is the newest revision to show.
If LIMIT is non-nil, show no more than this many entries."
(let ((coding-system-for-read
- (or coding-system-for-read vc-git-commits-coding-system)))
+ (or coding-system-for-read vc-git-log-output-coding-system)))
;; `vc-do-command' creates the buffer, but we need it before running
;; the command.
(vc-setup-buffer buffer)
The difference to vc-do-command is that this function always invokes
`vc-git-program'."
(let ((coding-system-for-read
- (or coding-system-for-read vc-git-commits-coding-system))
+ (or coding-system-for-read vc-git-log-output-coding-system))
(coding-system-for-write
(or coding-system-for-write vc-git-commits-coding-system)))
(apply 'vc-do-command (or buffer "*vc*") okstatus vc-git-program
;; directories. We enable `inhibit-null-byte-detection', otherwise
;; Tramp's eol conversion might be confused.
(let ((inhibit-null-byte-detection t)
- (coding-system-for-read vc-git-commits-coding-system)
- (coding-system-for-write vc-git-commits-coding-system)
+ (coding-system-for-read
+ (or coding-system-for-read vc-git-log-output-coding-system))
+ (coding-system-for-write
+ (or coding-system-for-write vc-git-commits-coding-system))
(process-environment (cons "PAGER=" process-environment)))
(apply 'process-file vc-git-program nil buffer nil command args)))
:group 'mode-line
:version "25.1")
-(defface vc-state-base-face
+(defface vc-state-base
'((default))
"Base face for VC state indicator."
:group 'vc-faces
:version "25.1")
(defface vc-up-to-date-state
- '((default :inherit vc-state-base-face))
+ '((default :inherit vc-state-base))
"Face for VC modeline state when the file is up to date."
:version "25.1"
:group 'vc-faces)
(defface vc-needs-update-state
- '((default :inherit vc-state-base-face))
+ '((default :inherit vc-state-base))
"Face for VC modeline state when the file needs update."
:version "25.1"
:group 'vc-faces)
(defface vc-locked-state
- '((default :inherit vc-state-base-face))
+ '((default :inherit vc-state-base))
"Face for VC modeline state when the file locked."
:version "25.1"
:group 'vc-faces)
(defface vc-locally-added-state
- '((default :inherit vc-state-base-face))
+ '((default :inherit vc-state-base))
"Face for VC modeline state when the file is locally added."
:version "25.1"
:group 'vc-faces)
(defface vc-conflict-state
- '((default :inherit vc-state-base-face))
+ '((default :inherit vc-state-base))
"Face for VC modeline state when the file contains merge conflicts."
:version "25.1"
:group 'vc-faces)
(defface vc-removed-state
- '((default :inherit vc-state-base-face))
+ '((default :inherit vc-state-base))
"Face for VC modeline state when the file was removed from the VC system."
:version "25.1"
:group 'vc-faces)
(defface vc-missing-state
- '((default :inherit vc-state-base-face))
+ '((default :inherit vc-state-base))
"Face for VC modeline state when the file is missing from the file system."
:version "25.1"
:group 'vc-faces)
(defface vc-edited-state
- '((default :inherit vc-state-base-face))
+ '((default :inherit vc-state-base))
"Face for VC modeline state when the file is edited."
:version "25.1"
:group 'vc-faces)
(wait_reading_process_output, init_process_emacs):
Assume O_NONBLOCK.
(wait_reading_process_output): Put in a special case for WINDOWSNT
- to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
+ to mimic the older behavior where it had O_NDELAY but not O_NONBLOCK.
It's not clear this is needed, but it's a more-conservative change.
(create_process): Assume FD_CLOEXEC.
(create_process, create_pty): Assume O_NOCTTY.
@try
{
+ /* It seems OS X should probably use UTF-8 everywhere.
+ 'localeIdentifier' does not specify the encoding, and I can't
+ find any way to get the OS to tell us which encoding to use,
+ so hard-code '.UTF-8'. */
+ NSString *localeID = [NSString stringWithFormat:@"%@.UTF-8",
+ [locale localeIdentifier]];
+
/* Set LANG to locale, but not if LANG is already set. */
- setenv("LANG", [[locale localeIdentifier] UTF8String], 0);
+ setenv("LANG", [localeID UTF8String], 0);
}
@catch (NSException *e)
{
#include <stdio.h>
#include <fcntl.h>
#include <stdarg.h>
+#include <stdint.h>
#include <sys/types.h>
#include <unistd.h>
#include <mach/mach.h>
+#include <mach/vm_map.h>
#include <mach-o/loader.h>
#include <mach-o/reloc.h>
#ifdef HAVE_MALLOC_MALLOC_H
static int
unexec_write (off_t dest, const void *src, size_t count)
{
+ task_t task = mach_task_self();
+ if (task == MACH_PORT_NULL || task == MACH_PORT_DEAD)
+ return false;
+
if (lseek (outfd, dest, SEEK_SET) != dest)
return 0;
- return write (outfd, src, count) == count;
+ /* We use the Mach virtual memory API to read our process memory
+ because using src directly would be undefined behavior and fails
+ under Address Sanitizer. */
+ bool success = false;
+ vm_offset_t data;
+ mach_msg_type_number_t data_count;
+ if (vm_read (task, (uintptr_t) src, count, &data, &data_count)
+ == KERN_SUCCESS)
+ {
+ success =
+ write (outfd, (const void *) (uintptr_t) data, data_count) == count;
+ vm_deallocate (task, data, data_count);
+ }
+ return success;
}
/* Write COUNT bytes of zeros to outfd starting at offset DEST.
Changing the value does not change the session id used by Emacs.
The value is nil if no session manager is running.
See also `x-session-previous-id', `emacs-save-session-functions',
-`emacs-session-save' and `emacs-session-restore'." */);
+`emacs-session-save' and `emacs-session-restore'. */);
Vx_session_id = Qnil;
DEFVAR_LISP ("x-session-previous-id", Vx_session_previous_id,
same, depending on how the session manager works.
See also `emacs-save-session-functions', `emacs-session-save' and
-`emacs-session-restore'." */);
+`emacs-session-restore'. */);
Vx_session_previous_id = Qnil;
defsubr (&Shandle_save_session);
other time to know things like window placement etc. */
xv = xwidget_init_view (xww, s, x, y);
- /* Calculate clipping, which is used for all manner of onscreen
- xwidget views. Each widget border can get clipped by other emacs
- objects so there are four clipping variables. */
- clip_right =
- min (xww->width,
- WINDOW_RIGHT_EDGE_X (s->w) - x -
- WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH (s->w) -
- WINDOW_RIGHT_FRINGE_WIDTH (s->w));
- clip_left =
- max (0,
- WINDOW_LEFT_EDGE_X (s->w) - x +
- WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (s->w) +
- WINDOW_LEFT_FRINGE_WIDTH (s->w));
-
- clip_bottom =
- min (xww->height,
- WINDOW_BOTTOM_EDGE_Y (s->w) - WINDOW_MODE_LINE_HEIGHT (s->w) - y);
- clip_top = max (0, WINDOW_TOP_EDGE_Y (s->w) - y);
+ int text_area_x, text_area_y, text_area_width, text_area_height;
+
+ window_box (s->w,
+ ANY_AREA,
+ &text_area_x,
+ &text_area_y,
+ &text_area_width,
+ &text_area_height);
+ clip_right = min (xww->width,
+ text_area_width);
+ clip_left = max (0,
+ text_area_x);
+
+ clip_bottom = min (xww->height,
+ text_area_height);
+ clip_top = max (0, text_area_y);
/* We are concerned with movement of the onscreen area. The area
might sit still when the widget actually moves. This happens