bbatsov/emacs-lisp-style-guide 888
A community-driven Emacs Lisp style guide
dgutov/diff-hl 577
Emacs package for highlighting uncommitted changes
company-mode/company-quickhelp 302
Documentation popup for Company
dgutov/highlight-escape-sequences 39
Highlight escape sequences in Emacs
Quickly replace an existing bookmark in Mozilla Firefox
color-theme based on the default theme for Espresso
My .emacs.d directory
Simple Rails-like blog with comments and user authentication.
Because the Emacs defaults are not so great sometimes.
the definitive emacs customizations for people who are OCD about whitespace
issue commentcompany-mode/company-mode
How to display regexp-filtered results on the incremental drop-down menu?
I mean, say, for the Dirac notation, there is no any icons rendered in the middle column of the drop-down menu.

comment created time in 6 minutes
issue commentcompany-mode/company-mode
How to display regexp-filtered results on the incremental drop-down menu?
Another issue I want to know if why some commands have icons, others don't, shown on the countdown second column.
comment created time in 25 minutes
issue closedcompany-mode/company-mode
On Ubuntu 20.04, I'm using auctex, eglot, texlab, and company as my Emacs based LaTeX document preparation system.
The detailed settings are described here. The company relevant configuration is shown below:
(use-package company)
(add-hook 'after-init-hook 'global-company-mode)
And the real effect is represented in the following screenshot:

But, I want to know if it's possible to do the regexp-based search and completion result filtering displayed on the incremental drop-down menu. For example, if I typeset \?*arrow*, then all LaTeX commands including arrow will be shown up in the drop-down menu list.
Any hints for this feature will be highly appreciated.
Regards, HY
closed time in 15 hours
hongyi-zhaoissue commentcompany-mode/company-mode
Really/exactly. Wonderful. Thank you for your comments. See the screenshot below:

comment created time in 15 hours
issue openedcompany-mode/company-mode
On Ubuntu 20.04, I'm using auctex, eglot, texlab, and company as my Emacs based LaTeX document preparation system.
The detailed settings are described here. The company relevant configuration is shown below:
(use-package company)
(add-hook 'after-init-hook 'global-company-mode)
And the real effect is represented in the following screenshot:

But, I want to know if it's possible to do the regexp-based search and completion result filtering displayed on the incremental drop-down menu. For example, if I typeset \?*arrow*, then all LaTeX commands including arrow will be shown up in the drop-down menu list.
Any hints for this feature will be highly appreciated.
Regards, HY
created time in a day
issue commentcompany-mode/company-mode
backend company-capf error "Args out of range: "
Thanks for the quick reply.
I get the same error if I invoke company-diag in the buffer that caused the error reported above. But if I invoke it in another buffer, this is what it returns:
Emacs 28.0.50 (x86_64-apple-darwin20.5.0) of 2021-06-03 on 192.168.1.3
Company 0.9.13
company-backends: (company-capf company-keywords company-semantic company-files company-etags company-clang company-cmake company-ispell company-yasnippet)
Used backend: company-ispell
Major mode: org-mode
comment created time in 2 days
starteddgutov/diff-hl
started time in 2 days
starteddgutov/diff-hl
started time in 2 days
issue openedcompany-mode/company-mode
backend company-capf error "Args out of range: "
I've been getting a backend company-capf error "Args out of range: " error for a few weeks, which I haven't been able to fix or diagnose (I'm not a programmer and am relatively new to Emacs, so apologies if the cause is obvious).
Here is the backtrace:
Debugger entered--Lisp error: (args-out-of-range " to the transitions involved in the agricultural o..." 0 63)
completion-pcm--find-all-completions(" to the transitions involved in the agricultural o..." #f(compiled-function (string pred action) #<bytecode -0x1543e01145f4150e>) #f(compiled-function (f) #<bytecode -0x20bf05604b2064f>) 62 identity)
completion-pcm--find-all-completions(" to the transitions involved in the agricultural o..." #f(compiled-function (string pred action) #<bytecode -0x1543e01145f4150e>) #f(compiled-function (f) #<bytecode -0x20bf05604b2064f>) 63)
completion-pcm-all-completions(" to the transitions involved in the agricultural o..." #f(compiled-function (string pred action) #<bytecode -0x1543e01145f4150e>) #f(compiled-function (f) #<bytecode -0x20bf05604b2064f>) 63)
#f(compiled-function (style) #<bytecode -0x1f74fcdb728cbbe4>)(partial-completion)
completion--some(#f(compiled-function (style) #<bytecode -0x1f74fcdb728cbbe4>) (basic partial-completion emacs22))
completion--nth-completion(2 " to the transitions involved in the agricultural o..." #f(compiled-function (string pred action) #<bytecode -0xe2cae3d89e479fe>) #f(compiled-function (f) #<bytecode -0x20bf05604b2064f>) 63 (metadata (completion--unquote-requote . t)))
completion-all-completions(" to the transitions involved in the agricultural o..." #f(compiled-function (string pred action) #<bytecode -0xe2cae3d89e479fe>) #f(compiled-function (f) #<bytecode -0x20bf05604b2064f>) 63 (metadata (completion--unquote-requote . t)))
company-capf--candidates(" to the transitions involved in the agricultural o...")
company-capf(candidates " to the transitions involved in the agricultural o...")
apply(company-capf (candidates " to the transitions involved in the agricultural o..."))
(if (functionp company-backend) (apply company-backend args) (apply #'company--multi-backend-adapter company-backend args))
(condition-case err (if (functionp company-backend) (apply company-backend args) (apply #'company--multi-backend-adapter company-backend args)) ((debug user-error) (user-error "Company: backend %s user-error: %s" company-backend (error-message-string err))) ((debug error) (error "Company: backend %s error \"%s\" with args %s" company-backend (error-message-string err) args)))
company-call-backend-raw(candidates " to the transitions involved in the agricultural o...")
(if (or company-selection-changed (company-require-match-p)) (company-call-backend 'candidates prefix) (company-call-backend-raw 'candidates prefix))
(let* ((non-essential (not (company-explicit-action-p))) (inhibit-redisplay t) (c (if (or company-selection-changed (company-require-match-p)) (company-call-backend 'candidates prefix) (company-call-backend-raw 'candidates prefix)))) (if (not (eq (car c) :async)) c (let ((res 'none)) (funcall (cdr c) #'(lambda (candidates) (if (eq res ...) (progn ...)) (setq res candidates))) (if (company--flyspell-workaround-p) (while (and (eq res 'none) (not (input-pending-p))) (sleep-for company-async-wait)) (while (and (eq res 'none) (sit-for 0.5 t)))) (while (member (car unread-command-events) '(company-foo (t . company-foo))) (car-safe (prog1 unread-command-events (setq unread-command-events (cdr unread-command-events))))) (prog1 (and (consp res) res) (setq res 'exited)))))
company--fetch-candidates(" to the transitions involved in the agricultural o...")
(company--preprocess-candidates (company--fetch-candidates prefix))
(setq candidates (company--preprocess-candidates (company--fetch-candidates prefix)))
(progn (setq candidates (company--preprocess-candidates (company--fetch-candidates prefix))) (setq company-candidates-cache (cons (cons prefix candidates) company-candidates-cache)))
(or candidates (if company-candidates-cache (progn (let ((len (length prefix)) (completion-ignore-case ignore-case) prev) (catch '--cl-block-nil-- (let ((--dotimes-limit-- ...) (--dotimes-counter-- 0)) (while (< --dotimes-counter-- --dotimes-limit--) (let ... ...) (setq --dotimes-counter-- ...))))))) (progn (setq candidates (company--preprocess-candidates (company--fetch-candidates prefix))) (setq company-candidates-cache (cons (cons prefix candidates) company-candidates-cache))))
(let ((candidates (cdr (assoc prefix company-candidates-cache)))) (or candidates (if company-candidates-cache (progn (let ((len (length prefix)) (completion-ignore-case ignore-case) prev) (catch '--cl-block-nil-- (let (... ...) (while ... ... ...)))))) (progn (setq candidates (company--preprocess-candidates (company--fetch-candidates prefix))) (setq company-candidates-cache (cons (cons prefix candidates) company-candidates-cache)))) (company--postprocess-candidates candidates))
company-calculate-candidates(" to the transitions involved in the agricultural o..." nil)
(setq company-prefix (company--prefix-str prefix) company-backend backend c (company-calculate-candidates company-prefix ignore-case))
(let ((ignore-case (company-call-backend 'ignore-case))) (setq company-prefix (company--prefix-str prefix) company-backend backend c (company-calculate-candidates company-prefix ignore-case)) (cond ((and (company--unique-match-p c company-prefix ignore-case) (if company--manual-action (ignore (message "Sole completion")) t)) (company-cancel 'unique)) ((null c) (if company--manual-action (progn (message "No completion found")))) (t (if company--manual-action (progn (setq company--manual-prefix prefix))) (company-update-candidates c) (run-hook-with-args 'company-completion-started-hook (company-explicit-action-p)) (company-call-frontends 'show))))
(progn (let ((ignore-case (company-call-backend 'ignore-case))) (setq company-prefix (company--prefix-str prefix) company-backend backend c (company-calculate-candidates company-prefix ignore-case)) (cond ((and (company--unique-match-p c company-prefix ignore-case) (if company--manual-action (ignore (message "Sole completion")) t)) (company-cancel 'unique)) ((null c) (if company--manual-action (progn (message "No completion found")))) (t (if company--manual-action (progn (setq company--manual-prefix prefix))) (company-update-candidates c) (run-hook-with-args 'company-completion-started-hook (company-explicit-action-p)) (company-call-frontends 'show)))))
(if (company--good-prefix-p prefix) (progn (let ((ignore-case (company-call-backend 'ignore-case))) (setq company-prefix (company--prefix-str prefix) company-backend backend c (company-calculate-candidates company-prefix ignore-case)) (cond ((and (company--unique-match-p c company-prefix ignore-case) (if company--manual-action (ignore ...) t)) (company-cancel 'unique)) ((null c) (if company--manual-action (progn (message "No completion found")))) (t (if company--manual-action (progn (setq company--manual-prefix prefix))) (company-update-candidates c) (run-hook-with-args 'company-completion-started-hook (company-explicit-action-p)) (company-call-frontends 'show))))))
(progn (if (company--good-prefix-p prefix) (progn (let ((ignore-case (company-call-backend 'ignore-case))) (setq company-prefix (company--prefix-str prefix) company-backend backend c (company-calculate-candidates company-prefix ignore-case)) (cond ((and (company--unique-match-p c company-prefix ignore-case) (if company--manual-action ... t)) (company-cancel 'unique)) ((null c) (if company--manual-action (progn ...))) (t (if company--manual-action (progn ...)) (company-update-candidates c) (run-hook-with-args 'company-completion-started-hook (company-explicit-action-p)) (company-call-frontends 'show)))))) (throw '--cl-block-nil-- c))
(if prefix (progn (if (company--good-prefix-p prefix) (progn (let ((ignore-case (company-call-backend ...))) (setq company-prefix (company--prefix-str prefix) company-backend backend c (company-calculate-candidates company-prefix ignore-case)) (cond ((and ... ...) (company-cancel ...)) ((null c) (if company--manual-action ...)) (t (if company--manual-action ...) (company-update-candidates c) (run-hook-with-args ... ...) (company-call-frontends ...)))))) (throw '--cl-block-nil-- c)))
(let ((backend (car --dolist-tail--))) (setq prefix (if (or (symbolp backend) (functionp backend)) (if (company--maybe-init-backend backend) (progn (let ((company-backend backend)) (company-call-backend 'prefix)))) (company--multi-backend-adapter backend 'prefix))) (if prefix (progn (if (company--good-prefix-p prefix) (progn (let ((ignore-case ...)) (setq company-prefix (company--prefix-str prefix) company-backend backend c (company-calculate-candidates company-prefix ignore-case)) (cond (... ...) (... ...) (t ... ... ... ...))))) (throw '--cl-block-nil-- c))) (setq --dolist-tail-- (cdr --dolist-tail--)))
(while --dolist-tail-- (let ((backend (car --dolist-tail--))) (setq prefix (if (or (symbolp backend) (functionp backend)) (if (company--maybe-init-backend backend) (progn (let (...) (company-call-backend ...)))) (company--multi-backend-adapter backend 'prefix))) (if prefix (progn (if (company--good-prefix-p prefix) (progn (let (...) (setq company-prefix ... company-backend backend c ...) (cond ... ... ...)))) (throw '--cl-block-nil-- c))) (setq --dolist-tail-- (cdr --dolist-tail--))))
(let ((--dolist-tail-- (if company-backend (list company-backend) company-backends))) (while --dolist-tail-- (let ((backend (car --dolist-tail--))) (setq prefix (if (or (symbolp backend) (functionp backend)) (if (company--maybe-init-backend backend) (progn (let ... ...))) (company--multi-backend-adapter backend 'prefix))) (if prefix (progn (if (company--good-prefix-p prefix) (progn (let ... ... ...))) (throw '--cl-block-nil-- c))) (setq --dolist-tail-- (cdr --dolist-tail--)))))
(catch '--cl-block-nil-- (let ((--dolist-tail-- (if company-backend (list company-backend) company-backends))) (while --dolist-tail-- (let ((backend (car --dolist-tail--))) (setq prefix (if (or (symbolp backend) (functionp backend)) (if (company--maybe-init-backend backend) (progn ...)) (company--multi-backend-adapter backend 'prefix))) (if prefix (progn (if (company--good-prefix-p prefix) (progn ...)) (throw '--cl-block-nil-- c))) (setq --dolist-tail-- (cdr --dolist-tail--))))))
(let (prefix c) (catch '--cl-block-nil-- (let ((--dolist-tail-- (if company-backend (list company-backend) company-backends))) (while --dolist-tail-- (let ((backend (car --dolist-tail--))) (setq prefix (if (or ... ...) (if ... ...) (company--multi-backend-adapter backend ...))) (if prefix (progn (if ... ...) (throw ... c))) (setq --dolist-tail-- (cdr --dolist-tail--)))))))
company--begin-new()
(cond (company-candidates (company--continue)) ((company--should-complete) (company--begin-new)))
company--perform()
(let ((inhibit-quit nil)) (company--perform) company-candidates)
(condition-case err (let ((inhibit-quit nil)) (company--perform) company-candidates) ((debug error) (message "Company: An error occurred in auto-begin") (message "%s" (error-message-string err)) (company-cancel)) ((debug quit) (company-cancel)))
(let ((company-idle-delay 'now)) (condition-case err (let ((inhibit-quit nil)) (company--perform) company-candidates) ((debug error) (message "Company: An error occurred in auto-begin") (message "%s" (error-message-string err)) (company-cancel)) ((debug quit) (company-cancel))))
(and company-mode (not company-candidates) (let ((company-idle-delay 'now)) (condition-case err (let ((inhibit-quit nil)) (company--perform) company-candidates) ((debug error) (message "Company: An error occurred in auto-begin") (message "%s" (error-message-string err)) (company-cancel)) ((debug quit) (company-cancel)))))
company-auto-begin()
(if (company-auto-begin) (progn (if (version< emacs-version "24.3.50") (progn (company-input-noop))) (let ((this-command 'company-idle-begin)) (company-post-command))))
(and (eq buf (current-buffer)) (eq win (selected-window)) (eq tick (buffer-chars-modified-tick)) (eq pos (point)) (if (company-auto-begin) (progn (if (version< emacs-version "24.3.50") (progn (company-input-noop))) (let ((this-command 'company-idle-begin)) (company-post-command)))))
company-idle-begin(#<buffer entries.org> #<window 75 on entries.org> 26181 587683)
apply(company-idle-begin (#<buffer entries.org> #<window 75 on entries.org> 26181 587683))
timer-event-handler([t 24778 2780 234888 nil company-idle-begin (#<buffer entries.org> #<window 75 on entries.org> 26181 587683) nil 0])
created time in 2 days
pull request commentcompany-mode/company-mode
I use my auto-compile, which compiles when saving, so I am immediately informed about mistakes I have just made. It is not 100% bullet-proof as some issue only become visible if you compile in a fresh environment, but it goes pretty far.
comment created time in 2 days
pull request commentcompany-mode/company-mode
What would be a recommended practice to avoid similar issues in future? The ones that come to my mind require to memorize an additional step:
- re-check each variable name with
C-h v, - recompile changed file(s). Could probably compilation stage be added to the package tests or github actions? (I'm not proficient with any of the mentioned, so just guessing.) Anyway, some automation might help I suppose. It should be possible to configure something locally, too, but that would not prevent other commits from similar issues.
comment created time in 2 days
Pull request review commentcompany-mode/company-mode
If SHOW-VERSION is non-nil, show the version in the echo area." 'company-scrollbar-fg 'company-scrollbar-bg))) -(defun company--scrollpos-line (text width right-margin-width)
done
comment created time in 2 days
PR opened company-mode/company-mode
lib/company/company.el:3221:1: Warning: Lexical argument
shadows the dynamic variable right-margin-width
pr created time in 2 days
issue commentjoaotavora/eglot
Using `eglot-alternatives` results in more calls to `executable-find` than necessary
@joaotavora Everything seems to work well for me with the latest commit (I tried both locally and over TRAMP). Thanks!
comment created time in 2 days
Pull request review commentcompany-mode/company-mode
Fix width of tooltip offset lines number display
If SHOW-VERSION is non-nil, show the version in the echo area." 'company-scrollbar-fg 'company-scrollbar-bg))) -(defun company--scrollpos-line (text width)+(defun company--scrollpos-line (text width right-margin-width)
Sure. And thank you for maintaining the packages!
comment created time in 3 days
issue commentcompany-mode/company-mode
Incremental drop-down menu completion for auctex through company-mode.
I'm still struggling to achieve a workable solution on this path. See here for some relevant discussions.
comment created time in 3 days
push eventtmalsburg/tango-plus-theme
commit sha 6ad64d82c8bd8c559b9023cd70b1c2d0c18e9060
Added bookmark-face Used in org to mark recent captures.
push time in 3 days
issue commentmooz/js2-mode
from the code this looks as if it should match, and it catches imports on top-level like this:
import(/* webpackChunkName: "some-dialog" */ 'path/to/some-dialog');
What can I do to make it work as preparation for a return-value, too?
export function someFun () {
return import(/* webpackChunkName: "some-dialog" */ 'path/to/some-dialog').then(({ SomeDialog }) => {
return new SomeDialog().show();
}).catch(error => console.log(error));
}
comment created time in 3 days
Pull request review commentcompany-mode/company-mode
Fix width of tooltip offset lines number display
If SHOW-VERSION is non-nil, show the version in the echo area." 'company-scrollbar-fg 'company-scrollbar-bg))) -(defun company--scrollpos-line (text width)+(defun company--scrollpos-line (text width right-margin-width)
Yes, I thought so initially and the initial implementations used the following approaches, none of which worked fine in my opinion. The current solution has its drawback too (confusing change of names), but reflects correctly the use of the width-value: we pass left-margin-width to be used as a right-margin-width. I'd be happy to improve relatively to the described issues, but nothing better comes to my mind at the moment.
- UI didn't look nice.
(concat (company-space-string left-margin-width)
(company-safe-substring text 0 width)
(company-space-string company-tooltip-margin)))
- Lost flexibility of configuring the right margin specifically (probably in the future).
(concat (company-space-string company-tooltip-margin)
(company-safe-substring text 0 (+ width left-margin-width)))
- Confusingly looking internals of
company--scrollpos-linefunction: why do we add left-margin to the right side of the line?
(concat (company-space-string company-tooltip-margin)
(company-safe-substring text 0 width)
(company-space-string left-margin-width)))
comment created time in 3 days
issue commentcompany-mode/company-mode
Incremental drop-down menu completion for auctex through company-mode.
Based on the comments here
This is the default backend if LSP layer is enabled. It provides proper IDE support and is recommended over company-auctex.
Currently, the LaTeX LSP backend depends on TexLab.
So, it seems that LSP oriented solution is more powerful. For LaTeX and fiends, this one comes into role.
comment created time in 3 days
issue commentcompany-mode/company-mode
Incremental drop-down menu completion for auctex through company-mode.
I tried company-auctex with the following in my ~/.emacs.d/init.el:
(straight-use-package
`( company-auctex :type git :host github :repo "hongyi-zhao/company-auctex"))
(require 'company-auctex)
(company-auctex-init)
But still failed to trigger the incremental drop-down completion menu, as shown below:

comment created time in 4 days
issue commentcompany-mode/company-mode
Incremental drop-down menu completion for auctex through company-mode.
Thank you for giving me insightful comments.
First of all, have you tried https://github.com/alexeyr/company-auctex?
TBF, I noticed the author said the following on this repo, so I haven't tried it yet:
Please note that I am currently not using Emacs for LaTeX and therefore not maintaining this actively.
comment created time in 4 days
issue openedcompany-mode/company-mode
Incremental drop-down menu completion for auctex through company-mode.
On Ubuntu 20.04, I installed auctex, ivy, and company-mode via straight.el with the following code snippet in ~/.emacs.d/init.el:
(straight-use-package
`( auctex :type git :host nil :repo "https://git.savannah.gnu.org/git/auctex.git"
:pre-build ,(pcase system-type
(`berkeley-unix '("gmake"))
(_ '(
;("bash" "-c" "cd ~/.emacs.d/straight/repos/auctex")
("./autogen.sh")
("./configure")
("make")
("sudo" "make" "install"))))))
(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)
(straight-use-package
`( swiper :type git :host github :repo "abo-abo/swiper"
:pre-build (
;("bash" "-c" "cd ~/.emacs.d/straight/repos/swiper")
;https://github.com/abo-abo/swiper/issues/2886#issuecomment-860605327
("make" "deps")
("make" "compile")
)))
;(add-to-list 'load-path "~/.emacs.d/straight/repos/swiper/")
(require 'ivy)
(ivy-mode 1)
(setq ivy-use-virtual-buffers t)
(setq ivy-count-format "(%d/%d) ")
(use-package company)
(add-hook 'after-init-hook 'global-company-mode)
Then I test my above configurations with a minimal LaTeX file as shown below:
\documentclass{paper}
\usepackage{hyperref}
\begin{document}
Some testings come here.
\end{document}
created time in 4 days
PR opened company-mode/company-mode
The issue is visible with (setq company-tooltip-offset-display 'lines) and non-nil company-format-margin-function.
BTW, this 'lines feature is a very nice one.
before
after

pr created time in 4 days
issue commentmooz/js2-mode
Just noting another (related) use case for dynamic import is loadable components.
Would an approach for this be something like, modify js2-parse-import to bail if the import usage looks like a function call, ie, import is immediately followed by a left paren? If js2-parse-import bails, then would js2-parse-function-stmt simply parse it as a function call?
comment created time in 4 days
pull request commentcompany-mode/company-mode
Add faces for quick-access numbers
Hi Dmitry, It's now clear more or less what the terms would look like after closing the rest of the changes in work, so let's try to move on with this one, also resolving (for me) the trouble of having too many unfinished changes. Let me know what you think!
comment created time in 4 days