summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2016-02-03 23:56:08 -0800
committerJohn Wiegley <johnw@newartisans.com>2016-02-03 23:56:08 -0800
commit0608bf1c3d91196bcf06a6da96243f0fac119089 (patch)
treed79a6c43cd10c681445b75f859545c9f88e41899 /lisp
parent91ab66201cedbcd2e4e8533a7152f6736ad08731 (diff)
parentee7399792f865905d393df05c3d4e5ec309aa06c (diff)
downloademacs-0608bf1c3d91196bcf06a6da96243f0fac119089.tar.gz
Merge from origin/emacs-25
ee73997 Make erc work better when encountering unknown prefix chars b99141d Make erc completion case-insensitive again 66c4620 Make complection in erc use consistent casing 8c562b2 Make /QUIT in erc more robust d93d2c5 Make tracking faces in Emacs work more reliably af6ab7e Make shr not bug out on images on non-graphical displays 3311f40 Fix bookmark display widths d90ab1e Fix typo in eww-make-unique-file-name 7f81825 Make it possible to TAB to input fields a43a1dc Insert complete alt texts when images are disabled 56ed4e1 Allow eww text fields to grow 66b315c Make erc work when subword-mode is switched on 255b68f Fix IMAP doc example 91557f5 Quoting fixes in doc strings and diagnostics 2c0dc9f Fix warning message in hack-local-variables 504696d Etags: yet another improvement in Ruby tags 8784ebf Fix x-popup-menu on TTYs without a mouse 8b87ecb * lisp/emacs-lisp/map.el: Improvements to the docstring of the pcase macro 6191003 Use pop-to-buffer-same-window in eww fe321fd * autogen.sh: Revert all recent changes. 74ebd4a * make-dist: Updates related to nt/. 737193a * make-dist: Add modules/. 3696bf2 * make-dist: Update for super-special file that can't live in etc/. a4278e2 Fix failure to compile ns-win.el in parallel builds 860da4d Fix names of tags generated for Ruby accessors f6213ce Fix file-name recognition in 'etags' e42e662 Change Ruby file names and extensions recognized by 'etags' 58bfb6a More improvements for Ruby support in 'etags' c04e911 Add --git-config option to autogen.sh 5713466 Fix editing undo changes in eww fields 51362d6 Allow the user more control of popping up the eww window ee0fbd8 Make eww-browse-url with new-window parameter work again 9c3142d Clean up eww code slightly cb035f3 Don't insert nil faces in shr 4c3fae3 ; * lisp/progmodes/prolog.el: Remove some obsolete commentary. 93f2153 Improve the custom type of some user options. 9f60d7e Mark some risky calendar variables. 1d07dcd Highlight two additional SCSS keywords ee8b466 Recommend enabling integrity-checking in git e639e10 Some corrections in Elisp manual d766ca8 Chatter when autogen.sh changes Git configuration 3b734e1 * org/org-compat.el (org-font-lock-ensure): Fix bogus test (bug#22399) 43cb9f8 Omit unnecessary history from Lisp intro 2fbd1da * etc/HISTORY: Add some more history, plus git tags. c90e1b4 Improve elisp “Security Considerations” doc cedd7ca autogen.sh now arranges for git to check hashes 86ce76b ; Fix ChangeLog.2 commit ID. 7b1d2b1 Fix (c & 040) typo in emergency escapes a8273da Fix display of overlay strings with 'display' and 'box' property fc48106 Fix imap-starttls-open cdecbed Fix return value of imap-starttls-open 20c7e34 ; * etc/NEWS: Fix renamed command name 98bdbdb Correct reference to DARWIN_OS preprocessor symbol b250d29 Spelling fix b920a0e Spelling fixes 93b144b Pacify GCC on C library without glibc API
Diffstat (limited to 'lisp')
-rw-r--r--lisp/autoinsert.el12
-rw-r--r--lisp/calendar/cal-china.el6
-rw-r--r--lisp/calendar/calendar.el4
-rw-r--r--lisp/calendar/diary-lib.el2
-rw-r--r--lisp/calendar/solar.el2
-rw-r--r--lisp/emacs-lisp/bytecomp.el8
-rw-r--r--lisp/emacs-lisp/map.el17
-rw-r--r--lisp/emacs-lisp/pcase.el6
-rw-r--r--lisp/erc/erc-backend.el28
-rw-r--r--lisp/erc/erc-button.el16
-rw-r--r--lisp/erc/erc-pcomplete.el8
-rw-r--r--lisp/erc/erc-track.el3
-rw-r--r--lisp/erc/erc.el21
-rw-r--r--lisp/files.el6
-rw-r--r--lisp/gnus/gnus-art.el2
-rw-r--r--lisp/gnus/gnus-gravatar.el2
-rw-r--r--lisp/gnus/gnus-picon.el2
-rw-r--r--lisp/gnus/mml-smime.el4
-rw-r--r--lisp/net/eww.el70
-rw-r--r--lisp/net/imap.el18
-rw-r--r--lisp/net/shr.el29
-rw-r--r--lisp/org/org-compat.el4
-rw-r--r--lisp/progmodes/prolog.el79
-rw-r--r--lisp/replace.el2
-rw-r--r--lisp/ses.el6
-rw-r--r--lisp/textmodes/css-mode.el12
-rw-r--r--lisp/xwidget.el8
27 files changed, 226 insertions, 151 deletions
diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el
index e5dd62ff4d8..43fa31288e6 100644
--- a/lisp/autoinsert.el
+++ b/lisp/autoinsert.el
@@ -305,7 +305,17 @@ ACTION may be a skeleton to insert (see `skeleton-insert'), an absolute
file-name or one relative to `auto-insert-directory' or a function to call.
ACTION may also be a vector containing several successive single actions as
described above, e.g. [\"header.insert\" date-and-author-update]."
- :type 'sexp
+ :type '(alist :key-type
+ (choice (regexp :tag "Regexp matching file name")
+ (symbol :tag "Major mode")
+ (cons :tag "Condition and description"
+ (choice :tag "Condition"
+ (regexp :tag "Regexp matching file name")
+ (symbol :tag "Major mode"))
+ (string :tag "Description")))
+ ;; There's no custom equivalent of "repeat" for vectors.
+ :value-type (choice file function
+ (sexp :tag "Skeleton or vector")))
:version "25.1"
:group 'auto-insert)
diff --git a/lisp/calendar/cal-china.el b/lisp/calendar/cal-china.el
index cfddd6b6953..661a8185bf4 100644
--- a/lisp/calendar/cal-china.el
+++ b/lisp/calendar/cal-china.el
@@ -71,9 +71,6 @@ Default is for Beijing. This is an expression in `year' since it changed at
;; It gets eval'd.
;;;###autoload
(put 'calendar-chinese-time-zone 'risky-local-variable t)
-;;;###autoload
-(put 'chinese-calendar-time-zone 'risky-local-variable t)
-
;; FIXME unused.
(defcustom calendar-chinese-location-name "Beijing"
@@ -98,6 +95,7 @@ Default is for no daylight saving time."
This is an expression depending on `year' because it changed
at 1928-01-01 00:00:00 from `PMT' to `CST'."
:type 'sexp
+ :risky t
:group 'calendar-chinese)
(defcustom calendar-chinese-daylight-time-zone-name "CDT"
@@ -115,6 +113,7 @@ at 1928-01-01 00:00:00 from `PMT' to `CST'."
Default is for no daylight saving time. See documentation of
`calendar-daylight-savings-starts'."
:type 'sexp
+ :risky t
:group 'calendar-chinese)
(defcustom calendar-chinese-daylight-saving-end nil
@@ -125,6 +124,7 @@ Default is for no daylight saving time. See documentation of
Default is for no daylight saving time. See documentation of
`calendar-daylight-savings-ends'."
:type 'sexp
+ :risky t
:group 'calendar-chinese)
(defcustom calendar-chinese-daylight-saving-start-time 0
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index 5dec3eca52d..ccdae484fa6 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -850,6 +850,7 @@ For examples of three common styles, see `diary-american-date-forms',
Normally you should not customize this, but `calendar-date-display-form'
\(which see)."
:type 'sexp
+ :risky t
:version "23.1"
:group 'calendar)
@@ -859,6 +860,7 @@ Normally you should not customize this, but `calendar-date-display-form'
Normally you should not customize this, but `calendar-date-display-form'
\(which see)."
:type 'sexp
+ :risky t
:group 'calendar)
(defcustom calendar-american-date-display-form
@@ -867,6 +869,7 @@ Normally you should not customize this, but `calendar-date-display-form'
Normally you should not customize this, but `calendar-date-display-form'
\(which see)."
:type 'sexp
+ :risky t
:group 'calendar)
(defcustom calendar-date-display-form
@@ -892,6 +895,7 @@ would give the usual American style in fixed-length fields. The variables
`calendar-american-date-display-form' provide some defaults for three common
styles."
:type 'sexp
+ :risky t
:set-after '(calendar-date-style calendar-iso-date-display-form
calendar-european-date-display-form
calendar-american-date-display-form)
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index 0523d8355b3..9ba4e358e38 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -296,6 +296,7 @@ Used by the function `diary-remind', a pseudo-pattern is a list of
expressions that can involve the keywords `days' (a number), `date'
\(a list of month, day, year), and `diary-entry' (a string)."
:type 'sexp
+ :risky t
:group 'diary)
(defcustom diary-abbreviated-year-flag t
@@ -412,6 +413,7 @@ The format of the header is specified by `diary-header-line-format'."
Only used if `diary-header-line-flag' is non-nil."
:group 'diary
:type 'sexp
+ :risky t
:initialize 'custom-initialize-default
:set 'diary-set-header
:version "23.3") ; frame-width -> window-width
diff --git a/lisp/calendar/solar.el b/lisp/calendar/solar.el
index 2ce76d5da2f..bf8bedd599e 100644
--- a/lisp/calendar/solar.el
+++ b/lisp/calendar/solar.el
@@ -70,6 +70,7 @@ For example, the form
would give military-style times like \"21:07 (UTC)\"."
:type 'sexp
+ :risky t
:group 'calendar)
(defcustom calendar-latitude nil
@@ -131,6 +132,7 @@ variable `calendar-latitude' paired with the variable `calendar-longitude'.
This variable should be set in `site-start'.el."
:type 'sexp
+ :risky t
:group 'calendar)
(defcustom solar-error 0.5
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 9fe6e036fbd..11eb44cea31 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1169,7 +1169,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
(display-warning 'bytecomp string level byte-compile-log-buffer)))
(defun byte-compile-warn (format &rest args)
- "Issue a byte compiler warning; use (format FORMAT ARGS...) for message."
+ "Issue a byte compiler warning; use (format-message FORMAT ARGS...) for message."
(setq format (apply #'format-message format args))
(if byte-compile-error-on-warn
(error "%s" format) ; byte-compile-file catches and logs it
@@ -3748,7 +3748,8 @@ discarding."
(if (= (logand len 1) 1)
(progn
(byte-compile-log-warning
- (format "missing value for `%S' at end of setq" (car (last args)))
+ (format-message
+ "missing value for `%S' at end of setq" (car (last args)))
nil :error)
(byte-compile-form
`(signal 'wrong-number-of-arguments '(setq ,len))
@@ -4019,7 +4020,8 @@ that suppresses all warnings during execution of BODY."
(progn
(mapc 'byte-compile-form (cdr form))
(byte-compile-out 'byte-call (length (cdr (cdr form)))))
- (byte-compile-log-warning "`funcall' called with no arguments" nil :error)
+ (byte-compile-log-warning
+ (format-message "`funcall' called with no arguments") nil :error)
(byte-compile-form '(signal 'wrong-number-of-arguments '(funcall 0))
byte-compile--for-effect)))
diff --git a/lisp/emacs-lisp/map.el b/lisp/emacs-lisp/map.el
index ebef27185ae..ec8d3d79d9f 100644
--- a/lisp/emacs-lisp/map.el
+++ b/lisp/emacs-lisp/map.el
@@ -47,17 +47,18 @@
(pcase-defmacro map (&rest args)
"Build a `pcase' pattern matching map elements.
-The `pcase' pattern will match each element of PATTERN against
-the corresponding elements of the map.
+ARGS is a list of elements to be matched in the map.
-Extra elements of the map are ignored if fewer ARGS are
-given, and the match does not fail.
+Each element of ARGS can be of the form (KEY PAT), in which case KEY is
+evaluated and searched for in the map. The match fails if for any KEY
+found in the map, the corresponding PAT doesn't match the value
+associated to the KEY.
-ARGS can be a list of the form (KEY PAT), in which case KEY in an
-unquoted form.
+Each element can also be a SYMBOL, which is an abbreviation of a (KEY
+PAT) tuple of the form (\\='SYMBOL SYMBOL).
-ARGS can also be a list of symbols, which stands for ('SYMBOL
-SYMBOL)."
+Keys in ARGS not found in the map are ignored, and the match doesn't
+fail."
`(and (pred mapp)
,@(map--make-pcase-bindings args)))
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index 7be997e6469..7e164c0fe5c 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -111,7 +111,7 @@
CASES is a list of elements of the form (PATTERN CODE...).
A structural PATTERN describes a template that identifies a class
-of values. For example, the pattern `(,foo ,bar) matches any
+of values. For example, the pattern \\=`(,foo ,bar) matches any
two element list, binding its elements to symbols named `foo' and
`bar' -- in much the same way that `cl-destructuring-bind' would.
@@ -119,12 +119,12 @@ A significant difference from `cl-destructuring-bind' is that, if
a pattern match fails, the next case is tried until either a
successful match is found or there are no more cases.
-Another difference is that pattern elements may be backquoted,
+Another difference is that pattern elements may be quoted,
meaning they must match exactly: The pattern \\='(foo bar)
matches only against two element lists containing the symbols
`foo' and `bar' in that order. (As a short-hand, atoms always
match themselves, such as numbers or strings, and need not be
-quoted).
+quoted.)
Lastly, a pattern can be logical, such as (pred numberp), that
matches any number-like element; or the symbol `_', that matches
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index 4a2a12dd403..b413ee5a547 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -474,13 +474,39 @@ Currently this is called by `erc-send-input'."
nil t))
(split-string (buffer-string) "\n"))))
+(defun erc-forward-word ()
+ "Moves forward one word, ignoring any subword settings. If no
+subword-mode is active, then this is (forward-word)."
+ (skip-syntax-forward "^w")
+ (> (skip-syntax-forward "w") 0))
+
+(defun erc-word-at-arg-p (pos)
+ "Reports whether the char after a given POS has word syntax.
+If POS is out of range, the value is nil."
+ (let ((c (char-after pos)))
+ (if c
+ (eq ?w (char-syntax c))
+ nil)))
+
+(defun erc-bounds-of-word-at-point ()
+ "Returns the bounds of a word at point, or nil if we're not at
+a word. If no subword-mode is active, then this
+is (bounds-of-thing-at-point 'word)."
+ (if (or (erc-word-at-arg-p (point))
+ (erc-word-at-arg-p (1- (point))))
+ (save-excursion
+ (let* ((start (progn (skip-syntax-backward "w") (point)))
+ (end (progn (skip-syntax-forward "w") (point))))
+ (cons start end)))
+ nil))
+
;; Used by CTCP functions
(defun erc-upcase-first-word (str)
"Upcase the first word in STR."
(with-temp-buffer
(insert str)
(goto-char (point-min))
- (upcase-word 1)
+ (upcase-region (point) (progn (erc-forward-word) (point)))
(buffer-string)))
(defun erc-server-setup-periodical-ping (buffer)
diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el
index e1ccea90dd1..7d509196330 100644
--- a/lisp/erc/erc-button.el
+++ b/lisp/erc/erc-button.el
@@ -300,14 +300,14 @@ specified by `erc-button-alist'."
(when (or (eq t form)
(eval form))
(goto-char (point-min))
- (while (forward-word 1)
- (setq bounds (bounds-of-thing-at-point 'word))
- (setq word (buffer-substring-no-properties
- (car bounds) (cdr bounds)))
- (when (or (and (erc-server-buffer-p) (erc-get-server-user word))
- (and erc-channel-users (erc-get-channel-user word)))
- (erc-button-add-button (car bounds) (cdr bounds)
- fun t (list word)))))))
+ (while (erc-forward-word)
+ (when (setq bounds (erc-bounds-of-word-at-point))
+ (setq word (buffer-substring-no-properties
+ (car bounds) (cdr bounds)))
+ (when (or (and (erc-server-buffer-p) (erc-get-server-user word))
+ (and erc-channel-users (erc-get-channel-user word)))
+ (erc-button-add-button (car bounds) (cdr bounds)
+ fun t (list word))))))))
(defun erc-button-add-buttons-1 (regexp entry)
"Search through the buffer for matches to ENTRY and add buttons."
diff --git a/lisp/erc/erc-pcomplete.el b/lisp/erc/erc-pcomplete.el
index cf3f51ba3f6..9f572396de8 100644
--- a/lisp/erc/erc-pcomplete.el
+++ b/lisp/erc/erc-pcomplete.el
@@ -238,10 +238,12 @@ If optional argument IGNORE-SELF is non-nil, don't return the current nick."
"Returns a list of all nicks on the current server."
(let (nicks)
(erc-with-server-buffer
- (maphash (lambda (nick _user)
- (setq nicks (cons (concat nick postfix) nicks)))
+ (maphash (lambda (_nick user)
+ (setq nicks (cons
+ (concat (erc-server-user-nickname user) postfix)
+ nicks)))
erc-server-users))
- nicks))
+ nicks))
(defun pcomplete-erc-channels ()
"Returns a list of channels associated with the current server."
diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el
index 1750cb77845..4d8feb52759 100644
--- a/lisp/erc/erc-track.el
+++ b/lisp/erc/erc-track.el
@@ -971,7 +971,8 @@ is in `erc-mode'."
"Return a list of all faces used in STR."
(let ((i 0)
(m (length str))
- (faces (erc-list (get-text-property 0 'face str)))
+ (faces (let ((face1 (get-text-property 0 'face str)))
+ (when face1 (list face1))))
cur)
(while (and (setq i (next-single-property-change i 'face str m))
(not (= i m)))
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index b7f40a878a9..98ea594e164 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -1141,7 +1141,7 @@ which the local user typed."
(define-key map "\C-c\C-u" 'erc-kill-input)
(define-key map "\C-c\C-x" 'erc-quit-server)
(define-key map "\M-\t" 'ispell-complete-word)
- (define-key map "\t" 'completion-at-point)
+ (define-key map "\t" 'erc-completion-at-point)
;; Suppress `font-lock-fontify-block' key binding since it
;; destroys face properties.
@@ -3996,6 +3996,13 @@ Prompt for one if called interactively."
(format "MODE %s +k %s" tgt key)
(format "MODE %s -k" tgt)))))
+(defun erc-completion-at-point ()
+ "Perform complection on the text around point case-insentitively.
+See `completion-at-point'."
+ (interactive)
+ (let ((completion-ignore-case t))
+ (completion-at-point)))
+
(defun erc-quit-server (reason)
"Disconnect from current server after prompting for REASON.
`erc-quit-reason' works with this just like with `erc-cmd-QUIT'."
@@ -6088,13 +6095,15 @@ If it doesn't exist, create it."
(or (file-accessible-directory-p dir) (error "Cannot access %s" dir)))
(defun erc-kill-query-buffers (process)
- "Kill all buffers of PROCESS."
+ "Kill all buffers of PROCESS.
+Does nothing if PROCESS is not a process object."
;; here, we only want to match the channel buffers, to avoid
;; "selecting killed buffers" b0rkage.
- (erc-with-all-buffers-of-server process
- (lambda ()
- (not (erc-server-buffer-p)))
- (kill-buffer (current-buffer))))
+ (when (processp process)
+ (erc-with-all-buffers-of-server process
+ (lambda ()
+ (not (erc-server-buffer-p)))
+ (kill-buffer (current-buffer)))))
(defun erc-nick-at-point ()
"Give information about the nickname at `point'.
diff --git a/lisp/files.el b/lisp/files.el
index 92ae4344e1c..aca7b3593d9 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3426,7 +3426,11 @@ local variables, but directory-local variables may still be applied."
(format-message
"%s: `lexical-binding' at end of file unreliable"
(file-name-nondirectory
- (or buffer-file-name ""))))))
+ ;; We are called from
+ ;; 'with-temp-buffer', so we need
+ ;; to use 'thisbuf's name in the
+ ;; warning message.
+ (or (buffer-file-name thisbuf) ""))))))
(t
(ignore-errors
(push (cons (if (eq var 'eval)
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 54bbfd857f1..366d14aca1d 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -260,7 +260,7 @@ This can also be a list of the above values."
;; needed there. And XEmacs doesn't handle `intangible' anyway.
'(invisible t)
"Property list to use for hiding text."
- :type 'sexp
+ :type 'plist
:group 'gnus-article-hiding)
;; Fixme: This isn't the right thing for mixed graphical and non-graphical
diff --git a/lisp/gnus/gnus-gravatar.el b/lisp/gnus/gnus-gravatar.el
index deb6e4bc4c9..de7203d9d10 100644
--- a/lisp/gnus/gnus-gravatar.el
+++ b/lisp/gnus/gnus-gravatar.el
@@ -41,7 +41,7 @@ If nil, default to `gravatar-size'."
(defcustom gnus-gravatar-properties '(:ascent center :relief 1)
"List of image properties applied to Gravatar images."
- :type 'sexp
+ :type 'plist
:version "24.1"
:group 'gnus-gravatar)
diff --git a/lisp/gnus/gnus-picon.el b/lisp/gnus/gnus-picon.el
index 6365e8e2ff7..bbbe0eded4e 100644
--- a/lisp/gnus/gnus-picon.el
+++ b/lisp/gnus/gnus-picon.el
@@ -73,7 +73,7 @@ Some people may want to add \"unknown\" to this list."
(defcustom gnus-picon-properties '(:color-symbols (("None" . "white")))
"List of image properties applied to picons."
- :type 'sexp
+ :type 'plist
:version "24.3"
:group 'gnus-picon)
diff --git a/lisp/gnus/mml-smime.el b/lisp/gnus/mml-smime.el
index 2d8f25c5003..248e63682c8 100644
--- a/lisp/gnus/mml-smime.el
+++ b/lisp/gnus/mml-smime.el
@@ -216,7 +216,7 @@ Whether the passphrase is cached at all is controlled by
"")))))
(if (setq cert (smime-cert-by-dns who))
(setq result (list 'certfile (buffer-name cert)))
- (setq bad (format "`%s' not found. " who))))
+ (setq bad (gnus-format-message "`%s' not found. " who))))
(quit))
result))
@@ -235,7 +235,7 @@ Whether the passphrase is cached at all is controlled by
"")))))
(if (setq cert (smime-cert-by-ldap who))
(setq result (list 'certfile (buffer-name cert)))
- (setq bad (format "`%s' not found. " who))))
+ (setq bad (gnus-format-message "`%s' not found. " who))))
(quit))
result))
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index bc74a0d31d2..e8b8c63addb 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -275,6 +275,10 @@ word(s) will be searched for via `eww-search-prefix'."
(setq url (concat url "/"))))
(setq url (concat eww-search-prefix
(replace-regexp-in-string " " "+" url))))))
+ (pop-to-buffer-same-window
+ (if (eq major-mode 'eww-mode)
+ (current-buffer)
+ (get-buffer-create "*eww*")))
(eww-setup-buffer)
;; Check whether the domain only uses "Highly Restricted" Unicode
;; IDNA characters. If not, transform to punycode to indicate that
@@ -557,7 +561,7 @@ Currently this means either text/html or application/xhtml+xml."
(declare-function mailcap-view-mime "mailcap" (type))
(defun eww-display-pdf ()
(let ((data (buffer-substring (point) (point-max))))
- (switch-to-buffer (get-buffer-create "*eww pdf*"))
+ (pop-to-buffer-same-window (get-buffer-create "*eww pdf*"))
(let ((coding-system-for-write 'raw-text)
(inhibit-read-only t))
(erase-buffer)
@@ -566,7 +570,6 @@ Currently this means either text/html or application/xhtml+xml."
(goto-char (point-min)))
(defun eww-setup-buffer ()
- (switch-to-buffer (get-buffer-create "*eww*"))
(when (or (plist-get eww-data :url)
(plist-get eww-data :dom))
(eww-save-history))
@@ -759,9 +762,9 @@ the like."
;;;###autoload
(defun eww-browse-url (url &optional new-window)
- (cond (new-window
- (switch-to-buffer (generate-new-buffer "*eww*"))
- (eww-mode)))
+ (when new-window
+ (pop-to-buffer-same-window (generate-new-buffer "*eww*"))
+ (eww-mode))
(eww url))
(defun eww-back-url ()
@@ -933,6 +936,7 @@ network, but just re-display the HTML already fetched."
(let ((eww-form (list (cons :method (dom-attr dom 'method))
(cons :action (dom-attr dom 'action))))
(start (point)))
+ (insert "\n")
(shr-ensure-paragraph)
(shr-generic dom)
(unless (bolp)
@@ -1042,6 +1046,7 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.")
(1- end)))))
(let* ((form (get-text-property pos 'eww-form))
(properties (text-properties-at pos))
+ (buffer-undo-list t)
(inhibit-read-only t)
(length (- end beg replace-length))
(type (plist-get form :type)))
@@ -1056,19 +1061,19 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.")
(1- (line-end-position))
(eww-end-of-field)))
(while (and (> length 0)
- (eql (following-char) ? ))
+ (eql (char-after (1- (point))) ? ))
(delete-region (1- (point)) (point))
(cl-decf length))))
((< length 0)
;; Add padding.
(save-excursion
- (goto-char (1- end))
+ (goto-char end)
(goto-char
(if (equal type "textarea")
(1- (line-end-position))
(1+ (eww-end-of-field))))
(let ((start (point)))
- (insert (make-string (abs length) ? ))
+ (insert (make-string (abs length) ? ))
(set-text-properties start (point) properties))
(goto-char (1- end)))))
(set-text-properties (plist-get form :start) (plist-get form :end)
@@ -1082,8 +1087,9 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.")
(when (equal type "password")
;; Display passwords as asterisks.
(let ((start (eww-beginning-of-field)))
- (put-text-property start (+ start (length value))
- 'display (make-string (length value) ?*)))))))))
+ (put-text-property
+ start (+ start (length value))
+ 'display (make-string (length value) ?*)))))))))
(defun eww-tag-textarea (dom)
(let ((start (point))
@@ -1145,7 +1151,9 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.")
(t
(eww-form-text dom)))
(unless (= start (point))
- (put-text-property start (1+ start) 'help-echo "Input field"))))
+ (put-text-property start (1+ start) 'help-echo "Input field")
+ ;; Mark this as an element we can TAB to.
+ (put-text-property start (1+ start) 'shr-url dom))))
(defun eww-tag-select (dom)
(shr-ensure-paragraph)
@@ -1476,21 +1484,21 @@ Differences in #targets are ignored."
string)))
(defun eww-make-unique-file-name (file directory)
- (cond
- ((zerop (length file))
- (setq file "!"))
- ((string-match "\\`[.]" file)
- (setq file (concat "!" file))))
- (let ((count 1)
- (stem file)
- (suffix ""))
- (when (string-match "\\`\\(.*\\)\\([.][^.]+\\)" file)
- (setq stem (match-string 1)
- suffix (match-string 2)))
- (while (file-exists-p (expand-file-name file directory))
- (setq file (format "%s(%d)%s" stem count suffix))
- (setq count (1+ count)))
- (expand-file-name file directory)))
+ (cond
+ ((zerop (length file))
+ (setq file "!"))
+ ((string-match "\\`[.]" file)
+ (setq file (concat "!" file))))
+ (let ((count 1)
+ (stem file)
+ (suffix ""))
+ (when (string-match "\\`\\(.*\\)\\([.][^.]+\\)" file)
+ (setq stem (match-string 1 file)
+ suffix (match-string 2)))
+ (while (file-exists-p (expand-file-name file directory))
+ (setq file (format "%s(%d)%s" stem count suffix))
+ (setq count (1+ count)))
+ (expand-file-name file directory)))
(defun eww-set-character-encoding (charset)
"Set character encoding to CHARSET.
@@ -1576,8 +1584,8 @@ If CHARSET is nil then use UTF-8."
(defun eww-list-bookmarks ()
"Display the bookmarks."
(interactive)
- (eww-bookmark-prepare)
- (pop-to-buffer "*eww bookmarks*"))
+ (pop-to-buffer "*eww bookmarks*")
+ (eww-bookmark-prepare))
(defun eww-bookmark-prepare ()
(eww-read-bookmarks)
@@ -1764,7 +1772,7 @@ If CHARSET is nil then use UTF-8."
(let ((buffer eww-current-buffer))
(quit-window)
(when buffer
- (switch-to-buffer buffer)))
+ (pop-to-buffer-same-window buffer)))
(eww-restore-history history)))
(defvar eww-history-mode-map
@@ -1845,7 +1853,7 @@ If CHARSET is nil then use UTF-8."
(unless buffer
(error "No buffer on current line"))
(quit-window)
- (switch-to-buffer buffer)))
+ (pop-to-buffer-same-window buffer)))
(defun eww-buffer-show ()
"Display buffer under point in eww buffer list."
@@ -1854,7 +1862,7 @@ If CHARSET is nil then use UTF-8."
(unless buffer
(error "No buffer on current line"))
(other-window -1)
- (switch-to-buffer buffer)
+ (pop-to-buffer-same-window buffer)
(other-window 1)))
(defun eww-buffer-show-next ()
diff --git a/lisp/net/imap.el b/lisp/net/imap.el
index 5c5ed868172..e5a14d75dee 100644
--- a/lisp/net/imap.el
+++ b/lisp/net/imap.el
@@ -747,13 +747,19 @@ sure of changing the value of `foo'."
:capability-command "1 CAPABILITY\r\n"
:always-query-capabilities t
:end-of-command "\r\n"
- :success " OK "
+ :success "^1 OK "
:starttls-function
- (lambda (capabilities)
- (when (string-match-p "STARTTLS" capabilities)
- "1 STARTTLS\r\n"))))
- (done (and process
- (memq (process-status process) '(open run)))))
+ #'(lambda (capabilities)
+ (when (string-match-p "STARTTLS" capabilities)
+ "1 STARTTLS\r\n"))))
+ done)
+ (when process
+ (imap-log buffer)
+ (when (memq (process-status process) '(open run))
+ (setq done process)
+ (with-current-buffer buffer
+ (goto-char (point-min))
+ (imap-parse-greeting))))
(message "imap: Connecting with STARTTLS...%s" (if done "done" "failed"))
done))
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index c5de34a4ac5..a8ba2845aa2 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -981,7 +981,7 @@ element is the data blob and the second element is the content-type."
(image-animated-p image))))
(image-animate image nil 60)))
image)
- (insert alt)))
+ (insert (or alt ""))))
(defun shr-rescale-image (data &optional content-type)
"Rescale DATA, if too big, to fit the current buffer."
@@ -1426,9 +1426,7 @@ The preference is a float determined from `shr-prefer-media-type'."
(and shr-blocked-images
(string-match shr-blocked-images url)))
(setq shr-start (point))
- (if (> (string-width alt) 8)
- (shr-insert (truncate-string-to-width alt 8))
- (shr-insert alt)))
+ (shr-insert alt))
((and (not shr-ignore-cache)
(url-is-cached (shr-encode-url url)))
(funcall shr-put-image-function (shr-get-image-data url) alt))
@@ -1771,17 +1769,18 @@ The preference is a float determined from `shr-prefer-media-type'."
align)))
(dolist (line lines)
(end-of-line)
- (let ((start (point)))
- (insert
- line
- (propertize " "
- 'display `(space :align-to (,pixel-align))
- 'face (and (> (length line) 0)
- (shr-face-background
- (get-text-property
- (1- (length line)) 'face line)))
- 'shr-table-indent shr-table-id)
- shr-table-vertical-line)
+ (let ((start (point))
+ (background (and (> (length line) 0)
+ (shr-face-background
+ (get-text-property
+ (1- (length line)) 'face line))))
+ (space (propertize
+ " "
+ 'display `(space :align-to (,pixel-align))
+ 'shr-table-indent shr-table-id)))
+ (when background
+ (setq space (propertize space 'face background)))
+ (insert line space shr-table-vertical-line)
(shr-colorize-region
start (1- (point)) (nth 5 column) (nth 6 column)))
(forward-line 1))
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el
index 6403d4df04d..cf6aafc9854 100644
--- a/lisp/org/org-compat.el
+++ b/lisp/org/org-compat.el
@@ -479,9 +479,9 @@ LIMIT."
(not (null pos)))))
(defalias 'org-font-lock-ensure
- (if (fboundp 'org-font-lock-ensure)
+ (if (fboundp 'font-lock-ensure)
#'font-lock-ensure
- (lambda (_beg _end) (font-lock-fontify-buffer))))
+ (lambda (&optional _beg _end) (font-lock-fontify-buffer))))
(defun org-floor* (x &optional y)
"Return a list of the floor of X and the fractional part of X.
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index 3767dbaa1e8..9ee405b31e1 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -53,34 +53,16 @@
;; all the bells and whistles one would expect, including syntax
;; highlighting and auto indentation. It can also send regions to an
;; inferior Prolog process.
-;;
-;; The code requires the comint, easymenu, info, imenu, and font-lock
-;; libraries. These are normally distributed with GNU Emacs and
-;; XEmacs.
-;;; Installation:
-;;
-;; Insert the following lines in your init file:
-;;
-;; (setq load-path (cons "/usr/lib/xemacs/site-lisp" load-path))
-;; (autoload 'run-prolog "prolog" "Start a Prolog sub-process." t)
-;; (autoload 'prolog-mode "prolog" "Major mode for editing Prolog programs." t)
-;; (autoload 'mercury-mode "prolog" "Major mode for editing Mercury programs." t)
+;; Some settings you may wish to use:
+
;; (setq prolog-system 'swi) ; optional, the system you are using;
;; ; see `prolog-system' below for possible values
-;; (setq auto-mode-alist (append '(("\\.pl$" . prolog-mode)
-;; ("\\.m$" . mercury-mode))
+;; (setq auto-mode-alist (append '(("\\.pl\\'" . prolog-mode)
+;; ("\\.m\\'" . mercury-mode))
;; auto-mode-alist))
;;
-;; where the path in the first line is the file system path to this file.
-;; MSDOS paths can be written like "d:/programs/emacs-19.34/site-lisp".
-;; Note: In XEmacs, either `/usr/lib/xemacs/site-lisp' (RPM default in
-;; Red Hat-based distributions) or `/usr/local/lib/xemacs/site-lisp'
-;; (default when compiling from sources) are automatically added to
-;; `load-path', so the first line is not necessary provided that you
-;; put this file in the appropriate place.
-;;
-;; The last s-expression above makes sure that files ending with .pl
+;; The last expression above makes sure that files ending with .pl
;; are assumed to be Prolog files and not Perl, which is the default
;; Emacs setting. If this is not wanted, remove this line. It is then
;; necessary to either
@@ -98,8 +80,8 @@
;; If the command to start the prolog process ('sicstus', 'pl' or
;; 'swipl' for SWI prolog, etc.) is not available in the default path,
;; then it is necessary to set the value of the environment variable
-;; EPROLOG to a shell command to invoke the prolog process. In XEmacs
-;; and Emacs 20+ you can also customize the variable
+;; EPROLOG to a shell command to invoke the prolog process.
+;; You can also customize the variable
;; `prolog-program-name' (in the group `prolog-inferior') and provide
;; a full path for your Prolog system (swi, scitus, etc.).
;;
@@ -109,6 +91,7 @@
;; to keep the GNU Emacs compatibility. So if you work under Emacs
;; and see something that does not work do drop me a line, as I have
;; a smaller chance to notice this kind of bugs otherwise.
+; [The above comment dates from 2011.]
;; Changelog:
@@ -272,9 +255,6 @@
;; Version 0.1.35:
;; o Minor font-lock bug fixes.
-;;; TODO:
-
-;; Replace ":type 'sexp" with more precise Custom types.
;;; Code:
@@ -441,7 +421,12 @@ Legal values:
"Alist of Prolog keywords which is used for font locking of directives."
:version "24.1"
:group 'prolog-font-lock
- :type 'sexp
+ ;; Note that "(repeat string)" also allows "nil" (repeat-count 0).
+ ;; This gets processed by prolog-find-value-by-system, which
+ ;; allows both the car and the cdr to be a list to eval.
+ ;; Though the latter must have the form '(eval ...)'.
+ ;; Of course, none of this is documented...
+ :type '(repeat (list (choice symbol sexp) (choice (repeat string) sexp)))
:risky t)
(defcustom prolog-types
@@ -451,7 +436,7 @@ Legal values:
"Alist of Prolog types used by font locking."
:version "24.1"
:group 'prolog-font-lock
- :type 'sexp
+ :type '(repeat (list (choice symbol sexp) (choice (repeat string) sexp)))
:risky t)
(defcustom prolog-mode-specificators
@@ -461,7 +446,7 @@ Legal values:
"Alist of Prolog mode specificators used by font locking."
:version "24.1"
:group 'prolog-font-lock
- :type 'sexp
+ :type '(repeat (list (choice symbol sexp) (choice (repeat string) sexp)))
:risky t)
(defcustom prolog-determinism-specificators
@@ -472,7 +457,7 @@ Legal values:
"Alist of Prolog determinism specificators used by font locking."
:version "24.1"
:group 'prolog-font-lock
- :type 'sexp
+ :type '(repeat (list (choice symbol sexp) (choice (repeat string) sexp)))
:risky t)
(defcustom prolog-directives
@@ -482,7 +467,7 @@ Legal values:
"Alist of Prolog source code directives used by font locking."
:version "24.1"
:group 'prolog-font-lock
- :type 'sexp
+ :type '(repeat (list (choice symbol sexp) (choice (repeat string) sexp)))
:risky t)
@@ -569,7 +554,8 @@ the first column (i.e., DCG heads) inserts ` -->' and newline."
(or (car names) "prolog"))))
"Alist of program names for invoking an inferior Prolog with `run-prolog'."
:group 'prolog-inferior
- :type 'sexp
+ :type '(alist :key-type (choice symbol sexp)
+ :value-type (group (choice string (const nil) sexp)))
:risky t)
(defun prolog-program-name ()
(prolog-find-value-by-system prolog-program-name))
@@ -580,7 +566,7 @@ the first column (i.e., DCG heads) inserts ` -->' and newline."
"Alist of switches given to inferior Prolog run with `run-prolog'."
:version "24.1"
:group 'prolog-inferior
- :type 'sexp
+ :type '(repeat (list (choice symbol sexp) (choice (repeat string) sexp)))
:risky t)
(defun prolog-program-switches ()
(prolog-find-value-by-system prolog-program-switches))
@@ -604,7 +590,8 @@ Some parts of the string are replaced:
region of a buffer, in which case it is the number of lines before
the region."
:group 'prolog-inferior
- :type 'sexp
+ :type '(alist :key-type (choice symbol sexp)
+ :value-type (group (choice string (const nil) sexp)))
:risky t)
(defun prolog-consult-string ()
@@ -631,17 +618,21 @@ Some parts of the string are replaced:
If `prolog-program-name' is non-nil, it is a string sent to a Prolog process.
If `prolog-program-name' is nil, it is an argument to the `compile' function."
:group 'prolog-inferior
- :type 'sexp
+ :type '(alist :key-type (choice symbol sexp)
+ :value-type (group (choice string (const nil) sexp)))
:risky t)
(defun prolog-compile-string ()
(prolog-find-value-by-system prolog-compile-string))
(defcustom prolog-eof-string "end_of_file.\n"
- "Alist of strings that represent end of file for prolog.
-nil means send actual operating system end of file."
+ "String or alist of strings that represent end of file for prolog.
+If nil, send actual operating system end of file."
:group 'prolog-inferior
- :type 'sexp
+ :type '(choice string
+ (const nil)
+ (alist :key-type (choice symbol sexp)
+ :value-type (group (choice string (const nil) sexp))))
:risky t)
(defcustom prolog-prompt-regexp
@@ -653,7 +644,8 @@ nil means send actual operating system end of file."
"Alist of prompts of the prolog system command line."
:version "24.1"
:group 'prolog-inferior
- :type 'sexp
+ :type '(alist :key-type (choice symbol sexp)
+ :value-type (group (choice string (const nil) sexp)))
:risky t)
(defun prolog-prompt-regexp ()
@@ -664,7 +656,8 @@ nil means send actual operating system end of file."
;; (t "^|: +"))
;; "Alist of regexps matching the prompt when consulting `user'."
;; :group 'prolog-inferior
-;; :type 'sexp
+;; :type '(alist :key-type (choice symbol sexp)
+;; :value-type (group (choice string (const nil) sexp)))
;; :risky t)
(defcustom prolog-debug-on-string "debug.\n"
@@ -1036,7 +1029,7 @@ VERSION is of the format (Major . Minor)"
(define-abbrev-table 'prolog-mode-abbrev-table ())
-;; Becauses this can `eval' its arguments, any variable that gets
+;; Because this can `eval' its arguments, any variable that gets
;; processed by it should be marked as :risky.
(defun prolog-find-value-by-system (alist)
"Get value from ALIST according to `prolog-system'."
diff --git a/lisp/replace.el b/lisp/replace.el
index f5c8d33b5f5..dfe8cd739a2 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -85,7 +85,7 @@ from Isearch by using a key sequence like `C-s C-s M-%'." "24.3")
;; while preparing to dump, also stops customize-rogue listing this.
:initialize 'custom-initialize-delay
:group 'matching
- :type 'sexp
+ :type '(choice string (sexp :tag "Display specification"))
:version "25.1")
(defcustom query-replace-from-history-variable 'query-replace-history
diff --git a/lisp/ses.el b/lisp/ses.el
index 7647a5519ad..a87386e1730 100644
--- a/lisp/ses.el
+++ b/lisp/ses.el
@@ -446,10 +446,8 @@ is nil if SYM is not a symbol that names a cell."
(ses-get-cell (car rowcol) (cdr rowcol)))))))
(defun ses-plist-delq (plist prop)
- "Return PLIST after deletion of proprerty/value pair.
-
-PROP is the symbol identifying the property/value pair. PLIST may
-be modified by border effect."
+ "Return PLIST after deleting the first pair (if any) with symbol PROP.
+This can alter PLIST."
(cond
((null plist) nil)
((eq (car plist) prop) (cddr plist))
diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el
index 96a82baa56c..b3a41d3822c 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/css-mode.el
@@ -54,6 +54,14 @@
'("charset" "font-face" "import" "media" "namespace" "page")
"Identifiers that appear in the form @foo.")
+(defconst css-bang-ids
+ '("important")
+ "Identifiers that appear in the form !foo.")
+
+(defconst scss-bang-ids
+ '("default" "global" "optional")
+ "Additional identifiers that appear in the form !foo in SCSS.")
+
(defconst css-descriptor-ids
'("ascent" "baseline" "bbox" "cap-height" "centerline" "definition-src"
"descent" "font-family" "font-size" "font-stretch" "font-style"
@@ -236,8 +244,8 @@
(defun css--font-lock-keywords (&optional sassy)
`((,(concat "!\\s-*"
- (regexp-opt (append (if sassy '("global"))
- '("important"))))
+ (regexp-opt (append (if sassy scss-bang-ids)
+ css-bang-ids)))
(0 font-lock-builtin-face))
;; Atrules keywords. IDs not in css-at-ids are valid (ignored).
;; In fact the regexp should probably be
diff --git a/lisp/xwidget.el b/lisp/xwidget.el
index 8c8e679c8da..cd8ec0ec29d 100644
--- a/lisp/xwidget.el
+++ b/lisp/xwidget.el
@@ -144,7 +144,7 @@ Interactively, URL defaults to the string looking like a url around point."
(defun xwidget-webkit-scroll-up ()
"Scroll webkit up.
Depending on the value of `xwidget-webkit-scroll-behavior',
-this scrolls in 'native' fashion, or like `image-mode' would."
+this scrolls in `native' fashion, or like `image-mode' would."
(interactive)
(if (eq xwidget-webkit-scroll-behavior 'native)
(xwidget-set-adjustment (xwidget-webkit-last-session) 'vertical t 50)
@@ -153,7 +153,7 @@ this scrolls in 'native' fashion, or like `image-mode' would."
(defun xwidget-webkit-scroll-down ()
"Scroll webkit down.
Depending on the value of `xwidget-webkit-scroll-behavior',
-this scrolls in 'native' fashion, or like `image-mode' would."
+this scrolls in `native' fashion, or like `image-mode' would."
(interactive)
(if (eq xwidget-webkit-scroll-behavior 'native)
(xwidget-set-adjustment (xwidget-webkit-last-session) 'vertical t -50)
@@ -162,7 +162,7 @@ this scrolls in 'native' fashion, or like `image-mode' would."
(defun xwidget-webkit-scroll-forward ()
"Scroll webkit forwards.
Depending on the value of `xwidget-webkit-scroll-behavior',
-this scrolls in 'native' fashion, or like `image-mode' would."
+this scrolls in `native' fashion, or like `image-mode' would."
(interactive)
(if (eq xwidget-webkit-scroll-behavior 'native)
(xwidget-set-adjustment (xwidget-webkit-last-session) 'horizontal t 50)
@@ -171,7 +171,7 @@ this scrolls in 'native' fashion, or like `image-mode' would."
(defun xwidget-webkit-scroll-backward ()
"Scroll webkit backwards.
Depending on the value of `xwidget-webkit-scroll-behavior',
-this scrolls in 'native' fashion, or like `image-mode' would."
+this scrolls in `native' fashion, or like `image-mode' would."
(interactive)
(if (eq xwidget-webkit-scroll-behavior 'native)
(xwidget-set-adjustment (xwidget-webkit-last-session) 'horizontal t -50)