Merge from origin/emacs-25

43662a2 ; Clarify that xref is still experimental
0a6e6ca ; * admin/release-process: Remove some obsolete records.
c2e9e3d * lisp/progmodes/fortran.el (fortran-make-syntax-propertize-function):
8637f3d (semantic-symref-derive-find-filepatterns): Return a list
0a7ad07 ; Re-arrange xref-related entries in NEWS.
fe903ef Fix xref-find-references on MS-Windows
55a28d8 ; Fixed visual bell artifact problem on NextStep.
d064034 Document new features of tildify-mode
964bea7 Document new features of Whitespace mode
cd68f47 Improve documentation of new Hide-IfDef features
723b8bf Fix regression in font-locking cl-assert and cl-check-type
This commit is contained in:
John Wiegley 2016-01-11 22:48:10 -08:00
commit 4b739f70a5
9 changed files with 146 additions and 66 deletions

View file

@ -213,26 +213,26 @@ names of the people who have checked it.
SECTION READERS SECTION READERS
---------------------------------- ----------------------------------
TUTORIAL cyd TUTORIAL
TUTORIAL.bg ogi TUTORIAL.bg
TUTORIAL.cn xfq TUTORIAL.cn
TUTORIAL.cs TUTORIAL.cs
TUTORIAL.de wl TUTORIAL.de
TUTORIAL.eo TUTORIAL.eo
TUTORIAL.es TUTORIAL.es
TUTORIAL.fr TUTORIAL.fr
TUTORIAL.he eliz TUTORIAL.he
TUTORIAL.it TUTORIAL.it
TUTORIAL.ja TUTORIAL.ja
TUTORIAL.ko TUTORIAL.ko
TUTORIAL.nl Pieter Schoenmakers TUTORIAL.nl
TUTORIAL.pl TUTORIAL.pl
TUTORIAL.pt_BR TUTORIAL.pt_BR
TUTORIAL.ro TUTORIAL.ro
TUTORIAL.ru Alex Ott TUTORIAL.ru
TUTORIAL.sk TUTORIAL.sk
TUTORIAL.sl Primoz PETERLIN TUTORIAL.sl
TUTORIAL.sv Mats Lidell TUTORIAL.sv
TUTORIAL.th TUTORIAL.th
TUTORIAL.zh TUTORIAL.zh
@ -326,7 +326,7 @@ markers.texi
minibuf.texi minibuf.texi
modes.texi modes.texi
nonascii.texi nonascii.texi
numbers.texi Paul Eggert (24.4) numbers.texi
objects.texi objects.texi
os.texi os.texi
package.texi package.texi

View file

@ -1164,12 +1164,15 @@ indicate-empty-lines t)}.
@cindex mode, Whitespace @cindex mode, Whitespace
@findex whitespace-mode @findex whitespace-mode
@vindex whitespace-style @vindex whitespace-style
@findex whitespace-toggle-options
Whitespace mode is a buffer-local minor mode that lets you Whitespace mode is a buffer-local minor mode that lets you
visualize many kinds of whitespace in the buffer, by either visualize many kinds of whitespace in the buffer, by either
drawing the whitespace characters with a special face or displaying drawing the whitespace characters with a special face or displaying
them as special glyphs. To toggle this mode, type @kbd{M-x them as special glyphs. To toggle this mode, type @kbd{M-x
whitespace-mode}. The kinds of whitespace visualized are determined whitespace-mode}. The kinds of whitespace visualized are determined
by the list variable @code{whitespace-style}. Here is a partial list by the list variable @code{whitespace-style}. Individual elements in
that list can be toggled on or off in the current buffer by typing
@w{@kbd{M-x whitespace-toggle-options}}. Here is a partial list
of possible elements (see the variable's documentation for the full of possible elements (see the variable's documentation for the full
list): list):
@ -1200,6 +1203,13 @@ Highlight newlines.
@item empty @item empty
Highlight empty lines. Highlight empty lines.
@item big-indent
@vindex whitespace-big-indent-regexp
Highlight too-deep indentation. By default any sequence of at least 4
consecutive TAB characters or 32 consecutive SPC characters is
highlighted. To change that, customize the regular expression
@code{whitespace-big-indent-regexp}.
@item space-mark @item space-mark
Draw space and non-breaking characters with a special glyph. Draw space and non-breaking characters with a special glyph.
@ -1210,6 +1220,12 @@ Draw tab characters with a special glyph.
Draw newline characters with a special glyph. Draw newline characters with a special glyph.
@end table @end table
@findex global-whitespace-toggle-options
@findex global-whitespace-mode
Global Whitespace mode is a global minor mode that lets you visualize
whitespace in all buffers. To toggle individual features, use
@kbd{M-x global-whitespace-toggle-options}.
@node Selective Display @node Selective Display
@section Selective Display @section Selective Display
@cindex selective display @cindex selective display

View file

@ -945,16 +945,36 @@ fitting for use in money calculations
--- ---
*** Factorial works with non-integer inputs. *** Factorial works with non-integer inputs.
** HideIfDef mode now support full C/C++ expressions, argumented macro ** Hide-IfDef mode
expansions, interactive macro evaluation and automatic scanning of
#defined symbols.
*** New custom variable `hide-ifdef-header-regexp' to define C/C++ header file ---
name patterns. Default case-insensitive .h, .hh, .hpp, .hxx, and .h++. *** Hide-IfDef mode now support full C/C++ expressions in macros,
macro argument expansion, interactive macro evaluation and automatic
scanning of #define'd symbols.
---
*** New command `hif-evaluate-macro', bound to `C-c @ e', displays the
result of evaluating a macro.
---
*** New command `hif-clear-all-ifdef-define', bound to `C-c @ C', clears
all defined symbols in `hide-ifdef-env'.
---
*** New custom variable `hide-ifdef-header-regexp' to define C/C++ header
file name patterns. Defaults to files whose extension is one of `.h',
`.hh', `.hpp', `.hxx', or `.h++', matched case-insensitively.
---
*** New custom variable `hide-ifdef-expand-reinclusion-protection' to prevent *** New custom variable `hide-ifdef-expand-reinclusion-protection' to prevent
reinclusion protected header files from being fully hidden. reinclusion protected (a.k.a. "idempotent") header files from being hidden.
(This could happen when an idempotent header file is visited again,
when its guard symbol is already defined.) Defaults to `t'.
---
*** New custom variable `hide-ifdef-exclude-define-regexp' to define symbol *** New custom variable `hide-ifdef-exclude-define-regexp' to define symbol
name patterns (e.g. all "FOR_DOXYGEN_ONLY_*") to be excluded. name patterns (e.g. all "FOR_DOXYGEN_ONLY_*") to be ignored when
looking for macro definitions. By default, no symbols are ignored.
** TeX mode ** TeX mode
@ -967,30 +987,47 @@ use PDF instead of DVI.
`prettify-symbols-mode' in a tex-mode buffer, \alpha ... \omega, and `prettify-symbols-mode' in a tex-mode buffer, \alpha ... \omega, and
many other math macros are displayed using unicode characters. many other math macros are displayed using unicode characters.
** whitespace-mode: new 'big-indent style highlighting too much indentation. +++
By default, 32 spaces and four TABs are considered to be too much but ** New `big-indent' style in `whitespace-mode' highlights deep indentation.
`whitespace-big-indent-regexp' can be configured to change that. By default, 32 consecutive spaces or four consecutive TABs are
considered to be too deep, but the new variable
`whitespace-big-indent-regexp' can be customized to change that.
** tildify: `tildify-space-string', `tildify-pattern', and ---
`tildify-foreach-region-function' variables added making ** New options in `tildify-mode'.
New options `tildify-space-string', `tildify-pattern', and
`tildify-foreach-region-function' variables make
`tildify-string-alist', `tildify-pattern-alist', and `tildify-string-alist', `tildify-pattern-alist', and
`tildify-ignored-environments-alist' variables (as well as a few `tildify-ignored-environments-alist' variables (as well as a few
helper functions) obsolete. helper functions) obsolete.
** xref ** New package Xref replaces Etags's front-end and UI
The new package provides generic framework and new commands to find
and move to definitions, as well as pop back to the original location. The new package Xref provides a generic framework and new commands to
find and move to definitions of functions, macros, data structures
etc., as well as go back to the location where you were before moving
to a definition. It supersedes and obsoletes many Etags commands,
while still using the etags.el code that reads the TAGS tables as one
of its back-ends.
The command `xref-find-definitions' replaces `find-tag' and provides
an interface to pick one definition among several.
`tags-loop-continue' is now unbound. `xref-pop-marker-stack' replaces
`pop-tag-mark', but has a keybinding (`M-,'), unlike `pop-tag-mark'.
*** New key bindings
`xref-find-definitions' replaces `find-tag' and provides an interface
to pick one destination among several. Hence, `tags-loop-continue' is
unbound. `xref-pop-marker-stack' replaces `pop-tag-mark', but uses an
easier binding, which is now unoccupied (`M-,').
`xref-find-definitions-other-window' replaces `find-tag-other-window'. `xref-find-definitions-other-window' replaces `find-tag-other-window'.
`xref-find-definitions-other-frame' replaces `find-tag-other-frame'. `xref-find-definitions-other-frame' replaces `find-tag-other-frame'.
`xref-find-apropos' replaces `find-tag-regexp'. `xref-find-apropos' replaces `find-tag-regexp'.
As a result of this, the following commands are now obsolete:
`find-tag-other-window', `find-tag-other-frame', `find-tag-regexp',
`tags-apropos', and `tags-loop-continue'.
The framework's API is still experimental and can change in major,
backward-incompatible ways.
*** New variables *** New variables
`find-tag-marker-ring-length' is now an obsolete alias for `find-tag-marker-ring-length' is now an obsolete alias for
`xref-marker-ring-length'. `find-tag-marker-ring' is now an obsolete `xref-marker-ring-length'. `find-tag-marker-ring' is now an obsolete
alias for a private variable. `xref-push-marker-stack' and alias for a private variable. `xref-push-marker-stack' and
@ -1001,11 +1038,6 @@ alias for a private variable. `xref-push-marker-stack' and
information about mode local overrides (defined by cedet/mode-local.el information about mode local overrides (defined by cedet/mode-local.el
`define-overloadable-function' `define-mode-local-overrides'). `define-overloadable-function' `define-mode-local-overrides').
** etags
As a result of the above, these commands are now obsolete:
`find-tag-other-window', `find-tag-other-frame', `find-tag-regexp',
`tags-apropos' and `tags-loop-continue'.
** EUDC ** EUDC
EUDC's LDAP backend has been improved. EUDC's LDAP backend has been improved.

View file

@ -53,6 +53,8 @@ and those hits returned.")
See find -name man page for format.") See find -name man page for format.")
(defun semantic-symref-derive-find-filepatterns (&optional mode) (defun semantic-symref-derive-find-filepatterns (&optional mode)
;; FIXME: This should be moved to grep.el, where it could be used
;; for "C-u M-x grep" as well.
"Derive a list of file patterns for the current buffer. "Derive a list of file patterns for the current buffer.
Looks first in `semantic-symref-filepattern-alist'. If it is not Looks first in `semantic-symref-filepattern-alist'. If it is not
there, it then looks in `auto-mode-alist', and attempts to derive something there, it then looks in `auto-mode-alist', and attempts to derive something
@ -64,28 +66,20 @@ Optional argument MODE specifies the `major-mode' to test."
(when (not pat) (when (not pat)
;; No hit, try auto-mode-alist. ;; No hit, try auto-mode-alist.
(dolist (X auto-mode-alist) (dolist (X auto-mode-alist)
(when (eq (cdr X) mode) (when (and (eq (cdr X) mode)
;; Only take in simple patterns, so try to convert this one. ;; Only take in simple patterns, so try to convert this one.
(let ((Xp (string-match "\\\\\\.\\([^\\'>]+\\)\\\\'" (car X)))
(cond ((string-match "\\\\\\.\\([^\\'>]+\\)\\\\'" (car X)) (push (concat "*." (match-string 1 (car X))) pat))))
(concat "*." (match-string 1 (car X))))
(t nil))))
(when Xp
(setq pat (cons Xp pat))))
)))
;; Convert the list into some find-flags. ;; Convert the list into some find-flags.
(cond ((= (length pat) 1) (if (null pat)
(concat "-name \"" (car pat) "\"")) (error "Customize `semantic-symref-filepattern-alist' for %S"
((consp pat) major-mode)
(concat "\\( " (let ((args `("-name" ,(car pat))))
(mapconcat (lambda (s) (if (null (cdr args))
(concat "-name \"" s "\"")) args
pat `("(" ,@args
" -o ") ,@(apply #'nconc (mapcar (lambda (s) `("-o" "-name" ,s)) pat))
" \\)")) ")"))))))
(t
(error "Customize `semantic-symref-filepattern-alist' for %s" major-mode))
)))
(defvar grepflags) (defvar grepflags)
(defvar greppattern) (defvar greppattern)
@ -147,7 +141,8 @@ This shell should support pipe redirect syntax."
;; Find the root of the project, and do a find-grep... ;; Find the root of the project, and do a find-grep...
(let* (;; Find the file patterns to use. (let* (;; Find the file patterns to use.
(rootdir (semantic-symref-calculate-rootdir)) (rootdir (semantic-symref-calculate-rootdir))
(filepattern (semantic-symref-derive-find-filepatterns)) (filepatterns (semantic-symref-derive-find-filepatterns))
(filepattern (mapconcat #'shell-quote-argument filepatterns " "))
;; Grep based flags. ;; Grep based flags.
(grepflags (cond ((eq (oref tool :resulttype) 'file) (grepflags (cond ((eq (oref tool :resulttype) 'file)
"-l ") "-l ")

View file

@ -383,7 +383,8 @@ This will generate compile-time constants from BINDINGS."
((eq type 'type) font-lock-type-face) ((eq type 'type) font-lock-type-face)
((or (not (match-string 2)) ;; Normal defun. ((or (not (match-string 2)) ;; Normal defun.
(and (match-string 2) ;; Setf function. (and (match-string 2) ;; Setf function.
(match-string 4))) font-lock-function-name-face))) (match-string 4)))
font-lock-function-name-face)))
nil t))) nil t)))
"Subdued level highlighting for Lisp modes.") "Subdued level highlighting for Lisp modes.")
@ -403,7 +404,7 @@ This will generate compile-time constants from BINDINGS."
(2 font-lock-constant-face nil t)) (2 font-lock-constant-face nil t))
;; Erroneous structures. ;; Erroneous structures.
(,(concat "(" el-errs-re "\\_>") (,(concat "(" el-errs-re "\\_>")
(1 font-lock-warning-face)) (1 font-lock-warning-face prepend))
;; Words inside \\[] tend to be for `substitute-command-keys'. ;; Words inside \\[] tend to be for `substitute-command-keys'.
(,(concat "\\\\\\\\\\[\\(" lisp-mode-symbol-regexp "\\)\\]") (,(concat "\\\\\\\\\\[\\(" lisp-mode-symbol-regexp "\\)\\]")
(1 font-lock-constant-face prepend)) (1 font-lock-constant-face prepend))

View file

@ -496,12 +496,12 @@ This is used to fontify fixed-format Fortran comments."
;; worth the trouble (about 0.5% of slow down). ;; worth the trouble (about 0.5% of slow down).
(eval ;I hate `eval', but it's hard to avoid it here. (eval ;I hate `eval', but it's hard to avoid it here.
`(syntax-propertize-rules `(syntax-propertize-rules
("^[cd\\*]" (0 "<")) ("^[CcDd\\*]" (0 "<"))
;; We mark all chars after line-length as "comment-start", rather than ;; We mark all chars after line-length as "comment-start", rather than
;; just the first one. This is so that a closing ' that's past the ;; just the first one. This is so that a closing ' that's past the
;; line-length will indeed be ignored (and will result in a string that ;; line-length will indeed be ignored (and will result in a string that
;; leaks into subsequent lines). ;; leaks into subsequent lines).
((format "^[^cd\\*\t\n].\\{%d\\}\\(.+\\)" (1- line-length)) ((format "^[^CcDd\\*\t\n].\\{%d\\}\\(.+\\)" (1- line-length))
(1 "<"))))) (1 "<")))))
(defvar fortran-font-lock-keywords fortran-font-lock-keywords-1 (defvar fortran-font-lock-keywords fortran-font-lock-keywords-1

View file

@ -19,6 +19,11 @@
;;; Commentary: ;;; Commentary:
;; NOTE: The xref API is still experimental and can change in major,
;; backward-incompatible ways. Everyone is encouraged to try it, and
;; report to us any problems or use cases we hadn't anticiated, by
;; sending an email to emacs-devel, or `M-x report-emacs-bug'.
;;
;; This file provides a somewhat generic infrastructure for cross ;; This file provides a somewhat generic infrastructure for cross
;; referencing commands, in particular "find-definition". ;; referencing commands, in particular "find-definition".
;; ;;

View file

@ -282,7 +282,7 @@ corresponding text part and can be either:
CALLBACK is a function accepting two arguments -- REG-BEG and REG-END -- that CALLBACK is a function accepting two arguments -- REG-BEG and REG-END -- that
will be called for portions of the buffer outside of the environments defined by will be called for portions of the buffer outside of the environments defined by
PAIRS regexes. PAIRS regexps.
The function will return as soon as CALLBACK returns nil or point goes past END. The function will return as soon as CALLBACK returns nil or point goes past END.
CALLBACK may be called on portions of the buffer outside of [BEG END); in fact CALLBACK may be called on portions of the buffer outside of [BEG END); in fact
@ -479,7 +479,7 @@ which is assumed to be a space character, should be replaced with a hard space."
;;;###autoload ;;;###autoload
(define-minor-mode tildify-mode (define-minor-mode tildify-mode
"Adds electric behaviour to space character. "Adds electric behavior to space character.
When space is inserted into a buffer in a position where hard space is required When space is inserted into a buffer in a position where hard space is required
instead (determined by `tildify-space-pattern' and `tildify-space-predicates'), instead (determined by `tildify-space-pattern' and `tildify-space-predicates'),

View file

@ -1150,9 +1150,11 @@ @interface EmacsBell : NSImageView
{ {
// Number of currently active bell:s. // Number of currently active bell:s.
unsigned int nestCount; unsigned int nestCount;
bool isAttached;
} }
- (void)show:(NSView *)view; - (void)show:(NSView *)view;
- (void)hide; - (void)hide;
- (void)remove;
@end @end
@implementation EmacsBell @implementation EmacsBell
@ -1162,6 +1164,7 @@ - (id)init;
if ((self = [super init])) if ((self = [super init]))
{ {
nestCount = 0; nestCount = 0;
isAttached = false;
self.image = [NSImage imageNamed:NSImageNameCaution]; self.image = [NSImage imageNamed:NSImageNameCaution];
} }
return self; return self;
@ -1183,6 +1186,7 @@ - (void)show:(NSView *)view
[self setFrameOrigin:pos]; [self setFrameOrigin:pos];
[self setFrameSize:self.image.size]; [self setFrameSize:self.image.size];
isAttached = true;
[[[view window] contentView] addSubview:self [[[view window] contentView] addSubview:self
positioned:NSWindowAbove positioned:NSWindowAbove
relativeTo:nil]; relativeTo:nil];
@ -1199,17 +1203,31 @@ - (void)hide
// Note: Trace output from this method isn't shown, reason unknown. // Note: Trace output from this method isn't shown, reason unknown.
// NSTRACE ("[EmacsBell hide]"); // NSTRACE ("[EmacsBell hide]");
if (nestCount > 0)
--nestCount; --nestCount;
// Remove the image once the last bell became inactive. // Remove the image once the last bell became inactive.
if (nestCount == 0) if (nestCount == 0)
{
[self remove];
}
}
-(void)remove
{
if (isAttached)
{ {
[self removeFromSuperview]; [self removeFromSuperview];
isAttached = false;
} }
} }
@end @end
static EmacsBell * bell_view = nil;
static void static void
ns_ring_bell (struct frame *f) ns_ring_bell (struct frame *f)
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
@ -1222,7 +1240,6 @@ - (void)hide
struct frame *frame = SELECTED_FRAME (); struct frame *frame = SELECTED_FRAME ();
NSView *view; NSView *view;
static EmacsBell * bell_view = nil;
if (bell_view == nil) if (bell_view == nil)
{ {
bell_view = [[EmacsBell alloc] init]; bell_view = [[EmacsBell alloc] init];
@ -1246,6 +1263,18 @@ - (void)hide
} }
static void hide_bell ()
/* --------------------------------------------------------------------------
Ensure the bell is hidden.
-------------------------------------------------------------------------- */
{
if (bell_view != nil)
{
[bell_view remove];
}
}
/* ========================================================================== /* ==========================================================================
Frame / window manager related functions Frame / window manager related functions
@ -2328,6 +2357,8 @@ - (void)hide
{ {
if (FRAME_NS_VIEW (f)) if (FRAME_NS_VIEW (f))
{ {
hide_bell(); // Ensure the bell image isn't scrolled.
ns_focus (f, &dest, 1); ns_focus (f, &dest, 1);
[FRAME_NS_VIEW (f) scrollRect: src [FRAME_NS_VIEW (f) scrollRect: src
by: NSMakeSize (dest.origin.x - src.origin.x, by: NSMakeSize (dest.origin.x - src.origin.x,