Commit 049bd5d2 authored by Michael Heerdegen's avatar Michael Heerdegen

Don't quote self-quoting pcase patterns

* admin/bzrmerge.el:
* lisp/char-fold.el:
* lisp/dired.el:
* lisp/emacs-lisp/derived.el:
* lisp/emacs-lisp/easy-mmode.el:
* lisp/emacs-lisp/easymenu.el:
* lisp/emacs-lisp/eieio-core.el:
* lisp/emacs-lisp/package.el:
* lisp/emacs-lisp/smie.el:
* lisp/faces.el:
* lisp/filesets.el:
* lisp/progmodes/modula2.el:
* lisp/progmodes/octave.el:
* lisp/progmodes/opascal.el:
* lisp/progmodes/perl-mode.el:
* lisp/progmodes/prolog.el:
* lisp/progmodes/ruby-mode.el:
* lisp/progmodes/sh-script.el:
* lisp/server.el:
* lisp/subr.el:
* lisp/textmodes/css-mode.el:
* test/lisp/emacs-lisp/pcase-tests.el: Don't quote self-quoting
'pcase' patterns.
parent 607cc290
......@@ -150,12 +150,12 @@ Type `y' to skip this revision,
(format "%s: Skip (y/n/N/q/%s)? " str
(key-description (vector help-char)))
'(?y ?n ?N ?q)))
(`?y (setq skip t))
(`?q (keyboard-quit))
(?y (setq skip t))
(?q (keyboard-quit))
;; A single log entry can match skip-regexp multiple
;; times. If you are sure you don't want to skip it,
;; you don't want to be asked multiple times.
(`?N (setq skip 'no))))))
(?N (setq skip 'no))))))
(if (eq skip t)
(push revno skipped)
(push revno revnos)))))
......
......@@ -170,7 +170,7 @@ from which to start."
;; need to keep them grouped together like this: "\\( \\|[ ...][ ...]\\)".
(while (< i end)
(pcase (aref string i)
(`?\s (setq spaces (1+ spaces)))
(?\s (setq spaces (1+ spaces)))
(c (when (> spaces 0)
(push (char-fold--make-space-string spaces) out)
(setq spaces 0))
......
......@@ -3046,10 +3046,10 @@ TRASH non-nil means to trash the file instead of deleting, provided
("no" ?n "skip to next")
("all" ?! "delete all remaining directories with no more questions")
("quit" ?q "exit")))
('"all" (setq recursive 'always dired-recursive-deletes recursive))
('"yes" (if (eq recursive 'top) (setq recursive 'always)))
('"no" (setq recursive nil))
('"quit" (keyboard-quit))
("all" (setq recursive 'always dired-recursive-deletes recursive))
("yes" (if (eq recursive 'top) (setq recursive 'always)))
("no" (setq recursive nil))
("quit" (keyboard-quit))
(_ (keyboard-quit))))) ; catch all unknown answers
(setq recursive nil)) ; Empty dir or recursive is nil.
(delete-directory file recursive trash))))
......
......@@ -193,10 +193,10 @@ See Info node `(elisp)Derived Modes' for more details."
;; Process the keyword args.
(while (keywordp (car body))
(pcase (pop body)
(`:group (setq group (pop body)))
(`:abbrev-table (setq abbrev (pop body)) (setq declare-abbrev nil))
(`:syntax-table (setq syntax (pop body)) (setq declare-syntax nil))
(`:after-hook (setq after-hook (pop body)))
(:group (setq group (pop body)))
(:abbrev-table (setq abbrev (pop body)) (setq declare-abbrev nil))
(:syntax-table (setq syntax (pop body)) (setq declare-syntax nil))
(:after-hook (setq after-hook (pop body)))
(_ (pop body))))
(setq docstring (derived-mode-make-docstring
......
......@@ -217,30 +217,30 @@ For example, you could write
(while (keywordp (setq keyw (car body)))
(setq body (cdr body))
(pcase keyw
(`:init-value (setq init-value (pop body)))
(`:lighter (setq lighter (purecopy (pop body))))
(`:global (setq globalp (pop body))
(when (and globalp (symbolp mode))
(setq setter `(setq-default ,mode))
(setq getter `(default-value ',mode))))
(`:extra-args (setq extra-args (pop body)))
(`:set (setq set (list :set (pop body))))
(`:initialize (setq initialize (list :initialize (pop body))))
(`:group (setq group (nconc group (list :group (pop body)))))
(`:type (setq type (list :type (pop body))))
(`:require (setq require (pop body)))
(`:keymap (setq keymap (pop body)))
(`:variable (setq variable (pop body))
(if (not (and (setq tmp (cdr-safe variable))
(or (symbolp tmp)
(functionp tmp))))
;; PLACE is not of the form (GET . SET).
(progn
(setq setter `(setf ,variable))
(setq getter variable))
(setq getter (car variable))
(setq setter `(funcall #',(cdr variable)))))
(`:after-hook (setq after-hook (pop body)))
(:init-value (setq init-value (pop body)))
(:lighter (setq lighter (purecopy (pop body))))
(:global (setq globalp (pop body))
(when (and globalp (symbolp mode))
(setq setter `(setq-default ,mode))
(setq getter `(default-value ',mode))))
(:extra-args (setq extra-args (pop body)))
(:set (setq set (list :set (pop body))))
(:initialize (setq initialize (list :initialize (pop body))))
(:group (setq group (nconc group (list :group (pop body)))))
(:type (setq type (list :type (pop body))))
(:require (setq require (pop body)))
(:keymap (setq keymap (pop body)))
(:variable (setq variable (pop body))
(if (not (and (setq tmp (cdr-safe variable))
(or (symbolp tmp)
(functionp tmp))))
;; PLACE is not of the form (GET . SET).
(progn
(setq setter `(setf ,variable))
(setq getter variable))
(setq getter (car variable))
(setq setter `(funcall #',(cdr variable)))))
(:after-hook (setq after-hook (pop body)))
(_ (push keyw extra-keywords) (push (pop body) extra-keywords))))
(setq keymap-sym (if (and keymap (symbolp keymap)) keymap
......@@ -407,8 +407,8 @@ on if the hook has explicitly disabled it."
(while (keywordp (setq keyw (car keys)))
(setq keys (cdr keys))
(pcase keyw
(`:group (setq group (nconc group (list :group (pop keys)))))
(`:global (setq keys (cdr keys)))
(:group (setq group (nconc group (list :group (pop keys)))))
(:global (setq keys (cdr keys)))
(_ (push keyw extra-keywords) (push (pop keys) extra-keywords))))
(unless group
......@@ -533,11 +533,11 @@ Valid keywords and arguments are:
(let ((key (pop args))
(val (pop args)))
(pcase key
(`:name (setq name val))
(`:dense (setq dense val))
(`:inherit (setq inherit val))
(`:suppress (setq suppress val))
(`:group)
(:name (setq name val))
(:dense (setq dense val))
(:inherit (setq inherit val))
(:suppress (setq suppress val))
(:group)
(_ (message "Unknown argument %s in defmap" key)))))
(unless (keymapp m)
(setq bs (append m bs))
......
......@@ -226,14 +226,14 @@ possibly preceded by keyword pairs as described in `easy-menu-define'."
(let ((arg (cadr menu-items)))
(setq menu-items (cddr menu-items))
(pcase keyword
(`:filter
(:filter
(setq filter (lambda (menu)
(easy-menu-filter-return (funcall arg menu)
menu-name))))
((or `:enable `:active) (setq enable (or arg ''nil)))
(`:label (setq label arg))
(`:help (setq help arg))
((or `:included `:visible) (setq visible (or arg ''nil))))))
((or :enable :active) (setq enable (or arg ''nil)))
(:label (setq label arg))
(:help (setq help arg))
((or :included :visible) (setq visible (or arg ''nil))))))
(if (equal visible ''nil)
nil ; Invisible menu entry, return nil.
(if (and visible (not (easy-menu-always-true-p visible)))
......@@ -325,15 +325,15 @@ ITEM defines an item as in `easy-menu-define'."
(setq arg (aref item (1+ count)))
(setq count (+ 2 count))
(pcase keyword
((or `:included `:visible) (setq visible (or arg ''nil)))
(`:key-sequence (setq cache arg cache-specified t))
(`:keys (setq keys arg no-name nil))
(`:label (setq label arg))
((or `:active `:enable) (setq active (or arg ''nil)))
(`:help (setq prop (cons :help (cons arg prop))))
(`:suffix (setq suffix arg))
(`:style (setq style arg))
(`:selected (setq selected (or arg ''nil)))))
((or :included :visible) (setq visible (or arg ''nil)))
(:key-sequence (setq cache arg cache-specified t))
(:keys (setq keys arg no-name nil))
(:label (setq label arg))
((or :active :enable) (setq active (or arg ''nil)))
(:help (setq prop (cons :help (cons arg prop))))
(:suffix (setq suffix arg))
(:style (setq style arg))
(:selected (setq selected (or arg ''nil)))))
(if suffix
(setq label
(if (stringp suffix)
......
......@@ -388,9 +388,9 @@ See `defclass' for more information."
;; Clean up the meaning of protection.
(setq prot
(pcase prot
((or 'nil 'public ':public) nil)
((or 'protected ':protected) 'protected)
((or 'private ':private) 'private)
((or 'nil 'public :public) nil)
((or 'protected :protected) 'protected)
((or 'private :private) 'private)
(_ (signal 'invalid-slot-type (list :protection prot)))))
;; The default type specifier is supposed to be t, meaning anything.
......
......@@ -2911,17 +2911,17 @@ PKG is a `package-desc' object.
Return (PKG-DESC [NAME VERSION STATUS DOC])."
(let* ((status (package-desc-status pkg))
(face (pcase status
(`"built-in" 'package-status-built-in)
(`"external" 'package-status-external)
(`"available" 'package-status-available)
(`"avail-obso" 'package-status-avail-obso)
(`"new" 'package-status-new)
(`"held" 'package-status-held)
(`"disabled" 'package-status-disabled)
(`"installed" 'package-status-installed)
(`"dependency" 'package-status-dependency)
(`"unsigned" 'package-status-unsigned)
(`"incompat" 'package-status-incompat)
("built-in" 'package-status-built-in)
("external" 'package-status-external)
("available" 'package-status-available)
("avail-obso" 'package-status-avail-obso)
("new" 'package-status-new)
("held" 'package-status-held)
("disabled" 'package-status-disabled)
("installed" 'package-status-installed)
("dependency" 'package-status-dependency)
("unsigned" 'package-status-unsigned)
("incompat" 'package-status-incompat)
(_ 'font-lock-warning-face)))) ; obsolete.
(list pkg
`[(,(symbol-name (package-desc-name pkg))
......
......@@ -1856,9 +1856,9 @@ KEYWORDS are additional arguments, which can use the following keywords:
(let ((k (pop keywords))
(v (pop keywords)))
(pcase k
(`:forward-token
(:forward-token
(set (make-local-variable 'smie-forward-token-function) v))
(`:backward-token
(:backward-token
(set (make-local-variable 'smie-backward-token-function) v))
(_ (message "smie-setup: ignoring unknown keyword %s" k)))))
(let ((ca (cdr (assq :smie-closer-alist grammar))))
......
......@@ -1084,27 +1084,27 @@ of a set of discrete values. Value is `integerp' if ATTRIBUTE expects
an integer value."
(let ((valid
(pcase attribute
(`:family
(:family
(if (window-system frame)
(mapcar (lambda (x) (cons x x))
(font-family-list))
;; Only one font on TTYs.
(list (cons "default" "default"))))
(`:foundry
(:foundry
(list nil))
(`:width
(:width
(mapcar #'(lambda (x) (cons (symbol-name (aref x 1)) (aref x 1)))
font-width-table))
(`:weight
(:weight
(mapcar #'(lambda (x) (cons (symbol-name (aref x 1)) (aref x 1)))
font-weight-table))
(`:slant
(:slant
(mapcar #'(lambda (x) (cons (symbol-name (aref x 1)) (aref x 1)))
font-slant-table))
(`:inverse-video
(:inverse-video
(mapcar #'(lambda (x) (cons (symbol-name x) x))
(internal-lisp-face-attribute-values attribute)))
((or `:underline `:overline `:strike-through `:box)
((or :underline :overline :strike-through :box)
(if (window-system frame)
(nconc (mapcar #'(lambda (x) (cons (symbol-name x) x))
(internal-lisp-face-attribute-values attribute))
......@@ -1112,12 +1112,12 @@ an integer value."
(defined-colors frame)))
(mapcar #'(lambda (x) (cons (symbol-name x) x))
(internal-lisp-face-attribute-values attribute))))
((or `:foreground `:background)
((or :foreground :background)
(mapcar #'(lambda (c) (cons c c))
(defined-colors frame)))
(`:height
(:height
'integerp)
(`:stipple
(:stipple
(and (memq (window-system frame) '(x ns)) ; No stipple on w32
(mapcar #'list
(apply #'nconc
......@@ -1126,7 +1126,7 @@ an integer value."
(file-directory-p dir)
(directory-files dir)))
x-bitmap-file-path)))))
(`:inherit
(:inherit
(cons '("none" . nil)
(mapcar #'(lambda (c) (cons (symbol-name c) c))
(face-list))))
......
......@@ -1559,7 +1559,7 @@ SAVE-FUNCTION takes no argument, but works on the current buffer."
(defun filesets-get-fileset-from-name (name &optional mode)
"Get fileset definition for NAME."
(pcase mode
((or `:ingroup `:tree) name)
((or :ingroup :tree) name)
(_ (assoc name filesets-data))))
......
......@@ -232,11 +232,11 @@
;; FIXME: "^." are two tokens, not one.
(defun m2-smie-forward-token ()
(pcase (smie-default-forward-token)
(`"VAR" (if (zerop (car (syntax-ppss))) "VAR" "VAR-arg"))
(`"CONST" (if (zerop (car (syntax-ppss))) "CONST" "CONST-arg"))
(`";" (save-excursion (m2-smie-refine-semi)))
(`"OF" (save-excursion (forward-char -2) (m2-smie-refine-of)))
(`":" (save-excursion (forward-char -1) (m2-smie-refine-colon)))
("VAR" (if (zerop (car (syntax-ppss))) "VAR" "VAR-arg"))
("CONST" (if (zerop (car (syntax-ppss))) "CONST" "CONST-arg"))
(";" (save-excursion (m2-smie-refine-semi)))
("OF" (save-excursion (forward-char -2) (m2-smie-refine-of)))
(":" (save-excursion (forward-char -1) (m2-smie-refine-colon)))
;; (`"END" (if (and (looking-at "[ \t\n]*\\(\\(?:\\sw\\|\\s_\\)+\\)")
;; (not (assoc (match-string 1) m2-smie-grammar)))
;; "END-proc" "END"))
......@@ -244,11 +244,11 @@
(defun m2-smie-backward-token ()
(pcase (smie-default-backward-token)
(`"VAR" (if (zerop (car (syntax-ppss))) "VAR" "VAR-arg"))
(`"CONST" (if (zerop (car (syntax-ppss))) "CONST" "CONST-arg"))
(`";" (save-excursion (forward-char 1) (m2-smie-refine-semi)))
(`"OF" (save-excursion (m2-smie-refine-of)))
(`":" (save-excursion (m2-smie-refine-colon)))
("VAR" (if (zerop (car (syntax-ppss))) "VAR" "VAR-arg"))
("CONST" (if (zerop (car (syntax-ppss))) "CONST" "CONST-arg"))
(";" (save-excursion (forward-char 1) (m2-smie-refine-semi)))
("OF" (save-excursion (m2-smie-refine-of)))
(":" (save-excursion (m2-smie-refine-colon)))
;; (`"END" (if (and (looking-at "\\sw+[ \t\n]+\\(\\(?:\\sw\\|\\s_\\)+\\)")
;; (not (assoc (match-string 1) m2-smie-grammar)))
;; "END-proc" "END"))
......@@ -272,7 +272,7 @@
(pcase (cons kind token)
(`(:elem . basic) m2-indent)
(`(:after . ":=") (or m2-indent smie-indent-basic))
(`(:after . ,(or `"CONST" `"VAR" `"TYPE"))
(`(:after . ,(or "CONST" "VAR" "TYPE"))
(or m2-indent smie-indent-basic))
;; (`(:before . ,(or `"VAR" `"TYPE" `"CONST"))
;; (if (smie-rule-parent-p "PROCEDURE") 0))
......
......@@ -1065,8 +1065,8 @@ directory and makes this the current buffer's default directory."
(unless found (goto-char orig))
found))))
(pcase (and buffer-file-name (file-name-extension buffer-file-name))
(`"cc" (funcall search
"\\_<DEFUN\\(?:_DLD\\)?\\s-*(\\s-*\\(\\(?:\\sw\\|\\s_\\)+\\)" 1))
("cc" (funcall search
"\\_<DEFUN\\(?:_DLD\\)?\\s-*(\\s-*\\(\\(?:\\sw\\|\\s_\\)+\\)" 1))
(_ (funcall search octave-function-header-regexp 3)))))
(defun octave-function-file-p ()
......@@ -1135,19 +1135,19 @@ q: Don't fix\n" func file))
(read-char-choice
"Which name to use? (a/b/q) " '(?a ?b ?q))))))
(pcase c
(`?a (let ((newname (expand-file-name
(concat func (file-name-extension
buffer-file-name t)))))
(when (or (not (file-exists-p newname))
(yes-or-no-p
(format "Target file %s exists; proceed? " newname)))
(when (file-exists-p buffer-file-name)
(rename-file buffer-file-name newname t))
(set-visited-file-name newname))))
(`?b (save-excursion
(goto-char name-start)
(delete-region name-start name-end)
(insert file)))))))))
(?a (let ((newname (expand-file-name
(concat func (file-name-extension
buffer-file-name t)))))
(when (or (not (file-exists-p newname))
(yes-or-no-p
(format "Target file %s exists; proceed? " newname)))
(when (file-exists-p buffer-file-name)
(rename-file buffer-file-name newname t))
(set-visited-file-name newname))))
(?b (save-excursion
(goto-char name-start)
(delete-region name-start name-end)
(insert file)))))))))
(defun octave-update-function-file-comment (beg end)
"Query replace function names in function file comment."
......@@ -1801,19 +1801,19 @@ If the environment variable OCTAVE_SRCDIR is set, it is searched first."
(defun octave-find-definition-default-filename (name)
"Default value for `octave-find-definition-filename-function'."
(pcase (file-name-extension name)
(`"oct"
("oct"
(octave-find-definition-default-filename
(concat "libinterp/dldfcn/"
(file-name-sans-extension (file-name-nondirectory name))
".cc")))
(`"cc"
("cc"
(let ((file (or (locate-file name (octave-source-directories))
(locate-file (file-name-nondirectory name)
(octave-source-directories)))))
(or (and file (file-exists-p file))
(error "File `%s' not found" name))
file))
(`"mex"
("mex"
(if (yes-or-no-p (format-message "File `%s' may be binary; open? "
(file-name-nondirectory name)))
name
......
......@@ -393,17 +393,17 @@ routine.")
(if (null (nth 8 ppss))
(when (looking-at opascal--literal-start-re)
(pcase (char-after)
(`?/ 'comment-single-line)
(`?\{ 'comment-multi-line-1)
(`?\( 'comment-multi-line-2)
(`?\' 'string)
(`?\" 'double-quoted-string)))
(?/ 'comment-single-line)
(?\{ 'comment-multi-line-1)
(?\( 'comment-multi-line-2)
(?\' 'string)
(?\" 'double-quoted-string)))
(if (nth 3 ppss) ;String.
(if (eq (nth 3 ppss) ?\")
'double-quoted-string 'string)
(pcase (nth 7 ppss)
(`2 'comment-single-line)
(`1 'comment-multi-line-2)
(2 'comment-single-line)
(1 'comment-multi-line-2)
(_ 'comment-multi-line-1))))))))
(defun opascal-literal-start-pattern (literal-kind)
......
......@@ -323,8 +323,8 @@
(cons (car (string-to-syntax "< c"))
;; Remember the names of heredocs found on this line.
(cons (cons (pcase (aref name 0)
(`?\\ (substring name 1))
((or `?\" `?\' `?\`) (substring name 1 -1))
(?\\ (substring name 1))
((or ?\" ?\' ?\`) (substring name 1 -1))
(_ name))
indented)
(cdr st)))))))
......
......@@ -954,9 +954,9 @@ This is really kludgy, and unneeded (i.e. obsolete) in Emacs>=24."
;; -> thenrule
;; ; elserule
;; )
(`(:before . ,(or `"->" `";"))
(`(:before . ,(or "->" ";"))
(and (smie-rule-bolp) (smie-rule-parent-p "(") (smie-rule-parent 0)))
(`(:after . ,(or `"->" `"*->"))
(`(:after . ,(or "->" "*->"))
;; We distinguish
;;
;; (a ->
......@@ -3247,11 +3247,11 @@ the following comma and whitespace, if any."
(defun prolog-post-self-insert ()
(pcase last-command-event
(`?_ (prolog-electric--underscore))
(`?- (prolog-electric--dash))
(`?: (prolog-electric--colon))
((or `?\( `?\; `?>) (prolog-electric--if-then-else))
(`?. (prolog-electric--dot))))
(?_ (prolog-electric--underscore))
(?- (prolog-electric--dash))
(?: (prolog-electric--colon))
((or ?\( ?\; ?>) (prolog-electric--if-then-else))
(?. (prolog-electric--dot))))
(defun prolog-find-term (functor arity &optional prefix)
"Go to the position at the start of the next occurrence of a term.
......
......@@ -612,7 +612,7 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'."
;; For (invalid) code between switch and case.
;; (if (smie-parent-p "switch") 4)
))
(`(:before . ,(or `"(" `"[" `"{"))
(`(:before . ,(or "(" "[" "{"))
(cond
((and (equal token "{")
(not (smie-rule-prev-p "(" "{" "[" "," "=>" "=" "return" ";"))
......@@ -639,7 +639,7 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'."
(forward-char -1))
(smie-indent-virtual))
(t (smie-rule-parent))))))
(`(:after . ,(or `"(" "[" "{"))
(`(:after . ,(or "(" "[" "{"))
;; FIXME: Shouldn't this be the default behavior of
;; `smie-indent-after-keyword'?
(save-excursion
......@@ -660,7 +660,7 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'."
(smie-backward-sexp ".")
(cons 'column (+ (current-column)
ruby-indent-level))))
(`(:before . ,(or `"else" `"then" `"elsif" `"rescue" `"ensure"))
(`(:before . ,(or "else" "then" "elsif" "rescue" "ensure"))
(smie-rule-parent))
(`(:before . "when")
;; Align to the previous `when', but look up the virtual
......@@ -1544,8 +1544,8 @@ With ARG, do it many times. Negative ARG means move forward."
(cond ((looking-at "\\s)")
(goto-char (scan-sexps (1+ (point)) -1))
(pcase (char-before)
(`?% (forward-char -1))
((or `?q `?Q `?w `?W `?r `?x)
(?% (forward-char -1))
((or ?q ?Q ?w ?W ?r ?x)
(if (eq (char-before (1- (point))) ?%)
(forward-char -2))))
nil)
......@@ -1562,13 +1562,13 @@ With ARG, do it many times. Negative ARG means move forward."
(forward-char 1)
(while (progn (forward-word-strictly -1)
(pcase (char-before)
(`?_ t)
(`?. (forward-char -1) t)
((or `?$ `?@)
(?_ t)
(?. (forward-char -1) t)
((or ?$ ?@)
(forward-char -1)
(and (eq (char-before) (char-after))
(forward-char -1)))
(`?:
(?:
(forward-char -1)
(eq (char-before) :)))))
(if (looking-at ruby-block-end-re)
......
......@@ -959,8 +959,8 @@ See `sh-feature'.")
;; ((...)) or $((...)) or $[...] or ${...}. Nested
;; parenthesis can occur inside the first of these forms, so
;; parse backward recursively.
(`?\( (eq ?\( (char-before)))
((or `?\{ `?\[) (eq ?\$ (char-before))))
(?\( (eq ?\( (char-before)))
((or ?\{ ?\[) (eq ?\$ (char-before))))
(sh--inside-noncommand-expression (1- (point))))))))
(defun sh-font-lock-open-heredoc (start string eol)
......@@ -2038,7 +2038,7 @@ May return nil if the line should not be treated as continued."
(`(:elem . basic) sh-basic-offset)
(`(:after . "case-)") (- (sh-var-value 'sh-indent-for-case-alt)
(sh-var-value 'sh-indent-for-case-label)))
(`(:before . ,(or `"(" `"{" `"[" "while" "if" "for" "case"))
(`(:before . ,(or "(" "{" "[" "while" "if" "for" "case"))
(if (not (smie-rule-prev-p "&&" "||" "|"))
(when (smie-rule-hanging-p)
(smie-rule-parent))
......@@ -2047,11 +2047,11 @@ May return nil if the line should not be treated as continued."
`(column . ,(smie-indent-virtual)))))
;; FIXME: Maybe this handling of ;; should be made into
;; a smie-rule-terminator function that takes the substitute ";" as arg.
(`(:before . ,(or `";;" `";&" `";;&"))
(`(:before . ,(or ";;" ";&" ";;&"))
(if (and (smie-rule-bolp) (looking-at ";;?&?[ \t]*\\(#\\|$\\)"))
(cons 'column (smie-indent-keyword ";"))
(smie-rule-separator kind)))
(`(:after . ,(or `";;" `";&" `";;&"))
(`(:after . ,(or ";;" ";&" ";;&"))
(with-demoted-errors
(smie-backward-sexp token)
(cons 'column
......@@ -2062,7 +2062,7 @@ May return nil if the line should not be treated as continued."
(smie-rule-bolp))))
(current-column)
(smie-indent-calculate)))))
(`(:before . ,(or `"|" `"&&" `"||"))
(`(:before . ,(or "|" "&&" "||"))
(unless (smie-rule-parent-p token)
(smie-backward-sexp token)
`(column . ,(+ (funcall smie-rules-function :elem