unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eric Lilja <mindcooler@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Why didn't setq work here?
Date: Fri, 07 Jan 2011 17:05:48 +0100	[thread overview]
Message-ID: <ig7dl2$doq$1@dough.gmane.org> (raw)
In-Reply-To: <87k4ig7pto.fsf@member.fsf.org>

On 2011-01-07 15:26, Tassilo Horn wrote:
> Eric Lilja<mindcooler@gmail.com>  writes:
>
>> I have one final question though. fill-column does seem to be a
>> variable.
>
> It is.
>
>> It can be described using C-h v and set using M-x
>> set-variable. However, if I replace (set-fill-column 76) with (setq
>> fill-column 76) the variable value is never changed (and no byte
>> compiler warning btw).
>
> I presume, your observation is false.  In fact, `set-fill-column' does
> nothing except reading its argument and then doing (setq fill-column
> arg) itself.
>
> Bye,
> Tassilo
>
>
>

Thanks for your reply Mr Horn. Either my mind is playing tricks on me or 
there is some stochastic error here which makes setq sometimes not 
stick. I tried it ten times in a row and one time it claimed fill-column 
was at the default value. Anyway, I documented my .emacs like the 
following and I now consider this case closed. I learned quite a bit 
about configuring emacs in this little thread so I am happy! I will look 
out for set-fill-column not "sticking" as it should if my brain was 
indeed not fooling me.

(defun my-latex-hook ()
   (message "Running my-latex-hook")
   ;; Using setq does not work, because setq is for setting values of
   ;; variables and there is no variable called auto-fill-mode (as can
   ;; be observed by performing C-h v auto-fill-mode). The correct way
   ;; to turn on auto-fill-mode is to call the funcion auto-fill-mode
   ;; with a positive argument. In some modes there exists a variable
   ;; with the same name as the function which disables or enables that
   ;; mode (a variable that can be used for the same purpose), but
   ;; auto-fill-mode is not one of those modes.
   (auto-fill-mode 1)
   ;; fill-column is a variable so we can use setq on it. However, we
   ;; have decided to use the function set-fill-column which performs
   ;; setq fill-column itself but also displays in the messages buffer
   ;; what it's doing.
   ;; Sometimes it seemed like setq fill-column did not take effect
   ;; as it should but it could just be my imagination...
   (set-fill-column 76)
)
(add-hook 'latex-mode-hook 'my-latex-hook)

- EL




  reply	other threads:[~2011-01-07 16:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-07  2:05 Why didn't setq work here? Eric Lilja
2011-01-07  3:40 ` Deniz Dogan
2011-01-07 12:43   ` Eric Lilja
2011-01-07 14:26     ` Tassilo Horn
2011-01-07 16:05       ` Eric Lilja [this message]
2011-01-07 16:59       ` Peter Dyballa
2011-01-08 17:29         ` Tassilo Horn
     [not found]       ` <mailman.6.1294416372.29236.help-gnu-emacs@gnu.org>
2011-01-07 22:50         ` Tim X
     [not found] <mailman.23.1294365997.1330.help-gnu-emacs@gnu.org>
2011-01-07  2:54 ` Pascal J. Bourguignon
2011-01-07  3:50 ` rusi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='ig7dl2$doq$1@dough.gmane.org' \
    --to=mindcooler@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).