summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog.152
-rw-r--r--lisp/comint.el7
-rw-r--r--lisp/emacs-lisp/lisp-mode.el6
-rw-r--r--lisp/emacs-lisp/package.el1
-rw-r--r--lisp/face-remap.el29
-rw-r--r--lisp/ffap.el4
-rw-r--r--lisp/net/tramp-sh.el1
-rw-r--r--lisp/play/studly.el8
-rw-r--r--lisp/progmodes/compile.el8
-rw-r--r--lisp/progmodes/grep.el48
-rw-r--r--lisp/progmodes/prolog.el16
-rw-r--r--lisp/rect.el5
-rw-r--r--lisp/subr.el7
-rw-r--r--lisp/vc/vc-git.el66
-rw-r--r--lisp/vc/vc-hooks.el18
15 files changed, 153 insertions, 73 deletions
diff --git a/lisp/ChangeLog.15 b/lisp/ChangeLog.15
index 88f5487ca74..46fa01acc5e 100644
--- a/lisp/ChangeLog.15
+++ b/lisp/ChangeLog.15
@@ -5820,7 +5820,7 @@
* epa.el (epa-passphrase-callback-function): Say what we're
querying the password for.
- * ibuffer.el (ibuffer-visit-buffer): To mimick list-buffers
+ * ibuffer.el (ibuffer-visit-buffer): To mimic list-buffers
behavior, don't bury the ibuffer buffer when visiting other buffers.
2010-10-08 Chong Yidong <cyd@stupidchicken.com>
diff --git a/lisp/comint.el b/lisp/comint.el
index cb79c175f0e..dcd4a5ae4cf 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -816,13 +816,6 @@ series of processes in the same Comint buffer. The hook
(format "COLUMNS=%d" (window-width)))
(list "TERM=emacs"
(format "TERMCAP=emacs:co#%d:tc=unknown:" (window-width))))
-
- ;; This hack is for backward compatibility with Bash 4.3 and
- ;; earlier. It can break common uses of 'configure', so
- ;; remove it once Bash 4.4 or later is common.
- (unless (getenv "EMACS")
- (list "EMACS=t"))
-
(list (format "INSIDE_EMACS=%s,comint" emacs-version))
process-environment))
(default-directory
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index b4bb3b0acce..74aebc0a66a 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -398,6 +398,9 @@ This will generate compile-time constants from BINDINGS."
lisp-el-font-lock-keywords-1
`( ;; Regexp negated char group.
("\\[\\(\\^\\)" 1 font-lock-negation-char-face prepend)
+ ;; Erroneous structures.
+ (,(concat "(" el-errs-re "\\_>")
+ (1 font-lock-warning-face))
;; Control structures. Common Lisp forms.
(lisp--el-match-keyword . 1)
;; Exit/Feature symbols as constants.
@@ -405,9 +408,6 @@ This will generate compile-time constants from BINDINGS."
"[ \t']*\\(" lisp-mode-symbol-regexp "\\)?")
(1 font-lock-keyword-face)
(2 font-lock-constant-face nil t))
- ;; Erroneous structures.
- (,(concat "(" el-errs-re "\\_>")
- (1 font-lock-warning-face prepend))
;; Words inside \\[] tend to be for `substitute-command-keys'.
(,(concat "\\\\\\\\\\[\\(" lisp-mode-symbol-regexp "\\)\\]")
(1 font-lock-constant-face prepend))
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 4da66d2fabf..d5d35d78b83 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -146,6 +146,7 @@
(eval-when-compile (require 'subr-x))
(eval-when-compile (require 'cl-lib))
(eval-when-compile (require 'epg)) ;For setf accessors.
+(require 'seq)
(require 'tabulated-list)
(require 'macroexp)
diff --git a/lisp/face-remap.el b/lisp/face-remap.el
index 0da6be7430b..9c2cae14b38 100644
--- a/lisp/face-remap.el
+++ b/lisp/face-remap.el
@@ -256,6 +256,23 @@ disable `text-scale-mode' as necessary)."
text-scale-mode-amount))))
(force-window-update (current-buffer)))
+(defun text-scale-min-amount ()
+ "Return the minimum amount of text-scaling we allow."
+ ;; When the resulting pixel-height of characters will become smaller
+ ;; than 1 pixel, we can expect trouble from the display engine.
+ ;; E.g., it requires that the character glyph's ascent is
+ ;; non-negative.
+ (log (/ 1.0 (frame-char-height)) text-scale-mode-step))
+
+(defun text-scale-max-amount ()
+ "Return the maximum amount of text-scaling we allow."
+ ;; The display engine uses a 16-bit short for pixel-width of
+ ;; characters, thus the 0xffff limitation. It also makes no sense
+ ;; to have characters wider than the display.
+ (log (/ (min (display-pixel-width) #xffff)
+ (frame-char-width))
+ text-scale-mode-step))
+
;;;###autoload
(defun text-scale-set (level)
"Set the scale factor of the default face in the current buffer to LEVEL.
@@ -266,7 +283,8 @@ Each step scales the height of the default face by the variable
`text-scale-mode-step' (a negative number decreases the height by
the same amount)."
(interactive "p")
- (setq text-scale-mode-amount level)
+ (setq text-scale-mode-amount
+ (max (min level (text-scale-max-amount)) (text-scale-min-amount)))
(text-scale-mode (if (zerop text-scale-mode-amount) -1 1)))
;;;###autoload
@@ -279,8 +297,13 @@ Each step scales the height of the default face by the variable
height by the same amount). As a special case, an argument of 0
will remove any scaling currently active."
(interactive "p")
- (setq text-scale-mode-amount
- (if (= inc 0) 0 (+ (if text-scale-mode text-scale-mode-amount 0) inc)))
+ (let* ((current-value (if text-scale-mode text-scale-mode-amount 0))
+ (new-value (if (= inc 0) 0 (+ current-value inc))))
+ (if (or (> new-value (text-scale-max-amount))
+ (< new-value (text-scale-min-amount)))
+ (user-error "Cannot %s the default face height more than it already is"
+ (if (> inc 0) "increase" "decrease")))
+ (setq text-scale-mode-amount new-value))
(text-scale-mode (if (zerop text-scale-mode-amount) -1 1)))
;;;###autoload
diff --git a/lisp/ffap.el b/lisp/ffap.el
index abf979f6129..7013e6e8ba4 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -1966,7 +1966,9 @@ Only intended for interactive use."
(defun ffap-guess-file-name-at-point ()
"Try to get a file name at point.
This hook is intended to be put in `file-name-at-point-functions'."
- (let ((guess (ffap-guesser)))
+ ;; ffap-guesser can signal an error, and we don't want that when,
+ ;; e.g., the user types M-n at the "C-x C-f" prompt.
+ (let ((guess (ignore-errors (ffap-guesser))))
(when (stringp guess)
(let ((url (ffap-url-p guess)))
(or url
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 2667aaff0db..b2293a2b014 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -542,7 +542,6 @@ as given in your `~/.profile'."
(defcustom tramp-remote-process-environment
`("TMOUT=0" "LC_CTYPE=''"
,(format "TERM=%s" tramp-terminal-type)
- "EMACS=t" ;; Deprecated; remove this line once Bash 4.4-or-later is common.
,(format "INSIDE_EMACS='%s,tramp:%s'" emacs-version tramp-version)
"CDPATH=" "HISTORY=" "MAIL=" "MAILCHECK=" "MAILPATH=" "PAGER=cat"
"autocorrect=" "correct=")
diff --git a/lisp/play/studly.el b/lisp/play/studly.el
index f6aae4548b1..ff1bf03e118 100644
--- a/lisp/play/studly.el
+++ b/lisp/play/studly.el
@@ -25,10 +25,10 @@
(setq begin (point))
(while (and (<= (point) end)
(not (looking-at "\\W*\\'")))
- (forward-word 1)
- (backward-word 1)
+ (forward-word-strictly 1)
+ (backward-word-strictly 1)
(setq begin (max (point) begin))
- (forward-word 1)
+ (forward-word-strictly 1)
(let ((offset 0)
(word-end (min (point) end))
c)
@@ -55,7 +55,7 @@
"Studlify-case the current word, or COUNT words if given an argument."
(interactive "*p")
(let ((begin (point)) end rb re)
- (forward-word count)
+ (forward-word-strictly count)
(setq end (point))
(setq rb (min begin end) re (max begin end))
(studlify-region rb re)))
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 0b15a283090..b7ab408f744 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1702,14 +1702,6 @@ Returns the compilation buffer created."
(list "TERM=emacs"
(format "TERMCAP=emacs:co#%d:tc=unknown:"
(window-width))))
-
- ;; Set the EMACS variable, but
- ;; don't override users' setting of $EMACS.
- ;; Remove this hack once Bash 4.4-or-later is common,
- ;; since it can break 'configure'.
- (unless (getenv "EMACS")
- (list "EMACS=t"))
-
(list (format "INSIDE_EMACS=%s,compile" emacs-version))
(copy-sequence process-environment))))
(set (make-local-variable 'compilation-arguments)
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 2b44b58f245..a478c95eb4f 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -427,21 +427,34 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies
This gets tacked on the end of the generated expressions.")
;;;###autoload
-(defvar grep-program (purecopy "grep")
+(defcustom grep-program (purecopy "grep")
"The default grep program for `grep-command' and `grep-find-command'.
-This variable's value takes effect when `grep-compute-defaults' is called.")
+This variable's value takes effect when `grep-compute-defaults' is called."
+ :type 'string
+ :version "25.1"
+ :group 'grep)
;;;###autoload
-(defvar find-program (purecopy "find")
+(defcustom grep-find-program (purecopy "find")
"The default find program.
This is used by commands like `grep-find-command', `find-dired'
-and others.")
+and others."
+ :type 'string
+ :version "25.1"
+ :group 'grep)
+
+(define-obsolete-variable-alias 'find-program 'grep-find-program "25.1")
;;;###autoload
-(defvar xargs-program (purecopy "xargs")
+(defcustom grep-xargs-program (purecopy "xargs")
"The default xargs program for `grep-find-command'.
See `grep-find-use-xargs'.
-This variable's value takes effect when `grep-compute-defaults' is called.")
+This variable's value takes effect when `grep-compute-defaults' is called."
+ :type 'string
+ :version "25.1"
+ :group 'grep)
+
+(define-obsolete-variable-alias 'xargs-program 'grep-xargs-program "25.1")
;;;###autoload
(defvar grep-find-use-xargs nil
@@ -611,13 +624,14 @@ This function is called from `compilation-filter-hook'."
(unless grep-find-use-xargs
(setq grep-find-use-xargs
(cond
- ((grep-probe find-program
+ ((grep-probe grep-find-program
`(nil nil nil ,null-device "-exec" "echo"
"{}" "+"))
'exec-plus)
((and
- (grep-probe find-program `(nil nil nil ,null-device "-print0"))
- (grep-probe xargs-program `(nil nil nil "-0" "echo")))
+ (grep-probe grep-find-program
+ `(nil nil nil ,null-device "-print0"))
+ (grep-probe grep-xargs-program `(nil nil nil "-0" "echo")))
'gnu)
(t
'exec))))
@@ -628,10 +642,11 @@ This function is called from `compilation-filter-hook'."
;; after the pipe symbol be quoted if they use
;; forward slashes as directory separators.
(format "%s . -type f -print0 | \"%s\" -0 %s"
- find-program xargs-program grep-command))
+ grep-find-program grep-xargs-program
+ grep-command))
((memq grep-find-use-xargs '(exec exec-plus))
(let ((cmd0 (format "%s . -type f -exec %s"
- find-program grep-command))
+ grep-find-program grep-command))
(null (if grep-use-null-device
(format "%s " null-device)
"")))
@@ -643,7 +658,8 @@ This function is called from `compilation-filter-hook'."
(1+ (length cmd0)))))
(t
(format "%s . -type f -print | \"%s\" %s"
- find-program xargs-program grep-command)))))
+ grep-find-program grep-xargs-program
+ grep-command)))))
(unless grep-find-template
(setq grep-find-template
(let ((gcmd (format "%s <C> %s <R>"
@@ -653,17 +669,17 @@ This function is called from `compilation-filter-hook'."
"")))
(cond ((eq grep-find-use-xargs 'gnu)
(format "%s <D> <X> -type f <F> -print0 | \"%s\" -0 %s"
- find-program xargs-program gcmd))
+ grep-find-program grep-xargs-program gcmd))
((eq grep-find-use-xargs 'exec)
(format "%s <D> <X> -type f <F> -exec %s {} %s%s"
- find-program gcmd null
+ grep-find-program gcmd null
(shell-quote-argument ";")))
((eq grep-find-use-xargs 'exec-plus)
(format "%s <D> <X> -type f <F> -exec %s %s{} +"
- find-program gcmd null))
+ grep-find-program gcmd null))
(t
(format "%s <D> <X> -type f <F> -print | \"%s\" %s"
- find-program xargs-program gcmd))))))))
+ grep-find-program grep-xargs-program gcmd))))))))
;; Save defaults for this host.
(setq grep-host-defaults-alist
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index 9ee405b31e1..212a5fa69ab 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -1374,8 +1374,20 @@ the variable `prolog-prompt-regexp'."
()
(with-current-buffer (get-buffer-create "*prolog*")
(prolog-inferior-mode)
- (apply 'make-comint-in-buffer "prolog" (current-buffer)
- (prolog-program-name) nil (prolog-program-switches))
+
+ ;; The "INFERIOR=yes" hack is for SWI-Prolog 7.2.3 and earlier,
+ ;; which assumes it is running under Emacs if either INFERIOR=yes or
+ ;; if EMACS is set to a nonempty value. The EMACS setting is
+ ;; obsolescent, so set INFERIOR. Newer versions of SWI-Prolog should
+ ;; know about INSIDE_EMACS (which replaced EMACS) and should not need
+ ;; this hack.
+ (let ((process-environment
+ (if (getenv "INFERIOR")
+ process-environment
+ (cons "INFERIOR=yes" process-environment))))
+ (apply 'make-comint-in-buffer "prolog" (current-buffer)
+ (prolog-program-name) nil (prolog-program-switches)))
+
(unless prolog-system
;; Setup auto-detection.
(setq-local
diff --git a/lisp/rect.el b/lisp/rect.el
index 73790f2f92a..685213a0635 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -398,8 +398,9 @@ With a prefix (or a FILL) argument, also fill too short lines."
(defun rectangle--space-to (col)
(propertize " " 'display `(space :align-to ,col)))
-(defface rectangle-preview-face '((t :inherit region))
- "The face to use for the `string-rectangle' preview.")
+(defface rectangle-preview '((t :inherit region))
+ "The face to use for the `string-rectangle' preview."
+ :version "25.1")
(defcustom rectangle-preview t
"If non-nil, `string-rectangle' will show an-the-fly preview."
diff --git a/lisp/subr.el b/lisp/subr.el
index a6d6fa44ca1..2dfd96edc07 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2087,6 +2087,10 @@ some sort of escape sequence, the ambiguity is resolved via `read-key-delay'."
(aref keys 1)
key)))
(cancel-timer timer)
+ ;; For some reason, `read-key(-sequence)' leaves the prompt in the echo
+ ;; area, whereas `read-event' seems to empty it just before returning
+ ;; (bug#22714). So, let's mimic the behavior of `read-event'.
+ (message nil)
(use-global-map old-global-map))))
(defvar read-passwd-map
@@ -4107,7 +4111,8 @@ This function makes or adds to an entry on `after-load-alist'."
(defmacro with-eval-after-load (file &rest body)
"Execute BODY after FILE is loaded.
FILE is normally a feature name, but it can also be a file name,
-in case that file does not provide any feature."
+in case that file does not provide any feature. See `eval-after-load'
+for more details about the different forms of FILE and their semantics."
(declare (indent 1) (debug t))
`(eval-after-load ,file (lambda () ,@body)))
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index f2466d86493..2fd84f102f8 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -165,8 +165,20 @@ matching the resulting Git log output, and KEYWORDS is a list of
:type '(list string string (repeat sexp))
:version "24.1")
-(defvar vc-git-commits-coding-system 'utf-8
- "Default coding system for git commits.")
+(defcustom vc-git-commits-coding-system 'utf-8
+ "Default coding system for sending commit log messages to Git.
+
+Should be consistent with the Git config value i18n.commitEncoding,
+and should also be consistent with `locale-coding-system'."
+ :type '(coding-system :tag "Coding system to encode Git commit logs")
+ :version "25.1")
+
+(defcustom vc-git-log-output-coding-system 'utf-8
+ "Default coding system for receiving log output from Git.
+
+Should be consistent with the Git config value i18n.logOutputEncoding."
+ :type '(coding-system :tag "Coding system to decode Git log output")
+ :version "25.1")
;; History of Git commands.
(defvar vc-git-history nil)
@@ -680,21 +692,43 @@ It is based on `log-edit-mode', and has Git-specific extensions.")
(default-directory (expand-file-name root))
(only (or (cdr files)
(not (equal root (abbreviate-file-name file1)))))
- (coding-system-for-write vc-git-commits-coding-system))
+ (pcsw coding-system-for-write)
+ (coding-system-for-write
+ ;; On MS-Windows, we must encode command-line arguments in
+ ;; the system codepage.
+ (if (eq system-type 'windows-nt)
+ locale-coding-system
+ (or coding-system-for-write vc-git-commits-coding-system)))
+ (msg-file
+ ;; On MS-Windows, pass the commit log message through a
+ ;; file, to work around the limitation that command-line
+ ;; arguments must be in the system codepage, and therefore
+ ;; might not support the non-ASCII characters in the log
+ ;; message.
+ (if (eq system-type 'windows-nt) (make-temp-file "git-msg"))))
(cl-flet ((boolean-arg-fn
(argument)
(lambda (value) (when (equal value "yes") (list argument)))))
;; When operating on the whole tree, better pass "-a" than ".", since "."
;; fails when we're committing a merge.
(apply 'vc-git-command nil 0 (if only files)
- (nconc (list "commit" "-m")
- (log-edit-extract-headers
- `(("Author" . "--author")
- ("Date" . "--date")
- ("Amend" . ,(boolean-arg-fn "--amend"))
- ("Sign-Off" . ,(boolean-arg-fn "--signoff")))
- comment)
- (if only (list "--only" "--") '("-a")))))))
+ (nconc (if msg-file (list "commit" "-F" msg-file)
+ (list "commit" "-m"))
+ (let ((args
+ (log-edit-extract-headers
+ `(("Author" . "--author")
+ ("Date" . "--date")
+ ("Amend" . ,(boolean-arg-fn "--amend"))
+ ("Sign-Off" . ,(boolean-arg-fn "--signoff")))
+ comment)))
+ (when msg-file
+ (let ((coding-system-for-write
+ (or pcsw vc-git-commits-coding-system)))
+ (write-region (car args) nil msg-file))
+ (setq args (cdr args)))
+ args)
+ (if only (list "--only" "--") '("-a")))))
+ (if (and msg-file (file-exists-p msg-file)) (delete-file msg-file))))
(defun vc-git-find-revision (file rev buffer)
(let* (process-file-side-effects
@@ -854,7 +888,7 @@ If SHORTLOG is non-nil, use a short format based on `vc-git-root-log-format'.
If START-REVISION is non-nil, it is the newest revision to show.
If LIMIT is non-nil, show no more than this many entries."
(let ((coding-system-for-read
- (or coding-system-for-read vc-git-commits-coding-system)))
+ (or coding-system-for-read vc-git-log-output-coding-system)))
;; `vc-do-command' creates the buffer, but we need it before running
;; the command.
(vc-setup-buffer buffer)
@@ -1389,7 +1423,7 @@ This command shares argument histories with \\[rgrep] and \\[grep]."
The difference to vc-do-command is that this function always invokes
`vc-git-program'."
(let ((coding-system-for-read
- (or coding-system-for-read vc-git-commits-coding-system))
+ (or coding-system-for-read vc-git-log-output-coding-system))
(coding-system-for-write
(or coding-system-for-write vc-git-commits-coding-system)))
(apply 'vc-do-command (or buffer "*vc*") okstatus vc-git-program
@@ -1414,8 +1448,10 @@ The difference to vc-do-command is that this function always invokes
;; directories. We enable `inhibit-null-byte-detection', otherwise
;; Tramp's eol conversion might be confused.
(let ((inhibit-null-byte-detection t)
- (coding-system-for-read vc-git-commits-coding-system)
- (coding-system-for-write vc-git-commits-coding-system)
+ (coding-system-for-read
+ (or coding-system-for-read vc-git-log-output-coding-system))
+ (coding-system-for-write
+ (or coding-system-for-write vc-git-commits-coding-system))
(process-environment (cons "PAGER=" process-environment)))
(apply 'process-file vc-git-program nil buffer nil command args)))
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el
index 97ccec84550..4c0161d7978 100644
--- a/lisp/vc/vc-hooks.el
+++ b/lisp/vc/vc-hooks.el
@@ -40,7 +40,7 @@
:group 'mode-line
:version "25.1")
-(defface vc-state-base-face
+(defface vc-state-base
'((default))
"Base face for VC state indicator."
:group 'vc-faces
@@ -48,49 +48,49 @@
:version "25.1")
(defface vc-up-to-date-state
- '((default :inherit vc-state-base-face))
+ '((default :inherit vc-state-base))
"Face for VC modeline state when the file is up to date."
:version "25.1"
:group 'vc-faces)
(defface vc-needs-update-state
- '((default :inherit vc-state-base-face))
+ '((default :inherit vc-state-base))
"Face for VC modeline state when the file needs update."
:version "25.1"
:group 'vc-faces)
(defface vc-locked-state
- '((default :inherit vc-state-base-face))
+ '((default :inherit vc-state-base))
"Face for VC modeline state when the file locked."
:version "25.1"
:group 'vc-faces)
(defface vc-locally-added-state
- '((default :inherit vc-state-base-face))
+ '((default :inherit vc-state-base))
"Face for VC modeline state when the file is locally added."
:version "25.1"
:group 'vc-faces)
(defface vc-conflict-state
- '((default :inherit vc-state-base-face))
+ '((default :inherit vc-state-base))
"Face for VC modeline state when the file contains merge conflicts."
:version "25.1"
:group 'vc-faces)
(defface vc-removed-state
- '((default :inherit vc-state-base-face))
+ '((default :inherit vc-state-base))
"Face for VC modeline state when the file was removed from the VC system."
:version "25.1"
:group 'vc-faces)
(defface vc-missing-state
- '((default :inherit vc-state-base-face))
+ '((default :inherit vc-state-base))
"Face for VC modeline state when the file is missing from the file system."
:version "25.1"
:group 'vc-faces)
(defface vc-edited-state
- '((default :inherit vc-state-base-face))
+ '((default :inherit vc-state-base))
"Face for VC modeline state when the file is edited."
:version "25.1"
:group 'vc-faces)