1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-01 08:17:38 +00:00

Merge remote-tracking branch 'savannah/master' into HEAD

This commit is contained in:
Andrea Corallo 2021-02-10 21:56:55 +01:00
commit 2fcb85c3e7
500 changed files with 9736 additions and 7429 deletions

View File

@ -67,7 +67,7 @@ error-prone. It also allows sending patches whose author is someone
other than the email sender.
Once the cumulative amount of your submissions exceeds about 15 lines
of non-trivial changes, we will need you to assign to the FSF the
of non-trivial code, we will need you to assign to the FSF the
copyright for your contributions. Ask on emacs-devel@gnu.org, and we
will send you the necessary form together with the instructions to
fill and email it, in order to start this legal paperwork.

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
;;; admin.el --- utilities for Emacs administration
;;; admin.el --- utilities for Emacs administration -*- lexical-binding: t; -*-
;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
@ -254,7 +254,7 @@ ROOT should be the root of an Emacs source tree."
(search-forward "INFO_COMMON = ")
(let ((start (point)))
(end-of-line)
(while (and (looking-back "\\\\")
(while (and (looking-back "\\\\" (- (point) 2))
(zerop (forward-line 1)))
(end-of-line))
(append (split-string (replace-regexp-in-string
@ -930,13 +930,19 @@ changes (in a non-trivial way). This function does not check for that."
(interactive
(list (progn
(require 'debbugs-gnu)
(defvar debbugs-gnu-emacs-blocking-reports)
(defvar debbugs-gnu-emacs-current-release)
(completing-read
"Emacs release: "
(mapcar #'identity debbugs-gnu-emacs-blocking-reports)
nil t debbugs-gnu-emacs-current-release))))
(require 'debbugs-gnu)
(declare-function debbugs-get-status "debbugs" (&rest bug-numbers))
(declare-function debbugs-get-attribute "debbugs" (bug-or-message attribute))
(require 'reporter)
(declare-function mail-position-on-field "sendmail" (field &optional soft))
(declare-function mail-text "sendmail" ())
(when-let ((id (alist-get version debbugs-gnu-emacs-blocking-reports
nil nil #'string-equal))
@ -958,11 +964,11 @@ changes (in a non-trivial way). This function does not check for that."
(insert "
The following bugs are regarded as release-blocking for Emacs " version ".
People are encouraged to work on them with priority.\n\n")
(dolist (_ blockedby-status)
(unless (equal (debbugs-get-attribute _ 'pending) "done")
(dolist (i blockedby-status)
(unless (equal (debbugs-get-attribute i 'pending) "done")
(insert (format "bug#%d %s\n"
(debbugs-get-attribute _ 'id)
(debbugs-get-attribute _ 'subject)))))
(debbugs-get-attribute i 'id)
(debbugs-get-attribute i 'subject)))))
(insert "
If you use the debbugs package from GNU ELPA, you can apply the
following form to see all bugs which block a given release:

View File

@ -1,4 +1,4 @@
;;; authors.el --- utility for maintaining Emacs's AUTHORS file
;;; authors.el --- utility for maintaining Emacs's AUTHORS file -*- lexical-binding: t; -*-
;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
@ -1254,7 +1254,7 @@ Additionally, for these logs we apply the `lax' elements of
(defun authors-disambiguate-file-name (fullname)
"Convert FULLNAME to an unambiguous relative-name."
(let ((relname (file-name-nondirectory fullname))
dir parent)
dir)
(if (and (member relname authors-ambiguous-files)
;; Try to identify the top-level directory.
;; FIXME should really use ROOT from M-x authors.
@ -1266,8 +1266,8 @@ Additionally, for these logs we apply the `lax' elements of
;; I think it looks weird to see eg "lisp/simple.el".
;; But for eg Makefile.in, we do want to say "lisp/Makefile.in".
(if (and (string-equal "lisp"
(setq parent (file-name-nondirectory
(directory-file-name dir))))
(file-name-nondirectory
(directory-file-name dir)))
;; TODO better to simply have hard-coded list?
;; Only really Makefile.in where this applies.
(not (file-exists-p
@ -1569,9 +1569,9 @@ and changed by AUTHOR."
(cons (cons file (cdr (assq :changed actions)))
changed-list))))))
(if wrote-list
(setq wrote-list (sort wrote-list 'string-lessp)))
(setq wrote-list (sort wrote-list #'string-lessp)))
(if cowrote-list
(setq cowrote-list (sort cowrote-list 'string-lessp)))
(setq cowrote-list (sort cowrote-list #'string-lessp)))
(when changed-list
(setq changed-list (sort changed-list
(lambda (a b)
@ -1579,7 +1579,7 @@ and changed by AUTHOR."
(string-lessp (car a) (car b))
(> (cdr a) (cdr b))))))
(setq nchanged (length changed-list))
(setq changed-list (mapcar 'car changed-list)))
(setq changed-list (mapcar #'car changed-list)))
(if (> (- nchanged authors-many-files) 2)
(setcdr (nthcdr authors-many-files changed-list)
(list (format "and %d other files" (- nchanged authors-many-files)))))
@ -1688,12 +1688,12 @@ list of their contributions.\n")
(when authors-invalid-file-names
(insert "Unrecognized file entries found:\n\n")
(mapc (lambda (f) (if (not (string-match "^[A-Za-z]+$" f)) (insert f "\n")))
(sort authors-invalid-file-names 'string-lessp)))
(sort authors-invalid-file-names #'string-lessp)))
(when authors-ignored-names
(insert "\n\nThese authors were ignored:\n\n"
(mapconcat
'identity
(sort authors-ignored-names 'string-lessp) "\n")))
#'identity
(sort authors-ignored-names #'string-lessp) "\n")))
(goto-char (point-min))
(compilation-mode)
(message "Errors were found. See buffer %s" (buffer-name))))

View File

@ -1,4 +1,4 @@
;;; cus-test.el --- tests for custom types and load problems
;;; cus-test.el --- tests for custom types and load problems -*- lexical-binding: t; -*-
;; Copyright (C) 1998, 2000, 2002-2021 Free Software Foundation, Inc.
@ -112,6 +112,7 @@ Names should be as they appear in loaddefs.el.")
;; This avoids a hang of `cus-test-apropos' in 21.2.
;; (add-to-list 'cus-test-skip-list 'sh-alias-alist)
(defvar viper-mode)
(or noninteractive
;; Never Viperize.
(setq viper-mode nil))
@ -196,7 +197,7 @@ The detected problematic options are stored in `cus-test-errors'."
mismatch)
(when (default-boundp symbol)
(push (funcall get symbol) values)
(push (eval (car (get symbol 'standard-value))) values))
(push (eval (car (get symbol 'standard-value)) t) values))
(if (boundp symbol)
(push (symbol-value symbol) values))
;; That does not work.
@ -222,7 +223,7 @@ The detected problematic options are stored in `cus-test-errors'."
(get symbol 'standard-value))))
(and (consp c-value)
(boundp symbol)
(not (equal (eval (car c-value)) (symbol-value symbol)))
(not (equal (eval (car c-value) t) (symbol-value symbol)))
(add-to-list 'cus-test-vars-with-changed-state symbol)))
(if mismatch
@ -239,7 +240,7 @@ The detected problematic options are stored in `cus-test-errors'."
(defun cus-test-cus-load-groups (&optional cus-load)
"Return a list of current custom groups.
If CUS-LOAD is non-nil, include groups from cus-load.el."
(append (mapcar 'cdr custom-current-group-alist)
(append (mapcar #'cdr custom-current-group-alist)
(if cus-load
(with-temp-buffer
(insert-file-contents (locate-library "cus-load.el"))
@ -290,7 +291,7 @@ currently defined groups."
"Call `custom-load-symbol' on all atoms."
(interactive)
(if noninteractive (let (noninteractive) (require 'dunnet)))
(mapatoms 'custom-load-symbol)
(mapatoms #'custom-load-symbol)
(run-hooks 'cus-test-after-load-libs-hook))
(defmacro cus-test-load-1 (&rest body)
@ -346,7 +347,7 @@ Optional argument ALL non-nil means list all (non-obsolete) Lisp files."
(prog1
;; Hack to remove leading "./".
(mapcar (lambda (e) (substring e 2))
(apply 'process-lines find-program
(apply #'process-lines find-program
"." "-name" "obsolete" "-prune" "-o"
"-name" "[^.]*.el" ; ignore .dir-locals.el
(if all
@ -542,7 +543,7 @@ in the Emacs source directory."
(message "No options not loaded by custom-load-symbol found")
(message "The following options were not loaded by custom-load-symbol:")
(cus-test-message
(sort cus-test-vars-not-cus-loaded 'string<)))
(sort cus-test-vars-not-cus-loaded #'string<)))
(dolist (o groups-loaded)
(setq groups-not-loaded (delete o groups-not-loaded)))
@ -550,7 +551,7 @@ in the Emacs source directory."
(if (not groups-not-loaded)
(message "No groups not in cus-load.el found")
(message "The following groups are not in cus-load.el:")
(cus-test-message (sort groups-not-loaded 'string<)))))
(cus-test-message (sort groups-not-loaded #'string<)))))
(provide 'cus-test)

View File

@ -1,4 +1,4 @@
;;; find-gc.el --- detect functions that call the garbage collector
;;; find-gc.el --- detect functions that call the garbage collector -*- lexical-binding: t; -*-
;; Copyright (C) 1992, 2001-2021 Free Software Foundation, Inc.
@ -42,14 +42,14 @@ Each entry has the form (FUNCTION . FUNCTIONS-THAT-CALL-IT).")
Each entry has the form (FUNCTION . FUNCTIONS-IT-CALLS).")
;;; Functions on this list are safe, even if they appear to be able
;;; to call the target.
;; Functions on this list are safe, even if they appear to be able
;; to call the target.
(defvar find-gc-noreturn-list '(Fsignal Fthrow wrong_type_argument))
;;; This was originally generated directory-files, but there were
;;; too many files there that were not actually compiled. The
;;; list below was created for a HP-UX 7.0 system.
;; This was originally generated directory-files, but there were
;; too many files there that were not actually compiled. The
;; list below was created for a HP-UX 7.0 system.
(defvar find-gc-source-files
'("dispnew.c" "scroll.c" "xdisp.c" "window.c"
@ -76,11 +76,11 @@ Also store it in `find-gc-unsafe-list'."
(lambda (x y)
(string-lessp (car x) (car y))))))
;;; This does a depth-first search to find all functions that can
;;; ultimately call the function "target". The result is an a-list
;;; in find-gc-unsafe-list; the cars are the unsafe functions, and the cdrs
;;; are (one of) the unsafe functions that these functions directly
;;; call.
;; This does a depth-first search to find all functions that can
;; ultimately call the function "target". The result is an a-list
;; in find-gc-unsafe-list; the cars are the unsafe functions, and the cdrs
;; are (one of) the unsafe functions that these functions directly
;; call.
(defun find-unsafe-funcs (target)
(setq find-gc-unsafe-list (list (list target)))
@ -134,7 +134,8 @@ Also store it in `find-gc-unsafe-list'."
(setcdr entry (cons name (cdr entry)))))))))))))
(defun trace-use-tree ()
(setq find-gc-subrs-callers (mapcar 'list (mapcar 'car find-gc-subrs-called)))
(setq find-gc-subrs-callers
(mapcar #'list (mapcar #'car find-gc-subrs-called)))
(let ((ptr find-gc-subrs-called)
p2 found)
(while ptr

View File

@ -1,4 +1,4 @@
;;; gitmerge.el --- help merge one Emacs branch into another
;;; gitmerge.el --- help merge one Emacs branch into another -*- lexical-binding: t; -*-
;; Copyright (C) 2010-2021 Free Software Foundation, Inc.
@ -7,6 +7,8 @@
;; Keywords: maint
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
@ -390,7 +392,7 @@ is nil, only the single commit BEG is merged."
(if end "s were " " was ")
"skipped:\n\n")
""))
(apply 'call-process "git" nil t nil "log" "--oneline"
(apply #'call-process "git" nil t nil "log" "--oneline"
(if end (list (concat beg "~.." end))
`("-1" ,beg)))
(insert "\n")
@ -422,7 +424,7 @@ MISSING must be a list of SHA1 strings."
(unless end
(setq end beg))
(unless (zerop
(apply 'call-process "git" nil t nil "merge" "--no-ff"
(apply #'call-process "git" nil t nil "merge" "--no-ff"
(append (when skip '("-s" "ours"))
`("-m" ,commitmessage ,end))))
(gitmerge-write-missing missing from)

View File

@ -232,9 +232,9 @@ unless they visit files: such buffers are used internally by Emacs.
@table @kbd
@item C-x C-q
Toggle read-only status of buffer (@code{read-only-mode}).
@item M-x rename-buffer @key{RET} @var{buffer} @key{RET}
@item C-x x r @key{RET} @var{buffer} @key{RET}
Change the name of the current buffer.
@item M-x rename-uniquely
@item C-x x u
Rename the current buffer by adding @samp{<@var{number}>} to the end.
@item M-x view-buffer @key{RET} @var{buffer} @key{RET}
Scroll through buffer @var{buffer}. @xref{View Mode}.
@ -263,28 +263,28 @@ non-@code{nil} value, making the buffer read-only with @kbd{C-x C-q}
also enables View mode in the buffer (@pxref{View Mode}).
@findex rename-buffer
@kbd{M-x rename-buffer} changes the name of the current buffer. You
specify the new name as a minibuffer argument; there is no default.
If you specify a name that is in use for some other buffer, an error
happens and no renaming is done.
@kbd{C-x x r} (@code{rename-buffer} changes the name of the current
buffer. You specify the new name as a minibuffer argument; there is
no default. If you specify a name that is in use for some other
buffer, an error happens and no renaming is done.
@findex rename-uniquely
@kbd{M-x rename-uniquely} renames the current buffer to a similar
name with a numeric suffix added to make it both different and unique.
This command does not need an argument. It is useful for creating
multiple shell buffers: if you rename the @file{*shell*} buffer, then
do @kbd{M-x shell} again, it makes a new shell buffer named
@file{*shell*}; meanwhile, the old shell buffer continues to exist
under its new name. This method is also good for mail buffers,
@kbd{C-x x u} (@code{rename-uniquely}) renames the current buffer to
a similar name with a numeric suffix added to make it both different
and unique. This command does not need an argument. It is useful for
creating multiple shell buffers: if you rename the @file{*shell*}
buffer, then do @kbd{M-x shell} again, it makes a new shell buffer
named @file{*shell*}; meanwhile, the old shell buffer continues to
exist under its new name. This method is also good for mail buffers,
compilation buffers, and most Emacs features that create special
buffers with particular names. (With some of these features, such as
@kbd{M-x compile}, @kbd{M-x grep}, you need to switch to some other
buffer before using the command again, otherwise it will reuse the
current buffer despite the name change.)
The commands @kbd{M-x append-to-buffer} and @kbd{M-x insert-buffer}
can also be used to copy text from one buffer to another.
@xref{Accumulating Text}.
The commands @kbd{M-x append-to-buffer} and @kbd{C-x x i}
(@code{insert-buffer}) can also be used to copy text from one buffer
to another. @xref{Accumulating Text}.
@node Kill Buffer
@section Killing Buffers

View File

@ -519,12 +519,9 @@ Set up a customization buffer for all the settings and groups that
match @var{regexp}.
@item M-x customize-changed @key{RET} @var{version} @key{RET}
Set up a customization buffer with all the settings and groups
whose meaning has changed since Emacs version @var{version}.
@item M-x customize-changed-options @key{RET} @var{version} @key{RET}
Set up a customization buffer with all the options whose meaning or
default values have changed since Emacs version @var{version}.
Set up a customization buffer with all the user options, faces and
groups whose meaning has changed since (or been added after) Emacs
version @var{version}.
@item M-x customize-saved
Set up a customization buffer containing all settings that you

View File

@ -173,6 +173,10 @@ line; on subsequent consecutive invocations, make the current line the
top line, the bottom line, and so on in cyclic order. Possibly
redisplay the screen too (@code{recenter-top-bottom}).
@item C-M-S-l
Scroll the other window; this is equivalent to @kbd{C-l} acting on the
other window.
@item M-x recenter
Scroll the selected window so the current line is the center-most text
line. Possibly redisplay the screen too.
@ -1755,13 +1759,13 @@ and/or leftmost columns.
@findex toggle-truncate-lines
Horizontal scrolling automatically causes line truncation
(@pxref{Horizontal Scrolling}). You can explicitly enable line
truncation for a particular buffer with the command @kbd{M-x
toggle-truncate-lines}. This works by locally changing the variable
@code{truncate-lines}. If that variable is non-@code{nil}, long lines
are truncated; if it is @code{nil}, they are continued onto multiple
screen lines. Setting the variable @code{truncate-lines} in any way
makes it local to the current buffer; until that time, the default
value, which is normally @code{nil}, is in effect.
truncation for a particular buffer with the command @kbd{C-x x t}
(@code{toggle-truncate-lines}). This works by locally changing the
variable @code{truncate-lines}. If that variable is non-@code{nil},
long lines are truncated; if it is @code{nil}, they are continued onto
multiple screen lines. Setting the variable @code{truncate-lines} in
any way makes it local to the current buffer; until that time, the
default value, which is normally @code{nil}, is in effect.
If a split window becomes too narrow, Emacs may automatically enable
line truncation. @xref{Split Window}, for the variable

View File

@ -927,9 +927,9 @@ Manual}). For customizations, see the Custom group @code{time-stamp}.
If you have made extensive changes to a file-visiting buffer and
then change your mind, you can @dfn{revert} the changes and go back to
the saved version of the file. To do this, type @kbd{M-x
revert-buffer}. Since reverting unintentionally could lose a lot of
work, Emacs asks for confirmation first.
the saved version of the file. To do this, type @kbd{C-x x g}. Since
reverting unintentionally could lose a lot of work, Emacs asks for
confirmation first.
The @code{revert-buffer} command tries to position point in such a
way that, if the file was edited only slightly, you will be at

View File

@ -136,8 +136,8 @@ this transient mode is active, typing @kbd{@key{LEFT}} or
@kbd{@key{RIGHT}} indents leftward and rightward, respectively, by one
space. You can also type @kbd{S-@key{LEFT}} or @kbd{S-@key{RIGHT}} to
indent leftward or rightward to the next tab stop (@pxref{Tab Stops}).
Typing any other key disables the transient mode, and resumes normal
editing.
Typing any other key disables the transient mode, and this key is then
acted upon as normally.
If called with a prefix argument @var{n}, this command indents the
lines forward by @var{n} spaces (without enabling the transient mode).

View File

@ -703,13 +703,13 @@ copy-to-buffer} is similar, except that any existing text in the other
buffer is deleted, so the buffer is left containing just the text newly
copied into it.
The command @kbd{M-x insert-buffer} can be used to retrieve the
accumulated text from another buffer. This prompts for the name of a
buffer, and inserts a copy of all the text in that buffer into the
current buffer at point, leaving point at the beginning of the
inserted text. It also adds the position of the end of the inserted
text to the mark ring, without activating the mark. @xref{Buffers},
for background information on buffers.
The command @kbd{C-x x i} (@code{insert-buffer}) can be used to
retrieve the accumulated text from another buffer. This prompts for
the name of a buffer, and inserts a copy of all the text in that
buffer into the current buffer at point, leaving point at the
beginning of the inserted text. It also adds the position of the end
of the inserted text to the mark ring, without activating the mark.
@xref{Buffers}, for background information on buffers.
Instead of accumulating text in a buffer, you can append text
directly into a file with @kbd{M-x append-to-file}. This prompts for

View File

@ -2027,6 +2027,13 @@ highlighting:
@item lazy-highlight-initial-delay
@vindex lazy-highlight-initial-delay
Time in seconds to wait before highlighting visible matches.
Applies only if the search string is less than
@code{lazy-highlight-no-delay-length} characters long.
@item lazy-highlight-no-delay-length
@vindex lazy-highlight-no-delay-length
For search strings at least as long as the value of this variable,
lazy highlighting of matches starts immediately.
@item lazy-highlight-interval
@vindex lazy-highlight-interval

View File

@ -161,6 +161,8 @@ Select another window (@code{other-window}).
Scroll the next window upward (@code{scroll-other-window}).
@item C-M-S-v
Scroll the next window downward (@code{scroll-other-window-down}).
@item C-M-S-l
Recenter the next window (@code{recenter-other-window}).
@item mouse-1
@kbd{mouse-1}, in the text area of a window, selects the window and
moves point to the position clicked. Clicking in the mode line
@ -194,6 +196,8 @@ rebind a command.)
@findex scroll-other-window
@kindex C-M-S-v
@findex scroll-other-window-down
@kindex C-M-S-l
@findex recenter-other-window
The usual scrolling commands (@pxref{Display}) apply to the selected
window only, but there are also commands to scroll the next window.
@kbd{C-M-v} (@code{scroll-other-window}) scrolls the window that
@ -203,7 +207,9 @@ take positive and negative arguments. (In the minibuffer, @kbd{C-M-v}
scrolls the help window associated with the minibuffer, if any, rather
than the next window in the standard cyclic order; @pxref{Minibuffer
Edit}.) @kbd{C-M-S-v} (@code{scroll-other-window-down}) scrolls the
next window downward in a similar way.
next window downward in a similar way. Likewise, @kbd{C-M-S-l}
(@code{recenter-other-window}) behaves like @kbd{C-l}
(@code{recenter-top-bottom}) in the next window.
@vindex mouse-autoselect-window
If you set @code{mouse-autoselect-window} to a non-@code{nil} value,

View File

@ -1802,6 +1802,8 @@ Geometry}).
@item child-frame-border-width
The width in pixels of the frame's internal border (@pxref{Frame
Geometry}) if the given frame is a child frame (@pxref{Child Frames}).
If this is @code{nil}, the value specified by the
@code{internal-border-width} parameter is used instead.
@vindex vertical-scroll-bars@r{, a frame parameter}
@item vertical-scroll-bars

View File

@ -150,11 +150,11 @@ multiplied by an approximation to this value. The default for
@end table
@end defun
You can also create a new hash table using the printed representation
You can also create a hash table using the printed representation
for hash tables. The Lisp reader can read this printed
representation, provided each element in the specified hash table has
a valid read syntax (@pxref{Printed Representation}). For instance,
the following specifies a new hash table containing the keys
the following specifies a hash table containing the keys
@code{key1} and @code{key2} (both symbols) associated with @code{val1}
(a symbol) and @code{300} (a number) respectively.
@ -162,6 +162,11 @@ the following specifies a new hash table containing the keys
#s(hash-table size 30 data (key1 val1 key2 300))
@end example
Note, however, that when using this in Emacs Lisp code, it's
undefined whether this creates a new hash table or not. If you want
to create a new hash table, you should always use
@code{make-hash-table} (@pxref{Self-Evaluating Forms}).
@noindent
The printed representation for a hash table consists of @samp{#s}
followed by a list beginning with @samp{hash-table}. The rest of the

View File

@ -573,12 +573,6 @@ key.
@code{search-map} is the global keymap used for the @kbd{M-s} prefix
key.
@item
@cindex @kbd{M-o}
@vindex facemenu-keymap
@code{facemenu-keymap} is the global keymap used for the @kbd{M-o}
prefix key.
@item
The other Emacs prefix keys are @kbd{C-x @@}, @kbd{C-x a i}, @kbd{C-x
@key{ESC}} and @kbd{@key{ESC} @key{ESC}}. They use keymaps that have

View File

@ -1168,13 +1168,14 @@ x
@end group
@end example
However, the other arguments (all but the last) should be mutable lists.
However, the other arguments (all but the last) should be mutable
lists.
A common pitfall is to use a constant list as a non-last
argument to @code{nconc}. If you do this, the resulting behavior
is undefined. It is possible that your program will change
each time you run it! Here is what might happen (though this
is not guaranteed to happen):
A common pitfall is to use a constant list as a non-last argument to
@code{nconc}. If you do this, the resulting behavior is undefined
(@pxref{Self-Evaluating Forms}). It is possible that your program
will change each time you run it! Here is what might happen (though
this is not guaranteed to happen):
@smallexample
@group

View File

@ -53,9 +53,6 @@ A sparse keymap for subcommands of the prefix @kbd{C-x r}.@*
@item esc-map
A full keymap for @key{ESC} (or @key{Meta}) commands.
@item facemenu-keymap
A sparse keymap used for the @kbd{M-o} prefix key.
@item function-key-map
The parent keymap of all @code{local-function-key-map} (q.v.@:) instances.

View File

@ -1799,15 +1799,19 @@ pairs. The following properties are supported:
The value should be a function to add annotations in the completions
buffer. This function must accept one argument, a completion, and
should either return @code{nil} or a string to be displayed next to
the completion.
the completion. Unless this function puts own face on the annotation
suffix string, the @code{completions-annotations} face is added by
default to that string.
@item :affixation-function
The value should be a function to add prefixes and suffixes to
completions. This function must accept one argument, a list of
completions, and should return such a list of completions where
each element contains a list of three elements: a completion,
a prefix string, and a suffix string. This function takes priority
over @code{:annotation-function}.
a prefix string, and a suffix string. When this function
returns a list of two elements, it is interpreted as a list
of a completion and a suffix string like in @code{:annotation-function}.
This function takes priority over @code{:annotation-function}.
@item :exit-function
The value should be a function to run after performing completion.
@ -1907,6 +1911,9 @@ The value should be a function for @dfn{annotating} completions. The
function should take one argument, @var{string}, which is a possible
completion. It should return a string, which is displayed after the
completion @var{string} in the @file{*Completions*} buffer.
Unless this function puts own face on the annotation suffix string,
the @code{completions-annotations} face is added by default to
that string.
@item affixation-function
The value should be a function for adding prefixes and suffixes to
@ -1915,8 +1922,10 @@ completions. The function should take one argument,
return such a list of @var{completions} where each element contains a list
of three elements: a completion, a prefix which is displayed before
the completion string in the @file{*Completions*} buffer, and
a suffix displayed after the completion string. This function
takes priority over @code{annotation-function}.
a suffix displayed after the completion string. When this function
returns a list of two elements, it is interpreted as a list of
a completion and a suffix string like in @code{annotation-function}.
This function takes priority over @code{annotation-function}.
@item display-sort-function
The value should be a function for sorting completions. The function
@ -2384,7 +2393,7 @@ minibuffer.
@deffn Command exit-minibuffer
This command exits the active minibuffer. It is normally bound to
keys in minibuffer local keymaps. The command throws an error if the
current buffer is not the active minibuffer.
current buffer is a minibuffer, but not the active minibuffer.
@end deffn
@deffn Command self-insert-and-exit

View File

@ -1826,6 +1826,11 @@ starts, for example by providing a @code{:require} keyword.
Use @code{:group @var{group}} in @var{keyword-args} to specify the
custom group for the mode variable of the global minor mode.
By default, the buffer-local minor mode variable that says whether the
mode is switched on or off is the same as the name of the mode itself.
Use @code{:variable @var{variable}} if that's not the case--some minor
modes use a different variable to store this state information.
Generally speaking, when you define a globalized minor mode, you should
also define a non-globalized version, so that people can use (or
disable) it in individual buffers. This also allows them to disable a

View File

@ -2017,7 +2017,8 @@ describing the type of event.
default sentinel function, which inserts a message in the process's
buffer with the process name and the string describing the event.
The string describing the event looks like one of the following:
The string describing the event looks like one of the following (but
this is not an exhaustive list of event strings):
@itemize @bullet
@item
@ -2047,6 +2048,9 @@ core.
@item
@code{"open\n"}.
@item
@code{"run\n"}.
@item
@code{"connection broken by remote peer\n"}.
@end itemize

View File

@ -573,10 +573,11 @@ and by Font Lock mode during syntactic fontification (@pxref{Syntactic
Font Lock}). It is called with two arguments, @var{start} and
@var{end}, which are the starting and ending positions of the text on
which it should act. It is allowed to call @code{syntax-ppss} on any
position before @var{end}. However, it should not call
@code{syntax-ppss-flush-cache}; so, it is not allowed to call
@code{syntax-ppss} on some position and later modify the buffer at an
earlier position.
position before @var{end}, but if a Lisp program calls
@code{syntax-ppss} on some position and later modifies the buffer at
some earlier position, then it is that program's responsibility to
call @code{syntax-ppss-flush-cache} to flush the now obsolete info
from the cache.
@strong{Caution:} When this variable is non-@code{nil}, Emacs removes
@code{syntax-table} text properties arbitrarily and relies on

View File

@ -2151,6 +2151,11 @@ And this form restricts the monitoring on D-Bus errors:
@end lisp
@end defun
@deffn Command dbus-monitor &optional bus
This command invokes @code{dbus-register-monitor} interactively, and
switches to the monitor buffer.
@end deffn
@node Index
@unnumbered Index

View File

@ -2792,9 +2792,10 @@ visiting a file will show its encrypted contents. However, it is
highly discouraged to mix encrypted and not encrypted files in the
same directory.
@deffn Command tramp-crypt-add-directory name
If a remote directory shall not include encrypted files anymore, it
must be indicated by this command.
@deffn Command tramp-crypt-remove-directory name
This command should be used to indicate that files in @code{name}
should no longer be encrypted. Existing encrypted files and
subdirectories will remain encrypted.
@end deffn

View File

@ -66,8 +66,9 @@ the list at the end of this file.
** macOS
Mac OS X 10.6 or newer. PowerPC is not supported.
For installation instructions see the file nextstep/INSTALL.
Mac OS X 10.6 or newer. Both AArch64 (Arm) and x86-64 systems are
supported, but PowerPC is not supported. For installation
instructions see the file nextstep/INSTALL.
** Microsoft Windows

162
etc/NEWS
View File

@ -85,7 +85,11 @@ useful on systems such as FreeBSD which ships only with "etc/termcap".
* Changes in Emacs 28.1
** The new NonGNU ELPA archive is enabled by default alongside GNU ELPA
** The new NonGNU ELPA archive is enabled by default alongside GNU ELPA.
+++
** New command 'recenter-other-window', bound to 'S-M-C-l'.
Like 'recenter-top-bottom' acting in the other window.
** Minibuffer scrolling is now conservative by default.
This is controlled by the new variable 'scroll-minibuffer-conservatively'.
@ -221,10 +225,25 @@ It is not enabled by default.
+++
** Modifiers now go outside angle brackets in pretty-printed key bindings.
For example, <return> with Control and Meta modifiers is now shown as
C-M-<return> instead of <C-M-return>. Either variant can be used as
input; functions such as 'kbd' and 'read-kbd-macro' accept both styles
as equivalent (they have done so for a long time).
For example, 'RET' with Control and Meta modifiers is now shown as
'C-M-<return>' instead of '<C-M-return>'. Either variant can be used
as input; functions such as 'kbd' and 'read-kbd-macro' accept both
styles as equivalent (they have done so for a long time).
+++
** New user option 'lazy-highlight-no-delay-length'.
Lazy highlighting of matches in Isearch now starts immediately if the
search string is at least this long. 'lazy-highlight-initial-delay'
still applies for shorter search strings, which avoids flicker in the
search buffer due to too many matches being highlighted.
+++
** A new keymap for buffer actions has been added.
The 'C-x x' keymap now holds keystrokes for various buffer-oriented
commands. The new keystrokes are 'C-x x g' ('revert-buffer'),
'C-x x r' ('rename-buffer'), 'C-x x u' ('rename-uniquely'), 'C-x x n'
('clone-buffer'), 'C-x x i' ('insert-buffer') and 'C-x x t'
('toggle-truncate-lines').
* Editing Changes in Emacs 28.1
@ -247,7 +266,7 @@ forms, but this command has now been changed to work more like
When 'M-y' is typed not after a yank command, it activates the minibuffer
where you can browse previous kills using the minibuffer history or
completion. In Isearch, you can bind 'C-s M-y' to the command
`isearch-yank-pop' that uses the minibuffer with completion on
'isearch-yank-pop' that uses the minibuffer with completion on
previous kills to read a string and append it to the search string.
---
@ -331,9 +350,10 @@ It used to be enabled when Emacs is started in GUI mode but not when started
in text mode. The cursor still only actually blinks in GUI frames.
** pcase
+++
*** The `pred` pattern can now take the form (pred (not FUN)).
This is like (pred (lambda (x) (not (FUN x)))) but results
*** The 'pred' pattern can now take the form '(pred (not FUN))'.
This is like '(pred (lambda (x) (not (FUN x))))' but results
in better code.
+++
@ -393,7 +413,7 @@ disabled entirely.
** Windows
+++
*** New 'display-buffer' function 'display-buffer-use-least-recent-window'
*** New 'display-buffer' function 'display-buffer-use-least-recent-window'.
This is like 'display-buffer-use-some-window', but won't reuse the
current window, and when called repeatedly will try not to reuse a
previously selected window.
@ -454,9 +474,14 @@ applied when the option 'tab-line-tab-face-functions' is
so-configured. That option may also be used to customize tab-line
faces in other ways.
** New bindings in occur-mode, 'next-error-no-select' bound to 'n' and
** Occur mode
*** New bindings in occur-mode, 'next-error-no-select' bound to 'n' and
'previous-error-no-select' bound to 'p'.
*** The new command 'recenter-current-error', bound to 'l' in Occur or
compilation buffers, recenters the current displayed occurrence/error.
** EIEIO
+++
@ -505,7 +530,7 @@ time zones will use a form like "+0100" instead of "CET".
** Dired
---
*** Behaviour change on 'dired-clean-confirm-killing-deleted-buffers'.
*** Behavior change on 'dired-clean-confirm-killing-deleted-buffers'.
Previously, if 'dired-clean-up-buffers-too' was non-nil, and
'dired-clean-confirm-killing-deleted-buffers' was nil, the buffers
wouldn't be killed. This combination will now kill the buffers.
@ -576,6 +601,13 @@ their 'default-directory' under VC.
This is used when expanding commit messages from 'vc-print-root-log'
and similar commands.
---
*** New faces for 'vc-dir' buffers.
Those are: 'vc-dir-header', 'vc-dir-header-value', 'vc-dir-directory',
'vc-dir-file', 'vc-dir-mark-indicator', 'vc-dir-status-warning',
'vc-dir-status-edited', 'vc-dir-status-up-to-date',
'vc-dir-status-ignored'.
---
*** The responsible VC backend is now the most specific one.
'vc-responsible-backend' loops over the backends in
@ -726,7 +758,7 @@ not.
---
*** Respect 'message-forward-ignored-headers' more.
Previously, this variable would not be consulted if
Previously, this user option would not be consulted if
'message-forward-show-mml' was nil and forwarding as MIME.
+++
@ -840,6 +872,14 @@ iso-transl RET', it supports the same key sequences as 'C-x 8',
so e.g. like 'C-x 8 [' inserts a left single quotation mark,
'C-x \ [' does the same.
---
*** New user options 'read-char-by-name-sort' and 'read-char-by-name-group'.
'read-char-by-name-sort' defines the sorting order of characters for
completion of 'C-x 8 RET TAB' and can be customized to sort them
by codepoints instead of character names by default. The 't' value of
'read-char-by-name-group' groups the characters for completion of
'C-x 8 RET TAB' by Unicode blocks.
---
*** Improved language transliteration in Malayalam input methods.
Added a new Mozhi scheme. The inapplicable ITRANS scheme is now
@ -847,7 +887,7 @@ deprecated. Errors in the Inscript method were corrected.
---
*** New input method 'cham'.
There's also a Cham greeting in 'etc/HELLO'.
There's also a Cham greeting in "etc/HELLO".
** Ispell
@ -885,7 +925,7 @@ To revert to the previous behavior,
*** Most customize commands now hide obsolete user options.
Obsolete user options are no longer shown in the listings produced by
the commands 'customize', 'customize-group', 'customize-apropos' and
'customize-changed-options'.
'customize-changed'.
To customize obsolete user options, use 'customize-option' or
'customize-saved'.
@ -948,6 +988,9 @@ command line under point (and any following output).
** Eshell
---
*** 'eshell-hist-ignoredups' can now also be used to mimic "erasedups" in bash.
---
*** Environment variable 'INSIDE_EMACS' is now copied to subprocesses.
Its value equals the result of evaluating '(format "%s,eshell" emacs-version)'.
@ -1386,13 +1429,13 @@ have been renamed to have "proper" public names and documented
'xref-show-definitions-buffer-at-bottom').
*** New command 'xref-quit-and-pop-marker-stack' and a binding for it
in Xref buffers ('M-,'). This combination is easy to press
in "*xref*" buffers ('M-,'). This combination is easy to press
semi-accidentally if the user wants to go back in the middle of
choosing the exact definition to go to, and this should do TRT.
---
*** New value 'project-relative' for 'xref-file-name-display'
If chosen, file names in *xref* buffers will be displayed relative
*** New value 'project-relative' for 'xref-file-name-display'.
If chosen, file names in "*xref*" buffers will be displayed relative
to the 'project-root' of the current project, when available.
** json.el
@ -1415,9 +1458,9 @@ https://www.w3.org/TR/xml/#charsets). Now it rejects such strings.
---
*** erc-services.el now supports NickServ passwords from auth-source.
The 'erc-use-auth-source-for-nickserv-password' variable enables querying
auth-source for NickServ passwords. To enable this, add the following
to your init file:
The 'erc-use-auth-source-for-nickserv-password' user option enables
querying auth-source for NickServ passwords. To enable this, add the
following to your init file:
(setq erc-prompt-for-nickserv-password nil
erc-use-auth-source-for-nickserv-password t)
@ -1582,18 +1625,25 @@ that makes it a valid button.
'string-clean-whitespace', 'string-fill', 'string-limit',
'string-lines', 'string-pad' and 'string-chop-newline'.
*** New macro `named-let` that provides Scheme's "named let" looping construct
*** New macro 'named-let' that provides Scheme's "named let" looping construct.
** thingatpt
+++
*** New variable 'thing-at-point-provider-alist'.
This allows mode-specific alterations to how `thing-at-point' works.
This allows mode-specific alterations to how 'thing-at-point' works.
** Enriched mode
---
*** 'C-a' is by default no longer bound to 'beginning-of-line-text'.
This is so 'C-a' works as in other modes, and in particular holding
Shift while typing 'C-a', i.e. 'C-S-a', will now highlight the text.
** Miscellaneous
+++
*** New command `C-x C-k Q' to force redisplay in keyboard macros.
*** New command 'C-x C-k Q' to force redisplay in keyboard macros.
---
*** New user option 'remember-diary-regexp'.
@ -1607,8 +1657,8 @@ This function returns some statistics about the line lengths in a buffer.
+++
*** New variable 'inhibit-interaction' to make user prompts signal an error.
If this is bound to something non-nil, functions like
`read-from-minibuffer', `read-char' (and related) will signal an
`inhibited-interaction' error.
'read-from-minibuffer', 'read-char' (and related) will signal an
'inhibited-interaction' error.
---
*** 'process-attributes' now works under OpenBSD, too.
@ -1879,14 +1929,12 @@ Otherwise, it will use 'xwidget-webkit-last-session'.
+++
*** New user options to customize Flymake's mode-line.
The new customization variable 'flymake-mode-line-format' is a mix of
strings and symbols like 'flymake-mode-line-title' ,
'flymake-mode-line-exception' and 'flymake-mode-line-counters'. The
new customization variable 'flymake-mode-line-counter-format' is a mix
of strings and symbols like 'flymake-mode-line-error-counter',
'flymake-mode-line-warning-counter' and
'flymake-mode-line-note-counter'.
The new user option 'flymake-mode-line-format' is a mix of strings and
symbols like 'flymake-mode-line-title', 'flymake-mode-line-exception'
and 'flymake-mode-line-counters'. The new user option
'flymake-mode-line-counter-format' is a mix of strings and symbols
like 'flymake-mode-line-error-counter',
'flymake-mode-line-warning-counter' and 'flymake-mode-line-note-counter'.
** Flyspell mode
@ -1945,7 +1993,7 @@ type symbols. Both functions propagate D-Bus errors.
messages, contain the error name of that message now.
+++
*** D-Bus messages can be monitored with new function 'dbus-register-monitor'.
*** D-Bus messages can be monitored with the new command 'dbus-monitor'.
+++
*** D-Bus events have changed their internal structure.
@ -2004,6 +2052,18 @@ first).
* Incompatible Editing Changes in Emacs 28.1
** The 'M-o' ('facemanu-keymap') global binding has been removed.
** The 'M-o M-s' and 'M-o M-S' global bindings have been removed.
Use 'M-x center-line' and 'M-x center-paragraph' instead.
** In 'f90-mode', the backslash character ('\') no longer escapes.
For about a decade, the backslash character has no longer had a
special escape syntax in Fortran F90. To get the old behaviour back,
say something like:
(modify-syntax-entry ?\\ "\\" f90-mode-syntax-table)
** In 'nroff-mode', 'center-line' is now bound to 'M-o M-s'.
The original key binding was 'M-s', which interfered with I-search,
since the latter uses 'M-s' as a prefix key of the search prefix map.
@ -2014,6 +2074,11 @@ directory instead of the default directory.
* Incompatible Lisp Changes in Emacs 28.1
** 'pcomplete-ignore-case' is now an obsolete alias of 'completion-ignore-case'.
** 'completions-annotations' face is not used when the caller puts own face.
This affects the suffix specified by completion 'annotation-function'.
** 'set-process-buffer' now updates the process mark.
The mark will be set to point to the end of the new buffer.
@ -2066,6 +2131,11 @@ parameter.
'previous-system-time-locale' have been removed, as they were created
by mistake and were not useful to Lisp code.
---
** Loading 'generic-x' unconditionally loads all modes.
The user option `generic-extras-enable-list' is now obsolete, and
setting it has no effect.
---
** The 'load-dangerous-libraries' variable is now obsolete.
It was used to allow loading Lisp libraries compiled by XEmacs, a
@ -2102,8 +2172,9 @@ ledit.el, lmenu.el, lucid.el and old-whitespace.el.
'completion-base-size', 'completion-common-substring',
'crm-minibuffer-complete', 'crm-minibuffer-complete-and-exit',
'crm-minibuffer-completion-help', 'custom-mode', 'custom-mode-hook',
'define-mode-overload-implementation', 'detect-coding-with-priority',
'dirtrack-debug', 'dirtrack-debug-toggle', 'dynamic-completion-table',
'define-key-rebound-commands', 'define-mode-overload-implementation',
'detect-coding-with-priority', 'dirtrack-debug',
'dirtrack-debug-toggle', 'dynamic-completion-table',
'easy-menu-precalculate-equivalent-keybindings',
'epa-display-verify-result', 'epg-passphrase-callback-function',
'eshell-report-bug', 'eval-next-after-load', 'exchange-dot-and-mark',
@ -2158,17 +2229,24 @@ ledit.el, lmenu.el, lucid.el and old-whitespace.el.
'vcursor-toggle-vcursor-map', 'w32-focus-frame', 'w32-select-font',
'wisent-lex-make-token-table'.
** The 'when' argument of `make-obsolete` and related functions is mandatory.
The use of those functions without a 'when' argument was marked
obsolete back in Emacs-23.1. The affected functions are:
make-obsolete, define-obsolete-function-alias, make-obsolete-variable,
define-obsolete-variable-alias.
** The WHEN argument of 'make-obsolete' and related functions is mandatory.
The use of those functions without a WHEN argument was marked obsolete
back in Emacs 23.1. The affected functions are: 'make-obsolete',
'define-obsolete-function-alias', 'make-obsolete-variable',
'define-obsolete-variable-alias'.
** The variable 'keyboard-type' is obsolete and not dynamically scoped any more
** The variable 'keyboard-type' is obsolete and not dynamically scoped any more.
* Lisp Changes in Emacs 28.1
** The 'values' variable is now obsolete.
---
** New variable 'indent-line-ignored-functions'.
This allows modes to cycle through a set of indentation functions
appropriate for those modes.
** New function 'garbage-collect-maybe' to trigger GC early.
---

20
etc/facemenu-removal.txt Normal file
View File

@ -0,0 +1,20 @@
`facemenu-keymap' (normally bound to `M-o') has been disabled.
==============================================================
We've disabled the normal `M-o' keymap for a month (until March the
10th, 2021) in the development version of Emacs to see whether anybody
uses this feature.
If the removal of this key binding doesn't annoy too many people, the
plan is to then leave the it unbound, for usage by third-party
packages and users.
If you wish to restore the binding during the trial period, you can
put the following in your .emacs file:
(facemenu-keymap-restore)
After the trial period is over, the function will be removed.
If you wish to protest the removal of the `M-o' key binding, please
send your thoughts to the emacs-devel@gnu.org mailing list.

View File

@ -10,18 +10,18 @@
;; This file is part of GNU Emacs.
;; This program is free software; you can redistribute it and/or
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;

View File

@ -10,18 +10,18 @@
;; This file is part of GNU Emacs.
;; This program is free software; you can redistribute it and/or
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;

Binary file not shown.

View File

@ -516,9 +516,8 @@ It is nil if the abbrev has already been unexpanded.")
(defvar last-abbrev-location 0
"The location of the start of the last abbrev expanded.")
;; (defvar local-abbrev-table fundamental-mode-abbrev-table
;; (defvar-local local-abbrev-table fundamental-mode-abbrev-table
;; "Local (mode-specific) abbrev table of current buffer.")
;; (make-variable-buffer-local 'local-abbrev-table)
(defun clear-abbrev-table (table)
"Undefine all abbrevs in abbrev table TABLE, leaving it empty."

View File

@ -424,7 +424,7 @@ The possible settings for `align-region-separate' are:
(backward-word 1)
(looking-at
"\\(goto\\|return\\|new\\|delete\\|throw\\)"))
(if (and (boundp 'font-lock-mode) font-lock-mode)
(if font-lock-mode
(eq (get-text-property (point) 'face)
'font-lock-comment-face)
(eq (caar (c-guess-basic-syntax)) 'c)))))))
@ -775,18 +775,14 @@ See the documentation for `align-rules-list' for more info."
;;; Internal Variables:
(defvar align-mode-rules-list nil
(defvar-local align-mode-rules-list nil
"Alignment rules specific to the current major mode.
See the variable `align-rules-list' for more details.")
(make-variable-buffer-local 'align-mode-rules-list)
(defvar align-mode-exclude-rules-list nil
(defvar-local align-mode-exclude-rules-list nil
"Alignment exclusion rules specific to the current major mode.
See the variable `align-exclude-rules-list' for more details.")
(make-variable-buffer-local 'align-mode-exclude-rules-list)
(defvar align-highlight-overlays nil
"The current overlays highlighting the text matched by a rule.")

View File

@ -78,9 +78,8 @@
;;; during file load, so the involved code must reside above that
;;; definition in the file.
;;;_ = allout-widgets-mode
(defvar allout-widgets-mode nil
(defvar-local allout-widgets-mode nil
"Allout mode enhanced with graphical widgets.")
(make-variable-buffer-local 'allout-widgets-mode)
;;;_ : USER CUSTOMIZATION VARIABLES and incidental functions:
;;;_ > defgroup allout-widgets
@ -243,14 +242,13 @@ decreases as obsolete widgets are garbage collected."
:version "24.1"
:type 'boolean
:group 'allout-widgets-developer)
(defvar allout-widgets-tally nil
(defvar-local allout-widgets-tally nil
"Hash-table of existing allout widgets, for debugging.
Table is maintained only if `allout-widgets-maintain-tally' is non-nil.
The table contents will be out of sync if any widgets are created
or deleted while this variable is nil.")
(make-variable-buffer-local 'allout-widgets-tally)
(defvar allout-widgets-mode-inhibit) ; defined below
;;;_ > allout-widgets-tally-string
(defun allout-widgets-tally-string ()
@ -295,7 +293,7 @@ to publicize it by making it a customization variable)."
(message "%s" msg)
msg))
;;;_ = allout-widgets-mode-inhibit
(defvar allout-widgets-mode-inhibit nil
(defvar-local allout-widgets-mode-inhibit nil
"Inhibit `allout-widgets-mode' from activating widgets.
This also inhibits automatic adjustment of widgets to track allout outline
@ -310,15 +308,13 @@ buffers where this is set to enable and disable widget
enhancements, directly.")
;;;###autoload
(put 'allout-widgets-mode-inhibit 'safe-local-variable 'booleanp)
(make-variable-buffer-local 'allout-widgets-mode-inhibit)
;;;_ = allout-inhibit-body-modification-hook
(defvar allout-inhibit-body-modification-hook nil
(defvar-local allout-inhibit-body-modification-hook nil
"Override de-escaping of text-prefixes in item bodies during specific changes.
This is used by `allout-buffer-modification-handler' to signal such changes
to `allout-body-modification-handler', and is always reset by
`allout-post-command-business'.")
(make-variable-buffer-local 'allout-inhibit-body-modification-hook)
;;;_ = allout-widgets-icons-cache
(defvar allout-widgets-icons-cache nil
"Cache allout icon images, as an association list.
@ -358,7 +354,7 @@ See \\[describe-mode] for many more options."
The structure includes the guides lines, bullet, and bullet cue.")
;;;_ = allout-widgets-changes-record
(defvar allout-widgets-changes-record nil
(defvar-local allout-widgets-changes-record nil
"Record outline changes for processing by post-command hook.
Entries on the list are lists whose first element is a symbol indicating
@ -369,14 +365,12 @@ type. For example:
The changes are recorded in reverse order, with new values pushed
onto the front.")
(make-variable-buffer-local 'allout-widgets-changes-record)
;;;_ = allout-widgets-undo-exposure-record
(defvar allout-widgets-undo-exposure-record nil
(defvar-local allout-widgets-undo-exposure-record nil
"Record outline undo traces for processing by post-command hook.
The changes are recorded in reverse order, with new values pushed
onto the front.")
(make-variable-buffer-local 'allout-widgets-undo-exposure-record)
;;;_ = allout-widgets-last-hook-error
(defvar allout-widgets-last-hook-error nil
"String holding last error string, for debugging purposes.")
@ -393,13 +387,12 @@ onto the front.")
"Maintained true during `allout-widgets-exposure-undo-processor'")
;;;_ , Widget-specific outline text format
;;;_ = allout-escaped-prefix-regexp
(defvar allout-escaped-prefix-regexp ""
(defvar-local allout-escaped-prefix-regexp ""
"Regular expression for body text that would look like an item prefix if
not altered with an escape sequence.")
(make-variable-buffer-local 'allout-escaped-prefix-regexp)
;;;_ , Widget element formatting
;;;_ = allout-item-icon-keymap
(defvar allout-item-icon-keymap
(defvar-local allout-item-icon-keymap
(let ((km (make-sparse-keymap))
(as-parent (if (current-local-map)
(make-composed-keymap (current-local-map)
@ -420,9 +413,8 @@ not altered with an escape sequence.")
km)
"General tree-node key bindings.")
(make-variable-buffer-local 'allout-item-icon-keymap)
;;;_ = allout-item-body-keymap
(defvar allout-item-body-keymap
(defvar-local allout-item-body-keymap
(let ((km (make-sparse-keymap))
(as-parent (if (current-local-map)
(make-composed-keymap (current-local-map)
@ -432,17 +424,15 @@ not altered with an escape sequence.")
(set-keymap-parent km as-parent)
km)
"General key bindings for the text content of outline items.")
(make-variable-buffer-local 'allout-item-body-keymap)
;;;_ = allout-body-span-category
(defvar allout-body-span-category nil
"Symbol carrying allout body-text overlay properties.")
;;;_ = allout-cue-span-keymap
(defvar allout-cue-span-keymap
(defvar-local allout-cue-span-keymap
(let ((km (make-sparse-keymap)))
(set-keymap-parent km allout-item-icon-keymap)
km)
"Keymap used in the item cue area - the space between the icon and headline.")
(make-variable-buffer-local 'allout-cue-span-keymap)
;;;_ = allout-escapes-category
(defvar allout-escapes-category nil
"Symbol for category of text property used to hide escapes of prefix-like
@ -477,7 +467,7 @@ including things like:
(defvar allout-trailing-category nil
"Symbol carrying common properties of an overlay's trailing newline.")
;;;_ , Developer
(defvar allout-widgets-last-decoration-timing nil
(defvar-local allout-widgets-last-decoration-timing nil
"Timing details for the last cooperative decoration action.
This is maintained when `allout-widgets-time-decoration-activity' is set.
@ -488,7 +478,6 @@ The value is a list containing two elements:
When active, the value is revised each time automatic decoration activity
happens in the buffer.")
(make-variable-buffer-local 'allout-widgets-last-decoration-timing)
;;;_ . mode hookup
;;;_ > define-minor-mode allout-widgets-mode (arg)
;;;###autoload
@ -693,12 +682,11 @@ outline hot-spot navigation (see `allout-mode')."
(allout-get-or-create-item-widget))))))
;;;_ . settings context
;;;_ = allout-container-item
(defvar allout-container-item-widget nil
(defvar-local allout-container-item-widget nil
"A widget for the current outline's overarching container as an item.
The item has settings (of the file/connection) and maybe a body, but no
icon/bullet.")
(make-variable-buffer-local 'allout-container-item-widget)
;;;_ . Hooks and hook helpers
;;;_ , major command-loop business:
;;;_ > allout-widgets-pre-command-business (&optional recursing)
@ -2243,7 +2231,7 @@ interactive command."
We use a caching strategy, so the caller doesn't need to do so."
(let* ((types allout-widgets-icon-types)
(use-dir (if (equal (allout-frame-property nil 'background-mode)
(use-dir (if (equal (frame-parameter nil 'background-mode)
'light)
allout-widgets-icons-light-subdir
allout-widgets-icons-dark-subdir))
@ -2274,13 +2262,6 @@ We use a caching strategy, so the caller doesn't need to do so."
"Return seconds between START/END time values."
(let ((elapsed (time-subtract end start)))
(float-time elapsed)))
;;;_ > allout-frame-property (frame property)
(defalias 'allout-frame-property
(cond ((fboundp 'frame-parameter)
'frame-parameter)
((fboundp 'frame-property)
'frame-property)
(t nil)))
;;;_ > allout-find-image (specs)
(define-obsolete-function-alias 'allout-find-image #'find-image "28.1")
;;;_ > allout-widgets-copy-list (list)
@ -2307,6 +2288,8 @@ The elements of LIST are not copied, just the list structure itself."
(overlays-in start end)))))
(length button-overlays)))
(define-obsolete-function-alias 'allout-frame-property #'frame-parameter "28.1")
;;;_ : provide
(provide 'allout-widgets)

View File

@ -830,9 +830,8 @@ such topics are encrypted.)"
The value of `buffer-saved-size' at the time of decryption is used,
for restoring when all encryptions are established.")
(defvar allout-just-did-undo nil
(defvar-local allout-just-did-undo nil
"True just after undo commands, until allout-post-command-business.")
(make-variable-buffer-local 'allout-just-did-undo)
;;;_ + Developer
;;;_ = allout-developer group
@ -874,10 +873,10 @@ For details, see `allout-toggle-current-subtree-encryption's docstring."
msg))
;;;_ : Mode activation (defined here because it's referenced early)
;;;_ = allout-mode
(defvar allout-mode nil "Allout outline mode minor-mode flag.")
(make-variable-buffer-local 'allout-mode)
(defvar-local allout-mode nil
"Allout outline mode minor-mode flag.")
;;;_ = allout-layout nil
(defvar allout-layout nil ; LEAVE GLOBAL VALUE NIL -- see docstring.
(defvar-local allout-layout nil ; LEAVE GLOBAL VALUE NIL -- see docstring.
"Buffer-specific setting for allout layout.
In buffers where this is non-nil (and if `allout-auto-activation'
@ -903,34 +902,30 @@ followed by the equivalent of `(allout-expose-topic 0 : -1 -1 0)'.
`allout-default-layout' describes the specification format.
`allout-layout' can additionally have the value t, in which
case the value of `allout-default-layout' is used.")
(make-variable-buffer-local 'allout-layout)
;;;###autoload
(put 'allout-layout 'safe-local-variable
(lambda (x) (or (numberp x) (listp x) (memq x '(: * + -)))))
;;;_ : Topic header format
;;;_ = allout-regexp
(defvar allout-regexp ""
(defvar-local allout-regexp ""
"Regular expression to match the beginning of a heading line.
Any line whose beginning matches this regexp is considered a
heading. This var is set according to the user configuration vars
by `allout-set-regexp'.")
(make-variable-buffer-local 'allout-regexp)
;;;_ = allout-bullets-string
(defvar allout-bullets-string ""
(defvar-local allout-bullets-string ""
"A string dictating the valid set of outline topic bullets.
This var should *not* be set by the user -- it is set by `allout-set-regexp',
and is produced from the elements of `allout-plain-bullets-string'
and `allout-distinctive-bullets-string'.")
(make-variable-buffer-local 'allout-bullets-string)
;;;_ = allout-bullets-string-len
(defvar allout-bullets-string-len 0
(defvar-local allout-bullets-string-len 0
"Length of current buffers' `allout-plain-bullets-string'.")
(make-variable-buffer-local 'allout-bullets-string-len)
;;;_ = allout-depth-specific-regexp
(defvar allout-depth-specific-regexp ""
(defvar-local allout-depth-specific-regexp ""
"Regular expression to match a heading line prefix for a particular depth.
This expression is used to search for depth-specific topic
@ -941,34 +936,28 @@ This var is set according to the user configuration vars by
`allout-set-regexp'. It is prepared with format strings for two
decimal numbers, which should each be one less than the depth of the
topic prefix to be matched.")
(make-variable-buffer-local 'allout-depth-specific-regexp)
;;;_ = allout-depth-one-regexp
(defvar allout-depth-one-regexp ""
(defvar-local allout-depth-one-regexp ""
"Regular expression to match a heading line prefix for depth one.
This var is set according to the user configuration vars by
`allout-set-regexp'. It is prepared with format strings for two
decimal numbers, which should each be one less than the depth of the
topic prefix to be matched.")
(make-variable-buffer-local 'allout-depth-one-regexp)
;;;_ = allout-line-boundary-regexp
(defvar allout-line-boundary-regexp ()
(defvar-local allout-line-boundary-regexp ()
"`allout-regexp' prepended with a newline for the search target.
This is properly set by `allout-set-regexp'.")
(make-variable-buffer-local 'allout-line-boundary-regexp)
;;;_ = allout-bob-regexp
(defvar allout-bob-regexp ()
(defvar-local allout-bob-regexp ()
"Like `allout-line-boundary-regexp', for headers at beginning of buffer.")
(make-variable-buffer-local 'allout-bob-regexp)
;;;_ = allout-header-subtraction
(defvar allout-header-subtraction (1- (length allout-header-prefix))
(defvar-local allout-header-subtraction (1- (length allout-header-prefix))
"Allout-header prefix length to subtract when computing topic depth.")
(make-variable-buffer-local 'allout-header-subtraction)
;;;_ = allout-plain-bullets-string-len
(defvar allout-plain-bullets-string-len (length allout-plain-bullets-string)
(defvar-local allout-plain-bullets-string-len (length allout-plain-bullets-string)
"Length of `allout-plain-bullets-string', updated by `allout-set-regexp'.")
(make-variable-buffer-local 'allout-plain-bullets-string-len)
;;;_ = allout-doublecheck-at-and-shallower
(defconst allout-doublecheck-at-and-shallower 3
@ -1279,11 +1268,10 @@ Also refresh various data structures that hinge on the regexp."
["Set New Exposure" allout-expose-topic t])))
;;;_ : Allout Modal-Variables Utilities
;;;_ = allout-mode-prior-settings
(defvar allout-mode-prior-settings nil
(defvar-local allout-mode-prior-settings nil
"Internal `allout-mode' use; settings to be resumed on mode deactivation.
See `allout-add-resumptions' and `allout-do-resumptions'.")
(make-variable-buffer-local 'allout-mode-prior-settings)
;;;_ > allout-add-resumptions (&rest pairs)
(defun allout-add-resumptions (&rest pairs)
"Set name/value PAIRS.
@ -1466,16 +1454,15 @@ that was affected by the undo.."
:version "24.3")
;;;_ = allout-outside-normal-auto-fill-function
(defvar allout-outside-normal-auto-fill-function nil
(defvar-local allout-outside-normal-auto-fill-function nil
"Value of `normal-auto-fill-function' outside of allout mode.
Used by `allout-auto-fill' to do the mandated `normal-auto-fill-function'
wrapped within allout's automatic `fill-prefix' setting.")
(make-variable-buffer-local 'allout-outside-normal-auto-fill-function)
;;;_ = prevent redundant activation by desktop mode:
(add-to-list 'desktop-minor-mode-handlers '(allout-mode . nil))
;;;_ = allout-after-save-decrypt
(defvar allout-after-save-decrypt nil
(defvar-local allout-after-save-decrypt nil
"Internal variable, is nil or has the value of two points:
- the location of a topic to be decrypted after saving is done
@ -1483,9 +1470,8 @@ wrapped within allout's automatic `fill-prefix' setting.")
This is used to decrypt the topic that was currently being edited, if it
was encrypted automatically as part of a file write or autosave.")
(make-variable-buffer-local 'allout-after-save-decrypt)
;;;_ = allout-encryption-plaintext-sanitization-regexps
(defvar allout-encryption-plaintext-sanitization-regexps nil
(defvar-local allout-encryption-plaintext-sanitization-regexps nil
"List of regexps whose matches are removed from plaintext before encryption.
This is for the sake of removing artifacts, like escapes, that are added on
@ -1498,9 +1484,8 @@ Each value can be a regexp or a list with a regexp followed by a
substitution string. If it's just a regexp, all its matches are removed
before the text is encrypted. If it's a regexp and a substitution, the
substitution is used against the regexp matches, a la `replace-match'.")
(make-variable-buffer-local 'allout-encryption-plaintext-sanitization-regexps)
;;;_ = allout-encryption-ciphertext-rejection-regexps
(defvar allout-encryption-ciphertext-rejection-regexps nil
(defvar-local allout-encryption-ciphertext-rejection-regexps nil
"Variable for regexps matching plaintext to remove before encryption.
This is used to detect strings in encryption results that would
@ -1513,13 +1498,11 @@ Encryptions that result in matches will be retried, up to
`allout-encryption-ciphertext-rejection-ceiling' times, after which
an error is raised.")
(make-variable-buffer-local 'allout-encryption-ciphertext-rejection-regexps)
;;;_ = allout-encryption-ciphertext-rejection-ceiling
(defvar allout-encryption-ciphertext-rejection-ceiling 5
(defvar-local allout-encryption-ciphertext-rejection-ceiling 5
"Limit on number of times encryption ciphertext is rejected.
See `allout-encryption-ciphertext-rejection-regexps' for rejection reasons.")
(make-variable-buffer-local 'allout-encryption-ciphertext-rejection-ceiling)
;;;_ > allout-mode-p ()
;; Must define this macro above any uses, or byte compilation will lack
;; proper def, if file isn't loaded -- eg, during emacs build!
@ -1607,10 +1590,9 @@ non-nil in a lasting way.")
;;;_ #2 Mode environment and activation
;;;_ = allout-explicitly-deactivated
(defvar allout-explicitly-deactivated nil
(defvar-local allout-explicitly-deactivated nil
"If t, `allout-mode's last deactivation was deliberate.
So `allout-post-command-business' should not reactivate it...")
(make-variable-buffer-local 'allout-explicitly-deactivated)
;;;_ > allout-setup-menubar ()
(defun allout-setup-menubar ()
"Populate the current buffer's menubar with `allout-mode' stuff."
@ -2119,21 +2101,17 @@ function can also be used as an `isearch-mode-end-hook'."
;; for just-established data. This optimization can provide
;; significant speed improvement, but it must be employed carefully.
;;;_ = allout-recent-prefix-beginning
(defvar allout-recent-prefix-beginning 0
(defvar-local allout-recent-prefix-beginning 0
"Buffer point of the start of the last topic prefix encountered.")
(make-variable-buffer-local 'allout-recent-prefix-beginning)
;;;_ = allout-recent-prefix-end
(defvar allout-recent-prefix-end 0
(defvar-local allout-recent-prefix-end 0
"Buffer point of the end of the last topic prefix encountered.")
(make-variable-buffer-local 'allout-recent-prefix-end)
;;;_ = allout-recent-depth
(defvar allout-recent-depth 0
(defvar-local allout-recent-depth 0
"Depth of the last topic prefix encountered.")
(make-variable-buffer-local 'allout-recent-depth)
;;;_ = allout-recent-end-of-subtree
(defvar allout-recent-end-of-subtree 0
(defvar-local allout-recent-end-of-subtree 0
"Buffer point last returned by `allout-end-of-current-subtree'.")
(make-variable-buffer-local 'allout-recent-end-of-subtree)
;;;_ > allout-prefix-data ()
(defsubst allout-prefix-data ()
"Register allout-prefix state data.
@ -3213,7 +3191,7 @@ Returns resulting position, else nil if none found."
;;;_ - Fundamental
;;;_ = allout-post-goto-bullet
(defvar allout-post-goto-bullet nil
(defvar-local allout-post-goto-bullet nil
"Outline internal var, for `allout-pre-command-business' hot-spot operation.
When set, tells post-processing to reposition on topic bullet, and
@ -3221,18 +3199,15 @@ then unset it. Set by `allout-pre-command-business' when implementing
hot-spot operation, where literal characters typed over a topic bullet
are mapped to the command of the corresponding control-key on the
`allout-mode-map-value'.")
(make-variable-buffer-local 'allout-post-goto-bullet)
;;;_ = allout-command-counter
(defvar allout-command-counter 0
(defvar-local allout-command-counter 0
"Counter that monotonically increases in allout-mode buffers.
Set by `allout-pre-command-business', to support allout addons in
coordinating with allout activity.")
(make-variable-buffer-local 'allout-command-counter)
;;;_ = allout-this-command-hid-text
(defvar allout-this-command-hid-text nil
(defvar-local allout-this-command-hid-text nil
"True if the most recent allout-mode command hid any text.")
(make-variable-buffer-local 'allout-this-command-hid-text)
;;;_ > allout-post-command-business ()
(defun allout-post-command-business ()
"Outline `post-command-hook' function.

View File

@ -581,14 +581,15 @@ default value. If the user, host, or port are missing, the alist
`auth-source-creation-prompts' will be used to look up the
prompts IN THAT ORDER (so the `user' prompt will be queried first,
then `host', then `port', and finally `secret'). Each prompt string
can use %u, %h, and %p to show the user, host, and port.
can use %u, %h, and %p to show the user, host, and port. The prompt
is formatted with `format-prompt', a trailing \": \" is removed.
Here's an example:
\(let ((auth-source-creation-defaults \\='((user . \"defaultUser\")
(A . \"default A\")))
(auth-source-creation-prompts
\\='((secret . \"Enter IMAP password for %h:%p: \"))))
\\='((secret . \"Enter IMAP password for %h:%p\"))))
(auth-source-search :host \\='(\"nonesuch\" \"twosuch\") :type \\='netrc :max 1
:P \"pppp\" :Q \"qqqq\"
:create \\='(A B Q)))
@ -860,7 +861,9 @@ while \(:host t) would find all host entries."
secret)))
(defun auth-source-format-prompt (prompt alist)
"Format PROMPT using %x (for any character x) specifiers in ALIST."
"Format PROMPT using %x (for any character x) specifiers in ALIST.
Remove trailing \": \"."
(setq prompt (replace-regexp-in-string ":\\s-*$" "" prompt))
(dolist (cell alist)
(let ((c (nth 0 cell))
(v (nth 1 cell)))
@ -1344,11 +1347,11 @@ See `auth-source-search' for details on SPEC."
"[any port]"))))
(prompt (or (auth-source--aget auth-source-creation-prompts r)
(cl-case r
(secret "%p password for %u@%h: ")
(user "%p user name for %h: ")
(host "%p host name for user %u: ")
(port "%p port for %u@%h: "))
(format "Enter %s (%%u@%%h:%%p): " r)))
(secret "%p password for %u@%h")
(user "%p user name for %h")
(host "%p host name for user %u")
(port "%p port for %u@%h"))
(format "Enter %s (%%u@%%h:%%p)" r)))
(prompt (auth-source-format-prompt
prompt
`((?u ,(auth-source--aget printable-defaults 'user))
@ -1378,7 +1381,9 @@ See `auth-source-search' for details on SPEC."
(setq check nil)))
ret))
(t 'never)))
(plain (or (eval default) (read-passwd prompt))))
(plain
(or (eval default)
(read-passwd (format-prompt prompt nil)))))
;; ask if we don't know what to do (in which case
;; auth-source-netrc-use-gpg-tokens must be a list)
(unless gpg-encrypt
@ -1390,12 +1395,9 @@ See `auth-source-search' for details on SPEC."
(if (eq gpg-encrypt 'gpg)
(auth-source-epa-make-gpg-token plain file)
plain))
(if (stringp default)
(read-string (if (string-match ": *\\'" prompt)
(concat (substring prompt 0 (match-beginning 0))
" (default " default "): ")
(concat prompt "(default " default ") "))
nil nil default)
(if (and (stringp default) auth-source-save-behavior)
(read-string
(format-prompt prompt default) nil nil default)
(eval default)))))
(when data
@ -1745,12 +1747,12 @@ authentication tokens:
"[any label]"))))
(prompt (or (auth-source--aget auth-source-creation-prompts r)
(cl-case r
(secret "%p password for %u@%h: ")
(user "%p user name for %h: ")
(host "%p host name for user %u: ")
(port "%p port for %u@%h: ")
(label "Enter label for %u@%h: "))
(format "Enter %s (%%u@%%h:%%p): " r)))
(secret "%p password for %u@%h")
(user "%p user name for %h")
(host "%p host name for user %u")
(port "%p port for %u@%h")
(label "Enter label for %u@%h"))
(format "Enter %s (%%u@%%h:%%p)" r)))
(prompt (auth-source-format-prompt
prompt
`((?u ,(auth-source--aget printable-defaults 'user))
@ -1760,13 +1762,11 @@ authentication tokens:
;; Store the data, prompting for the password if needed.
(setq data (or data
(if (eq r 'secret)
(or (eval default) (read-passwd prompt))
(if (stringp default)
(read-string (if (string-match ": *\\'" prompt)
(concat (substring prompt 0 (match-beginning 0))
" (default " default "): ")
(concat prompt "(default " default ") "))
nil nil default)
(or (eval default)
(read-passwd (format-prompt prompt nil)))
(if (and (stringp default) auth-source-save-behavior)
(read-string
(format-prompt prompt default) nil nil default)
(eval default)))))
(when data
@ -2190,11 +2190,11 @@ entries for git.gnus.org:
"[any port]"))))
(prompt (or (auth-source--aget auth-source-creation-prompts r)
(cl-case r
(secret "%p password for %u@%h: ")
(user "%p user name for %h: ")
(host "%p host name for user %u: ")
(port "%p port for %u@%h: "))
(format "Enter %s (%%u@%%h:%%p): " r)))
(secret "%p password for %u@%h")
(user "%p user name for %h")
(host "%p host name for user %u")
(port "%p port for %u@%h"))
(format "Enter %s (%%u@%%h:%%p)" r)))
(prompt (auth-source-format-prompt
prompt
`((?u ,(auth-source--aget printable-defaults 'user))
@ -2204,14 +2204,11 @@ entries for git.gnus.org:
;; Store the data, prompting for the password if needed.
(setq data (or data
(if (eq r 'secret)
(or (eval default) (read-passwd prompt))
(if (stringp default)
(or (eval default)
(read-passwd (format-prompt prompt nil)))
(if (and (stringp default) auth-source-save-behavior)
(read-string
(if (string-match ": *\\'" prompt)
(concat (substring prompt 0 (match-beginning 0))
" (default " default "): ")
(concat prompt "(default " default ") "))
nil nil default)
(format-prompt prompt default) nil nil default)
(eval default)))))
(when data

View File

@ -25,8 +25,10 @@
;; For those who are annoyed by the mouse pointer obscuring text,
;; this mode moves the mouse pointer - either just a little out of
;; the way, or all the way to the corner of the frame.
;; To use, load or evaluate this file and type M-x mouse-avoidance-mode .
;; To set up permanently, put the following in your .emacs:
;;
;; To use, type `M-x mouse-avoidance-mode'.
;;
;; To set up permanently, put this in your .emacs:
;;
;; (if (display-mouse-p) (mouse-avoidance-mode 'animate))
;;
@ -47,11 +49,6 @@
;;
;; For completely random pointer shape, replace the setq above with:
;; (setq x-pointer-shape (mouse-avoidance-random-shape))
;;
;; Bugs / Warnings / To-Do:
;;
;; - Using this code does slow Emacs down. "banish" mode shouldn't
;; be too bad, and on my workstation even "animate" is reasonable.
;; Credits:
;; This code was helped by all those who contributed suggestions,
@ -76,7 +73,7 @@
"Activate Mouse Avoidance mode.
See function `mouse-avoidance-mode' for possible values.
Setting this variable directly does not take effect;
use either \\[customize] or the function `mouse-avoidance-mode'."
use either \\[customize] or \\[mouse-avoidance-mode]."
:set (lambda (_symbol value)
;; 'none below prevents toggling when value is nil.
(mouse-avoidance-mode (or value 'none)))
@ -261,9 +258,9 @@ If you want the mouse banished to a different corner set
(t 0))))
(defun mouse-avoidance-nudge-mouse ()
;; Push the mouse a little way away, possibly animating the move.
;; For these modes, state keeps track of the total offset that we've
;; accumulated, and tries to keep it close to zero.
"Push the mouse a little way away, possibly animating the move.
For these modes, state keeps track of the total offset that we've
accumulated, and tries to keep it close to zero."
(let* ((cur (mouse-position))
(cur-pos (cdr cur))
(pos (window-edges))
@ -375,7 +372,7 @@ redefine this function to suit your own tastes."
(setq mouse-avoidance-state nil))))))
(defun mouse-avoidance-fancy ()
;; Used for the "fancy" modes, ie jump et al.
;; Used for the "fancy" modes, i.e. jump et al.
(if (and (not mouse-avoidance-animating-pointer)
(not (mouse-avoidance-ignore-p))
(mouse-avoidance-too-close-p (mouse-position)))

View File

@ -199,7 +199,7 @@ mouse-3: Set coding system"
(symbol-name buffer-file-coding-system))
"Buffer coding system: none specified")))
(defvar mode-line-mule-info
(defvar-local mode-line-mule-info
`(""
(current-input-method
(:propertize ("" current-input-method-title)
@ -225,7 +225,6 @@ mnemonics of the following coding systems:
coding system for terminal output (on a text terminal)")
;;;###autoload
(put 'mode-line-mule-info 'risky-local-variable t)
(make-variable-buffer-local 'mode-line-mule-info)
(defvar mode-line-client
`(""
@ -247,7 +246,7 @@ mnemonics of the following coding systems:
(format "Buffer is %smodified\nmouse-1: Toggle modification state"
(if (buffer-modified-p (window-buffer window)) "" "not ")))
(defvar mode-line-modified
(defvar-local mode-line-modified
(list (propertize
"%1*"
'help-echo 'mode-line-read-only-help-echo
@ -264,9 +263,8 @@ mnemonics of the following coding systems:
"Mode line construct for displaying whether current buffer is modified.")
;;;###autoload
(put 'mode-line-modified 'risky-local-variable t)
(make-variable-buffer-local 'mode-line-modified)
(defvar mode-line-remote
(defvar-local mode-line-remote
(list (propertize
"%1@"
'mouse-face 'mode-line-highlight
@ -283,7 +281,6 @@ mnemonics of the following coding systems:
"Mode line construct to indicate a remote buffer.")
;;;###autoload
(put 'mode-line-remote 'risky-local-variable t)
(make-variable-buffer-local 'mode-line-remote)
;; MSDOS frames have window-system, but want the Fn identification.
(defun mode-line-frame-control ()
@ -301,12 +298,11 @@ Value is used for `mode-line-frame-identification', which see."
;;;###autoload
(put 'mode-line-frame-identification 'risky-local-variable t)
(defvar mode-line-process nil
(defvar-local mode-line-process nil
"Mode line construct for displaying info on process status.
Normally nil in most modes, since there is no process to display.")
;;;###autoload
(put 'mode-line-process 'risky-local-variable t)
(make-variable-buffer-local 'mode-line-process)
(defun bindings--define-key (map key item)
"Define KEY in keymap MAP according to ITEM from a menu.
@ -543,7 +539,7 @@ mouse-1: Previous buffer\nmouse-3: Next buffer")
'mouse-face 'mode-line-highlight
'local-map mode-line-buffer-identification-keymap)))
(defvar mode-line-buffer-identification
(defvar-local mode-line-buffer-identification
(propertized-buffer-identification "%12b")
"Mode line construct for identifying the buffer being displayed.
Its default value is (\"%12b\") with some text properties added.
@ -551,7 +547,6 @@ Major modes that edit things other than ordinary files may change this
\(e.g. Info, Dired,...)")
;;;###autoload
(put 'mode-line-buffer-identification 'risky-local-variable t)
(make-variable-buffer-local 'mode-line-buffer-identification)
(defvar mode-line-misc-info
'((global-mode-string ("" global-mode-string " ")))
@ -1418,6 +1413,18 @@ if `inhibit-field-text-motion' is non-nil."
(define-key ctl-x-map "z" 'repeat)
(defvar ctl-x-x-map
(let ((map (make-sparse-keymap)))
(define-key map "g" #'revert-buffer)
(define-key map "r" #'rename-buffer)
(define-key map "u" #'rename-uniquely)
(define-key map "n" #'clone-buffer)
(define-key map "i" #'insert-buffer)
(define-key map "t" #'toggle-truncate-lines)
map)
"Keymap for subcommands of C-x x.")
(define-key ctl-x-map "x" ctl-x-x-map)
(define-key esc-map "\C-l" 'reposition-window)
(define-key ctl-x-4-map "a" 'add-change-log-entry-other-window)

View File

@ -271,13 +271,11 @@ defaults to `bookmark-default-file' and MODTIME is its modification time.")
(defvar bookmark-file-coding-system nil
"The coding-system of the last loaded or saved bookmark file.")
(defvar bookmark-current-bookmark nil
(defvar-local bookmark-current-bookmark nil
"Name of bookmark most recently used in the current file.
It is buffer local, used to make moving a bookmark forward
through a file easier.")
(make-variable-buffer-local 'bookmark-current-bookmark)
(defvar bookmark-alist-modification-count 0
"Number of modifications to bookmark list since it was last saved.")
@ -903,13 +901,11 @@ Does not affect the kill ring."
(when (and newline-too (= (following-char) ?\n))
(delete-char 1))))
(defvar bookmark-annotation-name nil
(defvar-local bookmark-annotation-name nil
"Name of bookmark under edit in `bookmark-edit-annotation-mode'.")
(make-variable-buffer-local 'bookmark-annotation-name)
(defvar bookmark--annotation-from-bookmark-list nil
(defvar-local bookmark--annotation-from-bookmark-list nil
"If non-nil, `bookmark-edit-annotation-mode' should return to bookmark list.")
(make-variable-buffer-local 'bookmark--annotation-from-bookmark-list)
(defun bookmark-default-annotation-text (bookmark-name)
"Return default annotation text for BOOKMARK-NAME.

View File

@ -111,11 +111,10 @@ as it is by default."
:group 'Buffer-menu
:version "22.1")
(defvar Buffer-menu-files-only nil
(defvar-local Buffer-menu-files-only nil
"Non-nil if the current Buffer Menu lists only file buffers.
This is set by the prefix argument to `buffer-menu' and related
commands.")
(make-variable-buffer-local 'Buffer-menu-files-only)
(defvar Buffer-menu-mode-map
(let ((map (make-sparse-keymap))

View File

@ -46,10 +46,8 @@
(defvar calc-embedded-modes nil)
(defvar calc-embedded-globals nil)
(defvar calc-embedded-active nil)
(defvar calc-embedded-all-active nil)
(make-variable-buffer-local 'calc-embedded-all-active)
(defvar calc-embedded-some-active nil)
(make-variable-buffer-local 'calc-embedded-some-active)
(defvar-local calc-embedded-all-active nil)
(defvar-local calc-embedded-some-active nil)
;; The following variables are customizable and defined in calc.el.
(defvar calc-embedded-announce-formula)
@ -856,31 +854,21 @@ The command \\[yank] can retrieve it from there."
(newmode (cl-assoc-if #'derived-mode-p
calc-embedded-open-close-mode-alist)))
(when newann
(make-local-variable 'calc-embedded-announce-formula)
(setq calc-embedded-announce-formula (cdr newann)))
(setq-local calc-embedded-announce-formula (cdr newann)))
(when newform
(make-local-variable 'calc-embedded-open-formula)
(make-local-variable 'calc-embedded-close-formula)
(setq calc-embedded-open-formula (nth 0 (cdr newform)))
(setq calc-embedded-close-formula (nth 1 (cdr newform))))
(setq-local calc-embedded-open-formula (nth 0 (cdr newform)))
(setq-local calc-embedded-close-formula (nth 1 (cdr newform))))
(when newword
(make-local-variable 'calc-embedded-word-regexp)
(setq calc-embedded-word-regexp (nth 1 newword)))
(setq-local calc-embedded-word-regexp (nth 1 newword)))
(when newplain
(make-local-variable 'calc-embedded-open-plain)
(make-local-variable 'calc-embedded-close-plain)
(setq calc-embedded-open-plain (nth 0 (cdr newplain)))
(setq calc-embedded-close-plain (nth 1 (cdr newplain))))
(setq-local calc-embedded-open-plain (nth 0 (cdr newplain)))
(setq-local calc-embedded-close-plain (nth 1 (cdr newplain))))
(when newnewform
(make-local-variable 'calc-embedded-open-new-formula)
(make-local-variable 'calc-embedded-close-new-formula)
(setq calc-embedded-open-new-formula (nth 0 (cdr newnewform)))
(setq calc-embedded-close-new-formula (nth 1 (cdr newnewform))))
(setq-local calc-embedded-open-new-formula (nth 0 (cdr newnewform)))
(setq-local calc-embedded-close-new-formula (nth 1 (cdr newnewform))))
(when newmode
(make-local-variable 'calc-embedded-open-mode)
(make-local-variable 'calc-embedded-close-mode)
(setq calc-embedded-open-mode (nth 0 (cdr newmode)))
(setq calc-embedded-close-mode (nth 1 (cdr newmode)))))))
(setq-local calc-embedded-open-mode (nth 0 (cdr newmode)))
(setq-local calc-embedded-close-mode (nth 1 (cdr newmode)))))))
(while (and (cdr found)
(> point (aref (car (cdr found)) 3)))
(setq found (cdr found)))

View File

@ -1545,9 +1545,7 @@
(set-buffer trace-buffer)
(goto-char (point-max))
(or (assq 'scroll-stop (buffer-local-variables))
(progn
(make-local-variable 'scroll-step)
(setq scroll-step 3)))
(setq-local scroll-step 3))
(insert "\n\n\n")
(set-buffer calcbuf)
(math-try-integral sexpr))

View File

@ -1045,30 +1045,30 @@ If the result is a list or vector, then use the data debugger to display it."
(list (let ((minibuffer-completing-symbol t))
(read-from-minibuffer "Eval: "
nil read-expression-map t
'read-expression-history))
))
'read-expression-history))))
(if (null eval-expression-debug-on-error)
(setq values (cons (eval expr) values))
(let ((old-value (make-symbol "t")) new-value)
;; Bind debug-on-error to something unique so that we can
;; detect when evalled code changes it.
(let ((debug-on-error old-value))
(setq values (cons (eval expr) values))
(setq new-value debug-on-error))
;; If evalled code has changed the value of debug-on-error,
;; propagate that change to the global binding.
(unless (eq old-value new-value)
(setq debug-on-error new-value))))
(let (result)
(if (null eval-expression-debug-on-error)
(setq result (values--store-value (eval expr)))
(let ((old-value (make-symbol "t")) new-value)
;; Bind debug-on-error to something unique so that we can
;; detect when evalled code changes it.
(let ((debug-on-error old-value))
(setq result (values--store-value (eval expr)))
(setq new-value debug-on-error))
;; If evalled code has changed the value of debug-on-error,
;; propagate that change to the global binding.
(unless (eq old-value new-value)
(setq debug-on-error new-value))))
(if (or (consp (car values)) (vectorp (car values)))
(let ((v (car values)))
(data-debug-show-stuff v "Expression"))
;; Old style
(prog1
(prin1 (car values) t)
(let ((str (eval-expression-print-format (car values))))
(if str (princ str t))))))
(if (or (consp result) (vectorp result))
(let ((v result))
(data-debug-show-stuff v "Expression"))
;; Old style
(prog1
(prin1 result t)
(let ((str (eval-expression-print-format result)))
(if str (princ str t)))))))
(provide 'data-debug)

View File

@ -140,22 +140,19 @@ specified by `ede-project-directories'."
(defvar ede-projects nil
"A list of all active projects currently loaded in Emacs.")
(defvar ede-object-root-project nil
(defvar-local ede-object-root-project nil
"The current buffer's current root project.
If a file is under a project, this specifies the project that is at
the root of a project tree.")
(make-variable-buffer-local 'ede-object-root-project)
(defvar ede-object-project nil
(defvar-local ede-object-project nil
"The current buffer's current project at that level.
If a file is under a project, this specifies the project that contains the
current target.")
(make-variable-buffer-local 'ede-object-project)
(defvar ede-object nil
(defvar-local ede-object nil
"The current buffer's target object.
This object's class determines how to compile and debug from a buffer.")
(make-variable-buffer-local 'ede-object)
(defvar ede-selected-object nil
"The currently user-selected project or target.

View File

@ -5,6 +5,8 @@
;; Author: Eric M. Ludlam <zappo@gnu.org>
;; Keywords: project, make
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or

View File

@ -1,4 +1,4 @@
;;; project-am.el --- A project management scheme based on automake files.
;;; project-am.el --- A project management scheme based on automake files. -*- lexical-binding: t; -*-
;; Copyright (C) 1998-2000, 2003, 2005, 2007-2021 Free Software
;; Foundation, Inc.
@ -54,17 +54,14 @@
(defcustom project-am-compile-project-command nil
"Default command used to compile a project."
:group 'project-am
:type '(choice (const nil) string))
(defcustom project-am-compile-target-command (concat ede-make-command " -k %s")
"Default command used to compile a project."
:group 'project-am
:type 'string)
(defcustom project-am-debug-target-function 'gdb
"Default Emacs command used to debug a target."
:group 'project-am
:type 'function) ; make this be a list some day
(defconst project-am-type-alist
@ -240,8 +237,8 @@ OT is the object target. DIR is the directory to start in."
(if (= (point-min) (point))
(re-search-forward (ede-target-name obj))))
(cl-defmethod project-new-target ((proj project-am-makefile)
&optional name type)
(cl-defmethod project-new-target ((_proj project-am-makefile)
&optional name type)
"Create a new target named NAME.
Argument TYPE is the type of target to insert. This is a string
matching something in `project-am-type-alist' or type class symbol.
@ -300,7 +297,7 @@ buffer being in order to provide a smart default target type."
;; This should be handled at the EDE level, calling a method of the
;; top most project.
;;
(cl-defmethod project-compile-project ((obj project-am-target) &optional command)
(cl-defmethod project-compile-project ((_obj project-am-target) &optional command)
"Compile the entire current project.
Argument COMMAND is the command to use when compiling."
(require 'compile)
@ -324,7 +321,7 @@ Argument COMMAND is the command to use when compiling."
(let* ((default-directory (project-am-find-topmost-level default-directory)))
(compile command)))
(cl-defmethod project-compile-project ((obj project-am-makefile)
(cl-defmethod project-compile-project ((_obj project-am-makefile)
&optional command)
"Compile the entire current project.
Argument COMMAND is the command to use when compiling."
@ -349,7 +346,7 @@ Argument COMMAND is the command to use when compiling."
(let* ((default-directory (project-am-find-topmost-level default-directory)))
(compile command)))
(cl-defmethod project-compile-target ((obj project-am-target) &optional command)
(cl-defmethod project-compile-target ((_obj project-am-target) &optional command)
"Compile the current target.
Argument COMMAND is the command to use for compiling the target."
(require 'compile)
@ -423,7 +420,7 @@ Argument COMMAND is the command to use for compiling the target."
;;; Project loading and saving
;;
(defun project-am-load (directory &optional rootproj)
(defun project-am-load (directory &optional _rootproj)
"Read an automakefile DIRECTORY into our data structure.
If a given set of projects has already been loaded, then do nothing
but return the project for the directory given.
@ -442,34 +439,28 @@ Optional ROOTPROJ is the root EDE project."
(file-name-directory (directory-file-name newdir))))
(expand-file-name dir)))
(defvar recentf-exclude)
(defmacro project-am-with-makefile-current (dir &rest forms)
"Set the Makefile.am in DIR to be the current buffer.
Run FORMS while the makefile is current.
Kill the makefile if it was not loaded before the load."
`(let* ((fn (expand-file-name "Makefile.am" ,dir))
(fb nil)
(kb (get-file-buffer fn)))
(if (not (file-exists-p fn))
nil
(save-excursion
(if kb (setq fb kb)
;; We need to find-file this thing, but don't use
;; any semantic features.
(let ((semantic-init-hook nil)
(recentf-exclude '( (lambda (f) t) ))
)
(setq fb (find-file-noselect fn)))
)
(set-buffer fb)
(prog1 ,@forms
(if (not kb) (kill-buffer (current-buffer))))))))
(put 'project-am-with-makefile-current 'lisp-indent-function 1)
(add-hook 'edebug-setup-hook
(lambda ()
(def-edebug-spec project-am-with-makefile-current
(form def-body))))
Run FORMS while the makefile is current."
(declare (indent 1) (debug (form def-body)))
`(project-am--with-makefile-current ,dir (lambda () ,@forms)))
(defun project-am--with-makefile-current (dir fun)
(let* ((fn (expand-file-name "Makefile.am" dir))
(kb (get-file-buffer fn)))
(if (not (file-exists-p fn))
nil
(with-current-buffer
(or kb
;; We need to find-file this thing, but don't use
;; any semantic features.
(let ((semantic-init-hook nil)
(recentf-exclude `(,(lambda (_f) t))))
(find-file-noselect fn)))
(unwind-protect (funcall fun)
(if (not kb) (kill-buffer (current-buffer))))))))
(defun project-am-load-makefile (path &optional suggestedname)
"Convert PATH into a project Makefile, and return its project object.
@ -480,6 +471,7 @@ This is used when subprojects are made in named subdirectories."
(if (and ede-object (project-am-makefile-p ede-object))
ede-object
(let* ((pi (project-am-package-info path))
(fn buffer-file-name)
(sfn (when suggestedname
(project-am-last-dir suggestedname)))
(pn (or sfn (nth 0 pi) (project-am-last-dir fn)))
@ -734,19 +726,19 @@ Strip out duplicates, and recurse on variables."
"Return the default macro to `edit' for this object type."
(concat (subst-char-in-string ?- ?_ (oref this name)) "_SOURCES"))
(cl-defmethod project-am-macro ((this project-am-header-noinst))
(cl-defmethod project-am-macro ((_this project-am-header-noinst))
"Return the default macro to `edit' for this object."
"noinst_HEADERS")
(cl-defmethod project-am-macro ((this project-am-header-inst))
(cl-defmethod project-am-macro ((_this project-am-header-inst))
"Return the default macro to `edit' for this object."
"include_HEADERS")
(cl-defmethod project-am-macro ((this project-am-header-pkg))
(cl-defmethod project-am-macro ((_this project-am-header-pkg))
"Return the default macro to `edit' for this object."
"pkginclude_HEADERS")
(cl-defmethod project-am-macro ((this project-am-header-chk))
(cl-defmethod project-am-macro ((_this project-am-header-chk))
"Return the default macro to `edit' for this object."
"check_HEADERS")
@ -758,7 +750,7 @@ Strip out duplicates, and recurse on variables."
"Return the default macro to `edit' for this object type."
(oref this name))
(cl-defmethod project-am-macro ((this project-am-lisp))
(cl-defmethod project-am-macro ((_this project-am-lisp))
"Return the default macro to `edit' for this object."
"lisp_LISP")
@ -785,13 +777,11 @@ nil means that this buffer belongs to no-one."
"Return t if object THIS lays claim to the file in BUFFER."
(let ((efn (expand-file-name (buffer-file-name buffer))))
(or (string= (oref this file) efn)
(string-match "/configure\\.ac$" efn)
(string-match "/configure\\.in$" efn)
(string-match "/configure$" efn)
(string-match "/configure\\(?:\\.ac\\|\\.in\\)?\\'" efn)
;; Search output files.
(let ((ans nil))
(dolist (f (oref this configureoutputfiles))
(when (string-match (concat (regexp-quote f) "$") efn)
(when (string-match (concat (regexp-quote f) "\\'") efn)
(setq ans t)))
ans)
)))
@ -822,7 +812,7 @@ nil means that this buffer belongs to no-one."
"Return the sub project in AMPF specified by SUBDIR."
(object-assoc (expand-file-name subdir) 'file (oref ampf subproj)))
(cl-defmethod project-compile-target-command ((this project-am-target))
(cl-defmethod project-compile-target-command ((_this project-am-target))
"Default target to use when compiling a given target."
;; This is a pretty good default for most.
"")
@ -861,7 +851,7 @@ Argument FILE is the file to extract the end directory name from."
(t
'project-am-program)))
(cl-defmethod ede-buffer-header-file((this project-am-objectcode) buffer)
(cl-defmethod ede-buffer-header-file((this project-am-objectcode) _buffer)
"There are no default header files."
(or (cl-call-next-method)
(let ((s (oref this source))
@ -910,22 +900,13 @@ files in the project."
"Set the Configure FILE in the top most directory above DIR as current.
Run FORMS in the configure file.
Kill the Configure buffer if it was not already in a buffer."
`(save-excursion
(let ((fb (generate-new-buffer ,file)))
(set-buffer fb)
(erase-buffer)
(insert-file-contents ,file)
(prog1 ,@forms
(kill-buffer fb)))))
(declare (indent 1) (debug t))
`(with-temp-buffer
(erase-buffer)
(insert-file-contents ,file)
,@forms))
(put 'project-am-with-config-current 'lisp-indent-function 1)
(add-hook 'edebug-setup-hook
(lambda ()
(def-edebug-spec project-am-with-config-current
(form def-body))))
(defmacro project-am-extract-shell-variable (var)
(defun project-am-extract-shell-variable (var)
"Extract the value of the shell variable VAR from a shell script."
(save-excursion
(goto-char (point-min))
@ -997,12 +978,12 @@ Calculates the info with `project-am-extract-package-info'."
(project-am-extract-package-info dir)))
;; for simple per project include path extension
(cl-defmethod ede-system-include-path ((this project-am-makefile))
(cl-defmethod ede-system-include-path ((_this project-am-makefile))
"Return `project-am-localvars-include-path', usually local variable
per file or in .dir-locals.el or similar."
(bound-and-true-p project-am-localvars-include-path))
(cl-defmethod ede-system-include-path ((this project-am-target))
(cl-defmethod ede-system-include-path ((_this project-am-target))
"Return `project-am-localvars-include-path', usually local variable
per file or in .dir-locals.el or similar."
(bound-and-true-p project-am-localvars-include-path))

View File

@ -170,11 +170,10 @@ definition."
;;; Core bindings API
;;
(defvar mode-local-symbol-table nil
(defvar-local mode-local-symbol-table nil
"Buffer local mode bindings.
These symbols provide a hook for a `major-mode' to specify specific
behaviors. Use the function `mode-local-bind' to define new bindings.")
(make-variable-buffer-local 'mode-local-symbol-table)
(defvar mode-local-active-mode nil
"Major mode in which bindings are active.")

View File

@ -1,6 +1,6 @@
;;; pulse.el --- Pulsing Overlays
;;; pulse.el --- Pulsing Overlays -*- lexical-binding: t; -*-
;;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
;; Version: 1.0

View File

@ -77,13 +77,12 @@ introduced."
;;; Variables and Configuration
;;
(defvar semantic--parse-table nil
(defvar-local semantic--parse-table nil
"Variable that defines how to parse top level items in a buffer.
This variable is for internal use only, and its content depends on the
external parser used.")
(make-variable-buffer-local 'semantic--parse-table)
(defvar semantic-symbol->name-assoc-list
(defvar-local semantic-symbol->name-assoc-list
'((type . "Types")
(variable . "Variables")
(function . "Functions")
@ -95,22 +94,19 @@ It is sometimes useful for a language to use a different string
in place of the default, even though that language will still
return a symbol. For example, Java return's includes, but the
string can be replaced with `Imports'.")
(make-variable-buffer-local 'semantic-symbol->name-assoc-list)
(defvar semantic-symbol->name-assoc-list-for-type-parts nil
(defvar-local semantic-symbol->name-assoc-list-for-type-parts nil
"Like `semantic-symbol->name-assoc-list' for type parts.
Some tags that have children (see `semantic-tag-children-compatibility')
will want to define the names of classes of tags differently than at
the top level. For example, in C++, a Function may be called a
Method. In addition, there may be new types of tags that exist only
in classes, such as protection labels.")
(make-variable-buffer-local 'semantic-symbol->name-assoc-list-for-type-parts)
(defvar semantic-case-fold nil
(defvar-local semantic-case-fold nil
"Value for `case-fold-search' when parsing.")
(make-variable-buffer-local 'semantic-case-fold)
(defvar semantic--buffer-cache nil
(defvar-local semantic--buffer-cache nil
"A cache of the fully parsed buffer.
If no significant changes have been made (based on the state) then
this is returned instead of re-parsing the buffer.
@ -120,16 +116,13 @@ this is returned instead of re-parsing the buffer.
If you need a tag list, use `semantic-fetch-tags'. If you need the
cached values for some reason, chances are you can add a hook to
`semantic-after-toplevel-cache-change-hook'.")
(make-variable-buffer-local 'semantic--buffer-cache)
(defvar semantic-unmatched-syntax-cache nil
(defvar-local semantic-unmatched-syntax-cache nil
"A cached copy of unmatched syntax tokens.")
(make-variable-buffer-local 'semantic-unmatched-syntax-cache)
(defvar semantic-unmatched-syntax-cache-check nil
(defvar-local semantic-unmatched-syntax-cache-check nil
"Non-nil if the unmatched syntax cache is out of date.
This is tracked with `semantic-change-function'.")
(make-variable-buffer-local 'semantic-unmatched-syntax-cache-check)
(defvar semantic-edits-are-safe nil
"When non-nil, modifications do not require a reparse.
@ -180,19 +173,16 @@ during a flush when the cache is given a new value of nil.")
:group 'semantic
:type 'boolean)
(defvar semantic-parser-name "LL"
(defvar-local semantic-parser-name "LL"
"Optional name of the parser used to parse input stream.")
(make-variable-buffer-local 'semantic-parser-name)
(defvar semantic--completion-cache nil
(defvar-local semantic--completion-cache nil
"Internal variable used by `semantic-complete-symbol'.")
(make-variable-buffer-local 'semantic--completion-cache)
;;; Parse tree state management API
;;
(defvar semantic-parse-tree-state 'needs-rebuild
(defvar-local semantic-parse-tree-state 'needs-rebuild
"State of the current parse tree.")
(make-variable-buffer-local 'semantic-parse-tree-state)
(defmacro semantic-parse-tree-unparseable ()
"Indicate that the current buffer is unparseable.
@ -268,9 +258,8 @@ These functions are called by `semantic-new-buffer-fcn', before
(defvar semantic-init-hook nil
"Hook run when a buffer is initialized with a parsing table.")
(defvar semantic-init-mode-hook nil
(defvar-local semantic-init-mode-hook nil
"Hook run when a buffer of a particular mode is initialized.")
(make-variable-buffer-local 'semantic-init-mode-hook)
(defvar semantic-init-db-hook nil
"Hook run when a buffer is initialized with a parsing table for DBs.
@ -729,9 +718,8 @@ This function returns semantic tags without overlays."
;;
;; Any parser can use this API to provide a list of warnings during a
;; parse which a user may want to investigate.
(defvar semantic-parser-warnings nil
(defvar-local semantic-parser-warnings nil
"A list of parser warnings since the last full reparse.")
(make-variable-buffer-local 'semantic-parser-warnings)
(defun semantic-clear-parser-warnings ()
"Clear the current list of parser warnings for this buffer."

View File

@ -41,10 +41,9 @@
;;; Variables
;;
(defvar semantic-bovinate-nonterminal-check-obarray nil
(defvar-local semantic-bovinate-nonterminal-check-obarray nil
"Obarray of streams already parsed for nonterminal symbols.
Use this to detect infinite recursion during a parse.")
(make-variable-buffer-local 'semantic-bovinate-nonterminal-check-obarray)

View File

@ -1,4 +1,4 @@
;;; semantic/bovine/gcc.el --- gcc querying special code for the C parser
;;; semantic/bovine/gcc.el --- gcc querying special code for the C parser -*- lexical-binding: t -*-
;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
@ -25,6 +25,7 @@
;; GCC, and set up the preprocessor and include paths.
(require 'semantic/dep)
(require 'cl-lib)
(defvar semantic-lex-c-preprocessor-symbol-file)
(defvar semantic-lex-c-preprocessor-symbol-map)
@ -88,9 +89,7 @@ to give to the program."
(let ((path (substring line 1)))
(when (and (file-accessible-directory-p path)
(file-name-absolute-p path))
(add-to-list 'inc-path
(expand-file-name path)
t))))))))
(cl-pushnew (expand-file-name path) inc-path))))))))
inc-path))
@ -101,7 +100,7 @@ to give to the program."
(dolist (L lines)
(let ((dat (split-string L)))
(when (= (length dat) 3)
(add-to-list 'lst (cons (nth 1 dat) (nth 2 dat))))))
(push (cons (nth 1 dat) (nth 2 dat)) lst))))
lst))
(defun semantic-gcc-fields (str)
@ -142,6 +141,8 @@ This is an alist, and should include keys of:
`--prefix' - where GCC was installed.
It should also include other symbols GCC was compiled with.")
(defvar c++-include-path)
;;;###autoload
(defun semantic-gcc-setup ()
"Setup Semantic C/C++ parsing based on GCC output."

View File

@ -867,9 +867,8 @@ Expected return values are:
;; * semantic-collector-try-completion
;; * semantic-collector-all-completions
(defvar semantic-collector-per-buffer-list nil
(defvar-local semantic-collector-per-buffer-list nil
"List of collectors active in this buffer.")
(make-variable-buffer-local 'semantic-collector-per-buffer-list)
(defvar semantic-collector-list nil
"List of global collectors active this session.")

View File

@ -32,17 +32,15 @@
(require 'semantic)
;;; Code:
(defvar semantic-command-separation-character
(defvar-local semantic-command-separation-character
";"
"String which indicates the end of a command.
Used for identifying the end of a single command.")
(make-variable-buffer-local 'semantic-command-separation-character)
(defvar semantic-function-argument-separation-character
(defvar-local semantic-function-argument-separation-character
","
"String which indicates the end of an argument.
Used for identifying arguments to functions.")
(make-variable-buffer-local 'semantic-function-argument-separation-character)
;;; Local Contexts
;;

View File

@ -426,17 +426,15 @@ Default action as described in `semanticdb-find-translate-path'."
;; searchable item, then instead do the regular thing without caching.
(semanticdb-find-translate-path-includes--internal path))))
(defvar semanticdb-find-lost-includes nil
(defvar-local semanticdb-find-lost-includes nil
"Include files that we cannot find associated with this buffer.")
(make-variable-buffer-local 'semanticdb-find-lost-includes)
(defvar semanticdb-find-scanned-include-tags nil
(defvar-local semanticdb-find-scanned-include-tags nil
"All include tags scanned, plus action taken on the tag.
Each entry is an alist:
(ACTION . TAG)
where ACTION is one of `scanned', `duplicate', `lost'
and TAG is a clone of the include tag that was found.")
(make-variable-buffer-local 'semanticdb-find-scanned-include-tags)
(defvar semanticdb-implied-include-tags nil
"Include tags implied for all files of a given mode.

View File

@ -50,27 +50,23 @@
(defvar semanticdb-database-list nil
"List of all active databases.")
(defvar semanticdb-new-database-class 'semanticdb-project-database-file
(defvar-local semanticdb-new-database-class 'semanticdb-project-database-file
"The default type of database created for new files.
This can be changed on a per file basis, so that some directories
are saved using one mechanism, and some directories via a different
mechanism.")
(make-variable-buffer-local 'semanticdb-new-database-class)
(defvar semanticdb-default-find-index-class 'semanticdb-find-search-index
(defvar-local semanticdb-default-find-index-class 'semanticdb-find-search-index
"The default type of search index to use for a `semanticdb-table's.
This can be changed to try out new types of search indices.")
(make-variable-buffer-local 'semanticdb-default-find=index-class)
;;;###autoload
(defvar semanticdb-current-database nil
(defvar-local semanticdb-current-database nil
"For a given buffer, this is the currently active database.")
(make-variable-buffer-local 'semanticdb-current-database)
;;;###autoload
(defvar semanticdb-current-table nil
(defvar-local semanticdb-current-table nil
"For a given buffer, this is the currently active database table.")
(make-variable-buffer-local 'semanticdb-current-table)
;;; ABSTRACT CLASSES
;;
@ -825,13 +821,12 @@ must return a string, (the root directory) or a list of strings (multiple
root directories in a more complex system). This variable should be used
by project management programs like EDE or JDE.")
(defvar semanticdb-project-system-databases nil
(defvar-local semanticdb-project-system-databases nil
"List of databases containing system library information.
Mode authors can create their own system databases which know
detailed information about the system libraries for querying purposes.
Put those into this variable as a buffer-local, or mode-local
value.")
(make-variable-buffer-local 'semanticdb-project-system-databases)
(defvar semanticdb-search-system-databases t
"Non-nil if search routines are to include a system database.")
@ -1016,10 +1011,9 @@ DONTLOAD does not affect the creation of new database objects."
)
)))
(defvar semanticdb-out-of-buffer-create-table-fcn nil
(defvar-local semanticdb-out-of-buffer-create-table-fcn nil
"When non-nil, a function for creating a semanticdb table.
This should take a filename to be parsed.")
(make-variable-buffer-local 'semanticdb-out-of-buffer-create-table-fcn)
(defun semanticdb-create-table-for-file-not-in-buffer (filename)
"Create a table for the file FILENAME.

View File

@ -44,24 +44,18 @@
;;; Code:
;;;###autoload
(defvar semantic-debug-parser-source nil
(defvar-local semantic-debug-parser-source nil
"For any buffer, the file name (no path) of the parser.
This would be a parser for a specific language, not the source
to one of the parser generators.")
;;;###autoload
(make-variable-buffer-local 'semantic-debug-parser-source)
;;;###autoload
(defvar semantic-debug-parser-class nil
(defvar-local semantic-debug-parser-class nil
"Class to create when building a debug parser object.")
;;;###autoload
(make-variable-buffer-local 'semantic-debug-parser-class)
;;;###autoload
(defvar semantic-debug-parser-debugger-source nil
(defvar-local semantic-debug-parser-debugger-source nil
"Location of the debug parser class.")
;;;###autoload
(make-variable-buffer-local 'semantic-debug-parser-source)
(defvar semantic-debug-enabled nil
"Non-nil when debugging a parser.")

View File

@ -39,7 +39,7 @@
;;; Code:
(defvar semantic-dependency-include-path nil
(defvar-local semantic-dependency-include-path nil
"Defines the include path used when searching for files.
This should be a list of directories to search which is specific
to the file being included.
@ -56,9 +56,8 @@ reparsed, the cache will be reset.
TODO: use ffap.el to locate such items?
NOTE: Obsolete this, or use as special user")
(make-variable-buffer-local 'semantic-dependency-include-path)
(defvar semantic-dependency-system-include-path nil
(defvar-local semantic-dependency-system-include-path nil
"Defines the system include path.
This should be set with either `defvar-mode-local', or with
`semantic-add-system-include'.
@ -71,7 +70,6 @@ When searching for a file associated with a name found in a tag of
class include, this path will be inspected for includes of type
`system'. Some include tags are agnostic to this setting and will
check both the project and system directories.")
(make-variable-buffer-local 'semantic-dependency-system-include-path)
(defmacro defcustom-mode-local-semantic-dependency-system-include-path
(mode name value &optional docstring)

View File

@ -78,13 +78,11 @@ Images can be used as icons instead of some types of text strings."
:group 'semantic
:type 'boolean)
(defvar semantic-function-argument-separator ","
(defvar-local semantic-function-argument-separator ","
"Text used to separate arguments when creating text from tags.")
(make-variable-buffer-local 'semantic-function-argument-separator)
(defvar semantic-format-parent-separator "::"
(defvar-local semantic-format-parent-separator "::"
"Text used to separate names when between namespaces/classes and functions.")
(make-variable-buffer-local 'semantic-format-parent-separator)
(defvar semantic-format-face-alist
`( (function . font-lock-function-name-face)

View File

@ -243,9 +243,8 @@ Avoid using a large BODY since it is duplicated."
;;; Misc utilities
;;
(defvar semantic-new-buffer-fcn-was-run nil
(defvar-local semantic-new-buffer-fcn-was-run nil
"Non-nil after `semantic-new-buffer-fcn' has been executed.")
(make-variable-buffer-local 'semantic-new-buffer-fcn-was-run)
(defsubst semantic-active-p ()
"Return non-nil if the current buffer was set up for parsing."

View File

@ -432,9 +432,8 @@ Also load the specified macro libraries."
defs)))
(nreverse defs)))
(defvar semantic-grammar-macros nil
(defvar-local semantic-grammar-macros nil
"List of associations (MACRO-NAME . EXPANDER).")
(make-variable-buffer-local 'semantic-grammar-macros)
(defun semantic-grammar-macros ()
"Build and return the alist of defined macros."
@ -1054,8 +1053,7 @@ See also the variable `semantic-grammar-file-regexp'."
;;;; Macros highlighting
;;;;
(defvar semantic--grammar-macros-regexp-1 nil)
(make-variable-buffer-local 'semantic--grammar-macros-regexp-1)
(defvar-local semantic--grammar-macros-regexp-1 nil)
(defun semantic--grammar-macros-regexp-1 ()
"Return font-lock keyword regexp for pre-installed macro names."
@ -1076,8 +1074,7 @@ See also the variable `semantic-grammar-file-regexp'."
"\\<%use-macros\\>[ \t\r\n]+\\(\\sw\\|\\s_\\)+[ \t\r\n]+{"
"Regexp that matches a macro declaration statement.")
(defvar semantic--grammar-macros-regexp-2 nil)
(make-variable-buffer-local 'semantic--grammar-macros-regexp-2)
(defvar-local semantic--grammar-macros-regexp-2 nil)
(defun semantic--grammar-clear-macros-regexp-2 (&rest _)
"Clear the cached regexp that match macros local in this grammar.

View File

@ -1,4 +1,4 @@
;;; idle.el --- Schedule parsing tasks in idle time
;;; idle.el --- Schedule parsing tasks in idle time -*- lexical-binding: t; -*-
;; Copyright (C) 2003-2006, 2008-2021 Free Software Foundation, Inc.
@ -135,10 +135,9 @@ it is unlikely the user would be ready to type again right away."
:group 'semantic
:type 'hook)
(defvar semantic-idle-scheduler-mode nil
(defvar-local semantic-idle-scheduler-mode nil
"Non-nil if idle-scheduler minor mode is enabled.
Use the command `semantic-idle-scheduler-mode' to change this variable.")
(make-variable-buffer-local 'semantic-idle-scheduler-mode)
(defcustom semantic-idle-scheduler-max-buffer-size 0
"Maximum size in bytes of buffers where idle-scheduler is enabled.
@ -223,18 +222,18 @@ And also manages services that depend on tag values."
(and (buffer-file-name b)
b))
(buffer-list)))))
safe ;; This safe is not used, but could be.
;; safe ;; This safe is not used, but could be.
others
mode)
(when (semantic-idle-scheduler-enabled-p)
(save-excursion
;; First, reparse the current buffer.
(setq mode major-mode
safe (semantic-safe "Idle Parse Error: %S"
;(error "Goofy error 1")
(semantic-idle-scheduler-refresh-tags)
)
)
(setq mode major-mode)
;; (setq safe
(semantic-safe "Idle Parse Error: %S"
;(error "Goofy error 1")
(semantic-idle-scheduler-refresh-tags))
;; Now loop over other buffers with same major mode, trying to
;; update them as well. Stop on keypress.
(dolist (b buffers)
@ -431,6 +430,8 @@ datasets."
(message "Long Work Idle Timer...%s" exit-type)))
)
(defvar ede-auto-add-method)
(defun semantic-idle-scheduler-work-parse-neighboring-files ()
"Parse all the files in similar directories to buffers being edited."
;; Let's tell EDE to ignore all the files we're about to load
@ -565,11 +566,12 @@ DOC will be a documentation string describing FORMS.
FORMS will be called during idle time after the current buffer's
semantic tag information has been updated.
This routine creates the following functions and variables:"
(declare (indent 1) (debug (&define name stringp def-body)))
(let ((global (intern (concat "global-" (symbol-name name) "-mode")))
(mode (intern (concat (symbol-name name) "-mode")))
(hook (intern (concat (symbol-name name) "-mode-hook")))
(map (intern (concat (symbol-name name) "-mode-map")))
(setup (intern (concat (symbol-name name) "-mode-setup")))
;; (setup (intern (concat (symbol-name name) "-mode-setup")))
(func (intern (concat (symbol-name name) "-idle-function"))))
`(progn
@ -619,11 +621,6 @@ turned on in every Semantic-supported buffer.")
,(concat "Perform idle activity for the minor mode `"
(symbol-name mode) "'.")
,@forms))))
(put 'define-semantic-idle-service 'lisp-indent-function 1)
(add-hook 'edebug-setup-hook
(lambda ()
(def-edebug-spec define-semantic-idle-service
(&define name stringp def-body))))
;;; SUMMARY MODE
;;
@ -717,8 +714,7 @@ specific to a major mode. For example, in jde mode:
(defun semantic-idle-summary-useful-context-p ()
"Non-nil if we should show a summary based on context."
(if (and (boundp 'font-lock-mode)
font-lock-mode
(if (and font-lock-mode
(memq (get-text-property (point) 'face)
semantic-idle-summary-out-of-context-faces))
;; The best I can think of at the moment is to disable
@ -823,6 +819,8 @@ turned on in every Semantic-supported buffer."
(make-obsolete-variable 'semantic-idle-symbol-highlight-face
"customize the face `semantic-idle-symbol-highlight' instead" "24.4" 'set)
(defvar pulse-flag)
(defun semantic-idle-symbol-maybe-highlight (tag)
"Perhaps add highlighting to the symbol represented by TAG.
TAG was found as the symbol under point. If it happens to be
@ -900,7 +898,7 @@ Call `semantic-symref-hits-in-region' to identify local references."
(when (semantic-tag-p target)
(require 'semantic/symref/filter)
(semantic-symref-hits-in-region
target (lambda (start end prefix)
target (lambda (start end _prefix)
(when (/= start (car Hbounds))
(pulse-momentary-highlight-region
start end semantic-idle-symbol-highlight-face))
@ -1233,7 +1231,7 @@ shortened at the beginning."
)
(defun semantic-idle-breadcrumbs--format-linear
(tag-list &optional max-length)
(tag-list &optional _max-length)
"Format TAG-LIST as a linear list, starting with the outermost tag.
MAX-LENGTH is not used."
(require 'semantic/analyze/fcn)

View File

@ -136,12 +136,11 @@ other buffer local ones based on the same semanticdb."
"Non-nil if `semantic-imenu-rebuild-directory-indexes' is running.")
;;;###autoload
(defvar semantic-imenu-expandable-tag-classes '(type)
(defvar-local semantic-imenu-expandable-tag-classes '(type)
"List of expandable tag classes.
Tags of those classes will be given submenu with children.
By default, a `type' has interesting children. In Texinfo, however, a
`section' has interesting children.")
(make-variable-buffer-local 'semantic-imenu-expandable-tag-classes)
;;; Code:
(defun semantic-imenu-tag-overlay (tag)

View File

@ -73,28 +73,24 @@
(declare-function c-end-of-macro "cc-engine")
;;; Code:
(defvar semantic-lex-spp-macro-symbol-obarray nil
(defvar-local semantic-lex-spp-macro-symbol-obarray nil
"Table of macro keywords used by the Semantic Preprocessor.
These symbols will be used in addition to those in
`semantic-lex-spp-dynamic-macro-symbol-obarray'.")
(make-variable-buffer-local 'semantic-lex-spp-macro-symbol-obarray)
(defvar semantic-lex-spp-project-macro-symbol-obarray nil
(defvar-local semantic-lex-spp-project-macro-symbol-obarray nil
"Table of macro keywords for this project.
These symbols will be used in addition to those in
`semantic-lex-spp-dynamic-macro-symbol-obarray'.")
(make-variable-buffer-local 'semantic-lex-spp-project-macro-symbol-obarray)
(defvar semantic-lex-spp-dynamic-macro-symbol-obarray nil
(defvar-local semantic-lex-spp-dynamic-macro-symbol-obarray nil
"Table of macro keywords used during lexical analysis.
Macros are lexical symbols which are replaced by other lexical
tokens during lexical analysis. During analysis symbols can be
added and removed from this symbol table.")
(make-variable-buffer-local 'semantic-lex-spp-dynamic-macro-symbol-obarray)
(defvar semantic-lex-spp-dynamic-macro-symbol-obarray-stack nil
(defvar-local semantic-lex-spp-dynamic-macro-symbol-obarray-stack nil
"A stack of obarrays for temporarily scoped macro values.")
(make-variable-buffer-local 'semantic-lex-spp-dynamic-macro-symbol-obarray-stack)
(defvar semantic-lex-spp-expanded-macro-stack nil
"The stack of lexical SPP macros we have expanded.")

View File

@ -202,10 +202,9 @@ as a PROPERTY value. FUN receives a symbol as argument."
;; These keywords are keywords defined for using in a grammar with the
;; %keyword declaration, and are not keywords used in Emacs Lisp.
(defvar semantic-flex-keywords-obarray nil
(defvar-local semantic-flex-keywords-obarray nil
"Buffer local keyword obarray for the lexical analyzer.
These keywords are matched explicitly, and converted into special symbols.")
(make-variable-buffer-local 'semantic-flex-keywords-obarray)
(defmacro semantic-lex-keyword-invalid (name)
"Signal that NAME is an invalid keyword name."
@ -333,9 +332,8 @@ so that analysis can continue, if possible."
;; with the %type declaration. Types represent different syntaxes.
;; See code for `semantic-lex-preset-default-types' for the classic
;; types of syntax.
(defvar semantic-lex-types-obarray nil
(defvar-local semantic-lex-types-obarray nil
"Buffer local types obarray for the lexical analyzer.")
(make-variable-buffer-local 'semantic-lex-types-obarray)
(defun semantic-lex-type-invalid (type)
"Signal that TYPE is an invalid lexical type name."
@ -471,12 +469,9 @@ PROPERTY set."
;;; Lexical Analyzer framework settings
;;
;; FIXME change to non-obsolete default.
(defvar semantic-lex-analyzer 'semantic-flex
(defvar-local semantic-lex-analyzer 'semantic-lex
"The lexical analyzer used for a given buffer.
See `semantic-lex' for documentation.
For compatibility with Semantic 1.x it defaults to `semantic-flex'.")
(make-variable-buffer-local 'semantic-lex-analyzer)
See `semantic-lex' for documentation.")
(defvar semantic-lex-tokens
'(
@ -558,7 +553,7 @@ The key to this alist is the symbol representing token type that
- whitespace: Characters that match `\\s-+' regexp.
This token is produced with `semantic-lex-whitespace'.")
(defvar semantic-lex-syntax-modifications nil
(defvar-local semantic-lex-syntax-modifications nil
"Changes to the syntax table for this buffer.
These changes are active only while the buffer is being flexed.
This is a list where each element has the form:
@ -566,20 +561,17 @@ This is a list where each element has the form:
CHAR is the char passed to `modify-syntax-entry',
and CLASS is the string also passed to `modify-syntax-entry' to define
what syntax class CHAR has.")
(make-variable-buffer-local 'semantic-lex-syntax-modifications)
(defvar semantic-lex-syntax-table nil
(defvar-local semantic-lex-syntax-table nil
"Syntax table used by lexical analysis.
See also `semantic-lex-syntax-modifications'.")
(make-variable-buffer-local 'semantic-lex-syntax-table)
(defvar semantic-lex-comment-regex nil
(defvar-local semantic-lex-comment-regex nil
"Regular expression for identifying comment start during lexical analysis.
This may be automatically set when semantic initializes in a mode, but
may need to be overridden for some special languages.")
(make-variable-buffer-local 'semantic-lex-comment-regex)
(defvar semantic-lex-number-expression
(defvar-local semantic-lex-number-expression
;; This expression was written by David Ponce for Java, and copied
;; here for C and any other similar language.
(eval-when-compile
@ -628,12 +620,10 @@ FLOATING_POINT_LITERAL:
| [0-9]+<EXPONENT>[fFdD]?
| [0-9]+<EXPONENT>?[fFdD]
;")
(make-variable-buffer-local 'semantic-lex-number-expression)
(defvar semantic-lex-depth 0
(defvar-local semantic-lex-depth 0
"Default lexing depth.
This specifies how many lists to create tokens in.")
(make-variable-buffer-local 'semantic-lex-depth)
(defvar semantic-lex-unterminated-syntax-end-function
(lambda (_syntax _syntax-start lex-end) lex-end)
@ -1768,7 +1758,7 @@ when finding unterminated syntax.")
(make-obsolete-variable 'semantic-flex-unterminated-syntax-end-function
nil "28.1")
(defvar semantic-flex-extensions nil
(defvar-local semantic-flex-extensions nil
"Buffer local extensions to the lexical analyzer.
This should contain an alist with a key of a regex and a data element of
a function. The function should both move point, and return a lexical
@ -1777,10 +1767,9 @@ token of the form:
nil is also a valid return value.
TYPE can be any type of symbol, as long as it doesn't occur as a
nonterminal in the language definition.")
(make-variable-buffer-local 'semantic-flex-extensions)
(make-obsolete-variable 'semantic-flex-extensions nil "28.1")
(defvar semantic-flex-syntax-modifications nil
(defvar-local semantic-flex-syntax-modifications nil
"Changes to the syntax table for this buffer.
These changes are active only while the buffer is being flexed.
This is a list where each element has the form:
@ -1788,47 +1777,40 @@ This is a list where each element has the form:
CHAR is the char passed to `modify-syntax-entry',
and CLASS is the string also passed to `modify-syntax-entry' to define
what syntax class CHAR has.")
(make-variable-buffer-local 'semantic-flex-syntax-modifications)
(make-obsolete-variable 'semantic-flex-syntax-modifications nil "28.1")
(defvar semantic-ignore-comments t
(defvar-local semantic-ignore-comments t
"Default comment handling.
The value t means to strip comments when flexing; nil means
to keep comments as part of the token stream.")
(make-variable-buffer-local 'semantic-ignore-comments)
(make-obsolete-variable 'semantic-ignore-comments nil "28.1")
(defvar semantic-flex-enable-newlines nil
(defvar-local semantic-flex-enable-newlines nil
"When flexing, report newlines as syntactic elements.
Useful for languages where the newline is a special case terminator.
Only set this on a per mode basis, not globally.")
(make-variable-buffer-local 'semantic-flex-enable-newlines)
(make-obsolete-variable 'semantic-flex-enable-newlines nil "28.1")
(defvar semantic-flex-enable-whitespace nil
(defvar-local semantic-flex-enable-whitespace nil
"When flexing, report whitespace as syntactic elements.
Useful for languages where the syntax is whitespace dependent.
Only set this on a per mode basis, not globally.")
(make-variable-buffer-local 'semantic-flex-enable-whitespace)
(make-obsolete-variable 'semantic-flex-enable-whitespace nil "28.1")
(defvar semantic-flex-enable-bol nil
(defvar-local semantic-flex-enable-bol nil
"When flexing, report beginning of lines as syntactic elements.
Useful for languages like python which are indentation sensitive.
Only set this on a per mode basis, not globally.")
(make-variable-buffer-local 'semantic-flex-enable-bol)
(make-obsolete-variable 'semantic-flex-enable-bol nil "28.1")
(defvar semantic-number-expression semantic-lex-number-expression
(defvar-local semantic-number-expression semantic-lex-number-expression
"See variable `semantic-lex-number-expression'.")
(make-variable-buffer-local 'semantic-number-expression)
(make-obsolete-variable 'semantic-number-expression
'semantic-lex-number-expression "28.1")
(defvar semantic-flex-depth 0
(defvar-local semantic-flex-depth 0
"Default flexing depth.
This specifies how many lists to create tokens in.")
(make-variable-buffer-local 'semantic-flex-depth)
(make-obsolete-variable 'semantic-flex-depth nil "28.1")
(provide 'semantic/lex)

View File

@ -1,4 +1,4 @@
;;; semantic/scope.el --- Analyzer Scope Calculations
;;; semantic/scope.el --- Analyzer Scope Calculations -*- lexical-binding: t; -*-
;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
@ -115,7 +115,7 @@ Saves scoping information between runs of the analyzer.")
)
(cl-defmethod semanticdb-synchronize ((cache semantic-scope-cache)
new-tags)
_new-tags)
"Synchronize a CACHE with some NEW-TAGS."
(semantic-reset cache))
@ -262,7 +262,7 @@ are from nesting data types."
(semantic-go-to-tag pparent)
(setq stack (semantic-find-tag-by-overlay (point)))
;; Step one, find the merged version of stack in the typecache.
(let* ((stacknames (reverse (mapcar 'semantic-tag-name stack)))
(let* ((stacknames (reverse (mapcar #'semantic-tag-name stack)))
(tc nil)
)
;; @todo - can we use the typecache ability to
@ -317,7 +317,7 @@ are from nesting data types."
;; returnlist is empty.
(while snlist
(setq fullsearchname
(append (mapcar 'semantic-tag-name returnlist)
(append (mapcar #'semantic-tag-name returnlist)
(list (car snlist)))) ;; Next one
(setq ptag
(semanticdb-typecache-find fullsearchname))
@ -325,8 +325,8 @@ are from nesting data types."
(when (or (not ptag)
(not (semantic-tag-of-class-p ptag 'type)))
(let ((rawscope
(apply 'append
(mapcar 'semantic-tag-type-members
(apply #'append
(mapcar #'semantic-tag-type-members
(cons (car returnlist) scopetypes)
)))
)
@ -541,7 +541,7 @@ tag is not something you can complete from within TYPE."
(setq leftover (cons S leftover)))))
(nreverse leftover)))
(defun semantic-analyze-scoped-type-parts (type &optional scope noinherit protection)
(defun semantic-analyze-scoped-type-parts (type &optional scope noinherit _protection)
"Return all parts of TYPE, a tag representing a TYPE declaration.
SCOPE is the scope object.
NOINHERIT turns off searching of inherited tags.

View File

@ -601,10 +601,9 @@ Makes C/C++ language like assumptions."
)
(t nil)))
(defvar senator-isearch-semantic-mode nil
(defvar-local senator-isearch-semantic-mode nil
"Non-nil if isearch does semantic search.
This is a buffer local variable.")
(make-variable-buffer-local 'senator-isearch-semantic-mode)
(defun senator-beginning-of-defun (&optional arg)
"Move backward to the beginning of a defun.

View File

@ -310,11 +310,10 @@ may re-organize the list with side-effects."
;; external members, and bring them together in a cloned copy of the
;; class tag.
;;
(defvar semantic-orphaned-member-metaparent-type "class"
(defvar-local semantic-orphaned-member-metaparent-type "class"
"In `semantic-adopt-external-members', the type of 'type for metaparents.
A metaparent is a made-up type semantic token used to hold the child list
of orphaned members of a named type.")
(make-variable-buffer-local 'semantic-orphaned-member-metaparent-type)
(defvar semantic-mark-external-member-function nil
"Function called when an externally defined orphan is found.

View File

@ -1194,7 +1194,7 @@ See also the function `semantic--expand-tag'."
(setq tag (cdr tag)))
(null tag)))
(defvar semantic-tag-expand-function nil
(defvar-local semantic-tag-expand-function nil
"Function used to expand a tag.
It is passed each tag production, and must return a list of tags
derived from it, or nil if it does not need to be expanded.
@ -1207,7 +1207,6 @@ following definition is easily parsed into one tag:
This function should take this compound tag and turn it into two tags,
one for A, and the other for B.")
(make-variable-buffer-local 'semantic-tag-expand-function)
(defun semantic--tag-expand (tag)
"Convert TAG from a raw state to a cooked state, and expand it.

View File

@ -498,10 +498,9 @@ non-nil if the minor mode is enabled."
(semantic-add-minor-mode 'semantic-show-parser-state-mode
"")
(defvar semantic-show-parser-state-string nil
(defvar-local semantic-show-parser-state-string nil
"String showing the parser state for this buffer.
See `semantic-show-parser-state-marker' for details.")
(make-variable-buffer-local 'semantic-show-parser-state-string)
(defun semantic-show-parser-state-marker (&rest ignore)
"Set `semantic-show-parser-state-string' to indicate parser state.
@ -692,10 +691,6 @@ non-nil if the minor mode is enabled."
;; Disable minor mode if semantic stuff not available
(setq semantic-stickyfunc-mode nil)
(error "Buffer %s was not set up for parsing" (buffer-name)))
(unless (boundp 'header-line-format)
;; Disable if there are no header lines to use.
(setq semantic-stickyfunc-mode nil)
(error "Sticky Function mode requires Emacs"))
;; Enable the mode
;; Save previous buffer local value of header line format.
(when (and (local-variable-p 'header-line-format (current-buffer))
@ -713,10 +708,9 @@ non-nil if the minor mode is enabled."
(setq header-line-format semantic-stickyfunc-old-hlf)
(kill-local-variable 'semantic-stickyfunc-old-hlf)))))
(defvar semantic-stickyfunc-sticky-classes
(defvar-local semantic-stickyfunc-sticky-classes
'(function type)
"List of tag classes which stickyfunc will display in the header line.")
(make-variable-buffer-local 'semantic-stickyfunc-sticky-classes)
(defcustom semantic-stickyfunc-show-only-functions-p nil
"Non-nil means don't show lines that aren't part of a tag.
@ -886,9 +880,8 @@ Argument EVENT describes the event that caused this function to be called."
)
(select-window startwin)))
(defvar semantic-highlight-func-ct-overlay nil
(defvar-local semantic-highlight-func-ct-overlay nil
"Overlay used to highlight the tag the cursor is in.")
(make-variable-buffer-local 'semantic-highlight-func-ct-overlay)
(defface semantic-highlight-func-current-tag-face
'((((class color) (background dark))

View File

@ -39,20 +39,18 @@
;;; Code:
(defvar semantic-type-relation-separator-character '(".")
(defvar-local semantic-type-relation-separator-character '(".")
"Character strings used to separate a parent/child relationship.
This list of strings are used for displaying or finding separators
in variable field dereferencing. The first character will be used for
display. In C, a type field is separated like this: \"type.field\"
thus, the character is a \".\". In C, and additional value of \"->\"
would be in the list, so that \"type->field\" could be found.")
(make-variable-buffer-local 'semantic-type-relation-separator-character)
(defvar semantic-equivalent-major-modes nil
(defvar-local semantic-equivalent-major-modes nil
"List of major modes which are considered equivalent.
Equivalent modes share a parser, and a set of override methods.
A value of nil means that the current major mode is the only one.")
(make-variable-buffer-local 'semantic-equivalent-major-modes)
(declare-function semanticdb-file-stream "semantic/db" (file))

View File

@ -93,15 +93,13 @@ it to a form suitable for the Wisent's parser."
;;; Syntax analysis
;;
(defvar wisent-error-function nil
(defvar-local wisent-error-function nil
"Function used to report parse error.
By default use the function `wisent-message'.")
(make-variable-buffer-local 'wisent-error-function)
(defvar wisent-lexer-function 'wisent-lex
(defvar-local wisent-lexer-function 'wisent-lex
"Function used to obtain the next lexical token in input.
Should be a lexical analyzer created with `define-wisent-lexer'.")
(make-variable-buffer-local 'wisent-lexer-function)
;; Tag production
;;

View File

@ -33,11 +33,6 @@
;;; Code:
;; Emacs < 23.3
(eval-and-compile
(unless (boundp 'float-pi)
(defconst float-pi (* 4 (atan 1)) "The value of Pi (3.1415926...).")))
;;;###autoload
(defun color-name-to-rgb (color &optional frame)
"Convert COLOR string to a list of normalized RGB components.

View File

@ -700,8 +700,7 @@ Entry to this mode runs the hooks on `comint-mode-hook'."
;; https://lists.gnu.org/r/emacs-devel/2007-08/msg00827.html
;;
;; This makes it really work to keep point at the bottom.
;; (make-local-variable 'scroll-conservatively)
;; (setq scroll-conservatively 10000)
;; (setq-local scroll-conservatively 10000)
(add-hook 'pre-command-hook 'comint-preinput-scroll-to-bottom t t)
(make-local-variable 'comint-ptyp)
(make-local-variable 'comint-process-echoes)
@ -2253,15 +2252,23 @@ This function could be on `comint-output-filter-functions' or bound to a key."
"Strip trailing `^M' characters from the current output group.
This function could be on `comint-output-filter-functions' or bound to a key."
(interactive)
(let ((pmark (process-mark (get-buffer-process (current-buffer)))))
(save-excursion
(condition-case nil
(goto-char
(if (called-interactively-p 'interactive)
comint-last-input-end comint-last-output-start))
(error nil))
(while (re-search-forward "\r+$" pmark t)
(replace-match "" t t)))))
(let ((process (get-buffer-process (current-buffer))))
(if (not process)
;; This function may be used in
;; `comint-output-filter-functions', and in that case, if
;; there's no process, then we should do nothing. If
;; interactive, report an error.
(when (called-interactively-p 'interactive)
(error "No process in the current buffer"))
(let ((pmark (process-mark process)))
(save-excursion
(condition-case nil
(goto-char
(if (called-interactively-p 'interactive)
comint-last-input-end comint-last-output-start))
(error nil))
(while (re-search-forward "\r+$" pmark t)
(replace-match "" t t)))))))
(define-obsolete-function-alias 'shell-strip-ctrl-m #'comint-strip-ctrl-m "27.1")
(defun comint-show-maximum-output ()
@ -2375,12 +2382,11 @@ a buffer local variable."
;; saved -- typically passwords to ftp, telnet, or somesuch.
;; Just enter m-x comint-send-invisible and type in your line.
(defvar comint-password-function nil
(defvar-local comint-password-function nil
"Abnormal hook run when prompted for a password.
This function gets one argument, a string containing the prompt.
It may return a string containing the password, or nil if normal
password prompting should occur.")
(make-variable-buffer-local 'comint-password-function)
(defun comint-send-invisible (&optional prompt)
"Read a string without echoing.

View File

@ -505,9 +505,8 @@ Used to decide whether to save completions.")
;; Old name, non-namespace-clean.
(defvaralias 'cmpl-syntax-table 'completion-syntax-table)
(defvar completion-syntax-table completion-standard-syntax-table
(defvar-local completion-syntax-table completion-standard-syntax-table
"This variable holds the current completion syntax table.")
(make-variable-buffer-local 'completion-syntax-table)
;;-----------------------------------------------
;; Symbol functions

View File

@ -179,7 +179,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
(insert "\
;; The remainder of this file is for handling :version.
;; We provide a minimum of information so that `customize-changed-options'
;; We provide a minimum of information so that `customize-changed'
;; can do its job.
;; For groups we set `custom-version', `group-documentation' and
@ -240,7 +240,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
This is an alist whose members have as car a version string, and as
elements the files that have variables or faces that contain that
version. These files should be loaded before showing the customization
buffer that `customize-changed-options' generates.\")\n\n"))
buffer that `customize-changed' generates.\")\n\n"))
(save-buffer)
(byte-compile-info
(format "Generating %s...done" generated-custom-dependencies-file) t))

View File

@ -1206,7 +1206,7 @@ Show the buffer in another window, but don't select it."
(message "`%s' is an alias for `%s'" symbol basevar))))
(defvar customize-changed-options-previous-release "26.3"
"Version for `customize-changed-options' to refer back to by default.")
"Version for `customize-changed' to refer back to by default.")
;; Packages will update this variable, so make it available.
;;;###autoload
@ -1242,10 +1242,11 @@ the user might see the value in an error message, a good choice is
the official name of the package, such as MH-E or Gnus.")
;;;###autoload
(defalias 'customize-changed 'customize-changed-options)
(define-obsolete-function-alias 'customize-changed-options
#'customize-changed "28.1")
;;;###autoload
(defun customize-changed-options (&optional since-version)
(defun customize-changed (&optional since-version)
"Customize all settings whose meanings have changed in Emacs itself.
This includes new user options and faces, and new customization
groups, as well as older options and faces whose meanings or

View File

@ -343,7 +343,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
(const :tag "Never" nil)
(const :tag "Always" t)
(repeat (symbol :tag "Parameter")))
"25.1")
"27.1")
(iconify-child-frame frames
(choice
(const :tag "Do nothing" nil)

View File

@ -350,7 +350,7 @@ for more information."
;; if you need to recompile all the Lisp files using interpreted code.
`(custom-declare-variable
',symbol
,(if lexical-binding ;FIXME: This is not reliable, but is all we have.
,(if lexical-binding
;; The STANDARD arg should be an expression that evaluates to
;; the standard value. The use of `eval' for it is spread
;; over many different places and hence difficult to
@ -627,6 +627,10 @@ property, or (ii) an alias for another customizable variable."
(or (get variable 'standard-value)
(get variable 'custom-autoload))))
(defun custom--standard-value (variable)
"Return the standard value of VARIABLE."
(eval (car (get variable 'standard-value)) t))
(define-obsolete-function-alias 'user-variable-p 'custom-variable-p "24.3")
(defun custom-note-var-changed (variable)

View File

@ -5,10 +5,6 @@
;; Author: Eric M. Ludlam <zappo@gnu.org>
;; Keywords: file, tags, tools
(defvar dframe-version "1.3"
"The current version of the dedicated frame library.")
(make-obsolete-variable 'dframe-version nil "28.1")
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
@ -150,42 +146,35 @@ selected frame and the focus will change to that frame."
:group 'dframe
:type 'hook)
(defvar dframe-track-mouse-function nil
(defvar-local dframe-track-mouse-function nil
"A function to call when the mouse is moved in the given frame.
Typically used to display info about the line under the mouse.")
(make-variable-buffer-local 'dframe-track-mouse-function)
(defvar dframe-help-echo-function nil
(defvar-local dframe-help-echo-function nil
"A function to call when help-echo is used in newer versions of Emacs.
Typically used to display info about the line under the mouse.")
(make-variable-buffer-local 'dframe-help-echo-function)
(defvar dframe-mouse-click-function nil
(defvar-local dframe-mouse-click-function nil
"A function to call when the mouse is clicked.
Valid clicks are mouse 2, our double mouse 1.")
(make-variable-buffer-local 'dframe-mouse-click-function)
(defvar dframe-mouse-position-function nil
(defvar-local dframe-mouse-position-function nil
"A function to call to position the cursor for a mouse click.")
(make-variable-buffer-local 'dframe-mouse-position-function)
(defvar dframe-power-click nil
"Never set this by hand. Value is t when S-mouse activity occurs.")
(defvar dframe-timer nil
(defvar-local dframe-timer nil
"The dframe timer used for updating the buffer.")
(make-variable-buffer-local 'dframe-timer)
(defvar dframe-attached-frame nil
(defvar-local dframe-attached-frame nil
"The frame which started a frame mode.
This is the frame from which all interesting activities will go
for the mode using dframe.")
(make-variable-buffer-local 'dframe-attached-frame)
(defvar dframe-controlled nil
(defvar-local dframe-controlled nil
"Is this buffer controlled by a dedicated frame.
Local to those buffers, as a function called that created it.")
(make-variable-buffer-local 'dframe-controlled)
(defun dframe-update-keymap (map)
"Update the keymap MAP for dframe default bindings."
@ -686,28 +675,26 @@ Evaluates all cached timer functions in sequence."
(funcall (car l)))
(setq l (cdr l)))))
(defalias 'dframe-popup-kludge
(lambda (e)
"Pop up a menu related to the clicked on item.
(defun dframe-popup-kludge (e)
"Pop up a menu related to the clicked on item.
Must be bound to event E."
(interactive "e")
(save-excursion
(mouse-set-point e)
;; This gets the cursor where the user can see it.
(if (not (bolp)) (forward-char -1))
(sit-for 0)
(popup-menu (mouse-menu-major-mode-map) e))))
(interactive "e")
(save-excursion
(mouse-set-point e)
;; This gets the cursor where the user can see it.
(if (not (bolp)) (forward-char -1))
(sit-for 0)
(popup-menu (mouse-menu-major-mode-map) e)))
;;; Interactive user functions for the mouse
;;
(defalias 'dframe-mouse-event-p
(lambda (event)
"Return t if the event is a mouse related event."
(if (and (listp event)
(member (event-basic-type event)
'(mouse-1 mouse-2 mouse-3)))
t
nil)))
(defun dframe-mouse-event-p (event)
"Return t if the event is a mouse related event."
(if (and (listp event)
(member (event-basic-type event)
'(mouse-1 mouse-2 mouse-3)))
t
nil))
(defun dframe-track-mouse (event)
"For motion EVENT, display info about the current line."
@ -836,6 +823,13 @@ the mode-line."
(t (dframe-message
"Click on the edge of the mode line to scroll left/right")))))
;;; Obsolete
(defvar dframe-version "1.3"
"The current version of the dedicated frame library.")
(make-obsolete-variable 'dframe-version nil "28.1")
(provide 'dframe)
;;; dframe.el ends here

View File

@ -3148,7 +3148,7 @@ REGEXP should use constructs supported by your local `grep' command."
(with-current-buffer
(let ((xref-show-xrefs-function
;; Some future-proofing (bug#44905).
(eval (car (get 'xref-show-xrefs-function 'standard-value)))))
(custom--standard-value 'xref-show-xrefs-function)))
(dired-do-find-regexp from))
(xref-query-replace-in-results from to)))

View File

@ -2332,19 +2332,9 @@ to relist the file at point or the marked files or a
subdirectory, or type \\[dired-build-subdir-alist] to parse the buffer
again for the directory tree.
Customization variables (rename this buffer and type \\[describe-variable] on each line
for more info):
See the `dired' customization group for a list of user options.
`dired-listing-switches'
`dired-trivial-filenames'
`dired-marker-char'
`dired-del-marker'
`dired-keep-marker-rename'
`dired-keep-marker-copy'
`dired-keep-marker-hardlink'
`dired-keep-marker-symlink'
Hooks (use \\[describe-variable] to see their documentation):
This mode runs the following hooks:
`dired-before-readin-hook'
`dired-after-readin-hook'

View File

@ -95,8 +95,7 @@ but not `C-u X' or `ESC X' since the X is not the prefix key."
(global-set-key [ignore] 'ignore)
(or (boundp 'isearch-mode-map)
(load-library "isearch"))
(require 'isearch)
(define-key isearch-mode-map [ignore]
(lambda () (interactive) (isearch-update)))
@ -141,12 +140,6 @@ but not `C-u X' or `ESC X' since the X is not the prefix key."
;;; Mode
;; This feature seemed useless and it confused describe-mode,
;; so I deleted it.
;; (defvar double-mode-name "Double")
;; ;; Name of current double mode.
;; (make-variable-buffer-local 'double-mode-name)
;;;###autoload
(define-minor-mode double-mode
"Toggle special insertion on double keypresses (Double mode).

View File

@ -95,8 +95,7 @@
map)
"Keymap defining commands available in `electric-help-mode'.")
(defvar electric-help-orig-major-mode nil)
(make-variable-buffer-local 'electric-help-orig-major-mode)
(defvar-local electric-help-orig-major-mode nil)
(defun electric-help-mode ()
"`with-electric-help' temporarily places its buffer in this mode.

View File

@ -289,7 +289,7 @@
(byte-compile-preprocess
(byte-compile--reify-function fn))))))
(if (eq (car-safe newfn) 'function)
(byte-compile-unfold-lambda `(,(cadr newfn) ,@(cdr form)))
(macroexp--unfold-lambda `(,(cadr newfn) ,@(cdr form)))
;; This can happen because of macroexp-warn-and-return &co.
(byte-compile-warn
"Inlining closure %S failed" name)
@ -297,77 +297,91 @@
(_ ;; Give up on inlining.
form))))
;; ((lambda ...) ...)
(defun byte-compile-unfold-lambda (form &optional name)
;; In lexical-binding mode, let and functions don't bind vars in the same way
;; (let obey special-variable-p, but functions don't). But luckily, this
;; doesn't matter here, because function's behavior is underspecified so it
;; can safely be turned into a `let', even though the reverse is not true.
(or name (setq name "anonymous lambda"))
(let* ((lambda (car form))
(values (cdr form))
(arglist (nth 1 lambda))
(body (cdr (cdr lambda)))
optionalp restp
bindings)
(if (and (stringp (car body)) (cdr body))
(setq body (cdr body)))
(if (and (consp (car body)) (eq 'interactive (car (car body))))
(setq body (cdr body)))
;; FIXME: The checks below do not belong in an optimization phase.
(while arglist
(cond ((eq (car arglist) '&optional)
;; ok, I'll let this slide because funcall_lambda() does...
;; (if optionalp (error "multiple &optional keywords in %s" name))
(if restp (error "&optional found after &rest in %s" name))
(if (null (cdr arglist))
(error "nothing after &optional in %s" name))
(setq optionalp t))
((eq (car arglist) '&rest)
;; ...but it is by no stretch of the imagination a reasonable
;; thing that funcall_lambda() allows (&rest x y) and
;; (&rest x &optional y) in arglists.
(if (null (cdr arglist))
(error "nothing after &rest in %s" name))
(if (cdr (cdr arglist))
(error "multiple vars after &rest in %s" name))
(setq restp t))
(restp
(setq bindings (cons (list (car arglist)
(and values (cons 'list values)))
bindings)
values nil))
((and (not optionalp) (null values))
(byte-compile-warn "attempt to open-code `%s' with too few arguments" name)
(setq arglist nil values 'too-few))
(t
(setq bindings (cons (list (car arglist) (car values))
bindings)
values (cdr values))))
(setq arglist (cdr arglist)))
(if values
(progn
(or (eq values 'too-few)
(byte-compile-warn
"attempt to open-code `%s' with too many arguments" name))
form)
;; The following leads to infinite recursion when loading a
;; file containing `(defsubst f () (f))', and then trying to
;; byte-compile that file.
;(setq body (mapcar 'byte-optimize-form body)))
(let ((newform
(if bindings
(cons 'let (cons (nreverse bindings) body))
(cons 'progn body))))
(byte-compile-log " %s\t==>\t%s" form newform)
newform))))
;;; implementing source-level optimizers
(defconst byte-optimize-enable-variable-constprop t
"If non-nil, enable constant propagation through local variables.")
(defconst byte-optimize-warn-eliminated-variable nil
"Whether to warn when a variable is optimised away entirely.
This does usually not indicate a problem and makes the compiler
very chatty, but can be useful for debugging.")
(defvar byte-optimize--lexvars nil
"Lexical variables in scope, in reverse order of declaration.
Each element is on the form (NAME KEEP [VALUE]), where:
NAME is the variable name,
KEEP is a boolean indicating whether the binding must be retained,
VALUE, if present, is a substitutable expression.
Earlier variables shadow later ones with the same name.")
(defvar byte-optimize--vars-outside-condition nil
"Alist of variables lexically bound outside conditionally executed code.
Variables here are sensitive to mutation inside the conditional code,
since their contents in sequentially later code depends on the path taken
and may no longer be statically known.
Same format as `byte-optimize--lexvars', with shared structure and contents.")
(defvar byte-optimize--vars-outside-loop nil
"Alist of variables lexically bound outside the innermost `while' loop.
Variables here are sensitive to mutation inside the loop, since this can
occur an indeterminate number of times and thus have effect on code
sequentially preceding the mutation itself.
Same format as `byte-optimize--lexvars', with shared structure and contents.")
(defvar byte-optimize--dynamic-vars nil
"List of variables declared as dynamic during optimisation.")
(defun byte-optimize--substitutable-p (expr)
"Whether EXPR is a constant that can be propagated."
;; Only consider numbers, symbols and strings to be values for substitution
;; purposes. Numbers and symbols are immutable, and mutating string
;; literals (or results from constant-evaluated string-returning functions)
;; can be considered undefined.
;; (What about other quoted values, like conses?)
(or (booleanp expr)
(numberp expr)
(stringp expr)
(and (consp expr)
(eq (car expr) 'quote)
(symbolp (cadr expr)))
(keywordp expr)))
(defmacro byte-optimize--pcase (exp &rest cases)
;; When we do
;;
;; (pcase EXP
;; (`(if ,exp ,then ,else) (DO-TEST))
;; (`(plus ,e2 ,e2) (DO-ADD))
;; (`(times ,e2 ,e2) (DO-MULT))
;; ...)
;;
;; we usually don't want to fall back to the default case if
;; the value of EXP is of a form like `(if E1 E2)' or `(plus E1)'
;; or `(times E1 E2 E3)', instead we either want to signal an error
;; that EXP has an unexpected shape, or we want to carry on as if
;; it had the right shape (ignore the extra data and pretend the missing
;; data is nil) because it should simply never happen.
;;
;; The macro below implements the second option by rewriting patterns
;; like `(if ,exp ,then ,else)'
;; to `(if . (or `(,exp ,then ,else) pcase--dontcare))'.
;;
;; The resulting macroexpansion is also significantly cleaner/smaller/faster.
(declare (indent 1) (debug (form &rest (pcase-PAT body))))
`(pcase ,exp
. ,(mapcar (lambda (case)
`(,(pcase (car case)
((and `(,'\` (,_ . (,'\, ,_))) pat) pat)
(`(,'\` (,head . ,tail))
(list '\`
(cons head
(list '\, `(or ,(list '\` tail) pcase--dontcare)))))
(pat pat))
. ,(cdr case)))
cases)))
(defun byte-optimize-form-code-walker (form for-effect)
;;
;; For normal function calls, We can just mapcar the optimizer the cdr. But
@ -380,13 +394,26 @@
;; have no place in an optimizer: the corresponding tests should be
;; performed in `macroexpand-all', or in `cconv', or in `bytecomp'.
(let ((fn (car-safe form)))
(pcase form
(byte-optimize--pcase form
((pred (not consp))
(if (not (and for-effect
(or byte-compile-delete-errors
(not (symbolp form))
(eq form t))))
form))
(cond
((and for-effect
(or byte-compile-delete-errors
(not (symbolp form))
(eq form t)))
nil)
((symbolp form)
(let ((lexvar (assq form byte-optimize--lexvars)))
(if (cddr lexvar) ; Value available?
(if (assq form byte-optimize--vars-outside-loop)
;; Cannot substitute; mark for retention to avoid the
;; variable being eliminated.
(progn
(setcar (cdr lexvar) t)
form)
(caddr lexvar)) ; variable value to use
form)))
(t form)))
(`(quote . ,v)
(if (cdr v)
(byte-compile-warn "malformed quote form: `%s'"
@ -396,39 +423,28 @@
(and (car v)
(not for-effect)
form))
(`(,(or 'let 'let*) . ,(or `(,bindings . ,exps) pcase--dontcare))
;; Recursively enter the optimizer for the bindings and body
;; of a let or let*. This for depth-firstness: forms that
;; are more deeply nested are optimized first.
(cons fn
(cons
(mapcar (lambda (binding)
(if (symbolp binding)
binding
(if (cdr (cdr binding))
(byte-compile-warn "malformed let binding: `%s'"
(prin1-to-string binding)))
(list (car binding)
(byte-optimize-form (nth 1 binding) nil))))
bindings)
(byte-optimize-body exps for-effect))))
(`(,(or 'let 'let*) . ,rest)
(cons fn (byte-optimize-let-form fn rest for-effect)))
(`(cond . ,clauses)
(cons fn
(mapcar (lambda (clause)
(if (consp clause)
(cons
(byte-optimize-form (car clause) nil)
(byte-optimize-body (cdr clause) for-effect))
(byte-compile-warn "malformed cond form: `%s'"
(prin1-to-string clause))
clause))
clauses)))
;; The condition in the first clause is always executed, but
;; right now we treat all of them as conditional for simplicity.
(let ((byte-optimize--vars-outside-condition byte-optimize--lexvars))
(cons fn
(mapcar (lambda (clause)
(if (consp clause)
(cons
(byte-optimize-form (car clause) nil)
(byte-optimize-body (cdr clause) for-effect))
(byte-compile-warn "malformed cond form: `%s'"
(prin1-to-string clause))
clause))
clauses))))
(`(progn . ,exps)
;; As an extra added bonus, this simplifies (progn <x>) --> <x>.
(if (cdr exps)
(macroexp-progn (byte-optimize-body exps for-effect))
(byte-optimize-form (car exps) for-effect)))
(`(prog1 . ,(or `(,exp . ,exps) pcase--dontcare))
(`(prog1 ,exp . ,exps)
(if exps
`(prog1 ,(byte-optimize-form exp for-effect)
. ,(byte-optimize-body exps t))
@ -442,37 +458,54 @@
(cons fn (byte-optimize-body exps for-effect)))
(`(if ,test ,then . ,else)
`(if ,(byte-optimize-form test nil)
,(byte-optimize-form then for-effect)
. ,(byte-optimize-body else for-effect)))
(`(if . ,_)
(byte-compile-warn "too few arguments for `if'"))
;; The test is always executed.
(let* ((test-opt (byte-optimize-form test nil))
;; The THEN and ELSE branches are executed conditionally.
;;
;; FIXME: We are conservative here: any variable changed in the
;; THEN branch will be barred from substitution in the ELSE
;; branch, despite the branches being mutually exclusive.
(byte-optimize--vars-outside-condition byte-optimize--lexvars)
(then-opt (byte-optimize-form then for-effect))
(else-opt (byte-optimize-body else for-effect)))
`(if ,test-opt ,then-opt . ,else-opt)))
(`(,(or 'and 'or) . ,exps) ; Remember, and/or are control structures.
;; Take forms off the back until we can't any more.
;; In the future it could conceivably be a problem that the
;; subexpressions of these forms are optimized in the reverse
;; order, but it's ok for now.
(if for-effect
(let ((backwards (reverse exps)))
(while (and backwards
(null (setcar backwards
(byte-optimize-form (car backwards)
for-effect))))
(setq backwards (cdr backwards)))
(if (and exps (null backwards))
(byte-compile-log
" all subforms of %s called for effect; deleted" form))
(and backwards
(cons fn (nreverse (mapcar #'byte-optimize-form
backwards)))))
(cons fn (mapcar #'byte-optimize-form exps))))
;; FIXME: We have to traverse the expressions in left-to-right
;; order (because that is the order of evaluation and variable
;; mutations must be found prior to their use), but doing so we miss
;; some optimisation opportunities:
;; consider (and A B) in a for-effect context, where B => nil.
;; Then A could be optimised in a for-effect context too.
(let ((tail exps)
(args nil))
(when tail
;; The first argument is always unconditional.
(push (byte-optimize-form
(car tail) (and for-effect (null (cdr tail))))
args)
(setq tail (cdr tail))
;; Remaining arguments are conditional.
(let ((byte-optimize--vars-outside-condition byte-optimize--lexvars))
(while tail
(push (byte-optimize-form
(car tail) (and for-effect (null (cdr tail))))
args)
(setq tail (cdr tail)))))
(cons fn (nreverse args))))
(`(while ,exp . ,exps)
`(while ,(byte-optimize-form exp nil)
. ,(byte-optimize-body exps t)))
(`(while . ,_)
(byte-compile-warn "too few arguments for `while'"))
;; FIXME: We conservatively prevent the substitution of any variable
;; bound outside the loop in case it is mutated later in the loop,
;; but this misses many opportunities: variables not mutated in the
;; loop at all, and variables affecting the initial condition (which
;; is always executed unconditionally).
(let* ((byte-optimize--vars-outside-condition byte-optimize--lexvars)
(byte-optimize--vars-outside-loop byte-optimize--lexvars)
(condition (byte-optimize-form exp nil))
(body (byte-optimize-body exps t)))
`(while ,condition . ,body)))
(`(interactive . ,_)
(byte-compile-warn "misplaced interactive spec: `%s'"
@ -484,25 +517,36 @@
;; all the subexpressions and compiling them separately.
form)
(`(condition-case . ,(or `(,var ,exp . ,clauses) pcase--dontcare))
`(condition-case ,var ;Not evaluated.
,(byte-optimize-form exp for-effect)
,@(mapcar (lambda (clause)
`(,(car clause)
,@(byte-optimize-body (cdr clause) for-effect)))
clauses)))
(`(condition-case ,var ,exp . ,clauses)
(let ((byte-optimize--vars-outside-condition byte-optimize--lexvars))
`(condition-case ,var ;Not evaluated.
,(byte-optimize-form exp for-effect)
,@(mapcar (lambda (clause)
`(,(car clause)
,@(byte-optimize-body (cdr clause) for-effect)))
clauses))))
(`(unwind-protect . ,(or `(,exp . ,exps) pcase--dontcare))
;; The "protected" part of an unwind-protect is compiled (and thus
;; optimized) as a top-level form, so don't do it here. But the
;; non-protected part has the same for-effect status as the
;; unwind-protect itself. (The protected part is always for effect,
(`(unwind-protect ,exp . ,exps)
;; The unwinding part of an unwind-protect is compiled (and thus
;; optimized) as a top-level form, but run the optimizer for it here
;; anyway for lexical variable usage and substitution. But the
;; protected part has the same for-effect status as the
;; unwind-protect itself. (The unwinding part is always for effect,
;; but that isn't handled properly yet.)
`(unwind-protect ,(byte-optimize-form exp for-effect) . ,exps))
(let* ((byte-optimize--vars-outside-condition byte-optimize--lexvars)
(bodyform (byte-optimize-form exp for-effect)))
(pcase exps
(`(:fun-body ,f)
`(unwind-protect ,bodyform
:fun-body ,(byte-optimize-form f nil)))
(_
`(unwind-protect ,bodyform
. ,(byte-optimize-body exps t))))))
(`(catch . ,(or `(,tag . ,exps) pcase--dontcare))
`(catch ,(byte-optimize-form tag nil)
. ,(byte-optimize-body exps for-effect)))
(`(catch ,tag . ,exps)
(let ((byte-optimize--vars-outside-condition byte-optimize--lexvars))
`(catch ,(byte-optimize-form tag nil)
. ,(byte-optimize-body exps for-effect))))
(`(ignore . ,exps)
;; Don't treat the args to `ignore' as being
@ -512,10 +556,17 @@
`(prog1 nil . ,(mapcar #'byte-optimize-form exps)))
;; Needed as long as we run byte-optimize-form after cconv.
(`(internal-make-closure . ,_) form)
(`(internal-make-closure . ,_)
;; Look up free vars and mark them to be kept, so that they
;; won't be optimised away.
(dolist (var (caddr form))
(let ((lexvar (assq var byte-optimize--lexvars)))
(when lexvar
(setcar (cdr lexvar) t))))
form)
(`((lambda . ,_) . ,_)
(let ((newform (byte-compile-unfold-lambda form)))
(let ((newform (macroexp--unfold-lambda form)))
(if (eq newform form)
;; Some error occurred, avoid infinite recursion.
form
@ -525,6 +576,36 @@
;; is a *value* and shouldn't appear in the car.
(`((closure . ,_) . ,_) form)
(`(setq . ,args)
(let ((var-expr-list nil))
(while args
(unless (and (consp args)
(symbolp (car args)) (consp (cdr args)))
(byte-compile-warn "malformed setq form: %S" form))
(let* ((var (car args))
(expr (cadr args))
(lexvar (assq var byte-optimize--lexvars))
(value (byte-optimize-form expr nil)))
(when lexvar
;; If it's bound outside conditional, invalidate.
(if (assq var byte-optimize--vars-outside-condition)
;; We are in conditional code and the variable was
;; bound outside: cancel substitutions.
(setcdr (cdr lexvar) nil)
;; Set a new value (if substitutable).
(setcdr (cdr lexvar)
(and (byte-optimize--substitutable-p value)
(list value))))
(setcar (cdr lexvar) t)) ; Mark variable to be kept.
(push var var-expr-list)
(push value var-expr-list))
(setq args (cddr args)))
(cons fn (nreverse var-expr-list))))
(`(defvar ,(and (pred symbolp) name) . ,_)
(push name byte-optimize--dynamic-vars)
form)
(`(,(pred byte-code-function-p) . ,exps)
(cons fn (mapcar #'byte-optimize-form exps)))
@ -582,6 +663,66 @@
new)
form)))
(defun byte-optimize-let-form (head form for-effect)
;; Recursively enter the optimizer for the bindings and body
;; of a let or let*. This for depth-firstness: forms that
;; are more deeply nested are optimized first.
(if (and lexical-binding byte-optimize-enable-variable-constprop)
(let* ((byte-optimize--lexvars byte-optimize--lexvars)
(new-lexvars nil)
(let-vars nil))
(dolist (binding (car form))
(let (name expr)
(cond ((consp binding)
(setq name (car binding))
(unless (symbolp name)
(byte-compile-warn "let-bind nonvariable: `%S'" name))
(setq expr (byte-optimize-form (cadr binding) nil)))
((symbolp binding)
(setq name binding))
(t (byte-compile-warn "malformed let binding: `%S'" binding)))
(let* (
(value (and (byte-optimize--substitutable-p expr)
(list expr)))
(lexical (not (or (and (symbolp name)
(special-variable-p name))
(memq name byte-compile-bound-variables)
(memq name byte-optimize--dynamic-vars))))
(lexinfo (and lexical (cons name (cons nil value)))))
(push (cons name (cons expr (cdr lexinfo))) let-vars)
(when lexinfo
(push lexinfo (if (eq head 'let*)
byte-optimize--lexvars
new-lexvars))))))
(setq byte-optimize--lexvars
(append new-lexvars byte-optimize--lexvars))
;; Walk the body expressions, which may mutate some of the records,
;; and generate new bindings that exclude unused variables.
(let* ((byte-optimize--dynamic-vars byte-optimize--dynamic-vars)
(opt-body (byte-optimize-body (cdr form) for-effect))
(bindings nil))
(dolist (var let-vars)
;; VAR is (NAME EXPR [KEEP [VALUE]])
(if (and (nthcdr 3 var) (not (nth 2 var)))
;; Value present and not marked to be kept: eliminate.
(when byte-optimize-warn-eliminated-variable
(byte-compile-warn "eliminating local variable %S" (car var)))
(push (list (nth 0 var) (nth 1 var)) bindings)))
(cons bindings opt-body)))
;; With dynamic binding, no substitutions are in effect.
(let ((byte-optimize--lexvars nil))
(cons
(mapcar (lambda (binding)
(if (symbolp binding)
binding
(when (or (atom binding) (cddr binding))
(byte-compile-warn "malformed let binding: `%S'" binding))
(list (car binding)
(byte-optimize-form (nth 1 binding) nil))))
(car form))
(byte-optimize-body (cdr form) for-effect)))))
(defun byte-optimize-body (forms all-for-effect)
;; Optimize the cdr of a progn or implicit progn; all forms is a list of

View File

@ -195,7 +195,6 @@ otherwise adds \".elc\"."
(autoload 'byte-optimize-form "byte-opt")
;; This is the entry point to the lapcode optimizer pass2.
(autoload 'byte-optimize-lapcode "byte-opt")
(autoload 'byte-compile-unfold-lambda "byte-opt")
;; This is the entry point to the decompiler, which is used by the
;; disassembler. The disassembler just requires 'byte-compile, but
@ -3365,7 +3364,7 @@ for symbols generated by the byte compiler itself."
((and (eq (car-safe (car form)) 'lambda)
;; if the form comes out the same way it went in, that's
;; because it was malformed, and we couldn't unfold it.
(not (eq form (setq form (byte-compile-unfold-lambda form)))))
(not (eq form (setq form (macroexp--unfold-lambda form)))))
(byte-compile-form form byte-compile--for-effect)
(setq byte-compile--for-effect nil))
((byte-compile-normal-call form)))

View File

@ -67,9 +67,8 @@
(define-obsolete-variable-alias 'chart-map 'chart-mode-map "24.1")
(defvar chart-mode-map (make-sparse-keymap) "Keymap used in chart mode.")
(defvar chart-local-object nil
(defvar-local chart-local-object nil
"Local variable containing the locally displayed chart object.")
(make-variable-buffer-local 'chart-local-object)
(defvar chart-face-color-list '("red" "green" "blue"
"cyan" "yellow" "purple")

View File

@ -147,13 +147,6 @@
;;
;; See the above section "Checking Parameters" for details about
;; parameter checking.
;;
;; Dependencies:
;;
;; This file requires lisp-mnt (Lisp maintenance routines) for the
;; comment checkers.
;;
;; Requires custom for Emacs v20.
;;; TO DO:
;; Hook into the byte compiler on a defun/defvar level to generate

View File

@ -278,11 +278,10 @@ For example, you could write
((not globalp)
`(progn
:autoload-end
(defvar ,mode ,init-value
(defvar-local ,mode ,init-value
,(concat (format "Non-nil if %s is enabled.\n" pretty-name)
(internal--format-docstring-line
"Use the command `%s' to change this variable." mode)))
(make-variable-buffer-local ',mode)))
"Use the command `%s' to change this variable." mode)))))
(t
(let ((base-doc-string
(concat "Non-nil if %s is enabled.
@ -419,6 +418,7 @@ on if the hook has explicitly disabled it.
(pretty-global-name (easy-mmode-pretty-mode-name global-mode))
(group nil)
(extra-keywords nil)
(MODE-variable mode)
(MODE-buffers (intern (concat global-mode-name "-buffers")))
(MODE-enable-in-buffers
(intern (concat global-mode-name "-enable-in-buffers")))
@ -440,6 +440,7 @@ on if the hook has explicitly disabled it.
(pcase keyw
(:group (setq group (nconc group (list :group (pop body)))))
(:global (pop body))
(:variable (setq MODE-variable (pop body)))
(:predicate
(setq predicate (list (pop body)))
(setq turn-on-function
@ -453,8 +454,7 @@ on if the hook has explicitly disabled it.
(progn
(put ',global-mode 'globalized-minor-mode t)
:autoload-end
(defvar ,MODE-major-mode nil)
(make-variable-buffer-local ',MODE-major-mode))
(defvar-local ,MODE-major-mode nil))
;; The actual global minor-mode
(define-minor-mode ,global-mode
,(concat (format "Toggle %s in all buffers.\n" pretty-name)
@ -543,7 +543,7 @@ list."
(with-current-buffer buf
(unless ,MODE-set-explicitly
(unless (eq ,MODE-major-mode major-mode)
(if ,mode
(if ,MODE-variable
(progn
(,mode -1)
(funcall ,turn-on-function))

View File

@ -341,7 +341,7 @@ Return the result of the last expression in BODY."
;; FIXME: We should probably just be using `pop-to-buffer'.
(setq window
(cond
((and (edebug-window-live-p window)
((and (window-live-p window)
(eq (window-buffer window) buffer))
window)
((eq (window-buffer) buffer)
@ -392,7 +392,7 @@ Return the result of the last expression in BODY."
;; Get either a full window configuration or some window information.
(if (listp which-windows)
(mapcar (lambda (window)
(if (edebug-window-live-p window)
(if (window-live-p window)
(list window
(window-buffer window)
(window-point window)
@ -407,7 +407,7 @@ Return the result of the last expression in BODY."
(mapcar (lambda (one-window-info)
(if one-window-info
(apply (lambda (window buffer point start hscroll)
(if (edebug-window-live-p window)
(if (window-live-p window)
(progn
(set-window-buffer window buffer)
(set-window-point window point)
@ -1687,10 +1687,10 @@ contains a circular object."
(first-char (and (symbolp spec) (aref (symbol-name spec) 0)))
(match (cond
((eq ?& first-char);; "&" symbols take all following specs.
(funcall (get-edebug-spec spec) cursor (cdr specs)))
(edebug--handle-&-spec-op spec cursor (cdr specs)))
((eq ?: first-char);; ":" symbols take one following spec.
(setq rest (cdr (cdr specs)))
(funcall (get-edebug-spec spec) cursor (car (cdr specs))))
(edebug--handle-:-spec-op spec cursor (car (cdr specs))))
(t;; Any other normal spec.
(setq rest (cdr specs))
(edebug-match-one-spec cursor spec)))))
@ -1721,16 +1721,10 @@ contains a circular object."
;; user may want to define macros or functions with the same names.
;; We could use an internal obarray for these primitive specs.
(dolist (pair '((&optional . edebug-match-&optional)
(&rest . edebug-match-&rest)
(&or . edebug-match-&or)
(form . edebug-match-form)
(dolist (pair '((form . edebug-match-form)
(sexp . edebug-match-sexp)
(body . edebug-match-body)
(&define . edebug-match-&define)
(name . edebug-match-name)
(:name . edebug-match-colon-name)
(:unique . edebug-match-:unique)
(arg . edebug-match-arg)
(def-body . edebug-match-def-body)
(def-form . edebug-match-def-form)
@ -1743,9 +1737,6 @@ contains a circular object."
(cl-macrolet-expr . edebug-match-cl-macrolet-expr)
(cl-macrolet-name . edebug-match-cl-macrolet-name)
(cl-macrolet-body . edebug-match-cl-macrolet-body)
(&not . edebug-match-&not)
(&key . edebug-match-&key)
(&error . edebug-match-&error)
(place . edebug-match-place)
(gate . edebug-match-gate)
;; (nil . edebug-match-nil) not this one - special case it.
@ -1793,7 +1784,7 @@ contains a circular object."
(defsubst edebug-match-body (cursor) (edebug-forms cursor))
(defun edebug-match-&optional (cursor specs)
(cl-defmethod edebug--handle-&-spec-op ((_ (eql &optional)) cursor specs)
;; Keep matching until one spec fails.
(edebug-&optional-wrapper cursor specs 'edebug-&optional-wrapper))
@ -1819,7 +1810,11 @@ contains a circular object."
;; Reuse the &optional handler with this as the remainder handler.
(edebug-&optional-wrapper cursor specs remainder-handler))
(defun edebug-match-&rest (cursor specs)
(cl-defgeneric edebug--handle-&-spec-op (op cursor specs)
"Handle &foo spec operators.
&foo spec operators operate on all the subsequent SPECS.")
(cl-defmethod edebug--handle-&-spec-op ((_ (eql &rest)) cursor specs)
;; Repeatedly use specs until failure.
(let ((edebug-&rest specs) ;; remember these
edebug-best-error
@ -1827,7 +1822,7 @@ contains a circular object."
(edebug-&rest-wrapper cursor specs 'edebug-&rest-wrapper)))
(defun edebug-match-&or (cursor specs)
(cl-defmethod edebug--handle-&-spec-op ((_ (eql &or)) cursor specs)
;; Keep matching until one spec succeeds, and return its results.
;; If none match, fail.
;; This needs to be optimized since most specs spend time here.
@ -1852,23 +1847,24 @@ contains a circular object."
))
(defun edebug-match-&not (cursor specs)
(cl-defmethod edebug--handle-&-spec-op ((_ (eql &not)) cursor specs)
;; If any specs match, then fail
(if (null (catch 'no-match
(let ((edebug-gate nil))
(save-excursion
(edebug-match-&or cursor specs)))
(edebug--handle-&-spec-op '&or cursor specs)))
nil))
;; This means something matched, so it is a no match.
(edebug-no-match cursor "Unexpected"))
;; This means nothing matched, so it is OK.
nil) ;; So, return nothing
(defun edebug-match-&key (cursor specs)
(cl-defmethod edebug--handle-&-spec-op ((_ (eql &key)) cursor specs)
;; Following specs must look like (<name> <spec>) ...
;; where <name> is the name of a keyword, and spec is its spec.
;; This really doesn't save much over the expanded form and takes time.
(edebug-match-&rest
(edebug--handle-&-spec-op
'&rest
cursor
(cons '&or
(mapcar (lambda (pair)
@ -1876,7 +1872,7 @@ contains a circular object."
(car (cdr pair))))
specs))))
(defun edebug-match-&error (cursor specs)
(cl-defmethod edebug--handle-&-spec-op ((_ (eql &error)) cursor specs)
;; Signal an error, using the following string in the spec as argument.
(let ((error-string (car specs))
(edebug-error-point (edebug-before-offset cursor)))
@ -1980,7 +1976,7 @@ contains a circular object."
(defun edebug-match-function (_cursor)
(error "Use function-form instead of function in edebug spec"))
(defun edebug-match-&define (cursor specs)
(cl-defmethod edebug--handle-&-spec-op ((_ (eql &define)) cursor specs)
;; Match a defining form.
;; Normally, &define is interpreted specially other places.
;; This should only be called inside of a spec list to match the remainder
@ -2034,7 +2030,11 @@ contains a circular object."
(edebug-move-cursor cursor)
(list name)))
(defun edebug-match-colon-name (_cursor spec)
(cl-defgeneric edebug--handle-:-spec-op (op cursor spec)
"Handle :foo spec operators.
:foo spec operators operate on just the one subsequent SPEC element.")
(cl-defmethod edebug--handle-:-spec-op ((_ (eql :name)) _cursor spec)
;; Set the edebug-def-name to the spec.
(setq edebug-def-name
(if edebug-def-name
@ -2043,7 +2043,7 @@ contains a circular object."
spec))
nil)
(defun edebug-match-:unique (_cursor spec)
(cl-defmethod edebug--handle-:-spec-op ((_ (eql :unique)) _cursor spec)
"Match a `:unique PREFIX' specifier.
SPEC is the symbol name prefix for `gensym'."
(let ((suffix (gensym spec)))
@ -2641,12 +2641,11 @@ See `edebug-behavior-alist' for implementations.")
;; window-start now stored with each function.
;;(defvar edebug-window-start nil)
;;(defvar-local edebug-window-start nil)
;; Remember where each buffers' window starts between edebug calls.
;; This is to avoid spurious recentering.
;; Does this still need to be buffer-local??
;;(setq-default edebug-window-start nil)
;;(make-variable-buffer-local 'edebug-window-start)
;; Dynamically declared unbound vars
@ -2689,7 +2688,7 @@ See `edebug-behavior-alist' for implementations.")
(edebug-outside-window (selected-window))
(edebug-outside-buffer (current-buffer))
(edebug-outside-point (point))
(edebug-outside-mark (edebug-mark))
(edebug-outside-mark (mark t))
edebug-outside-windows ; Window or screen configuration.
edebug-buffer-points
@ -2858,7 +2857,7 @@ See `edebug-behavior-alist' for implementations.")
;; Unrestore edebug-buffer's window-start, if displayed.
(let ((window (car edebug-window-data)))
(if (and (edebug-window-live-p window)
(if (and (window-live-p window)
(eq (window-buffer) edebug-buffer))
(progn
(set-window-start window (cdr edebug-window-data)
@ -2877,7 +2876,7 @@ See `edebug-behavior-alist' for implementations.")
;; Since we may be in a save-excursion, in case of quit,
;; reselect the outside window only.
;; Only needed if we are not recovering windows??
(if (edebug-window-live-p edebug-outside-window)
(if (window-live-p edebug-outside-window)
(select-window edebug-outside-window))
) ; if edebug-save-windows
@ -3802,9 +3801,10 @@ Print result in minibuffer."
(interactive (list (read--expression "Eval: ")))
(princ
(edebug-outside-excursion
(setq values (cons (edebug-eval expr) values))
(concat (edebug-safe-prin1-to-string (car values))
(eval-expression-print-format (car values))))))
(let ((result (edebug-eval expr)))
(values--store-value result)
(concat (edebug-safe-prin1-to-string result)
(eval-expression-print-format result))))))
(defun edebug-eval-last-sexp (&optional no-truncate)
"Evaluate sexp before point in the outside environment.
@ -4541,11 +4541,6 @@ It is removed when you hit any char."
;;; Emacs version specific code
(defalias 'edebug-window-live-p 'window-live-p)
(defun edebug-mark ()
(mark t))
(defun edebug-set-conditional-breakpoint (arg condition)
"Set a conditional breakpoint at nearest sexp.
The condition is evaluated in the outside context.
@ -4661,7 +4656,15 @@ instrumentation for, defaulting to all functions."
(message "Removed edebug instrumentation from %s"
(mapconcat #'symbol-name functions ", ")))
;;; Obsolete.
(defun edebug-mark ()
(declare (obsolete mark "28.1"))
(mark t))
(define-obsolete-function-alias 'edebug-mark-marker #'mark-marker "28.1")
(define-obsolete-function-alias 'edebug-window-live-p #'window-live-p "28.1")
(provide 'edebug)
;;; edebug.el ends here

View File

@ -110,8 +110,7 @@
;; Boy Jim's profiler.el. Both were written for Emacs 18 and both were
;; pretty good first shots at profiling, but I found that they didn't
;; provide the functionality or interface that I wanted, so I wrote
;; this. I've tested elp in XEmacs 19 and Emacs 19. There's no point
;; in even trying to make this work with Emacs 18.
;; this.
;; Unlike previous profilers, elp uses Emacs 19's built-in function
;; current-time to return interval times. This obviates the need for

View File

@ -725,17 +725,20 @@ Return the value with which ITERATOR finished iteration."
(condition-symbol (cps--gensym "iter-do-condition"))
(it-symbol (cps--gensym "iter-do-iterator"))
(result-symbol (cps--gensym "iter-do-result")))
`(let (,var
,result-symbol
`(let (,result-symbol
(,done-symbol nil)
(,it-symbol ,iterator))
(while (not ,done-symbol)
(condition-case ,condition-symbol
(setf ,var (iter-next ,it-symbol))
(iter-end-of-sequence
(setf ,result-symbol (cdr ,condition-symbol))
(setf ,done-symbol t)))
(unless ,done-symbol ,@body))
(while
(let ((,var
(condition-case ,condition-symbol
(iter-next ,it-symbol)
(iter-end-of-sequence
(setf ,result-symbol (cdr ,condition-symbol))
(setf ,done-symbol t)))))
(unless ,done-symbol
,@body
;; Loop until done-symbol is set.
t)))
,result-symbol)))
(defvar cl--loop-args)

View File

@ -96,9 +96,8 @@
;; Internal Variables
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar generic-font-lock-keywords nil
(defvar-local generic-font-lock-keywords nil
"Keywords for `font-lock-defaults' in a generic mode.")
(make-variable-buffer-local 'generic-font-lock-keywords)
;;;###autoload
(defvar generic-mode-list nil

View File

@ -495,7 +495,7 @@ absent, return nil."
(concat "^;;;[[:blank:]]*\\("
lm-commentary-header
"\\):[[:blank:]\n]*")
"^;;[[:blank:]]*" ; double semicolon prefix
"^;;[[:blank:]]?" ; double semicolon prefix
"[[:blank:]\n]*\\'") ; trailing new-lines
"" (buffer-substring-no-properties
start (lm-commentary-end))))))))

View File

@ -62,9 +62,6 @@
(modify-syntax-entry ?\t " " table)
(modify-syntax-entry ?\f " " table)
(modify-syntax-entry ?\n "> " table)
;; This is probably obsolete since nowadays such features use overlays.
;; ;; Give CR the same syntax as newline, for selective-display.
;; (modify-syntax-entry ?\^m "> " table)
(modify-syntax-entry ?\; "< " table)
(modify-syntax-entry ?` "' " table)
(modify-syntax-entry ?' "' " table)
@ -775,7 +772,8 @@ or to switch back to an existing one."
(setq-local find-tag-default-function 'lisp-find-tag-default)
(setq-local comment-start-skip
"\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *")
(setq-local comment-end "|#")
(setq-local comment-end-skip "[ \t]*\\(\\s>\\||#\\)")
(setq-local font-lock-comment-end-skip "|#")
(setq imenu-case-fold-search t))
(defun lisp-find-tag-default ()
@ -1372,7 +1370,24 @@ and initial semicolons."
(derived-mode-p 'emacs-lisp-mode))
emacs-lisp-docstring-fill-column
fill-column)))
(fill-paragraph justify))
(save-restriction
(save-excursion
(let ((ppss (syntax-ppss)))
;; If we're in a string, then narrow (roughly) to that
;; string before filling. This avoids filling Lisp
;; statements that follow the string.
(when (ppss-string-terminator ppss)
(goto-char (ppss-comment-or-string-start ppss))
(beginning-of-line)
;; The string may be unterminated -- in that case, don't
;; narrow.
(when (ignore-errors
(progn
(forward-sexp 1)
t))
(narrow-to-region (ppss-comment-or-string-start ppss)
(point))))
(fill-paragraph justify)))))
;; Never return nil.
t))

View File

@ -200,6 +200,69 @@ and also to avoid outputting the warning during normal execution."
new-form))
new-form)))
(defun macroexp--unfold-lambda (form &optional name)
;; In lexical-binding mode, let and functions don't bind vars in the same way
;; (let obey special-variable-p, but functions don't). But luckily, this
;; doesn't matter here, because function's behavior is underspecified so it
;; can safely be turned into a `let', even though the reverse is not true.
(or name (setq name "anonymous lambda"))
(let* ((lambda (car form))
(values (cdr form))
(arglist (nth 1 lambda))
(body (cdr (cdr lambda)))
optionalp restp
bindings)
(if (and (stringp (car body)) (cdr body))
(setq body (cdr body)))
(if (and (consp (car body)) (eq 'interactive (car (car body))))
(setq body (cdr body)))
;; FIXME: The checks below do not belong in an optimization phase.
(while arglist
(cond ((eq (car arglist) '&optional)
;; ok, I'll let this slide because funcall_lambda() does...
;; (if optionalp (error "multiple &optional keywords in %s" name))
(if restp (error "&optional found after &rest in %s" name))
(if (null (cdr arglist))
(error "nothing after &optional in %s" name))
(setq optionalp t))
((eq (car arglist) '&rest)
;; ...but it is by no stretch of the imagination a reasonable
;; thing that funcall_lambda() allows (&rest x y) and
;; (&rest x &optional y) in arglists.
(if (null (cdr arglist))
(error "nothing after &rest in %s" name))
(if (cdr (cdr arglist))
(error "multiple vars after &rest in %s" name))
(setq restp t))
(restp
(setq bindings (cons (list (car arglist)
(and values (cons 'list values)))
bindings)
values nil))
((and (not optionalp) (null values))
(setq arglist nil values 'too-few))
(t
(setq bindings (cons (list (car arglist) (car values))
bindings)
values (cdr values))))
(setq arglist (cdr arglist)))
(if values
(macroexp--warn-and-return
(format (if (eq values 'too-few)
"attempt to open-code `%s' with too few arguments"
"attempt to open-code `%s' with too many arguments")
name)
form)
;; The following leads to infinite recursion when loading a
;; file containing `(defsubst f () (f))', and then trying to
;; byte-compile that file.
;;(setq body (mapcar 'byte-optimize-form body)))
(if bindings
`(let ,(nreverse bindings) . ,body)
(macroexp-progn body)))))
(defun macroexp--expand-all (form)
"Expand all macros in FORM.
This is an internal version of `macroexpand-all'.
@ -245,12 +308,8 @@ Assumes the caller has bound `macroexpand-all-environment'."
;; i.e. rewrite it to (let (<args>) <body>). We'd do it in the optimizer
;; anyway, but doing it here (i.e. earlier) can sometimes avoid the
;; creation of a closure, thus resulting in much better code.
(let ((newform (if (not (fboundp 'byte-compile-unfold-lambda))
'macroexp--not-unfolded
;; Don't unfold if byte-opt is not yet loaded.
(byte-compile-unfold-lambda form))))
(if (or (eq newform 'macroexp--not-unfolded)
(eq newform form))
(let ((newform (macroexp--unfold-lambda form)))
(if (eq newform form)
;; Unfolding failed for some reason, avoid infinite recursion.
(macroexp--cons (macroexp--all-forms fun 2)
(macroexp--all-forms args)

View File

@ -182,8 +182,7 @@ if it exists."
;; Check if `package-archive-upload-base' is valid.
(when (or (not (stringp package-archive-upload-base))
(equal package-archive-upload-base
(car-safe
(get 'package-archive-upload-base 'standard-value))))
(custom--standard-value 'package-archive-upload-base)))
(setq package-archive-upload-base
(read-directory-name
"Base directory for package archive: ")))

View File

@ -135,7 +135,6 @@ PATTERN matches. PATTERN can take one of the forms:
(pred (not FUN)) matches if FUN called on EXPVAL returns nil.
(app FUN PAT) matches if FUN called on EXPVAL matches PAT.
(guard BOOLEXP) matches if BOOLEXP evaluates to non-nil.
(let PAT EXPR) matches if EXPR matches PAT.
(and PAT...) matches if all the patterns match.
(or PAT...) matches if any of the patterns matches.
@ -145,7 +144,7 @@ FUN in `pred' and `app' can take one of the forms:
(F ARG1 .. ARGn)
call F with ARG1..ARGn and EXPVAL as n+1'th argument
FUN, BOOLEXP, EXPR, and subsequent PAT can refer to variables
FUN, BOOLEXP, and subsequent PAT can refer to variables
bound earlier in the pattern by a SYMBOL pattern.
Additional patterns can be defined using `pcase-defmacro'.
@ -426,7 +425,6 @@ of the elements of LIST is performed as if by `pcase-let'.
(if (pcase--self-quoting-p pat) `',pat pat))
((memq head '(pred guard quote)) pat)
((memq head '(or and)) `(,head ,@(mapcar #'pcase--macroexpand (cdr pat))))
((eq head 'let) `(let ,(pcase--macroexpand (cadr pat)) ,@(cddr pat)))
((eq head 'app) `(app ,(nth 1 pat) ,(pcase--macroexpand (nth 2 pat))))
(t
(let* ((expander (pcase--get-macroexpander head))
@ -888,18 +886,9 @@ Otherwise, it defers to REST which is a list of branches of the form
(if (not (assq upat vars))
(pcase--u1 matches code (cons (cons upat sym) vars) rest)
;; Non-linear pattern. Turn it into an `eq' test.
(pcase--u1 (cons `(match ,sym . (pred (eq ,(cdr (assq upat vars)))))
(pcase--u1 (cons `(match ,sym . (pred (eql ,(cdr (assq upat vars)))))
matches)
code vars rest)))
((eq (car-safe upat) 'let)
;; A upat of the form (let VAR EXP).
;; (pcase--u1 matches code
;; (cons (cons (nth 1 upat) (nth 2 upat)) vars) rest)
(macroexp-let2
macroexp-copyable-p sym
(pcase--eval (nth 2 upat) vars)
(pcase--u1 (cons (pcase--match sym (nth 1 upat)) matches)
code vars rest)))
((eq (car-safe upat) 'app)
;; A upat of the form (app FUN PAT)
(pcase--mark-used sym)
@ -1011,5 +1000,9 @@ The predicate is the logical-AND of:
;; compounded values that are not `consp'
(t (error "Unknown QPAT: %S" qpat))))
(pcase-defmacro let (pat expr)
"Matches if EXPR matches PAT."
`(app (lambda (_) ,expr) ,pat))
(provide 'pcase)
;;; pcase.el ends here

View File

@ -127,8 +127,9 @@ Also add the value to the front of the list in the variable `values'."
(interactive
(list (read--expression "Eval: ")))
(message "Evaluating...")
(push (eval expression lexical-binding) values)
(pp-display-expression (car values) "*Pp Eval Output*"))
(let ((result (eval expression lexical-binding)))
(values--store-value result)
(pp-display-expression result "*Pp Eval Output*")))
;;;###autoload
(defun pp-macroexpand-expression (expression)

View File

@ -187,14 +187,14 @@ Set it to nil if you don't want limits here."
(defvar reb-target-window nil
"Window to which the RE is applied to.")
(defvar reb-regexp nil
(defvar-local reb-regexp nil
"Last regexp used by RE Builder.")
(defvar reb-regexp-src nil
(defvar-local reb-regexp-src nil
"Last regexp used by RE Builder before processing it.
Except for Lisp syntax this is the same as `reb-regexp'.")
(defvar reb-overlays nil
(defvar-local reb-overlays nil
"List of overlays of the RE Builder.")
(defvar reb-window-config nil
@ -212,10 +212,6 @@ Except for Lisp syntax this is the same as `reb-regexp'.")
(defvar reb-valid-string ""
"String in mode line showing validity of RE.")
(make-variable-buffer-local 'reb-overlays)
(make-variable-buffer-local 'reb-regexp)
(make-variable-buffer-local 'reb-regexp-src)
(defconst reb-buffer "*RE-Builder*"
"Buffer to use for the RE Builder.")

Some files were not shown because too many files have changed in this diff Show More