Hello Emacs team, I have two systems where one has an older newcomment.el (march 2013) and comment-indent-new-line works there. The other system (from which I enter this bug report and which hence has the version info given below) does not work correctly for comment-indent-new-line: it adds a line break and indents the newline, but does not insert the comment start. The error seems to be caused by comment-beginning behaving differently between these two versions. For the old version, comment-beginning leaves the point *after* the comment start, so that (buffer-substring compos comin) is not empty whereas for the new version, comment-beginning leaves the point *before* the comment start, so that (buffer-substring compos comin) is empty. In GNU Emacs 24.3.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2) of 2014-01-02 on king, modified by Debian (emacs-snapshot package, version 2:20140101-1~ppa1~precise1) Windowing system distributor `The X.Org Foundation', version 11.0.11300000 System Description: Ubuntu 12.04.4 LTS Configured using: `configure --build x86_64-linux-gnu --host x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var --infodir=/usr/share/info/emacs-snapshot --mandir=/usr/share/man --with-pop=yes --enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/24.3.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3.50/site-lisp:/usr/share/emacs/site-lisp --with-crt-dir=/usr/lib/x86_64-linux-gnu/ --with-x=yes --with-x-toolkit=gtk3 --with-imagemagick=yes 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' CPPFLAGS=-D_FORTIFY_SOURCE=2 'LDFLAGS=-g -Wl,--as-needed -znocombreloc'' Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: el Minor modes in effect: goto-address-prog-mode: t goto-address-mode: t eldoc-mode: t which-function-mode: t show-paren-mode: t subword-mode: t workgroups-mode: t recentf-mode: t desktop-save-mode: t savehist-mode: t global-auto-revert-mode: t winner-mode: t ido-everywhere: t yas-minor-mode: t whitespace-mode: t electric-pair-mode: t display-time-mode: t delete-selection-mode: t cua-mode: t tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t prettify-symbols-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 size-indication-mode: t column-number-mode: 1 line-number-mode: 1 transient-mark-mode: t abbrev-mode: t Recent input: C-s d e t a i l s ( f C-. C-2 C-s c o m m e n t - i n d e n t - C-w C-w C-s C-s C-a C-l C-l C-r c o m m e n t - b e g M-r M-. C-M-SPC C-c C-x 2 C-s f o o C-s C-s C-s C-s C-r C-r C-r C-s C-s C-a C-a C-k C-k C-s C-s C-s C-a C-s m - j ( f o o SPC ; S-SPC b a r M-: ( C-v c o m m e n t - b e g i C-e M-: g o t o - c h a r 2 1 6 6 6 9 C-a C-d C-d C-v Recent messages: Mark saved where search started [4 times] Dired-Hide-Details mode disabled Mark saved where search started [2 times] Mark set [2 times] Mark saved where search started [3 times] Auto-saving...done 216669 (#o647135, #x34e5d) [2 times] Mark set Saving file /home/frank/.emacs.d/init.el... Wrote /home/frank/.emacs.d/init.el Load-path shadows: /home/frank/.emacs.d/elpa/company-20130923.513/.dir-locals hides /home/frank/.emacs.d/elpa/flycheck-20130928.1223/.dir-locals /usr/share/emacs/24.3.50/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup /usr/share/emacs/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/24.3.50/lisp/textmodes/flyspell /usr/share/emacs/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/24.3.50/lisp/textmodes/ispell /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-table hides /usr/share/emacs/24.3.50/lisp/org/org-table /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-gnus hides /usr/share/emacs/24.3.50/lisp/org/org-gnus /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-plantuml hides /usr/share/emacs/24.3.50/lisp/org/ob-plantuml /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ox-html hides /usr/share/emacs/24.3.50/lisp/org/ox-html /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-pcomplete hides /usr/share/emacs/24.3.50/lisp/org/org-pcomplete /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-C hides /usr/share/emacs/24.3.50/lisp/org/ob-C /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-macs hides /usr/share/emacs/24.3.50/lisp/org/org-macs /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-shen hides /usr/share/emacs/24.3.50/lisp/org/ob-shen /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-ref hides /usr/share/emacs/24.3.50/lisp/org/ob-ref /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-clock hides /usr/share/emacs/24.3.50/lisp/org/org-clock /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-mscgen hides /usr/share/emacs/24.3.50/lisp/org/ob-mscgen /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-exp hides /usr/share/emacs/24.3.50/lisp/org/ob-exp /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-crypt hides /usr/share/emacs/24.3.50/lisp/org/org-crypt /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-io hides /usr/share/emacs/24.3.50/lisp/org/ob-io /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-macro hides /usr/share/emacs/24.3.50/lisp/org/org-macro /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org hides /usr/share/emacs/24.3.50/lisp/org/org /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-java hides /usr/share/emacs/24.3.50/lisp/org/ob-java /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-bibtex hides /usr/share/emacs/24.3.50/lisp/org/org-bibtex /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-css hides /usr/share/emacs/24.3.50/lisp/org/ob-css /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-latex hides /usr/share/emacs/24.3.50/lisp/org/ob-latex /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-entities hides /usr/share/emacs/24.3.50/lisp/org/org-entities /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-clojure hides /usr/share/emacs/24.3.50/lisp/org/ob-clojure /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ox-publish hides /usr/share/emacs/24.3.50/lisp/org/ox-publish /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-scala hides /usr/share/emacs/24.3.50/lisp/org/ob-scala /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-footnote hides /usr/share/emacs/24.3.50/lisp/org/org-footnote /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-lob hides /usr/share/emacs/24.3.50/lisp/org/ob-lob /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-capture hides /usr/share/emacs/24.3.50/lisp/org/org-capture /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-matlab hides /usr/share/emacs/24.3.50/lisp/org/ob-matlab /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-docview hides /usr/share/emacs/24.3.50/lisp/org/org-docview /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ox-icalendar hides /usr/share/emacs/24.3.50/lisp/org/ox-icalendar /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-ledger hides /usr/share/emacs/24.3.50/lisp/org/ob-ledger /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-R hides /usr/share/emacs/24.3.50/lisp/org/ob-R /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-lisp hides /usr/share/emacs/24.3.50/lisp/org/ob-lisp /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-screen hides /usr/share/emacs/24.3.50/lisp/org/ob-screen /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-id hides /usr/share/emacs/24.3.50/lisp/org/org-id /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-eshell hides /usr/share/emacs/24.3.50/lisp/org/org-eshell /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ox-latex hides /usr/share/emacs/24.3.50/lisp/org/ox-latex /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-scheme hides /usr/share/emacs/24.3.50/lisp/org/ob-scheme /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-calc hides /usr/share/emacs/24.3.50/lisp/org/ob-calc /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-table hides /usr/share/emacs/24.3.50/lisp/org/ob-table /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-timer hides /usr/share/emacs/24.3.50/lisp/org/org-timer /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-comint hides /usr/share/emacs/24.3.50/lisp/org/ob-comint /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-sqlite hides /usr/share/emacs/24.3.50/lisp/org/ob-sqlite /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-archive hides /usr/share/emacs/24.3.50/lisp/org/org-archive /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-mouse hides /usr/share/emacs/24.3.50/lisp/org/org-mouse /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-ruby hides /usr/share/emacs/24.3.50/lisp/org/ob-ruby /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-attach hides /usr/share/emacs/24.3.50/lisp/org/org-attach /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-octave hides /usr/share/emacs/24.3.50/lisp/org/ob-octave /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-colview hides /usr/share/emacs/24.3.50/lisp/org/org-colview /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-gnuplot hides /usr/share/emacs/24.3.50/lisp/org/ob-gnuplot /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-sh hides /usr/share/emacs/24.3.50/lisp/org/ob-sh /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-ctags hides /usr/share/emacs/24.3.50/lisp/org/org-ctags /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-eval hides /usr/share/emacs/24.3.50/lisp/org/ob-eval /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-tangle hides /usr/share/emacs/24.3.50/lisp/org/ob-tangle /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-element hides /usr/share/emacs/24.3.50/lisp/org/org-element /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-compat hides /usr/share/emacs/24.3.50/lisp/org/org-compat /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-install hides /usr/share/emacs/24.3.50/lisp/org/org-install /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ox-texinfo hides /usr/share/emacs/24.3.50/lisp/org/ox-texinfo /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-version hides /usr/share/emacs/24.3.50/lisp/org/org-version /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-emacs-lisp hides /usr/share/emacs/24.3.50/lisp/org/ob-emacs-lisp /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-ocaml hides /usr/share/emacs/24.3.50/lisp/org/ob-ocaml /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-core hides /usr/share/emacs/24.3.50/lisp/org/ob-core /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-indent hides /usr/share/emacs/24.3.50/lisp/org/org-indent /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-sql hides /usr/share/emacs/24.3.50/lisp/org/ob-sql /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-picolisp hides /usr/share/emacs/24.3.50/lisp/org/ob-picolisp /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-maxima hides /usr/share/emacs/24.3.50/lisp/org/ob-maxima /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-protocol hides /usr/share/emacs/24.3.50/lisp/org/org-protocol /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-haskell hides /usr/share/emacs/24.3.50/lisp/org/ob-haskell /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-datetree hides /usr/share/emacs/24.3.50/lisp/org/org-datetree /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-fortran hides /usr/share/emacs/24.3.50/lisp/org/ob-fortran /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-info hides /usr/share/emacs/24.3.50/lisp/org/org-info /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-dot hides /usr/share/emacs/24.3.50/lisp/org/ob-dot /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-habit hides /usr/share/emacs/24.3.50/lisp/org/org-habit /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-awk hides /usr/share/emacs/24.3.50/lisp/org/ob-awk /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-src hides /usr/share/emacs/24.3.50/lisp/org/org-src /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-keys hides /usr/share/emacs/24.3.50/lisp/org/ob-keys /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob hides /usr/share/emacs/24.3.50/lisp/org/ob /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ox-odt hides /usr/share/emacs/24.3.50/lisp/org/ox-odt /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-mobile hides /usr/share/emacs/24.3.50/lisp/org/org-mobile /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ox-md hides /usr/share/emacs/24.3.50/lisp/org/ox-md /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-faces hides /usr/share/emacs/24.3.50/lisp/org/org-faces /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-irc hides /usr/share/emacs/24.3.50/lisp/org/org-irc /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-plot hides /usr/share/emacs/24.3.50/lisp/org/org-plot /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ox-beamer hides /usr/share/emacs/24.3.50/lisp/org/ox-beamer /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ox hides /usr/share/emacs/24.3.50/lisp/org/ox /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-js hides /usr/share/emacs/24.3.50/lisp/org/ob-js /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-feed hides /usr/share/emacs/24.3.50/lisp/org/org-feed /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-makefile hides /usr/share/emacs/24.3.50/lisp/org/ob-makefile /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-agenda hides /usr/share/emacs/24.3.50/lisp/org/org-agenda /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ox-org hides /usr/share/emacs/24.3.50/lisp/org/ox-org /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-org hides /usr/share/emacs/24.3.50/lisp/org/ob-org /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-list hides /usr/share/emacs/24.3.50/lisp/org/org-list /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-lilypond hides /usr/share/emacs/24.3.50/lisp/org/ob-lilypond /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-asymptote hides /usr/share/emacs/24.3.50/lisp/org/ob-asymptote /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-python hides /usr/share/emacs/24.3.50/lisp/org/ob-python /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-rmail hides /usr/share/emacs/24.3.50/lisp/org/org-rmail /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-w3m hides /usr/share/emacs/24.3.50/lisp/org/org-w3m /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-ditaa hides /usr/share/emacs/24.3.50/lisp/org/ob-ditaa /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-sass hides /usr/share/emacs/24.3.50/lisp/org/ob-sass /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ob-perl hides /usr/share/emacs/24.3.50/lisp/org/ob-perl /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-mhe hides /usr/share/emacs/24.3.50/lisp/org/org-mhe /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-inlinetask hides /usr/share/emacs/24.3.50/lisp/org/org-inlinetask /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ox-man hides /usr/share/emacs/24.3.50/lisp/org/ox-man /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-loaddefs hides /usr/share/emacs/24.3.50/lisp/org/org-loaddefs /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/ox-ascii hides /usr/share/emacs/24.3.50/lisp/org/ox-ascii /home/frank/.emacs.d/elpa/org-plus-contrib-20130923/org-bbdb hides /usr/share/emacs/24.3.50/lisp/org/org-bbdb /home/frank/.emacs.d/elpa/company-20130923.513/.dir-locals hides /usr/share/emacs/24.3.50/lisp/gnus/.dir-locals Features: (shadow sort mail-extr emacsbug message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils tabify mule-util dired-aux misearch multi-isearch add-log dired company-go jka-compr goto-addr eldoc disp-table which-func imenu paren superword subword cuatroporocho-theme workgroups saveplace recentf tree-widget wid-edit desktop frameset server view go-mode url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap ffap url-parse auth-source eieio eieio-core gnus-util mm-util mail-prsvr password-cache url-vars python-el-fgallina-expansions python slime-fancy slime-trace-dialog slime-fontifying-fu slime-package-fu slime-references slime-scratch slime-presentations slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c slime-repl elp slime-editing-commands slime-autodoc slime-parse slime derived gud apropos arc-mode archive-mode hyperspec savehist autorevert filenotify cl-macs gv grep compile winner transpose-frame switch-window quail smex rainbow-mode color multiple-cursors mc-separate-operations rectangular-region-mode mc-mark-pop mc-mark-more mc-cycle-cursors mc-edit-lines multiple-cursors-core warnings rect iedit iedit-lib hide-lines goto-last-change flycheck rx f dash s expand-region text-mode-expansions the-org-mode-expansions er-basic-expansions expand-region-custom expand-region-core diminish company ace-jump-mode webjump misc ido ibuffer autoinsert yasnippet help-mode cl whitespace thingatpt paredit edmacro kmacro cl-loaddefs cl-lib org byte-opt bytecomp byte-compile cconv org-macro org-footnote org-pcomplete pcomplete org-list org-faces org-entities noutline outline easy-mmode org-version ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint ob-core ob-eval org-compat org-macs org-loaddefs format-spec find-func cal-menu calendar cal-loaddefs dabbrev hippie-exp comint ansi-color elec-pair etags ring browse-url bookmark pp avoid time time-stamp delsel cua-base advice help-fns finder-inf info easymenu package time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer 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 make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)