Clean up my/bibtex-in-entry-p
This commit is contained in:
parent
641aa325dc
commit
427b70f347
19
init.el
19
init.el
@ -1623,21 +1623,10 @@ COMMAND and COMINT are like `compile'."
|
|||||||
When EXCLUDE-BRACES is non-nil, don't count the first and last brace of the
|
When EXCLUDE-BRACES is non-nil, don't count the first and last brace of the
|
||||||
entry as in the entry. That is, if the point is on the first { or last } of the
|
entry as in the entry. That is, if the point is on the first { or last } of the
|
||||||
entry, return nil."
|
entry, return nil."
|
||||||
(save-excursion
|
(cl-destructuring-bind (depth &rest r) (syntax-ppss)
|
||||||
(when (and exclude-braces (eq ?\} (char-after)))
|
(if (zerop depth)
|
||||||
(forward-char))
|
(and (not exclude-braces) (eql (char-after) ?\{))
|
||||||
;; go to top level and check if the character at point is {
|
(or (not exclude-braces) (not (eql (char-after) ?\}))))))
|
||||||
(let ((start-pos (point))
|
|
||||||
(last-valid (point)))
|
|
||||||
(condition-case nil
|
|
||||||
(while t
|
|
||||||
(backward-up-list 1 t t)
|
|
||||||
(setq last-valid (point)))
|
|
||||||
(error
|
|
||||||
(and
|
|
||||||
(eq ?\{ (char-after last-valid))
|
|
||||||
(or (not exclude-braces)
|
|
||||||
(not (= start-pos last-valid)))))))))
|
|
||||||
(defvar my/bibtex-indent-width 4
|
(defvar my/bibtex-indent-width 4
|
||||||
"Width to indent for `my/bibtex-calculate-indentation'.")
|
"Width to indent for `my/bibtex-calculate-indentation'.")
|
||||||
(defun my/bibtex-calculate-indentation ()
|
(defun my/bibtex-calculate-indentation ()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user