unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: 37733@debbugs.gnu.org
Subject: bug#37733: [PATCH]: Erroneous grep call thows exception in compilation-tear-down-arrow-spec-in-margin.
Date: Sun, 13 Oct 2019 13:05:12 +0000	[thread overview]
Message-ID: <20191013130512.GC10125@ACM> (raw)

In master:
emacs -Q
C-u M-x grep <CR>
grep --color -nH --null '-syn-' *.el <CR> ; Note the '-syn-' is
                                  ; interpreted by grep as flags.

This throws an exception.

Fix as follows:


diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index e312def18d..25c8a4d067 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -2669,10 +2669,11 @@ compilation-set-up-arrow-spec-in-margin
 
 (defun compilation-tear-down-arrow-spec-in-margin ()
   "Restore compilation-arrow-overlay to not using the margin, which is removed."
-  (overlay-put compilation-arrow-overlay 'before-string nil)
-  (delete-overlay compilation-arrow-overlay)
-  (setq compilation-arrow-overlay nil)
-  (set-window-margins (selected-window) (- (car (window-margins)) 2)))
+  (when (overlayp compilation-arrow-overlay)
+    (overlay-put compilation-arrow-overlay 'before-string nil)
+    (delete-overlay compilation-arrow-overlay)
+    (setq compilation-arrow-overlay nil)
+    (set-window-margins (selected-window) (- (car (window-margins)) 2))))
 
 (defun compilation-set-overlay-arrow (w)
   "Set up, or switch off, the overlay-arrow for window W."

.

-- 
Alan Mackenzie (Nuremberg, Germany).





             reply	other threads:[~2019-10-13 13:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-13 13:05 Alan Mackenzie [this message]
     [not found] ` <handler.37733.B.157097192426471.ack@debbugs.gnu.org>
2019-10-13 13:22   ` bug#37733: Acknowledgement ([PATCH]: Erroneous grep call thows exception in compilation-tear-down-arrow-spec-in-margin.) Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191013130512.GC10125@ACM \
    --to=acm@muc.de \
    --cc=37733@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).