GNU bug report logs - #2034
23.0.60; c-subword-mode incompatible with xml-mode

Previous Next

Package: emacs;

Reported by: me <at> rpatterson.net

Date: Sun, 25 Jan 2009 02:20:03 UTC

Severity: normal

Tags: notabug, wontfix

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ross Patterson <me <at> rpatterson.net>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 2034 <at> debbugs.gnu.org, emacs-pretest-bug <at> gnu.org
Subject: bug#2034: 23.0.60; c-subword-mode incompatible with xml-mode
Date: Sun, 25 Jan 2009 10:48:36 -0800
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> Running "M-x c-subword-mode" in a buffer using xml-mode will raise the
>> following error:
>
>> c-update-modeline: Wrong type argument: stringp, (sgml-xml-mode "XML" "SGML")
>
> c-subword-mode is obviously written specifically for modes provided by
> the cc-*.el files.  It may accidentally work in some other modes, but at
> least c-update-modeline makes several assumptions about the format used
> for `mode-name'.

Well I find it very useful to use c-subword-mode in pretty much all my
buffers.  Here's the patched version of this function I'm using to work
around this issue:

(defun c-update-modeline ()
  (let* ((fmt (format "/%s%s%s%s"
                      (if c-electric-flag "l" "")
                      (if (and c-electric-flag c-auto-newline)
                          "a" "")
                      (if c-hungry-delete-key "h" "")
                      (if (and
                           ;; cc-subword might not be loaded.
                           (boundp 'c-subword-mode)
                           (symbol-value 'c-subword-mode))
                          "w"
                        "")))
         (str-mode-name (if (listp mode-name)
                            (nth 1 mode-name)
                          mode-name))
         (bare-mode-name (if (string-match "\\(^[^/]*\\)/" str-mode-name)
                             (substring str-mode-name (match-beginning 1) (match-end 1))
                           str-mode-name)))
    ;;     (setq c-submode-indicators
    ;; 	  (if (> (length fmt) 1)
    ;; 	      fmt))
    (setq mode-name
          (if (> (length fmt) 1)
              (concat bare-mode-name fmt)
            bare-mode-name))
    (force-mode-line-update)))

Ross




This bug report was last modified 6 years and 280 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.