all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#19206: 25.0.50; CC Mode tracks wrong source files
@ 2014-11-28 10:19 Sebastian Wiesner
  2014-11-28 19:49 ` Stefan Monnier
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Sebastian Wiesner @ 2014-11-28 10:19 UTC (permalink / raw)
  To: 19206

CC Mode tracks wrong source files when a CC Mode derived mode is
installed non-interactively.

To reproduce, save the following code as `cc-miscompile.el'

(require 'package)
(require 'cc-defs)

(defun main ()
  (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))

  (setq package-user-dir (make-temp-file "cc-miscompile" 'directory))

  (package-initialize)
  (package-refresh-contents)
  (package-install 'd-mode)

  (require 'd-mode)

  (let ((source (get (intern "c-typedef-decl-kwds" c-lang-constants) 'source)))
    (message "Sources: %S" (mapcar 'car source)))

  (delete-directory package-user-dir 'recursive))

(main)

and run it with `emacs -Q --script cc-miscompile.el'.  The output is as
follows (package.el output shortened for readility):

Contacting host: melpa.org:80
Contacting host: elpa.gnu.org:80
[…]
Sources: (d-mode cc-miscompile cc-langs)

Note that `cc-miscompile' ends up in the source list of
`c-typedef-decl-kwds', even though it never actually calls any `c-*'
functions at all.

Naturally, CC Mode will later try to load this file, and fail if it is
not in the `load-path'.  This effectively breaks installations of D
Mode from non-interactive Emacs sessions.

I did not try to find the culprit.  The CC Mode code is convoluted
beyond my understanding.





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-01-13 16:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-28 10:19 bug#19206: 25.0.50; CC Mode tracks wrong source files Sebastian Wiesner
2014-11-28 19:49 ` Stefan Monnier
     [not found] ` <mailman.14863.1417170074.1147.bug-gnu-emacs@gnu.org>
2014-11-28 22:25   ` Alan Mackenzie
2014-11-28 22:37     ` Sebastian Wiesner
2014-11-30 18:42     ` Alan Mackenzie
     [not found]     ` <20141130184221.GA12974@acm.acm>
2014-12-02 11:03       ` Sebastian Wiesner
2014-12-02 12:02         ` Alan Mackenzie
2014-12-02 14:02           ` Stefan Monnier
2014-12-07 22:46           ` Alan Mackenzie
2014-12-08  2:59             ` Stefan Monnier
2015-01-13 16:09 ` Alan Mackenzie

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.