emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 1a9cec1 05/13: Merge from origin/emacs-25


From: Paul Eggert
Subject: [Emacs-diffs] master 1a9cec1 05/13: Merge from origin/emacs-25
Date: Sat, 30 Jan 2016 22:12:16 +0000

branch: master
commit 1a9cec16fe8d805dbb9f3a082bebcdefb878cf13
Merge: 3b71a72 3f481ad
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Merge from origin/emacs-25
    
    3f481ad Rename xref-query-replace to xref-query-replace-in-results
    62f4ed4 Update cl-defgeneric and cl-defmethod docstrings
    2111e0e Comment out next-error-function integration in xref
    4e11ad3 Correct a use of "which" in intro.texi
    a1865bc Distinguish the two meanings of Java's keyword "default".  Fixes 
bug #22358.
    76045f7 Don't operate on menu bar of nonexistent frame
    c32f3bc Unbreak the GNUstep build.
---
 doc/emacs/dired.texi          |    4 ++--
 doc/emacs/maintaining.texi    |   12 ++++++------
 doc/lispref/intro.texi        |    2 +-
 etc/NEWS                      |    4 ++--
 lisp/dired-aux.el             |    4 ++--
 lisp/emacs-lisp/cl-generic.el |   24 ++++++++++++++----------
 lisp/progmodes/cc-engine.el   |   15 ++++++++++++++-
 lisp/progmodes/cc-langs.el    |    4 ++--
 lisp/progmodes/xref.el        |   10 ++++++----
 src/nsterm.m                  |   23 ++++++++++++++---------
 src/xfns.c                    |   21 ++++++++++++---------
 11 files changed, 75 insertions(+), 48 deletions(-)

diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi
index 123f1ae..13242d1 100644
--- a/doc/emacs/dired.texi
+++ b/doc/emacs/dired.texi
@@ -797,8 +797,8 @@ Perform @code{query-replace-regexp} on each of the 
specified files,
 replacing matches for @var{regexp} with the string
 @var{to} (@code{dired-do-find-regexp-and-replace}).
 
-This command is a variant of @code{xref-query-replace}.  It presents
-an @file{*xref*} buffer that lists all the matches of @var{regexp},
+This command is a variant of @code{xref-query-replace-in-results}.  It
+presents an @file{*xref*} buffer that lists all the matches of @var{regexp},
 and you can use the special commands in that buffer (@pxref{Xref
 Commands}).  In particular, if you exit the query replace loop, you
 can use @kbd{r} in that buffer to replace more matches.
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index 90af5c8..471a16b 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -1875,11 +1875,11 @@ Move to the previous reference and display it in the 
other window
 @findex xref-show-location-at-point
 Display the reference on the current line in the other window
 (@code{xref-show-location-at-point}).
address@hidden xref-query-replace
address@hidden xref-query-replace-in-results
 @item r @var{pattern} @key{RET} @var{replacement} @key{RET}
 Perform interactive query-replace on references that match
address@hidden (@code{xref-query-replace}), replacing the match with
address@hidden  @xref{Identifier Search}.
address@hidden (@code{xref-query-replace-in-results}), replacing
+the match with @var{replacement}.  @xref{Identifier Search}.
 @findex xref-quit
 @item q
 Quit the window showing the @file{*xref*} buffer (@code{xref-quit}).
@@ -1901,7 +1901,7 @@ them.
 @table @kbd
 @item M-?
 Find all the references for the identifier at point.
address@hidden M-x xref-query-replace @key{RET} @var{regexp} @key{RET} 
@var{replacement} @key{RET}
address@hidden M-x xref-query-replace-in-results @key{RET} @var{regexp} 
@key{RET} @var{replacement} @key{RET}
 Interactively replace @var{regexp} with @var{replacement} in the names
 of all the identifiers shown in the @file{*xref*} buffer.
 @item M-x tags-search @key{RET} @var{regexp} @key{RET}
@@ -1923,8 +1923,8 @@ identifier, showing the file name and the line where the 
identifier is
 referenced.  The XREF mode commands are available in this buffer, see
 @ref{Xref Commands}.
 
address@hidden xref-query-replace
-  @kbd{M-x xref-query-replace} reads a regexp to match identifier
address@hidden xref-query-replace-in-results
+  @kbd{M-x xref-query-replace-in-results} reads a regexp to match identifier
 names and a replacement string, just like ordinary @kbd{M-x
 query-replace-regexp}.  It then performs the specified replacement in
 the names of the matching identifiers in all the places in all the
diff --git a/doc/lispref/intro.texi b/doc/lispref/intro.texi
index 9d4a720..0f42d4d 100644
--- a/doc/lispref/intro.texi
+++ b/doc/lispref/intro.texi
@@ -191,7 +191,7 @@ in Lisp programs also.
   In contexts where a truth value is expected, any address@hidden value
 is considered to be @var{true}.  However, @code{t} is the preferred way
 to represent the truth value @var{true}.  When you need to choose a
-value which represents @var{true}, and there is no other basis for
+value that represents @var{true}, and there is no other basis for
 choosing, use @code{t}.  The symbol @code{t} always has the value
 @code{t}.
 
diff --git a/etc/NEWS b/etc/NEWS
index 1cc45c3..2ac7383 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1230,8 +1230,8 @@ viewing HTML files and the like.
 
 *** New user interface for the `A' and `Q' commands.
 These keys, now bound to `dired-do-find-regexp' and
-`dired-do-find-regexp-and-replace', work similarly to
-`xref-find-apropos' and `xref-query-replace': they present the matches
+`dired-do-find-regexp-and-replace', work similarly to `xref-find-apropos'
+and `xref-query-replace-in-results': they present the matches
 in the `*xref*' buffer and let you move through the matches.  No need
 to use `tags-loop-continue' to resume the search or replace loop.  The
 previous commands, `dired-do-search' and
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index ab10ede..9bcb1f9 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -2714,7 +2714,7 @@ with the command \\[tags-loop-continue]."
                      '(dired-get-marked-files nil nil 'dired-nondirectory-p)))
 
 (declare-function xref--show-xrefs "xref")
-(declare-function xref-query-replace "xref")
+(declare-function xref-query-replace-in-results "xref")
 
 ;;;###autoload
 (defun dired-do-find-regexp (regexp)
@@ -2746,7 +2746,7 @@ with the command \\[tags-loop-continue]."
            "Query replace regexp in marked files" t t)))
      (list (nth 0 common) (nth 1 common))))
   (with-current-buffer (dired-do-find-regexp from)
-    (xref-query-replace from to)))
+    (xref-query-replace-in-results from to)))
 
 (defun dired-nondirectory-p (file)
   (not (file-directory-p file)))
diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el
index b0815f5..5413bdb 100644
--- a/lisp/emacs-lisp/cl-generic.el
+++ b/lisp/emacs-lisp/cl-generic.el
@@ -83,8 +83,6 @@
 ;; - A generic "filter" generalizer (e.g. could be used to cleanly add methods
 ;;   to cl-generic-combine-methods with a specializer that says it applies only
 ;;   when some particular qualifier is used).
-;; - A way to dispatch on the context (e.g. the major-mode, some global
-;;   variable, you name it).
 
 ;;; Code:
 
@@ -195,9 +193,9 @@ OPTIONS-AND-METHODS currently understands:
 - (declare DECLARATIONS)
 - (:argument-precedence-order &rest ARGS)
 - (:method [QUALIFIERS...] ARGS &rest BODY)
-BODY, if present, is used as the body of a default method.
+DEFAULT-BODY, if present, is used as the body of a default method.
 
-\(fn NAME ARGS [DOC-STRING] [OPTIONS-AND-METHODS...] &rest BODY)"
+\(fn NAME ARGS [DOC-STRING] [OPTIONS-AND-METHODS...] &rest DEFAULT-BODY)"
   (declare (indent 2) (doc-string 3))
   (let* ((doc (if (stringp (car-safe options-and-methods))
                   (pop options-and-methods)))
@@ -360,10 +358,10 @@ the specializer used will be the one returned by BODY."
 (defmacro cl-defmethod (name args &rest body)
   "Define a new method for generic function NAME.
 I.e. it defines the implementation of NAME to use for invocations where the
-value of the dispatch argument matches the specified TYPE.
-The dispatch argument has to be one of the mandatory arguments, and
-all methods of NAME have to use the same argument for dispatch.
-The dispatch argument and TYPE are specified in ARGS where the corresponding
+values of the dispatch arguments match the specified TYPEs.
+The dispatch arguments have to be among the mandatory arguments, and
+all methods of NAME have to use the same set of arguments for dispatch.
+Each dispatch argument and TYPE are specified in ARGS where the corresponding
 formal argument appears as (VAR TYPE) rather than just VAR.
 
 The optional second argument QUALIFIER is a specifier that
@@ -373,8 +371,14 @@ modifies how the method is combined with other methods, 
including:
    :around  - Method will be called around everything else
 The absence of QUALIFIER means this is a \"primary\" method.
 
-Other than a type, TYPE can also be of the form `(eql VAL)' in
-which case this method will be invoked when the argument is `eql' to VAL.
+TYPE can be one of the basic types (see the full list and their
+hierarchy in `cl--generic-typeof-types'), CL struct type, or an
+EIEIO class.
+
+Other than that, TYPE can also be of the form `(eql VAL)' in
+which case this method will be invoked when the argument is `eql'
+to VAL, or `(head VAL)', in which case the argument is required
+to be a cons with VAL as its head.
 
 \(fn NAME [QUALIFIER] ARGS &rest [DOCSTRING] BODY)"
   (declare (doc-string 3) (indent 2)
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 7d3f528..018805d 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -10066,7 +10066,19 @@ comment at the start of cc-engine.el for more info."
                                       paren-state)))
 
        ;; CASE 14: A case or default label
-       ((looking-at c-label-kwds-regexp)
+       ((save-excursion
+         (and (looking-at c-label-kwds-regexp)
+              (or (c-major-mode-is 'idl-mode)
+                  (and
+                   containing-sexp
+                   (goto-char containing-sexp)
+                   (eq (char-after) ?{)
+                   (progn (c-backward-syntactic-ws) t)
+                   (eq (char-before) ?\))
+                   (c-go-list-backward)
+                   (progn (c-backward-syntactic-ws) t)
+                   (c-simple-skip-symbol-backward)
+                   (looking-at c-block-stmt-2-key)))))
        (if containing-sexp
            (progn
              (goto-char containing-sexp)
@@ -10082,6 +10094,7 @@ comment at the start of cc-engine.el for more info."
        ((save-excursion
          (back-to-indentation)
          (and (not (looking-at c-syntactic-ws-start))
+              (not (looking-at c-label-kwds-regexp))
               (c-forward-label)))
        (cond (containing-decl-open
               (setq placeholder (c-add-class-syntax 'inclass
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index b52da3f..ef89404 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -1972,8 +1972,8 @@ will be handled."
         ;; In CORBA CIDL:
         "bindsTo" "delegatesTo" "implements" "proxy" "storedOn")
   ;; Note: "const" is not used in Java, but it's still a reserved keyword.
-  java '("abstract" "const" "final" "native" "private" "protected" "public"
-        "static" "strictfp" "synchronized" "transient" "volatile")
+  java '("abstract" "const" "default" "final" "native" "private" "protected"
+        "public" "static" "strictfp" "synchronized" "transient" "volatile")
   pike '("final" "inline" "local" "nomask" "optional" "private" "protected"
         "public" "static" "variant"))
 
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index d32da37..267853d 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -502,7 +502,7 @@ WINDOW controls how the buffer is displayed:
     (xref-quit)
     (xref--pop-to-location xref window)))
 
-(defun xref-query-replace (from to)
+(defun xref-query-replace-in-results (from to)
   "Perform interactive replacement of FROM with TO in all displayed xrefs.
 
 This command interactively replaces FROM with TO in the names of the
@@ -589,7 +589,7 @@ references displayed in the current *xref* buffer."
     (define-key map [remap quit-window] #'xref-quit)
     (define-key map (kbd "n") #'xref-next-line)
     (define-key map (kbd "p") #'xref-prev-line)
-    (define-key map (kbd "r") #'xref-query-replace)
+    (define-key map (kbd "r") #'xref-query-replace-in-results)
     (define-key map (kbd "RET") #'xref-goto-xref)
     (define-key map (kbd "C-o") #'xref-show-location-at-point)
     ;; suggested by Johan Claesson "to further reduce finger movement":
@@ -600,8 +600,10 @@ references displayed in the current *xref* buffer."
 (define-derived-mode xref--xref-buffer-mode special-mode "XREF"
   "Mode for displaying cross-references."
   (setq buffer-read-only t)
-  (setq next-error-function #'xref--next-error-function)
-  (setq next-error-last-buffer (current-buffer)))
+  ;; FIXME: http://debbugs.gnu.org/20489
+  ;; (setq next-error-function #'xref--next-error-function)
+  ;; (setq next-error-last-buffer (current-buffer))
+  )
 
 (defun xref--next-error-function (n reset?)
   (when reset?
diff --git a/src/nsterm.m b/src/nsterm.m
index b270e0e..860c55d 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1161,11 +1161,24 @@ ns_clip_to_row (struct window *w, struct glyph_row *row,
 
 - (id)init;
 {
+  NSTRACE ("[EmacsBell init]");
   if ((self = [super init]))
     {
       nestCount = 0;
       isAttached = false;
+#ifdef NS_IMPL_GNUSTEP
+      // GNUstep doesn't provide named images.  This was reported in
+      // 2011, see https://savannah.gnu.org/bugs/?33396
+      //
+      // As a drop in replacment, a semi tranparent gray square is used.
+      self.image = [[NSImage alloc] initWithSize:NSMakeSize(32, 32)];
+      [self.image lockFocus];
+      [[NSColor colorForEmacsRed:0.5 green:0.5 blue:0.5 alpha:0.5] set];
+      NSRectFill(NSMakeRect(0, 0, 32, 32));
+      [self.image unlockFocus];
+#else
       self.image = [NSImage imageNamed:NSImageNameCaution];
+#endif
     }
   return self;
 }
@@ -1572,7 +1585,6 @@ x_set_window_size (struct frame *f,
   NSRect wr = [window frame];
   int tb = FRAME_EXTERNAL_TOOL_BAR (f);
   int pixelwidth, pixelheight;
-  int rows, cols;
   int orig_height = wr.size.height;
 
   NSTRACE ("x_set_window_size");
@@ -1590,15 +1602,11 @@ x_set_window_size (struct frame *f,
     {
       pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width);
       pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, height);
-      cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth);
-      rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelheight);
     }
   else
     {
       pixelwidth =  FRAME_TEXT_COLS_TO_PIXEL_WIDTH   (f, width);
       pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height);
-      cols = width;
-      rows = height;
     }
 
   /* If we have a toolbar, take its height into account. */
@@ -2631,13 +2639,13 @@ ns_draw_fringe_bitmap (struct window *w, struct 
glyph_row *row,
         [img setXBMColor: bm_color];
       }
 
+#ifdef NS_IMPL_COCOA
       // Note: For periodic images, the full image height is "h + hd".
       // By using the height h, a suitable part of the image is used.
       NSRect fromRect = NSMakeRect(0, 0, p->wd, p->h);
 
       NSTRACE_RECT ("fromRect", fromRect);
 
-#ifdef NS_IMPL_COCOA
       [img drawInRect: r
               fromRect: fromRect
              operation: NSCompositeSourceOver
@@ -6357,7 +6365,6 @@ not_in_argv (NSString *arg)
   if (oldr != rows || oldc != cols || neww != oldw || newh != oldh)
     {
       NSView *view = FRAME_NS_VIEW (emacsframe);
-      NSWindow *win = [view window];
 
       change_frame_size (emacsframe,
                          FRAME_PIXEL_TO_TEXT_WIDTH (emacsframe, neww),
@@ -7778,8 +7785,6 @@ not_in_argv (NSString *arg)
 
 - (void)zoom:(id)sender
 {
-  struct frame * f = SELECTED_FRAME ();
-
   NSTRACE ("[EmacsWindow zoom:]");
 
   ns_update_auto_hide_menu_bar();
diff --git a/src/xfns.c b/src/xfns.c
index aad9680..9624ac5 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -6084,16 +6084,19 @@ Value is t if tooltip was open, nil otherwise.  */)
         items is unmapped.  Redisplay the menu manually...  */
       {
         Widget w;
-       struct frame *f = SELECTED_FRAME ();
-       w = f->output_data.x->menubar_widget;
+        struct frame *f = SELECTED_FRAME ();
+        if (FRAME_X_P (f) && FRAME_LIVE_P (f))
+          {
+          w = f->output_data.x->menubar_widget;
 
-       if (!DoesSaveUnders (FRAME_DISPLAY_INFO (f)->screen)
-           && w != NULL)
-         {
-           block_input ();
-           xlwmenu_redisplay (w);
-           unblock_input ();
-         }
+          if (!DoesSaveUnders (FRAME_DISPLAY_INFO (f)->screen)
+              && w != NULL)
+            {
+              block_input ();
+              xlwmenu_redisplay (w);
+              unblock_input ();
+            }
+        }
       }
 #endif /* USE_LUCID */
     }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]