This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Add a syntax table to dwarf-mode.el
- From: Tom Tromey <tromey at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 25 Jun 2018 14:40:04 -0000
- Subject: [binutils-gdb] Add a syntax table to dwarf-mode.el
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1021d1cb1214771711c61117ba0923c73a3ff431
commit 1021d1cb1214771711c61117ba0923c73a3ff431
Author: Tom Tromey <tom@tromey.com>
Date: Sun Jun 24 21:25:44 2018 -0600
Add a syntax table to dwarf-mode.el
This adds a syntax table for dwarf-mode to dwarf-mode.el. I noticed
the need for this when trying to use mark-sexp (C-M-SPC) on a hex
number -- it copied the trailing ">" as well, which isn't desirable.
I've also bumped the version number to make this simpler to install
via the Emacs package system.
Tested locally. I'm checking this in.
binutils/ChangeLog
2018-06-25 Tom Tromey <tom@tromey.com>
* dwarf-mode.el (dwarf-mode-syntax-table): New variable.
Bump version number.
Diff:
---
binutils/ChangeLog | 5 +++++
binutils/dwarf-mode.el | 11 ++++++++++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 28babb2..08c00c6 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2018-06-25 Tom Tromey <tom@tromey.com>
+
+ * dwarf-mode.el (dwarf-mode-syntax-table): New variable.
+ Bump version number.
+
2018-06-24 Nick Clifton <nickc@redhat.com>
* README-how-to-make-a-release: Update with experiences from
diff --git a/binutils/dwarf-mode.el b/binutils/dwarf-mode.el
index 8eed1b7..3692f0e 100644
--- a/binutils/dwarf-mode.el
+++ b/binutils/dwarf-mode.el
@@ -1,6 +1,6 @@
;;; dwarf-mode.el --- Browser for DWARF information. -*-lexical-binding:t-*-
-;; Version: 1.4
+;; Version: 1.5
;; Copyright (C) 2012-2018 Free Software Foundation, Inc.
@@ -181,6 +181,15 @@ A prefix argument means expand all children."
(expand-file-name dwarf-file))
(set-buffer-modified-p nil)))
+(defvar dwarf-mode-syntax-table
+ (let ((table (make-syntax-table)))
+ ;; This at least makes it so mark-sexp on some hex digits inside
+ ;; <...> does not also copy the ">".
+ (modify-syntax-entry ?< "(>" table)
+ (modify-syntax-entry ?> ")<" table)
+ table)
+ "Syntax table for dwarf-mode buffers.")
+
(defvar dwarf-mode-map
(let ((map (make-sparse-keymap)))
(set-keymap-parent map special-mode-map)