bug#44834: 27.1; Tcl mode enforces bad indentation following proc within a namespace

classic Classic list List threaded Threaded
43 messages Options
123
Reply | Threaded
Open this post in threaded view
|

bug#44834: 27.1; Tcl mode enforces bad indentation following proc within a namespace

Morgan Willcock

It seems as though an incorrect indentation level is sometimes detected
by Tcl mode. An easy (and commonly used) example is a proc defined in a
namespace: the third line which defines p2 incorrectly wants to indent
into the wrong position:

namespace eval ns {
    proc p1 {} {}
proc p2 {} {}
}

Spreading braces over more lines has the same issue:

namespace eval ns {
    proc p1 {} {
        # ...
    }
proc p2 {} {
    # ...
}
}

The issues seems very specific to detection of the proc, commenting the
first proc delays the problem:

namespace eval ns {
    # proc p1 {} {}
    proc p2 {} {}
proc p3 {} {}
}

...as does using something other than a proc at the start of the
namespace:

namespace eval ns {
    variable x {}
    proc p1 {} {}
proc p2 {} {}
}

I believe the problem originates from this commit:
http://git.savannah.gnu.org/cgit/emacs.git/commit/lisp/progmodes/tcl.el?id=cd5bb4bf3dbad8941d25823f398b595b8f0edbb9

To re-create the problem in a new buffer:

1. enter Tcl mode:

M-x tcl-mode

2. paste this text:

namespace eval ns {
    proc p1 {} {}
    proc p2 {} {}
}

3. move point to anywhere on line 3 and press tab



In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11, cairo version 1.14.8)
 of 2020-08-12 built on inspiron
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
System Description: Debian GNU/Linux 9 (stretch)

Recent messages:
previous-line: Beginning of buffer
Mark set
Saved text from "It seems as though an incorrect indentat"
Mark set [3 times]
Beginning of buffer [8 times]
Auto-saving...done
Mark set [3 times]
Beginning of buffer [5 times]
Mark set
Buffer *unsent mail to [hidden email]* modified; kill anyway? (y or n) y

Configured using:
 'configure --with-cairo --with-json --with-xml2'

Configured features:
XPM JPEG TIFF GIF PNG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY
GNUTLS LIBXML2 FREETYPE HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE
XIM MODULES THREADS JSON PDUMPER GMP

Important settings:
  value of $LANG: en_GB.utf8
  locale-coding-system: utf-8-unix

Major mode: Tcl

Minor modes in effect:
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-notifications-mode: t
  erc-match-mode: t
  erc-spelling-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  savehist-mode: t
  icomplete-mode: t
  shell-dirtrack-mode: t
  recentf-mode: t
  global-hl-line-mode: t
  display-time-mode: t
  tooltip-mode: t
  global-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
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/mwillcock/.emacs.d/elpa/org-9.4/ol hides /usr/local/share/emacs/27.1/lisp/org/ol
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-sqlite hides /usr/local/share/emacs/27.1/lisp/org/ob-sqlite
/home/mwillcock/.emacs.d/elpa/org-9.4/org-feed hides /usr/local/share/emacs/27.1/lisp/org/org-feed
/home/mwillcock/.emacs.d/elpa/org-9.4/org-src hides /usr/local/share/emacs/27.1/lisp/org/org-src
/home/mwillcock/.emacs.d/elpa/org-9.4/ox-html hides /usr/local/share/emacs/27.1/lisp/org/ox-html
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-eshell hides /usr/local/share/emacs/27.1/lisp/org/ob-eshell
/home/mwillcock/.emacs.d/elpa/org-9.4/ol-bbdb hides /usr/local/share/emacs/27.1/lisp/org/ol-bbdb
/home/mwillcock/.emacs.d/elpa/org-9.4/org-faces hides /usr/local/share/emacs/27.1/lisp/org/org-faces
/home/mwillcock/.emacs.d/elpa/org-9.4/ox hides /usr/local/share/emacs/27.1/lisp/org/ox
/home/mwillcock/.emacs.d/elpa/org-9.4/ol-docview hides /usr/local/share/emacs/27.1/lisp/org/ol-docview
/home/mwillcock/.emacs.d/elpa/org-9.4/ol-gnus hides /usr/local/share/emacs/27.1/lisp/org/ol-gnus
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-scheme hides /usr/local/share/emacs/27.1/lisp/org/ob-scheme
/home/mwillcock/.emacs.d/elpa/org-9.4/org-footnote hides /usr/local/share/emacs/27.1/lisp/org/org-footnote
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-groovy hides /usr/local/share/emacs/27.1/lisp/org/ob-groovy
/home/mwillcock/.emacs.d/elpa/org-9.4/org hides /usr/local/share/emacs/27.1/lisp/org/org
/home/mwillcock/.emacs.d/elpa/org-9.4/ol-eshell hides /usr/local/share/emacs/27.1/lisp/org/ol-eshell
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-coq hides /usr/local/share/emacs/27.1/lisp/org/ob-coq
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-lilypond hides /usr/local/share/emacs/27.1/lisp/org/ob-lilypond
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-tangle hides /usr/local/share/emacs/27.1/lisp/org/ob-tangle
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-hledger hides /usr/local/share/emacs/27.1/lisp/org/ob-hledger
/home/mwillcock/.emacs.d/elpa/org-9.4/org-keys hides /usr/local/share/emacs/27.1/lisp/org/org-keys
/home/mwillcock/.emacs.d/elpa/org-9.4/org-inlinetask hides /usr/local/share/emacs/27.1/lisp/org/org-inlinetask
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-screen hides /usr/local/share/emacs/27.1/lisp/org/ob-screen
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-exp hides /usr/local/share/emacs/27.1/lisp/org/ob-exp
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-lua hides /usr/local/share/emacs/27.1/lisp/org/ob-lua
/home/mwillcock/.emacs.d/elpa/org-9.4/org-tempo hides /usr/local/share/emacs/27.1/lisp/org/org-tempo
/home/mwillcock/.emacs.d/elpa/org-9.4/org-entities hides /usr/local/share/emacs/27.1/lisp/org/org-entities
/home/mwillcock/.emacs.d/elpa/org-9.4/org-lint hides /usr/local/share/emacs/27.1/lisp/org/org-lint
/home/mwillcock/.emacs.d/elpa/org-9.4/org-num hides /usr/local/share/emacs/27.1/lisp/org/org-num
/home/mwillcock/.emacs.d/elpa/org-9.4/org-capture hides /usr/local/share/emacs/27.1/lisp/org/org-capture
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-dot hides /usr/local/share/emacs/27.1/lisp/org/ob-dot
/home/mwillcock/.emacs.d/elpa/org-9.4/ox-beamer hides /usr/local/share/emacs/27.1/lisp/org/ox-beamer
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-octave hides /usr/local/share/emacs/27.1/lisp/org/ob-octave
/home/mwillcock/.emacs.d/elpa/org-9.4/ox-texinfo hides /usr/local/share/emacs/27.1/lisp/org/ox-texinfo
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-ebnf hides /usr/local/share/emacs/27.1/lisp/org/ob-ebnf
/home/mwillcock/.emacs.d/elpa/org-9.4/ol-bibtex hides /usr/local/share/emacs/27.1/lisp/org/ol-bibtex
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-emacs-lisp hides /usr/local/share/emacs/27.1/lisp/org/ob-emacs-lisp
/home/mwillcock/.emacs.d/elpa/org-9.4/ox-latex hides /usr/local/share/emacs/27.1/lisp/org/ox-latex
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-stan hides /usr/local/share/emacs/27.1/lisp/org/ob-stan
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-abc hides /usr/local/share/emacs/27.1/lisp/org/ob-abc
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-css hides /usr/local/share/emacs/27.1/lisp/org/ob-css
/home/mwillcock/.emacs.d/elpa/org-9.4/ox-md hides /usr/local/share/emacs/27.1/lisp/org/ox-md
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-plantuml hides /usr/local/share/emacs/27.1/lisp/org/ob-plantuml
/home/mwillcock/.emacs.d/elpa/org-9.4/org-crypt hides /usr/local/share/emacs/27.1/lisp/org/org-crypt
/home/mwillcock/.emacs.d/elpa/org-9.4/org-attach hides /usr/local/share/emacs/27.1/lisp/org/org-attach
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-perl hides /usr/local/share/emacs/27.1/lisp/org/ob-perl
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-latex hides /usr/local/share/emacs/27.1/lisp/org/ob-latex
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-core hides /usr/local/share/emacs/27.1/lisp/org/ob-core
/home/mwillcock/.emacs.d/elpa/org-9.4/ol-eww hides /usr/local/share/emacs/27.1/lisp/org/ol-eww
/home/mwillcock/.emacs.d/elpa/org-9.4/ox-odt hides /usr/local/share/emacs/27.1/lisp/org/ox-odt
/home/mwillcock/.emacs.d/elpa/org-9.4/ox-org hides /usr/local/share/emacs/27.1/lisp/org/ox-org
/home/mwillcock/.emacs.d/elpa/org-9.4/org-plot hides /usr/local/share/emacs/27.1/lisp/org/org-plot
/home/mwillcock/.emacs.d/elpa/org-9.4/ol-irc hides /usr/local/share/emacs/27.1/lisp/org/ol-irc
/home/mwillcock/.emacs.d/elpa/org-9.4/ol-mhe hides /usr/local/share/emacs/27.1/lisp/org/ol-mhe
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-shell hides /usr/local/share/emacs/27.1/lisp/org/ob-shell
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-J hides /usr/local/share/emacs/27.1/lisp/org/ob-J
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-R hides /usr/local/share/emacs/27.1/lisp/org/ob-R
/home/mwillcock/.emacs.d/elpa/org-9.4/org-protocol hides /usr/local/share/emacs/27.1/lisp/org/org-protocol
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-haskell hides /usr/local/share/emacs/27.1/lisp/org/ob-haskell
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-io hides /usr/local/share/emacs/27.1/lisp/org/ob-io
/home/mwillcock/.emacs.d/elpa/org-9.4/org-compat hides /usr/local/share/emacs/27.1/lisp/org/org-compat
/home/mwillcock/.emacs.d/elpa/org-9.4/org-element hides /usr/local/share/emacs/27.1/lisp/org/org-element
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-ocaml hides /usr/local/share/emacs/27.1/lisp/org/ob-ocaml
/home/mwillcock/.emacs.d/elpa/org-9.4/org-attach-git hides /usr/local/share/emacs/27.1/lisp/org/org-attach-git
/home/mwillcock/.emacs.d/elpa/org-9.4/org-agenda hides /usr/local/share/emacs/27.1/lisp/org/org-agenda
/home/mwillcock/.emacs.d/elpa/org-9.4/org-list hides /usr/local/share/emacs/27.1/lisp/org/org-list
/home/mwillcock/.emacs.d/elpa/org-9.4/org-pcomplete hides /usr/local/share/emacs/27.1/lisp/org/org-pcomplete
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-mscgen hides /usr/local/share/emacs/27.1/lisp/org/ob-mscgen
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-shen hides /usr/local/share/emacs/27.1/lisp/org/ob-shen
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-fortran hides /usr/local/share/emacs/27.1/lisp/org/ob-fortran
/home/mwillcock/.emacs.d/elpa/org-9.4/org-table hides /usr/local/share/emacs/27.1/lisp/org/org-table
/home/mwillcock/.emacs.d/elpa/org-9.4/ol-info hides /usr/local/share/emacs/27.1/lisp/org/ol-info
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-processing hides /usr/local/share/emacs/27.1/lisp/org/ob-processing
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-sql hides /usr/local/share/emacs/27.1/lisp/org/ob-sql
/home/mwillcock/.emacs.d/elpa/org-9.4/org-mouse hides /usr/local/share/emacs/27.1/lisp/org/org-mouse
/home/mwillcock/.emacs.d/elpa/org-9.4/ox-man hides /usr/local/share/emacs/27.1/lisp/org/ox-man
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-vala hides /usr/local/share/emacs/27.1/lisp/org/ob-vala
/home/mwillcock/.emacs.d/elpa/org-9.4/ob hides /usr/local/share/emacs/27.1/lisp/org/ob
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-asymptote hides /usr/local/share/emacs/27.1/lisp/org/ob-asymptote
/home/mwillcock/.emacs.d/elpa/org-9.4/org-mobile hides /usr/local/share/emacs/27.1/lisp/org/org-mobile
/home/mwillcock/.emacs.d/elpa/org-9.4/org-install hides /usr/local/share/emacs/27.1/lisp/org/org-install
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-lob hides /usr/local/share/emacs/27.1/lisp/org/ob-lob
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-C hides /usr/local/share/emacs/27.1/lisp/org/ob-C
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-ledger hides /usr/local/share/emacs/27.1/lisp/org/ob-ledger
/home/mwillcock/.emacs.d/elpa/org-9.4/ox-publish hides /usr/local/share/emacs/27.1/lisp/org/ox-publish
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-calc hides /usr/local/share/emacs/27.1/lisp/org/ob-calc
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-matlab hides /usr/local/share/emacs/27.1/lisp/org/ob-matlab
/home/mwillcock/.emacs.d/elpa/org-9.4/ox-ascii hides /usr/local/share/emacs/27.1/lisp/org/ox-ascii
/home/mwillcock/.emacs.d/elpa/org-9.4/org-archive hides /usr/local/share/emacs/27.1/lisp/org/org-archive
/home/mwillcock/.emacs.d/elpa/org-9.4/ox-icalendar hides /usr/local/share/emacs/27.1/lisp/org/ox-icalendar
/home/mwillcock/.emacs.d/elpa/org-9.4/org-macs hides /usr/local/share/emacs/27.1/lisp/org/org-macs
/home/mwillcock/.emacs.d/elpa/org-9.4/ol-w3m hides /usr/local/share/emacs/27.1/lisp/org/ol-w3m
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-makefile hides /usr/local/share/emacs/27.1/lisp/org/ob-makefile
/home/mwillcock/.emacs.d/elpa/org-9.4/org-goto hides /usr/local/share/emacs/27.1/lisp/org/org-goto
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-lisp hides /usr/local/share/emacs/27.1/lisp/org/ob-lisp
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-table hides /usr/local/share/emacs/27.1/lisp/org/ob-table
/home/mwillcock/.emacs.d/elpa/org-9.4/org-macro hides /usr/local/share/emacs/27.1/lisp/org/org-macro
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-js hides /usr/local/share/emacs/27.1/lisp/org/ob-js
/home/mwillcock/.emacs.d/elpa/org-9.4/org-colview hides /usr/local/share/emacs/27.1/lisp/org/org-colview
/home/mwillcock/.emacs.d/elpa/org-9.4/org-indent hides /usr/local/share/emacs/27.1/lisp/org/org-indent
/home/mwillcock/.emacs.d/elpa/org-9.4/org-loaddefs hides /usr/local/share/emacs/27.1/lisp/org/org-loaddefs
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-sass hides /usr/local/share/emacs/27.1/lisp/org/ob-sass
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-forth hides /usr/local/share/emacs/27.1/lisp/org/ob-forth
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-gnuplot hides /usr/local/share/emacs/27.1/lisp/org/ob-gnuplot
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-java hides /usr/local/share/emacs/27.1/lisp/org/ob-java
/home/mwillcock/.emacs.d/elpa/org-9.4/org-duration hides /usr/local/share/emacs/27.1/lisp/org/org-duration
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-ruby hides /usr/local/share/emacs/27.1/lisp/org/ob-ruby
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-sed hides /usr/local/share/emacs/27.1/lisp/org/ob-sed
/home/mwillcock/.emacs.d/elpa/org-9.4/org-datetree hides /usr/local/share/emacs/27.1/lisp/org/org-datetree
/home/mwillcock/.emacs.d/elpa/org-9.4/ol-rmail hides /usr/local/share/emacs/27.1/lisp/org/ol-rmail
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-eval hides /usr/local/share/emacs/27.1/lisp/org/ob-eval
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-python hides /usr/local/share/emacs/27.1/lisp/org/ob-python
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-picolisp hides /usr/local/share/emacs/27.1/lisp/org/ob-picolisp
/home/mwillcock/.emacs.d/elpa/org-9.4/org-habit hides /usr/local/share/emacs/27.1/lisp/org/org-habit
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-maxima hides /usr/local/share/emacs/27.1/lisp/org/ob-maxima
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-awk hides /usr/local/share/emacs/27.1/lisp/org/ob-awk
/home/mwillcock/.emacs.d/elpa/org-9.4/org-id hides /usr/local/share/emacs/27.1/lisp/org/org-id
/home/mwillcock/.emacs.d/elpa/org-9.4/org-timer hides /usr/local/share/emacs/27.1/lisp/org/org-timer
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-ditaa hides /usr/local/share/emacs/27.1/lisp/org/ob-ditaa
/home/mwillcock/.emacs.d/elpa/org-9.4/org-ctags hides /usr/local/share/emacs/27.1/lisp/org/org-ctags
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-ref hides /usr/local/share/emacs/27.1/lisp/org/ob-ref
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-comint hides /usr/local/share/emacs/27.1/lisp/org/ob-comint
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-org hides /usr/local/share/emacs/27.1/lisp/org/ob-org
/home/mwillcock/.emacs.d/elpa/org-9.4/org-version hides /usr/local/share/emacs/27.1/lisp/org/org-version
/home/mwillcock/.emacs.d/elpa/org-9.4/org-clock hides /usr/local/share/emacs/27.1/lisp/org/org-clock
/home/mwillcock/.emacs.d/elpa/org-9.4/ob-clojure hides /usr/local/share/emacs/27.1/lisp/org/ob-clojure

Features:
(shadow emacsbug ediff ediff-merg ediff-mult ediff-wind ediff-diff
ediff-help ediff-init ediff-util reveal view finder-inf cl-print
help-fns radix-tree tcl mule-util ibuf-ext mhtml-mode css-mode color js
cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs sgml-mode ox-odt rng-loc rng-uri rng-parse rng-match
rng-dt rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util
ox-latex ox-icalendar ox-html table ox-ascii ox-publish ox sh-script
smie executable org-clock org-duration cal-iso face-remap log-edit
pcvs-util add-log smerge-mode diff vc vc-dispatcher bookmark tabify
vc-git diff-mode erc-list erc-menu erc-join erc-ring erc-networks
erc-pcomplete erc-track erc-button erc-fill erc-stamp erc-netsplit
erc-desktop-notifications erc-match org-element avl-tree generator
ol-eww eww url-queue ol-rmail ol-mhe ol-irc ol-info ol-gnus ol-docview
doc-view jka-compr image-mode exif ol-bibtex bibtex ol-bbdb ol-w3m
mailalias smtpmail sendmail misearch multi-isearch gnus-notifications
gnus-fun notifications dbus flow-fill mail-extr qp sort gnus-cite smiley
gnus-async gnus-bcklg cl-extra help-mode gnus-ml disp-table gnus-topic
mm-archive gnutls url-http url-gw url-cache url-auth nnrss mm-url
nndraft nnmh utf-7 epa-file network-stream nsm nnfolder nnnil gnus-agent
gnus-srvr gnus-score score-mode nnvirtual gnus-cache gnus-demon nntp
org-agenda gnus-icalendar org-capture org-refile icalendar diary-lib
diary-loaddefs nnir lua-mode compile rx renpy-mode imenu python org-msg
htmlize cl gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig
gnus-sum url url-proxy url-privacy url-expand url-methods url-history
mailcap gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail
mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range message rmc
dired dired-loaddefs rfc822 mml mml-sec epa derived epg epg-config
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader gnus-win erc-spelling flyspell ispell erc-goodies erc
erc-backend erc-compat thingatpt pp erc-loaddefs ob-dot org ob ob-tangle
ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint
org-pcomplete org-list org-faces org-entities noutline outline
easy-mmode org-version ob-emacs-lisp ob-core ob-eval org-table ol
org-keys org-compat advice org-macs org-loaddefs find-func cal-menu
calendar cal-loaddefs savehist icomplete tramp-cache tramp-sh tramp
tramp-loaddefs trampver tramp-integration files-x tramp-compat shell
pcomplete comint ansi-color ring parse-time iso8601 ls-lisp format-spec
recentf tree-widget ibuffer ibuffer-loaddefs hl-line time edmacro kmacro
gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums
time-date mail-utils mm-util mail-prsvr wid-edit shr
text-property-search url-cookie url-domsuf url-util puny svg xml dom
modus-vivendi-theme info package easymenu browse-url url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json subr-x map url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib 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 cairo move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 601379 93831)
 (symbols 48 41903 13)
 (strings 32 163981 18423)
 (string-bytes 1 5420629)
 (vectors 16 67450)
 (vector-slots 8 1236339 91558)
 (floats 8 647 1055)
 (intervals 56 5816 2611)
 (buffers 1000 157))

--
Morgan Willcock, Support and Development Engineer
Precedence Technologies Ltd              T: +44 (0) 845 6446 800
Technology House, 36a Union Lane         F: +44 (0) 845 6446 899
Cambridge, CB4 1QB, United Kingdom       W: http://www.precedence.co.uk/
Limited company registered in England and Wales. Company number 3725626



Reply | Threaded
Open this post in threaded view
|

bug#44834: change severity

Anticrisis
Just a note that this bug makes the current tcl-mode practically unusable for anyone writing more than a basic single-file script. I'm not sure 'minor' is the correct severity. Can it be changed to 'normal' and would it be possible to alert the maintainer, who I imagine must not be aware of the impact of his commits last year?
Reply | Threaded
Open this post in threaded view
|

bug#44834: Patch to provide failing test for bug 44834

Anticrisis
In reply to this post by Morgan Willcock
--- emacs/test/lisp/progmodes/tcl-tests.el 2021-01-01 22:11:30.620000000 -1000
+++ emacs.patched/test/lisp/progmodes/tcl-tests.el 2021-01-08
12:51:27.420000000 -1000
@@ -50,14 +50,14 @@
(insert "proc notinthis {} {\n # nothing\n}\n\n")
(should-not (add-log-current-defun))))

-(ert-deftest tcl-mode-function-name ()
+(ert-deftest tcl-mode-function-name-2 ()
(with-temp-buffer
(tcl-mode)
(insert "proc simple {} {\n # nothing\n}")
(backward-char 3)
(should (equal "simple" (add-log-current-defun)))))

-(ert-deftest tcl-mode-function-name ()
+(ert-deftest tcl-mode-function-name-3 ()
(with-temp-buffer
(tcl-mode)
(insert "proc inthis {} {\n # nothing\n")
@@ -71,6 +71,15 @@
(insert text)
(indent-region (point-min) (point-max))
(should (equal (buffer-string) text)))))
+
+;; From bug#44834
+(ert-deftest tcl-mode-namespace-indent-2 ()
+ (with-temp-buffer
+ (tcl-mode)
+ (let ((text "namespace eval Foo {\n proc foo {} {}\n\n proc bar {}{}}\n"))
+ (insert text)
+ (indent-region (point-min) (point-max))
+ (should (equal (buffer-string) text)))))

(provide 'tcl-tests)



Reply | Threaded
Open this post in threaded view
|

bug#44834: Patch to provide failing test for bug 44834

Anticrisis
Apologies, the patch was munged by gmail even in plain text mode. It
should not be applied.



Reply | Threaded
Open this post in threaded view
|

bug#44834: Patch to provide failing test for bug 44834

Lars Ingebrigtsen
Anticrisis <[hidden email]> writes:

> Apologies, the patch was munged by gmail even in plain text mode. It
> should not be applied.

Try resending it as an attachment.

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



Reply | Threaded
Open this post in threaded view
|

bug#44834: Patch to provide failing test for bug 44834

Anticrisis
Trying again with an attachment, thank you for the suggestion.

patch.txt (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

bug#44834: Fix for failing indentation of Tcl procs nested in namespace

Anticrisis
In reply to this post by Morgan Willcock
This patch corrects the problem by partially backing out changes
introduced in this commit 2 1/2 years ago:

https://git.savannah.gnu.org/cgit/emacs.git/commit/lisp/progmodes/tcl.el?id=cd5bb4bf3dbad8941d25823f398b595b8f0edbb9

The patch removes the customized tcl-beginning-of-defun-function in
favor of relying on the existing lisp mechanism. It preserves the
customized tcl-end-of-defun-function because that is required for some
test cases.

The expected-failing test was marked as succeeding.

This is a minor change. I did not refer to any code outside of emacs
itself in investigating and correcting this bug. I will not be able to
provide additional paperwork.

tcl-beginning-of-defun-patch.txt (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

bug#44834: Patch also closes bug#44083

Anticrisis
In reply to this post by Morgan Willcock
This patch also closes bug#44083.



Reply | Threaded
Open this post in threaded view
|

bug#44834: Fix for failing indentation of Tcl procs nested in namespace

Lars Ingebrigtsen
In reply to this post by Anticrisis
Anticrisis <[hidden email]> writes:

> This is a minor change. I did not refer to any code outside of emacs
> itself in investigating and correcting this bug. I will not be able to
> provide additional paperwork.

The change is unfortunately too big to apply without a copyright
assignment to the FSF.  Are you willing to sign such paperwork?

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



Reply | Threaded
Open this post in threaded view
|

bug#44834: Fix for failing indentation of Tcl procs nested in namespace

Dmitry Gutov
On 27.01.2021 06:37, Lars Ingebrigtsen wrote:
> The change is unfortunately too big to apply without a copyright
> assignment to the FSF.

Is it really?

There are like 2 new [non-empty] lines in there.



Reply | Threaded
Open this post in threaded view
|

bug#44834: Fix for failing indentation of Tcl procs nested in namespace

Richard Stallman
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > > The change is unfortunately too big to apply without a copyright
  > > assignment to the FSF.

  > Is it really?

  > There are like 2 new [non-empty] lines in there.

If someone contributes just 2 nontrivial lines, we can treat it as a
trivial change.
--
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





Reply | Threaded
Open this post in threaded view
|

bug#44834: Fix for failing indentation of Tcl procs nested in namespace

Richard Stallman
In reply to this post by Lars Ingebrigtsen
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

I have not looked at the patch or the problem it fixes.
But I can say something about the issue of its copyright.

We can use the program if it is under CC0, but would you
please send the FSF a paper affirming that?

Also, do you have an employer that might claim copyright on it?
--
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





Reply | Threaded
Open this post in threaded view
|

bug#44834: Fix for failing indentation of Tcl procs nested in namespace

Anticrisis
It really is a tiny change, and I explain the rationale in an earlier
comment on this bug report, it would take five minutes for anyone else
to read the explanation and make the same code change. I placed the
CC0 disclaimer using the Creative Commons CC0 tool directly on the
gist at github I posted earlier. I'm afraid any paperwork would
require my real name and signature, which I'm not willing to give. And
I am self-employed. I don't need attribution, I just hope the official
version of tcl-mode can be improved for everyone.

On Sat, Feb 6, 2021 at 7:47 PM Richard Stallman <[hidden email]> wrote:

>
> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
> I have not looked at the patch or the problem it fixes.
> But I can say something about the issue of its copyright.
>
> We can use the program if it is under CC0, but would you
> please send the FSF a paper affirming that?
>
> Also, do you have an employer that might claim copyright on it?
> --
> Dr Richard Stallman
> Chief GNUisance of the GNU Project (https://gnu.org)
> Founder, Free Software Foundation (https://fsf.org)
> Internet Hall-of-Famer (https://internethalloffame.org)
>
>



Reply | Threaded
Open this post in threaded view
|

bug#44834: Fix for failing indentation of Tcl procs nested in namespace

Richard Stallman
In reply to this post by Richard Stallman
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > Once the cumulative amount of your submissions exceeds about 15 lines
  > of non-trivial changes, we will need you to assign to the FSF the
  > copyright for your contributions.
  > ----

  > So if code removal doesn't count, then perhaps this should be rephrased?

It can surely be improved, to say that lines deleted or totally replaced don't
count.

However, trying to make it a completely clear and precise statement
is a misguided goal.

--
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





Reply | Threaded
Open this post in threaded view
|

bug#44834: Fix for failing indentation of Tcl procs nested in namespace

Richard Stallman
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

The text said

  > >   > Once the cumulative amount of your submissions exceeds about 15 lines
  > >   > of non-trivial changes, we will need you to assign to the FSF the
  > >   > copyright for your contributions.

I think you changed it to

  > >   > Once the cumulative amount of your submissions exceeds about 15 lines
  > >   > of non-trivial code, we will need you to assign to the FSF the
  > >   > copyright for your contributions.

but that is not entirely correct either.  People could misinterpret
what is "trivial."

Please put in

   about 10 new or modified nontrivial lines of code.  (A line with
   a symbol is nontrivial.)




--
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





Reply | Threaded
Open this post in threaded view
|

bug#44834: Fix for failing indentation of Tcl procs nested in namespace

Lars Ingebrigtsen
Richard Stallman <[hidden email]> writes:

> but that is not entirely correct either.  People could misinterpret
> what is "trivial."
>
> Please put in
>
>    about 10 new or modified nontrivial lines of code.  (A line with
>    a symbol is nontrivial.)

Eli has changed the text further; please have a look.

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



Reply | Threaded
Open this post in threaded view
|

bug#44834: Fix for failing indentation of Tcl procs nested in namespace

Eli Zaretskii
> From: Lars Ingebrigtsen <[hidden email]>
> Date: Tue, 09 Feb 2021 09:24:53 +0100
> Cc: [hidden email], [hidden email], [hidden email]
>
> Richard Stallman <[hidden email]> writes:
>
> > but that is not entirely correct either.  People could misinterpret
> > what is "trivial."
> >
> > Please put in
> >
> >    about 10 new or modified nontrivial lines of code.  (A line with
> >    a symbol is nontrivial.)
>
> Eli has changed the text further; please have a look.

FTR, the text now says:

  Once the cumulative amount of your submissions exceeds about 15 lines
  of non-trivial code you added or changed (not counting deleted lines),
  we will need you to assign to the FSF the copyright for your
  contributions.  Ask on [hidden email], and we will send you the
  necessary form together with the instructions to fill and email it, in
  order to start this legal paperwork.



Reply | Threaded
Open this post in threaded view
|

bug#44834: Fix for failing indentation of Tcl procs nested in namespace

Richard Stallman
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > FTR, the text now says:

  >   Once the cumulative amount of your submissions exceeds about 15 lines
  >   of non-trivial code you added or changed (not counting deleted lines),
  >   we will need you to assign to the FSF the copyright for your
  >   contributions.  Ask on [hidden email], and we will send you the
  >   necessary form together with the instructions to fill and email it, in
  >   order to start this legal paperwork.

Thanks.  Please make it this:

  >   Once the cumulative amount of your submissions exceeds about 10
  >   new or modified nontrivial lines of code, we will need you to
  >   assign to the FSF the copyright for your contributions.  (If a
  >   line contains a symbol, consider it nontrivial.)  Ask on
  >   [hidden email], and we will send you the necessary form
  >   together with the instructions to fill and email it, in order to
  >   start this legal paperwork.

--
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





Reply | Threaded
Open this post in threaded view
|

bug#44834: Fix for failing indentation of Tcl procs nested in namespace

Richard Stallman
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > Why remove the note about not counting deleted lines?

Because it is logically not necessary.

  >   I agree that in
  > principle "new or modified" covers that, but how many readers will
  > immediately understand that "modified" doesn't include "deleted"?

The idea is to count lines in the new version which are added or
modified.  If that is clear, you will see that it doesn't count
anything from the old versin.

If that is not clear, we do need to clarify it.  But real
clarification calls for more than "deleted lines don't count".  It's,
"Don't count _anything_ from the old code; count only the added and
modified lines in the _patched_ code."

--
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





Reply | Threaded
Open this post in threaded view
|

bug#44834: Fix for failing indentation of Tcl procs nested in namespace

Richard Stallman
In reply to this post by Richard Stallman
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > I don't quite understand what you mean by "if a line contains a symbol".
  > Do you mean that strings or comments don't count?

No.  I meant to say that even one symbol on a line maks it nontrivial.
But you're right that strings and comments count.  So do numbers.

--
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





123