GNU bug report logs - #61925
30.0.50; normal-mode does not set up local variables in temporary buffers (scratch, with-temp-buffer)

Previous Next

Package: emacs;

Reported by: Wolfgang Scherer <Wolfgang.Scherer <at> gmx.de>

Date: Thu, 2 Mar 2023 23:12:02 UTC

Severity: normal

Tags: notabug

Found in version 30.0.50

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #19 received at 61925 <at> debbugs.gnu.org (full text, mbox):

From: Wolfgang Scherer <Wolfgang.Scherer <at> gmx.de>
To: 61925 <at> debbugs.gnu.org
Subject: Re: bug#61925: 30.0.50; normal-mode does not set up local variables
 in temporary buffers (scratch, with-temp-buffer)
Date: Mon, 6 Mar 2023 03:07:57 +0100
The corrected version of the advice fixes the invalid mode specification.

(let* ((expected-value (not (default-value 'truncate-lines)))

       (need-advice (with-temp-buffer
                      (insert (format (concat ";; -*-"
                                              " mode: fundamental;"
                                              " truncate-lines: %S;"
                                              " -*-")
                                      expected-value))
                      (normal-mode)
                      (not (eq truncate-lines expected-value)))))
  (when need-advice
    (defadvice normal-mode (around wsx-normal-mode activate)
      "Bind buffer-file-name to `null-device', if it is nil."
      (let ((buffer-file-name (or buffer-file-name null-device "/dev/null")))
        ad-do-it))))


This bug report was last modified 1 year and 132 days ago.

Previous Next


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