merge trunk

This commit is contained in:
Kenichi Handa 2013-09-08 21:17:12 +09:00
commit 3aff2f57cc
39 changed files with 789 additions and 632 deletions

View file

@ -1,3 +1,12 @@
2013-09-07 Paul Eggert <eggert@cs.ucla.edu>
Port --without-x --enable-gcc-warnings to Fedora 19.
* configure.ac (WERROR_CFLAGS): Omit redundant use of
-Wmissing-field-initializers, -Wswitch, -Wtype-limits,
-Wunused-parameter. If there is no window system, also omit
-Wsuggest-attribute=const and -Wsuggest-attribute=noreturn; this
is needed for Fedora 19.
2013-09-05 Dmitry Antipov <dmantipov@yandex.ru>
Make --without-x compatible with --enable-gcc-warnings.

26
autogen/configure vendored
View file

@ -7656,6 +7656,13 @@ fi
# The following line should be removable at some point.
nw="$nw -Wsuggest-attribute=pure"
# This part is merely for shortening the command line,
# since -Wno-FOO needs to be added below regardless.
nw="$nw -Wmissing-field-initializers"
nw="$nw -Wswitch"
nw="$nw -Wtype-limits"
nw="$nw -Wunused-parameter"
# clang is unduly picky about some things.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is clang" >&5
$as_echo_n "checking whether the compiler is clang... " >&6; }
@ -10342,6 +10349,25 @@ fi
if test "$window_system" = none && test "$gl_gcc_warnings" = yes; then
# Too many warnings for now.
nw=
nw="$nw -Wsuggest-attribute=const"
nw="$nw -Wsuggest-attribute=noreturn"
gl_warn_set=
set x $WARN_CFLAGS; shift
for gl_warn_item
do
case " $nw " in
*" $gl_warn_item "*)
;;
*)
gl_warn_set="$gl_warn_set $gl_warn_item"
;;
esac
done
WARN_CFLAGS=$gl_warn_set
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-unused-variable" >&5
$as_echo_n "checking whether C compiler handles -Wno-unused-variable... " >&6; }

View file

@ -826,6 +826,13 @@ else
# The following line should be removable at some point.
nw="$nw -Wsuggest-attribute=pure"
# This part is merely for shortening the command line,
# since -Wno-FOO needs to be added below regardless.
nw="$nw -Wmissing-field-initializers"
nw="$nw -Wswitch"
nw="$nw -Wtype-limits"
nw="$nw -Wunused-parameter"
# clang is unduly picky about some things.
AC_CACHE_CHECK([whether the compiler is clang], [emacs_cv_clang],
[AC_COMPILE_IFELSE(
@ -1777,6 +1784,11 @@ fi
if test "$window_system" = none && test "$gl_gcc_warnings" = yes; then
# Too many warnings for now.
nw=
nw="$nw -Wsuggest-attribute=const"
nw="$nw -Wsuggest-attribute=noreturn"
gl_MANYWARN_COMPLEMENT([WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
gl_WARN_ADD([-Wno-unused-variable])
gl_WARN_ADD([-Wno-unused-but-set-variable])
gl_WARN_ADD([-Wno-unused-but-set-parameter])

View file

@ -1,3 +1,7 @@
2013-09-06 Michael Albinus <michael.albinus@gmx.de>
* tramp.texi (Alternative Syntax): Remove chapter.
2013-08-28 Paul Eggert <eggert@cs.ucla.edu>
* Makefile.in (SHELL): Now @SHELL@, not /bin/sh,

View file

@ -225,7 +225,6 @@ Configuring @value{tramp} for use
Using @value{tramp}
* Filename Syntax:: @value{tramp} filename conventions.
* Alternative Syntax:: URL-like filename syntax.
* Filename completion:: Filename completion.
* Ad-hoc multi-hops:: Declaring multiple hops in the file name.
* Remote processes:: Integration with other @value{emacsname} packages.
@ -2356,7 +2355,6 @@ minute you have already forgotten that you hit that key!
@menu
* Filename Syntax:: @value{tramp} filename conventions.
* Alternative Syntax:: URL-like filename syntax.
* Filename completion:: Filename completion.
* Ad-hoc multi-hops:: Declaring multiple hops in the file name.
* Remote processes:: Integration with other @value{emacsname} packages.
@ -2453,46 +2451,6 @@ by adding @file{#<port>} to the host name, like in @file{@trampfn{ssh,
daniel, melancholia#42, .emacs}}.
@node Alternative Syntax
@section URL-like filename syntax
@cindex filename syntax
@cindex filename examples
Additionally to the syntax described in the previous chapter, it is
possible to use a URL-like syntax for @value{tramp}. This can be
switched on by customizing the variable @code{tramp-syntax}. Please
note that this feature is experimental for the time being.
The variable @code{tramp-syntax} must be set before requiring @value{tramp}:
@lisp
(setq tramp-syntax 'url)
(require 'tramp)
@end lisp
Then, a @value{tramp} filename would look like this:
@file{/@var{method}://@var{user}@@@var{machine}:@var{port}/@var{path/to.file}}.
@file{/@var{method}://} is mandatory, all other parts are optional.
@file{:@var{port}} is useful for methods only who support this.
The last example from the previous section would look like this:
@file{/ssh://daniel@@melancholia/.emacs}.
For the time being, @code{tramp-syntax} can have the following values:
@itemize @w{}
@ifset emacs
@item @code{ftp}---That is the default syntax
@item @code{url}---URL-like syntax
@end ifset
@ifset xemacs
@item @code{sep}---That is the default syntax
@item @code{url}---URL-like syntax
@item @code{ftp}---EFS-like syntax
@end ifset
@end itemize
@node Filename completion
@section Filename completion
@cindex filename completion

View file

@ -332,6 +332,10 @@ This is useful to avoid a query when you have no key for that name.
*** key bindings to navigate through and select the completions.
*** The icomplete-separator is customizable, and its default has changed.
*** Removed icomplete-show-key-bindings.
*** Icomplete-mode by defaults applies to all forms of minibuffer completion.
(setq icomplete-with-completion-tables '(internal-complete-buffer))
will revert to the old behavior.
** Ido
*** Ido has a manual now.
@ -461,6 +465,8 @@ todo-mode.el has been made obsolete and renamed otodo-mode.el.
** Tramp
*** The experimental url syntax for remote file names is withdrawn.
+++
*** New connection method "adb", which allows to access Android
devices by the Android Debug Bridge. The variable `tramp-adb-program'
@ -754,6 +760,11 @@ used in place of the 9th element of `file-attributes'.
`preserve-extended-attributes' as it now handles both SELinux context
and ACL entries.
** The `common-substring' argument of display-completion-list is obsolete.
Either use `completion-all-completions' which already returns highlighted
strings (including for partial or substring completion) or call
`completion-hilit-commonality' to add the highlight.
** Changes to the Emacs Lisp Coding Conventions in Emacs 24.4
*** The package descriptor and name of global variables, constants,

View file

@ -3,6 +3,121 @@
* international/characters.el: Set category "^" (Combining) for
more characters.
2013-09-07 Alan Mackenzie <acm@muc.de>
Correctly fontify Java class constructors.
* progmodes/cc-langs.el (c-type-decl-suffix-key): Now matches ")"
in Java Mode.
(c-recognize-typeless-decls): Set the Java value to t.
* progmodes/cc-engine.el (c-forward-decl-or-cast-1): While
handling a "(", add a check for, effectively, Java, and handle a
"typeless" declaration there.
2013-09-07 Roland Winkler <winkler@gnu.org>
* textmodes/bibtex.el (bibtex-biblatex-entry-alist): Add optional
field subtitle for entry type book.
2013-09-06 Stefan Monnier <monnier@iro.umontreal.ca>
* minibuffer.el: Make minibuffer-complete call completion-in-region
rather than other way around.
(completion--some, completion-pcm--find-all-completions):
Don't delay signals when debugging.
(minibuffer-completion-contents): Beware fields within the
minibuffer contents.
(completion-all-sorted-completions): Use defvar-local.
(completion--do-completion, completion--cache-all-sorted-completions)
(completion-all-sorted-completions, minibuffer-force-complete):
Add args `beg' and `end'.
(completion--in-region-1): New fun, extracted from minibuffer-complete.
(minibuffer-complete): Use completion-in-region.
(completion-complete-and-exit): New fun, extracted from
minibuffer-complete-and-exit.
(minibuffer-complete-and-exit): Use it.
(completion--complete-and-exit): Rename from
minibuffer--complete-and-exit.
(completion-in-region--single-word): New function, extracted from
minibuffer-complete-word.
(minibuffer-complete-word): Use it.
(display-completion-list): Make `common-substring' argument obsolete.
(completion--in-region): Call completion--in-region-1 instead of
minibuffer-complete.
(completion-help-at-point): Pass boundaries to
minibuffer-completion-help as args rather than via an overlay.
(completion-pcm--string->pattern): Use `any-delim'.
(completion-pcm--optimize-pattern): New function.
(completion-pcm--pattern->regex): Handle `any-delim'.
* icomplete.el (icomplete-forward-completions)
(icomplete-backward-completions, icomplete-completions):
Adjust calls to completion-all-sorted-completions and
completion--cache-all-sorted-completions.
(icomplete-with-completion-tables): Default to t.
* emacs-lisp/crm.el (crm--current-element): Rename from
crm--select-current-element. Don't put an overlay but return the
boundaries instead.
(crm--completion-command): Take two new args to bind to the boundaries.
(crm-completion-help): Adjust accordingly.
(crm-complete): Use completion-in-region.
(crm-complete-word): Use completion-in-region--single-word.
(crm-complete-and-exit): Use completion-complete-and-exit.
2013-09-06 Stefan Monnier <monnier@iro.umontreal.ca>
* dired-x.el (dired-mark-sexp): Bind the vars lexically rather
than dynamically.
2013-09-06 Juri Linkov <juri@jurta.org>
* info.el (Info-display-images-node): When image file doesn't exist
display text version of the image if it's provided in the Info file.
Otherwise, display the location of missing image from SRC attribute.
Add help-echo text property from ALT attribute. (Bug#15279)
2013-09-06 Stefan Monnier <monnier@iro.umontreal.ca>
* abbrev.el (edit-abbrevs-mode-map): Rename from edit-abbrevs-map.
(edit-abbrevs-mode): Use define-derived-mode.
* epa.el (epa--encode-coding-string, epa--decode-coding-string)
(epa--select-safe-coding-system, epa--derived-mode-p): Make it obvious
that it's defined.
(epa-key-list-mode, epa-key-mode, epa-info-mode):
Use define-derived-mode.
* epg.el (epg-start-encrypt): Minor CSE simplification.
2013-09-06 William Xu <william.xwl@gmail.com>
* arc-mode.el: Add support for 7za (bug#15264).
(archive-7z-program): New var.
(archive-zip-extract, archive-zip-expunge, archive-zip-update)
(archive-zip-update-case, archive-7z-extract, archive-7z-expunge)
(archive-7z-update, archive-zip-extract, archive-7z-summarize): Use it.
2013-09-06 Michael Albinus <michael.albinus@gmx.de>
Remove URL syntax.
* net/tramp.el (tramp-syntax, tramp-prefix-format)
(tramp-postfix-method-format, tramp-prefix-ipv6-format)
(tramp-postfix-ipv6-format, tramp-prefix-port-format)
(tramp-postfix-host-format, tramp-file-name-regexp)
(tramp-completion-file-name-regexp)
(tramp-completion-dissect-file-name)
(tramp-handle-substitute-in-file-name): Remove 'url case.
(tramp-file-name-regexp-url)
(tramp-completion-file-name-regexp-url): Remove constants.
2013-09-06 Glenn Morris <rgm@gnu.org>
* replace.el (replace-string): Doc fix re start/end. (Bug#15275)
2013-09-05 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/ruby-mode.el (ruby-font-lock-keywords): Move "Perl-ish
keywords" below "here-doc beginnings" (Bug#15270).
2013-09-05 Stefan Monnier <monnier@iro.umontreal.ca>
* subr.el (pop): Use `car-safe'.
@ -64,6 +179,30 @@
2013-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
* vc/vc-dispatcher.el (vc-run-delayed): New macro.
(vc-do-command, vc-set-async-update):
* vc/vc-mtn.el (vc-mtn-dir-status):
* vc/vc-hg.el (vc-hg-dir-status, vc-hg-dir-status-files)
(vc-hg-pull, vc-hg-merge-branch):
* vc/vc-git.el (vc-git-dir-status-goto-stage, vc-git-pull)
(vc-git-merge-branch):
* vc/vc-cvs.el (vc-cvs-print-log, vc-cvs-dir-status)
(vc-cvs-dir-status-files):
* vc/vc-bzr.el (vc-bzr-pull, vc-bzr-merge-branch, vc-bzr-dir-status)
(vc-bzr-dir-status-files):
* vc/vc-arch.el (vc-arch-dir-status): Use vc-run-delayed.
* vc/vc-annotate.el: Use lexical-binding.
(vc-annotate-display-select, vc-annotate): Use vc-run-delayed.
(vc-sentinel-movepoint): Declare.
(vc-annotate): Don't use `goto-line'.
* vc/vc.el (vc-diff-internal): Prefer a closure to `(lambda...).
(vc-diff-internal, vc-log-internal-common): Use vc-run-delayed.
(vc-sentinel-movepoint): Declare.
* vc/vc-svn.el: Use lexical-binding.
(vc-svn-dir-status, vc-svn-dir-status-files): Use vc-run-delayed.
* vc/vc-sccs.el:
* vc/vc-rcs.el: Use lexical-binding.
* autorevert.el (auto-revert-notify-handler): Explicitly ignore
`deleted'. Don't drop errors silently.

View file

@ -67,13 +67,15 @@ be replaced by its expansion."
(put 'abbrev-mode 'safe-local-variable 'booleanp)
(defvar edit-abbrevs-map
(defvar edit-abbrevs-mode-map
(let ((map (make-sparse-keymap)))
(define-key map "\C-x\C-s" 'abbrev-edit-save-buffer)
(define-key map "\C-x\C-w" 'abbrev-edit-save-to-file)
(define-key map "\C-c\C-c" 'edit-abbrevs-redefine)
map)
"Keymap used in `edit-abbrevs'.")
(define-obsolete-variable-alias 'edit-abbrevs-map
'edit-abbrevs-mode-map "24.4")
(defun kill-all-abbrevs ()
"Undefine all defined abbrevs."
@ -144,16 +146,6 @@ Otherwise display all abbrevs."
(set-buffer-modified-p nil)
(current-buffer))))
(defun edit-abbrevs-mode ()
"Major mode for editing the list of abbrev definitions.
\\{edit-abbrevs-map}"
(interactive)
(kill-all-local-variables)
(setq major-mode 'edit-abbrevs-mode)
(setq mode-name "Edit-Abbrevs")
(use-local-map edit-abbrevs-map)
(run-mode-hooks 'edit-abbrevs-mode-hook))
(defun edit-abbrevs ()
"Alter abbrev definitions by editing a list of them.
Selects a buffer containing a list of abbrev definitions with
@ -1013,6 +1005,11 @@ SORTFUN is passed to `sort' to change the default ordering."
(sort entries (lambda (x y)
(funcall sortfun (nth 2 x) (nth 2 y)))))))
;; Keep it after define-abbrev-table, since define-derived-mode uses
;; define-abbrev-table.
(define-derived-mode edit-abbrevs-mode special-mode "Edit-Abbrevs"
"Major mode for editing the list of abbrev definitions.")
(provide 'abbrev)
;;; abbrev.el ends here

View file

@ -218,9 +218,14 @@ Archive and member name will be added."
;; ------------------------------
;; Zip archive configuration
(defvar archive-7z-program (let ((7z (or (executable-find "7z")
(executable-find "7za"))))
(when 7z
(file-name-nondirectory 7z))))
(defcustom archive-zip-extract
(cond ((executable-find "unzip") '("unzip" "-qq" "-c"))
((executable-find "7z") '("7z" "x" "-so"))
(archive-7z-program `(,archive-7z-program "x" "-so"))
((executable-find "pkunzip") '("pkunzip" "-e" "-o-"))
(t '("unzip" "-qq" "-c")))
"Program and its options to run in order to extract a zip file member.
@ -239,7 +244,7 @@ be added."
(defcustom archive-zip-expunge
(cond ((executable-find "zip") '("zip" "-d" "-q"))
((executable-find "7z") '("7z" "d"))
(archive-7z-program `(,archive-7z-program "d"))
((executable-find "pkzip") '("pkzip" "-d"))
(t '("zip" "-d" "-q")))
"Program and its options to run in order to delete zip file members.
@ -252,7 +257,7 @@ Archive and member names will be added."
(defcustom archive-zip-update
(cond ((executable-find "zip") '("zip" "-q"))
((executable-find "7z") '("7z" "u"))
(archive-7z-program `(,archive-7z-program "u"))
((executable-find "pkzip") '("pkzip" "-u" "-P"))
(t '("zip" "-q")))
"Program and its options to run in order to update a zip file member.
@ -266,7 +271,7 @@ file. Archive and member name will be added."
(defcustom archive-zip-update-case
(cond ((executable-find "zip") '("zip" "-q" "-k"))
((executable-find "7z") '("7z" "u"))
(archive-7z-program `(,archive-7z-program "u"))
((executable-find "pkzip") '("pkzip" "-u" "-P"))
(t '("zip" "-q" "-k")))
"Program and its options to run in order to update a case fiddled zip member.
@ -321,7 +326,7 @@ Archive and member name will be added."
;; 7z archive configuration
(defcustom archive-7z-extract
'("7z" "x" "-so")
`(,archive-7z-program "x" "-so")
"Program and its options to run in order to extract a 7z file member.
Extraction should happen to standard output. Archive and member name will
be added."
@ -333,7 +338,7 @@ be added."
:group 'archive-7z)
(defcustom archive-7z-expunge
'("7z" "d")
`(,archive-7z-program "d")
"Program and its options to run in order to delete 7z file members.
Archive and member names will be added."
:version "24.1"
@ -344,7 +349,7 @@ Archive and member names will be added."
:group 'archive-7z)
(defcustom archive-7z-update
'("7z" "u")
`(,archive-7z-program "u")
"Program and its options to run in order to update a 7z file member.
Options should ensure that specified directory will be put into the 7z
file. Archive and member name will be added."
@ -1864,7 +1869,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
(cond
((member-ignore-case (car archive-zip-extract) '("pkunzip" "pkzip"))
(archive-*-extract archive name archive-zip-extract))
((equal (car archive-zip-extract) "7z")
((equal (car archive-zip-extract) archive-7z-program)
(let ((archive-7z-extract archive-zip-extract))
(archive-7z-extract archive name)))
(t
@ -2088,7 +2093,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
(file buffer-file-name)
(files ()))
(with-temp-buffer
(call-process "7z" nil t nil "l" "-slt" file)
(call-process archive-7z-program nil t nil "l" "-slt" file)
(goto-char (point-min))
;; Four dashes start the meta info section that should be skipped.
;; Archive members start with more than four dashes.

View file

@ -1,4 +1,4 @@
;;; dired-x.el --- extra Dired functionality
;;; dired-x.el --- extra Dired functionality -*- lexical-binding:t -*-
;; Copyright (C) 1993-1994, 1997, 2001-2013 Free Software Foundation,
;; Inc.
@ -1185,7 +1185,7 @@ results in
(setq count (1+ count)
start (1+ start)))
;; ... and prepend a "../" for each slash found:
(dotimes (n count)
(dotimes (_ count)
(setq name1 (concat "../" name1)))))
(make-symbolic-link
(directory-file-name name1) ; must not link to foo/
@ -1397,22 +1397,6 @@ Considers buffers closer to the car of `buffer-list' to be more recent."
;; Does anyone use this? - lrd 6/29/93.
;; Apparently people do use it. - lrd 12/22/97.
(with-no-warnings
;; Warnings are suppressed to avoid "global/dynamic var `X' lacks a prefix".
;; This is unbearably ugly, but not more than having global variables
;; named size, time, name or s, however practical it can be while writing
;; `dired-mark-sexp' predicates.
(defvar inode)
(defvar s)
(defvar mode)
(defvar nlink)
(defvar uid)
(defvar gid)
(defvar size)
(defvar time)
(defvar name)
(defvar sym))
(defun dired-mark-sexp (predicate &optional unflag-p)
"Mark files for which PREDICATE returns non-nil.
With a prefix arg, unmark or unflag those files instead.
@ -1505,7 +1489,17 @@ to mark all zero length files."
(line-end-position))
""))
t)
(eval predicate)))
(eval predicate
`((inode . ,inode)
(s . ,s)
(mode . ,mode)
(nlink . ,nlink)
(uid . ,uid)
(gid . ,gid)
(size . ,size)
(time . ,time)
(name . ,name)
(sym . ,sym)))))
(format "'%s file" predicate))))

View file

@ -4352,7 +4352,7 @@ instead.
;;;***
;;;### (autoloads nil "dired-x" "dired-x.el" "130484d4c94bb9929c210774f9e475f5")
;;;### (autoloads nil "dired-x" "dired-x.el" "1bf4009b81e55bf51947bc87b2c82994")
;;; Generated autoloads from dired-x.el
(autoload 'dired-jump "dired-x" "\

View file

@ -157,33 +157,32 @@ Functions'."
predicate
flag)))
(defun crm--select-current-element ()
(defun crm--current-element ()
"Parse the minibuffer to find the current element.
Place an overlay on the element, with a `field' property, and return it."
(let* ((bob (minibuffer-prompt-end))
(start (save-excursion
Return the element's boundaries as (START . END)."
(let ((bob (minibuffer-prompt-end)))
(cons (save-excursion
(if (re-search-backward crm-separator bob t)
(match-end 0)
bob)))
(end (save-excursion
bob))
(save-excursion
(if (re-search-forward crm-separator nil t)
(match-beginning 0)
(point-max))))
(ol (make-overlay start end nil nil t)))
(overlay-put ol 'field (make-symbol "crm"))
ol))
(point-max))))))
(defmacro crm--completion-command (command)
"Make COMMAND a completion command for `completing-read-multiple'."
`(let ((ol (crm--select-current-element)))
(unwind-protect
,command
(delete-overlay ol))))
(defmacro crm--completion-command (beg end &rest body)
"Run BODY with BEG and END bound to the current element's boundaries."
(declare (indent 2) (debug (sexp sexp &rest body)))
`(let* ((crm--boundaries (crm--current-element))
(,beg (car crm--boundaries))
(,end (cdr crm--boundaries)))
,@body))
(defun crm-completion-help ()
"Display a list of possible completions of the current minibuffer element."
(interactive)
(crm--completion-command (minibuffer-completion-help))
(crm--completion-command beg end
(minibuffer-completion-help beg end))
nil)
(defun crm-complete ()
@ -192,13 +191,18 @@ If no characters can be completed, display a list of possible completions.
Return t if the current element is now a valid match; otherwise return nil."
(interactive)
(crm--completion-command (minibuffer-complete)))
(crm--completion-command beg end
(completion-in-region beg end
minibuffer-completion-table
minibuffer-completion-predicate)))
(defun crm-complete-word ()
"Complete the current element at most a single word.
Like `minibuffer-complete-word' but for `completing-read-multiple'."
(interactive)
(crm--completion-command (minibuffer-complete-word)))
(crm--completion-command beg end
(completion-in-region--single-word
beg end minibuffer-completion-table minibuffer-completion-predicate)))
(defun crm-complete-and-exit ()
"If all of the minibuffer elements are valid completions then exit.
@ -211,16 +215,14 @@ This function is modeled after `minibuffer-complete-and-exit'."
(goto-char (minibuffer-prompt-end))
(while
(and doexit
(let ((ol (crm--select-current-element)))
(goto-char (overlay-end ol))
(unwind-protect
(catch 'exit
(minibuffer-complete-and-exit)
;; This did not throw `exit', so there was a problem.
(setq doexit nil))
(goto-char (overlay-end ol))
(delete-overlay ol))
(not (eobp)))
(crm--completion-command beg end
(let ((end (copy-marker end t)))
(goto-char end)
(setq doexit nil)
(completion-complete-and-exit beg end
(lambda () (setq doexit t)))
(goto-char end)
(not (eobp))))
(looking-at crm-separator))
;; Skip to the next element.
(goto-char (match-end 0)))

View file

@ -268,62 +268,40 @@ You should bind this variable with `let', but do not set it globally.")
(epg-sub-key-id (car (epg-key-sub-key-list
(widget-get widget :value))))))
(eval-and-compile
(if (fboundp 'encode-coding-string)
(defalias 'epa--encode-coding-string 'encode-coding-string)
(defalias 'epa--encode-coding-string 'identity)))
(defalias 'epa--encode-coding-string
(if (fboundp 'encode-coding-string) #'encode-coding-string #'identity))
(eval-and-compile
(if (fboundp 'decode-coding-string)
(defalias 'epa--decode-coding-string 'decode-coding-string)
(defalias 'epa--decode-coding-string 'identity)))
(defalias 'epa--decode-coding-string
(if (fboundp 'decode-coding-string) #'decode-coding-string #'identity))
(defun epa-key-list-mode ()
(define-derived-mode epa-key-list-mode special-mode "Keys"
"Major mode for `epa-list-keys'."
(kill-all-local-variables)
(buffer-disable-undo)
(setq major-mode 'epa-key-list-mode
mode-name "Keys"
truncate-lines t
(setq truncate-lines t
buffer-read-only t)
(use-local-map epa-key-list-mode-map)
(make-local-variable 'font-lock-defaults)
(setq font-lock-defaults '(epa-font-lock-keywords t))
(setq-local font-lock-defaults '(epa-font-lock-keywords t))
;; In XEmacs, auto-initialization of font-lock is not effective
;; if buffer-file-name is not set.
(font-lock-set-defaults)
(make-local-variable 'epa-exit-buffer-function)
(make-local-variable 'revert-buffer-function)
(setq revert-buffer-function 'epa--key-list-revert-buffer)
(run-mode-hooks 'epa-key-list-mode-hook))
(setq-local revert-buffer-function #'epa--key-list-revert-buffer))
(defun epa-key-mode ()
(define-derived-mode epa-key-mode special-mode "Key"
"Major mode for a key description."
(kill-all-local-variables)
(buffer-disable-undo)
(setq major-mode 'epa-key-mode
mode-name "Key"
truncate-lines t
(setq truncate-lines t
buffer-read-only t)
(use-local-map epa-key-mode-map)
(make-local-variable 'font-lock-defaults)
(setq font-lock-defaults '(epa-font-lock-keywords t))
(setq-local font-lock-defaults '(epa-font-lock-keywords t))
;; In XEmacs, auto-initialization of font-lock is not effective
;; if buffer-file-name is not set.
(font-lock-set-defaults)
(make-local-variable 'epa-exit-buffer-function)
(run-mode-hooks 'epa-key-mode-hook))
(make-local-variable 'epa-exit-buffer-function))
(defun epa-info-mode ()
(define-derived-mode epa-info-mode special-mode "Info"
"Major mode for `epa-info-buffer'."
(kill-all-local-variables)
(buffer-disable-undo)
(setq major-mode 'epa-info-mode
mode-name "Info"
truncate-lines t
buffer-read-only t)
(use-local-map epa-info-mode-map)
(run-mode-hooks 'epa-info-mode-hook))
(setq truncate-lines t
buffer-read-only t))
(defun epa-mark-key (&optional arg)
"Mark a key on the current line.
@ -951,10 +929,10 @@ See the reason described in the `epa-verify-region' documentation."
(error "No cleartext tail"))
(epa-verify-region cleartext-start cleartext-end))))))
(eval-and-compile
(defalias 'epa--select-safe-coding-system
(if (fboundp 'select-safe-coding-system)
(defalias 'epa--select-safe-coding-system 'select-safe-coding-system)
(defun epa--select-safe-coding-system (_from _to)
#'select-safe-coding-system
(lambda (_from _to)
buffer-file-coding-system)))
;;;###autoload
@ -1026,16 +1004,16 @@ If no one is selected, default secret key is used. "
'start-open t
'end-open t)))))
(eval-and-compile
(defalias 'epa--derived-mode-p
(if (fboundp 'derived-mode-p)
(defalias 'epa--derived-mode-p 'derived-mode-p)
(defun epa--derived-mode-p (&rest modes)
#'derived-mode-p
(lambda (&rest modes)
"Non-nil if the current major mode is derived from one of MODES.
Uses the `derived-mode-parent' property of the symbol to trace backwards."
(let ((parent major-mode))
(while (and (not (memq parent modes))
(setq parent (get parent 'derived-mode-parent))))
parent))))
(while (and (not (memq parent modes))
(setq parent (get parent 'derived-mode-parent))))
parent))))
;;;###autoload
(defun epa-encrypt-region (start end recipients sign signers)
@ -1138,6 +1116,7 @@ If no one is selected, symmetric encryption will be performed. ")
(if (epg-context-result-for context 'import)
(epa-display-info (epg-import-result-to-string
(epg-context-result-for context 'import))))
;; FIXME: Why not use the (otherwise unused) epa--derived-mode-p?
(if (eq major-mode 'epa-key-list-mode)
(apply #'epa--list-keys epa-list-keys-arguments))))

View file

@ -2415,9 +2415,8 @@ If you are unsure, use synchronous version of this function
(list "--" (epg-data-file plain)))))
;; `gpgsm' does not read passphrase from stdin, so waiting is not needed.
(unless (eq (epg-context-protocol context) 'CMS)
(if sign
(epg-wait-for-status context '("BEGIN_SIGNING"))
(epg-wait-for-status context '("BEGIN_ENCRYPTION"))))
(epg-wait-for-status context
(if sign '("BEGIN_SIGNING") '("BEGIN_ENCRYPTION"))))
(when (epg-data-string plain)
(if (eq (process-status (epg-context-process context)) 'run)
(process-send-string (epg-context-process context)

View file

@ -158,11 +158,13 @@ minibuffer completion.")
(add-hook 'icomplete-post-command-hook 'icomplete-exhibit)
;;;_ = icomplete-with-completion-tables
(defvar icomplete-with-completion-tables '(internal-complete-buffer)
(defcustom icomplete-with-completion-tables t
"Specialized completion tables with which icomplete should operate.
Icomplete does not operate with any specialized completion tables
except those on this list.")
except those on this list."
:type '(choice (const :tag "All" t)
(repeat function)))
(defvar icomplete-minibuffer-map
(let ((map (make-sparse-keymap)))
@ -177,24 +179,28 @@ except those on this list.")
Second entry becomes the first and can be selected with
`minibuffer-force-complete-and-exit'."
(interactive)
(let* ((comps (completion-all-sorted-completions))
(let* ((beg (minibuffer-prompt-end))
(end (point-max))
(comps (completion-all-sorted-completions beg end))
(last (last comps)))
(when comps
(setcdr last (cons (car comps) (cdr last)))
(completion--cache-all-sorted-completions (cdr comps)))))
(completion--cache-all-sorted-completions beg end (cdr comps)))))
(defun icomplete-backward-completions ()
"Step backward completions by one entry.
Last entry becomes the first and can be selected with
`minibuffer-force-complete-and-exit'."
(interactive)
(let* ((comps (completion-all-sorted-completions))
(let* ((beg (minibuffer-prompt-end))
(end (point-max))
(comps (completion-all-sorted-completions beg end))
(last-but-one (last comps 2))
(last (cdr last-but-one)))
(when (consp last) ; At least two elements in comps
(setcdr last-but-one (cdr last))
(push (car last) comps)
(completion--cache-all-sorted-completions comps))))
(completion--cache-all-sorted-completions beg end comps))))
;;;_ > icomplete-mode (&optional prefix)
;;;###autoload
@ -263,7 +269,8 @@ and `minibuffer-setup-hook'."
"Insert icomplete completions display.
Should be run via minibuffer `post-command-hook'. See `icomplete-mode'
and `minibuffer-setup-hook'."
(when (and icomplete-mode (icomplete-simple-completing-p))
(when (and icomplete-mode
(icomplete-simple-completing-p)) ;Shouldn't be necessary.
(save-excursion
(goto-char (point-max))
; Insert the match-status information:
@ -319,7 +326,8 @@ matches exist. \(Keybindings for uniquely matched commands
are exhibited within the square braces.)"
(let* ((md (completion--field-metadata (field-beginning)))
(comps (completion-all-sorted-completions))
(comps (completion-all-sorted-completions
(minibuffer-prompt-end) (point-max)))
(last (if (consp comps) (last comps)))
(base-size (cdr last))
(open-bracket (if require-match "(" "["))

View file

@ -1595,17 +1595,20 @@ escaped (\\\",\\\\)."
""))
(image (if (file-exists-p image-file)
(create-image image-file)
"[broken image]")))
(or (cdr (assoc-string "text" parameter-alist))
(and src (concat "[broken image:" src "]"))
"[broken image]"))))
(if (not (get-text-property start 'display))
(add-text-properties
start (point) `(display ,image rear-nonsticky (display)))))
start (point)
`(display ,image rear-nonsticky (display)
help-echo ,(cdr (assoc-string "alt" parameter-alist))))))
;; text-only display, show alternative text if provided, or
;; otherwise a clue that there's meant to be a picture
(delete-region start (point))
(insert (or (cdr (assoc-string "text" parameter-alist))
(cdr (assoc-string "alt" parameter-alist))
(and src
(concat "[image:" src "]"))
(and src (concat "[image:" src "]"))
"[image]"))))))
(set-buffer-modified-p nil)))

View file

@ -38,7 +38,7 @@
;;; Bugs:
;; - completion-all-sorted-completions list all the completions, whereas
;; - completion-all-sorted-completions lists all the completions, whereas
;; it should only lists the ones that `try-completion' would consider.
;; E.g. it should honor completion-ignored-extensions.
;; - choose-completion can't automatically figure out the boundaries
@ -145,7 +145,7 @@ Like CL's `some'."
(let ((firsterror nil)
res)
(while (and (not res) xs)
(condition-case err
(condition-case-unless-debug err
(setq res (funcall fun (pop xs)))
(error (unless firsterror (setq firsterror err)) nil)))
(or res
@ -623,7 +623,8 @@ If ARGS are provided, then pass MESSAGE through `format'."
(message nil)))
;; Clear out any old echo-area message to make way for our new thing.
(message nil)
(setq message (if (and (null args) (string-match-p "\\` *\\[.+\\]\\'" message))
(setq message (if (and (null args)
(string-match-p "\\` *\\[.+\\]\\'" message))
;; Make sure we can put-text-property.
(copy-sequence message)
(concat " [" message "]")))
@ -651,7 +652,7 @@ If ARGS are provided, then pass MESSAGE through `format'."
"Return the user input in a minibuffer before point as a string.
In Emacs-22, that was what completion commands operated on."
(declare (obsolete nil "24.4"))
(buffer-substring (field-beginning) (point)))
(buffer-substring (minibuffer-prompt-end) (point)))
(defun delete-minibuffer-contents ()
"Delete all user input in a minibuffer.
@ -670,8 +671,7 @@ If the value is t the *Completion* buffer is displayed whenever completion
is requested but cannot be done.
If the value is `lazy', the *Completions* buffer is only displayed after
the second failed attempt to complete."
:type '(choice (const nil) (const t) (const lazy))
:group 'minibuffer)
:type '(choice (const nil) (const t) (const lazy)))
(defconst completion-styles-alist
'((emacs21
@ -750,7 +750,6 @@ The available styles are listed in `completion-styles-alist'.
Note that `completion-category-overrides' may override these
styles for specific categories, such as files, buffers, etc."
:type completion--styles-type
:group 'minibuffer
:version "23.1")
(defcustom completion-category-overrides
@ -880,7 +879,7 @@ Moves point to the end of the new text."
(defcustom completion-cycle-threshold nil
"Number of completion candidates below which cycling is used.
Depending on this setting `minibuffer-complete' may use cycling,
Depending on this setting `completion-in-region' may use cycling,
like `minibuffer-force-complete'.
If nil, cycling is never used.
If t, cycling is always used.
@ -894,8 +893,7 @@ completion candidates than this number."
(over (assq 'cycle (cdr (assq cat completion-category-overrides)))))
(if over (cdr over) completion-cycle-threshold)))
(defvar completion-all-sorted-completions nil)
(make-variable-buffer-local 'completion-all-sorted-completions)
(defvar-local completion-all-sorted-completions nil)
(defvar-local completion--all-sorted-completions-location nil)
(defvar completion-cycling nil)
@ -906,8 +904,8 @@ completion candidates than this number."
(if completion-show-inline-help
(minibuffer-message msg)))
(defun completion--do-completion (&optional try-completion-function
expect-exact)
(defun completion--do-completion (beg end &optional
try-completion-function expect-exact)
"Do the completion and return a summary of what happened.
M = completion was performed, the text was Modified.
C = there were available Completions.
@ -926,9 +924,7 @@ E = after completion we now have an Exact match.
TRY-COMPLETION-FUNCTION is a function to use in place of `try-completion'.
EXPECT-EXACT, if non-nil, means that there is no need to tell the user
when the buffer's text is already an exact match."
(let* ((beg (field-beginning))
(end (field-end))
(string (buffer-substring beg end))
(let* ((string (buffer-substring beg end))
(md (completion--field-metadata beg))
(comp (funcall (or try-completion-function
'completion-try-completion)
@ -963,7 +959,8 @@ when the buffer's text is already an exact match."
(if unchanged
(goto-char end)
;; Insert in minibuffer the chars we got.
(completion--replace beg end completion))
(completion--replace beg end completion)
(setq end (+ beg (length completion))))
;; Move point to its completion-mandated destination.
(forward-char (- comp-pos (length completion)))
@ -972,7 +969,8 @@ when the buffer's text is already an exact match."
;; whether this is a unique completion or not, so try again using
;; the real case (this shouldn't recurse again, because the next
;; time try-completion will return either t or the exact string).
(completion--do-completion try-completion-function expect-exact)
(completion--do-completion beg end
try-completion-function expect-exact)
;; It did find a match. Do we match some possibility exactly now?
(let* ((exact (test-completion completion
@ -995,7 +993,7 @@ when the buffer's text is already an exact match."
minibuffer-completion-predicate
""))
comp-pos)))
(completion-all-sorted-completions))))
(completion-all-sorted-completions beg end))))
(completion--flush-all-sorted-completions)
(cond
((and (consp (cdr comps)) ;; There's something to cycle.
@ -1006,8 +1004,8 @@ when the buffer's text is already an exact match."
;; Not more than completion-cycle-threshold remaining
;; completions: let's cycle.
(setq completed t exact t)
(completion--cache-all-sorted-completions comps)
(minibuffer-force-complete))
(completion--cache-all-sorted-completions beg end comps)
(minibuffer-force-complete beg end))
(completed
;; We could also decide to refresh the completions,
;; if they're displayed (and assuming there are
@ -1024,14 +1022,14 @@ when the buffer's text is already an exact match."
(if (pcase completion-auto-help
(`lazy (eq this-command last-command))
(_ completion-auto-help))
(minibuffer-completion-help)
(minibuffer-completion-help beg end)
(completion--message "Next char not unique")))
;; If the last exact completion and this one were the same, it
;; means we've already given a "Complete, but not unique" message
;; and the user's hit TAB again, so now we give him help.
(t
(if (and (eq this-command last-command) completion-auto-help)
(minibuffer-completion-help))
(minibuffer-completion-help beg end))
(completion--done completion 'exact
(unless expect-exact
"Complete, but not unique"))))
@ -1045,6 +1043,11 @@ If no characters can be completed, display a list of possible completions.
If you repeat this command after it displayed such a list,
scroll the window of possible completions."
(interactive)
(completion-in-region (minibuffer-prompt-end) (point-max)
minibuffer-completion-table
minibuffer-completion-predicate))
(defun completion--in-region-1 (beg end)
;; If the previous command was not this,
;; mark the completion buffer obsolete.
(setq this-command 'completion-at-point)
@ -1067,17 +1070,17 @@ scroll the window of possible completions."
nil)))
;; If we're cycling, keep on cycling.
((and completion-cycling completion-all-sorted-completions)
(minibuffer-force-complete)
(minibuffer-force-complete beg end)
t)
(t (pcase (completion--do-completion)
(t (pcase (completion--do-completion beg end)
(#b000 nil)
(_ t)))))
(defun completion--cache-all-sorted-completions (comps)
(defun completion--cache-all-sorted-completions (beg end comps)
(add-hook 'after-change-functions
'completion--flush-all-sorted-completions nil t)
(setq completion--all-sorted-completions-location
(cons (copy-marker (field-beginning)) (copy-marker (field-end))))
(cons (copy-marker beg) (copy-marker end)))
(setq completion-all-sorted-completions comps))
(defun completion--flush-all-sorted-completions (&optional start end _len)
@ -1097,10 +1100,10 @@ scroll the window of possible completions."
(if (eq (car bounds) base) md-at-point
(completion-metadata (substring string 0 base) table pred))))
(defun completion-all-sorted-completions ()
(defun completion-all-sorted-completions (start end)
(or completion-all-sorted-completions
(let* ((start (field-beginning))
(end (field-end))
(let* ((start (or start (minibuffer-prompt-end)))
(end (or end (point-max)))
(string (buffer-substring start end))
(md (completion--field-metadata start))
(all (completion-all-completions
@ -1138,18 +1141,20 @@ scroll the window of possible completions."
;; Cache the result. This is not just for speed, but also so that
;; repeated calls to minibuffer-force-complete can cycle through
;; all possibilities.
(completion--cache-all-sorted-completions (nconc all base-size))))))
(completion--cache-all-sorted-completions
start end (nconc all base-size))))))
(defun minibuffer-force-complete-and-exit ()
"Complete the minibuffer with first of the matches and exit."
(interactive)
(minibuffer-force-complete)
(minibuffer--complete-and-exit
(completion--complete-and-exit
(minibuffer-prompt-end) (point-max) #'exit-minibuffer
;; If the previous completion completed to an element which fails
;; test-completion, then we shouldn't exit, but that should be rare.
(lambda () (minibuffer-message "Incomplete"))))
(defun minibuffer-force-complete ()
(defun minibuffer-force-complete (&optional start end)
"Complete the minibuffer to an exact match.
Repeated uses step through the possible completions."
(interactive)
@ -1157,10 +1162,10 @@ Repeated uses step through the possible completions."
;; FIXME: Need to deal with the extra-size issue here as well.
;; FIXME: ~/src/emacs/t<M-TAB>/lisp/minibuffer.el completes to
;; ~/src/emacs/trunk/ and throws away lisp/minibuffer.el.
(let* ((start (copy-marker (field-beginning)))
(end (field-end))
(let* ((start (copy-marker (or start (minibuffer-prompt-end))))
(end (or end (point-max)))
;; (md (completion--field-metadata start))
(all (completion-all-sorted-completions))
(all (completion-all-sorted-completions start end))
(base (+ start (or (cdr (last all)) 0))))
(cond
((not (consp all))
@ -1173,10 +1178,11 @@ Repeated uses step through the possible completions."
'finished (when done "Sole completion"))))
(t
(completion--replace base end (car all))
(setq end (+ base (length (car all))))
(completion--done (buffer-substring-no-properties start (point)) 'sole)
;; Set cycling after modifying the buffer since the flush hook resets it.
(setq completion-cycling t)
(setq this-command 'completion-at-point) ;For minibuffer-complete.
(setq this-command 'completion-at-point) ;For completion-in-region.
;; If completing file names, (car all) may be a directory, so we'd now
;; have a new set of possible completions and might want to reset
;; completion-all-sorted-completions to nil, but we prefer not to,
@ -1184,7 +1190,7 @@ Repeated uses step through the possible completions."
;; through the previous possible completions.
(let ((last (last all)))
(setcdr last (cons (car all) (cdr last)))
(completion--cache-all-sorted-completions (cdr all)))
(completion--cache-all-sorted-completions start end (cdr all)))
;; Make sure repeated uses cycle, even though completion--done might
;; have added a space or something that moved us outside of the field.
;; (bug#12221).
@ -1223,27 +1229,32 @@ If `minibuffer-completion-confirm' is `confirm-after-completion',
`minibuffer-confirm-exit-commands', and accept the input
otherwise."
(interactive)
(minibuffer--complete-and-exit
(completion-complete-and-exit (minibuffer-prompt-end) (point-max)
#'exit-minibuffer))
(defun completion-complete-and-exit (beg end exit-function)
(completion--complete-and-exit
beg end exit-function
(lambda ()
(pcase (condition-case nil
(completion--do-completion nil 'expect-exact)
(completion--do-completion beg end
nil 'expect-exact)
(error 1))
((or #b001 #b011) (exit-minibuffer))
((or #b001 #b011) (funcall exit-function))
(#b111 (if (not minibuffer-completion-confirm)
(exit-minibuffer)
(funcall exit-function)
(minibuffer-message "Confirm")
nil))
(_ nil)))))
(defun minibuffer--complete-and-exit (completion-function)
(defun completion--complete-and-exit (beg end
exit-function completion-function)
"Exit from `require-match' minibuffer.
COMPLETION-FUNCTION is called if the current buffer's content does not
appear to be a match."
(let ((beg (field-beginning))
(end (field-end)))
(cond
;; Allow user to specify null string
((= beg end) (exit-minibuffer))
((= beg end) (funcall exit-function))
((test-completion (buffer-substring beg end)
minibuffer-completion-table
minibuffer-completion-predicate)
@ -1269,7 +1280,7 @@ appear to be a match."
;; that file.
(= (length string) (length compl)))
(completion--replace beg end compl))))
(exit-minibuffer))
(funcall exit-function))
((memq minibuffer-completion-confirm '(confirm confirm-after-completion))
;; The user is permitted to exit with an input that's rejected
@ -1280,13 +1291,13 @@ appear to be a match."
;; catches most minibuffer typos).
(and (eq minibuffer-completion-confirm 'confirm-after-completion)
(not (memq last-command minibuffer-confirm-exit-commands))))
(exit-minibuffer)
(funcall exit-function)
(minibuffer-message "Confirm")
nil))
(t
;; Call do-completion, but ignore errors.
(funcall completion-function)))))
(funcall completion-function))))
(defun completion--try-word-completion (string table predicate point md)
(let ((comp (completion-try-completion string table predicate point md)))
@ -1381,9 +1392,18 @@ After one word is completed as much as possible, a space or hyphen
is added, provided that matches some possible completion.
Return nil if there is no valid completion, else t."
(interactive)
(pcase (completion--do-completion 'completion--try-word-completion)
(completion-in-region--single-word
(minibuffer-prompt-end) (point-max)
minibuffer-completion-table minibuffer-completion-predicate))
(defun completion-in-region--single-word (beg end collection
&optional predicate)
(let ((minibuffer-completion-table collection)
(minibuffer-completion-predicate predicate))
(pcase (completion--do-completion beg end
#'completion--try-word-completion)
(#b000 nil)
(_ t)))
(_ t))))
(defface completions-annotations '((t :inherit italic))
"Face to use for annotations in the *Completions* buffer.")
@ -1395,7 +1415,6 @@ in columns in the *Completions* buffer.
If the value is `horizontal', display completions sorted
horizontally in alphabetical order, rather than down the screen."
:type '(choice (const horizontal) (const vertical))
:group 'minibuffer
:version "23.2")
(defun completion--insert-strings (strings)
@ -1504,15 +1523,13 @@ See also `display-completion-list'.")
(defface completions-first-difference
'((t (:inherit bold)))
"Face added on the first uncommon character in completions in *Completions* buffer."
:group 'completion)
"Face added on the first uncommon character in completions in *Completions* buffer.")
(defface completions-common-part '((t nil))
"Face added on the common prefix substring in completions in *Completions* buffer.
The idea of `completions-common-part' is that you can use it to
make the common parts less visible than normal, so that the rest
of the differing parts is, by contrast, slightly highlighted."
:group 'completion)
of the differing parts is, by contrast, slightly highlighted.")
(defun completion-hilit-commonality (completions prefix-len base-size)
(when completions
@ -1555,12 +1572,8 @@ alternative, the second serves as annotation.
The actual completion alternatives, as inserted, are given `mouse-face'
properties of `highlight'.
At the end, this runs the normal hook `completion-setup-hook'.
It can find the completion buffer in `standard-output'.
The obsolete optional arg COMMON-SUBSTRING, if non-nil, should be a string
specifying a common substring for adding the faces
`completions-first-difference' and `completions-common-part' to
the completions buffer."
It can find the completion buffer in `standard-output'."
(declare (advertised-calling-convention (completions) "24.4"))
(if common-substring
(setq completions (completion-hilit-commonality
completions (length common-substring)
@ -1647,19 +1660,19 @@ variables.")
(equal pre-msg (and exit-fun (current-message))))
(completion--message message))))
(defun minibuffer-completion-help ()
(defun minibuffer-completion-help (&optional start end)
"Display a list of possible completions of the current minibuffer contents."
(interactive)
(message "Making completion list...")
(let* ((start (field-beginning))
(end (field-end))
(string (field-string))
(let* ((start (or start (minibuffer-prompt-end)))
(end (or end (point-max)))
(string (buffer-substring start end))
(md (completion--field-metadata start))
(completions (completion-all-completions
string
minibuffer-completion-table
minibuffer-completion-predicate
(- (point) (field-beginning))
(- (point) start)
md)))
(message nil)
(if (or (null completions)
@ -1811,7 +1824,6 @@ exit."
(if (memq system-type '(ms-dos windows-nt darwin cygwin))
t nil)
"Non-nil means when reading a file name completion ignores case."
:group 'minibuffer
:type 'boolean
:version "22.1")
@ -1821,22 +1833,15 @@ exit."
;; completions" operation as well.
completion-in-region-functions (start end collection predicate)
(let ((minibuffer-completion-table collection)
(minibuffer-completion-predicate predicate)
(ol (make-overlay start end nil nil t)))
(overlay-put ol 'field 'completion)
(minibuffer-completion-predicate predicate))
;; HACK: if the text we are completing is already in a field, we
;; want the completion field to take priority (e.g. Bug#6830).
(overlay-put ol 'priority 100)
(when completion-in-region-mode-predicate
(completion-in-region-mode 1)
(setq completion-in-region--data
(list (if (markerp start) start (copy-marker start))
(copy-marker end) collection)))
;; FIXME: `minibuffer-complete' should call `completion-in-region' rather
;; than the other way around!
(unwind-protect
(call-interactively 'minibuffer-complete)
(delete-overlay ol)))))
(completion--in-region-1 start end))))
(defvar completion-in-region-mode-map
(let ((map (make-sparse-keymap)))
@ -2001,19 +2006,14 @@ The completion method is determined by `completion-at-point-functions'."
(lambda ()
;; We're still in the same completion field.
(let ((newstart (car-safe (funcall hookfun))))
(and newstart (= newstart start)))))
(ol (make-overlay start end nil nil t)))
(and newstart (= newstart start))))))
;; FIXME: We should somehow (ab)use completion-in-region-function or
;; introduce a corresponding hook (plus another for word-completion,
;; and another for force-completion, maybe?).
(overlay-put ol 'field 'completion)
(overlay-put ol 'priority 100)
(completion-in-region-mode 1)
(setq completion-in-region--data
(list start (copy-marker end) collection))
(unwind-protect
(call-interactively 'minibuffer-completion-help)
(delete-overlay ol))))
(minibuffer-completion-help start end)))
(`(,hookfun . ,_)
;; The hook function already performed completion :-(
;; Not much we can do at this point.
@ -2308,7 +2308,6 @@ the minibuffer empty.
For some commands, exiting with an empty minibuffer has a special meaning,
such as making the current buffer visit no file in the case of
`set-visited-file-name'."
:group 'minibuffer
:type 'boolean)
;; Not always defined, but only called if next-read-file-uses-dialog-p says so.
@ -2701,7 +2700,6 @@ expression (not containing character ranges like `a-z')."
;; Refresh other vars.
(completion-pcm--prepare-delim-re value))
:initialize 'custom-initialize-reset
:group 'minibuffer
:type 'string)
(defcustom completion-pcm-complete-word-inserts-delimiters nil
@ -2734,7 +2732,8 @@ or a symbol, see `completion-pcm--merge-completions'."
(completion-pcm--string->pattern suffix)))
(let* ((pattern nil)
(p 0)
(p0 p))
(p0 p)
(pending nil))
(while (and (setq p (string-match completion-pcm--delim-wild-regex
string p))
@ -2751,18 +2750,49 @@ or a symbol, see `completion-pcm--merge-completions'."
;; This is determined by the presence of a submatch-1 which delimits
;; the prefix.
(if (match-end 1) (setq p (match-end 1)))
(push (substring string p0 p) pattern)
(unless (= p0 p)
(if pending (push pending pattern))
(push (substring string p0 p) pattern))
(setq pending nil)
(if (eq (aref string p) ?*)
(progn
(push 'star pattern)
(setq p0 (1+ p)))
(push 'any pattern)
(setq p0 p))
(cl-incf p))
(if (match-end 1)
(setq p0 p)
(push (substring string p (match-end 0)) pattern)
;; `any-delim' is used so that "a-b" also finds "array->beginning".
(setq pending 'any-delim)
(setq p0 (match-end 0))))
(setq p p0))
(when (> (length string) p0)
(if pending (push pending pattern))
(push (substring string p0) pattern))
;; An empty string might be erroneously added at the beginning.
;; It should be avoided properly, but it's so easy to remove it here.
(delete "" (nreverse (cons (substring string p0) pattern))))))
(delete "" (nreverse pattern)))))
(defun completion-pcm--optimize-pattern (p)
;; Remove empty strings in a separate phase since otherwise a ""
;; might prevent some other optimization, as in '(any "" any).
(setq p (delete "" p))
(let ((n '()))
(while p
(pcase p
(`(,(and s1 (pred stringp)) ,(and s2 (pred stringp)) . ,rest)
(setq p (cons (concat s1 s2) rest)))
(`(,(and p1 (pred symbolp)) ,(and p2 (guard (eq p1 p2))) . ,_)
(setq p (cdr p)))
(`(star ,(pred symbolp) . ,rest) (setq p `(star . ,rest)))
(`(,(pred symbolp) star . ,rest) (setq p `(star . ,rest)))
(`(point ,(or `any `any-delim) . ,rest) (setq p `(point . ,rest)))
(`(,(or `any `any-delim) point . ,rest) (setq p `(point . ,rest)))
(`(any ,(or `any `any-delim) . ,rest) (setq p `(any . ,rest)))
(`(,(pred symbolp)) (setq p nil)) ;Implicit terminating `any'.
(_ (push (pop p) n))))
(nreverse n)))
(defun completion-pcm--pattern->regex (pattern &optional group)
(let ((re
@ -2771,8 +2801,13 @@ or a symbol, see `completion-pcm--merge-completions'."
(lambda (x)
(cond
((stringp x) (regexp-quote x))
((if (consp group) (memq x group) group) "\\(.*?\\)")
(t ".*?")))
(t
(let ((re (if (eq x 'any-delim)
(concat completion-pcm--delim-wild-regex "*?")
".*?")))
(if (if (consp group) (memq x group) group)
(concat "\\(" re "\\)")
re)))))
pattern
""))))
;; Avoid pathological backtracking.
@ -2846,11 +2881,11 @@ filter out additional entries (because TABLE might not obey PRED)."
(setq string (substring string (car bounds) (+ point (cdr bounds))))
(let* ((relpoint (- point (car bounds)))
(pattern (completion-pcm--string->pattern string relpoint))
(all (condition-case err
(all (condition-case-unless-debug err
(funcall filter
(completion-pcm--all-completions
prefix pattern table pred))
(error (unless firsterror (setq firsterror err)) nil))))
(error (setq firsterror err) nil))))
(when (and (null all)
(> (car bounds) 0)
(null (ignore-errors (try-completion prefix table pred))))

View file

@ -1424,7 +1424,8 @@ It was \"a(say)\", but has changed to \"a{sv})\"."
(string-match "^/?\\([^/]+\\)" localname)
(list (tramp-gvfs-mount-spec-entry "type" "smb-share")
(tramp-gvfs-mount-spec-entry "server" host)
(tramp-gvfs-mount-spec-entry "share" (match-string 1 localname))))
(tramp-gvfs-mount-spec-entry
"share" (match-string 1 localname))))
((string-equal "obex" method)
(list (tramp-gvfs-mount-spec-entry "type" method)
(tramp-gvfs-mount-spec-entry
@ -1441,7 +1442,8 @@ It was \"a(say)\", but has changed to \"a{sv})\"."
,@(when domain
(list (tramp-gvfs-mount-spec-entry "domain" domain)))
,@(when port
(list (tramp-gvfs-mount-spec-entry "port" (number-to-string port))))))
(list (tramp-gvfs-mount-spec-entry
"port" (number-to-string port))))))
(mount-pref
(if (and (string-match "\\`dav" method)
(string-match "^/?[^/]+" localname))

View file

@ -690,7 +690,7 @@ Useful for \"rsync\" like methods.")
;; Tramp only knows how to deal with `file-name-handler-alist', not
;; the other places.
;; Currently, we have the choice between 'ftp, 'sep, and 'url.
;; Currently, we have the choice between 'ftp and 'sep.
;;;###autoload
(defcustom tramp-syntax
(if (featurep 'xemacs) 'sep 'ftp)
@ -699,20 +699,15 @@ Useful for \"rsync\" like methods.")
It can have the following values:
'ftp -- Ange-FTP respective EFS like syntax (GNU Emacs default)
'sep -- Syntax as defined for XEmacs (not available yet for GNU Emacs)
'url -- URL-like syntax."
'sep -- Syntax as defined for XEmacs."
:group 'tramp
:type (if (featurep 'xemacs)
'(choice (const :tag "EFS" ftp)
(const :tag "XEmacs" sep)
(const :tag "URL" url))
'(choice (const :tag "Ange-FTP" ftp)
(const :tag "URL" url))))
:version "24.4"
:type `(choice (const :tag ,(if (featurep 'xemacs) "EFS" "Ange-FTP") ftp)
(const :tag "XEmacs" sep)))
(defconst tramp-prefix-format
(cond ((equal tramp-syntax 'ftp) "/")
((equal tramp-syntax 'sep) "/[")
((equal tramp-syntax 'url) "/")
(t (error "Wrong `tramp-syntax' defined")))
"String matching the very beginning of Tramp file names.
Used in `tramp-make-tramp-file-name'.")
@ -729,7 +724,6 @@ Should always start with \"^\". Derived from `tramp-prefix-format'.")
(defconst tramp-postfix-method-format
(cond ((equal tramp-syntax 'ftp) ":")
((equal tramp-syntax 'sep) "/")
((equal tramp-syntax 'url) "://")
(t (error "Wrong `tramp-syntax' defined")))
"String matching delimiter between method and user or host names.
Used in `tramp-make-tramp-file-name'.")
@ -776,7 +770,6 @@ Derived from `tramp-postfix-user-format'.")
(defconst tramp-prefix-ipv6-format
(cond ((equal tramp-syntax 'ftp) "[")
((equal tramp-syntax 'sep) "")
((equal tramp-syntax 'url) "[")
(t (error "Wrong `tramp-syntax' defined")))
"String matching left hand side of IPv6 addresses.
Used in `tramp-make-tramp-file-name'.")
@ -796,7 +789,6 @@ Derived from `tramp-prefix-ipv6-format'.")
(defconst tramp-postfix-ipv6-format
(cond ((equal tramp-syntax 'ftp) "]")
((equal tramp-syntax 'sep) "")
((equal tramp-syntax 'url) "]")
(t (error "Wrong `tramp-syntax' defined")))
"String matching right hand side of IPv6 addresses.
Used in `tramp-make-tramp-file-name'.")
@ -809,7 +801,6 @@ Derived from `tramp-postfix-ipv6-format'.")
(defconst tramp-prefix-port-format
(cond ((equal tramp-syntax 'ftp) "#")
((equal tramp-syntax 'sep) "#")
((equal tramp-syntax 'url) ":")
(t (error "Wrong `tramp-syntax' defined")))
"String matching delimiter between host names and port numbers.")
@ -838,7 +829,6 @@ Derived from `tramp-postfix-hop-format'.")
(defconst tramp-postfix-host-format
(cond ((equal tramp-syntax 'ftp) ":")
((equal tramp-syntax 'sep) "]")
((equal tramp-syntax 'url) "")
(t (error "Wrong `tramp-syntax' defined")))
"String matching delimiter between host names and localnames.
Used in `tramp-make-tramp-file-name'.")
@ -908,16 +898,10 @@ On W32 systems, the volume letter must be ignored.")
XEmacs uses a separate filename syntax for Tramp and EFS.
See `tramp-file-name-structure' for more explanations.")
;;;###autoload
(defconst tramp-file-name-regexp-url "\\`/[^/|:]+://"
"Value for `tramp-file-name-regexp' for URL-like remoting.
See `tramp-file-name-structure' for more explanations.")
;;;###autoload
(defconst tramp-file-name-regexp
(cond ((equal tramp-syntax 'ftp) tramp-file-name-regexp-unified)
((equal tramp-syntax 'sep) tramp-file-name-regexp-separate)
((equal tramp-syntax 'url) tramp-file-name-regexp-url)
(t (error "Wrong `tramp-syntax' defined")))
"Regular expression matching file names handled by Tramp.
This regexp should match Tramp file names but no other file names.
@ -951,17 +935,10 @@ On W32 systems, the volume letter must be ignored.")
XEmacs uses a separate filename syntax for Tramp and EFS.
See `tramp-file-name-structure' for more explanations.")
;;;###autoload
(defconst tramp-completion-file-name-regexp-url
"\\`/[^/:]+\\(:\\(/\\(/[^/]*\\)?\\)?\\)?\\'"
"Value for `tramp-completion-file-name-regexp' for URL-like remoting.
See `tramp-file-name-structure' for more explanations.")
;;;###autoload
(defconst tramp-completion-file-name-regexp
(cond ((equal tramp-syntax 'ftp) tramp-completion-file-name-regexp-unified)
((equal tramp-syntax 'sep) tramp-completion-file-name-regexp-separate)
((equal tramp-syntax 'url) tramp-completion-file-name-regexp-url)
(t (error "Wrong `tramp-syntax' defined")))
"Regular expression matching file names handled by Tramp completion.
This regexp should match partial Tramp file names only.
@ -2542,64 +2519,40 @@ They are collected by `tramp-completion-dissect-file-name1'."
tramp-prefix-ipv6-regexp
"\\(" tramp-completion-ipv6-regexp x-nil "\\)$")
nil 1 2 nil))
;; "/method:user" "/[method/user" "/method://user"
;; "/method:user" "/[method/user"
(tramp-completion-file-name-structure7
(list (concat tramp-prefix-regexp
"\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp
"\\(" tramp-user-regexp x-nil "\\)$")
1 2 nil nil))
;; "/method:host" "/[method/host" "/method://host"
;; "/method:host" "/[method/host"
(tramp-completion-file-name-structure8
(list (concat tramp-prefix-regexp
"\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp
"\\(" tramp-host-regexp x-nil "\\)$")
1 nil 2 nil))
;; "/method:[ipv6" "/[method/ipv6" "/method://[ipv6"
;; "/method:[ipv6" "/[method/ipv6"
(tramp-completion-file-name-structure9
(list (concat tramp-prefix-regexp
"\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp
tramp-prefix-ipv6-regexp
"\\(" tramp-completion-ipv6-regexp x-nil "\\)$")
1 nil 2 nil))
;; "/method:user@host" "/[method/user@host" "/method://user@host"
;; "/method:user@host" "/[method/user@host"
(tramp-completion-file-name-structure10
(list (concat tramp-prefix-regexp
"\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp
"\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp
"\\(" tramp-host-regexp x-nil "\\)$")
1 2 3 nil))
;; "/method:user@[ipv6" "/[method/user@ipv6" "/method://user@[ipv6"
;; "/method:user@[ipv6" "/[method/user@ipv6"
(tramp-completion-file-name-structure11
(list (concat tramp-prefix-regexp
"\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp
"\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp
tramp-prefix-ipv6-regexp
"\\(" tramp-completion-ipv6-regexp x-nil "\\)$")
1 2 3 nil))
;; "/method: "/method:/"
(tramp-completion-file-name-structure12
(list
(if (equal tramp-syntax 'url)
(concat tramp-prefix-regexp
"\\(" tramp-method-regexp "\\)"
"\\(" (substring tramp-postfix-method-regexp 0 1)
"\\|" (substring tramp-postfix-method-regexp 1 2) "\\)"
"\\(" "\\)$")
;; Should not match if not URL syntax.
(concat tramp-prefix-regexp "/$"))
1 3 nil nil))
;; "/method: "/method:/"
(tramp-completion-file-name-structure13
(list
(if (equal tramp-syntax 'url)
(concat tramp-prefix-regexp
"\\(" tramp-method-regexp "\\)"
"\\(" (substring tramp-postfix-method-regexp 0 1)
"\\|" (substring tramp-postfix-method-regexp 1 2) "\\)"
"\\(" "\\)$")
;; Should not match if not URL syntax.
(concat tramp-prefix-regexp "/$"))
1 nil 3 nil)))
1 2 3 nil)))
(mapc (lambda (structure)
(add-to-list 'result
@ -2616,8 +2569,6 @@ They are collected by `tramp-completion-dissect-file-name1'."
tramp-completion-file-name-structure9
tramp-completion-file-name-structure10
tramp-completion-file-name-structure11
tramp-completion-file-name-structure12
tramp-completion-file-name-structure13
tramp-file-name-structure))
(delq nil result)))
@ -3289,35 +3240,19 @@ User is always nil."
(defun tramp-handle-substitute-in-file-name (filename)
"Like `substitute-in-file-name' for Tramp files.
\"//\" and \"/~\" substitute only in the local filename part.
If the URL Tramp syntax is chosen, \"//\" as method delimiter and \"/~\" at
beginning of local filename are not substituted."
\"//\" and \"/~\" substitute only in the local filename part."
;; First, we must replace environment variables.
(setq filename (tramp-replace-environment-variables filename))
(with-parsed-tramp-file-name filename nil
(if (equal tramp-syntax 'url)
;; We need to check localname only. The other parts cannot contain
;; "//" or "/~".
(if (and (> (length localname) 1)
(or (string-match "//" localname)
(string-match "/~" localname 1)))
(tramp-run-real-handler 'substitute-in-file-name (list filename))
(tramp-make-tramp-file-name
(when method (substitute-in-file-name method))
(when user (substitute-in-file-name user))
(when host (substitute-in-file-name host))
(when localname
(tramp-run-real-handler
'substitute-in-file-name (list localname)))))
;; Ignore in LOCALNAME everything before "//" or "/~".
(when (and (stringp localname) (string-match ".+?/\\(/\\|~\\)" localname))
(setq filename
(concat (file-remote-p filename)
(replace-match "\\1" nil nil localname)))
;; "/m:h:~" does not work for completion. We use "/m:h:~/".
(when (string-match "~$" filename)
(setq filename (concat filename "/"))))
(tramp-run-real-handler 'substitute-in-file-name (list filename)))))
;; Ignore in LOCALNAME everything before "//" or "/~".
(when (and (stringp localname) (string-match ".+?/\\(/\\|~\\)" localname))
(setq filename
(concat (file-remote-p filename)
(replace-match "\\1" nil nil localname)))
;; "/m:h:~" does not work for completion. We use "/m:h:~/".
(when (string-match "~$" filename)
(setq filename (concat filename "/"))))
(tramp-run-real-handler 'substitute-in-file-name (list filename))))
(defun tramp-handle-unhandled-file-name-directory (_filename)
"Like `unhandled-file-name-directory' for Tramp files."

View file

@ -6905,32 +6905,38 @@ comment at the start of cc-engine.el for more info."
;; Skip over type decl prefix operators. (Note similar code in
;; `c-font-lock-declarators'.)
(while (and (looking-at c-type-decl-prefix-key)
(if (and (c-major-mode-is 'c++-mode)
(match-beginning 3))
;; If the third submatch matches in C++ then
;; we're looking at an identifier that's a
;; prefix only if it specifies a member pointer.
(when (setq got-identifier (c-forward-name))
(if (looking-at "\\(::\\)")
;; We only check for a trailing "::" and
;; let the "*" that should follow be
;; matched in the next round.
(progn (setq got-identifier nil) t)
;; It turned out to be the real identifier,
;; so stop.
nil))
t))
(if (eq (char-after) ?\()
(if (and c-recognize-typeless-decls
(equal c-type-decl-prefix-key "\\<\\>"))
(when (eq (char-after) ?\()
(progn
(setq paren-depth (1+ paren-depth))
(forward-char))
(unless got-prefix-before-parens
(setq got-prefix-before-parens (= paren-depth 0)))
(setq got-prefix t)
(goto-char (match-end 1)))
(c-forward-syntactic-ws))
(forward-char)))
(while (and (looking-at c-type-decl-prefix-key)
(if (and (c-major-mode-is 'c++-mode)
(match-beginning 3))
;; If the third submatch matches in C++ then
;; we're looking at an identifier that's a
;; prefix only if it specifies a member pointer.
(when (setq got-identifier (c-forward-name))
(if (looking-at "\\(::\\)")
;; We only check for a trailing "::" and
;; let the "*" that should follow be
;; matched in the next round.
(progn (setq got-identifier nil) t)
;; It turned out to be the real identifier,
;; so stop.
nil))
t))
(if (eq (char-after) ?\()
(progn
(setq paren-depth (1+ paren-depth))
(forward-char))
(unless got-prefix-before-parens
(setq got-prefix-before-parens (= paren-depth 0)))
(setq got-prefix t)
(goto-char (match-end 1)))
(c-forward-syntactic-ws)))
(setq got-parens (> paren-depth 0))

View file

@ -2816,7 +2816,8 @@ is in effect when this is matched (see `c-identifier-syntax-table')."
"\\>")
"")
"\\)")
(java idl) "\\([\[\(]\\)")
java "\\([\[\(\)]\\)"
idl "\\([\[\(]\\)")
(c-lang-defvar c-type-decl-suffix-key (c-lang-const c-type-decl-suffix-key)
'dont-doc)
@ -2937,7 +2938,7 @@ calls before a brace block. This setting does not affect declarations
that are preceded by a declaration starting keyword, so
e.g. `c-typeless-decl-kwds' may still be used when it's set to nil."
t nil
(c c++ objc) t)
(c c++ objc java) t)
(c-lang-defvar c-recognize-typeless-decls
(c-lang-const c-recognize-typeless-decls))

View file

@ -1862,11 +1862,11 @@ See `font-lock-syntax-table'.")
"using")
'symbols))
1 'font-lock-builtin-face)
;; Perl-ish keywords
"\\_<\\(?:BEGIN\\|END\\)\\_>\\|^__END__$"
;; here-doc beginnings
`(,ruby-here-doc-beg-re 0 (unless (ruby-singleton-class-p (match-beginning 0))
'font-lock-string-face))
;; Perl-ish keywords
"\\_<\\(?:BEGIN\\|END\\)\\_>\\|^__END__$"
;; variables
`(,(concat ruby-font-lock-keyword-beg-re
"\\_<\\(nil\\|self\\|true\\|false\\)\\>")

View file

@ -490,12 +490,13 @@ If `replace-lax-whitespace' is non-nil, a space or spaces in the string
to be replaced will match a sequence of whitespace chars defined by the
regexp in `search-whitespace-regexp'.
In Transient Mark mode, if the mark is active, operate on the contents
of the region. Otherwise, operate from point to the end of the buffer.
Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace
only matches surrounded by word boundaries.
Fourth and fifth arg START and END specify the region to operate on.
Operates on the region between START and END (if both are nil, from point
to the end of the buffer). Interactively, if Transient Mark mode is
enabled and the mark is active, operates on the contents of the region;
otherwise from point to the end of the buffer.
Use \\<minibuffer-local-map>\\[next-history-element] \
to pull the last incremental search string to the minibuffer

View file

@ -468,7 +468,7 @@ alternatives, starting from zero."
nil
(("editor") ("editora") ("editorb") ("editorc")
("translator") ("annotator") ("commentator")
("introduction") ("foreword") ("afterword") ("titleaddon")
("introduction") ("foreword") ("afterword") ("subtitle") ("titleaddon")
("maintitle") ("mainsubtitle") ("maintitleaddon")
("language") ("origlanguage") ("volume") ("part") ("edition") ("volumes")
("series") ("number") ("note") ("publisher") ("location") ("isbn")

View file

@ -1,3 +1,85 @@
2013-09-07 Paul Eggert <eggert@cs.ucla.edu>
Port --without-x --enable-gcc-warnings to Fedora 19.
* gfilenotify.c (globals_of_gfilenotify):
Call g_type_init only if using an older glib version that needs it.
2013-09-06 Dmitry Antipov <dmantipov@yandex.ru>
* lisp.h (last_glyphless_glyph_frame, last_glyphless_glyph_face_id)
(last_glyphless_glyph_merged_face_id): Remove declarations.
* dispextern.h (merge_glyphless_glyph_face): Add prototype.
* xdisp.c (last_glyphless_glyph_frame, last_glyphless_glyph_face_id)
(last_glyphless_glyph_merged_face_id): Now static.
(merge_escape_glyph_face): New function, refactored from...
(get_next_display_element): ...here.
(merge_glyphless_glyph_face): New function, refactored from...
(produce_glyphless_glyph): ...here...
* term.c (produce_glyphless_glyph): ...and here.
2013-09-06 Stefan Monnier <monnier@iro.umontreal.ca>
* eval.c (eval_sub): Only call Ffunction if necessary.
2013-09-06 Dmitry Antipov <dmantipov@yandex.ru>
Attempt to make redisplay more selective when changing cursor type.
* frame.h (struct frame): New bitfield cursor_type_changed.
* xdisp.c (cursor_type_changed): Remove.
(try_cursor_movement, redisplay_window, try_window_id)
(set_frame_cursor_types, try_window_reusing_current_matrix):
Adjust to use per-frame bitfield.
(redisplay_internal): Look for cursor type change on each visible
frame and consider all frames if cursor type has been changed on
the frame other than selected. If cursor type has been changed on
selected frame only, do not use fast update.
2013-09-06 Dmitry Antipov <dmantipov@yandex.ru>
Attempt to make redisplay more selective when changing fonts.
* frame.h (struct frame): New bitfield fonts_changed.
* dispextern.h (fonts_changed_p, adjust_glyphs): Remove declaration.
(adjust_frame_glyphs): Add prototype.
* dispnew.c (fonts_changed_p): Remove.
(adjust_glyphs): Remove because we do not
adjust matrices on all frames at once any more.
(adjust_frame_glyphs): Block and unblock input here.
(adjust_glyph_matrix): Use fonts_changed.
(change_frame_size_1): Use adjust_frame_glyphs.
* font.c (font_open_entity): Use fonts_changed.
* frame.c (set_menu_bar_lines, Fmake_terminal_frame):
* w32fns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_show_tip):
* window.c (Fdelete_other_windows_internal, Fwindow_resize_apply)
(Fsplit_window_internal, Fdelete_window_internal, grow_mini_window)
(shrink_mini_window, Fresize_mini_window_internal)
(window_scroll_pixel_based, Fset_window_configuration)
(apply_window_adjustment, Fset_window_vscroll):
* xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_show_tip):
Use adjust_frame_glyphs.
* xdisp.c (redisplay_tool_bar, redisplay_window, try_window)
(try_window_reusing_current_matrix, try_window_id, display_line)
(IT_EXPAND_MATRIX_WIDTH): Use fonts_changed.
(redisplay_internal): Consider fonts_changed and adjust frame
matrices for each frame only if the frame is visible. If font
has been changed on some frame during full redisplay, retry
only visible frames where the font has been actually changed.
2013-09-05 Dmitry Antipov <dmantipov@yandex.ru>
Cache current header and mode line height for each window.
* window.h (struct window): New fields mode_line_height
and header_line_height.
* window.c (make_window): Initialize them.
* dispextern.h (CURRENT_MODE_LINE_HEIGHT)
(CURRENT_HEADER_LINE_HEIGHT): Use them. Adjust comment.
(current_mode_line_height, current_header_line_height):
Remove declaration.
* xdisp.c (current_mode_line_height, current_header_line_height):
Remove.
(pos_visible_p, init_xdisp): Adjust user.
(redisplay_window): Invalidate mode_line_height and
header_line_height if current and desired matrices do not agree.
2013-09-05 Dmitry Antipov <dmantipov@yandex.ru>
* fontset.c, window.c, xdisp.c (toplevel): Use TERM_HEADER.

View file

@ -1195,12 +1195,6 @@ struct glyph_row *matrix_row (struct glyph_matrix *, int);
((ROW)->phys_height - (ROW)->phys_ascent \
> (ROW)->height - (ROW)->ascent)
/* True means that fonts have been loaded since the last glyph
matrix adjustments. The function redisplay_internal adjusts glyph
matrices when this flag is true. */
extern bool fonts_changed_p;
/* A glyph for a space. */
extern struct glyph space_glyph;
@ -1428,31 +1422,31 @@ struct glyph_string
#define CURRENT_MODE_LINE_FACE_ID(W) \
(CURRENT_MODE_LINE_FACE_ID_3((W), XWINDOW (selected_window), (W)))
/* Return the current height of the mode line of window W. If not
known from current_mode_line_height, look at W's current glyph
matrix, or return a default based on the height of the font of the
face `mode-line'. */
/* Return the current height of the mode line of window W. If not known
from W->mode_line_height, look at W's current glyph matrix, or return
a default based on the height of the font of the face `mode-line'. */
#define CURRENT_MODE_LINE_HEIGHT(W) \
(current_mode_line_height >= 0 \
? current_mode_line_height \
: (MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix) \
? MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix) \
: estimate_mode_line_height (XFRAME ((W)->frame), \
CURRENT_MODE_LINE_FACE_ID (W))))
#define CURRENT_MODE_LINE_HEIGHT(W) \
(W->mode_line_height >= 0 \
? W->mode_line_height \
: (W->mode_line_height \
= (MATRIX_MODE_LINE_HEIGHT (W->current_matrix) \
? MATRIX_MODE_LINE_HEIGHT (W->current_matrix) \
: estimate_mode_line_height \
(XFRAME (W->frame), CURRENT_MODE_LINE_FACE_ID (W)))))
/* Return the current height of the header line of window W. If not
known from current_header_line_height, look at W's current glyph
matrix, or return an estimation based on the height of the font of
the face `header-line'. */
/* Return the current height of the header line of window W. If not known
from W->header_line_height, look at W's current glyph matrix, or return
an estimation based on the height of the font of the face `header-line'. */
#define CURRENT_HEADER_LINE_HEIGHT(W) \
(current_header_line_height >= 0 \
? current_header_line_height \
: (MATRIX_HEADER_LINE_HEIGHT ((W)->current_matrix) \
? MATRIX_HEADER_LINE_HEIGHT ((W)->current_matrix) \
: estimate_mode_line_height (XFRAME ((W)->frame), \
HEADER_LINE_FACE_ID)))
(W->header_line_height >= 0 \
? W->header_line_height \
: (W->header_line_height \
= (MATRIX_HEADER_LINE_HEIGHT (W->current_matrix) \
? MATRIX_HEADER_LINE_HEIGHT (W->current_matrix) \
: estimate_mode_line_height \
(XFRAME (W->frame), HEADER_LINE_FACE_ID))))
/* Return the height of the desired mode line of window W. */
@ -3201,7 +3195,6 @@ int frame_mode_line_height (struct frame *);
extern Lisp_Object Qtool_bar;
extern bool redisplaying_p;
extern int help_echo_showing_p;
extern int current_mode_line_height, current_header_line_height;
extern Lisp_Object help_echo_string, help_echo_window;
extern Lisp_Object help_echo_object, previous_help_echo_string;
extern ptrdiff_t help_echo_pos;
@ -3215,6 +3208,7 @@ extern ptrdiff_t compute_display_string_pos (struct text_pos *,
extern ptrdiff_t compute_display_string_end (ptrdiff_t,
struct bidi_string_data *);
extern void produce_stretch_glyph (struct it *);
extern int merge_glyphless_glyph_face (struct it *);
#ifdef HAVE_WINDOW_SYSTEM
@ -3455,7 +3449,7 @@ extern void cancel_line (int, struct frame *);
extern void init_desired_glyphs (struct frame *);
extern bool update_frame (struct frame *, bool, bool);
extern void bitch_at_user (void);
void adjust_glyphs (struct frame *);
extern void adjust_frame_glyphs (struct frame *);
void free_glyphs (struct frame *);
void free_window_matrices (struct window *);
void check_glyph_memory (void);

View file

@ -77,7 +77,6 @@ struct dim
static void update_frame_line (struct frame *, int);
static int required_matrix_height (struct window *);
static int required_matrix_width (struct window *);
static void adjust_frame_glyphs (struct frame *);
static void change_frame_size_1 (struct frame *, int, int, bool, bool, bool);
static void increment_row_positions (struct glyph_row *, ptrdiff_t, ptrdiff_t);
static void fill_up_frame_row_with_spaces (struct glyph_row *, int);
@ -152,16 +151,6 @@ static int glyph_pool_count;
static struct frame *frame_matrix_frame;
/* True means that fonts have been loaded since the last glyph
matrix adjustments. Redisplay must stop, and glyph matrices must
be adjusted when this flag becomes true during display. The
reason fonts can be loaded so late is that fonts of fontsets are
loaded on demand. Another reason is that a line contains many
characters displayed by zero width or very narrow glyphs of
variable-width fonts. */
bool fonts_changed_p;
/* Convert vpos and hpos from frame to window and vice versa.
This may only be used for terminal frames. */
@ -433,7 +422,7 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
|| right != matrix->right_margin_glyphs);
if (!marginal_areas_changed_p
&& !fonts_changed_p
&& !XFRAME (w->frame)->fonts_changed
&& !header_line_changed_p
&& matrix->window_left_col == WINDOW_LEFT_EDGE_COL (w)
&& matrix->window_top_line == WINDOW_TOP_EDGE_LINE (w)
@ -1799,37 +1788,17 @@ allocate_matrices_for_window_redisplay (struct window *w)
}
}
/* Re-allocate/ re-compute glyph matrices on frame F. If F is null,
do it for all frames; otherwise do it just for the given frame.
This function must be called when a new frame is created, its size
changes, or its window configuration changes. */
/* Allocate/reallocate glyph matrices of a single frame F.
This function must be called when a new frame is created,
its size changes, or its window configuration changes. */
void
adjust_glyphs (struct frame *f)
adjust_frame_glyphs (struct frame *f)
{
/* Block input so that expose events and other events that access
glyph matrices are not processed while we are changing them. */
block_input ();
if (f)
adjust_frame_glyphs (f);
else
{
Lisp_Object tail, lisp_frame;
FOR_EACH_FRAME (tail, lisp_frame)
adjust_frame_glyphs (XFRAME (lisp_frame));
}
unblock_input ();
}
/* Allocate/reallocate glyph matrices of a single frame F. */
static void
adjust_frame_glyphs (struct frame *f)
{
if (FRAME_WINDOW_P (f))
adjust_frame_glyphs_for_window_redisplay (f);
else
@ -1839,6 +1808,8 @@ adjust_frame_glyphs (struct frame *f)
adjust_decode_mode_spec_buffer (f);
f->glyphs_initialized_p = 1;
unblock_input ();
}
/* Return true if any window in the tree has nonzero window margins. See
@ -5546,7 +5517,7 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth,
w->cursor.vpos = w->cursor.y = 0;
}
adjust_glyphs (f);
adjust_frame_glyphs (f);
calculate_costs (f);
SET_FRAME_GARBAGED (f);
f->resized_p = 1;

View file

@ -2146,11 +2146,10 @@ eval_sub (Lisp_Object form)
/* Optimize for no indirection. */
fun = original_fun;
if (SYMBOLP (fun) && !NILP (fun)
&& (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
fun = indirect_function (fun);
else
if (!SYMBOLP (fun))
fun = Ffunction (Fcons (fun, Qnil));
else if (!NILP (fun) && (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
fun = indirect_function (fun);
if (SUBRP (fun))
{

View file

@ -2866,14 +2866,14 @@ font_open_entity (struct frame *f, Lisp_Object entity, int pixel_size)
{
FRAME_SMALLEST_CHAR_WIDTH (f) = min_width;
FRAME_SMALLEST_FONT_HEIGHT (f) = height;
fonts_changed_p = 1;
f->fonts_changed = 1;
}
else
{
if (FRAME_SMALLEST_CHAR_WIDTH (f) > min_width)
FRAME_SMALLEST_CHAR_WIDTH (f) = min_width, fonts_changed_p = 1;
FRAME_SMALLEST_CHAR_WIDTH (f) = min_width, f->fonts_changed = 1;
if (FRAME_SMALLEST_FONT_HEIGHT (f) > height)
FRAME_SMALLEST_FONT_HEIGHT (f) = height, fonts_changed_p = 1;
FRAME_SMALLEST_FONT_HEIGHT (f) = height, f->fonts_changed = 1;
}
#endif

View file

@ -224,7 +224,7 @@ set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
FRAME_WINDOW_SIZES_CHANGED (f) = 1;
FRAME_MENU_BAR_LINES (f) = nlines;
set_menu_bar_lines_1 (f->root_window, nlines - olines);
adjust_glyphs (f);
adjust_frame_glyphs (f);
}
}
@ -712,7 +712,7 @@ affects all frames on the same terminal device. */)
change_frame_size (f, height, width, 0, 0, 0);
}
adjust_glyphs (f);
adjust_frame_glyphs (f);
calculate_costs (f);
XSETFRAME (frame, f);

View file

@ -210,6 +210,13 @@ struct frame
unsigned external_tool_bar : 1;
#endif
/* Nonzero means that fonts have been loaded since the last glyph
matrix adjustments. */
unsigned fonts_changed : 1;
/* Nonzero means that cursor type has been changed. */
unsigned cursor_type_changed : 1;
/* Margin at the top of the frame. Used to display the tool-bar. */
int tool_bar_lines;

View file

@ -249,7 +249,9 @@ WATCH-DESCRIPTOR should be an object returned by `gfile-add-watch'. */)
void
globals_of_gfilenotify (void)
{
#if ! GLIB_CHECK_VERSION (2, 36, 0)
g_type_init ();
#endif
watch_list = Qnil;
}

View file

@ -3359,9 +3359,6 @@ extern Lisp_Object Qglyphless_char;
extern Lisp_Object QCdata, QCfile;
extern Lisp_Object QCmap;
extern Lisp_Object Qrisky_local_variable;
extern struct frame *last_glyphless_glyph_frame;
extern int last_glyphless_glyph_face_id;
extern int last_glyphless_glyph_merged_face_id;
extern int noninteractive_need_newline;
extern Lisp_Object echo_area_buffer[2];
extern void add_to_log (const char *, Lisp_Object, Lisp_Object);

View file

@ -1800,27 +1800,10 @@ append_glyphless_glyph (struct it *it, int face_id, const char *str)
static void
produce_glyphless_glyph (struct it *it, Lisp_Object acronym)
{
int face_id;
int len;
int len, face_id = merge_glyphless_glyph_face (it);
char buf[sizeof "\\x" + max (6, (sizeof it->c * CHAR_BIT + 3) / 4)];
char const *str = " ";
/* Get a face ID for the glyph by utilizing a cache (the same way as
done for `escape-glyph' in get_next_display_element). */
if (it->f == last_glyphless_glyph_frame
&& it->face_id == last_glyphless_glyph_face_id)
{
face_id = last_glyphless_glyph_merged_face_id;
}
else
{
/* Merge the `glyphless-char' face into the current face. */
face_id = merge_faces (it->f, Qglyphless_char, 0, it->face_id);
last_glyphless_glyph_frame = it->f;
last_glyphless_glyph_face_id = it->face_id;
last_glyphless_glyph_merged_face_id = face_id;
}
if (it->glyphless_method == GLYPHLESS_DISPLAY_THIN_SPACE)
{
/* As there's no way to produce a thin space, we produce a space

View file

@ -1637,7 +1637,7 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
do_pending_window_change (0);
}
adjust_glyphs (f);
adjust_frame_glyphs (f);
}
@ -1679,7 +1679,7 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
FRAME_TOOL_BAR_LINES (f) = nlines;
resize_frame_windows (f, FRAME_LINES (f), 0);
adjust_glyphs (f);
adjust_frame_glyphs (f);
/* We also have to make sure that the internal border at the top of
the frame, below the menu bar or tool bar, is redrawn when the
@ -6059,7 +6059,7 @@ Text larger than the specified size is clipped. */)
}
FRAME_TOTAL_COLS (f) = WINDOW_TOTAL_COLS (w);
adjust_glyphs (f);
adjust_frame_glyphs (f);
w->pseudo_window_p = 1;
/* Display the tooltip text in a temporary buffer. */
@ -6128,7 +6128,7 @@ Text larger than the specified size is clipped. */)
width /= WINDOW_FRAME_COLUMN_WIDTH (w);
w->total_cols = width;
FRAME_TOTAL_COLS (f) = width;
adjust_glyphs (f);
adjust_frame_glyphs (f);
w->pseudo_window_p = 1;
clear_glyph_matrix (w->desired_matrix);
clear_glyph_matrix (w->current_matrix);

View file

@ -2945,7 +2945,7 @@ window-start value is reasonable when this function is called. */)
}
}
adjust_glyphs (f);
adjust_frame_glyphs (f);
unblock_input ();
run_window_configuration_change_hook (f);
@ -3419,6 +3419,7 @@ make_window (void)
non-Lisp data, so do it only for slots which should not be zero. */
w->nrows_scale_factor = w->ncols_scale_factor = 1;
w->left_fringe_width = w->right_fringe_width = -1;
w->mode_line_height = w->header_line_height = -1;
w->phys_cursor_type = -1;
w->phys_cursor_width = -1;
w->scroll_bar_width = -1;
@ -3644,7 +3645,7 @@ be applied on the Elisp level. */)
windows_or_buffers_changed++;
FRAME_WINDOW_SIZES_CHANGED (f) = 1;
adjust_glyphs (f);
adjust_frame_glyphs (f);
unblock_input ();
run_window_configuration_change_hook (f);
@ -3914,7 +3915,7 @@ set correctly. See the code of `split-window' for how this is done. */)
block_input ();
window_resize_apply (p, horflag);
adjust_glyphs (f);
adjust_frame_glyphs (f);
/* Set buffer of NEW to buffer of reference window. Don't run
any hooks. */
set_window_buffer (new, r->contents, 0, 1);
@ -4043,7 +4044,7 @@ Signal an error when WINDOW is the only window on its frame. */)
recombine_windows (sibling);
}
adjust_glyphs (f);
adjust_frame_glyphs (f);
if (!WINDOW_LIVE_P (FRAME_SELECTED_WINDOW (f)))
/* We deleted the frame's selected window. */
@ -4130,7 +4131,7 @@ grow_mini_window (struct window *w, int delta)
w->total_lines -= XINT (value);
/* Enforce full redisplay. FIXME: make it more selective. */
windows_or_buffers_changed++;
adjust_glyphs (f);
adjust_frame_glyphs (f);
unblock_input ();
}
}
@ -4164,7 +4165,7 @@ shrink_mini_window (struct window *w)
w->total_lines = 1;
/* Enforce full redisplay. FIXME: make it more selective. */
windows_or_buffers_changed++;
adjust_glyphs (f);
adjust_frame_glyphs (f);
unblock_input ();
}
/* If the above failed for whatever strange reason we must make a
@ -4205,7 +4206,7 @@ DEFUN ("resize-mini-window-internal", Fresize_mini_window_internal, Sresize_mini
windows_or_buffers_changed++;
FRAME_WINDOW_SIZES_CHANGED (f) = 1;
adjust_glyphs (f);
adjust_frame_glyphs (f);
unblock_input ();
run_window_configuration_change_hook (f);
@ -4476,7 +4477,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
visible. */
w->vscroll = (it.last_visible_y
- it.current_y + it.max_ascent + it.max_descent);
adjust_glyphs (it.f);
adjust_frame_glyphs (it.f);
}
else
{
@ -5753,7 +5754,7 @@ the return value is nil. Otherwise the value is t. */)
++n;
}
adjust_glyphs (f);
adjust_frame_glyphs (f);
unblock_input ();
/* Scan dead buffer windows. */
@ -6082,7 +6083,7 @@ apply_window_adjustment (struct window *w)
clear_glyph_matrix (w->current_matrix);
w->window_end_valid = 0;
windows_or_buffers_changed++;
adjust_glyphs (XFRAME (WINDOW_FRAME (w)));
adjust_frame_glyphs (XFRAME (WINDOW_FRAME (w)));
}
@ -6348,7 +6349,7 @@ If PIXELS-P is non-nil, the return value is VSCROLL. */)
/* Adjust glyph matrix of the frame if the virtual display
area becomes larger than before. */
if (w->vscroll < 0 && w->vscroll < old_dy)
adjust_glyphs (f);
adjust_frame_glyphs (f);
/* Prevent redisplay shortcuts. */
XBUFFER (w->contents)->prevent_redisplay_optimizations_p = 1;

View file

@ -264,6 +264,12 @@ struct window
A value of -1 means use frame values. */
int scroll_bar_width;
/* Effective height of the mode line, or -1 if not known. */
int mode_line_height;
/* Effective height of the header line, or -1 if not known. */
int header_line_height;
/* Z - the buffer position of the last glyph in the current
matrix of W. Only valid if window_end_valid is nonzero. */
ptrdiff_t window_end_pos;

View file

@ -512,10 +512,6 @@ int update_mode_lines;
int windows_or_buffers_changed;
/* Nonzero means a frame's cursor type has been changed. */
static int cursor_type_changed;
/* Nonzero after display_mode_line if %l was used and it displayed a
line number. */
@ -573,12 +569,6 @@ static int last_height;
int help_echo_showing_p;
/* If >= 0, computed, exact values of mode-line and header-line height
to use in the macros CURRENT_MODE_LINE_HEIGHT and
CURRENT_HEADER_LINE_HEIGHT. */
int current_mode_line_height, current_header_line_height;
/* The maximum distance to look ahead for text properties. Values
that are too small let us call compute_char_face and similar
functions too often which is expensive. Values that are too large
@ -1349,12 +1339,12 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
/* Compute exact mode line heights. */
if (WINDOW_WANTS_MODELINE_P (w))
current_mode_line_height
w->mode_line_height
= display_mode_line (w, CURRENT_MODE_LINE_FACE_ID (w),
BVAR (current_buffer, mode_line_format));
if (WINDOW_WANTS_HEADER_LINE_P (w))
current_header_line_height
w->header_line_height
= display_mode_line (w, HEADER_LINE_FACE_ID,
BVAR (current_buffer, header_line_format));
@ -1647,8 +1637,6 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
if (old_buffer)
set_buffer_internal_1 (old_buffer);
current_header_line_height = current_mode_line_height = -1;
if (visible_p && w->hscroll > 0)
*x -=
window_hscroll_limited (w, WINDOW_XFRAME (w))
@ -6678,17 +6666,59 @@ lookup_glyphless_char_display (int c, struct it *it)
return glyphless_method;
}
/* Load IT's display element fields with information about the next
display element from the current position of IT. Value is zero if
end of buffer (or C string) is reached. */
/* Merge escape glyph face and cache the result. */
static struct frame *last_escape_glyph_frame = NULL;
static int last_escape_glyph_face_id = (1 << FACE_ID_BITS);
static int last_escape_glyph_merged_face_id = 0;
struct frame *last_glyphless_glyph_frame = NULL;
int last_glyphless_glyph_face_id = (1 << FACE_ID_BITS);
int last_glyphless_glyph_merged_face_id = 0;
static int
merge_escape_glyph_face (struct it *it)
{
int face_id;
if (it->f == last_escape_glyph_frame
&& it->face_id == last_escape_glyph_face_id)
face_id = last_escape_glyph_merged_face_id;
else
{
/* Merge the `escape-glyph' face into the current face. */
face_id = merge_faces (it->f, Qescape_glyph, 0, it->face_id);
last_escape_glyph_frame = it->f;
last_escape_glyph_face_id = it->face_id;
last_escape_glyph_merged_face_id = face_id;
}
return face_id;
}
/* Likewise for glyphless glyph face. */
static struct frame *last_glyphless_glyph_frame = NULL;
static int last_glyphless_glyph_face_id = (1 << FACE_ID_BITS);
static int last_glyphless_glyph_merged_face_id = 0;
int
merge_glyphless_glyph_face (struct it *it)
{
int face_id;
if (it->f == last_glyphless_glyph_frame
&& it->face_id == last_glyphless_glyph_face_id)
face_id = last_glyphless_glyph_merged_face_id;
else
{
/* Merge the `glyphless-char' face into the current face. */
face_id = merge_faces (it->f, Qglyphless_char, 0, it->face_id);
last_glyphless_glyph_frame = it->f;
last_glyphless_glyph_face_id = it->face_id;
last_glyphless_glyph_merged_face_id = face_id;
}
return face_id;
}
/* Load IT's display element fields with information about the next
display element from the current position of IT. Value is zero if
end of buffer (or C string) is reached. */
static int
get_next_display_element (struct it *it)
@ -6836,24 +6866,10 @@ get_next_display_element (struct it *it)
g = GLYPH_CODE_CHAR (gc);
lface_id = GLYPH_CODE_FACE (gc);
}
if (lface_id)
{
face_id = merge_faces (it->f, Qt, lface_id, it->face_id);
}
else if (it->f == last_escape_glyph_frame
&& it->face_id == last_escape_glyph_face_id)
{
face_id = last_escape_glyph_merged_face_id;
}
else
{
/* Merge the escape-glyph face into the current face. */
face_id = merge_faces (it->f, Qescape_glyph, 0,
it->face_id);
last_escape_glyph_frame = it->f;
last_escape_glyph_face_id = it->face_id;
last_escape_glyph_merged_face_id = face_id;
}
face_id = (lface_id
? merge_faces (it->f, Qt, lface_id, it->face_id)
: merge_escape_glyph_face (it));
XSETINT (it->ctl_chars[0], g);
XSETINT (it->ctl_chars[1], c ^ 0100);
@ -6885,27 +6901,10 @@ get_next_display_element (struct it *it)
escape_glyph = GLYPH_CODE_CHAR (gc);
lface_id = GLYPH_CODE_FACE (gc);
}
if (lface_id)
{
/* The display table specified a face.
Merge it into face_id and also into escape_glyph. */
face_id = merge_faces (it->f, Qt, lface_id,
it->face_id);
}
else if (it->f == last_escape_glyph_frame
&& it->face_id == last_escape_glyph_face_id)
{
face_id = last_escape_glyph_merged_face_id;
}
else
{
/* Merge the escape-glyph face into the current face. */
face_id = merge_faces (it->f, Qescape_glyph, 0,
it->face_id);
last_escape_glyph_frame = it->f;
last_escape_glyph_face_id = it->face_id;
last_escape_glyph_merged_face_id = face_id;
}
face_id = (lface_id
? merge_faces (it->f, Qt, lface_id, it->face_id)
: merge_escape_glyph_face (it));
/* Draw non-ASCII hyphen with just highlighting: */
@ -11993,7 +11992,7 @@ redisplay_tool_bar (struct frame *f)
if (WINDOW_TOTAL_LINES (w) != old_height)
{
clear_glyph_matrix (w->desired_matrix);
fonts_changed_p = 1;
f->fonts_changed = 1;
return 1;
}
}
@ -12094,7 +12093,7 @@ redisplay_tool_bar (struct frame *f)
{
clear_glyph_matrix (w->desired_matrix);
f->n_tool_bar_rows = nrows;
fonts_changed_p = 1;
f->fonts_changed = 1;
return 1;
}
}
@ -12980,15 +12979,6 @@ redisplay_internal (void)
last_glyphless_glyph_frame = NULL;
last_glyphless_glyph_face_id = (1 << FACE_ID_BITS);
/* If new fonts have been loaded that make a glyph matrix adjustment
necessary, do it. */
if (fonts_changed_p)
{
adjust_glyphs (NULL);
++windows_or_buffers_changed;
fonts_changed_p = 0;
}
/* If face_change_count is non-zero, init_iterator will free all
realized faces, which includes the faces referenced from current
matrices. So, we can't reuse current matrices in this case. */
@ -13019,7 +13009,19 @@ redisplay_internal (void)
struct frame *f = XFRAME (frame);
if (FRAME_VISIBLE_P (f))
++number_of_visible_frames;
{
++number_of_visible_frames;
/* Adjust matrices for visible frames only. */
if (f->fonts_changed)
{
adjust_frame_glyphs (f);
f->fonts_changed = 0;
}
/* If cursor type has been changed on the frame
other than selected, consider all frames. */
if (f != sf && f->cursor_type_changed)
update_mode_lines++;
}
clear_desired_matrices (f);
}
@ -13068,8 +13070,7 @@ redisplay_internal (void)
}
consider_all_windows_p = (update_mode_lines
|| buffer_shared_and_changed ()
|| cursor_type_changed);
|| buffer_shared_and_changed ());
/* If specs for an arrow have changed, do thorough redisplay
to ensure we remove any arrow that should no longer exist. */
@ -13103,9 +13104,7 @@ redisplay_internal (void)
if (!display_last_displayed_message_p)
message_cleared_p = 0;
if (fonts_changed_p)
goto retry;
else if (window_height_changed_p)
if (window_height_changed_p)
{
consider_all_windows_p = 1;
++update_mode_lines;
@ -13162,6 +13161,7 @@ redisplay_internal (void)
&& !current_buffer->prevent_redisplay_optimizations_p
&& FRAME_VISIBLE_P (XFRAME (w->frame))
&& !FRAME_OBSCURED_P (XFRAME (w->frame))
&& !XFRAME (w->frame)->cursor_type_changed
/* Make sure recorded data applies to current buffer, etc. */
&& this_line_buffer == current_buffer
&& match_p
@ -13380,6 +13380,8 @@ redisplay_internal (void)
&& !EQ (FRAME_TTY (f)->top_frame, frame))
continue;
retry_frame:
if (FRAME_WINDOW_P (f) || FRAME_TERMCAP_P (f) || f == sf)
{
/* Mark all the scroll bars to be removed; we'll redeem
@ -13399,20 +13401,22 @@ redisplay_internal (void)
if (FRAME_TERMINAL (f)->judge_scroll_bars_hook)
FRAME_TERMINAL (f)->judge_scroll_bars_hook (f);
/* If fonts changed, display again. */
/* ??? rms: I suspect it is a mistake to jump all the way
back to retry here. It should just retry this frame. */
if (fonts_changed_p)
goto retry;
if (FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f))
{
/* If fonts changed on visible frame, display again. */
if (f->fonts_changed)
{
adjust_frame_glyphs (f);
f->fonts_changed = 0;
goto retry_frame;
}
/* See if we have to hscroll. */
if (!f->already_hscrolled_p)
{
f->already_hscrolled_p = 1;
if (hscroll_windows (f->root_window))
goto retry;
goto retry_frame;
}
/* Prevent various kinds of signals during display
@ -13426,6 +13430,7 @@ redisplay_internal (void)
/* Update the display. */
set_window_update_flags (XWINDOW (f->root_window), 1);
pending |= update_frame (f, 0, 0);
f->cursor_type_changed = 0;
f->updated_p = 1;
}
}
@ -13470,7 +13475,7 @@ redisplay_internal (void)
update:
/* If fonts changed, display again. */
if (fonts_changed_p)
if (sf->fonts_changed)
goto retry;
/* Prevent various kinds of signals during display update.
@ -13487,6 +13492,7 @@ redisplay_internal (void)
XWINDOW (selected_window)->must_be_updated_p = 1;
pending = update_frame (sf, 0, 0);
sf->cursor_type_changed = 0;
}
/* We may have called echo_area_display at the top of this
@ -13501,6 +13507,7 @@ redisplay_internal (void)
{
XWINDOW (mini_window)->must_be_updated_p = 1;
pending |= update_frame (mini_frame, 0, 0);
mini_frame->cursor_type_changed = 0;
if (!pending && hscroll_windows (mini_window))
goto retry;
}
@ -13541,7 +13548,6 @@ redisplay_internal (void)
update_mode_lines = 0;
windows_or_buffers_changed = 0;
cursor_type_changed = 0;
}
/* Start SIGIO interrupts coming again. Having them off during the
@ -14983,7 +14989,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
cases. */
&& !update_mode_lines
&& !windows_or_buffers_changed
&& !cursor_type_changed
&& !f->cursor_type_changed
/* Can't use this case if highlighting a region. When a
region exists, cursor movement has to do more than just
set the cursor. */
@ -15330,9 +15336,8 @@ set_vertical_scroll_bar (struct window *w)
/* Redisplay leaf window WINDOW. JUST_THIS_ONE_P non-zero means only
selected_window is redisplayed.
We can return without actually redisplaying the window if
fonts_changed_p. In that case, redisplay_internal will
retry. */
We can return without actually redisplaying the window if fonts has been
changed on window's frame. In that case, redisplay_internal will retry. */
static void
redisplay_window (Lisp_Object window, int just_this_one_p)
@ -15717,7 +15722,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
debug_method_add (w, "try_window_id %d", tem);
#endif
if (fonts_changed_p)
if (f->fonts_changed)
goto need_larger_matrices;
if (tem > 0)
goto done;
@ -15787,12 +15792,12 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
IF_DEBUG (debug_method_add (w, "1"));
if (try_window (window, startp, TRY_WINDOW_CHECK_MARGINS) < 0)
/* -1 means we need to scroll.
0 means we need new matrices, but fonts_changed_p
0 means we need new matrices, but fonts_changed
is set in that case, so we will detect it below. */
goto try_to_scroll;
}
if (fonts_changed_p)
if (f->fonts_changed)
goto need_larger_matrices;
if (w->cursor.vpos >= 0)
@ -15980,7 +15985,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
/* Redisplay the window. */
if (!current_matrix_up_to_date_p
|| windows_or_buffers_changed
|| cursor_type_changed
|| f->cursor_type_changed
/* Don't use try_window_reusing_current_matrix in this case
because it can have changed the buffer. */
|| !NILP (Vwindow_scroll_functions)
@ -15993,7 +15998,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
/* If new fonts have been loaded (due to fontsets), give up. We
have to start a new redisplay since we need to re-adjust glyph
matrices. */
if (fonts_changed_p)
if (f->fonts_changed)
goto need_larger_matrices;
/* If cursor did not appear assume that the middle of the window is
@ -16106,7 +16111,8 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
if (WINDOW_WANTS_MODELINE_P (w)
&& CURRENT_MODE_LINE_HEIGHT (w) != DESIRED_MODE_LINE_HEIGHT (w))
{
fonts_changed_p = 1;
f->fonts_changed = 1;
w->mode_line_height = -1;
MATRIX_MODE_LINE_ROW (w->current_matrix)->height
= DESIRED_MODE_LINE_HEIGHT (w);
}
@ -16116,12 +16122,13 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
if (WINDOW_WANTS_HEADER_LINE_P (w)
&& CURRENT_HEADER_LINE_HEIGHT (w) != DESIRED_HEADER_LINE_HEIGHT (w))
{
fonts_changed_p = 1;
f->fonts_changed = 1;
w->header_line_height = -1;
MATRIX_HEADER_LINE_ROW (w->current_matrix)->height
= DESIRED_HEADER_LINE_HEIGHT (w);
}
if (fonts_changed_p)
if (f->fonts_changed)
goto need_larger_matrices;
}
@ -16186,8 +16193,8 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
}
#endif /* HAVE_WINDOW_SYSTEM */
/* We go to this label, with fonts_changed_p set,
if it is necessary to try again using larger glyph matrices.
/* We go to this label, with fonts_changed set, if it is
necessary to try again using larger glyph matrices.
We have to redeem the scroll bar even in this case,
because the loop in redisplay_internal expects that. */
need_larger_matrices:
@ -16259,7 +16266,7 @@ try_window (Lisp_Object window, struct text_pos pos, int flags)
{
if (display_line (&it))
last_text_row = it.glyph_row - 1;
if (fonts_changed_p && !(flags & TRY_WINDOW_IGNORE_FONTS_CHANGE))
if (f->fonts_changed && !(flags & TRY_WINDOW_IGNORE_FONTS_CHANGE))
return 0;
}
@ -16357,7 +16364,7 @@ try_window_reusing_current_matrix (struct window *w)
/* Don't try to reuse the display if windows have been split
or such. */
|| windows_or_buffers_changed
|| cursor_type_changed)
|| f->cursor_type_changed)
return 0;
/* Can't do this if region may have changed. */
@ -16405,8 +16412,7 @@ try_window_reusing_current_matrix (struct window *w)
w->cursor.vpos = -1;
last_text_row = last_reused_text_row = NULL;
while (it.current_y < it.last_visible_y
&& !fonts_changed_p)
while (it.current_y < it.last_visible_y && !f->fonts_changed)
{
/* If we have reached into the characters in the START row,
that means the line boundaries have changed. So we
@ -16617,7 +16623,7 @@ try_window_reusing_current_matrix (struct window *w)
if (pt_row == NULL)
w->cursor.vpos = -1;
last_text_row = NULL;
while (it.current_y < it.last_visible_y && !fonts_changed_p)
while (it.current_y < it.last_visible_y && !f->fonts_changed)
if (display_line (&it))
last_text_row = it.glyph_row - 1;
@ -17129,7 +17135,7 @@ try_window_id (struct window *w)
GIVE_UP (1);
/* This flag is used to prevent redisplay optimizations. */
if (windows_or_buffers_changed || cursor_type_changed)
if (windows_or_buffers_changed || f->cursor_type_changed)
GIVE_UP (2);
/* Verify that narrowing has not changed.
@ -17460,7 +17466,7 @@ try_window_id (struct window *w)
last_text_row = NULL;
overlay_arrow_seen = 0;
while (it.current_y < it.last_visible_y
&& !fonts_changed_p
&& !f->fonts_changed
&& (first_unchanged_at_end_row == NULL
|| IT_CHARPOS (it) < stop_pos))
{
@ -17468,7 +17474,7 @@ try_window_id (struct window *w)
last_text_row = it.glyph_row - 1;
}
if (fonts_changed_p)
if (f->fonts_changed)
return -1;
@ -17715,8 +17721,7 @@ try_window_id (struct window *w)
/* Display the rest of the lines at the window end. */
it.glyph_row = MATRIX_ROW (desired_matrix, it.vpos);
while (it.current_y < it.last_visible_y
&& !fonts_changed_p)
while (it.current_y < it.last_visible_y && !f->fonts_changed)
{
/* Is it always sure that the display agrees with lines in
the current matrix? I don't think so, so we mark rows
@ -19252,7 +19257,7 @@ display_line (struct it *it)
>= it->w->desired_matrix->nrows)
{
it->w->nrows_scale_factor++;
fonts_changed_p = 1;
it->f->fonts_changed = 1;
return 0;
}
@ -23980,12 +23985,12 @@ draw_glyphs (struct window *w, int x, struct glyph_row *row,
#define IT_EXPAND_MATRIX_WIDTH(it, area) \
{ \
if (!fonts_changed_p \
if (!it->f->fonts_changed \
&& (it->glyph_row->glyphs[area] \
< it->glyph_row->glyphs[area + 1])) \
{ \
it->w->ncols_scale_factor++; \
fonts_changed_p = 1; \
it->f->fonts_changed = 1; \
} \
}
@ -24901,21 +24906,7 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)
base_height = it->ascent + it->descent;
base_width = font->average_width;
/* Get a face ID for the glyph by utilizing a cache (the same way as
done for `escape-glyph' in get_next_display_element). */
if (it->f == last_glyphless_glyph_frame
&& it->face_id == last_glyphless_glyph_face_id)
{
face_id = last_glyphless_glyph_merged_face_id;
}
else
{
/* Merge the `glyphless-char' face into the current face. */
face_id = merge_faces (it->f, Qglyphless_char, 0, it->face_id);
last_glyphless_glyph_frame = it->f;
last_glyphless_glyph_face_id = it->face_id;
last_glyphless_glyph_merged_face_id = face_id;
}
face_id = merge_glyphless_glyph_face (it);
if (it->glyphless_method == GLYPHLESS_DISPLAY_THIN_SPACE)
{
@ -25956,7 +25947,7 @@ set_frame_cursor_types (struct frame *f, Lisp_Object arg)
FRAME_BLINK_OFF_CURSOR (f) = DEFAULT_CURSOR;
/* Make sure the cursor gets redrawn. */
cursor_type_changed = 1;
f->cursor_type_changed = 1;
}
@ -29686,8 +29677,6 @@ Its value should be an ASCII acronym string, `hex-code', `empty-box', or
void
init_xdisp (void)
{
current_header_line_height = current_mode_line_height = -1;
CHARPOS (this_line_start_pos) = 0;
if (!noninteractive)

View file

@ -1201,7 +1201,7 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
clear_glyph_matrix (XWINDOW (f->menu_bar_window)->current_matrix);
}
#endif /* not USE_X_TOOLKIT && not USE_GTK */
adjust_glyphs (f);
adjust_frame_glyphs (f);
run_window_configuration_change_hook (f);
}
@ -1264,7 +1264,7 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
FRAME_TOOL_BAR_LINES (f) = nlines;
resize_frame_windows (f, FRAME_LINES (f), 0);
adjust_glyphs (f);
adjust_frame_glyphs (f);
/* We also have to make sure that the internal border at the top of
the frame, below the menu bar or tool bar, is redrawn when the
@ -5486,7 +5486,7 @@ Text larger than the specified size is clipped. */)
}
FRAME_TOTAL_COLS (f) = w->total_cols;
adjust_glyphs (f);
adjust_frame_glyphs (f);
w->pseudo_window_p = 1;
/* Display the tooltip text in a temporary buffer. */
@ -5554,7 +5554,7 @@ Text larger than the specified size is clipped. */)
width /= WINDOW_FRAME_COLUMN_WIDTH (w);
w->total_cols = width;
FRAME_TOTAL_COLS (f) = width;
adjust_glyphs (f);
adjust_frame_glyphs (f);
clear_glyph_matrix (w->desired_matrix);
clear_glyph_matrix (w->current_matrix);
try_window (FRAME_ROOT_WINDOW (f), pos, 0);