From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 27 15:01:01 2019 Received: (at submit) by debbugs.gnu.org; 27 Nov 2019 20:01:01 +0000 Received: from localhost ([127.0.0.1]:56242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ia3Uh-0005I8-58 for submit@debbugs.gnu.org; Wed, 27 Nov 2019 15:01:01 -0500 Received: from lists.gnu.org ([209.51.188.17]:58154) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ia3Ue-0005Hz-7Z for submit@debbugs.gnu.org; Wed, 27 Nov 2019 15:00:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60389) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ia3UW-0005dG-VP for bug-gnu-emacs@gnu.org; Wed, 27 Nov 2019 15:00:55 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ia3UP-00009R-VP for bug-gnu-emacs@gnu.org; Wed, 27 Nov 2019 15:00:48 -0500 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]:33657) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ia3UP-00005k-9K for bug-gnu-emacs@gnu.org; Wed, 27 Nov 2019 15:00:41 -0500 Received: by mail-lf1-x132.google.com with SMTP id d6so18191686lfc.0 for ; Wed, 27 Nov 2019 12:00:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=62iyDEK5YQG8T7xIhpNkxWQHHR2jFzkOWjQWpKWAiqI=; b=JkijSUwnUrRgVizQbZtG5hC/IBRVDAP5EfRaB9vaoRP8WmVHQ71MS7hEq+RoePCTJC hM0Nc4PyDarzm9vHLYABm2POwN2PLRiuqb7apWznc4N+nXB5AWg652uBN1mxhYUwUCMZ VXLKP4a1u9FH0tfrmxgKNw4SD2jWvtZw2j95j73oIJ8wufj/lCCbhn46Ecv1FTac8gor iAnkKOOKOBy0sDg4Gu7lDB7+YPY6Vxqfx/LbF7j+zOjf/YN6Z0sV8v7qL0uLhsdqi7p5 FiW2R2Z01eQMcrROLPgKA3RvGKAoatODFoo+Etab9C35SopEd+bx59Y9DjAHWtqRXQYx z4xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=62iyDEK5YQG8T7xIhpNkxWQHHR2jFzkOWjQWpKWAiqI=; b=MDiPcNYu5FxgBKlMT6c0uOEfVYfP60BeKfxm5KEeShEDXWaPPkLvhWDvbpVsnLJQb7 djWQbWLzzc6TY0zNpdKb8KgRyWNNNjL0m1NzL7V7iVhEraED7nLxEcOAirsehUMy04mE ygavLmpj3JOZo37MWmuNGpnkOY/eXLCV1rTIC+RGblZQup7Z7S5DVyhophtZ0l77F2VM +oZgMnXLuuAx8a8wvrYl0JYP61Uzz5RUYQxH5f+i7+Mgev+DjXvsTi5trFMrOIZitQLu nl3TSJSjuVoDSVsKJ83l6BA/BxCotve5EoiRiDeszKqNmntw7EsHCEhUM5RzFDOrRSDq xBpQ== X-Gm-Message-State: APjAAAVoRj/M0Ys6CtJlKXyYIgaZNNh3+Q48Nxu1V0NAXjsi3NokqrTk mu+gVdVZ7KS36SBFkgciqYRFMTAJZKdDSAZFb0qlI98i X-Google-Smtp-Source: APXvYqzlgLbEEdEKOhWNSSwY7yqwyPVXXBvy8TDVXZtuE8ywPyhWkpvvwYvqIF8Mo+dAcDJNvRh1NB72IZQDUkx8a6Q= X-Received: by 2002:ac2:5210:: with SMTP id a16mr30790742lfl.156.1574884837977; Wed, 27 Nov 2019 12:00:37 -0800 (PST) MIME-Version: 1.0 From: yyoncho Date: Wed, 27 Nov 2019 22:00:26 +0200 Message-ID: Subject: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="000000000000547bdf0598597355" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::132 X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --000000000000547bdf0598597355 Content-Type: text/plain; charset="UTF-8" As per post-self-insert-hook documentation. > Hook run at the end of `self-insert-command'. > This is run after inserting the character. This does not hold by default in cc-mode due to the following mapped by default functions: > (define-key c-mode-base-map "#" 'c-electric-pound) > (define-key c-mode-base-map "{" 'c-electric-brace) > (define-key c-mode-base-map "}" 'c-electric-brace) > (define-key c-mode-base-map "/" 'c-electric-slash) > (define-key c-mode-base-map "*" 'c-electric-star) > (define-key c-mode-base-map ";" 'c-electric-semi&comma) > (define-key c-mode-base-map "," 'c-electric-semi&comma) > (define-key c-mode-base-map ":" 'c-electric-colon) > (define-key c-mode-base-map "(" 'c-electric-paren) > (define-key c-mode-base-map ")" 'c-electric-paren) All of these functions (or at least majority) contain the following lines: > (let (post-self-insert-hook) ; Disable random functionality. > (self-insert-command (prefix-numeric-value arg))) Possible fixes: 1. Do not bind the functions by default. 2. Rewrite them so they do not inhibit post-self-insert-hook functions. In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.1) of 2019-11-23 built on kyoncho-H87-D3H Repository revision: 8934762bb37273e6606097de92dcc2556456acd2 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12001000 System Description: Linux Mint 19.1 Configured using: 'configure --with-modules --with-json' Configured features: XPM JPEG TIFF GIF PNG SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY GNUTLS LIBXML2 FREETYPE HARFBUZZ XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS JSON PDUMPER GMP Important settings: value of $LC_CTYPE: en_US.UTF-8 value of $LC_MONETARY: bg_BG.UTF-8 value of $LC_NUMERIC: bg_BG.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Emacs-Lisp Minor modes in effect: helm-spacemacs-help-mode: t global-magit-file-mode: t global-evil-surround-mode: t evil-surround-mode: t helm-descbinds-mode: t helm-mode: t helm-flx-mode: t dap-tooltip-mode: t dap-ui-mode: t gdb-many-windows: t dap-mode: t gradle-mode: t global-git-gutter+-mode: t global-git-commit-mode: t async-bytecomp-package-mode: t pupo-mode: t purpose-mode: t evil-escape-mode: t projectile-mode: t recentf-mode: t company-mode: t auto-compile-mode: t elisp-slime-nav-mode: t eval-sexp-fu-flash-mode: t goto-address-prog-mode: t bug-reference-prog-mode: t auto-highlight-symbol-mode: t flycheck-pos-tip-mode: t global-flycheck-mode: t highlight-numbers-mode: t highlight-parentheses-mode: t rainbow-delimiters-mode: t yas-global-mode: t yas-minor-mode: t evil-cleverparens-mode: t show-smartparens-global-mode: t show-smartparens-mode: t smartparens-mode: t persistent-scratch-autosave-mode: t winner-mode: t global-spacemacs-whitespace-cleanup-mode: t spacemacs-whitespace-cleanup-mode: t winum-mode: t global-vi-tilde-fringe-mode: t save-place-mode: t savehist-mode: t persp-mode: t global-hl-todo-mode: t hl-todo-mode: t global-fasd-mode: t eyebrowse-mode: t evil-mc-mode: t global-anzu-mode: t anzu-mode: t editorconfig-mode: t doom-modeline-mode: t clean-aindent-mode: t hybrid-mode: t which-key-mode: t override-global-mode: t global-undo-tree-mode: t undo-tree-mode: t shell-dirtrack-mode: t evil-mode: t evil-local-mode: t spacemacs-leader-override-mode: t global-spacemacs-leader-override-mode: t global-hl-line-mode: t xterm-mouse-mode: t global-auto-revert-mode: t ido-vertical-mode: t global-page-break-lines-mode: t page-break-lines-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t column-number-mode: t line-number-mode: t transient-mark-mode: t hs-minor-mode: t Load-path shadows: /home/kyoncho/.emacs.d/elpa/27.0/develop/ht-20190924.704/ht hides /home/kyoncho/.emacs.d/core/libs/ht /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-exp hides /usr/local/share/emacs/27.0.50/lisp/org/ob-exp /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-footnote hides /usr/local/share/emacs/27.0.50/lisp/org/org-footnote /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-scheme hides /usr/local/share/emacs/27.0.50/lisp/org/ob-scheme /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-entities hides /usr/local/share/emacs/27.0.50/lisp/org/org-entities /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-clojure hides /usr/local/share/emacs/27.0.50/lisp/org/ob-clojure /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ox-odt hides /usr/local/share/emacs/27.0.50/lisp/org/ox-odt /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-ledger hides /usr/local/share/emacs/27.0.50/lisp/org/ob-ledger /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ox-man hides /usr/local/share/emacs/27.0.50/lisp/org/ox-man /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-duration hides /usr/local/share/emacs/27.0.50/lisp/org/org-duration /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-core hides /usr/local/share/emacs/27.0.50/lisp/org/ob-core /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-css hides /usr/local/share/emacs/27.0.50/lisp/org/ob-css /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ox-org hides /usr/local/share/emacs/27.0.50/lisp/org/ox-org /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-sass hides /usr/local/share/emacs/27.0.50/lisp/org/ob-sass /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-maxima hides /usr/local/share/emacs/27.0.50/lisp/org/ob-maxima /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-matlab hides /usr/local/share/emacs/27.0.50/lisp/org/ob-matlab /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-ebnf hides /usr/local/share/emacs/27.0.50/lisp/org/ob-ebnf /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-ocaml hides /usr/local/share/emacs/27.0.50/lisp/org/ob-ocaml /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ox-ascii hides /usr/local/share/emacs/27.0.50/lisp/org/ox-ascii /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-lilypond hides /usr/local/share/emacs/27.0.50/lisp/org/ob-lilypond /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ox-md hides /usr/local/share/emacs/27.0.50/lisp/org/ox-md /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-timer hides /usr/local/share/emacs/27.0.50/lisp/org/org-timer /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-calc hides /usr/local/share/emacs/27.0.50/lisp/org/ob-calc /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-macro hides /usr/local/share/emacs/27.0.50/lisp/org/org-macro /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-attach hides /usr/local/share/emacs/27.0.50/lisp/org/org-attach /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-plantuml hides /usr/local/share/emacs/27.0.50/lisp/org/ob-plantuml /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-element hides /usr/local/share/emacs/27.0.50/lisp/org/org-element /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-eww hides /usr/local/share/emacs/27.0.50/lisp/org/org-eww /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-crypt hides /usr/local/share/emacs/27.0.50/lisp/org/org-crypt /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-forth hides /usr/local/share/emacs/27.0.50/lisp/org/ob-forth /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-clock hides /usr/local/share/emacs/27.0.50/lisp/org/org-clock /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-colview hides /usr/local/share/emacs/27.0.50/lisp/org/org-colview /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-w3m hides /usr/local/share/emacs/27.0.50/lisp/org/org-w3m /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-src hides /usr/local/share/emacs/27.0.50/lisp/org/org-src /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-vala hides /usr/local/share/emacs/27.0.50/lisp/org/ob-vala /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-stan hides /usr/local/share/emacs/27.0.50/lisp/org/ob-stan /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-gnus hides /usr/local/share/emacs/27.0.50/lisp/org/org-gnus /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-fortran hides /usr/local/share/emacs/27.0.50/lisp/org/ob-fortran /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-lob hides /usr/local/share/emacs/27.0.50/lisp/org/ob-lob /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-processing hides /usr/local/share/emacs/27.0.50/lisp/org/ob-processing /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-mobile hides /usr/local/share/emacs/27.0.50/lisp/org/org-mobile /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-groovy hides /usr/local/share/emacs/27.0.50/lisp/org/ob-groovy /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-habit hides /usr/local/share/emacs/27.0.50/lisp/org/org-habit /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-shen hides /usr/local/share/emacs/27.0.50/lisp/org/ob-shen /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-lua hides /usr/local/share/emacs/27.0.50/lisp/org/ob-lua /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-ruby hides /usr/local/share/emacs/27.0.50/lisp/org/ob-ruby /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-info hides /usr/local/share/emacs/27.0.50/lisp/org/org-info /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-mouse hides /usr/local/share/emacs/27.0.50/lisp/org/org-mouse /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-archive hides /usr/local/share/emacs/27.0.50/lisp/org/org-archive /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-rmail hides /usr/local/share/emacs/27.0.50/lisp/org/org-rmail /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-comint hides /usr/local/share/emacs/27.0.50/lisp/org/ob-comint /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-io hides /usr/local/share/emacs/27.0.50/lisp/org/ob-io /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-hledger hides /usr/local/share/emacs/27.0.50/lisp/org/ob-hledger /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-id hides /usr/local/share/emacs/27.0.50/lisp/org/org-id /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-octave hides /usr/local/share/emacs/27.0.50/lisp/org/ob-octave /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-ref hides /usr/local/share/emacs/27.0.50/lisp/org/ob-ref /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-table hides /usr/local/share/emacs/27.0.50/lisp/org/ob-table /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ox-beamer hides /usr/local/share/emacs/27.0.50/lisp/org/ox-beamer /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-picolisp hides /usr/local/share/emacs/27.0.50/lisp/org/ob-picolisp /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-agenda hides /usr/local/share/emacs/27.0.50/lisp/org/org-agenda /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-python hides /usr/local/share/emacs/27.0.50/lisp/org/ob-python /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-makefile hides /usr/local/share/emacs/27.0.50/lisp/org/ob-makefile /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ox-texinfo hides /usr/local/share/emacs/27.0.50/lisp/org/ox-texinfo /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-gnuplot hides /usr/local/share/emacs/27.0.50/lisp/org/ob-gnuplot /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-lint hides /usr/local/share/emacs/27.0.50/lisp/org/org-lint /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ox-publish hides /usr/local/share/emacs/27.0.50/lisp/org/ox-publish /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-version hides /usr/local/share/emacs/27.0.50/lisp/org/org-version /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-perl hides /usr/local/share/emacs/27.0.50/lisp/org/ob-perl /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-eshell hides /usr/local/share/emacs/27.0.50/lisp/org/org-eshell /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-tangle hides /usr/local/share/emacs/27.0.50/lisp/org/ob-tangle /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-ctags hides /usr/local/share/emacs/27.0.50/lisp/org/org-ctags /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-eval hides /usr/local/share/emacs/27.0.50/lisp/org/ob-eval /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ox-latex hides /usr/local/share/emacs/27.0.50/lisp/org/ox-latex /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-keys hides /usr/local/share/emacs/27.0.50/lisp/org/ob-keys /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-java hides /usr/local/share/emacs/27.0.50/lisp/org/ob-java /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-macs hides /usr/local/share/emacs/27.0.50/lisp/org/org-macs /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-awk hides /usr/local/share/emacs/27.0.50/lisp/org/ob-awk /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-abc hides /usr/local/share/emacs/27.0.50/lisp/org/ob-abc /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-asymptote hides /usr/local/share/emacs/27.0.50/lisp/org/ob-asymptote /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-org hides /usr/local/share/emacs/27.0.50/lisp/org/ob-org /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-js hides /usr/local/share/emacs/27.0.50/lisp/org/ob-js /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-plot hides /usr/local/share/emacs/27.0.50/lisp/org/org-plot /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-indent hides /usr/local/share/emacs/27.0.50/lisp/org/org-indent /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-table hides /usr/local/share/emacs/27.0.50/lisp/org/org-table /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-sql hides /usr/local/share/emacs/27.0.50/lisp/org/ob-sql /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-screen hides /usr/local/share/emacs/27.0.50/lisp/org/ob-screen /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-dot hides /usr/local/share/emacs/27.0.50/lisp/org/ob-dot /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-coq hides /usr/local/share/emacs/27.0.50/lisp/org/ob-coq /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-pcomplete hides /usr/local/share/emacs/27.0.50/lisp/org/org-pcomplete /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-mscgen hides /usr/local/share/emacs/27.0.50/lisp/org/ob-mscgen /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-irc hides /usr/local/share/emacs/27.0.50/lisp/org/org-irc /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-latex hides /usr/local/share/emacs/27.0.50/lisp/org/ob-latex /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ox hides /usr/local/share/emacs/27.0.50/lisp/org/ox /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-capture hides /usr/local/share/emacs/27.0.50/lisp/org/org-capture /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org hides /usr/local/share/emacs/27.0.50/lisp/org/org /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-feed hides /usr/local/share/emacs/27.0.50/lisp/org/org-feed /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-shell hides /usr/local/share/emacs/27.0.50/lisp/org/ob-shell /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-protocol hides /usr/local/share/emacs/27.0.50/lisp/org/org-protocol /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-R hides /usr/local/share/emacs/27.0.50/lisp/org/ob-R /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-ditaa hides /usr/local/share/emacs/27.0.50/lisp/org/ob-ditaa /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ox-icalendar hides /usr/local/share/emacs/27.0.50/lisp/org/ox-icalendar /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-sed hides /usr/local/share/emacs/27.0.50/lisp/org/ob-sed /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-lisp hides /usr/local/share/emacs/27.0.50/lisp/org/ob-lisp /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-datetree hides /usr/local/share/emacs/27.0.50/lisp/org/org-datetree /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-install hides /usr/local/share/emacs/27.0.50/lisp/org/org-install /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-loaddefs hides /usr/local/share/emacs/27.0.50/lisp/org/org-loaddefs /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-sqlite hides /usr/local/share/emacs/27.0.50/lisp/org/ob-sqlite /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-bibtex hides /usr/local/share/emacs/27.0.50/lisp/org/org-bibtex /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-J hides /usr/local/share/emacs/27.0.50/lisp/org/ob-J /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-inlinetask hides /usr/local/share/emacs/27.0.50/lisp/org/org-inlinetask /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-mhe hides /usr/local/share/emacs/27.0.50/lisp/org/org-mhe /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-emacs-lisp hides /usr/local/share/emacs/27.0.50/lisp/org/ob-emacs-lisp /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-faces hides /usr/local/share/emacs/27.0.50/lisp/org/org-faces /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-docview hides /usr/local/share/emacs/27.0.50/lisp/org/org-docview /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ox-html hides /usr/local/share/emacs/27.0.50/lisp/org/ox-html /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob hides /usr/local/share/emacs/27.0.50/lisp/org/ob /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-list hides /usr/local/share/emacs/27.0.50/lisp/org/org-list /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-haskell hides /usr/local/share/emacs/27.0.50/lisp/org/ob-haskell /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-bbdb hides /usr/local/share/emacs/27.0.50/lisp/org/org-bbdb /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-C hides /usr/local/share/emacs/27.0.50/lisp/org/ob-C /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-compat hides /usr/local/share/emacs/27.0.50/lisp/org/org-compat Features: (shadow sort mail-extr emacsbug sendmail helm-c-yasnippet evil-indent-plus hippie-exp org-eldoc evil-org org-table ob-groovy ob-js ob-python ob-java ob-C ob-scala ensime-expand-region expand-region-core expand-region-custom ensime ensime-mode ensime-sbt sbt-mode sbt-mode-rgrep sbt-mode-comint sbt-mode-buffer sbt-mode-project sbt-mode-vars ensime-http ensime-ui ensime-semantic-highlight ensime-doc ensime-search ensime-helm ensime-undo ensime-startup ensime-refactor ensime-popup ensime-eldoc ensime-notes ensime-company ensime-editor ensime-ivy ensime-model ivy delsel colir ivy-overlay popup ensime-debug ensime-stacktrace ensime-inf ensime-overlay ensime-completion-util ensime-config ensime-util ensime-client ensime-vars smartparens-scala scala-mode scala-mode-prettify-symbols scala-mode-imenu scala-mode-map scala-mode-fontlock scala-mode-indent scala-mode-paragraph scala-mode-syntax scala-mode-lib arc-mode archive-mode ensime-macros ob-shell ob-clojure org-bullets org-download toc-org image-file org-eww org-rmail org-mhe org-irc org-info org-gnus nnir gnus-sum shr svg dom gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range gnus-win gnus nnheader org-docview doc-view image-mode exif org-bibtex bibtex org-bbdb org-w3m smartparens-org orgit org-element avl-tree org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint ob-keys org-pcomplete org-list org-faces org-entities org-version ob-emacs-lisp ob-core ob-eval org-compat org-macs org-loaddefs cal-menu calendar cal-loaddefs helm-projectile eieio-opt mwim pulse cursor-sensor company-go go-mode find-file helm-ag dired-aux drupal-mode drupal/emacs-drush drupal/flycheck drupal/phpcs drupal/ispell drupal/etags drupal/eldoc sql php-mode speedbar sb-image ezimage dframe cc-langs php-face php php-project diff-hl-dired diff-hl vc-dir dired-x gravatar url-cache misearch multi-isearch semantic/find helm-semantic helm-imenu semantic/util-modes semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local cedet jka-compr ffap helm-swoop vc-mtn vc-hg mule-util magit-extras fill-column-indicator helm-spacemacs-help helm-command helm-elisp helm-eval edebug backtrace magit-gitflow evil-magit git-rebase forge-list forge-commands forge-semi forge-bitbucket buck forge-gogs gogs forge-gitea gtea forge-gitlab glab forge-github ghub-graphql treepy gsexp ghub gnutls forge-notify forge-revnote forge-pullreq forge-issue forge-topic forge-post forge-repo forge forge-core forge-db closql emacsql-sqlite emacsql emacsql-compiler magit-bookmark magit-submodule magit-obsolete magit-popup magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log which-func magit-diff diminish smerge-mode magit-core magit-autorevert magit-margin magit-transient magit-process magit-mode transient flx helm-x-files helm-for-files helm-bookmark helm-adaptive helm-info bookmark pp helm-external helm-net evil-surround whitespace tabify helm-fasd helm-descbinds helm-mode helm-files helm-buffers helm-occur helm-tags helm-locate helm-grep helm-regexp helm-utils helm-help helm-types helm-flx helm helm-source helm-multi-match helm-lib vc-git diff-mode vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs vc vc-dispatcher dap-java dap-mouse dap-ui gdb-mi gud bui bui-list bui-info bui-entry bui-core bui-history bui-button bui-utils tree-mode dap-mode dap-overlays lsp-ui lsp-ui-doc lsp-ui-imenu lsp-ui-peek lsp-ui-sideline view company-lsp flycheck-rust lsp-ui-flycheck lsp-clients lsp-pwsh lsp-terraform lsp-yaml lsp-vhdl lsp-haxe lsp-erlang lsp-fsharp lsp-metals lsp-elm lsp-dart lsp-clojure lsp-go lsp-xml lsp-css lsp-intelephense lsp-vetur lsp-html lsp-solargraph lsp-rust lsp-pyls lsp-java request lsp lsp-mode ewoc smartparens-markdown markdown-mode color spinner network-stream inline em-glob esh-util dash-functional bindat flymake-proc flymake gradle-mode maven-test-mode company-c-headers cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs editorconfig-core editorconfig-core-handle editorconfig-fnmatch git-gutter-fringe+ fringe-helper git-gutter+ git-commit with-editor async-bytecomp async server magit-git magit-section magit-utils crm log-edit message rfc822 mml mml-sec epa gnus-util rmail rmail-loaddefs text-property-search mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log face-remap spacemacs-purpose-popwin window-purpose-x imenu-list dired dired-loaddefs window-purpose window-purpose-fixes window-purpose-prefix-overload window-purpose-switch window-purpose-layout window-purpose-core window-purpose-configuration window-purpose-utils evil-escape projectile grep ibuf-ext ibuffer ibuffer-loaddefs tramp-sh docker-tramp tramp-cache tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat parse-time iso8601 time-date ls-lisp recentf tree-widget evil-better-visual-line company-files company-keywords company-etags company-gtags company-dabbrev-code company-dabbrev company-semantic company-template company-capf php-extras company overseer pkg-info url-http url url-proxy url-privacy url-expand url-methods url-history mailcap url-auth url-cookie url-domsuf url-util url-gw nsm rmc puny epl compile auto-compile packed elisp-slime-nav etags fileloop generator xref project flycheck-package package-lint let-alist imenu finder cider-eval-sexp-fu eval-sexp-fu goto-addr bug-reference auto-highlight-symbol evil-lisp-state flycheck-pos-tip pos-tip flycheck find-func highlight-numbers parent-mode highlight-parentheses hideshow rainbow-delimiters yasnippet-snippets clojure-snippets yasnippet evil-cleverparens evil-cleverparens-text-objects evil-cleverparens-util smartparens-config smartparens-text smartparens paredit persistent-scratch winner xterm-color spacemacs-whitespace-cleanup ws-butler winum vi-tilde-fringe symbol-overlay string-inflection saveplace savehist popwin persp-mode noflet cl-indent hl-todo fasd eyebrowse evil-unimpaired evil-textobj-line evil-mc evil-mc-command-execute evil-mc-command-record evil-mc-cursor-make evil-mc-region evil-mc-cursor-state evil-mc-undo evil-mc-vars evil-mc-known-commands evil-mc-common evil-anzu anzu editorconfig noutline outline doom-modeline doom-modeline-segments doom-modeline-env doom-modeline-core shrink-path f s dash all-the-icons all-the-icons-faces data-material data-weathericons data-octicons data-fileicons data-faicons data-alltheicons memoize clean-aindent-mode clang-format xml helm-easymenu gh-common marshal drupal/pcomplete hybrid-mode evil-evilified-state which-key use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key use-package-core hydra lv cus-edit cus-start cus-load evil evil-keybindings evil-integration undo-tree diff evil-maps evil-commands reveal flyspell ispell evil-jumps evil-command-window evil-types evil-search evil-ex shell pcomplete comint ansi-color evil-macros evil-repeat evil-states evil-core evil-common windmove thingatpt rect evil-digraphs evil-vars ring bind-map quelpa mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr lisp-mnt help-fns radix-tree hl-line xt-mouse autorevert filenotify cl-extra disp-table wid-edit spacemacs-dark-theme spacemacs-common format-spec info finder-inf ido-vertical-mode ido core-spacemacs core-use-package-ext core-transient-state core-micro-state core-toggle core-keybindings core-fonts-support core-themes-support core-display-init core-jump core-release-management core-custom-settings core-configuration-layer eieio-compat core-progress-bar core-spacemacs-buffer core-funcs ht cl help-mode warnings package browse-url url-handlers url-parse auth-source cl-seq password-cache json map url-vars seq eieio byte-opt bytecomp byte-compile cconv eieio-core eieio-loaddefs epg epg-config core-command-line pcase core-debug edmacro kmacro derived cl-macs gv profiler easymenu cl-loaddefs cl-lib core-hooks page-break-lines easy-mmode core-env load-env-vars rx core-dotspacemacs advice core-emacs-backports subr-x core-dumper tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 1748405 1637619) (symbols 48 124025 14) (strings 32 353167 161247) (string-bytes 1 11869694) (vectors 16 146728) (vector-slots 8 3379598 989814) (floats 8 1585 12951) (intervals 56 79951 27733) (buffers 1000 123)) --000000000000547bdf0598597355 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
As per post-self-insert-hook documentation.

> Ho= ok run at the end of `self-insert-command'.
> This is run after i= nserting the character.

This does not hold by default in cc-mode due= to the following mapped by default functions:

> (define-key c-mo= de-base-map "#" =C2=A0 =C2=A0 =C2=A0 =C2=A0 'c-electric-pound= )
> (define-key c-mode-base-map "{" =C2=A0 =C2=A0 =C2=A0 = =C2=A0 'c-electric-brace)
> (define-key c-mode-base-map "}&q= uot; =C2=A0 =C2=A0 =C2=A0 =C2=A0 'c-electric-brace)
> (define-key= c-mode-base-map "/" =C2=A0 =C2=A0 =C2=A0 =C2=A0 'c-electric-= slash)
> (define-key c-mode-base-map "*" =C2=A0 =C2=A0 =C2= =A0 =C2=A0 'c-electric-star)
> (define-key c-mode-base-map "= ;" =C2=A0 =C2=A0 =C2=A0 =C2=A0 'c-electric-semi&comma)
>= (define-key c-mode-base-map "," =C2=A0 =C2=A0 =C2=A0 =C2=A0 '= ;c-electric-semi&comma)
> (define-key c-mode-base-map ":&quo= t; =C2=A0 =C2=A0 =C2=A0 =C2=A0 'c-electric-colon)
> (define-key c= -mode-base-map "(" =C2=A0 =C2=A0 =C2=A0 =C2=A0 'c-electric-pa= ren)
> (define-key c-mode-base-map ")" =C2=A0 =C2=A0 =C2=A0= =C2=A0 'c-electric-paren)

All of these functions (or at least m= ajority) contain the following lines:

> (let (post-self-insert-h= ook) ; Disable random functionality.
>=C2=A0 =C2=A0 =C2=A0 (self-inse= rt-command (prefix-numeric-value arg)))

Possible fixes:

= 1. Do not bind the functions by default.
2. Rewrite them so they do not = inhibit post-self-insert-hook functions.

In GNU Em= acs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.1)
=C2=A0of= 2019-11-23 built on kyoncho-H87-D3H
Repository revision: 8934762bb37273= e6606097de92dcc2556456acd2
Repository branch: master
Windowing system= distributor 'The X.Org Foundation', version 11.0.12001000
Syste= m Description: Linux Mint 19.1

Configured using:
=C2=A0'confi= gure --with-modules --with-json'

Configured features:
XPM JPE= G TIFF GIF PNG SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY GNUTLS
LIBXML2 F= REETYPE HARFBUZZ XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM
MODULES = THREADS JSON PDUMPER GMP

Important settings:
=C2=A0 value of $LC_= CTYPE: en_US.UTF-8
=C2=A0 value of $LC_MONETARY: bg_BG.UTF-8
=C2=A0 v= alue of $LC_NUMERIC: bg_BG.UTF-8
=C2=A0 value of $LANG: en_US.UTF-8
= =C2=A0 value of $XMODIFIERS: @im=3Dibus
=C2=A0 locale-coding-system: utf= -8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
=C2= =A0 helm-spacemacs-help-mode: t
=C2=A0 global-magit-file-mode: t
=C2= =A0 global-evil-surround-mode: t
=C2=A0 evil-surround-mode: t
=C2=A0 = helm-descbinds-mode: t
=C2=A0 helm-mode: t
=C2=A0 helm-flx-mode: t=C2=A0 dap-tooltip-mode: t
=C2=A0 dap-ui-mode: t
=C2=A0 gdb-many-win= dows: t
=C2=A0 dap-mode: t
=C2=A0 gradle-mode: t
=C2=A0 global-git= -gutter+-mode: t
=C2=A0 global-git-commit-mode: t
=C2=A0 async-byteco= mp-package-mode: t
=C2=A0 pupo-mode: t
=C2=A0 purpose-mode: t
=C2= =A0 evil-escape-mode: t
=C2=A0 projectile-mode: t
=C2=A0 recentf-mode= : t
=C2=A0 company-mode: t
=C2=A0 auto-compile-mode: t
=C2=A0 elis= p-slime-nav-mode: t
=C2=A0 eval-sexp-fu-flash-mode: t
=C2=A0 goto-add= ress-prog-mode: t
=C2=A0 bug-reference-prog-mode: t
=C2=A0 auto-highl= ight-symbol-mode: t
=C2=A0 flycheck-pos-tip-mode: t
=C2=A0 global-fly= check-mode: t
=C2=A0 highlight-numbers-mode: t
=C2=A0 highlight-paren= theses-mode: t
=C2=A0 rainbow-delimiters-mode: t
=C2=A0 yas-global-mo= de: t
=C2=A0 yas-minor-mode: t
=C2=A0 evil-cleverparens-mode: t
= =C2=A0 show-smartparens-global-mode: t
=C2=A0 show-smartparens-mode: t=C2=A0 smartparens-mode: t
=C2=A0 persistent-scratch-autosave-mode: t<= br>=C2=A0 winner-mode: t
=C2=A0 global-spacemacs-whitespace-cleanup-mode= : t
=C2=A0 spacemacs-whitespace-cleanup-mode: t
=C2=A0 winum-mode: t<= br>=C2=A0 global-vi-tilde-fringe-mode: t
=C2=A0 save-place-mode: t
= =C2=A0 savehist-mode: t
=C2=A0 persp-mode: t
=C2=A0 global-hl-todo-mo= de: t
=C2=A0 hl-todo-mode: t
=C2=A0 global-fasd-mode: t
=C2=A0 eye= browse-mode: t
=C2=A0 evil-mc-mode: t
=C2=A0 global-anzu-mode: t
= =C2=A0 anzu-mode: t
=C2=A0 editorconfig-mode: t
=C2=A0 doom-modeline-= mode: t
=C2=A0 clean-aindent-mode: t
=C2=A0 hybrid-mode: t
=C2=A0 = which-key-mode: t
=C2=A0 override-global-mode: t
=C2=A0 global-undo-t= ree-mode: t
=C2=A0 undo-tree-mode: t
=C2=A0 shell-dirtrack-mode: t=C2=A0 evil-mode: t
=C2=A0 evil-local-mode: t
=C2=A0 spacemacs-leade= r-override-mode: t
=C2=A0 global-spacemacs-leader-override-mode: t
= =C2=A0 global-hl-line-mode: t
=C2=A0 xterm-mouse-mode: t
=C2=A0 globa= l-auto-revert-mode: t
=C2=A0 ido-vertical-mode: t
=C2=A0 global-page-= break-lines-mode: t
=C2=A0 page-break-lines-mode: t
=C2=A0 tooltip-mo= de: t
=C2=A0 global-eldoc-mode: t
=C2=A0 eldoc-mode: t
=C2=A0 elec= tric-indent-mode: t
=C2=A0 mouse-wheel-mode: t
=C2=A0 file-name-shado= w-mode: t
=C2=A0 global-font-lock-mode: t
=C2=A0 font-lock-mode: t=C2=A0 auto-composition-mode: t
=C2=A0 auto-encryption-mode: t
=C2= =A0 auto-compression-mode: t
=C2=A0 buffer-read-only: t
=C2=A0 column= -number-mode: t
=C2=A0 line-number-mode: t
=C2=A0 transient-mark-mode= : t
=C2=A0 hs-minor-mode: t

Load-path shadows:
/home/kyoncho/.= emacs.d/elpa/27.0/develop/ht-20190924.704/ht hides /home/kyoncho/.emacs.d/c= ore/libs/ht
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20= 191111/ob-exp hides /usr/local/share/emacs/27.0.50/lisp/org/ob-exp
/home= /kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-footnote = hides /usr/local/share/emacs/27.0.50/lisp/org/org-footnote
/home/kyoncho= /.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-scheme hides /usr/= local/share/emacs/27.0.50/lisp/org/ob-scheme
/home/kyoncho/.emacs.d/elpa= /27.0/develop/org-plus-contrib-20191111/org-entities hides /usr/local/share= /emacs/27.0.50/lisp/org/org-entities
/home/kyoncho/.emacs.d/elpa/27.0/de= velop/org-plus-contrib-20191111/ob-clojure hides /usr/local/share/emacs/27.= 0.50/lisp/org/ob-clojure
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-pl= us-contrib-20191111/ox-odt hides /usr/local/share/emacs/27.0.50/lisp/org/ox= -odt
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/= ob-ledger hides /usr/local/share/emacs/27.0.50/lisp/org/ob-ledger
/home/= kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ox-man hides /= usr/local/share/emacs/27.0.50/lisp/org/ox-man
/home/kyoncho/.emacs.d/elp= a/27.0/develop/org-plus-contrib-20191111/org-duration hides /usr/local/shar= e/emacs/27.0.50/lisp/org/org-duration
/home/kyoncho/.emacs.d/elpa/27.0/d= evelop/org-plus-contrib-20191111/ob-core hides /usr/local/share/emacs/27.0.= 50/lisp/org/ob-core
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-co= ntrib-20191111/ob-css hides /usr/local/share/emacs/27.0.50/lisp/org/ob-css<= br>/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ox-or= g hides /usr/local/share/emacs/27.0.50/lisp/org/ox-org
/home/kyoncho/.em= acs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-sass hides /usr/local/= share/emacs/27.0.50/lisp/org/ob-sass
/home/kyoncho/.emacs.d/elpa/27.0/de= velop/org-plus-contrib-20191111/ob-maxima hides /usr/local/share/emacs/27.0= .50/lisp/org/ob-maxima
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus= -contrib-20191111/ob-matlab hides /usr/local/share/emacs/27.0.50/lisp/org/o= b-matlab
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191= 111/ob-ebnf hides /usr/local/share/emacs/27.0.50/lisp/org/ob-ebnf
/home/= kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-ocaml hides= /usr/local/share/emacs/27.0.50/lisp/org/ob-ocaml
/home/kyoncho/.emacs.d= /elpa/27.0/develop/org-plus-contrib-20191111/ox-ascii hides /usr/local/shar= e/emacs/27.0.50/lisp/org/ox-ascii
/home/kyoncho/.emacs.d/elpa/27.0/devel= op/org-plus-contrib-20191111/ob-lilypond hides /usr/local/share/emacs/27.0.= 50/lisp/org/ob-lilypond
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plu= s-contrib-20191111/ox-md hides /usr/local/share/emacs/27.0.50/lisp/org/ox-m= d
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org= -timer hides /usr/local/share/emacs/27.0.50/lisp/org/org-timer
/home/kyo= ncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-calc hides /us= r/local/share/emacs/27.0.50/lisp/org/ob-calc
/home/kyoncho/.emacs.d/elpa= /27.0/develop/org-plus-contrib-20191111/org-macro hides /usr/local/share/em= acs/27.0.50/lisp/org/org-macro
/home/kyoncho/.emacs.d/elpa/27.0/develop/= org-plus-contrib-20191111/org-attach hides /usr/local/share/emacs/27.0.50/l= isp/org/org-attach
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-con= trib-20191111/ob-plantuml hides /usr/local/share/emacs/27.0.50/lisp/org/ob-= plantuml
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191= 111/org-element hides /usr/local/share/emacs/27.0.50/lisp/org/org-element/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-ew= w hides /usr/local/share/emacs/27.0.50/lisp/org/org-eww
/home/kyoncho/.e= macs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-crypt hides /usr/loc= al/share/emacs/27.0.50/lisp/org/org-crypt
/home/kyoncho/.emacs.d/elpa/27= .0/develop/org-plus-contrib-20191111/ob-forth hides /usr/local/share/emacs/= 27.0.50/lisp/org/ob-forth
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-p= lus-contrib-20191111/org-clock hides /usr/local/share/emacs/27.0.50/lisp/or= g/org-clock
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20= 191111/org-colview hides /usr/local/share/emacs/27.0.50/lisp/org/org-colvie= w
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org= -w3m hides /usr/local/share/emacs/27.0.50/lisp/org/org-w3m
/home/kyoncho= /.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-src hides /usr/lo= cal/share/emacs/27.0.50/lisp/org/org-src
/home/kyoncho/.emacs.d/elpa/27.= 0/develop/org-plus-contrib-20191111/ob-vala hides /usr/local/share/emacs/27= .0.50/lisp/org/ob-vala
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus= -contrib-20191111/ob-stan hides /usr/local/share/emacs/27.0.50/lisp/org/ob-= stan
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/= org-gnus hides /usr/local/share/emacs/27.0.50/lisp/org/org-gnus
/home/ky= oncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-fortran hides= /usr/local/share/emacs/27.0.50/lisp/org/ob-fortran
/home/kyoncho/.emacs= .d/elpa/27.0/develop/org-plus-contrib-20191111/ob-lob hides /usr/local/shar= e/emacs/27.0.50/lisp/org/ob-lob
/home/kyoncho/.emacs.d/elpa/27.0/develop= /org-plus-contrib-20191111/ob-processing hides /usr/local/share/emacs/27.0.= 50/lisp/org/ob-processing
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-p= lus-contrib-20191111/org-mobile hides /usr/local/share/emacs/27.0.50/lisp/o= rg/org-mobile
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-= 20191111/ob-groovy hides /usr/local/share/emacs/27.0.50/lisp/org/ob-groovy<= br>/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-h= abit hides /usr/local/share/emacs/27.0.50/lisp/org/org-habit
/home/kyonc= ho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-shen hides /usr/= local/share/emacs/27.0.50/lisp/org/ob-shen
/home/kyoncho/.emacs.d/elpa/2= 7.0/develop/org-plus-contrib-20191111/ob-lua hides /usr/local/share/emacs/2= 7.0.50/lisp/org/ob-lua
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus= -contrib-20191111/ob-ruby hides /usr/local/share/emacs/27.0.50/lisp/org/ob-= ruby
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/= org-info hides /usr/local/share/emacs/27.0.50/lisp/org/org-info
/home/ky= oncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-mouse hides = /usr/local/share/emacs/27.0.50/lisp/org/org-mouse
/home/kyoncho/.emacs.d= /elpa/27.0/develop/org-plus-contrib-20191111/org-archive hides /usr/local/s= hare/emacs/27.0.50/lisp/org/org-archive
/home/kyoncho/.emacs.d/elpa/27.0= /develop/org-plus-contrib-20191111/org-rmail hides /usr/local/share/emacs/2= 7.0.50/lisp/org/org-rmail
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-p= lus-contrib-20191111/ob-comint hides /usr/local/share/emacs/27.0.50/lisp/or= g/ob-comint
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20= 191111/ob-io hides /usr/local/share/emacs/27.0.50/lisp/org/ob-io
/home/k= yoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-hledger hide= s /usr/local/share/emacs/27.0.50/lisp/org/ob-hledger
/home/kyoncho/.emac= s.d/elpa/27.0/develop/org-plus-contrib-20191111/org-id hides /usr/local/sha= re/emacs/27.0.50/lisp/org/org-id
/home/kyoncho/.emacs.d/elpa/27.0/develo= p/org-plus-contrib-20191111/ob-octave hides /usr/local/share/emacs/27.0.50/= lisp/org/ob-octave
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-con= trib-20191111/ob-ref hides /usr/local/share/emacs/27.0.50/lisp/org/ob-ref/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-tab= le hides /usr/local/share/emacs/27.0.50/lisp/org/ob-table
/home/kyoncho/= .emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ox-beamer hides /usr/l= ocal/share/emacs/27.0.50/lisp/org/ox-beamer
/home/kyoncho/.emacs.d/elpa/= 27.0/develop/org-plus-contrib-20191111/ob-picolisp hides /usr/local/share/e= macs/27.0.50/lisp/org/ob-picolisp
/home/kyoncho/.emacs.d/elpa/27.0/devel= op/org-plus-contrib-20191111/org-agenda hides /usr/local/share/emacs/27.0.5= 0/lisp/org/org-agenda
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-= contrib-20191111/ob-python hides /usr/local/share/emacs/27.0.50/lisp/org/ob= -python
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-201911= 11/ob-makefile hides /usr/local/share/emacs/27.0.50/lisp/org/ob-makefile/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ox-texi= nfo hides /usr/local/share/emacs/27.0.50/lisp/org/ox-texinfo
/home/kyonc= ho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-gnuplot hides /u= sr/local/share/emacs/27.0.50/lisp/org/ob-gnuplot
/home/kyoncho/.emacs.d/= elpa/27.0/develop/org-plus-contrib-20191111/org-lint hides /usr/local/share= /emacs/27.0.50/lisp/org/org-lint
/home/kyoncho/.emacs.d/elpa/27.0/develo= p/org-plus-contrib-20191111/ox-publish hides /usr/local/share/emacs/27.0.50= /lisp/org/ox-publish
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-c= ontrib-20191111/org-version hides /usr/local/share/emacs/27.0.50/lisp/org/o= rg-version
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-201= 91111/ob-perl hides /usr/local/share/emacs/27.0.50/lisp/org/ob-perl
/hom= e/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-eshell h= ides /usr/local/share/emacs/27.0.50/lisp/org/org-eshell
/home/kyoncho/.e= macs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-tangle hides /usr/loc= al/share/emacs/27.0.50/lisp/org/ob-tangle
/home/kyoncho/.emacs.d/elpa/27= .0/develop/org-plus-contrib-20191111/org-ctags hides /usr/local/share/emacs= /27.0.50/lisp/org/org-ctags
/home/kyoncho/.emacs.d/elpa/27.0/develop/org= -plus-contrib-20191111/ob-eval hides /usr/local/share/emacs/27.0.50/lisp/or= g/ob-eval
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-2019= 1111/ox-latex hides /usr/local/share/emacs/27.0.50/lisp/org/ox-latex
/ho= me/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-keys hid= es /usr/local/share/emacs/27.0.50/lisp/org/ob-keys
/home/kyoncho/.emacs.= d/elpa/27.0/develop/org-plus-contrib-20191111/ob-java hides /usr/local/shar= e/emacs/27.0.50/lisp/org/ob-java
/home/kyoncho/.emacs.d/elpa/27.0/develo= p/org-plus-contrib-20191111/org-macs hides /usr/local/share/emacs/27.0.50/l= isp/org/org-macs
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contr= ib-20191111/ob-awk hides /usr/local/share/emacs/27.0.50/lisp/org/ob-awk
= /home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-abc h= ides /usr/local/share/emacs/27.0.50/lisp/org/ob-abc
/home/kyoncho/.emacs= .d/elpa/27.0/develop/org-plus-contrib-20191111/ob-asymptote hides /usr/loca= l/share/emacs/27.0.50/lisp/org/ob-asymptote
/home/kyoncho/.emacs.d/elpa/= 27.0/develop/org-plus-contrib-20191111/ob-org hides /usr/local/share/emacs/= 27.0.50/lisp/org/ob-org
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plu= s-contrib-20191111/ob-js hides /usr/local/share/emacs/27.0.50/lisp/org/ob-j= s
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org= -plot hides /usr/local/share/emacs/27.0.50/lisp/org/org-plot
/home/kyonc= ho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-indent hides /u= sr/local/share/emacs/27.0.50/lisp/org/org-indent
/home/kyoncho/.emacs.d/= elpa/27.0/develop/org-plus-contrib-20191111/org-table hides /usr/local/shar= e/emacs/27.0.50/lisp/org/org-table
/home/kyoncho/.emacs.d/elpa/27.0/deve= lop/org-plus-contrib-20191111/ob-sql hides /usr/local/share/emacs/27.0.50/l= isp/org/ob-sql
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib= -20191111/ob-screen hides /usr/local/share/emacs/27.0.50/lisp/org/ob-screen=
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-d= ot hides /usr/local/share/emacs/27.0.50/lisp/org/ob-dot
/home/kyoncho/.e= macs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-coq hides /usr/local/= share/emacs/27.0.50/lisp/org/ob-coq
/home/kyoncho/.emacs.d/elpa/27.0/dev= elop/org-plus-contrib-20191111/org-pcomplete hides /usr/local/share/emacs/2= 7.0.50/lisp/org/org-pcomplete
/home/kyoncho/.emacs.d/elpa/27.0/develop/o= rg-plus-contrib-20191111/ob-mscgen hides /usr/local/share/emacs/27.0.50/lis= p/org/ob-mscgen
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contri= b-20191111/org-irc hides /usr/local/share/emacs/27.0.50/lisp/org/org-irc/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-late= x hides /usr/local/share/emacs/27.0.50/lisp/org/ob-latex
/home/kyoncho/.= emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ox hides /usr/local/sha= re/emacs/27.0.50/lisp/org/ox
/home/kyoncho/.emacs.d/elpa/27.0/develop/or= g-plus-contrib-20191111/org-capture hides /usr/local/share/emacs/27.0.50/li= sp/org/org-capture
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-con= trib-20191111/org hides /usr/local/share/emacs/27.0.50/lisp/org/org
/hom= e/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-feed hid= es /usr/local/share/emacs/27.0.50/lisp/org/org-feed
/home/kyoncho/.emacs= .d/elpa/27.0/develop/org-plus-contrib-20191111/ob-shell hides /usr/local/sh= are/emacs/27.0.50/lisp/org/ob-shell
/home/kyoncho/.emacs.d/elpa/27.0/dev= elop/org-plus-contrib-20191111/org-protocol hides /usr/local/share/emacs/27= .0.50/lisp/org/org-protocol
/home/kyoncho/.emacs.d/elpa/27.0/develop/org= -plus-contrib-20191111/ob-R hides /usr/local/share/emacs/27.0.50/lisp/org/o= b-R
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/o= b-ditaa hides /usr/local/share/emacs/27.0.50/lisp/org/ob-ditaa
/home/kyo= ncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ox-icalendar hide= s /usr/local/share/emacs/27.0.50/lisp/org/ox-icalendar
/home/kyoncho/.em= acs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-sed hides /usr/local/s= hare/emacs/27.0.50/lisp/org/ob-sed
/home/kyoncho/.emacs.d/elpa/27.0/deve= lop/org-plus-contrib-20191111/ob-lisp hides /usr/local/share/emacs/27.0.50/= lisp/org/ob-lisp
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contr= ib-20191111/org-datetree hides /usr/local/share/emacs/27.0.50/lisp/org/org-= datetree
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191= 111/org-install hides /usr/local/share/emacs/27.0.50/lisp/org/org-install/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-lo= addefs hides /usr/local/share/emacs/27.0.50/lisp/org/org-loaddefs
/home/= kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-sqlite hide= s /usr/local/share/emacs/27.0.50/lisp/org/ob-sqlite
/home/kyoncho/.emacs= .d/elpa/27.0/develop/org-plus-contrib-20191111/org-bibtex hides /usr/local/= share/emacs/27.0.50/lisp/org/org-bibtex
/home/kyoncho/.emacs.d/elpa/27.0= /develop/org-plus-contrib-20191111/ob-J hides /usr/local/share/emacs/27.0.5= 0/lisp/org/ob-J
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contri= b-20191111/org-inlinetask hides /usr/local/share/emacs/27.0.50/lisp/org/org= -inlinetask
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20= 191111/org-mhe hides /usr/local/share/emacs/27.0.50/lisp/org/org-mhe
/ho= me/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/ob-emacs-li= sp hides /usr/local/share/emacs/27.0.50/lisp/org/ob-emacs-lisp
/home/kyo= ncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-faces hides /= usr/local/share/emacs/27.0.50/lisp/org/org-faces
/home/kyoncho/.emacs.d/= elpa/27.0/develop/org-plus-contrib-20191111/org-docview hides /usr/local/sh= are/emacs/27.0.50/lisp/org/org-docview
/home/kyoncho/.emacs.d/elpa/27.0/= develop/org-plus-contrib-20191111/ox-html hides /usr/local/share/emacs/27.0= .50/lisp/org/ox-html
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-c= ontrib-20191111/ob hides /usr/local/share/emacs/27.0.50/lisp/org/ob
/hom= e/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-list hid= es /usr/local/share/emacs/27.0.50/lisp/org/org-list
/home/kyoncho/.emacs= .d/elpa/27.0/develop/org-plus-contrib-20191111/ob-haskell hides /usr/local/= share/emacs/27.0.50/lisp/org/ob-haskell
/home/kyoncho/.emacs.d/elpa/27.0= /develop/org-plus-contrib-20191111/org-bbdb hides /usr/local/share/emacs/27= .0.50/lisp/org/org-bbdb
/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plu= s-contrib-20191111/ob-C hides /usr/local/share/emacs/27.0.50/lisp/org/ob-C<= br>/home/kyoncho/.emacs.d/elpa/27.0/develop/org-plus-contrib-20191111/org-c= ompat hides /usr/local/share/emacs/27.0.50/lisp/org/org-compat

Featu= res:
(shadow sort mail-extr emacsbug sendmail helm-c-yasnippet
evil-i= ndent-plus hippie-exp org-eldoc evil-org org-table ob-groovy ob-js
ob-py= thon ob-java ob-C ob-scala ensime-expand-region expand-region-core
expan= d-region-custom ensime ensime-mode ensime-sbt sbt-mode
sbt-mode-rgrep sb= t-mode-comint sbt-mode-buffer sbt-mode-project
sbt-mode-vars ensime-http= ensime-ui ensime-semantic-highlight ensime-doc
ensime-search ensime-hel= m ensime-undo ensime-startup ensime-refactor
ensime-popup ensime-eldoc e= nsime-notes ensime-company ensime-editor
ensime-ivy ensime-model ivy del= sel colir ivy-overlay popup ensime-debug
ensime-stacktrace ensime-inf en= sime-overlay ensime-completion-util
ensime-config ensime-util ensime-cli= ent ensime-vars smartparens-scala
scala-mode scala-mode-prettify-symbols= scala-mode-imenu scala-mode-map
scala-mode-fontlock scala-mode-indent s= cala-mode-paragraph
scala-mode-syntax scala-mode-lib arc-mode archive-mo= de ensime-macros
ob-shell ob-clojure org-bullets org-download toc-org im= age-file org-eww
org-rmail org-mhe org-irc org-info org-gnus nnir gnus-s= um shr svg dom
gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail = mail-source
utf7 netrc nnoo gnus-spec gnus-int gnus-range gnus-win gnus = nnheader
org-docview doc-view image-mode exif org-bibtex bibtex org-bbdb= org-w3m
smartparens-org orgit org-element avl-tree org ob ob-tangle ob-= ref
ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint ob-k= eys
org-pcomplete org-list org-faces org-entities org-version ob-emacs-l= isp
ob-core ob-eval org-compat org-macs org-loaddefs cal-menu calendarcal-loaddefs helm-projectile eieio-opt mwim pulse cursor-sensor
compan= y-go go-mode find-file helm-ag dired-aux drupal-mode
drupal/emacs-drush = drupal/flycheck drupal/phpcs drupal/ispell
drupal/etags drupal/eldoc sql= php-mode speedbar sb-image ezimage dframe
cc-langs php-face php php-pro= ject diff-hl-dired diff-hl vc-dir dired-x
gravatar url-cache misearch mu= lti-isearch semantic/find helm-semantic
helm-imenu semantic/util-modes s= emantic/util semantic semantic/tag
semantic/lex semantic/fw mode-local c= edet jka-compr ffap helm-swoop
vc-mtn vc-hg mule-util magit-extras fill-= column-indicator
helm-spacemacs-help helm-command helm-elisp helm-eval e= debug backtrace
magit-gitflow evil-magit git-rebase forge-list forge-com= mands forge-semi
forge-bitbucket buck forge-gogs gogs forge-gitea gtea f= orge-gitlab glab
forge-github ghub-graphql treepy gsexp ghub gnutls forg= e-notify
forge-revnote forge-pullreq forge-issue forge-topic forge-post<= br>forge-repo forge forge-core forge-db closql emacsql-sqlite emacsql
em= acsql-compiler magit-bookmark magit-submodule magit-obsolete
magit-popup= magit-blame magit-stash magit-reflog magit-bisect magit-push
magit-pull= magit-fetch magit-clone magit-remote magit-commit
magit-sequence magit-= notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magi= t-files magit-refs magit-status magit
magit-repos magit-apply magit-wip = magit-log which-func magit-diff
diminish smerge-mode magit-core magit-au= torevert magit-margin
magit-transient magit-process magit-mode transient= flx helm-x-files
helm-for-files helm-bookmark helm-adaptive helm-info b= ookmark pp
helm-external helm-net evil-surround whitespace tabify helm-f= asd
helm-descbinds helm-mode helm-files helm-buffers helm-occur helm-tag= s
helm-locate helm-grep helm-regexp helm-utils helm-help helm-types
h= elm-flx helm helm-source helm-multi-match helm-lib vc-git diff-mode
vc-b= zr vc-src vc-sccs vc-svn vc-cvs vc-rcs vc vc-dispatcher dap-java
dap-mou= se dap-ui gdb-mi gud bui bui-list bui-info bui-entry bui-core
bui-histor= y bui-button bui-utils tree-mode dap-mode dap-overlays lsp-ui
lsp-ui-doc= lsp-ui-imenu lsp-ui-peek lsp-ui-sideline view company-lsp
flycheck-rust= lsp-ui-flycheck lsp-clients lsp-pwsh lsp-terraform
lsp-yaml lsp-vhdl ls= p-haxe lsp-erlang lsp-fsharp lsp-metals lsp-elm
lsp-dart lsp-clojure lsp= -go lsp-xml lsp-css lsp-intelephense lsp-vetur
lsp-html lsp-solargraph l= sp-rust lsp-pyls lsp-java request lsp lsp-mode
ewoc smartparens-markdown= markdown-mode color spinner network-stream
inline em-glob esh-util dash= -functional bindat flymake-proc flymake
gradle-mode maven-test-mode comp= any-c-headers cc-mode cc-fonts cc-guess
cc-menus cc-cmds cc-styles cc-al= ign cc-engine cc-vars cc-defs
editorconfig-core editorconfig-core-handle= editorconfig-fnmatch
git-gutter-fringe+ fringe-helper git-gutter+ git-c= ommit with-editor
async-bytecomp async server magit-git magit-section ma= git-utils crm
log-edit message rfc822 mml mml-sec epa gnus-util rmail rm= ail-loaddefs
text-property-search mailabbrev mail-utils gmm-utils mailhe= ader
pcvs-util add-log face-remap spacemacs-purpose-popwin window-purpos= e-x
imenu-list dired dired-loaddefs window-purpose window-purpose-fixes<= br>window-purpose-prefix-overload window-purpose-switch
window-purpose-l= ayout window-purpose-core window-purpose-configuration
window-purpose-ut= ils evil-escape projectile grep ibuf-ext ibuffer
ibuffer-loaddefs tramp-= sh docker-tramp tramp-cache tramp tramp-loaddefs
trampver tramp-integrat= ion files-x tramp-compat parse-time iso8601
time-date ls-lisp recentf tr= ee-widget evil-better-visual-line
company-files company-keywords company= -etags company-gtags
company-dabbrev-code company-dabbrev company-semant= ic company-template
company-capf php-extras company overseer pkg-info ur= l-http url url-proxy
url-privacy url-expand url-methods url-history mail= cap url-auth
url-cookie url-domsuf url-util url-gw nsm rmc puny epl comp= ile
auto-compile packed elisp-slime-nav etags fileloop generator xrefproject flycheck-package package-lint let-alist imenu finder
cider-eval= -sexp-fu eval-sexp-fu goto-addr bug-reference
auto-highlight-symbol evil= -lisp-state flycheck-pos-tip pos-tip flycheck
find-func highlight-number= s parent-mode highlight-parentheses hideshow
rainbow-delimiters yasnippe= t-snippets clojure-snippets yasnippet
evil-cleverparens evil-cleverparen= s-text-objects evil-cleverparens-util
smartparens-config smartparens-tex= t smartparens paredit
persistent-scratch winner xterm-color spacemacs-wh= itespace-cleanup
ws-butler winum vi-tilde-fringe symbol-overlay string-i= nflection
saveplace savehist popwin persp-mode noflet cl-indent hl-todo = fasd
eyebrowse evil-unimpaired evil-textobj-line evil-mc
evil-mc-comm= and-execute evil-mc-command-record evil-mc-cursor-make
evil-mc-region ev= il-mc-cursor-state evil-mc-undo evil-mc-vars
evil-mc-known-commands evil= -mc-common evil-anzu anzu editorconfig
noutline outline doom-modeline do= om-modeline-segments doom-modeline-env
doom-modeline-core shrink-path f = s dash all-the-icons
all-the-icons-faces data-material data-weathericons= data-octicons
data-fileicons data-faicons data-alltheicons memoize clea= n-aindent-mode
clang-format xml helm-easymenu gh-common marshal drupal/p= complete
hybrid-mode evil-evilified-state which-key use-package
use-p= ackage-ensure use-package-delight use-package-diminish
use-package-bind-= key bind-key use-package-core hydra lv cus-edit
cus-start cus-load evil = evil-keybindings evil-integration undo-tree diff
evil-maps evil-commands= reveal flyspell ispell evil-jumps
evil-command-window evil-types evil-s= earch evil-ex shell pcomplete
comint ansi-color evil-macros evil-repeat = evil-states evil-core
evil-common windmove thingatpt rect evil-digraphs = evil-vars ring
bind-map quelpa mm-decode mm-bodies mm-encode mail-parse = rfc2231 rfc2047
rfc2045 mm-util ietf-drums mail-prsvr lisp-mnt help-fns = radix-tree
hl-line xt-mouse autorevert filenotify cl-extra disp-table wi= d-edit
spacemacs-dark-theme spacemacs-common format-spec info finder-inf=
ido-vertical-mode ido core-spacemacs core-use-package-ext
core-trans= ient-state core-micro-state core-toggle core-keybindings
core-fonts-supp= ort core-themes-support core-display-init core-jump
core-release-managem= ent core-custom-settings core-configuration-layer
eieio-compat core-prog= ress-bar core-spacemacs-buffer core-funcs ht cl
help-mode warnings packa= ge browse-url url-handlers url-parse auth-source
cl-seq password-cache j= son map url-vars seq eieio byte-opt bytecomp
byte-compile cconv eieio-co= re eieio-loaddefs epg epg-config
core-command-line pcase core-debug edma= cro kmacro derived cl-macs gv
profiler easymenu cl-loaddefs cl-lib core-= hooks page-break-lines
easy-mmode core-env load-env-vars rx core-dotspac= emacs advice
core-emacs-backports subr-x core-dumper tooltip eldoc elect= ric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win=
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
t= abulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mod= e register page tab-bar menu-bar rfn-eshadow isearch timer
select scroll= -bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors = frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnames= e tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew gree= k romanian slovak czech european ethiopic indian
cyrillic chinese compos= ite charscript charprop case-table epa-hook
jka-cmpr-hook help simple ab= brev obarray cl-preloaded nadvice loaddefs
button faces cus-face macroex= p files text-properties overlay sha1 md5
base64 format env code-pages mu= le custom widget hashtable-print-readable
backquote threads dbusbind ino= tify dynamic-setting system-font-setting
font-render-setting move-toolba= r gtk x-toolkit x multi-tty
make-network-process emacs)

Memory in= formation:
((conses 16 1748405 1637619)
=C2=A0(symbols 48 124025 14)<= br>=C2=A0(strings 32 353167 161247)
=C2=A0(string-bytes 1 11869694)
= =C2=A0(vectors 16 146728)
=C2=A0(vector-slots 8 3379598 989814)
=C2= =A0(floats 8 1585 12951)
=C2=A0(intervals 56 79951 27733)
=C2=A0(buff= ers 1000 123))
--000000000000547bdf0598597355-- From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 30 09:36:45 2019 Received: (at 38406) by debbugs.gnu.org; 30 Nov 2019 14:36:45 +0000 Received: from localhost ([127.0.0.1]:33859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ib3rY-0002Az-Sb for submit@debbugs.gnu.org; Sat, 30 Nov 2019 09:36:45 -0500 Received: from colin.muc.de ([193.149.48.1]:35146 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1ib3rW-0002Aq-EN for 38406@debbugs.gnu.org; Sat, 30 Nov 2019 09:36:44 -0500 Received: (qmail 5590 invoked by uid 3782); 30 Nov 2019 14:36:40 -0000 Received: from acm.muc.de (p2E5D5014.dip0.t-ipconnect.de [46.93.80.20]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 30 Nov 2019 15:36:38 +0100 Received: (qmail 6867 invoked by uid 1000); 30 Nov 2019 14:36:38 -0000 Date: Sat, 30 Nov 2019 14:36:38 +0000 To: yyoncho Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes Message-ID: <20191130143638.GA6716@ACM> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38406 Cc: 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Yyoncho. On Wed, Nov 27, 2019 at 22:00:26 +0200, yyoncho wrote: > As per post-self-insert-hook documentation. > > Hook run at the end of `self-insert-command'. > > This is run after inserting the character. Yes. This is a problematic hook, since it is capable of disrupting the correct functionality of any Lisp program which uses self-insert-command. This transpired in CC Mode, so to make c-electric-brace and friends work, the action of the hook was nullified. > This does not hold by default in cc-mode due to the following mapped by > default functions: > > (define-key c-mode-base-map "#" 'c-electric-pound) > > (define-key c-mode-base-map "{" 'c-electric-brace) > > (define-key c-mode-base-map "}" 'c-electric-brace) > > (define-key c-mode-base-map "/" 'c-electric-slash) > > (define-key c-mode-base-map "*" 'c-electric-star) > > (define-key c-mode-base-map ";" 'c-electric-semi&comma) > > (define-key c-mode-base-map "," 'c-electric-semi&comma) > > (define-key c-mode-base-map ":" 'c-electric-colon) > > (define-key c-mode-base-map "(" 'c-electric-paren) > > (define-key c-mode-base-map ")" 'c-electric-paren) > All of these functions (or at least majority) contain the following lines: > > (let (post-self-insert-hook) ; Disable random functionality. > > (self-insert-command (prefix-numeric-value arg))) Yes. This was one way to get self-insert-function to perform its correct functionality, namely inserting exactly one copy of a typed key (or alternatively N copies when there's a prefix key). > Possible fixes: First question, what's the problem? What do you want to do that the above mechanism hinders? > 1. Do not bind the functions by default. They are essential to the correct functioning of CC Mode. > 2. Rewrite them so they do not inhibit post-self-insert-hook functions. This is difficult. If there were an easy way to do this, I would have done it. Note that, from the point of view of a major mode, post-self-insert-hook is totally random functionality - it is a bit like a trojan horse. The major mode has no way to control what it does, thus is unable to guarantee the major mode will work. There are other possible "fixes", for example modifying these functions so that they don't use self-insert-command at all, but somehow I don't think that's what you want. Another fix would be to specify restrictions on what one is allowed to do in this hook. I would prefer this, but other people would object strongly. I would advise against using post-self-insert-hook, if you possibly can. after-change-functions may be a good alternative. Maybe you can't. So, again, what is it you're trying to do? > In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.1) > of 2019-11-23 built on kyoncho-H87-D3H > Repository revision: 8934762bb37273e6606097de92dcc2556456acd2 > Repository branch: master > Windowing system distributor 'The X.Org Foundation', version 11.0.12001000 > System Description: Linux Mint 19.1 [ .... ] -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 01 05:03:17 2019 Received: (at 38406) by debbugs.gnu.org; 1 Dec 2019 10:03:17 +0000 Received: from localhost ([127.0.0.1]:35490 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibM4S-0001B9-RY for submit@debbugs.gnu.org; Sun, 01 Dec 2019 05:03:17 -0500 Received: from mail-lj1-f182.google.com ([209.85.208.182]:34889) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibM4P-0001Au-VU for 38406@debbugs.gnu.org; Sun, 01 Dec 2019 05:03:15 -0500 Received: by mail-lj1-f182.google.com with SMTP id j6so27469545lja.2 for <38406@debbugs.gnu.org>; Sun, 01 Dec 2019 02:03:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=maZFkN/Z5cMsDDpqK5peUCiAP1Mu0ulFOBOKw14i9PE=; b=aGN6nijrXZaUxMWtydf8muM5ACWG3v/eBvE2g3mWy+SexaFPmCLwBQr02+/vmJVNkV rdC1kndTjADoqymTdVay6HNewFJIQ9OoWb1i9TjZuAymD7V2Mah1NTMIT5qqTB4UZL/6 x2OviFqruY/disyH8KaR+a67qyULIP9Y/7TMXh1RPUOUz3+2disuNJO3+pKuXDFXgvKv 9za439U7Z1HMYZcNMFdiE/1wENL6fprBAIK0F2Apqo4aV91Co0KbqV42IbpSzdbUPA4l UtMJCtwdn8QC0oC7BDRk0Q5BuxZ6qqgvEsAgonI0j8eSieXm+79kISmpUW3e3orjyEJP 3QEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=maZFkN/Z5cMsDDpqK5peUCiAP1Mu0ulFOBOKw14i9PE=; b=XtCH1DECKaw5wBKff5NTdEEn/xESk0E4w1RFobIZGEsuLxRRpHQt3QqlcKci9C/GX9 BIfunhrSE9Uz1MIn7CamHXezVrhtwTR+vBwA5FQ2ajkCRB46ZlqcjeYq67dG+Itxvvek incGJEHPda9DsgutEb3vD/9G+OE7mYkkZeXKX/bGplY2g6V4O8ji5QexXsEnR7ely0B/ g3meBZcFye4Bt6arswI8RNRWUljuZrzDlz+itYo5sLJST9gjBsOMTM6EUi9Pvl+cPrLg aLEBXE/ql0sWb8UvUk4HtCKyIPzKci6R8lNfTK/w+pg+feQHTFQlvqTo7AI14Y6+yjLy YpPQ== X-Gm-Message-State: APjAAAUt1Qu4CGmY5awOe5XH0PgT2LEz6We/v9xxnc8RZKcEtnalEl/d 88UMIBqJRhhJPYp0bAaMGFlkVNKwjP7zthQ9LfQ= X-Google-Smtp-Source: APXvYqwgcPTAJ0gFKwE5/h/hjpCE5Xv8lwYoJMnj0/JNCtXZxUBwnOdByCcf6awCi078seyaZb4SXqkcmKQMNNFtp0A= X-Received: by 2002:a2e:808a:: with SMTP id i10mr27028889ljg.151.1575194587733; Sun, 01 Dec 2019 02:03:07 -0800 (PST) MIME-Version: 1.0 References: <20191130143638.GA6716@ACM> In-Reply-To: <20191130143638.GA6716@ACM> From: yyoncho Date: Sun, 1 Dec 2019 12:02:56 +0200 Message-ID: Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes To: Alan Mackenzie Content-Type: multipart/alternative; boundary="000000000000daa3840598a191af" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38406 Cc: 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000daa3840598a191af Content-Type: text/plain; charset="UTF-8" Hi Alan, > There are other possible "fixes", for example modifying these functions > so that they don't use self-insert-command at all, but somehow I don't > think that's what you want. I don't think that the code that is implemented against the contract listed in the hook documentation should be rewritten. If electric stuff is so that important and there is no way to disable it by default then at least a function to unbind the electric functionality the documentation of post-self-insert-hook should state: "Don't rely on this hook in cc derived modes because of {implementation details}. If you still want to use post-self-insert-hook disable use {implementation details} to turn electric off." Thanks, Ivan On Sat, Nov 30, 2019 at 4:36 PM Alan Mackenzie wrote: > Hello, Yyoncho. > > On Wed, Nov 27, 2019 at 22:00:26 +0200, yyoncho wrote: > > As per post-self-insert-hook documentation. > > > > Hook run at the end of `self-insert-command'. > > > This is run after inserting the character. > > Yes. This is a problematic hook, since it is capable of disrupting the > correct functionality of any Lisp program which uses > self-insert-command. This transpired in CC Mode, so to make > c-electric-brace and friends work, the action of the hook was nullified. > > > This does not hold by default in cc-mode due to the following mapped by > > default functions: > > > > (define-key c-mode-base-map "#" 'c-electric-pound) > > > (define-key c-mode-base-map "{" 'c-electric-brace) > > > (define-key c-mode-base-map "}" 'c-electric-brace) > > > (define-key c-mode-base-map "/" 'c-electric-slash) > > > (define-key c-mode-base-map "*" 'c-electric-star) > > > (define-key c-mode-base-map ";" 'c-electric-semi&comma) > > > (define-key c-mode-base-map "," 'c-electric-semi&comma) > > > (define-key c-mode-base-map ":" 'c-electric-colon) > > > (define-key c-mode-base-map "(" 'c-electric-paren) > > > (define-key c-mode-base-map ")" 'c-electric-paren) > > > All of these functions (or at least majority) contain the following > lines: > > > > (let (post-self-insert-hook) ; Disable random functionality. > > > (self-insert-command (prefix-numeric-value arg))) > > Yes. This was one way to get self-insert-function to perform its > correct functionality, namely inserting exactly one copy of a typed key > (or alternatively N copies when there's a prefix key). > > > Possible fixes: > > First question, what's the problem? What do you want to do that the > above mechanism hinders? > > > 1. Do not bind the functions by default. > > They are essential to the correct functioning of CC Mode. > > > 2. Rewrite them so they do not inhibit post-self-insert-hook functions. > > This is difficult. If there were an easy way to do this, I would have > done it. Note that, from the point of view of a major mode, > post-self-insert-hook is totally random functionality - it is a bit like > a trojan horse. The major mode has no way to control what it does, thus > is unable to guarantee the major mode will work. > > There are other possible "fixes", for example modifying these functions > so that they don't use self-insert-command at all, but somehow I don't > think that's what you want. > > Another fix would be to specify restrictions on what one is allowed to > do in this hook. I would prefer this, but other people would object > strongly. > > I would advise against using post-self-insert-hook, if you possibly can. > after-change-functions may be a good alternative. Maybe you can't. So, > again, what is it you're trying to do? > > > In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.1) > > of 2019-11-23 built on kyoncho-H87-D3H > > Repository revision: 8934762bb37273e6606097de92dcc2556456acd2 > > Repository branch: master > > Windowing system distributor 'The X.Org Foundation', version > 11.0.12001000 > > System Description: Linux Mint 19.1 > > [ .... ] > > -- > Alan Mackenzie (Nuremberg, Germany). > --000000000000daa3840598a191af Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Alan,

> There are other possible = "fixes", for example modifying these functions
> so that = they don't use self-insert-command at all, but somehow I don't
&= gt; think that's what you want.

I don't thin= k that the code that is implemented against the contract listed in
the h= ook documentation should be rewritten. If electric=C2=A0stuff is so thatimportant and there is no way to disable it by default then at least a fun= ction
to unbind the electric functionality the documentation of post-sel= f-insert-hook
should state: "Don't rely on this hook in cc deri= ved modes because of
{implementation details}. If you still want to use = post-self-insert-hook disable
use {implementation details} to turn elect= ric off."=C2=A0

Thanks,
Iva= n


On Sat, Nov 30, 2019 at = 4:36 PM Alan Mackenzie <= acm@muc.de> wrote:
Hello, Yyoncho.

On Wed, Nov 27, 2019 at 22:00:26 +0200, yyoncho wrote:
> As per post-self-insert-hook documentation.

> > Hook run at the end of `self-insert-command'.
> > This is run after inserting the character.

Yes.=C2=A0 This is a problematic hook, since it is capable of disrupting th= e
correct functionality of any Lisp program which uses
self-insert-command.=C2=A0 This transpired in CC Mode, so to make
c-electric-brace and friends work, the action of the hook was nullified.
> This does not hold by default in cc-mode due to the following mapped b= y
> default functions:

> > (define-key c-mode-base-map "#"=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0'c-electric-pound)
> > (define-key c-mode-base-map "{"=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0'c-electric-brace)
> > (define-key c-mode-base-map "}"=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0'c-electric-brace)
> > (define-key c-mode-base-map "/"=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0'c-electric-slash)
> > (define-key c-mode-base-map "*"=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0'c-electric-star)
> > (define-key c-mode-base-map ";"=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0'c-electric-semi&comma)
> > (define-key c-mode-base-map ","=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0'c-electric-semi&comma)
> > (define-key c-mode-base-map ":"=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0'c-electric-colon)
> > (define-key c-mode-base-map "("=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0'c-electric-paren)
> > (define-key c-mode-base-map ")"=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0'c-electric-paren)

> All of these functions (or at least majority) contain the following li= nes:

> > (let (post-self-insert-hook) ; Disable random functionality.
> >=C2=A0 =C2=A0 =C2=A0 (self-insert-command (prefix-numeric-value ar= g)))

Yes.=C2=A0 This was one way to get self-insert-function to perform its
correct functionality, namely inserting exactly one copy of a typed key
(or alternatively N copies when there's a prefix key).

> Possible fixes:

First question, what's the problem?=C2=A0 What do you want to do that t= he
above mechanism hinders?

> 1. Do not bind the functions by default.

They are essential to the correct functioning of CC Mode.

> 2. Rewrite them so they do not inhibit post-self-insert-hook functions= .

This is difficult.=C2=A0 If there were an easy way to do this, I would have=
done it.=C2=A0 Note that, from the point of view of a major mode,
post-self-insert-hook is totally random functionality - it is a bit like a trojan horse.=C2=A0 The major mode has no way to control what it does, th= us
is unable to guarantee the major mode will work.

There are other possible "fixes", for example modifying these fun= ctions
so that they don't use self-insert-command at all, but somehow I don= 9;t
think that's what you want.

Another fix would be to specify restrictions on what one is allowed to
do in this hook.=C2=A0 I would prefer this, but other people would object strongly.

I would advise against using post-self-insert-hook, if you possibly can. after-change-functions may be a good alternative.=C2=A0 Maybe you can't= .=C2=A0 So,
again, what is it you're trying to do?

> In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.= 1)
>=C2=A0 of 2019-11-23 built on kyoncho-H87-D3H
> Repository revision: 8934762bb37273e6606097de92dcc2556456acd2
> Repository branch: master
> Windowing system distributor 'The X.Org Foundation', version 1= 1.0.12001000
> System Description: Linux Mint 19.1

[ .... ]

--
Alan Mackenzie (Nuremberg, Germany).
--000000000000daa3840598a191af-- From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 01 10:07:44 2019 Received: (at 38406) by debbugs.gnu.org; 1 Dec 2019 15:07:44 +0000 Received: from localhost ([127.0.0.1]:36567 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibQp6-0004aE-75 for submit@debbugs.gnu.org; Sun, 01 Dec 2019 10:07:44 -0500 Received: from colin.muc.de ([193.149.48.1]:14157 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1ibQp4-0004a2-Cq for 38406@debbugs.gnu.org; Sun, 01 Dec 2019 10:07:43 -0500 Received: (qmail 9933 invoked by uid 3782); 1 Dec 2019 15:07:40 -0000 Received: from acm.muc.de (p2E5D5336.dip0.t-ipconnect.de [46.93.83.54]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 01 Dec 2019 16:07:38 +0100 Received: (qmail 6172 invoked by uid 1000); 1 Dec 2019 15:07:38 -0000 Date: Sun, 1 Dec 2019 15:07:38 +0000 To: yyoncho Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes Message-ID: <20191201150738.GB5085@ACM> References: <20191130143638.GA6716@ACM> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38406 Cc: 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Ivan. On Sun, Dec 01, 2019 at 12:02:56 +0200, yyoncho wrote: > Hi Alan, > > There are other possible "fixes", for example modifying these functions > > so that they don't use self-insert-command at all, but somehow I don't > > think that's what you want. > I don't think that the code that is implemented against the contract listed > in the hook documentation should be rewritten. If electric stuff is so > that important and there is no way to disable it by default then at > least a function to unbind the electric functionality the > documentation of post-self-insert-hook should state: "Don't rely on > this hook in cc derived modes because of {implementation details}. If > you still want to use post-self-insert-hook disable use > {implementation details} to turn electric off." The problem you have stumbled over is more of a political problem than a technical one. post-self-insert-hook was introduced relatively recently as a quick and dirty method of doing certain things. Its implications weren't thought through beforehand. In particular, it breaks major modes which use self-insert-command as part of their processing, including CC Mode. If functions put onto post-self-insert-hook didn't violate the definition of self-insert-command (inserting exactly one copy of the key typed), there wouldn't be a problem. An example of such a function is blink-paren-post-self-insert-function (see lisp/simple.el L7801). However, there are several functions put onto this hook that make extensive buffer changes. An example is electric-pair-post-self-insert-function (in lisp/elec-pair.el). These mess up self-insert-command, and violate the principle that major modes should be in charge of what text goes where in a window. People like using post-self-insert-hook without worrying about the problems it causes. Binding post-self-insert-hook to nil in CC Mode, while not good, was a pragmatic workaround from around a year ago. This allowed electric-pair-mode to function in CC Mode. As I said, this problem is primarily a political problem. Forgive me not wanting to draw too much attention to it at the moment. Again, how does this binding of post-self-insert-hook to nil in CC Mode affect you? What is it you're trying to do that this binding makes difficult? > Thanks, > Ivan -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 01 10:27:54 2019 Received: (at 38406) by debbugs.gnu.org; 1 Dec 2019 15:27:54 +0000 Received: from localhost ([127.0.0.1]:36587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibR8c-0005DD-7m for submit@debbugs.gnu.org; Sun, 01 Dec 2019 10:27:54 -0500 Received: from mail-lf1-f41.google.com ([209.85.167.41]:43985) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibR8Z-0005Cy-Ka for 38406@debbugs.gnu.org; Sun, 01 Dec 2019 10:27:52 -0500 Received: by mail-lf1-f41.google.com with SMTP id l14so25980389lfh.10 for <38406@debbugs.gnu.org>; Sun, 01 Dec 2019 07:27:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=s1STr6e7h0iWM3ZsBw1T250Wv1ueieZbGLXHFG2ov3g=; b=LA+mgqsByaq8rSLLYqD00IVZhFA4QEqrikgf3OHDSKsaAerHLsBuzeMAPj5Jsphy3l Gj7Y0tSoMdLMlPkuvYIZtwHj15CY2jsEE3pBrhfSXWumBZ0m5hqlIh9Z3iJGgWnFcdou cxy1rHOIJ7phR6rexFOizUYga746h7Kv7HKonud/VeRJ1Cr2DAf2IO9GR87hVSrHzsU1 k30VuuPW5RV70a6+RoyurtPFVAr6O0FClCwUgmYNPivR/5eabOezA36Gk41jI3fNX4yS JhPpqmejbXYdZfJYQPdhGntoUN2oY43B4Hmk0FokOWzsH2+42vh+/hxVSnBB5uFjICTw VNPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=s1STr6e7h0iWM3ZsBw1T250Wv1ueieZbGLXHFG2ov3g=; b=RbAxBab/x91CDiUuBefnhqFQTzFvIkE+u0r5LGINe+X+3SsbkCW7VppOyh6XJN1cFK yHQr/GuY9T28JouamCJOsoLPzCcxykuZz0LUq0Qnh+XBmV9jSaM7fX9ZlWuIE/Et1ka/ TYKItdQL6DtPRQkmVIMvDqFASkrZxL/t4I9rkUpBXE6FFmdgsRPC+lEXRj0uAHWhZJM1 3R6XEuG9R09DADytlGtjgcxIOxqdyQjyUm1fFERVLtxHpCj7DykHx7otzSuubtbcTMA1 zFYVAJsnLfGh5x8P2QA6CZ2NuR2lejGRMeBFF6jNFp+hvQNnzTFUGS2c0UkpDEfDviq9 3ejQ== X-Gm-Message-State: APjAAAWEtVP8ald+uFzoAMSyWFc26zxiKv54/MevN9jSraJEjirWbzqk WqpzsO4ij9ufAZjJ+O4kZPkzt4F9LRwhOCqP12w= X-Google-Smtp-Source: APXvYqzZVV9MYGhe6tlnNhp3PrpGxlj/1XNNg5mgNf8dKQox8d4ps6M6NXAXOl3JcB6WWBV430Oni67pXvx3H1AFE4M= X-Received: by 2002:ac2:5931:: with SMTP id v17mr12285745lfi.166.1575214065466; Sun, 01 Dec 2019 07:27:45 -0800 (PST) MIME-Version: 1.0 References: <20191130143638.GA6716@ACM> <20191201150738.GB5085@ACM> In-Reply-To: <20191201150738.GB5085@ACM> From: yyoncho Date: Sun, 1 Dec 2019 17:27:33 +0200 Message-ID: Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes To: Alan Mackenzie Content-Type: multipart/alternative; boundary="000000000000d141720598a61af3" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38406 Cc: 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000d141720598a61af3 Content-Type: text/plain; charset="UTF-8" Hi Alan > Again, how does this binding of post-self-insert-hook to nil in CC Mode > affect you? What is it you're trying to do that this binding makes > difficult? ATM this change breaks at least 2 packages - lsp-mode and smartparents. I am the maintainer of lsp-mode and it uses the hook for 2 things: 1. There are keys that are triggering displaying function signature. 2. There are keys that are triggering onTypeFormatting which happens asynchronously. I am not aware of how exactly smartparens uses post-insert-hook. Thanks, Ivan On Sun, Dec 1, 2019 at 5:07 PM Alan Mackenzie wrote: > Hello, Ivan. > > On Sun, Dec 01, 2019 at 12:02:56 +0200, yyoncho wrote: > > Hi Alan, > > > > There are other possible "fixes", for example modifying these functions > > > so that they don't use self-insert-command at all, but somehow I don't > > > think that's what you want. > > > I don't think that the code that is implemented against the contract > listed > > in the hook documentation should be rewritten. If electric stuff is so > > that important and there is no way to disable it by default then at > > least a function to unbind the electric functionality the > > documentation of post-self-insert-hook should state: "Don't rely on > > this hook in cc derived modes because of {implementation details}. If > > you still want to use post-self-insert-hook disable use > > {implementation details} to turn electric off." > > The problem you have stumbled over is more of a political problem than a > technical one. > > post-self-insert-hook was introduced relatively recently as a quick and > dirty method of doing certain things. Its implications weren't thought > through beforehand. In particular, it breaks major modes which use > self-insert-command as part of their processing, including CC Mode. > > If functions put onto post-self-insert-hook didn't violate the > definition of self-insert-command (inserting exactly one copy of the key > typed), there wouldn't be a problem. An example of such a function is > blink-paren-post-self-insert-function (see lisp/simple.el L7801). > > However, there are several functions put onto this hook that make > extensive buffer changes. An example is > electric-pair-post-self-insert-function (in lisp/elec-pair.el). These > mess up self-insert-command, and violate the principle that major modes > should be in charge of what text goes where in a window. > > People like using post-self-insert-hook without worrying about the > problems it causes. Binding post-self-insert-hook to nil in CC Mode, > while not good, was a pragmatic workaround from around a year ago. This > allowed electric-pair-mode to function in CC Mode. As I said, this > problem is primarily a political problem. Forgive me not wanting to > draw too much attention to it at the moment. > > Again, how does this binding of post-self-insert-hook to nil in CC Mode > affect you? What is it you're trying to do that this binding makes > difficult? > > > Thanks, > > Ivan > > -- > Alan Mackenzie (Nuremberg, Germany). > --000000000000d141720598a61af3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Hi Alan

> = Again, how does this binding of post-self-insert-hook to nil in CC Mode
= > affect you?=C2=A0 What is it you're trying to do that this binding= makes
> difficult?

ATM this change brea= ks at least 2 packages - lsp-mode and smartparents. I
am the main= tainer of lsp-mode and it uses the hook for 2 things:

<= div>1. There are keys that are triggering displaying function signature.
2. There are keys that are triggering onTypeFormatting which happen= s asynchronously.=C2=A0

I am not aware of how exac= tly=C2=A0smartparens uses post-insert-hook.

Thanks= ,
Ivan

On Sun, Dec 1, 2019 at 5:07 PM Alan Mackenzie <acm@muc.de> wrote:
Hello, Ivan.

On Sun, Dec 01, 2019 at 12:02:56 +0200, yyoncho wrote:
> Hi Alan,

> > There are other possible "fixes", for example modifying= these functions
> > so that they don't use self-insert-command at all, but someho= w I don't
> > think that's what you want.

> I don't think that the code that is implemented against the contra= ct listed
> in the hook documentation should be rewritten. If electric stuff is so=
> that important and there is no way to disable it by default then at > least a function to unbind the electric functionality the
> documentation of post-self-insert-hook should state: "Don't r= ely on
> this hook in cc derived modes because of {implementation details}. If<= br> > you still want to use post-self-insert-hook disable use
> {implementation details} to turn electric off."

The problem you have stumbled over is more of a political problem than a technical one.

post-self-insert-hook was introduced relatively recently as a quick and
dirty method of doing certain things.=C2=A0 Its implications weren't th= ought
through beforehand.=C2=A0 In particular, it breaks major modes which use self-insert-command as part of their processing, including CC Mode.

If functions put onto post-self-insert-hook didn't violate the
definition of self-insert-command (inserting exactly one copy of the key typed), there wouldn't be a problem.=C2=A0 An example of such a functio= n is
blink-paren-post-self-insert-function (see lisp/simple.el L7801).

However, there are several functions put onto this hook that make
extensive buffer changes.=C2=A0 An example is
electric-pair-post-self-insert-function (in lisp/elec-pair.el).=C2=A0 These=
mess up self-insert-command, and violate the principle that major modes
should be in charge of what text goes where in a window.

People like using post-self-insert-hook without worrying about the
problems it causes.=C2=A0 Binding post-self-insert-hook to nil in CC Mode,<= br> while not good, was a pragmatic workaround from around a year ago.=C2=A0 Th= is
allowed electric-pair-mode to function in CC Mode.=C2=A0 As I said, this problem is primarily a political problem.=C2=A0 Forgive me not wanting to draw too much attention to it at the moment.

Again, how does this binding of post-self-insert-hook to nil in CC Mode
affect you?=C2=A0 What is it you're trying to do that this binding make= s
difficult?

> Thanks,
> Ivan

--
Alan Mackenzie (Nuremberg, Germany).
--000000000000d141720598a61af3-- From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 01 10:58:48 2019 Received: (at 38406) by debbugs.gnu.org; 1 Dec 2019 15:58:48 +0000 Received: from localhost ([127.0.0.1]:36591 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibRcV-00065u-Uv for submit@debbugs.gnu.org; Sun, 01 Dec 2019 10:58:48 -0500 Received: from colin.muc.de ([193.149.48.1]:61000 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1ibRcU-00065m-Ih for 38406@debbugs.gnu.org; Sun, 01 Dec 2019 10:58:47 -0500 Received: (qmail 23761 invoked by uid 3782); 1 Dec 2019 15:58:44 -0000 Received: from acm.muc.de (p2E5D5336.dip0.t-ipconnect.de [46.93.83.54]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 01 Dec 2019 16:58:42 +0100 Received: (qmail 6403 invoked by uid 1000); 1 Dec 2019 15:58:42 -0000 Date: Sun, 1 Dec 2019 15:58:42 +0000 To: yyoncho Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes Message-ID: <20191201155842.GC5085@ACM> References: <20191130143638.GA6716@ACM> <20191201150738.GB5085@ACM> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38406 Cc: 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Ivan. On Sun, Dec 01, 2019 at 17:27:33 +0200, yyoncho wrote: > Hi Alan > I am not aware of how exactly smartparens uses post-insert-hook. In the simplest case, when you type, e.g. "{", it inserts "{}". In other cases, when you type "}" onto the existing Rbrace in "{}" it erases one of the Rbraces. The problem with this for CC Mode (in c-electric-brace, for example) is that all these extra and removed characters play havoc with CC Mode's insertion of auto-newlines and its execution of "clean ups" (e.g. compacting "}\n else {" to "} else {"). > > Again, how does this binding of post-self-insert-hook to nil in CC > > Mode affect you? What is it you're trying to do that this binding > > makes difficult? > ATM this change breaks at least 2 packages - lsp-mode and smartparents. I > am the maintainer of lsp-mode and it uses the hook for 2 things: > 1. There are keys that are triggering displaying function signature. > 2. There are keys that are triggering onTypeFormatting which happens > asynchronously. Ok, thanks for telling me! Why are you using post-self-insert-hook for these? This hook can run in the middle of a major mode's command, but surely you want them to run _after_ that command, no? Why not use post-command-hook here instead? > Thanks, > Ivan -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 01 13:00:21 2019 Received: (at 38406) by debbugs.gnu.org; 1 Dec 2019 18:00:21 +0000 Received: from localhost ([127.0.0.1]:36669 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibTW9-0000t7-50 for submit@debbugs.gnu.org; Sun, 01 Dec 2019 13:00:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43217) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibTW6-0000sp-W0 for 38406@debbugs.gnu.org; Sun, 01 Dec 2019 13:00:19 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51581) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ibTW0-0005IZ-9E; Sun, 01 Dec 2019 13:00:13 -0500 Received: from [176.228.60.248] (port=2184 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ibTVx-0008JR-5F; Sun, 01 Dec 2019 13:00:11 -0500 Date: Sun, 01 Dec 2019 19:59:54 +0200 Message-Id: <83imn0lyed.fsf@gnu.org> From: Eli Zaretskii To: Alan Mackenzie In-reply-to: <20191201150738.GB5085@ACM> (message from Alan Mackenzie on Sun, 1 Dec 2019 15:07:38 +0000) Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes References: <20191130143638.GA6716@ACM> <20191201150738.GB5085@ACM> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 38406 Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 1 Dec 2019 15:07:38 +0000 > From: Alan Mackenzie > Cc: 38406@debbugs.gnu.org > > > > There are other possible "fixes", for example modifying these functions > > > so that they don't use self-insert-command at all, but somehow I don't > > > think that's what you want. > > > I don't think that the code that is implemented against the contract listed > > in the hook documentation should be rewritten. If electric stuff is so > > that important and there is no way to disable it by default then at > > least a function to unbind the electric functionality the > > documentation of post-self-insert-hook should state: "Don't rely on > > this hook in cc derived modes because of {implementation details}. If > > you still want to use post-self-insert-hook disable use > > {implementation details} to turn electric off." > > The problem you have stumbled over is more of a political problem than a > technical one. Can we please make it technical again? Why can't the CC Mode function which temporarily disables post-self-insert-hook call the hook functions after it does its thing? (I think I already asked this in the past, but I cannot find that question of any discussion of it.) From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 01 13:04:01 2019 Received: (at 38406) by debbugs.gnu.org; 1 Dec 2019 18:04:01 +0000 Received: from localhost ([127.0.0.1]:36673 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibTZg-0000y7-MI for submit@debbugs.gnu.org; Sun, 01 Dec 2019 13:04:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43995) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibTZe-0000xv-Ar for 38406@debbugs.gnu.org; Sun, 01 Dec 2019 13:03:59 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51658) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ibTZY-0000BT-CV; Sun, 01 Dec 2019 13:03:52 -0500 Received: from [176.228.60.248] (port=2410 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ibTZX-0005B1-MH; Sun, 01 Dec 2019 13:03:52 -0500 Date: Sun, 01 Dec 2019 20:03:38 +0200 Message-Id: <83h82jncsl.fsf@gnu.org> From: Eli Zaretskii To: Alan Mackenzie In-reply-to: <20191201155842.GC5085@ACM> (message from Alan Mackenzie on Sun, 1 Dec 2019 15:58:42 +0000) Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes References: <20191130143638.GA6716@ACM> <20191201150738.GB5085@ACM> <20191201155842.GC5085@ACM> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 38406 Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 1 Dec 2019 15:58:42 +0000 > From: Alan Mackenzie > Cc: 38406@debbugs.gnu.org > > Why not use post-command-hook here instead? I don't know what's Ivan's reason, but I know mine: post-command-hook runs much more frequently (since self-insert-command's are a small subset of commands in general), and therefore its use is much more likely to make Emacs less responsive. E.g., cursor motion commands will not call post-self-insert-hook. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 01 14:27:15 2019 Received: (at 38406) by debbugs.gnu.org; 1 Dec 2019 19:27:15 +0000 Received: from localhost ([127.0.0.1]:36721 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibUsE-00057c-Ts for submit@debbugs.gnu.org; Sun, 01 Dec 2019 14:27:15 -0500 Received: from colin.muc.de ([193.149.48.1]:20940 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1ibUsC-00057S-0C for 38406@debbugs.gnu.org; Sun, 01 Dec 2019 14:27:13 -0500 Received: (qmail 74664 invoked by uid 3782); 1 Dec 2019 19:27:10 -0000 Received: from acm.muc.de (p2E5D5336.dip0.t-ipconnect.de [46.93.83.54]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 01 Dec 2019 20:27:08 +0100 Received: (qmail 8906 invoked by uid 1000); 1 Dec 2019 19:27:09 -0000 Date: Sun, 1 Dec 2019 19:27:09 +0000 To: Eli Zaretskii Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes Message-ID: <20191201192709.GE5085@ACM> References: <20191130143638.GA6716@ACM> <20191201150738.GB5085@ACM> <83imn0lyed.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83imn0lyed.fsf@gnu.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38406 Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Eli. On Sun, Dec 01, 2019 at 19:59:54 +0200, Eli Zaretskii wrote: > > Date: Sun, 1 Dec 2019 15:07:38 +0000 > > From: Alan Mackenzie > > Cc: 38406@debbugs.gnu.org > > > > There are other possible "fixes", for example modifying these > > > > functions so that they don't use self-insert-command at all, but > > > > somehow I don't think that's what you want. > > > I don't think that the code that is implemented against the > > > contract listed in the hook documentation should be rewritten. If > > > electric stuff is so that important and there is no way to disable > > > it by default then at least a function to unbind the electric > > > functionality the documentation of post-self-insert-hook should > > > state: "Don't rely on this hook in cc derived modes because of > > > {implementation details}. If you still want to use > > > post-self-insert-hook disable use {implementation details} to turn > > > electric off." > > The problem you have stumbled over is more of a political problem > > than a technical one. > Can we please make it technical again? Why can't the CC Mode function > which temporarily disables post-self-insert-hook call the hook > functions after it does its thing? (I think I already asked this in > the past, but I cannot find that question or any discussion of it.) See bug #33794 (but a lot of the discussion is unedifying). post-self-insert-hook's functions, unusually amongs hooks, interfere with its triggering event. This contrasts with, say, after-change-functions, where the functions don't insert into or delete from the buffer, or pre-redisplay-functions, where the functions don't try to prevent a particular window getting displayed. But post-s-i-h customarily makes its own buffer changes such that self-insert-command no longer performs its prime function, which is to insert exactly one copy (or N copies) of the typed key into the buffer. This makes it problematic for Lisp code which calls self-insert-command. It would be nice if functions on post-self-insert-hook could be split into "disruptive" ones and "safe" ones, so that a function such as c-electric-brace could elect to run just the "safe" ones. I think Ivan's functions would likely be classed as "safe". How about this idea for Emacs 28? Anyhow back to your question: c-electric-brace carefully calls electric-pair-post-self-insert-function testing various states afterwards (such as the buffer reducing in size) so as to be able to complete c-electric-brace's own processing. Just calling post-self-insert-hook instead could easily upset this balance. Unfortunately this hook can contain arbitrary code, and frequently does. So to call this hook at the end of c-electric-brace would mean having to filter the hook first (at the very least, to remove electric-pair-post-self-insert-function), which just seems very hackish and unsatisfactory. As a statistic, there are approximately 111 occurrences of (self-insert-command ...) in the Emacs Lisp sources. Any of them might be vulnerable to disruption by post-self-insert-hook. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 01 15:47:27 2019 Received: (at 38406) by debbugs.gnu.org; 1 Dec 2019 20:47:27 +0000 Received: from localhost ([127.0.0.1]:36776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibW7q-0007Fs-Uy for submit@debbugs.gnu.org; Sun, 01 Dec 2019 15:47:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37623) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibW7o-0007Fd-FX for 38406@debbugs.gnu.org; Sun, 01 Dec 2019 15:47:25 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53133) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ibW7i-0003Zy-TU; Sun, 01 Dec 2019 15:47:18 -0500 Received: from [176.228.60.248] (port=4846 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ibW7f-00049x-QJ; Sun, 01 Dec 2019 15:47:18 -0500 Date: Sun, 01 Dec 2019 22:47:01 +0200 Message-Id: <83blsrn58a.fsf@gnu.org> From: Eli Zaretskii To: Alan Mackenzie In-reply-to: <20191201192709.GE5085@ACM> (message from Alan Mackenzie on Sun, 1 Dec 2019 19:27:09 +0000) Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes References: <20191130143638.GA6716@ACM> <20191201150738.GB5085@ACM> <83imn0lyed.fsf@gnu.org> <20191201192709.GE5085@ACM> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 38406 Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 1 Dec 2019 19:27:09 +0000 > Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org > From: Alan Mackenzie > > post-self-insert-hook's functions, unusually amongs hooks, interfere with > its triggering event. This contrasts with, say, after-change-functions, > where the functions don't insert into or delete from the buffer, or > pre-redisplay-functions, where the functions don't try to prevent a > particular window getting displayed. You'd be surprised to know what some of those hooks do. Everything you say they don't, and then some. There's nothing we can do to prevent people from shooting themselves in the foot or hanging themselves with the rope we provided. And if you think you are the only one who needs to harden your code to let people do the craziest things with these hooks, please don't think so: you are definitely not alone. But breaking a hook's contract as a means to teach people not to shoot themselves in the foot is not right. If the uses are legitimate, they should be able to do them; if they aren't, let them cope with the consequences. > So to call this hook at the end of c-electric-brace would mean having to > filter the hook first (at the very least, to remove > electric-pair-post-self-insert-function), which just seems very hackish > and unsatisfactory. It doesn't seem too hackish to me, and as a nice bonus we will have post-self-insert-hook act as per its contract again. So could you please do that? TIA. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 02 13:32:03 2019 Received: (at 38406) by debbugs.gnu.org; 2 Dec 2019 18:32:03 +0000 Received: from localhost ([127.0.0.1]:38930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibqUM-0004XY-Ob for submit@debbugs.gnu.org; Mon, 02 Dec 2019 13:32:02 -0500 Received: from colin.muc.de ([193.149.48.1]:18852 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1ibqUL-0004X9-6q for 38406@debbugs.gnu.org; Mon, 02 Dec 2019 13:32:02 -0500 Received: (qmail 79959 invoked by uid 3782); 2 Dec 2019 18:31:59 -0000 Received: from acm.muc.de (p4FE15992.dip0.t-ipconnect.de [79.225.89.146]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 02 Dec 2019 19:31:56 +0100 Received: (qmail 4180 invoked by uid 1000); 2 Dec 2019 18:31:56 -0000 Date: Mon, 2 Dec 2019 18:31:56 +0000 To: Eli Zaretskii Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes Message-ID: <20191202183156.GA4175@ACM> References: <20191130143638.GA6716@ACM> <20191201150738.GB5085@ACM> <83imn0lyed.fsf@gnu.org> <20191201192709.GE5085@ACM> <83blsrn58a.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83blsrn58a.fsf@gnu.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38406 Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Eli. On Sun, Dec 01, 2019 at 22:47:01 +0200, Eli Zaretskii wrote: > > Date: Sun, 1 Dec 2019 19:27:09 +0000 > > Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org > > From: Alan Mackenzie > > post-self-insert-hook's functions, unusually amongs hooks, interfere > > with its triggering event. This contrasts with, say, > > after-change-functions, where the functions don't insert into or > > delete from the buffer, or pre-redisplay-functions, where the > > functions don't try to prevent a particular window getting > > displayed. > You'd be surprised to know what some of those hooks do. Everything > you say they don't, and then some. Any chance you could name one (or even two), thus letting me see for myself? > There's nothing we can do to prevent people from shooting themselves > in the foot or hanging themselves with the rope we provided. In the case of post-self-insert-hook, the damaging functions are part of Emacs itself, not crazy user-written code. > And if you think you are the only one who needs to harden your code to > let people do the craziest things with these hooks, please don't think > so: you are definitely not alone. OK. > But breaking a hook's contract as a means to teach people not to shoot > themselves in the foot is not right. If the uses are legitimate, they > should be able to do them; if they aren't, let them cope with the > consequences. > > So to call this hook at the end of c-electric-brace would mean having to > > filter the hook first (at the very least, to remove > > electric-pair-post-self-insert-function), which just seems very hackish > > and unsatisfactory. > It doesn't seem too hackish to me, and as a nice bonus we will have > post-self-insert-hook act as per its contract again. > So could you please do that? TIA. OK, I'll do that. It's not a nice thing to do, but we're kind of lacking nice things in this situation. Give me a few days, please - I'm a touch busy in RL at the moment. Additionally, how about reversing the encouragement in the Elisp manual to put buffer changing functions onto post-self-insert-hook? -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 02 13:37:37 2019 Received: (at 38406) by debbugs.gnu.org; 2 Dec 2019 18:37:37 +0000 Received: from localhost ([127.0.0.1]:38940 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibqZl-0004fe-3m for submit@debbugs.gnu.org; Mon, 02 Dec 2019 13:37:37 -0500 Received: from colin.muc.de ([193.149.48.1]:18993 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1ibqZj-0004fW-P3 for 38406@debbugs.gnu.org; Mon, 02 Dec 2019 13:37:36 -0500 Received: (qmail 81770 invoked by uid 3782); 2 Dec 2019 18:37:34 -0000 Received: from acm.muc.de (p4FE15992.dip0.t-ipconnect.de [79.225.89.146]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 02 Dec 2019 19:37:31 +0100 Received: (qmail 4188 invoked by uid 1000); 2 Dec 2019 18:37:31 -0000 Date: Mon, 2 Dec 2019 18:37:31 +0000 To: Eli Zaretskii Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes Message-ID: <20191202183731.GB4175@ACM> References: <20191130143638.GA6716@ACM> <20191201150738.GB5085@ACM> <20191201155842.GC5085@ACM> <83h82jncsl.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83h82jncsl.fsf@gnu.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38406 Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Eli. On Sun, Dec 01, 2019 at 20:03:38 +0200, Eli Zaretskii wrote: > > Date: Sun, 1 Dec 2019 15:58:42 +0000 > > From: Alan Mackenzie > > Cc: 38406@debbugs.gnu.org > > Why not use post-command-hook here instead? > I don't know what's Ivan's reason, but I know mine: post-command-hook > runs much more frequently (since self-insert-command's are a small > subset of commands in general), and therefore its use is much more > likely to make Emacs less responsive. E.g., cursor motion commands > will not call post-self-insert-hook. What we could do with here is a post-change-command-functions, something a bit like after-change-functions in what triggers it, and a bit like post-command-hook in when it gets triggered. Of course, one could say that we have too many hooks already ..... -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 02 15:17:23 2019 Received: (at 38406) by debbugs.gnu.org; 2 Dec 2019 20:17:23 +0000 Received: from localhost ([127.0.0.1]:38991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibs8I-0007KP-VW for submit@debbugs.gnu.org; Mon, 02 Dec 2019 15:17:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35405) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibs8G-0007KB-8B for 38406@debbugs.gnu.org; Mon, 02 Dec 2019 15:17:21 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44353) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ibs8A-0008O1-2U; Mon, 02 Dec 2019 15:17:14 -0500 Received: from [176.228.60.248] (port=2998 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ibs89-0002tf-Hu; Mon, 02 Dec 2019 15:17:13 -0500 Date: Mon, 02 Dec 2019 22:17:01 +0200 Message-Id: <837e3elbya.fsf@gnu.org> From: Eli Zaretskii To: Alan Mackenzie In-reply-to: <20191202183156.GA4175@ACM> (message from Alan Mackenzie on Mon, 2 Dec 2019 18:31:56 +0000) Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes References: <20191130143638.GA6716@ACM> <20191201150738.GB5085@ACM> <83imn0lyed.fsf@gnu.org> <20191201192709.GE5085@ACM> <83blsrn58a.fsf@gnu.org> <20191202183156.GA4175@ACM> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 38406 Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Mon, 2 Dec 2019 18:31:56 +0000 > Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org > From: Alan Mackenzie > > > You'd be surprised to know what some of those hooks do. Everything > > you say they don't, and then some. > > Any chance you could name one (or even two), thus letting me see for > myself? I'd have to dig for them. I'll try. > > It doesn't seem too hackish to me, and as a nice bonus we will have > > post-self-insert-hook act as per its contract again. > > > So could you please do that? TIA. > > OK, I'll do that. It's not a nice thing to do, but we're kind of > lacking nice things in this situation. Give me a few days, please - I'm > a touch busy in RL at the moment. Thanks, there's no special rush. > Additionally, how about reversing the encouragement in the Elisp manual > to put buffer changing functions onto post-self-insert-hook? If you could suggest the text to explain why this should be discouraged, I promise to consider it. From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 04 15:42:11 2019 Received: (at 38406) by debbugs.gnu.org; 4 Dec 2019 20:42:11 +0000 Received: from localhost ([127.0.0.1]:42721 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icbTP-0004DH-C3 for submit@debbugs.gnu.org; Wed, 04 Dec 2019 15:42:11 -0500 Received: from colin.muc.de ([193.149.48.1]:32400 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1icbTI-0004D9-F9 for 38406@debbugs.gnu.org; Wed, 04 Dec 2019 15:42:05 -0500 Received: (qmail 1870 invoked by uid 3782); 4 Dec 2019 20:42:03 -0000 Received: from acm.muc.de (p4FE15AD3.dip0.t-ipconnect.de [79.225.90.211]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 04 Dec 2019 21:41:59 +0100 Received: (qmail 8080 invoked by uid 1000); 4 Dec 2019 20:41:59 -0000 Date: Wed, 4 Dec 2019 20:41:59 +0000 To: Eli Zaretskii , yyoncho@gmail.com Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes Message-ID: <20191204204159.GA7587@ACM> References: <20191130143638.GA6716@ACM> <20191201150738.GB5085@ACM> <83imn0lyed.fsf@gnu.org> <20191201192709.GE5085@ACM> <83blsrn58a.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83blsrn58a.fsf@gnu.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38406 Cc: 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Eli and Ivan. On Sun, Dec 01, 2019 at 22:47:01 +0200, Eli Zaretskii wrote: > > Date: Sun, 1 Dec 2019 19:27:09 +0000 > > Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org > > From: Alan Mackenzie [ .... ] > But breaking a hook's contract as a means to teach people not to shoot > themselves in the foot is not right. If the uses are legitimate, they > should be able to do them; if they aren't, let them cope with the > consequences. > > So to call this hook at the end of c-electric-brace would mean > > having to filter the hook first (at the very least, to remove > > electric-pair-post-self-insert-function), which just seems very > > hackish and unsatisfactory. > It doesn't seem too hackish to me, and as a nice bonus we will have > post-self-insert-hook act as per its contract again. > So could you please do that? TIA. OK, here's a patch which I think does just what's wanted. Would you please try it out, Ivan, then let me know that it works, or about any problems which there still may be? Thanks. It's merely necessary to apply the patch below, byte compile cc-cmds.el, and load it. (In the highly unlikely event you want any help with the patch or the compilation, feel free to send me private email.) The patch should apply cleanly to the Emacs master branch. diff -r d20020192bd6 cc-cmds.el --- a/cc-cmds.el Sat Nov 30 21:10:11 2019 +0000 +++ b/cc-cmds.el Wed Dec 04 20:15:11 2019 +0000 @@ -493,6 +493,34 @@ (c-hungry-delete-forward) (c-hungry-delete-backwards))) +(defvar c--unsafe-post-self-insert-hook-functions + '(smie-blink-matching-open + electric-pair-post-self-insert-function + blink-paren-post-self-insert-function + electric-indent-post-self-insert-function + electric-layout-post-self-insert-function + electric-quote-post-self-insert-function) + "Known unsafe functions when members of `post-self-insert-hook' in CC Mode") + +(defun c--call-post-self-insert-hook-more-safely () + ;; Call post-self-insert-hook, having removed from `post-self-insert-hook' + ;; function known not to be safe to CC Mode. The result is of no + ;; significance. Note that the hook call is NOT absolutely safe. + (let ((src post-self-insert-hook) + dest) + (while src + (cond + ((memq (car src) c--unsafe-post-self-insert-hook-functions)) + ((eq (car src) t) + (let ((src (default-value 'post-self-insert-hook))) + (while src + (unless (memq (car src) c--unsafe-post-self-insert-hook-functions) + (add-hook dest (car src) t)) ; Preserve the order of the functions. + (setq src (cdr src))))) + (t (add-hook dest (car src) t))) ; Preserve the order of the functions. + (setq src (cdr src))) + (run-hooks dest))) + (defun c-electric-pound (arg) "Insert a \"#\". If `c-electric-flag' is set, handle it specially according to the variable @@ -522,7 +550,8 @@ (insert (c-last-command-char)) (and (not bolp) (goto-char (- (point-max) pos))) - ))) + )) + (c--call-post-self-insert-hook-more-safely)) (defun c-point-syntax () ;; Return the syntactic context of the construct at point. (This is NOT @@ -903,7 +932,8 @@ (save-excursion (c-save-buffer-state nil (c-backward-syntactic-ws safepos)) - (funcall old-blink-paren))))) + (funcall old-blink-paren))) + (c--call-post-self-insert-hook-more-safely))) (defun c-electric-slash (arg) "Insert a slash character. @@ -955,7 +985,8 @@ (let (post-self-insert-hook) ; Disable random functionality. (self-insert-command (prefix-numeric-value arg))) (if indentp - (indent-according-to-mode)))) + (indent-according-to-mode)) + (c--call-post-self-insert-hook-more-safely))) (defun c-electric-star (arg) "Insert a star character. @@ -985,7 +1016,8 @@ (bolp)))) (let (c-echo-syntactic-information-p) ; shut this up (indent-according-to-mode)) - )) + ) + (c--call-post-self-insert-hook-more-safely)) (defun c-electric-semi&comma (arg) "Insert a comma or semicolon. @@ -1057,8 +1089,8 @@ (setq add-newline-p (not (eq answer 'stop))) )) (if add-newline-p - (c-newline-and-indent)) - ))))) + (c-newline-and-indent))))) + (c--call-post-self-insert-hook-more-safely))) (defun c-electric-colon (arg) "Insert a colon. @@ -1160,8 +1192,8 @@ ;; does a newline go after the colon? (if (and (memq 'after (cdr-safe newlines)) (not is-scope-op)) - (c-newline-and-indent)) - )))) + (c-newline-and-indent)))) + (c--call-post-self-insert-hook-more-safely))) (defun c-electric-lt-gt (arg) "Insert a \"<\" or \">\" character. @@ -1251,7 +1283,8 @@ ;; From now (2016-01-01), the syntax-table text properties on < and > ;; are applied in an after-change function, not during redisplay. Hence ;; we no longer need to call (sit-for 0) for blink paren to work. - (funcall blink-paren-function))))) + (funcall blink-paren-function)))) + (c--call-post-self-insert-hook-more-safely)) (defun c-electric-paren (arg) "Insert a parenthesis. @@ -1370,7 +1403,8 @@ ;; Apply `electric-pair-mode' stuff inside a string or comment. (when (and (boundp 'electric-pair-mode) electric-pair-mode) (let (post-self-insert-hook) - (electric-pair-post-self-insert-function)))))) + (electric-pair-post-self-insert-function)))) + (c--call-post-self-insert-hook-more-safely))) (defun c-electric-continued-statement () "Reindent the current line if appropriate. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 04 16:05:03 2019 Received: (at 38406) by debbugs.gnu.org; 4 Dec 2019 21:05:04 +0000 Received: from localhost ([127.0.0.1]:42748 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icbpX-00059g-Mn for submit@debbugs.gnu.org; Wed, 04 Dec 2019 16:05:03 -0500 Received: from mail-wr1-f41.google.com ([209.85.221.41]:40424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icbpV-00058c-BR for 38406@debbugs.gnu.org; Wed, 04 Dec 2019 16:05:01 -0500 Received: by mail-wr1-f41.google.com with SMTP id c14so894130wrn.7 for <38406@debbugs.gnu.org>; Wed, 04 Dec 2019 13:05:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=7JlDxUDtNZf7Jus0YxZljp2tdUp3ELd+Zbc4LcflzJk=; b=YzhQdk9STIs0c8TQqNUjNqIyNkMeeiK7Fgsr/qwyRSUO0sA6vNZ9USWoUqlIYLWJY+ aCuy4r+cIGMJJ40VpVBBbBfPZ+Bzwr6xxb3D+h9p4n8Zxkfgd5QBs1Rw03wXdRYhGA3R 7LmoJv4toK0njvx5ToX7KFU29N6uoCMzUIeLhbgdZO6wkZd5o7yKzvRv4rh7TI5EPr4N 4wq3Rnx149i9m8SA8bIkKYqUsVvOHVCOmFb0nQcSAdHAZoolr2cS5CGOooYxSDqfxPwA 8/v3pJiSHFqYE9zldQ2M9OMhA3win9VbTZShB7GaIvJlajvYtcbEclS6mNwC8eyjT9S0 KRAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=7JlDxUDtNZf7Jus0YxZljp2tdUp3ELd+Zbc4LcflzJk=; b=D0t4r3290ruZhnXBvAJVM5T/ID5EwV/bs42UEPMJbtRHsBgin5mijLbbDFN6WWf4wp /xT4XFppRmpVugGty4V9dWZOiDsHX9uYrFQsq2bLB7EttfT3efih8s41E9v9+8DEUbz3 s5ITNNwfg+JqiQeLjVYhBkDHWVDhMgGNqpc2M2Tr46XZ6TTNHPfB3IMi7e74I65+Biz8 +TUJSM1CAkA5qjedBP/b35S+O92qpWNqWmv6V0OFvTWZn0Pzsv2gcnVSaG+8Ka4LQb8z i01twsTlfhDLHG58ufVr1Cx48mhmjGs0X91ymQXAoxT1/K5lSmt1n30jMEF+PpsXohCo 2ZpA== X-Gm-Message-State: APjAAAVLG6YsfDwD2/mTsQlA9fNQHyCsDFGkrmdhW2y1d1A+qtQ92EEh DtOIq6JBUQ9wZi90/BRSTj8J8MbN X-Google-Smtp-Source: APXvYqwgFf6Q/N61gCr7AVta3YljJtj8J4aw9OP5rFDLQL5n3ez1q8WIqbm+3MICTZr7Vcp3nisYkw== X-Received: by 2002:a5d:55d1:: with SMTP id i17mr6123330wrw.165.1575493470490; Wed, 04 Dec 2019 13:04:30 -0800 (PST) Received: from [192.168.0.5] ([212.50.117.215]) by smtp.googlemail.com with ESMTPSA id z13sm8324550wmi.18.2019.12.04.13.04.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Dec 2019 13:04:29 -0800 (PST) Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes To: Alan Mackenzie , Eli Zaretskii , yyoncho@gmail.com References: <20191130143638.GA6716@ACM> <20191201150738.GB5085@ACM> <83imn0lyed.fsf@gnu.org> <20191201192709.GE5085@ACM> <83blsrn58a.fsf@gnu.org> <20191204204159.GA7587@ACM> From: Dmitry Gutov Message-ID: <798bda88-41a7-361c-c01b-22ca4d6138e0@yandex.ru> Date: Wed, 4 Dec 2019 23:04:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191204204159.GA7587@ACM> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 38406 Cc: 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) On 04.12.2019 22:41, Alan Mackenzie wrote: > +(defvar c--unsafe-post-self-insert-hook-functions > + '(smie-blink-matching-open > + electric-pair-post-self-insert-function > + blink-paren-post-self-insert-function > + electric-indent-post-self-insert-function > + electric-layout-post-self-insert-function > + electric-quote-post-self-insert-function) > + "Known unsafe functions when members of `post-self-insert-hook' in CC Mode") I don't see how filtering out a bunch of popular consumers of post-self-insert-hook can make it "act as per its contract again". More surprisingly, what did smie-blink-matching-open and blink-paren-post-self-insert-function ever do so wrong? Neither of them modifies the buffer's contents. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 05 09:45:31 2019 Received: (at 38406) by debbugs.gnu.org; 5 Dec 2019 14:45:31 +0000 Received: from localhost ([127.0.0.1]:43402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icsNn-0008N8-11 for submit@debbugs.gnu.org; Thu, 05 Dec 2019 09:45:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50454) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icsNl-0008Mw-Fu for 38406@debbugs.gnu.org; Thu, 05 Dec 2019 09:45:29 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1icsNf-0000fU-Uq; Thu, 05 Dec 2019 09:45:24 -0500 Received: from [176.228.60.248] (port=2414 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1icsNX-0002nt-2c; Thu, 05 Dec 2019 09:45:22 -0500 Date: Thu, 05 Dec 2019 16:45:12 +0200 Message-Id: <83immuj0g7.fsf@gnu.org> From: Eli Zaretskii To: Alan Mackenzie In-reply-to: <20191204204159.GA7587@ACM> (message from Alan Mackenzie on Wed, 4 Dec 2019 20:41:59 +0000) Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes References: <20191130143638.GA6716@ACM> <20191201150738.GB5085@ACM> <83imn0lyed.fsf@gnu.org> <20191201192709.GE5085@ACM> <83blsrn58a.fsf@gnu.org> <20191204204159.GA7587@ACM> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 38406 Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Wed, 4 Dec 2019 20:41:59 +0000 > Cc: 38406@debbugs.gnu.org > From: Alan Mackenzie > > OK, here's a patch which I think does just what's wanted. Would you > please try it out, Ivan, then let me know that it works, or about any > problems which there still may be? Thanks. Thanks. > +(defvar c--unsafe-post-self-insert-hook-functions > + '(smie-blink-matching-open > + electric-pair-post-self-insert-function > + blink-paren-post-self-insert-function > + electric-indent-post-self-insert-function > + electric-layout-post-self-insert-function > + electric-quote-post-self-insert-function) > + "Known unsafe functions when members of `post-self-insert-hook' in CC Mode") Can you explain why you exempt these from being called from CC Mode? AFAIU, by disabling them when CC Mode reacts to insertion, you have solved the conflict between any such hook and CC Mode, so why not call any such hook afterwards? From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 05 14:09:58 2019 Received: (at 38406) by debbugs.gnu.org; 5 Dec 2019 19:09:58 +0000 Received: from localhost ([127.0.0.1]:45213 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icwVh-00014c-L0 for submit@debbugs.gnu.org; Thu, 05 Dec 2019 14:09:57 -0500 Received: from colin.muc.de ([193.149.48.1]:54428 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1icwVg-00014S-6P for 38406@debbugs.gnu.org; Thu, 05 Dec 2019 14:09:57 -0500 Received: (qmail 35418 invoked by uid 3782); 5 Dec 2019 19:09:55 -0000 Received: from acm.muc.de (p4FE15A39.dip0.t-ipconnect.de [79.225.90.57]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 05 Dec 2019 20:09:51 +0100 Received: (qmail 6453 invoked by uid 1000); 5 Dec 2019 19:09:51 -0000 Date: Thu, 5 Dec 2019 19:09:51 +0000 To: Eli Zaretskii Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes Message-ID: <20191205190951.GA6252@ACM> References: <20191130143638.GA6716@ACM> <20191201150738.GB5085@ACM> <83imn0lyed.fsf@gnu.org> <20191201192709.GE5085@ACM> <83blsrn58a.fsf@gnu.org> <20191204204159.GA7587@ACM> <83immuj0g7.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83immuj0g7.fsf@gnu.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38406 Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Eli. On Thu, Dec 05, 2019 at 16:45:12 +0200, Eli Zaretskii wrote: > > Date: Wed, 4 Dec 2019 20:41:59 +0000 > > Cc: 38406@debbugs.gnu.org > > From: Alan Mackenzie > > OK, here's a patch which I think does just what's wanted. Would you > > please try it out, Ivan, then let me know that it works, or about any > > problems which there still may be? Thanks. > Thanks. Actually, I forgot about testing for the existence of post-self-insert-hook. So the following will go in, too, with the obvious definition for ....-1: (defmacro c--call-post-self-insert-hook-more-safely () ;; Call post-self-insert-hook, if such exists. See comment for ;; `c--call-post-self-insert-hook-more-safely-1'. (if (boundp 'post-self-insert-hook) '(c--call-post-self-insert-hook-more-safely-1) '(progn))) > > +(defvar c--unsafe-post-self-insert-hook-functions > > + '(smie-blink-matching-open > > + electric-pair-post-self-insert-function > > + blink-paren-post-self-insert-function > > + electric-indent-post-self-insert-function > > + electric-layout-post-self-insert-function > > + electric-quote-post-self-insert-function) > > + "Known unsafe functions when members of `post-self-insert-hook' in CC Mode") > Can you explain why you exempt these from being called from CC Mode? There is already a call to the matching-paren blink functionality in cc-cmds.el, which must stay for older Emacsen. If blink-paren-p-s-i-f was allowed to run too, the result would probably be a doubling of the blink time. This is not desirable. The same applies to smie-blink-m-o, which in any case will not be used for CC Mode. electric-pair-post-self-insert-function must not run in c-electric-brace/paren except as carefully coded in these functions explicitly; it would otherwise foul things up, one way or another, as it did in the scenario for which bug #33794 was raised. Of the other three electric-* functions, only one has a complete doc string, so it is work to work out what the other two do. electric-indent-post-self-insert-function is redundant in CC Mode, and probably harmful. At best it will just take up processor cycles. I believe electric-layout-p-s-i-f just duplicates the auto-newline behaviour of the c-electric-* functions, making it redundant. I don't know exactly what electric-quote-p-s-i-f does, but it is likely to be something to do with quotes, and thus likely to clash with CC Mode's handling of quotes. > AFAIU, by disabling them when CC Mode reacts to insertion, you have > solved the conflict between any such hook and CC Mode, so why not call > any such hook afterwards? See above. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 05 14:15:04 2019 Received: (at 38406) by debbugs.gnu.org; 5 Dec 2019 19:15:04 +0000 Received: from localhost ([127.0.0.1]:45218 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icwae-0001Eq-DC for submit@debbugs.gnu.org; Thu, 05 Dec 2019 14:15:04 -0500 Received: from colin.muc.de ([193.149.48.1]:54479 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1icwac-0001E9-3W for 38406@debbugs.gnu.org; Thu, 05 Dec 2019 14:15:02 -0500 Received: (qmail 37995 invoked by uid 3782); 5 Dec 2019 19:15:00 -0000 Received: from acm.muc.de (p4FE15A39.dip0.t-ipconnect.de [79.225.90.57]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 05 Dec 2019 20:14:59 +0100 Received: (qmail 6471 invoked by uid 1000); 5 Dec 2019 19:14:59 -0000 Date: Thu, 5 Dec 2019 19:14:59 +0000 To: Dmitry Gutov Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes Message-ID: <20191205191459.GB6252@ACM> References: <20191130143638.GA6716@ACM> <20191201150738.GB5085@ACM> <83imn0lyed.fsf@gnu.org> <20191201192709.GE5085@ACM> <83blsrn58a.fsf@gnu.org> <20191204204159.GA7587@ACM> <798bda88-41a7-361c-c01b-22ca4d6138e0@yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <798bda88-41a7-361c-c01b-22ca4d6138e0@yandex.ru> User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38406 Cc: Eli Zaretskii , yyoncho@gmail.com, 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Dmitry. On Wed, Dec 04, 2019 at 23:04:27 +0200, Dmitry Gutov wrote: > On 04.12.2019 22:41, Alan Mackenzie wrote: > > +(defvar c--unsafe-post-self-insert-hook-functions > > + '(smie-blink-matching-open > > + electric-pair-post-self-insert-function > > + blink-paren-post-self-insert-function > > + electric-indent-post-self-insert-function > > + electric-layout-post-self-insert-function > > + electric-quote-post-self-insert-function) > > + "Known unsafe functions when members of `post-self-insert-hook' in CC Mode") > I don't see how filtering out a bunch of popular consumers of > post-self-insert-hook can make it "act as per its contract again". Think of it more as "filtering in" all functions on post-self-insert-hook _except_ the ones mentioned, which are harmful in CC Mode. > More surprisingly, what did smie-blink-matching-open and > blink-paren-post-self-insert-function ever do so wrong? Neither of them > modifies the buffer's contents. No, but if allowed to run, they would probably double the blink time on the paren match, which would be a Bad Thing. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 05 14:25:38 2019 Received: (at 38406) by debbugs.gnu.org; 5 Dec 2019 19:25:38 +0000 Received: from localhost ([127.0.0.1]:45230 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icwks-0001Z3-0y for submit@debbugs.gnu.org; Thu, 05 Dec 2019 14:25:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54921) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icwkq-0001Ys-LT for 38406@debbugs.gnu.org; Thu, 05 Dec 2019 14:25:37 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45753) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1icwkg-0005dN-GA; Thu, 05 Dec 2019 14:25:27 -0500 Received: from [176.228.60.248] (port=3747 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1icwkb-0006wo-8j; Thu, 05 Dec 2019 14:25:25 -0500 Date: Thu, 05 Dec 2019 21:25:14 +0200 Message-Id: <83pnh2h8x1.fsf@gnu.org> From: Eli Zaretskii To: Alan Mackenzie In-reply-to: <20191205190951.GA6252@ACM> (message from Alan Mackenzie on Thu, 5 Dec 2019 19:09:51 +0000) Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes References: <20191130143638.GA6716@ACM> <20191201150738.GB5085@ACM> <83imn0lyed.fsf@gnu.org> <20191201192709.GE5085@ACM> <83blsrn58a.fsf@gnu.org> <20191204204159.GA7587@ACM> <83immuj0g7.fsf@gnu.org> <20191205190951.GA6252@ACM> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 38406 Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Thu, 5 Dec 2019 19:09:51 +0000 > Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org > From: Alan Mackenzie > > > Can you explain why you exempt these from being called from CC Mode? > > There is already a call to the matching-paren blink functionality in > cc-cmds.el, which must stay for older Emacsen. If blink-paren-p-s-i-f > was allowed to run too, the result would probably be a doubling of the > blink time. This is not desirable. The same applies to smie-blink-m-o, > which in any case will not be used for CC Mode. > > electric-pair-post-self-insert-function must not run in > c-electric-brace/paren except as carefully coded in these functions > explicitly; it would otherwise foul things up, one way or another, as it > did in the scenario for which bug #33794 was raised. > > Of the other three electric-* functions, only one has a complete doc > string, so it is work to work out what the other two do. > electric-indent-post-self-insert-function is redundant in CC Mode, and > probably harmful. At best it will just take up processor cycles. I > believe electric-layout-p-s-i-f just duplicates the auto-newline > behaviour of the c-electric-* functions, making it redundant. I don't > know exactly what electric-quote-p-s-i-f does, but it is likely to be > something to do with quotes, and thus likely to clash with CC Mode's > handling of quotes. I don't think CC Mode should protect users of those hooks from themselves. If the user or Lisp set up these hooks such that they end up shooting themselves in the foot, we should let them. We never provide any "safety nets" for silly hook functions, so we shouldn't do that here as well. OTOH, if someone puts a function on those hooks which does something legitimate, we should meet their expectations and let those functions run, as the contract says. So I think you shouldn't filter anything from the hook before you run it. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 05 15:17:21 2019 Received: (at 38406) by debbugs.gnu.org; 5 Dec 2019 20:17:21 +0000 Received: from localhost ([127.0.0.1]:45278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icxYu-00039n-Ky for submit@debbugs.gnu.org; Thu, 05 Dec 2019 15:17:20 -0500 Received: from colin.muc.de ([193.149.48.1]:43840 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1icxYr-00039d-8P for 38406@debbugs.gnu.org; Thu, 05 Dec 2019 15:17:19 -0500 Received: (qmail 69103 invoked by uid 3782); 5 Dec 2019 20:17:15 -0000 Received: from acm.muc.de (p4FE15A39.dip0.t-ipconnect.de [79.225.90.57]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 05 Dec 2019 21:17:13 +0100 Received: (qmail 6719 invoked by uid 1000); 5 Dec 2019 20:17:13 -0000 Date: Thu, 5 Dec 2019 20:17:13 +0000 To: Eli Zaretskii Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes Message-ID: <20191205201713.GC6252@ACM> References: <20191130143638.GA6716@ACM> <20191201150738.GB5085@ACM> <83imn0lyed.fsf@gnu.org> <20191201192709.GE5085@ACM> <83blsrn58a.fsf@gnu.org> <20191204204159.GA7587@ACM> <83immuj0g7.fsf@gnu.org> <20191205190951.GA6252@ACM> <83pnh2h8x1.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83pnh2h8x1.fsf@gnu.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38406 Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Eli. On Thu, Dec 05, 2019 at 21:25:14 +0200, Eli Zaretskii wrote: > > Date: Thu, 5 Dec 2019 19:09:51 +0000 > > Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org > > From: Alan Mackenzie > > > Can you explain why you exempt these from being called from CC Mode? > > There is already a call to the matching-paren blink functionality in > > cc-cmds.el, which must stay for older Emacsen. If blink-paren-p-s-i-f > > was allowed to run too, the result would probably be a doubling of the > > blink time. This is not desirable. The same applies to smie-blink-m-o, > > which in any case will not be used for CC Mode. > > electric-pair-post-self-insert-function must not run in > > c-electric-brace/paren except as carefully coded in these functions > > explicitly; it would otherwise foul things up, one way or another, as it > > did in the scenario for which bug #33794 was raised. > > Of the other three electric-* functions, only one has a complete doc > > string, so it is work to work out what the other two do. > > electric-indent-post-self-insert-function is redundant in CC Mode, and > > probably harmful. At best it will just take up processor cycles. I > > believe electric-layout-p-s-i-f just duplicates the auto-newline > > behaviour of the c-electric-* functions, making it redundant. I don't > > know exactly what electric-quote-p-s-i-f does, but it is likely to be > > something to do with quotes, and thus likely to clash with CC Mode's > > handling of quotes. > I don't think CC Mode should protect users of those hooks from > themselves. It doesn't. Ivan's hook functions will now get called. > If the user or Lisp set up these hooks such that they end up shooting > themselves in the foot, we should let them. It's not a matter of what users might do. It's about what Emacs maintainers have already done. The current changes to CC Mode are to protect users of CC Mode from these design clashes inside Emacs. > We never provide any "safety nets" for silly hook functions, so we > shouldn't do that here as well. OTOH, if someone puts a function on > those hooks which does something legitimate, we should meet their > expectations and let those functions run, as the contract says. I think that, with my latest patch, that is the case. > So I think you shouldn't filter anything from the hook before you run > it. I thought you were urging me to do precisely that two or three posts ago. I just tried taking a particular function off of c--unsafe-post-self-insert-hook-functions and enabling electric-pair mode. On typing a brace, electric-pair-mode threw an obscure error. It doesn't make sense to call electric-pair-post-self-insert-function twice for one keypress. That is a good reason for having that function filtered out of the hook. For the other five filtered out functions, I gave what I think were good reasons in my last post. The root of the problem is the hook post-self-insert-hook. It is a thoroughly bad idea. The implications of introducing it a few years ago weren't thought through. Assuming that removing this hook from Emacs isn't an option, we are left with ugly ad-hoc workarounds, such as the patch we're currently discussing. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 05 15:45:17 2019 Received: (at 38406) by debbugs.gnu.org; 5 Dec 2019 20:45:17 +0000 Received: from localhost ([127.0.0.1]:45340 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icxzx-00065J-90 for submit@debbugs.gnu.org; Thu, 05 Dec 2019 15:45:17 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:39657) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icxzv-0005zT-Uc for 38406@debbugs.gnu.org; Thu, 05 Dec 2019 15:45:16 -0500 Received: by mail-wm1-f66.google.com with SMTP id s14so5144561wmh.4 for <38406@debbugs.gnu.org>; Thu, 05 Dec 2019 12:45:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=udX4OWfgyPohGBMpWeBfrY+GeW3IsXXZq3DEc1scEHY=; b=I7JSuIquTUZoQ5ctlZrrjL678RtfgVvqA6sI4J2pEY5YJw7Fpaw96NjzLbO0U8PrxP irgauWI9uhlIJ3Y214K6OHxVqOPNla8/kiZa09n5NE1h9tmNatczGGg/Q99ymX7da5hJ HNjOUcHrWBeq2F7oD8XznywB+PDWuHaqBlt2q980Dty5cDobNJbsnAnv1mv8CcByfw12 tU1yeO6qa8dlRuAnPEQOJbv49IDuhTagYscRqNf7yU5QRK8X956UMaBFfd7kvgrgOGgJ +8bn0EqNWbOcJ/nEsgVSCGs3APBEgoJh2+izDElBqHR00KbjTxxuSt7hwWCAvezE2Qba 36JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=udX4OWfgyPohGBMpWeBfrY+GeW3IsXXZq3DEc1scEHY=; b=ItSCgNL3X8s9X3zWY+7DArfQM5SzvPO1kyoEdLqefz45DwOgp2aiS/u3+MAiLSPZ9v R9g2VF1sITskuxncBGK2+9tOtSmLJZH0OD/QS2Bgzyu3eDaLUFAvNRt6aEOhsUaoH2nT SVywOJlQG+Zd6gslvak0xRbiTd6HQ0UhYyUupyKINqz4deg1t4KvdLDLGa/xtqZy8yKQ t3YCvsnDjK58CCIwhVD6qVvtTTU0lVqvw841tP/C2V9RLfxvAGX5mR8XLYCnJxMVeVQK UB9eoSnOZXpqJrhi9Hok2c2nnT0NODi5oPGitSUZQlDBJo2oLaouf5NTAXkCLkGywLmJ Jeeg== X-Gm-Message-State: APjAAAUDRz8yXFHA4LVnOtW+a3OYfI7uaXoOfDoOi/1+a1d1eht3zcJh VC75QlwtbheBrSRFI4G38GRCRd1H X-Google-Smtp-Source: APXvYqzAo8bIGqCSR0vBD1byymR3Ybfbwj1cut6FUDxy7iUo4pp6sHMwa1Slqh3/q6MwH39FKt+gAQ== X-Received: by 2002:a05:600c:2283:: with SMTP id 3mr7172081wmf.100.1575578709853; Thu, 05 Dec 2019 12:45:09 -0800 (PST) Received: from [192.168.0.5] ([212.50.117.215]) by smtp.googlemail.com with ESMTPSA id c72sm1129988wmd.11.2019.12.05.12.45.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Dec 2019 12:45:08 -0800 (PST) Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes To: Alan Mackenzie References: <20191130143638.GA6716@ACM> <20191201150738.GB5085@ACM> <83imn0lyed.fsf@gnu.org> <20191201192709.GE5085@ACM> <83blsrn58a.fsf@gnu.org> <20191204204159.GA7587@ACM> <798bda88-41a7-361c-c01b-22ca4d6138e0@yandex.ru> <20191205191459.GB6252@ACM> From: Dmitry Gutov Message-ID: <1c3dea25-5606-76d5-b35d-2486583b8f38@yandex.ru> Date: Thu, 5 Dec 2019 22:44:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191205191459.GB6252@ACM> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 38406 Cc: Eli Zaretskii , yyoncho@gmail.com, 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) On 05.12.2019 21:14, Alan Mackenzie wrote: > On Wed, Dec 04, 2019 at 23:04:27 +0200, Dmitry Gutov wrote: >> On 04.12.2019 22:41, Alan Mackenzie wrote: >>> +(defvar c--unsafe-post-self-insert-hook-functions >>> + '(smie-blink-matching-open >>> + electric-pair-post-self-insert-function >>> + blink-paren-post-self-insert-function >>> + electric-indent-post-self-insert-function >>> + electric-layout-post-self-insert-function >>> + electric-quote-post-self-insert-function) >>> + "Known unsafe functions when members of `post-self-insert-hook' in CC Mode") > >> I don't see how filtering out a bunch of popular consumers of >> post-self-insert-hook can make it "act as per its contract again". > > Think of it more as "filtering in" all functions on > post-self-insert-hook _except_ the ones mentioned, which are harmful in > CC Mode. blink-paren is harmful for CC Mode? Or is it reimplemented, like other features (e.g. electric-*), inside CC Mode? In the latter case, I think CC Mode should just disable the respective minor modes/variables locally and call it a day (the hook won't be used them, so no need for filtering). Of course, ideally users of recent enough Emacs would be able to disable these built-in features and switch on the generic ones instead. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 06 11:15:46 2019 Received: (at 38406) by debbugs.gnu.org; 6 Dec 2019 16:15:46 +0000 Received: from localhost ([127.0.0.1]:46931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idGGf-00052f-Fk for submit@debbugs.gnu.org; Fri, 06 Dec 2019 11:15:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57002) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idGGa-00050w-28 for 38406@debbugs.gnu.org; Fri, 06 Dec 2019 11:15:41 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43116) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1idGGN-00089o-BZ; Fri, 06 Dec 2019 11:15:27 -0500 Received: from [176.228.60.248] (port=2068 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1id8dD-0003Be-E3; Fri, 06 Dec 2019 03:06:32 -0500 Date: Fri, 06 Dec 2019 10:06:31 +0200 Message-Id: <83eexhho8o.fsf@gnu.org> From: Eli Zaretskii To: Alan Mackenzie In-reply-to: <20191205201713.GC6252@ACM> (message from Alan Mackenzie on Thu, 5 Dec 2019 20:17:13 +0000) Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes References: <20191130143638.GA6716@ACM> <20191201150738.GB5085@ACM> <83imn0lyed.fsf@gnu.org> <20191201192709.GE5085@ACM> <83blsrn58a.fsf@gnu.org> <20191204204159.GA7587@ACM> <83immuj0g7.fsf@gnu.org> <20191205190951.GA6252@ACM> <83pnh2h8x1.fsf@gnu.org> <20191205201713.GC6252@ACM> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 38406 Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Thu, 5 Dec 2019 20:17:13 +0000 > Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org > From: Alan Mackenzie > > > We never provide any "safety nets" for silly hook functions, so we > > shouldn't do that here as well. OTOH, if someone puts a function on > > those hooks which does something legitimate, we should meet their > > expectations and let those functions run, as the contract says. > > I think that, with my latest patch, that is the case. > > > So I think you shouldn't filter anything from the hook before you run > > it. > > I thought you were urging me to do precisely that two or three posts ago. > > I just tried taking a particular function off of > c--unsafe-post-self-insert-hook-functions and enabling electric-pair > mode. On typing a brace, electric-pair-mode threw an obscure error. It > doesn't make sense to call electric-pair-post-self-insert-function twice > for one keypress. That is a good reason for having that function > filtered out of the hook. There might be a misunderstanding on my part here. Could you please explain how come electric-pair-post-self-insert-function is called twice if it isn't removed from the hook? where's the second (or the first) call? > The root of the problem is the hook post-self-insert-hook. It is a > thoroughly bad idea. The implications of introducing it a few years ago > weren't thought through. That might be so, but I think it's too late for removing it now. > Assuming that removing this hook from Emacs isn't an option, we are > left with ugly ad-hoc workarounds, such as the patch we're currently > discussing. Yes. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 06 13:28:48 2019 Received: (at 38406) by debbugs.gnu.org; 6 Dec 2019 18:28:48 +0000 Received: from localhost ([127.0.0.1]:47045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idILP-0005To-TU for submit@debbugs.gnu.org; Fri, 06 Dec 2019 13:28:48 -0500 Received: from colin.muc.de ([193.149.48.1]:25173 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1idILP-0005Th-0E for 38406@debbugs.gnu.org; Fri, 06 Dec 2019 13:28:47 -0500 Received: (qmail 63569 invoked by uid 3782); 6 Dec 2019 18:28:45 -0000 Received: from acm.muc.de (p4FE15A40.dip0.t-ipconnect.de [79.225.90.64]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 06 Dec 2019 19:28:42 +0100 Received: (qmail 5171 invoked by uid 1000); 6 Dec 2019 18:28:42 -0000 Date: Fri, 6 Dec 2019 18:28:42 +0000 To: Eli Zaretskii Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes Message-ID: <20191206182842.GA3999@ACM> References: <20191201150738.GB5085@ACM> <83imn0lyed.fsf@gnu.org> <20191201192709.GE5085@ACM> <83blsrn58a.fsf@gnu.org> <20191204204159.GA7587@ACM> <83immuj0g7.fsf@gnu.org> <20191205190951.GA6252@ACM> <83pnh2h8x1.fsf@gnu.org> <20191205201713.GC6252@ACM> <83eexhho8o.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83eexhho8o.fsf@gnu.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38406 Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Eli. On Fri, Dec 06, 2019 at 10:06:31 +0200, Eli Zaretskii wrote: > > Date: Thu, 5 Dec 2019 20:17:13 +0000 > > Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org > > From: Alan Mackenzie > > > We never provide any "safety nets" for silly hook functions, so we > > > shouldn't do that here as well. OTOH, if someone puts a function > > > on those hooks which does something legitimate, we should meet > > > their expectations and let those functions run, as the contract > > > says. > > I think that, with my latest patch, that is the case. > > > So I think you shouldn't filter anything from the hook before you > > > run it. > > I thought you were urging me to do precisely that two or three posts > > ago. > > I just tried taking a particular function off of > > c--unsafe-post-self-insert-hook-functions and enabling electric-pair > > mode. On typing a brace, electric-pair-mode threw an obscure error. > > It doesn't make sense to call electric-pair-post-self-insert-function > > twice for one keypress. That is a good reason for having that > > function filtered out of the hook. > There might be a misunderstanding on my part here. Could you please > explain how come electric-pair-post-self-insert-function is called > twice if it isn't removed from the hook? where's the second (or the > first) call? The first call is an explicit call from c-electric-brace to electric-pair-post-self-insert-function. Depending on the changes to the buffer this call causes (amongst other things), differing electric actions are performed by c-electric-brace. This call is itself a workaround, there being no purpose designed function for this purpose in elec-pair.el. The second call happens when c-electric-brace run-hook's post-self-insert-hook - _if_ electric-pair-post-self-insert-function hasn't been filtered out of that hook. > > The root of the problem is the hook post-self-insert-hook. It is a > > thoroughly bad idea. The implications of introducing it a few years ago > > weren't thought through. > That might be so, but I think it's too late for removing it now. > > Assuming that removing this hook from Emacs isn't an option, we are > > left with ugly ad-hoc workarounds, such as the patch we're currently > > discussing. > Yes. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 06 13:48:35 2019 Received: (at 38406) by debbugs.gnu.org; 6 Dec 2019 18:48:35 +0000 Received: from localhost ([127.0.0.1]:47067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idIeZ-0007SO-F3 for submit@debbugs.gnu.org; Fri, 06 Dec 2019 13:48:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idIeW-0007S8-TX for 38406@debbugs.gnu.org; Fri, 06 Dec 2019 13:48:33 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48069) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1idIeR-0002dY-FL; Fri, 06 Dec 2019 13:48:27 -0500 Received: from [176.228.60.248] (port=1574 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1idIeQ-0005v9-S1; Fri, 06 Dec 2019 13:48:27 -0500 Date: Fri, 06 Dec 2019 20:48:26 +0200 Message-Id: <83y2vpffyd.fsf@gnu.org> From: Eli Zaretskii To: Alan Mackenzie In-reply-to: <20191206182842.GA3999@ACM> (message from Alan Mackenzie on Fri, 6 Dec 2019 18:28:42 +0000) Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes References: <20191201150738.GB5085@ACM> <83imn0lyed.fsf@gnu.org> <20191201192709.GE5085@ACM> <83blsrn58a.fsf@gnu.org> <20191204204159.GA7587@ACM> <83immuj0g7.fsf@gnu.org> <20191205190951.GA6252@ACM> <83pnh2h8x1.fsf@gnu.org> <20191205201713.GC6252@ACM> <83eexhho8o.fsf@gnu.org> <20191206182842.GA3999@ACM> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 38406 Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 6 Dec 2019 18:28:42 +0000 > Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org > From: Alan Mackenzie > > > There might be a misunderstanding on my part here. Could you please > > explain how come electric-pair-post-self-insert-function is called > > twice if it isn't removed from the hook? where's the second (or the > > first) call? > > The first call is an explicit call from c-electric-brace to > electric-pair-post-self-insert-function. Depending on the changes to the > buffer this call causes (amongst other things), differing electric > actions are performed by c-electric-brace. This call is itself a > workaround, there being no purpose designed function for this purpose in > elec-pair.el. > > The second call happens when c-electric-brace run-hook's > post-self-insert-hook - _if_ electric-pair-post-self-insert-function > hasn't been filtered out of that hook. If you already call that particular function explicitly, then calling it one more time is indeed redundant. But is this the case with all the other functions that you suggest to filter from post-self-insert-hook? From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 06 17:25:06 2019 Received: (at 38406) by debbugs.gnu.org; 6 Dec 2019 22:25:06 +0000 Received: from localhost ([127.0.0.1]:47141 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idM26-0007P3-4Q for submit@debbugs.gnu.org; Fri, 06 Dec 2019 17:25:06 -0500 Received: from colin.muc.de ([193.149.48.1]:25353 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1idM24-0007Oo-0E for 38406@debbugs.gnu.org; Fri, 06 Dec 2019 17:25:04 -0500 Received: (qmail 29406 invoked by uid 3782); 6 Dec 2019 22:25:02 -0000 Received: from acm.muc.de (p4FE15A40.dip0.t-ipconnect.de [79.225.90.64]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 06 Dec 2019 23:24:59 +0100 Received: (qmail 9234 invoked by uid 1000); 6 Dec 2019 22:24:59 -0000 Date: Fri, 6 Dec 2019 22:24:59 +0000 To: Eli Zaretskii Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes Message-ID: <20191206222459.GB3999@ACM> References: <20191201192709.GE5085@ACM> <83blsrn58a.fsf@gnu.org> <20191204204159.GA7587@ACM> <83immuj0g7.fsf@gnu.org> <20191205190951.GA6252@ACM> <83pnh2h8x1.fsf@gnu.org> <20191205201713.GC6252@ACM> <83eexhho8o.fsf@gnu.org> <20191206182842.GA3999@ACM> <83y2vpffyd.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83y2vpffyd.fsf@gnu.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38406 Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Eli. On Fri, Dec 06, 2019 at 20:48:26 +0200, Eli Zaretskii wrote: > > Date: Fri, 6 Dec 2019 18:28:42 +0000 > > Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org > > From: Alan Mackenzie > > > There might be a misunderstanding on my part here. Could you please > > > explain how come electric-pair-post-self-insert-function is called > > > twice if it isn't removed from the hook? where's the second (or the > > > first) call? > > The first call is an explicit call from c-electric-brace to > > electric-pair-post-self-insert-function. Depending on the changes to the > > buffer this call causes (amongst other things), differing electric > > actions are performed by c-electric-brace. This call is itself a > > workaround, there being no purpose designed function for this purpose in > > elec-pair.el. > > The second call happens when c-electric-brace run-hook's > > post-self-insert-hook - _if_ electric-pair-post-self-insert-function > > hasn't been filtered out of that hook. > If you already call that particular function explicitly, then calling > it one more time is indeed redundant. No, it's not redundant. It's positively harmful. > But is this the case with all the other functions that you suggest to > filter from post-self-insert-hook? No. They have individual reasons for being filtered out. Don't forget that this is a particularly sensitive hook, allowing hook functions to interfere in an unsynchronised way with partially complete command processing. Let's go through them again: smie-blink-matching-open is inapplicable to CC Mode and just takes up processor cycles. electric-pair-post-self-insert-function we've already discussed. blink-paren-post-self-insert-function would do nothing anyhow, since blink-paren-function has been bound to nil - this is so that the actual blinking doesn't occur until the newly inserted brace is at its final position. electric-indent-post-self-insert-function is redundant and possibly harmful. electric-layout-post-self-insert-function is undocumented, thus likely to be harmful. Its name suggests it is redundant. electric-quote-post-self-insert-function is undocumented, uncommented and obscure. It is safer not to risk running it. Given that the mechanism for filtering post-self-insert-hook is there, why is there the resistance to filtering out redundant and effect-free functions? And how come functions without meaningful doc strings are allowed onto Emacs hooks? -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 07 21:33:20 2019 Received: (at 38406) by debbugs.gnu.org; 8 Dec 2019 02:33:20 +0000 Received: from localhost ([127.0.0.1]:49979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idmNs-0005pj-9O for submit@debbugs.gnu.org; Sat, 07 Dec 2019 21:33:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59061) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idmNq-0005pW-Vw for 38406@debbugs.gnu.org; Sat, 07 Dec 2019 21:33:19 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iddV2-0002Pb-1M; Sat, 07 Dec 2019 12:04:08 -0500 Received: from [176.228.60.248] (port=2172 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ida7u-00053j-LX; Sat, 07 Dec 2019 08:28:03 -0500 Date: Sat, 07 Dec 2019 15:27:46 +0200 Message-Id: <83wob8e04t.fsf@gnu.org> From: Eli Zaretskii To: Alan Mackenzie In-reply-to: <20191207114045.GA6182@ACM> (message from Alan Mackenzie on Sat, 7 Dec 2019 11:40:45 +0000) Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes References: <20191204204159.GA7587@ACM> <83immuj0g7.fsf@gnu.org> <20191205190951.GA6252@ACM> <83pnh2h8x1.fsf@gnu.org> <20191205201713.GC6252@ACM> <83eexhho8o.fsf@gnu.org> <20191206182842.GA3999@ACM> <83y2vpffyd.fsf@gnu.org> <20191206222459.GB3999@ACM> <83h82cfsvf.fsf@gnu.org> <20191207114045.GA6182@ACM> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 38406 Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 7 Dec 2019 11:40:45 +0000 > Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org > From: Alan Mackenzie > > So, that would leave just electric-pair-post-self-insert-function to be > filtered out of the hook. Thank you, I agree. So please go ahead and push your changes with those modifications. From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 07 22:41:00 2019 Received: (at 38406) by debbugs.gnu.org; 8 Dec 2019 03:41:00 +0000 Received: from localhost ([127.0.0.1]:50265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idnRL-0005Ci-N8 for submit@debbugs.gnu.org; Sat, 07 Dec 2019 22:41:00 -0500 Received: from colin.muc.de ([193.149.48.1]:65077 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1idnRD-0005CT-Dw for 38406@debbugs.gnu.org; Sat, 07 Dec 2019 22:40:58 -0500 Received: (qmail 55220 invoked by uid 3782); 7 Dec 2019 11:40:48 -0000 Received: from acm.muc.de (p2E5D5590.dip0.t-ipconnect.de [46.93.85.144]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 07 Dec 2019 12:40:45 +0100 Received: (qmail 6304 invoked by uid 1000); 7 Dec 2019 11:40:45 -0000 Date: Sat, 7 Dec 2019 11:40:45 +0000 To: Eli Zaretskii Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes Message-ID: <20191207114045.GA6182@ACM> References: <20191204204159.GA7587@ACM> <83immuj0g7.fsf@gnu.org> <20191205190951.GA6252@ACM> <83pnh2h8x1.fsf@gnu.org> <20191205201713.GC6252@ACM> <83eexhho8o.fsf@gnu.org> <20191206182842.GA3999@ACM> <83y2vpffyd.fsf@gnu.org> <20191206222459.GB3999@ACM> <83h82cfsvf.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83h82cfsvf.fsf@gnu.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38406 Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sat, Dec 07, 2019 at 10:21:40 +0200, Eli Zaretskii wrote: > > Date: Fri, 6 Dec 2019 22:24:59 +0000 > > Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org > > From: Alan Mackenzie > > > If you already call that particular function explicitly, then calling > > > it one more time is indeed redundant. > > No, it's not redundant. It's positively harmful. > Agreed. > > smie-blink-matching-open is inapplicable to CC Mode and just takes up > > processor cycles. > > electric-pair-post-self-insert-function we've already discussed. > > blink-paren-post-self-insert-function would do nothing anyhow, since > > blink-paren-function has been bound to nil - this is so that the actual > > blinking doesn't occur until the newly inserted brace is at its final > > position. > > electric-indent-post-self-insert-function is redundant and possibly > > harmful. > > electric-layout-post-self-insert-function is undocumented, thus likely > > to be harmful. Its name suggests it is redundant. > > electric-quote-post-self-insert-function is undocumented, uncommented > > and obscure. It is safer not to risk running it. > > Given that the mechanism for filtering post-self-insert-hook is there, > > why is there the resistance to filtering out redundant and effect-free > > functions? > Alan, I'm trying to do TRT here, but I cannot do everything by myself, > because that would mean I need to invest an inordinate amount of time > in each decision, and will never be able to catch up. Please help me > with this particular task by providing more detailed information about > your reasons for filtering out each of the functions you want to > filter out. You have evidently studied them, so you should know more > about them then shown above, and certainly more than I do. > In general, I'd like to leave any function that is not harmful in the > list unfiltered, even if calling it in this context is silly, or has > no effect, or is otherwise redundant. Can you please humor me by > looking at the above list through these eyes, and trying to avoid your > apparent dislike for the whole idea while at that? I really need your > help. OK, sorry for the misunderstanding. I was reasoning, subconsciously, on the basis of justifying each function to remain on the hook. Again, subconsciously, I assumed you were doing the same. If I move over to justifying each function to be filtered out of the hook, things get a lot easier. > Specifically, I'd like the following questions answered, at the very > least: > . why is smie-blink-matching-open inapplicable? The "simple-minded indentation engine" is not used in CC Mode. But we can leave it in the hook since it is harmless. > . where and why is blink-paren-function bound to nil? Your patch > calls blink-paren-function explicitly -- does that mean calling > blink-paren-post-self-insert-function will be redundant? blink-paren-function is bound to nil at the start of c-electric-brace and c-electric-paren. Otherwise, the paren blinking would happen instantaneously after inserting the } or ), even though auto-newline may still need to insert a NL before the } or ); this would be jarring for the user. c-electric-brace/paren instead call blink-paren-function explicitly after any adjustments in the buffer have been made. But leaving blink-paren-post-self-insert-function on the hook, although it is redundant, will be harmless. > . why do you think electric-indent-post-self-insert-function could be > harmful? If it's merely redundant, could we please call it here? > . electric-layout-post-self-insert-function inserts newlines, and its > documentation is in electric-layout-rules; the latter is nil by > default and only used in js.el and octave.el -- why would it be > harmful here? These two functions never have any business in CC Mode, so I wanted to exclude them from the hook for safety reasons. If they somehow became active, they might corrupt CC Mode's indentation or auto-newline mode. But there is no immediately pressing reason to filter them out of the hook. > . electric-quote-post-self-insert-function replaces quote characters > (see the doc string of electric-quote-mode); do you have specific > reasons why calling it here could be harmful or risky? Thanks for the pointer. This hook alters ASCII quotes to curly quotes, but does so only in comments and strings. It might corrupt code if a user edits the code whilst it is commented out, or (in C++) "stringed out" by a long raw string (yes, I have seen this happening). So, I suppose we could say that any user who enables electric-quote-mode and comments out code should be aware of what she is doing. Although it would not happen often, getting a curly quote into commented out code, then uncommenting it, would be a difficult error to spot, with seemingly non-sensensical compiler error messages. But, thinking about it, there is no function `c-electric-quote', so filtering out electric-quote-p-s-i-f will never have any effect on anything. So there is no point in doing so. So, that would leave just electric-pair-post-self-insert-function to be filtered out of the hook. > > And how come functions without meaningful doc strings are allowed onto > > Emacs hooks? > Please, let's not try fix all of Emacs while working on this single > issue. I agree that undocumented functions is not a good thing, but, > as shown above, documentation for what these functions do _is_ > available nearby. OK. > Thanks. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 07 23:03:10 2019 Received: (at 38406-done) by debbugs.gnu.org; 8 Dec 2019 04:03:10 +0000 Received: from localhost ([127.0.0.1]:50286 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idnmo-0005kI-Ai for submit@debbugs.gnu.org; Sat, 07 Dec 2019 23:03:10 -0500 Received: from colin.muc.de ([193.149.48.1]:29902 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1idnmm-0005kA-Fj for 38406-done@debbugs.gnu.org; Sat, 07 Dec 2019 23:03:09 -0500 Received: (qmail 88727 invoked by uid 3782); 7 Dec 2019 19:03:05 -0000 Received: from acm.muc.de (p2E5D5590.dip0.t-ipconnect.de [46.93.85.144]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 07 Dec 2019 20:03:03 +0100 Received: (qmail 6114 invoked by uid 1000); 7 Dec 2019 19:03:02 -0000 Date: Sat, 7 Dec 2019 19:03:02 +0000 To: Eli Zaretskii Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes Message-ID: <20191207190302.GB6182@ACM> References: <20191205190951.GA6252@ACM> <83pnh2h8x1.fsf@gnu.org> <20191205201713.GC6252@ACM> <83eexhho8o.fsf@gnu.org> <20191206182842.GA3999@ACM> <83y2vpffyd.fsf@gnu.org> <20191206222459.GB3999@ACM> <83h82cfsvf.fsf@gnu.org> <20191207114045.GA6182@ACM> <83wob8e04t.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83wob8e04t.fsf@gnu.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38406-done Cc: yyoncho@gmail.com, 38406-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Eli. On Sat, Dec 07, 2019 at 15:27:46 +0200, Eli Zaretskii wrote: > > Date: Sat, 7 Dec 2019 11:40:45 +0000 > > Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org > > From: Alan Mackenzie > > So, that would leave just electric-pair-post-self-insert-function to be > > filtered out of the hook. > Thank you, I agree. So please go ahead and push your changes with > those modifications. DONE. I am closing the bug with this post. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 08 00:08:38 2019 Received: (at 38406) by debbugs.gnu.org; 8 Dec 2019 05:08:38 +0000 Received: from localhost ([127.0.0.1]:50325 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idooA-0007N7-F0 for submit@debbugs.gnu.org; Sun, 08 Dec 2019 00:08:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52883) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idoo8-0007Ms-Rw for 38406@debbugs.gnu.org; Sun, 08 Dec 2019 00:08:37 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1idVLd-0002WS-Of; Sat, 07 Dec 2019 03:21:53 -0500 Received: from [176.228.60.248] (port=3151 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1idVLb-0005Je-D2; Sat, 07 Dec 2019 03:21:53 -0500 Date: Sat, 07 Dec 2019 10:21:40 +0200 Message-Id: <83h82cfsvf.fsf@gnu.org> From: Eli Zaretskii To: Alan Mackenzie In-reply-to: <20191206222459.GB3999@ACM> (message from Alan Mackenzie on Fri, 6 Dec 2019 22:24:59 +0000) Subject: Re: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes References: <20191201192709.GE5085@ACM> <83blsrn58a.fsf@gnu.org> <20191204204159.GA7587@ACM> <83immuj0g7.fsf@gnu.org> <20191205190951.GA6252@ACM> <83pnh2h8x1.fsf@gnu.org> <20191205201713.GC6252@ACM> <83eexhho8o.fsf@gnu.org> <20191206182842.GA3999@ACM> <83y2vpffyd.fsf@gnu.org> <20191206222459.GB3999@ACM> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 38406 Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 6 Dec 2019 22:24:59 +0000 > Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org > From: Alan Mackenzie > > > If you already call that particular function explicitly, then calling > > it one more time is indeed redundant. > > No, it's not redundant. It's positively harmful. Agreed. > smie-blink-matching-open is inapplicable to CC Mode and just takes up > processor cycles. > > electric-pair-post-self-insert-function we've already discussed. > > blink-paren-post-self-insert-function would do nothing anyhow, since > blink-paren-function has been bound to nil - this is so that the actual > blinking doesn't occur until the newly inserted brace is at its final > position. > > electric-indent-post-self-insert-function is redundant and possibly > harmful. > > electric-layout-post-self-insert-function is undocumented, thus likely > to be harmful. Its name suggests it is redundant. > > electric-quote-post-self-insert-function is undocumented, uncommented > and obscure. It is safer not to risk running it. > > Given that the mechanism for filtering post-self-insert-hook is there, > why is there the resistance to filtering out redundant and effect-free > functions? Alan, I'm trying to do TRT here, but I cannot do everything by myself, because that would mean I need to invest an inordinate amount of time in each decision, and will never be able to catch up. Please help me with this particular task by providing more detailed information about your reasons for filtering out each of the functions you want to filter out. You have evidently studied them, so you should know more about them then shown above, and certainly more than I do. In general, I'd like to leave any function that is not harmful in the list unfiltered, even if calling it in this context is silly, or has no effect, or is otherwise redundant. Can you please humor me by looking at the above list through these eyes, and trying to avoid your apparent dislike for the whole idea while at that? I really need your help. Specifically, I'd like the following questions answered, at the very least: . why is smie-blink-matching-open inapplicable? . where and why is blink-paren-function bound to nil? Your patch calls blink-paren-function explicitly -- does that mean calling blink-paren-post-self-insert-function will be redundant? . why do you think electric-indent-post-self-insert-function could be harmful? If it's merely redundant, could we please call it here? . electric-layout-post-self-insert-function inserts newlines, and its documentation is in electric-layout-rules; the latter is nil by default and only used in js.el and octave.el -- why would it be harmful here? . electric-quote-post-self-insert-function replaces quote characters (see the doc string of electric-quote-mode); do you have specific reasons why calling it here could be harmful or risky? > And how come functions without meaningful doc strings are allowed onto > Emacs hooks? Please, let's not try fix all of Emacs while working on this single issue. I agree that undocumented functions is not a good thing, but, as shown above, documentation for what these functions do _is_ available nearby. Thanks. From unknown Sat Jun 21 03:30:47 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 05 Jan 2020 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator