emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/bison-mode dc479cf 11/29: Merge pull request #1 from syohe


From: ELPA Syncer
Subject: [nongnu] elpa/bison-mode dc479cf 11/29: Merge pull request #1 from syohex/fix-various-things
Date: Sun, 29 Aug 2021 10:58:41 -0400 (EDT)

branch: elpa/bison-mode
commit dc479cff157321e0d53f65ebc520e619749dd4be
Merge: 25d6d91 a167ea5
Author: Wilfred Hughes <me@wilfred.me.uk>
Commit: Wilfred Hughes <me@wilfred.me.uk>

    Merge pull request #1 from syohex/fix-various-things
    
    Fix various things
---
 bison-mode.el | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/bison-mode.el b/bison-mode.el
index 2ecf618..b3ebceb 100644
--- a/bison-mode.el
+++ b/bison-mode.el
@@ -79,6 +79,7 @@
 
 ;; *************** dependencies ***************
 (require 'derived)                     ;; define-derived-mode
+(require 'cc-mode)
 
 ;; *************** internal vars ***************
 
@@ -227,19 +228,18 @@ and \(point\)"
 
 ;; *************** bison-mode ***************
 
+;;;###autoload
 (define-derived-mode bison-mode c-mode "Bison"
   "Major mode for editing bison/yacc files."
 
   ;; try to set the indentation correctly
-  (setq-default c-basic-offset 4)
-  (make-variable-buffer-local 'c-basic-offset)
+  (setq c-basic-offset 4)
 
   (c-set-offset 'knr-argdecl-intro 0)
-  (make-variable-buffer-local 'c-offsets-alist)
   
   ;; remove auto and hungry anything
   (c-toggle-auto-hungry-state -1)
-  (c-toggle-auto-state -1)
+  (c-toggle-auto-newline -1)
   (c-toggle-hungry-state -1)
 
   (use-local-map bison-mode-map)
@@ -278,7 +278,7 @@ and \(point\)"
   "Return the section that user is currently in"
   (save-excursion
     (let ((bound (point)))
-      (beginning-of-buffer)
+      (goto-char (point-min))
       (bison--section-p-helper bound))))
 
 (defun bison--section-p-helper (bound)
@@ -415,7 +415,7 @@ found."
   (let ((point (or point (point)))
        (in-p nil))
     (save-excursion
-      (beginning-of-buffer)
+      (goto-char (point-min))
 
       (while (re-search-forward "[^\\]\"" point t)
        (setq in-p (not in-p)))
@@ -646,7 +646,7 @@ assumes indenting a new line, i.e. at column 0
              (progn
                (back-to-indentation)
                (just-no-space)
-               (function reset-pt)))))
+               (funcall reset-pt)))))
        
        ((= section bison--bison-decls-section)
        (let ((opener (bison--bison-decl-opener-p bol eol)))



reply via email to

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