Commit 9ac6d28a authored by Glenn Morris's avatar Glenn Morris
Browse files

Merge from emacs-24; up to 2014-06-11T19:33:14Z!rgm@gnu.org

parents a0e2175a 436550da
2014-06-26 Eli Zaretskii <eliz@gnu.org>
* notes/unicode: Some notes about what to do when a new Unicode
version is imported.
2014-06-26 Glenn Morris <rgm@gnu.org> 2014-06-26 Glenn Morris <rgm@gnu.org>
* authors.el: Move here from ../lisp/emacs-lisp. * authors.el: Move here from ../lisp/emacs-lisp.
......
...@@ -622,11 +622,12 @@ Changes to files in this list are not listed.") ...@@ -622,11 +622,12 @@ Changes to files in this list are not listed.")
"temacs.opt" "descrip.mms" "compile.com" "link.com" "temacs.opt" "descrip.mms" "compile.com" "link.com"
"compact.el" "fadr.el" "compact.el" "fadr.el"
"calc/calc-maint.el" "calc/calc-maint.el"
"emacs-lisp/cl-specs.el"
"emacs-lisp/eieio-comp.el" "emacs-lisp/eieio-comp.el"
"erc-hecomplete.el" "erc-hecomplete.el"
"eshell/esh-maint.el" "eshell/esh-maint.el"
"language/persian.el" "language/persian.el"
"meese.el" "iswitchb.el" "ledit.el" "meese.el" "iswitchb.el" "longlines.el"
"mh-exec.el" "mh-init.el" "mh-customize.el" "mh-exec.el" "mh-init.el" "mh-customize.el"
"net/zone-mode.el" "xesam.el" "net/zone-mode.el" "xesam.el"
"term/mac-win.el" "sup-mouse.el" "term/mac-win.el" "sup-mouse.el"
...@@ -647,6 +648,7 @@ Changes to files in this list are not listed.") ...@@ -647,6 +648,7 @@ Changes to files in this list are not listed.")
"dns-mode.el" "run-at-time.el" "gnus-encrypt.el" "sha1-el.el" "dns-mode.el" "run-at-time.el" "gnus-encrypt.el" "sha1-el.el"
"gnus-gl.el" "gnus.sum.el" "proto-stream.el" "color.el" "color-lab.el" "gnus-gl.el" "gnus.sum.el" "proto-stream.el" "color.el" "color-lab.el"
"eww.el" "shr-color.el" "shr.el" "earcon.el" "gnus-audio.el" "encrypt.el" "eww.el" "shr-color.el" "shr.el" "earcon.el" "gnus-audio.el" "encrypt.el"
"format-spec.el" "gnus-move.el"
;; doc ;; doc
"getopt.c" "texindex.c" "news.texi" "vc.texi" "vc2-xtra.texi" "getopt.c" "texindex.c" "news.texi" "vc.texi" "vc2-xtra.texi"
"back.texi" "vol1.texi" "vol2.texi" "elisp-covers.texi" "two.el" "back.texi" "vol1.texi" "vol2.texi" "elisp-covers.texi" "two.el"
...@@ -752,7 +754,11 @@ in the repository.") ...@@ -752,7 +754,11 @@ in the repository.")
("progmodes/octave-inf.el" . "octave.el") ("progmodes/octave-inf.el" . "octave.el")
("progmodes/octave-mod.el" . "octave.el") ("progmodes/octave-mod.el" . "octave.el")
;; Obsolete. ;; Obsolete.
("emacs-lisp/assoc.el" . "assoc.el")
("emacs-lisp/cust-print.el" . "cust-print.el")
("mail/mailpost.el" . "mailpost.el")
("play/bruce.el" . "bruce.el") ("play/bruce.el" . "bruce.el")
("play/yow.el" . "yow.el")
("patcomp.el" . "patcomp.el") ("patcomp.el" . "patcomp.el")
;; From lisp to etc/forms. ;; From lisp to etc/forms.
("forms-d2.el" . "forms-d2.el") ("forms-d2.el" . "forms-d2.el")
...@@ -771,6 +777,7 @@ in the repository.") ...@@ -771,6 +777,7 @@ in the repository.")
("build-install" . "build-ins.in") ("build-install" . "build-ins.in")
("build-install.in" . "build-ins.in") ("build-install.in" . "build-ins.in")
("unidata/Makefile" . "unidata/Makefile.in") ("unidata/Makefile" . "unidata/Makefile.in")
("mac/uvs.el" . "unidata/uvs.el")
;; Moved from top to etc/ ;; Moved from top to etc/
("CONTRIBUTE" . "CONTRIBUTE") ("CONTRIBUTE" . "CONTRIBUTE")
("FTP" . "FTP") ("FTP" . "FTP")
......
...@@ -3,6 +3,39 @@ ...@@ -3,6 +3,39 @@
Copyright (C) 2002-2014 Free Software Foundation, Inc. Copyright (C) 2002-2014 Free Software Foundation, Inc.
See the end of the file for license conditions. See the end of the file for license conditions.
Importing a new Unicode Standard version into Emacs
-------------------------------------------------------------
Emacs uses the following files from the Unicode Character Database
(a.k.a. "UCD):
. UnicodeData.txt
. BidiMirroring.txt
. IVD_Sequences.txt
First, these files need to be copied into admin/unidata/, and then
Emacs should be rebuilt for them to take effect. Rebuilding Emacs
updates several derived files elsewhere in the Emacs source tree,
mainly in lisp/international/.
When Emacs is rebuilt for the first time after importing the new
files, pay attention to any warning or error messages. In particular,
admin/unidata/unidata-gen.el will complain if UnicodeData.txt defines
new bidirectional attributes of characters, because unidata-gen.el,
bidi.c and dispextern.h need to be updated in that case; failure to do
so will cause aborts in redisplay.
Next, review the changes in UnicodeData.txt vs the previous version
used by Emacs. Any changes, be it introduction of new scripts or
addition of codepoints to existing scripts, need corresponding changes
in the data used for filling char-script-table, see characters.el
around line 1300. Other databases and settings in characters.el, such
as the data for char-width-table, might also need changes.
Any new scripts added by UnicodeData.txt will also need updates to
script-representative-chars defined in fontset.el. Other databases in
fontset.el might also need to be updated as needed.
Problems, fixmes and other unicode-related issues Problems, fixmes and other unicode-related issues
------------------------------------------------------------- -------------------------------------------------------------
......
2014-06-26 Glenn Morris <rgm@gnu.org>
* emacs-lisp/cl-macs.el (help-add-fundoc-usage):
Remove outdated declaration.
* emacs-lisp/authors.el (authors-valid-file-names)
(authors-renamed-files-alist): Additions.
2014-06-26 Leo Liu <sdl.web@gmail.com>
* textmodes/picture.el (picture-set-tab-stops):
* ruler-mode.el (ruler-mode-mouse-add-tab-stop)
(ruler-mode-ruler): Fix to work with nil tab-stop-list.
* progmodes/asm-mode.el (asm-calculate-indentation): Use
indent-next-tab-stop.
* indent.el (indent-accumulate-tab-stops): New function.
2014-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/package.el (package-list-unsigned): New var (bug#17625).
(package-desc-status): Obey it.
2014-06-26 Stephen Berman <stephen.berman@gmx.net>
* calendar/todo-mode.el: Fix two bugs.
(todo-insert-item--basic): If user cancels item insertion to
another category before setting priority, show original category
whether it is in the same or a different file.
(todo-set-item-priority): After selecting category, instead of
moving point to top, which extends an active region, restore it.
2014-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
* help-fns.el (describe-function-1): Check file-name is a string before
calling help-fns--autoloaded-p (bug#17564).
2014-06-26 Juri Linkov <juri@jurta.org>
* desktop.el (desktop-auto-save-enable)
(desktop-auto-save-disable): New functions.
(desktop-save-mode, desktop-auto-save-timeout): Use them.
(desktop-read): Disable the autosave before loading the desktop,
and enable afterwards. (Bug#17351)
2014-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
Fix some indentation problem with \; and pipes (bug#17842).
* progmodes/sh-script.el (sh-mode-syntax-table): Set syntax of ;|&.
(sh-smie--default-forward-token, sh-smie--default-backward-token):
New functions.
(sh-smie-sh-forward-token, sh-smie-sh-backward-token)
(sh-smie-rc-forward-token, sh-smie-rc-backward-token): Use them.
(sh-smie-sh-rules): Fix indentation of a pipe at BOL.
2014-06-26 Glenn Morris <rgm@gnu.org> 2014-06-26 Glenn Morris <rgm@gnu.org>
   
* emacs-lisp/find-func.el (find-function-C-source-directory): * emacs-lisp/find-func.el (find-function-C-source-directory):
...@@ -12194,7 +12250,7 @@ ...@@ -12194,7 +12250,7 @@
   
2013-07-07 Michael Kifer <kifer@cs.stonybrook.edu> 2013-07-07 Michael Kifer <kifer@cs.stonybrook.edu>
   
* ediff.el (ediff-version): Version update. * vc/ediff.el (ediff-version): Version update.
(ediff-files-command, ediff3-files-command, ediff-merge-command) (ediff-files-command, ediff3-files-command, ediff-merge-command)
(ediff-merge-with-ancestor-command, ediff-directories-command) (ediff-merge-with-ancestor-command, ediff-directories-command)
(ediff-directories3-command, ediff-merge-directories-command) (ediff-directories3-command, ediff-merge-directories-command)
...@@ -12202,19 +12258,21 @@ ...@@ -12202,19 +12258,21 @@
All are command-line interfaces to ediff: to facilitate calling All are command-line interfaces to ediff: to facilitate calling
Emacs with the appropriate ediff functions invoked. Emacs with the appropriate ediff functions invoked.
   
* viper-cmd.el (viper-del-forward-char-in-insert): New function. * emulation/viper-cmd.el (viper-del-forward-char-in-insert):
New function.
(viper-save-kill-buffer): Check if buffer is modified. (viper-save-kill-buffer): Check if buffer is modified.
   
* viper.el (viper-version): Version update. * emulation/viper.el (viper-version): Version update.
(viper-emacs-state-mode-list): Add egg-status-buffer-mode. (viper-emacs-state-mode-list): Add egg-status-buffer-mode.
   
2013-07-07 Stefan Monnier <monnier@iro.umontreal.ca> 2013-07-07 Stefan Monnier <monnier@iro.umontreal.ca>
   
* faces.el (tty-run-terminal-initialization): Run new tty-setup-hook. * faces.el (tty-run-terminal-initialization): Run new tty-setup-hook.
* viper-cmd.el (viper-envelop-ESC-key): Remove function. * emulation/viper-cmd.el (viper-envelop-ESC-key): Remove function.
(viper-intercept-ESC-key): Simplify. (viper-intercept-ESC-key): Simplify.
* viper-keym.el (viper-ESC-key): Make it a constant, don't use kbd. * emulation/viper-keym.el (viper-ESC-key): Make it a constant,
* viper.el (viper--tty-ESC-filter, viper--lookup-key) don't use kbd.
* emulation/viper.el (viper--tty-ESC-filter, viper--lookup-key)
(viper-catch-tty-ESC, viper-uncatch-tty-ESC) (viper-catch-tty-ESC, viper-uncatch-tty-ESC)
(viper-setup-ESC-to-escape): New functions. (viper-setup-ESC-to-escape): New functions.
(viper-go-away, viper-set-hooks): Call viper-setup-ESC-to-escape. (viper-go-away, viper-set-hooks): Call viper-setup-ESC-to-escape.
......
...@@ -8501,7 +8501,7 @@ ...@@ -8501,7 +8501,7 @@
   
2012-07-25 Jay Belanger <jay.p.belanger@gmail.com> 2012-07-25 Jay Belanger <jay.p.belanger@gmail.com>
   
* calc-alg.el (math-simplify-divide): Don't cross multiply * calc/calc-alg.el (math-simplify-divide): Don't cross multiply
in an equation when the lhs is a variable. in an equation when the lhs is a variable.
   
2012-07-24 Julien Danjou <julien@danjou.info> 2012-07-24 Julien Danjou <julien@danjou.info>
......
...@@ -1962,13 +1962,12 @@ their associated keys and their effects." ...@@ -1962,13 +1962,12 @@ their associated keys and their effects."
;; If user cancels before setting priority, restore ;; If user cancels before setting priority, restore
;; display. ;; display.
(unless item-added (unless item-added
(if ocat (set-window-buffer (selected-window) (set-buffer obuf))
(progn (when ocat
(unless (equal cat ocat) (unless (equal cat ocat)
(todo-category-number ocat) (todo-category-number ocat)
(todo-category-select)) (todo-category-select))
(and done-only (todo-toggle-view-done-only))) (and done-only (todo-toggle-view-done-only)))
(set-window-buffer (selected-window) (set-buffer obuf)))
(goto-char opoint)) (goto-char opoint))
;; If the todo items section is not visible when the ;; If the todo items section is not visible when the
;; insertion command is called (either because only done ;; insertion command is called (either because only done
...@@ -2553,9 +2552,9 @@ meaning to raise or lower the item's priority by one." ...@@ -2553,9 +2552,9 @@ meaning to raise or lower the item's priority by one."
(goto-char (point-min)) (goto-char (point-min))
(setq done (re-search-forward todo-done-string-start nil t)))) (setq done (re-search-forward todo-done-string-start nil t))))
(let ((todo-show-with-done done)) (let ((todo-show-with-done done))
(todo-category-select) ;; Keep current item or top of moved to category in view
;; Keep top of category in view while setting priority. ;; while setting priority.
(goto-char (point-min))))) (save-excursion (todo-category-select)))))
;; Prompt for priority only when the category has at least one ;; Prompt for priority only when the category has at least one
;; todo item. ;; todo item.
(when (> maxnum 1) (when (> maxnum 1)
......
...@@ -174,11 +174,8 @@ For further details, see info node `(emacs)Saving Emacs Sessions'." ...@@ -174,11 +174,8 @@ For further details, see info node `(emacs)Saving Emacs Sessions'."
:global t :global t
:group 'desktop :group 'desktop
(if desktop-save-mode (if desktop-save-mode
(when (and (integerp desktop-auto-save-timeout) (desktop-auto-save-enable)
(> desktop-auto-save-timeout 0)) (desktop-auto-save-disable)))
(add-hook 'window-configuration-change-hook 'desktop-auto-save-set-timer))
(remove-hook 'window-configuration-change-hook 'desktop-auto-save-set-timer)
(desktop-auto-save-cancel-timer)))
(defun desktop-save-mode-off () (defun desktop-save-mode-off ()
"Disable `desktop-save-mode'. Provided for use in hooks." "Disable `desktop-save-mode'. Provided for use in hooks."
...@@ -219,9 +216,8 @@ Zero or nil means disable auto-saving due to idleness." ...@@ -219,9 +216,8 @@ Zero or nil means disable auto-saving due to idleness."
(set-default symbol value) (set-default symbol value)
(ignore-errors (ignore-errors
(if (and (integerp value) (> value 0)) (if (and (integerp value) (> value 0))
(add-hook 'window-configuration-change-hook 'desktop-auto-save-set-timer) (desktop-auto-save-enable value)
(remove-hook 'window-configuration-change-hook 'desktop-auto-save-set-timer) (desktop-auto-save-disable))))
(desktop-auto-save-cancel-timer))))
:group 'desktop :group 'desktop
:version "24.4") :version "24.4")
...@@ -1132,6 +1128,10 @@ Using it may cause conflicts. Use it anyway? " owner))))) ...@@ -1132,6 +1128,10 @@ Using it may cause conflicts. Use it anyway? " owner)))))
(unless desktop-dirname (unless desktop-dirname
(message "Desktop file in use; not loaded."))) (message "Desktop file in use; not loaded.")))
(desktop-lazy-abort) (desktop-lazy-abort)
;; Temporarily disable the autosave that will leave it
;; disabled when loading the desktop fails with errors,
;; thus not overwriting the desktop with broken contents.
(desktop-auto-save-disable)
;; Evaluate desktop buffer and remember when it was modified. ;; Evaluate desktop buffer and remember when it was modified.
(load (desktop-full-file-name) t t t) (load (desktop-full-file-name) t t t)
(setq desktop-file-modtime (nth 5 (file-attributes (desktop-full-file-name)))) (setq desktop-file-modtime (nth 5 (file-attributes (desktop-full-file-name))))
...@@ -1184,6 +1184,7 @@ Using it may cause conflicts. Use it anyway? " owner))))) ...@@ -1184,6 +1184,7 @@ Using it may cause conflicts. Use it anyway? " owner)))))
(set-window-prev-buffers window nil) (set-window-prev-buffers window nil)
(set-window-next-buffers window nil)))) (set-window-next-buffers window nil))))
(setq desktop-saved-frameset nil) (setq desktop-saved-frameset nil)
(desktop-auto-save-enable)
t)) t))
;; No desktop file found. ;; No desktop file found.
(desktop-clear) (desktop-clear)
...@@ -1230,6 +1231,15 @@ directory DIRNAME." ...@@ -1230,6 +1231,15 @@ directory DIRNAME."
;; Auto-Saving. ;; Auto-Saving.
(defvar desktop-auto-save-timer nil) (defvar desktop-auto-save-timer nil)
(defun desktop-auto-save-enable (&optional timeout)
(when (and (integerp (or timeout desktop-auto-save-timeout))
(> (or timeout desktop-auto-save-timeout) 0))
(add-hook 'window-configuration-change-hook 'desktop-auto-save-set-timer)))
(defun desktop-auto-save-disable ()
(remove-hook 'window-configuration-change-hook 'desktop-auto-save-set-timer)
(desktop-auto-save-cancel-timer))
(defun desktop-auto-save () (defun desktop-auto-save ()
"Save the desktop periodically. "Save the desktop periodically.
Called by the timer created in `desktop-auto-save-set-timer'." Called by the timer created in `desktop-auto-save-set-timer'."
......
...@@ -382,8 +382,6 @@ its argument list allows full Common Lisp conventions." ...@@ -382,8 +382,6 @@ its argument list allows full Common Lisp conventions."
(if (car res) `(progn ,(car res) ,form) form)) (if (car res) `(progn ,(car res) ,form) form))
`(function ,func))) `(function ,func)))
(declare-function help-add-fundoc-usage "help-fns" (docstring arglist))
(defun cl--make-usage-var (x) (defun cl--make-usage-var (x)
"X can be a var or a (destructuring) lambda-list." "X can be a var or a (destructuring) lambda-list."
(cond (cond
......
...@@ -836,6 +836,8 @@ GnuPG keyring is located under \"gnupg\" in `package-user-dir'." ...@@ -836,6 +836,8 @@ GnuPG keyring is located under \"gnupg\" in `package-user-dir'."
sig)) sig))
(epg-context-result-for context 'verify))))) (epg-context-result-for context 'verify)))))
(if (null good-signatures) (if (null good-signatures)
;; FIXME: Only signal an error if the signature is invalid, not if we
;; simply lack the key needed to check the sig!
(error "Failed to verify signature %s: %S" (error "Failed to verify signature %s: %S"
sig-file sig-file
(mapcar #'epg-signature-to-string (mapcar #'epg-signature-to-string
...@@ -1664,6 +1666,9 @@ package PKG-DESC, add one. The alist is keyed with PKG-DESC." ...@@ -1664,6 +1666,9 @@ package PKG-DESC, add one. The alist is keyed with PKG-DESC."
(defvar package-list-unversioned nil (defvar package-list-unversioned nil
"If non-nil include packages that don't have a version in `list-package'.") "If non-nil include packages that don't have a version in `list-package'.")
(defvar package-list-unsigned nil
"If non-nil, mention in the list which packages were installed w/o signature.")
(defun package-desc-status (pkg-desc) (defun package-desc-status (pkg-desc)
(let* ((name (package-desc-name pkg-desc)) (let* ((name (package-desc-name pkg-desc))
(dir (package-desc-dir pkg-desc)) (dir (package-desc-dir pkg-desc))
...@@ -1684,9 +1689,8 @@ package PKG-DESC, add one. The alist is keyed with PKG-DESC." ...@@ -1684,9 +1689,8 @@ package PKG-DESC, add one. The alist is keyed with PKG-DESC."
(dir ;One of the installed packages. (dir ;One of the installed packages.
(cond (cond
((not (file-exists-p (package-desc-dir pkg-desc))) "deleted") ((not (file-exists-p (package-desc-dir pkg-desc))) "deleted")
((eq pkg-desc (cadr (assq name package-alist))) (if signed ((eq pkg-desc (cadr (assq name package-alist)))
"installed" (if (or (not package-list-unsigned) signed) "installed" "unsigned"))
"unsigned"))
(t "obsolete"))) (t "obsolete")))
(t (t
(let* ((ins (cadr (assq name package-alist))) (let* ((ins (cadr (assq name package-alist)))
...@@ -1696,9 +1700,9 @@ package PKG-DESC, add one. The alist is keyed with PKG-DESC." ...@@ -1696,9 +1700,9 @@ package PKG-DESC, add one. The alist is keyed with PKG-DESC."
(if (memq name package-menu--new-package-list) (if (memq name package-menu--new-package-list)
"new" "available")) "new" "available"))
((version-list-< version ins-v) "obsolete") ((version-list-< version ins-v) "obsolete")
((version-list-= version ins-v) (if signed ((version-list-= version ins-v)
"installed" (if (or (not package-list-unsigned) signed)
"unsigned")))))))) "installed" "unsigned"))))))))
(defun package-menu--refresh (&optional packages keywords) (defun package-menu--refresh (&optional packages keywords)
"Re-populate the `tabulated-list-entries'. "Re-populate the `tabulated-list-entries'.
......
2014-06-26 Glenn Morris <rgm@gnu.org>
* mm-util.el (help-function-arglist): Remove outdated declaration.
2014-06-24 Andreas Schwab <schwab@linux-m68k.org> 2014-06-24 Andreas Schwab <schwab@linux-m68k.org>
   
* html2text.el (html2text-get-attr): Rewrite to handle spaces in quoted * html2text.el (html2text-get-attr): Rewrite to handle spaces in quoted
......
...@@ -1374,8 +1374,6 @@ If INHIBIT is non-nil, inhibit `mm-inhibit-file-name-handlers'." ...@@ -1374,8 +1374,6 @@ If INHIBIT is non-nil, inhibit `mm-inhibit-file-name-handlers'."
(write-region start end filename append visit lockname))) (write-region start end filename append visit lockname)))
(autoload 'gmm-write-region "gmm-utils") (autoload 'gmm-write-region "gmm-utils")
(declare-function help-function-arglist "help-fns"
(def &optional preserve-names))
;; It is not a MIME function, but some MIME functions use it. ;; It is not a MIME function, but some MIME functions use it.
(if (and (fboundp 'make-temp-file) (if (and (fboundp 'make-temp-file)
......
...@@ -483,7 +483,7 @@ FILE is the file where FUNCTION was probably defined." ...@@ -483,7 +483,7 @@ FILE is the file where FUNCTION was probably defined."
(beg (if (and (or (byte-code-function-p def) (beg (if (and (or (byte-code-function-p def)
(keymapp def) (keymapp def)
(memq (car-safe def) '(macro lambda closure))) (memq (car-safe def) '(macro lambda closure)))
file-name (stringp file-name)
(help-fns--autoloaded-p function file-name)) (help-fns--autoloaded-p function file-name))
(if (commandp def) (if (commandp def)
"an interactive autoloaded " "an interactive autoloaded "
......
...@@ -677,6 +677,13 @@ If PREV is non-nil, return the previous one instead." ...@@ -677,6 +677,13 @@ If PREV is non-nil, return the previous one instead."
(if (<= column last) -1 (/ (- column last 1) step)) (if (<= column last) -1 (/ (- column last 1) step))
(1+ (/ (- column last) step))))))))) (1+ (/ (- column last) step)))))))))
(defun indent-accumulate-tab-stops (limit)
"Get a list of tab stops before LIMIT (inclusive)."
(let ((tab 0) (tab-stops))
(while (<= (setq tab (indent-next-tab-stop tab)) limit)
(push tab tab-stops))
(nreverse tab-stops)))
(defun tab-to-tab-stop () (defun tab-to-tab-stop ()
"Insert spaces or tabs to next defined tab-stop column. "Insert spaces or tabs to next defined tab-stop column.
The variable `tab-stop-list' is a list of columns at which there are tab stops. The variable `tab-stop-list' is a list of columns at which there are tab stops.
......
...@@ -172,7 +172,7 @@ Special commands: ...@@ -172,7 +172,7 @@ Special commands:
;; Simple `;' comments go to the comment-column. ;; Simple `;' comments go to the comment-column.
(and (looking-at "\\s<\\(\\S<\\|\\'\\)") comment-column) (and (looking-at "\\s<\\(\\S<\\|\\'\\)") comment-column)
;; The rest goes at the first tab stop. ;; The rest goes at the first tab stop.
(or (car tab-stop-list) tab-width))) (or (indent-next-tab-stop 0))))
(defun asm-colon () (defun asm-colon ()
"Insert a colon; if it follows a label, delete the label's indentation." "Insert a colon; if it follows a label, delete the label's indentation."
......
...@@ -481,6 +481,9 @@ name symbol." ...@@ -481,6 +481,9 @@ name symbol."
?~ "_" ?~ "_"
?, "_" ?, "_"
?= "." ?= "."
?\; "."
?| "."
?& "."
?< "." ?< "."
?> ".") ?> ".")
"The syntax table to use for Shell-Script mode. "The syntax table to use for Shell-Script mode.
...@@ -1860,6 +1863,40 @@ Does not preserve point." ...@@ -1860,6 +1863,40 @@ Does not preserve point."
((equal tok "in") (sh-smie--sh-keyword-in-p)) ((equal tok "in") (sh-smie--sh-keyword-in-p))
(t (sh-smie--keyword-p)))) (t (sh-smie--keyword-p))))
(defun sh-smie--default-forward-token ()
(forward-comment (point-max))
(buffer-substring-no-properties
(point)
(progn (if (zerop (skip-syntax-forward "."))
(while (progn (skip-syntax-forward "w_'")
(looking-at "\\\\"))
(forward-char 2)))
(point))))
(defun sh-smie--default-backward-token ()
(forward-comment (- (point)))
(let ((pos (point))
(n (skip-syntax-backward ".")))
(if (or (zerop n)
(and (eq n -1)
(let ((p (point)))
(if (eq -1 (% (skip-syntax-backward "\\") 2))
t
(goto-char p)
nil))))
(while
(progn (skip-syntax-backward "w_'")
(or (not (zerop (skip-syntax-backward "\\")))
(when (eq ?\\ (char-before (1- (point))))
(let ((p (point)))
(forward-char -1)
(if (eq -1 (% (skip-syntax-backward "\\") 2))
t
(goto-char p)
nil))))))
(goto-char (- (point) (% (skip-syntax-backward "\\") 2))))
(buffer-substring-no-properties (point) pos)))
(defun sh-smie-sh-forward-token () (defun sh-smie-sh-forward-token ()
(if (and (looking-at "[ \t]*\\(?:#\\|\\(\\s|\\)\\|$\\)") (if (and (looking-at "[ \t]*\\(?:#\\|\\(\\s|\\)\\|$\\)")
(save-excursion (save-excursion
...@@ -1888,7 +1925,7 @@ Does not preserve point." ...@@ -1888,7 +1925,7 @@ Does not preserve point."
tok)) tok))
(t (t
(let* ((pos (point)) (let* ((pos (point))
(tok (smie-default-forward-token))) (tok (sh-smie--default-forward-token)))
(cond (cond
((equal tok ")") "case-)") ((equal tok ")") "case-)")
((equal tok "(") "case-(") ((equal tok "(") "case-(")
...@@ -1932,7 +1969,7 @@ Does not preserve point." ...@@ -1932,7 +1969,7 @@ Does not preserve point."
(goto-char (match-beginning 1)) (goto-char (match-beginning 1))
(match-string-no-properties 1)) (match-string-no-properties 1))
(t (t
(let ((tok (smie-default-backward-token))) (let ((tok (sh-smie--default-backward-token)))
(cond (cond
((equal tok ")") "case-)") ((equal tok ")") "case-)")
((equal tok "(") "case-(") ((equal tok "(") "case-(")
...@@ -1962,18 +1999,18 @@ May return nil if the line should not be treated as continued." ...@@ -1962,18 +1999,18 @@ May return nil if the line should not be treated as continued."
(`(:after . "case-)") (- (sh-var-value 'sh-indent-for-case-alt) (`(:after . "case-)") (- (sh-var-value 'sh-indent-for-case-alt)
(sh-var-value 'sh-indent-for-case-label))) (sh-var-value 'sh-indent-for-case-label)))
((and `(:before . ,_) ((and `(:before . ,_)
(guard (when sh-indent-after-continuation ;; After a line-continuation, make sure the rest is indented.
(save-excursion (guard sh-indent-after-continuation)
(ignore-errors (guard (save-excursion