help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Spaces rather than tabs by a major mode hook


From: Jean Louis
Subject: Re: Spaces rather than tabs by a major mode hook
Date: Sun, 12 Jun 2022 21:21:01 +0300
User-agent: Mutt/+ () (2022-05-21)

* Eli Zaretskii <eliz@gnu.org> [2022-06-12 20:46]:
> > From: Po Lu <luangruo@yahoo.com>
> > Cc: Eli Zaretskii <eliz@gnu.org>,  help-gnu-emacs@gnu.org
> > Date: Sun, 12 Jun 2022 15:13:05 +0800
> > 
> > Or here's a better idea, if you don't want any of the features provided
> > by Fortran mode: use fundamental-mode instead.
> 
> That still has electric-indent-mode turned on by default, though.
> 
> Using Emacs makes no sense at all if one doesn't want automatic
> (re)indentation.  Why use such a powerful editor if all you want is to
> disable each and every feature which makes its powerful?

Maybe manual shall have a section about disabling indentation.

I was too much used on some automatically offered features in Emacs,
and simply submit to them and use what Emacs offers. 

Though I can understand that different files not made with Emacs could
have different intendation and myself I would not like changing those
or adapting those automatically.

For that reason I sometimes use this function to edit buffer with
external editor.

(defun rcd-edit-with-external-editor (&optional text)
  "Editing with external editor as defined in `rcd-external-editor'.

It will either edit the optional TEXT as string
argument. Otherwise it will edit the current buffer and replace
it with the result."
  (interactive)
  (let* ((buffer-or-text (if text nil t))
         (text (if buffer-or-text (buffer-substring-no-properties (point-min) 
(point-max)) text))
         (point (point))
         ;; (mode major-mode)
         (file (concat (or (getenv "TMPDIR") "/tmp/") "temp-file")))
    (string-to-file-force text file)
    (call-process rcd-external-editor nil nil nil file)
    (if buffer-or-text 
        (progn
          (erase-buffer)
          (insert-file-contents file)
          (goto-char point))
      (file-to-string file))))

(defcustom rcd-external-editor "notepadqq"
  "The external editor as an option for some functions"
  :group 'rcd
  :type 'string)


Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]