Commit e02f48d7 authored by Juanma Barranquero's avatar Juanma Barranquero
Browse files

lisp/progmodes/*.el: Lexical-binding cleanup.

parent 7ede3b65
2011-04-22 Juanma Barranquero <lekktu@gmail.com>
Lexical-binding cleanup.
* progmodes/ada-mode.el (ada-after-change-function, ada-loose-case-word)
(ada-no-auto-case, ada-capitalize-word, ada-untab, ada-narrow-to-defun):
* progmodes/ada-prj.el (ada-prj-initialize-values)
(ada-prj-display-page, ada-prj-field-modified, ada-prj-display-help)
(ada-prj-show-value):
* progmodes/ada-xref.el (ada-find-any-references, ada-gdb-application):
* progmodes/antlr-mode.el (antlr-with-displaying-help-buffer)
(antlr-invalidate-context-cache, antlr-options-menu-filter)
(antlr-language-option-extra, antlr-c++-mode-extra, antlr-run-tool):
* progmodes/bug-reference.el (bug-reference-push-button):
* progmodes/fortran.el (fortran-line-length):
* progmodes/glasses.el (glasses-change):
* progmodes/octave-mod.el (octave-fill-paragraph):
* progmodes/python.el (python-mode, python-pdbtrack-track-stack-file)
(python-pdbtrack-grub-for-buffer, python-sentinel):
* progmodes/sql.el (sql-save-connection):
* progmodes/tcl.el (tcl-indent-command, tcl-popup-menu):
* progmodes/xscheme.el (xscheme-enter-debugger-mode):
Mark unused parameters.
* progmodes/compile.el (compilation--flush-directory-cache)
(compilation--flush-parse, compile-internal): Mark unused parameters.
(compilation-buffer-name): Rename parameter MODE-NAME to NAME-OF-MODE.
(compilation-next-error-function): Remove unused variable `timestamp'.
* progmodes/cpp.el (cpp-parse-close): Remove unused variable `begin'.
(cpp-signal-read-only, cpp-grow-overlay): Mark unused parameters.
* progmodes/dcl-mode.el (dcl-end-of-command):
Remove unused variable `start'.
(dcl-calc-command-indent-multiple, dcl-calc-cont-indent-relative)
(dcl-option-value-basic, dcl-option-value-offset)
(dcl-option-value-margin-offset, dcl-option-value-comment-line):
Mark unused parameters.
(dcl-save-local-variable): Remove unused variable `val'.
(mode): Declare.
* progmodes/delphi.el (delphi-save-state, delphi-after-change):
Mark unused parameters.
(delphi-ignore-changes): Move before first use.
(delphi-charset-token-at): Remove unused variable `start'.
(delphi-else-start): Remove unused variable `if-count'.
(delphi-comment-block-start, delphi-comment-block-end):
Remove unused variable `kind'.
(delphi-indent-line): Remove unused variable `new-point'.
* progmodes/ebrowse.el (ebrowse-files-list)
(ebrowse-list-of-matching-members, ebrowse-tags-list-members-in-file):
Mark unused parameters. Don't quote `lambda'.
(ebrowse-sort-tree-list, ebrowse-same-tree-member-buffer-list):
Don't quote `lambda'.
(ebrowse-revert-tree-buffer-from-file, ebrowse-tags-choose-class)
(ebrowse-goto-visible-member/all-member-lists): Mark unused parameters.
(ebrowse-create-tree-buffer): Rename parameter OBARRAY to CLASSES.
(ebrowse-toggle-mark-at-point): Remove unused variable `pnt'.
Use `ignore-errors'.
(ebrowse-frozen-tree-buffer-name, ebrowse-find-source-file)
(ebrowse-view/find-file-and-search-pattern)
(ebrowse-view/find-member-declaration/definition):
Rename parameter TAGS-FILE-NAME to TAGS-FILE.
(ebrowse-find-class-declaration, ebrowse-view-class-declaration):
Rename parameter PREFIX-ARG to PREFIX.
(ebrowse-tags-read-name): Remove unused variables `start' and
`member-info'.
(ebrowse-display-member-buffer): Rename variable `tags-file-name'
to `tags-file'.
* progmodes/etags.el (local-find-tag-hook): Declare.
(tag-partial-file-name-match-p, tag-any-match-p, list-tags):
Mark unused parameters.
* progmodes/executable.el (compilation-error-regexp-alist): Declare.
(executable-interpret): Mark unused parameter.
* progmodes/flymake.el (flymake-process-sentinel)
(flymake-after-change-function)
(flymake-create-temp-with-folder-structure)
(flymake-get-include-dirs-dot): Mark unused parameters.
(flymake-safe-delete-directory): Remove unused variable `err'.
* progmodes/gdb-mi.el (speedbar-change-initial-expansion-list)
(speedbar-timer-fn, speedbar-line-text)
(speedbar-change-expand-button-char, speedbar-delete-subblock)
(speedbar-center-buffer-smartly): Declare functions.
(gdb-find-watch-expression): Remove unused variable `array'.
(gdb-edit-value, gdb-gdb, gdb-ignored-notification, gdb-thread-created)
(gdb-starting): Mark unused parameters.
(gud-gdbmi-marker-filter): Remove unused variable `output-record'.
(gdb-table-string): Remove unused variable `res'.
(gdb-place-breakpoints): Remove unused variables `flag' and `bptno'.
(gdb-disassembly-handler-custom): Remove unused variable `pos'.
(gdb-display-buffer): Remove unused variable `cur-size'.
* progmodes/gud.el (gud-def): Use `defalias' instead of `defun' to
allow lexical-binding compilation.
(gud-expansion-speedbar-buttons, gud-gdb-goto-stackframe)
(gud-dbx-massage-args, gud-xdb-massage-args, gud-perldb-massage-args)
(gud-jdb-massage-args, gud-jdb-find-source, gud-find-class):
Mark unused parameters.
(gud-gdb-marker-filter): Remove unused variable `match'.
(gud-find-class): Bind `syntax-symbol' and `syntax-point' to suitable
lambda expressions and funcall them, instead of using `fset'.
* progmodes/hideif.el (hif-parse-if-exp): Rename parameter
HIF-TOKEN-LIST to TOKEN-LIST and let-bind `hif-token-list'.
* progmodes/hideshow.el (hs-hide-block-at-point): Remove unused
variable `header-beg'; use `let'.
* progmodes/icon.el (indent-icon-exp): Remove unused variables
`restart', `last-sexp' and `at-do'.
* progmodes/js.el (js--debug): Mark unused parameter.
(js--parse-state-at-point): Remove unused variable `bound'; use `let'.
(js--splice-into-items): Remove unused variable `item'.
(js--read-symbol, js--read-tab): Pass 1/-1 to `ido-mode', not t/nil.
* progmodes/make-mode.el (makefile-make-font-lock-keywords):
Rename parameter FONT-LOCK-KEYWORDS to FL-KEYWORDS.
(makefile-complete): Remove unused variable `try'.
(makefile-fill-paragraph, makefile-match-function-end):
Mark unused parameters.
* progmodes/octave-inf.el (inferior-octave-complete):
Remove unused variable `proc'.
(inferior-octave-output-digest): Mark unused parameter.
* progmodes/perl-mode.el (perl-calculate-indent):
Remove unused variable `err'.
* progmodes/prolog.el (prolog-mode-keybindings-inferior)
(prolog-indent-line): Mark unused parameters.
(prolog-indent-line): Remove unused variable `beg'.
* progmodes/ps-mode.el (reporter-prompt-for-summary-p)
(reporter-dont-compact-list): Declare.
* progmodes/sh-script.el (sh-font-lock-quoted-subshell):
Remove unused variable `char'.
(sh-debug): Mark unused parameter.
(sh-get-indent-info): Remove unused variable `start'.
(sh-calculate-indent): Remove unused variable `var'.
* progmodes/simula.el (simula-popup-menu): Mark unused parameter.
(simula-electric-keyword): Remove unused variable `null'.
(simula-search-backward, simula-search-forward): Remove unused
variables `begin' and `end'.
* progmodes/vera-mode.el (vera-guess-basic-syntax):
Remove unused variable `pos'.
(vera-electric-tab, vera-comment-uncomment-region):
Mark unused parameters.
(vera-electric-tab): Rename parameter PREFIX-ARG to PREFIX.
2011-04-22 Chong Yidong <cyd@stupidchicken.com>
* emacs-lisp/package.el (package--builtins, package-alist)
......
......@@ -966,7 +966,7 @@ are treated as numbers instead of gnatprep comments."
(unless modified
(restore-buffer-modified-p nil))))
(defun ada-after-change-function (beg end old-len)
(defun ada-after-change-function (beg end _old-len)
"Called when the region between BEG and END was changed in the buffer.
OLD-LEN indicates what the length of the replaced text was."
(save-excursion
......@@ -1675,7 +1675,7 @@ ARG is the prefix the user entered with \\[universal-argument]."
'( ?` ?_ ?# ?% ?& ?* ?( ?) ?- ?= ?+
?| ?\; ?: ?' ?\" ?< ?, ?. ?> ?/ ?\n 32 ?\r )))
(defun ada-loose-case-word (&optional arg)
(defun ada-loose-case-word (&optional _arg)
"Upcase first letter and letters following `_' in the following word.
No other letter is modified.
ARG is ignored, and is there for compatibility with `capitalize-word' only."
......@@ -1691,7 +1691,7 @@ ARG is ignored, and is there for compatibility with `capitalize-word' only."
(insert-char (upcase (following-char)) 1)
(delete-char 1)))))
(defun ada-no-auto-case (&optional arg)
(defun ada-no-auto-case (&optional _arg)
"Do nothing. ARG is ignored.
This function can be used for the auto-casing variables in Ada mode, to
adapt to unusal auto-casing schemes. Since it does nothing, you can for
......@@ -1700,7 +1700,7 @@ auto-casing for identifiers, whereas keywords have to be lower-cased.
See also `ada-auto-case' to disable auto casing altogether."
nil)
(defun ada-capitalize-word (&optional arg)
(defun ada-capitalize-word (&optional _arg)
"Upcase first letter and letters following '_', lower case other letters.
ARG is ignored, and is there for compatibility with `capitalize-word' only."
(interactive)
......@@ -4219,7 +4219,7 @@ of the region. Otherwise, operate only on the current line."
((eq ada-tab-policy 'always-tab) (error "Not implemented"))
))
(defun ada-untab (arg)
(defun ada-untab (_arg)
"Delete leading indenting according to `ada-tab-policy'."
;; FIXME: ARG is ignored
(interactive "P")
......@@ -5250,7 +5250,7 @@ Return nil if no body was found."
;; Support for narrow-to-region
;; ---------------------------------------------------------
(defun ada-narrow-to-defun (&optional arg)
(defun ada-narrow-to-defun (&optional _arg)
"Make text outside current subprogram invisible.
The subprogram visible is the one that contains or follow point.
Optional ARG is ignored.
......
......@@ -92,7 +92,7 @@ If there is none, opens a new project file."
(ada-customize)
(ada-prj-new)))
(defun ada-prj-initialize-values (symbol ada-buffer filename)
(defun ada-prj-initialize-values (symbol _ada-buffer filename)
"Set SYMBOL to the property list of the project file FILENAME.
If FILENAME is null, read the file associated with ADA-BUFFER.
If no project file is found, return the default values."
......@@ -257,19 +257,19 @@ The current buffer must be the project editing buffer."
(widget-insert "\n Project configuration.\n
___________ ____________ ____________ ____________ ____________\n / ")
(widget-create 'push-button :notify
(lambda (&rest dummy) (ada-prj-display-page 1)) "General")
(lambda (&rest _dummy) (ada-prj-display-page 1)) "General")
(widget-insert " \\ / ")
(widget-create 'push-button :notify
(lambda (&rest dummy) (ada-prj-display-page 2)) "Paths")
(lambda (&rest _dummy) (ada-prj-display-page 2)) "Paths")
(widget-insert " \\ / ")
(widget-create 'push-button :notify
(lambda (&rest dummy) (ada-prj-display-page 3)) "Switches")
(lambda (&rest _dummy) (ada-prj-display-page 3)) "Switches")
(widget-insert " \\ / ")
(widget-create 'push-button :notify
(lambda (&rest dummy) (ada-prj-display-page 4)) "Ada Menu")
(lambda (&rest _dummy) (ada-prj-display-page 4)) "Ada Menu")
(widget-insert " \\ / ")
(widget-create 'push-button :notify
(lambda (&rest dummy) (ada-prj-display-page 5)) "Debugger")
(lambda (&rest _dummy) (ada-prj-display-page 5)) "Debugger")
(widget-insert " \\\n")
;; Display the currently selected page
......@@ -458,15 +458,15 @@ connect to the target when working with cross-environments" t)
(widget-insert "______________________________________________________________________\n\n ")
(widget-create 'push-button
:notify (lambda (&rest ignore)
:notify (lambda (&rest _ignore)
(setq ada-prj-current-values (ada-default-prj-properties))
(ada-prj-display-page 1))
"Reset to Default Values")
(widget-insert " ")
(widget-create 'push-button :notify (lambda (&rest ignore) (kill-buffer nil))
(widget-create 'push-button :notify (lambda (&rest _ignore) (kill-buffer nil))
"Cancel")
(widget-insert " ")
(widget-create 'push-button :notify (lambda (&rest ignore) (ada-prj-save))
(widget-create 'push-button :notify (lambda (&rest _ignore) (ada-prj-save))
"Save")
(widget-insert "\n\n")
......@@ -546,7 +546,7 @@ converted to a directory name."
ada-list "\n"))
(defun ada-prj-field-modified (widget &rest dummy)
(defun ada-prj-field-modified (widget &rest _dummy)
"Callback for modification of WIDGET.
Remaining args DUMMY are ignored.
Save the change in `ada-prj-current-values' so that selecting
......@@ -556,7 +556,7 @@ another page and coming back keeps the new value."
(widget-get widget ':prj-field)
(widget-value widget))))
(defun ada-prj-display-help (widget widget-modified event)
(defun ada-prj-display-help (widget _widget-modified event)
"Callback for help button in WIDGET.
Parameters WIDGET-MODIFIED, EVENT match :notify for the widget."
(let ((text (widget-get widget 'prj-help)))
......@@ -572,7 +572,7 @@ Parameters WIDGET-MODIFIED, EVENT match :notify for the widget."
(concat "*****Help*****\n" text "\n**************\n")
(point-at-bol 2)))))
(defun ada-prj-show-value (widget widget-modified event)
(defun ada-prj-show-value (widget _widget-modified event)
"Show the current field value in WIDGET.
Parameters WIDGET-MODIFIED, EVENT match :notify for the widget."
(let* ((field (widget-get widget ':prj-field))
......
......@@ -1043,7 +1043,7 @@ existing buffer `*gnatfind*', if there is one."
(setq old-contents (buffer-string))))
(let ((compilation-error "reference"))
(compilation-start command 'compilation-mode (lambda (mode) ada-gnatfind-buffer-name)))
(compilation-start command 'compilation-mode (lambda (_mode) ada-gnatfind-buffer-name)))
;; Hide the "Compilation" menu
(with-current-buffer ada-gnatfind-buffer-name
......@@ -1384,7 +1384,7 @@ project file."
;; Do not add -fullname, since we can have a 'rsh' command in front.
;; FIXME: This is evil but luckily a nop under Emacs-21.3.50 ! -stef
(fset 'gud-gdb-massage-args (lambda (file args) args))
(fset 'gud-gdb-massage-args (lambda (_file args) args))
(set 'pre-cmd (mapconcat 'identity pre-cmd ada-command-separator))
(if (not (equal pre-cmd ""))
......
......@@ -82,7 +82,7 @@
;;; Code:
(eval-when-compile
(eval-when-compile
(require 'cl))
(require 'easymenu)
......@@ -93,7 +93,7 @@
(declare-function cond-emacs-xemacs-macfn "antlr-mode" (args &optional msg))
;; General Emacs/XEmacs-compatibility compile-time macros
(eval-when-compile
(eval-when-compile
(defmacro cond-emacs-xemacs (&rest args)
(cond-emacs-xemacs-macfn
args "`cond-emacs-xemacs' must return exactly one element"))
......@@ -1073,7 +1073,7 @@ Used for `antlr-slow-syntactic-context'.")
(read-from-minibuffer prompt initial-input nil nil
(or history 'shell-command-history)))
(defunx antlr-with-displaying-help-buffer (thunk &optional name)
(defunx antlr-with-displaying-help-buffer (thunk &optional _name)
:xemacs-and-try with-displaying-help-buffer
"Make a help buffer and call `thunk' there."
(with-output-to-temp-buffer "*Help*"
......@@ -1092,7 +1092,7 @@ Used for `antlr-slow-syntactic-context'.")
;;;(defvar antlr-statistics-cache 0)
;;;(defvar antlr-statistics-inval 0)
(defunx antlr-invalidate-context-cache (&rest dummies)
(defunx antlr-invalidate-context-cache (&rest _dummies)
;; checkdoc-params: (dummies)
"Invalidate context cache for syntactical context information."
:XEMACS ; XEmacs bug workaround
......@@ -1670,7 +1670,7 @@ Return \(LEVEL OPTION LOCATION)."
table)))
(list level input (cdr kind))))))
(defun antlr-options-menu-filter (level menu-items)
(defun antlr-options-menu-filter (level _menu-items)
"Return items for options submenu of level LEVEL."
;; checkdoc-params: (menu-items)
(let ((active (if buffer-read-only
......@@ -2072,7 +2072,7 @@ Used inside `antlr-options-alists'."
nil
table '(("false") ("true"))))
(defun antlr-language-option-extra (phase &rest dummies)
(defun antlr-language-option-extra (phase &rest _dummies)
;; checkdoc-params: (dummies)
"Change language according to the new value of the \"language\" option.
Call `antlr-mode' if the new language would be different from the value
......@@ -2088,7 +2088,7 @@ Called in PHASE `after-insertion', see `antlr-options-alists'."
(antlr-mode)
(and font-lock (null font-lock-mode) (font-lock-mode 1)))))))
(defun antlr-c++-mode-extra (phase option &rest dummies)
(defun antlr-c++-mode-extra (phase option &rest _dummies)
;; checkdoc-params: (option dummies)
"Warn if C++ option is used with the wrong language.
Ask user \(\"y or n\"), if a C++ only option is going to be inserted but
......@@ -2260,7 +2260,7 @@ called interactively, the buffers are always saved, see also variable
(or saved (save-some-buffers (not antlr-ask-about-save)))
(let ((default-directory (file-name-directory file)))
(compilation-start (concat command " " (file-name-nondirectory file))
nil #'(lambda (mode-name) "*Antlr-Run*"))))
nil (lambda (_mode-name) "*Antlr-Run*"))))
(defun antlr-run-tool-interactive ()
;; code in `interactive' is not compiled
......@@ -2592,7 +2592,7 @@ the default language."
;; FIXME: Since it uses cc-mode, it bumps into c-update-modeline's
;; limitation to mode-name being a string.
;; '("Antlr." (:eval (cadr (assq antlr-language antlr-language-alist))))
"Antlr"
"Antlr"
"Major mode for editing ANTLR grammar files."
:abbrev-table antlr-mode-abbrev-table
(c-initialize-cc-mode) ; cc-mode is required
......
......@@ -90,7 +90,7 @@
"Keymap for Asm mode.")
(defconst asm-font-lock-keywords
(append
(append
'(("^\\(\\(\\sw\\|\\s_\\)+\\)\\>:?[ \t]*\\(\\sw+\\(\\.\\sw+\\)*\\)?"
(1 font-lock-function-name-face) (3 font-lock-keyword-face nil t))
;; label started from ".".
......
......@@ -109,7 +109,7 @@ so that it is considered safe, see `enable-local-variables'.")
(funcall bug-reference-url-format))))))))))
;; Taken from button.el.
(defun bug-reference-push-button (&optional pos use-mouse-action)
(defun bug-reference-push-button (&optional pos _use-mouse-action)
"Open URL corresponding to the bug reference at POS."
(interactive
(list (if (integerp last-command-event) (point) last-command-event)))
......
......@@ -833,7 +833,7 @@ returned RES, i.e. there is no change of `compilation-directory' between
POS and RES.")
(make-variable-buffer-local 'compilation--previous-directory-cache)
(defun compilation--flush-directory-cache (start end)
(defun compilation--flush-directory-cache (start _end)
(cond
((or (not compilation--previous-directory-cache)
(<= (car compilation--previous-directory-cache) start)))
......@@ -1307,7 +1307,7 @@ to `compilation-error-regexp-alist' if RULES is nil."
(compilation--parse-region (point) compilation--parsed)))))
nil)
(defun compilation--flush-parse (start end)
(defun compilation--flush-parse (start _end)
"Mark the region between START and END for re-parsing."
(if (markerp compilation--parsed)
(move-marker compilation--parsed (min start compilation--parsed))))
......@@ -1399,31 +1399,31 @@ point on its location in the *compilation* buffer."
:group 'compilation)
(defun compilation-buffer-name (mode-name mode-command name-function)
(defun compilation-buffer-name (name-of-mode mode-command name-function)
"Return the name of a compilation buffer to use.
If NAME-FUNCTION is non-nil, call it with one argument MODE-NAME
If NAME-FUNCTION is non-nil, call it with one argument NAME-OF-MODE
to determine the buffer name.
Likewise if `compilation-buffer-name-function' is non-nil.
If current buffer has the major mode MODE-COMMAND,
return the name of the current buffer, so that it gets reused.
Otherwise, construct a buffer name from MODE-NAME."
Otherwise, construct a buffer name from NAME-OF-MODE."
(cond (name-function
(funcall name-function mode-name))
(funcall name-function name-of-mode))
(compilation-buffer-name-function
(funcall compilation-buffer-name-function mode-name))
(funcall compilation-buffer-name-function name-of-mode))
((eq mode-command major-mode)
(buffer-name))
(t
(concat "*" (downcase mode-name) "*"))))
(concat "*" (downcase name-of-mode) "*"))))
;; This is a rough emulation of the old hack, until the transition to new
;; compile is complete.
(defun compile-internal (command error-message
&optional name-of-mode parser
&optional _name-of-mode parser
error-regexp-alist name-function
enter-regexp-alist leave-regexp-alist
file-regexp-alist nomessage-regexp-alist
no-async highlight-regexp local-map)
_enter-regexp-alist _leave-regexp-alist
file-regexp-alist _nomessage-regexp-alist
_no-async highlight-regexp _local-map)
(if parser
(error "Compile now works very differently, see `compilation-error-regexp-alist'"))
(let ((compilation-error-regexp-alist
......@@ -2229,7 +2229,7 @@ This is the value of `next-error-function' in Compilation buffers."
(when reset
(setq compilation-current-error nil))
(let* ((columns compilation-error-screen-columns) ; buffer's local value
(last 1) timestamp
(last 1)
(msg (compilation-next-error (or n 1) nil
(or compilation-current-error
compilation-messages-start
......
......@@ -308,7 +308,6 @@ A prefix arg suppresses display of that buffer."
;; Pop top of cpp-state-stack and create overlay.
(let ((entry (assoc (nth 1 (car cpp-state-stack)) cpp-edit-list))
(branch (nth 0 (car cpp-state-stack)))
(begin (nth 2 (car cpp-state-stack)))
(end (nth 3 (car cpp-state-stack))))
(setq cpp-state-stack (cdr cpp-state-stack))
(if entry
......@@ -398,7 +397,7 @@ A prefix arg suppresses display of that buffer."
(overlay-put overlay 'insert-in-front-hooks '(cpp-grow-overlay))
(overlay-put overlay 'insert-behind-hooks '(cpp-grow-overlay)))
(defun cpp-signal-read-only (overlay after start end &optional len)
(defun cpp-signal-read-only (overlay after start end &optional _len)
;; Only allow deleting the whole overlay.
;; Trying to change a read-only overlay.
(if (and (not after)
......@@ -406,7 +405,7 @@ A prefix arg suppresses display of that buffer."
(> (overlay-end overlay) end)))
(error "This text is read only")))
(defun cpp-grow-overlay (overlay after start end &optional len)
(defun cpp-grow-overlay (overlay after start end &optional _len)
;; Make OVERLAY grow to contain range START to END.
(if after
(move-overlay overlay
......
......@@ -662,8 +662,7 @@ There is some minimal font-lock support (see vars
(defun dcl-end-of-command ()
"Move point to end of current command or next command if not on a command."
(interactive)
(let ((type (dcl-get-line-type))
(start (point)))
(let ((type (dcl-get-line-type)))
(if (or (eq type '$)
(eq type '-))
(progn
......@@ -941,7 +940,7 @@ Returns one of the following symbols:
;;;---------------------------------------------------------------------------
(defun dcl-calc-command-indent-multiple
(indent-type cur-indent extra-indent last-point this-point)
(indent-type cur-indent extra-indent _last-point _this-point)
"Indent lines to a multiple of dcl-basic-offset.
Set dcl-calc-command-indent-function to this function to customize
......@@ -1185,7 +1184,7 @@ The indent-type classification could probably be expanded upon.
;;;---------------------------------------------------------------------------
(defun dcl-calc-cont-indent-relative (cur-indent extra-indent)
(defun dcl-calc-cont-indent-relative (_cur-indent _extra-indent)
"Indent continuation lines to align with words on previous line.
Indent continuation lines to a position relative to preceding
......@@ -1540,7 +1539,7 @@ Also remove the continuation mark if easily detected."
;;;-------------------------------------------------------------------------
(defun dcl-option-value-basic (option-assoc)
(defun dcl-option-value-basic (_option-assoc)
"Guess a value for basic-offset."
(save-excursion
(dcl-beginning-of-command)
......@@ -1575,7 +1574,7 @@ Also remove the continuation mark if easily detected."
;;;-------------------------------------------------------------------------
(defun dcl-option-value-offset (option-assoc)
(defun dcl-option-value-offset (_option-assoc)
"Guess a value for an offset.
Find the column of the first non-blank character on the line.
Returns the column offset."
......@@ -1586,7 +1585,7 @@ Returns the column offset."
;;;-------------------------------------------------------------------------
(defun dcl-option-value-margin-offset (option-assoc)
(defun dcl-option-value-margin-offset (_option-assoc)
"Guess a value for margin offset.
Find the column of the first non-blank character on the line, not
counting labels.
......@@ -1598,7 +1597,7 @@ Returns a number as a string."
;;;-------------------------------------------------------------------------
(defun dcl-option-value-comment-line (option-assoc)
(defun dcl-option-value-comment-line (_option-assoc)
"Guess a value for `dcl-comment-line-regexp'.
Must return a string."
;; Should we set comment-start and comment-start-skip as well?
......@@ -1789,8 +1788,7 @@ Set or update the value of VAR in the current buffers
(if (eolp) (error "Missing colon in local variables entry"))
(skip-chars-backward " \t")
(let* ((str (buffer-substring beg (point)))
(found-var (read str))
val)
(found-var (read str)))
;; Setting variable named "end" means end of list.
(if (string-equal (downcase str) "end")
(progn
......@@ -1895,6 +1893,10 @@ section at the end of the current buffer."
;;;-------------------------------------------------------------------------
(with-no-warnings
;; Dynamically bound in `dcl-save-mode'.
(defvar mode))
(defun dcl-save-mode ()
"Save the current mode for this buffer.
Save the current mode in a `Local Variables:'
......@@ -1902,7 +1904,7 @@ section at the end of the current buffer."
(interactive)
(let ((mode (prin1-to-string major-mode)))
(if (string-match "-mode$" mode)
(let ((mode (intern (substring mode 0 (match-beginning 0)))))
(let ((mode (intern (substring mode 0 (match-beginning 0)))))
(dcl-save-option 'mode))
(message "Strange mode: %s" mode))))
......
......@@ -328,7 +328,7 @@ routine.")
(after-change-functions nil)
(modified (buffer-modified-p)))
;; Disable any queries about editing obsolete files.
(fset 'ask-user-about-supersession-threat (lambda (fn)))
(fset 'ask-user-about-supersession-threat (lambda (_fn)))
(unwind-protect
(progn ,@forms)
(set-buffer-modified-p modified)
......@@ -444,6 +444,12 @@ routine.")
(goto-char curr-point)
next))
(defvar delphi-ignore-changes t
"Internal flag to control if the Delphi mode responds to buffer changes.
Defaults to t in case the `delphi-after-change' function is called on a
non-Delphi buffer. Set to nil in a Delphi buffer. To override, just do:
(let ((delphi-ignore-changes t)) ...)")
(defun delphi-set-text-properties (from to properties)
;; Like `set-text-properties', except we do not consider this to be a buffer
;; modification.
......@@ -590,7 +596,6 @@ routine.")
;; character set.
(let ((currp (point))
(end nil)
(start nil)
(token nil))
(goto-char p)
(when (> (skip-chars-forward charset) 0)
......@@ -720,13 +725,7 @@ routine.")
(delphi-step-progress p "Fontifying" delphi-fontifying-progress-step))