Avoid `defconst` for vars which we modify

If we `setq` or let-bind a var, then presumably it's not a const.

* lisp/bookmark.el (bookmark-bmenu-buffer):
* lisp/char-fold.el (char-fold-table):
* lisp/pcmpl-linux.el (pcmpl-linux-fs-modules-path-format)
(pcmpl-linux-mtab-file):
* lisp/emacs-lisp/bytecomp.el (byte-compile-log-buffer):
* lisp/emacs-lisp/check-declare.el (check-declare-warning-buffer):
* lisp/emacs-lisp/ert-x.el (ert-remote-temporary-file-directory):
* lisp/erc/erc.el (erc-default-port):
* lisp/net/tramp.el (tramp-unknown-id-string)
(tramp-unknown-id-integer):
* lisp/url/url-util.el (url-unreserved-chars):
feature/minibuffer-completion-enhancements
Stefan Monnier 2024-01-04 18:44:43 -05:00
parent 225710ba79
commit 1870e2f48a
9 changed files with 13 additions and 13 deletions

View File

@ -142,7 +142,7 @@ Nil means don't prompt for confirmation."
"Non-nil means show annotations when jumping to a bookmark."
:type 'boolean)
(defconst bookmark-bmenu-buffer "*Bookmark List*"
(defvar bookmark-bmenu-buffer "*Bookmark List*"
"Name of buffer used for Bookmark List.")
(defvar bookmark-bmenu-use-header-line t

View File

@ -214,7 +214,7 @@
equiv))
equiv)))
(defconst char-fold-table
(defvar char-fold-table
(eval-when-compile
(char-fold--make-table))
"Used for folding characters of the same group during search.

View File

@ -262,7 +262,7 @@ This option is enabled by default because it reduces Emacs memory usage."
:type 'boolean)
;;;###autoload(put 'byte-compile-dynamic-docstrings 'safe-local-variable 'booleanp)
(defconst byte-compile-log-buffer "*Compile-Log*"
(defvar byte-compile-log-buffer "*Compile-Log*"
"Name of the byte-compiler's log buffer.")
(defvar byte-compile--known-dynamic-vars nil
@ -1874,7 +1874,7 @@ It is too wide if it has any lines longer than the largest of
(setq byte-to-native-plist-environment
overriding-plist-environment)))))
(defmacro displaying-byte-compile-warnings (&rest body)
(defmacro displaying-byte-compile-warnings (&rest body) ;FIXME: namespace!
(declare (debug (def-body)))
`(bytecomp--displaying-warnings (lambda () ,@body)))

View File

@ -40,7 +40,7 @@
;;; Code:
(defconst check-declare-warning-buffer "*Check Declarations Warnings*"
(defvar check-declare-warning-buffer "*Check Declarations Warnings*"
"Name of buffer used to display any `check-declare' warnings.")
(defun check-declare-locate (file basefile)

View File

@ -543,7 +543,7 @@ The same keyword arguments are supported as in
;; If this defconst is used in a test file, `tramp' shall be loaded
;; prior `ert-x'. There is no default value on w32 systems, which
;; could work out of the box.
(defconst ert-remote-temporary-file-directory
(defvar ert-remote-temporary-file-directory
(when (featurep 'tramp)
(cond
((getenv "REMOTE_TEMPORARY_FILE_DIRECTORY"))

View File

@ -1691,7 +1691,7 @@ Defaults to the server buffer."
(defconst erc-default-server "irc.libera.chat"
"IRC server to use if it cannot be detected otherwise.")
(defconst erc-default-port 6667
(defvar erc-default-port 6667
"IRC port to use if it cannot be detected otherwise.")
(defconst erc-default-port-tls 6697

View File

@ -1085,10 +1085,10 @@ Derived from `tramp-postfix-host-format'.")
(defconst tramp-localname-regexp (rx (* (not (any "\r\n"))) eos)
"Regexp matching localnames.")
(defconst tramp-unknown-id-string "UNKNOWN"
(defvar tramp-unknown-id-string "UNKNOWN"
"String used to denote an unknown user or group.")
(defconst tramp-unknown-id-integer -1
(defvar tramp-unknown-id-integer -1
"Integer used to denote an unknown user or group.")
;;;###tramp-autoload
@ -2081,7 +2081,7 @@ without a visible progress reporter."
(defmacro with-tramp-timeout (list &rest body)
"Like `with-timeout', but allow SECONDS to be nil.
(fn (SECONDS TIMEOUT-FORMS...) BODY)"
\(fn (SECONDS TIMEOUT-FORMS...) BODY)"
(declare (indent 1) (debug ((form body) body)))
(let ((seconds (car list))
(timeout-forms (cdr list)))

View File

@ -61,7 +61,7 @@
(pcomplete-opt "hVanfFrsvwt(pcmpl-linux-fs-types)o?L?U?")
(while (pcomplete-here (pcomplete-entries) nil #'identity)))
(defconst pcmpl-linux-fs-modules-path-format "/lib/modules/%s/kernel/fs/")
(defvar pcmpl-linux-fs-modules-path-format "/lib/modules/%s/kernel/fs/")
(defun pcmpl-linux-fs-types ()
"Return a list of available fs modules on GNU/Linux systems."
@ -69,7 +69,7 @@
(directory-files
(format pcmpl-linux-fs-modules-path-format kernel-ver))))
(defconst pcmpl-linux-mtab-file "/etc/mtab")
(defvar pcmpl-linux-mtab-file "/etc/mtab")
(defun pcmpl-linux-mounted-directories ()
"Return a list of mounted directory names."

View File

@ -335,7 +335,7 @@ appropriate coding-system; see `decode-coding-string'."
str (substring str (match-end 0)))))
(concat tmp str)))
(defconst url-unreserved-chars
(defvar url-unreserved-chars
'(?a ?b ?c ?d ?e ?f ?g ?h ?i ?j ?k ?l ?m ?n ?o ?p ?q ?r ?s ?t ?u ?v ?w ?x ?y ?z
?A ?B ?C ?D ?E ?F ?G ?H ?I ?J ?K ?L ?M ?N ?O ?P ?Q ?R ?S ?T ?U ?V ?W ?X ?Y ?Z
?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9