[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Comment filling
From: |
Stefan Monnier |
Subject: |
Re: Comment filling |
Date: |
25 Feb 2004 14:51:56 -0500 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
> I took a step back and decided I'd try running this past the knowledgable
> masses.
> With auto-fill-mode set off, I type the following in a sql-mode buffer:
> -- This comment should be filled to multiple lines
> If I then type M-q (fill-paragraph), I get:
> -- This comment should be filled to
> multiple lines
> If, however, I have set `auto-fill-mode' on, I would get:
> -- This comment should be filled to
> -- multiple lines
> Which is what I want.
> Is this a bug in `fill-paragraph' or is there something I can do in
> sql-mode to get the desired `fill-paragraph' behavior?
It's a bug in sql-mode: it forgets to set comment-start-skip.
Stefan
PS: By the way, here is an unrelated patch, for those cases where
define-abbrev is not a `subr' (e.g. it has been redefined in elisp
for example via defadvice).
--- orig/lisp/progmodes/sql.el
+++ mod/lisp/progmodes/sql.el
@@ -1,6 +1,6 @@
;;; sql.el --- specialized comint.el for SQL interpreters
-;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
Inc.
+;; Copyright (C) 1998,1999,2000,01,02,03,2004 Free Software Foundation, Inc.
;; Author: Alex Schroeder <address@hidden>
;; Maintainer: Michael Mauger <address@hidden>
@@ -830,22 +830,14 @@
"Abbrev table used in `sql-mode' and `sql-interactive-mode'.")
(if sql-mode-abbrev-table
()
- (let ((nargs (cdr (subr-arity (symbol-function 'define-abbrev))))
- d-a)
- ;; In Emacs 21.3+, provide SYSTEM-FLAG to define-abbrev.
- (setq d-a
- (if (>= nargs 6)
- '(lambda (name expansion) (define-abbrev sql-mode-abbrev-table
name expansion nil 0 t))
- '(lambda (name expansion) (define-abbrev sql-mode-abbrev-table name
expansion))))
-
- (define-abbrev-table 'sql-mode-abbrev-table nil)
- (funcall d-a "ins" "insert")
- (funcall d-a "upd" "update")
- (funcall d-a "del" "delete")
- (funcall d-a "sel" "select")
- (funcall d-a "proc" "procedure")
- (funcall d-a "func" "function")
- (funcall d-a "cr" "create")))
+ (define-abbrev-table 'sql-mode-abbrev-table
+ '(("ins" "insert" nil nil t)
+ ("upd" "update" nil nil t)
+ ("del" "delete" nil nil t)
+ ("sel" "select" nil nil t)
+ ("proc" "procedure" nil nil t)
+ ("func" "function" nil nil t)
+ ("cr" "create" nil nil t))))
;; Syntax Table
- Comment filling, Michael Mauger, 2004/02/24
- Re: Comment filling,
Stefan Monnier <=