bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#61925: 30.0.50; normal-mode does not set up local variables in tempo


From: Wolfgang Scherer
Subject: 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
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.0

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))))


reply via email to

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